Project Analysis¶
Single-file analysis is useful for quick checks, but real insights come from analyzing entire projects — where dependency patterns, cross-file violations, and aggregate metrics reveal the true health of a codebase.
Running a project report¶
This scans all supported files in the directory (recursively), runs the detection pipeline for each language, and produces:
- Per-file violation tables — grouped by language
- Severity breakdown — how many violations at each level
- Project summary — total violations, top offenders, and dominant issue categories
Export options¶
CI integration¶
--quietsuppresses Rich panels and banners — clean output for CI logs- Exit code
1if violations exceed the configuredseverity_threshold - Attach
report.jsonas a build artifact for review
Including prompts in reports¶
Adds remediation prompts inline with each violation — useful for review-ready documents.
Language filtering¶
Analyze only files matching a specific language. Useful for focused reviews or when only one language is configured.
Perspective-filtered reports¶
The report command supports the same public perspectives as the rest of the runtime:
all— full rule-first result with every surfaced violationzen— rule-level result without dogma-analysis payloadsdogma— dogma-focused result with universal dogma analysis preservedtesting— violations linked to the detected testing family for matching test filesprojection— violations linked to an explicit projection-family target supplied with--as
zen reports tests --perspective testing --out testing-only.md
zen reports src/frontend --language react --perspective projection --as nextjs
Dogma perspective is available
--perspective dogma is now runnable. It keeps universal dogma analysis
attached and filters the projected result down to dogma-relevant
violations.
What project analysis reveals¶
Unlike single-file linting, project-level analysis can detect:
- Cross-file dependency patterns (Python only, with AST analysis)
- Aggregate complexity trends — which modules are the most complex
- Systemic issues — patterns that repeat across many files
- Coverage gaps — files or directories with no analysis results
Perspective filtering is especially useful once a repository spans many languages and framework analyzers: you can keep one broad baseline report for the whole worktree, then generate narrower testing or projection views for the subsets that matter to a given rollout.
MCP + CLI remediation loop¶
- Run
zen reports path/to/project --export-json report.jsonto create a baseline artifact. - In your MCP client, call
generate_agent_tasksfor the project path (optionally with amin_severityfilter) so the agent can focus on top offenders. - Apply fixes in focused batches (high severity first), then re-run
zen reports. - Track score movement over time using the exported JSON in CI artifacts.
See Also¶
- CLI Reference — Full
zen reportsflag reference - Configuration — Set
severity_thresholdfor CI gates - Prompt Generation — Generate fix instructions from reports