Skip to content

Repository files navigation

CodeSmellAuditor

Local-first CLI that reviews C# source against markdown governance rules using a local Ollama model. It streams the critique live and saves a timestamped markdown report.

This is an AI-assisted semantic code reviewer, not a deterministic static analyzer. It does not use Roslyn or parse C# into a syntax tree; the LLM interprets plain source text against your rule packs.

CI License: MIT

CodeSmellAuditor terminal output

Highlights

  • Single-file .cs audits against local markdown rule packs (.mdc)
  • Batch mode via WorkstationStorage/Targets/ and path-based sniff for files in place
  • Local Ollama only — source stays on your machine
  • Streaming terminal output with Spectre Status spinner until first token
  • Timestamped markdown reports under WorkstationStorage/Reports/
  • Pass/fail parsed from a Status: line in the report; sniff sets process exit codes
  • Layered Core / Cli / Tests solution with constructor injection at the composition root
  • Compact rule excerpts with character-budget validation before each audit
  • 25 xUnit tests for rule loading, prompt building, pass/fail parsing, and engine orchestration (fakes; no Ollama in CI)
  • Ubuntu CI via GitHub Actions

Architecture

Program.cs (composition root)
  -> MarkdownRuleRepository / OllamaAiOrchestrator
  -> AuditEngine
  -> CliAuditHost (batch + sniff)

Two projects plus tests: CodeSmellAuditor.Core (engine, interfaces, Ollama HTTP), CodeSmellAuditor.Cli (composition root and interactive host), CodeSmellAuditor.Core.Tests.

Details: docs/architecture.md

Stack

  • C# / .NET 10
  • Ollama local HTTP API
  • Spectre.Console (Status + streaming)
  • xUnit
  • Markdown rule packs (.mdc)

Docs

License

MIT

About

Local-first CLI that reviews C# source against markdown rule packs via Ollama, with streaming critique reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages