feat: add conductor audit command for architecture documentation #102
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Audit command
Adds a new /conductor:audit command that analyzes the current codebase. It generates or updates conductor/architecture.md as a persistent context artifact alongside the existing product, tech-stack, and workflow definitions. The audit covers directory layout, module boundaries, data flow, API surfaces, security boundaries, and architectural health. The command is re-runnable. When conductor/architecture.md already exists, a subsequent run performs a fresh analysis. It adds a “Changes Since Last Audit” section that summarizes differences. The audit also ensures the architecture document is discoverable from Conductor’s index. It does this by adding a link in conductor/index.md if one is not already present.
This PR also registers the Architecture artifact path in GEMINI.md and the setup index template (setup.toml), and documents the command in README.md.
Motivation
The existing commands cover the lifecycle of track-scoped work. setup scaffolds the project environment. newTrack generates specs and an implementation plan. implement executes planned tasks sequentially. status reports track progress. review checks completed work against guidelines. revert rolls back prior work using git history. All of these operate on tracks, these are scoped units of change. /conductor:audit adds a different axis. It analyzes the codebase itself, independent of any track. It produces a persistent architecture document.
Trade-offs
Token cost. The analysis protocol is a multi-pass sweep. It includes file discovery, structure analysis, pattern recognition, dependency tracing, data flow, API surface cataloging, security boundary mapping, and anti-pattern detection. On large codebases, this can consume a significant number of tokens in a single invocation. The flash model constraint mitigates cost per token. It does not reduce the volume of content the agent must read.
Full re-analysis on every run. Re-audits perform a complete fresh analysis, then diff against the previous document. There is no option to audit a subset of the codebase or a single module. On large projects where only one area changed, this is redundant work.
Analysis quality depends on the agent and context limits. The spec asks the agent to identify design patterns, trace request lifecycles, detect anti-patterns, and assess architectural health in a single session. On complex codebases, some sections may be shallow or inaccurate. This depends on how much of the codebase fits within the agent’s context window. The spec has no mechanism to signal low-confidence sections.
Point-in-time snapshot. The architecture document reflects the codebase at the time of the audit. There is no trigger to re-run when the codebase changes significantly. The document can go stale silently between runs.
Evidence
Audit ran on the conductor repo.
Evidence: sample output generated by
/conductor:audit(permalink): conductor/architecture.mdAs an additional validation, I ran /conductor:audit on my (C++) HTTP server repository to cover a more complex architecture then conductor itself (permalink): conductor/architecture.md
Weakpoints
Based on the evidence above, the generated document has room to improve. It could be more concise. It should also make it clearer where each feature lives in the codebase.
Overall, this feels like a reasonable starting point for Conductor’s audit capability, if this feature is in scope.