@fro.bot/systematic 2.1.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,148 @@
1
+ # Code Review Output Template
2
+
3
+ Use this **exact format** when presenting synthesized review findings. Findings are grouped by severity, not by reviewer.
4
+
5
+ **IMPORTANT:** Use pipe-delimited markdown tables (`| col | col |`). Do NOT use ASCII box-drawing characters.
6
+
7
+ ## Example
8
+
9
+ ```markdown
10
+ ## Code Review Results
11
+
12
+ **Scope:** merge-base with the review base branch -> working tree (14 files, 342 lines)
13
+ **Intent:** Add order export endpoint with CSV and JSON format support
14
+ **Mode:** autofix
15
+
16
+ **Reviewers:** correctness, testing, maintainability, security, api-contract
17
+ - security -- new public endpoint accepts user-provided format parameter
18
+ - api-contract -- new /api/orders/export route with response schema
19
+
20
+ ### P0 -- Critical
21
+
22
+ | # | File | Issue | Reviewer | Confidence | Route |
23
+ |---|------|-------|----------|------------|-------|
24
+ | 1 | `orders_controller.rb:42` | User-supplied ID in account lookup without ownership check | security | 0.92 | `gated_auto -> downstream-resolver` |
25
+
26
+ ### P1 -- High
27
+
28
+ | # | File | Issue | Reviewer | Confidence | Route |
29
+ |---|------|-------|----------|------------|-------|
30
+ | 2 | `export_service.rb:87` | Loads all orders into memory -- unbounded for large accounts | performance | 0.85 | `safe_auto -> review-fixer` |
31
+ | 3 | `export_service.rb:91` | No pagination -- response size grows linearly with order count | api-contract, performance | 0.80 | `manual -> downstream-resolver` |
32
+
33
+ ### P2 -- Moderate
34
+
35
+ | # | File | Issue | Reviewer | Confidence | Route |
36
+ |---|------|-------|----------|------------|-------|
37
+ | 4 | `export_service.rb:45` | Missing error handling for CSV serialization failure | correctness | 0.75 | `safe_auto -> review-fixer` |
38
+
39
+ ### P3 -- Low
40
+
41
+ | # | File | Issue | Reviewer | Confidence | Route |
42
+ |---|------|-------|----------|------------|-------|
43
+ | 5 | `export_helper.rb:12` | Format detection could use early return instead of nested conditional | maintainability | 0.70 | `advisory -> human` |
44
+
45
+ ### Applied Fixes
46
+
47
+ - `safe_auto`: Added bounded export pagination guard and CSV serialization failure test coverage in this run
48
+
49
+ ### Residual Actionable Work
50
+
51
+ | # | File | Issue | Route | Next Step |
52
+ |---|------|-------|-------|-----------|
53
+ | 1 | `orders_controller.rb:42` | Ownership check missing on export lookup | `gated_auto -> downstream-resolver` | Create residual todo and require explicit approval before behavior change |
54
+ | 2 | `export_service.rb:91` | Pagination contract needs a broader API decision | `manual -> downstream-resolver` | Create residual todo with contract and client impact details |
55
+
56
+ ### Pre-existing Issues
57
+
58
+ | # | File | Issue | Reviewer |
59
+ |---|------|-------|----------|
60
+ | 1 | `orders_controller.rb:12` | Broad rescue masking failed permission check | correctness |
61
+
62
+ ### Learnings & Past Solutions
63
+
64
+ - [Known Pattern] `docs/solutions/export-pagination.md` -- previous export pagination fix applies to this endpoint
65
+
66
+ ### Agent-Native Gaps
67
+
68
+ - New export endpoint has no CLI/agent equivalent -- agent users cannot trigger exports
69
+
70
+ ### Schema Drift Check
71
+
72
+ - Clean: schema.rb changes match the migrations in scope
73
+
74
+ ### Deployment Notes
75
+
76
+ - Pre-deploy: capture baseline row counts before enabling the export backfill
77
+ - Verify: `SELECT COUNT(*) FROM exports WHERE status IS NULL;` should stay at `0`
78
+ - Rollback: keep the old export path available until the backfill has been validated
79
+
80
+ ### Coverage
81
+
82
+ - Suppressed: 2 findings below 0.60 confidence
83
+ - Residual risks: No rate limiting on export endpoint
84
+ - Testing gaps: No test for concurrent export requests
85
+
86
+ ---
87
+
88
+ > **Verdict:** Ready with fixes
89
+ >
90
+ > **Reasoning:** 1 critical auth bypass must be fixed. The memory/pagination issues (P1) should be addressed for production safety.
91
+ >
92
+ > **Fix order:** P0 auth bypass -> P1 memory/pagination -> P2 error handling if straightforward
93
+ ```
94
+
95
+ ## Anti-patterns
96
+
97
+ Do NOT produce output like this. The following is wrong:
98
+
99
+ ```markdown
100
+ Findings
101
+
102
+ Sev: P1
103
+ File: foo.go:42
104
+ Issue: Some problem description
105
+ Reviewer(s): adversarial
106
+ Confidence: 0.85
107
+ Route: advisory -> human
108
+ ────────────────────────────────────────
109
+ Sev: P2
110
+ File: bar.go:99
111
+ Issue: Another problem
112
+ ```
113
+
114
+ This fails because: no pipe-delimited tables, no severity-grouped `###` headers, uses box-drawing horizontal rules, no numbered findings, no `## Code Review Results` title, and the verdict is not in a blockquote. Always use the table format from the example above.
115
+
116
+ ## Formatting Rules
117
+
118
+ - **Pipe-delimited markdown tables** for findings -- never ASCII box-drawing characters or per-finding horizontal-rule separators between entries (the report-level `---` before the verdict is still required)
119
+ - **Severity-grouped sections** -- `### P0 -- Critical`, `### P1 -- High`, `### P2 -- Moderate`, `### P3 -- Low`. Omit empty severity levels.
120
+ - **Always include file:line location** for code review issues
121
+ - **Reviewer column** shows which persona(s) flagged the issue. Multiple reviewers = cross-reviewer agreement.
122
+ - **Confidence column** shows the finding's confidence score
123
+ - **Route column** shows the synthesized handling decision as ``<autofix_class> -> <owner>``.
124
+ - **Header includes** scope, intent, and reviewer team with per-conditional justifications
125
+ - **Mode line** -- include `interactive`, `autofix`, `report-only`, or `headless`
126
+ - **Applied Fixes section** -- include only when a fix phase ran in this review invocation
127
+ - **Residual Actionable Work section** -- include only when unresolved actionable findings were handed off for later work
128
+ - **Pre-existing section** -- separate table, no confidence column (these are informational)
129
+ - **Learnings & Past Solutions section** -- results from learnings-researcher, with links to docs/solutions/ files
130
+ - **Agent-Native Gaps section** -- results from agent-native-reviewer. Omit if no gaps found.
131
+ - **Schema Drift Check section** -- results from schema-drift-detector. Omit if the agent did not run.
132
+ - **Deployment Notes section** -- key checklist items from deployment-verification-agent. Omit if the agent did not run.
133
+ - **Coverage section** -- suppressed count, residual risks, testing gaps, failed reviewers
134
+ - **Summary uses blockquotes** for verdict, reasoning, and fix order
135
+ - **Horizontal rule** (`---`) separates findings from verdict
136
+ - **`###` headers** for each section -- never plain text headers
137
+
138
+ ## Headless Mode Format
139
+
140
+ In `mode:headless`, replace the interactive pipe-delimited table report with a structured text envelope. The headless format is defined in the `### Headless output format` section of SKILL.md. Key differences from the interactive format:
141
+
142
+ - **No pipe-delimited tables.** Findings use `[severity][autofix_class -> owner] File: <file:line> -- <title>` line format with indented Why/Evidence/Suggested fix lines.
143
+ - **Findings grouped by autofix_class** (gated-auto, manual, advisory) instead of severity. Within each group, findings are sorted by severity.
144
+ - **Verdict in header** (top of output) instead of bottom, so programmatic callers get it first.
145
+ - **`Artifact:` line** in metadata header gives callers the path to the full run artifact.
146
+ - **`[needs-verification]` marker** on findings where `requires_verification: true`.
147
+ - **Evidence lines** included per finding.
148
+ - **Completion signal:** "Review complete" as the final line.
@@ -0,0 +1,84 @@
1
+ # Sub-agent Prompt Template
2
+
3
+ This template is used by the orchestrator to spawn each reviewer sub-agent. Variable substitution slots are filled at spawn time.
4
+
5
+ ---
6
+
7
+ ## Template
8
+
9
+ ```
10
+ You are a specialist code reviewer.
11
+
12
+ <persona>
13
+ {persona_file}
14
+ </persona>
15
+
16
+ <scope-rules>
17
+ {diff_scope_rules}
18
+ </scope-rules>
19
+
20
+ <output-contract>
21
+ Return ONLY valid JSON matching the findings schema below. No prose, no markdown, no explanation outside the JSON object.
22
+
23
+ {schema}
24
+
25
+ Confidence rubric (0.0-1.0 scale):
26
+ - 0.00-0.29: Not confident / likely false positive. Do not report.
27
+ - 0.30-0.49: Somewhat confident. Do not report -- too speculative for actionable review.
28
+ - 0.50-0.59: Moderately confident. Real but uncertain. Do not report unless P0 severity.
29
+ - 0.60-0.69: Confident enough to flag. Include only when the issue is clearly actionable.
30
+ - 0.70-0.84: Highly confident. Real and important. Report with full evidence.
31
+ - 0.85-1.00: Certain. Verifiable from the code alone. Report.
32
+
33
+ Suppress threshold: 0.60. Do not emit findings below 0.60 confidence (except P0 at 0.50+).
34
+
35
+ False-positive categories to actively suppress:
36
+ - Pre-existing issues unrelated to this diff (mark pre_existing: true for unchanged code the diff does not interact with; if the diff makes it newly relevant, it is secondary, not pre-existing)
37
+ - Pedantic style nitpicks that a linter/formatter would catch
38
+ - Code that looks wrong but is intentional (check comments, commit messages, PR description for intent)
39
+ - Issues already handled elsewhere in the codebase (check callers, guards, middleware)
40
+ - Suggestions that restate what the code already does in different words
41
+ - Generic "consider adding" advice without a concrete failure mode
42
+
43
+ Rules:
44
+ - Every finding MUST include at least one evidence item grounded in the actual code.
45
+ - Set pre_existing to true ONLY for issues in unchanged code that are unrelated to this diff. If the diff makes the issue newly relevant, it is NOT pre-existing.
46
+ - You are operationally read-only. You may use non-mutating inspection commands, including read-oriented `git` / `gh` commands, to gather evidence. Do not edit files, change branches, commit, push, create PRs, or otherwise mutate the checkout or repository state.
47
+ - Set `autofix_class` accurately -- not every finding is `advisory`. Use this decision guide:
48
+ - `safe_auto`: The fix is local and deterministic — the fixer can apply it mechanically without design judgment. Examples: extracting a duplicated helper, adding a missing nil/null check, fixing an off-by-one, adding a missing test for an untested code path, removing dead code.
49
+ - `gated_auto`: A concrete fix exists but it changes contracts, permissions, or crosses a module boundary in a way that deserves explicit approval. Examples: adding authentication to an unprotected endpoint, changing a public API response shape, switching from soft-delete to hard-delete.
50
+ - `manual`: Actionable work that requires design decisions or cross-cutting changes. Examples: redesigning a data model, choosing between two valid architectural approaches, adding pagination to an unbounded query.
51
+ - `advisory`: Report-only items that should not become code-fix work. Examples: noting a design asymmetry the PR improves but doesn't fully resolve, flagging a residual risk, deployment notes.
52
+ Do not default to `advisory` when uncertain -- if a concrete fix is obvious, classify it as `safe_auto` or `gated_auto`.
53
+ - Set `owner` to the default next actor for this finding: `review-fixer`, `downstream-resolver`, `human`, or `release`.
54
+ - Set `requires_verification` to true whenever the likely fix needs targeted tests, a focused re-review, or operational validation before it should be trusted.
55
+ - suggested_fix is optional. Only include it when the fix is obvious and correct. A bad suggestion is worse than none.
56
+ - If you find no issues, return an empty findings array. Still populate residual_risks and testing_gaps if applicable.
57
+ - **Intent verification:** Compare the code changes against the stated intent (and PR title/body when available). If the code does something the intent does not describe, or fails to do something the intent promises, flag it as a finding. Mismatches between stated intent and actual code are high-value findings.
58
+ </output-contract>
59
+
60
+ <pr-context>
61
+ {pr_metadata}
62
+ </pr-context>
63
+
64
+ <review-context>
65
+ Intent: {intent_summary}
66
+
67
+ Changed files: {file_list}
68
+
69
+ Diff:
70
+ {diff}
71
+ </review-context>
72
+ ```
73
+
74
+ ## Variable Reference
75
+
76
+ | Variable | Source | Description |
77
+ |----------|--------|-------------|
78
+ | `{persona_file}` | Agent markdown file content | The full persona definition (identity, failure modes, calibration, suppress conditions) |
79
+ | `{diff_scope_rules}` | `references/diff-scope.md` content | Primary/secondary/pre-existing tier rules |
80
+ | `{schema}` | `references/findings-schema.json` content | The JSON schema reviewers must conform to |
81
+ | `{intent_summary}` | Stage 2 output | 2-3 line description of what the change is trying to accomplish |
82
+ | `{pr_metadata}` | Stage 1 output | PR title, body, and URL when reviewing a PR. Empty string when reviewing a branch or standalone checkout |
83
+ | `{file_list}` | Stage 1 output | List of changed files from the scope step |
84
+ | `{diff}` | Stage 1 output | The actual diff content to review |
@@ -0,0 +1,109 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Document Review Findings",
4
+ "description": "Structured output schema for document review persona agents",
5
+ "type": "object",
6
+ "required": ["reviewer", "findings", "residual_risks", "deferred_questions"],
7
+ "properties": {
8
+ "reviewer": {
9
+ "type": "string",
10
+ "description": "Persona name that produced this output (e.g., 'coherence', 'feasibility', 'product-lens')"
11
+ },
12
+ "findings": {
13
+ "type": "array",
14
+ "description": "List of document review findings. Empty array if no issues found.",
15
+ "items": {
16
+ "type": "object",
17
+ "required": [
18
+ "title",
19
+ "severity",
20
+ "section",
21
+ "why_it_matters",
22
+ "finding_type",
23
+ "autofix_class",
24
+ "confidence",
25
+ "evidence"
26
+ ],
27
+ "properties": {
28
+ "title": {
29
+ "type": "string",
30
+ "description": "Short, specific issue title. 10 words or fewer.",
31
+ "maxLength": 100
32
+ },
33
+ "severity": {
34
+ "type": "string",
35
+ "enum": ["P0", "P1", "P2", "P3"],
36
+ "description": "Issue severity level"
37
+ },
38
+ "section": {
39
+ "type": "string",
40
+ "description": "Document section where the issue appears (e.g., 'Requirements Trace', 'Implementation Unit 3', 'Overview')"
41
+ },
42
+ "why_it_matters": {
43
+ "type": "string",
44
+ "description": "Impact statement -- not 'what is wrong' but 'what goes wrong if not addressed'"
45
+ },
46
+ "autofix_class": {
47
+ "type": "string",
48
+ "enum": ["auto", "present"],
49
+ "description": "How this issue should be handled. auto = one clear correct fix that can be applied silently (terminology, formatting, cross-references, completeness corrections, additions mechanically implied by other content). present = requires individual user judgment."
50
+ },
51
+ "finding_type": {
52
+ "type": "string",
53
+ "enum": ["error", "omission"],
54
+ "description": "Whether the finding is a mistake in what the document says (error) or something the document forgot to say (omission). Errors are design tensions, contradictions, or incorrect statements. Omissions are missing mechanical steps, forgotten list entries, or absent details."
55
+ },
56
+ "suggested_fix": {
57
+ "type": ["string", "null"],
58
+ "description": "Concrete fix text. Omit or null if no good fix is obvious -- a bad suggestion is worse than none."
59
+ },
60
+ "confidence": {
61
+ "type": "number",
62
+ "description": "Reviewer confidence in this finding, calibrated per persona",
63
+ "minimum": 0.0,
64
+ "maximum": 1.0
65
+ },
66
+ "evidence": {
67
+ "type": "array",
68
+ "description": "Quoted text from the document that supports this finding. At least 1 item.",
69
+ "items": { "type": "string" },
70
+ "minItems": 1
71
+ }
72
+ }
73
+ }
74
+ },
75
+ "residual_risks": {
76
+ "type": "array",
77
+ "description": "Risks the reviewer noticed but could not confirm as findings (below confidence threshold)",
78
+ "items": { "type": "string" }
79
+ },
80
+ "deferred_questions": {
81
+ "type": "array",
82
+ "description": "Questions that should be resolved in a later workflow stage (planning, implementation)",
83
+ "items": { "type": "string" }
84
+ }
85
+ },
86
+
87
+ "_meta": {
88
+ "confidence_thresholds": {
89
+ "suppress": "Below 0.50 -- do not report. Finding is speculative noise.",
90
+ "flag": "0.50-0.69 -- include only when the persona's calibration says the issue is actionable at that confidence.",
91
+ "report": "0.70+ -- report with full confidence."
92
+ },
93
+ "severity_definitions": {
94
+ "P0": "Contradictions or gaps that would cause building the wrong thing. Must fix before proceeding.",
95
+ "P1": "Significant gap likely hit during planning or implementation. Should fix.",
96
+ "P2": "Moderate issue with meaningful downside. Fix if straightforward.",
97
+ "P3": "Minor improvement. User's discretion."
98
+ },
99
+ "autofix_classes": {
100
+ "_principle": "Autofix class is independent of severity. A P1 finding can be auto if the fix is obvious. The test: is there one clear correct fix, or does resolving this require judgment?",
101
+ "auto": "One clear correct fix -- applied silently. Includes both internal reconciliation (summary/detail mismatches, wrong counts, stale cross-references, terminology drift) and additions mechanically implied by other content (missing steps, unstated thresholds, completeness gaps where the correct content is obvious). Must include suggested_fix.",
102
+ "present": "Requires individual user judgment -- strategic questions, design tradeoffs, or findings where reasonable people could disagree on the right action."
103
+ },
104
+ "finding_types": {
105
+ "error": "Something the document says that is wrong -- contradictions, incorrect statements, design tensions, incoherent tradeoffs. These are mistakes in what exists.",
106
+ "omission": "Something the document forgot to say -- missing mechanical steps, absent list entries, undefined thresholds, forgotten cross-references. These are gaps in completeness."
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,89 @@
1
+ # Document Review Output Template
2
+
3
+ Use this **exact format** when presenting synthesized review findings. Findings are grouped by severity, not by reviewer.
4
+
5
+ **IMPORTANT:** Use pipe-delimited markdown tables (`| col | col |`). Do NOT use ASCII box-drawing characters.
6
+
7
+ ## Example
8
+
9
+ ```markdown
10
+ ## Document Review Results
11
+
12
+ **Document:** docs/plans/2026-03-15-feat-user-auth-plan.md
13
+ **Type:** plan
14
+ **Reviewers:** coherence, feasibility, security-lens, scope-guardian
15
+ - security-lens -- plan adds public API endpoint with auth flow
16
+ - scope-guardian -- plan has 15 requirements across 3 priority levels
17
+
18
+ Applied 5 auto-fixes. 4 findings to consider (2 errors, 2 omissions).
19
+
20
+ ### Auto-fixes Applied
21
+
22
+ - Standardized "pipeline"/"workflow" terminology to "pipeline" throughout (coherence)
23
+ - Fixed cross-reference: Section 4 referenced "Section 3.2" which is actually "Section 3.1" (coherence)
24
+ - Updated unit count from "6 units" to "7 units" to match listed units (coherence)
25
+ - Added "update API rate-limit config" step to Unit 4 -- implied by Unit 3's rate-limit introduction (feasibility)
26
+ - Added auth token refresh to test scenarios -- required by Unit 2's token expiry handling (security-lens)
27
+
28
+ ### P0 -- Must Fix
29
+
30
+ #### Errors
31
+
32
+ | # | Section | Issue | Reviewer | Confidence |
33
+ |---|---------|-------|----------|------------|
34
+ | 1 | Requirements Trace | Goal states "offline support" but technical approach assumes persistent connectivity | coherence | 0.92 |
35
+
36
+ ### P1 -- Should Fix
37
+
38
+ #### Errors
39
+
40
+ | # | Section | Issue | Reviewer | Confidence |
41
+ |---|---------|-------|----------|------------|
42
+ | 2 | Scope Boundaries | 8 of 12 units build admin infrastructure; only 2 touch stated goal | scope-guardian | 0.80 |
43
+
44
+ #### Omissions
45
+
46
+ | # | Section | Issue | Reviewer | Confidence |
47
+ |---|---------|-------|----------|------------|
48
+ | 3 | Implementation Unit 3 | Plan proposes custom auth but does not mention existing Devise setup or migration path | feasibility | 0.85 |
49
+
50
+ ### P2 -- Consider Fixing
51
+
52
+ #### Omissions
53
+
54
+ | # | Section | Issue | Reviewer | Confidence |
55
+ |---|---------|-------|----------|------------|
56
+ | 4 | API Design | Public webhook endpoint has no rate limiting mentioned | security-lens | 0.75 |
57
+
58
+ ### Residual Concerns
59
+
60
+ | # | Concern | Source |
61
+ |---|---------|--------|
62
+ | 1 | Migration rollback strategy not addressed for Phase 2 data changes | feasibility |
63
+
64
+ ### Deferred Questions
65
+
66
+ | # | Question | Source |
67
+ |---|---------|--------|
68
+ | 1 | Should the API use versioned endpoints from launch? | feasibility, security-lens |
69
+
70
+ ### Coverage
71
+
72
+ | Persona | Status | Findings | Auto | Present | Residual |
73
+ |---------|--------|----------|------|---------|----------|
74
+ | coherence | completed | 4 | 3 | 1 | 0 |
75
+ | feasibility | completed | 2 | 1 | 1 | 1 |
76
+ | security-lens | completed | 2 | 1 | 1 | 0 |
77
+ | scope-guardian | completed | 1 | 0 | 1 | 0 |
78
+ | product-lens | not activated | -- | -- | -- | -- |
79
+ | design-lens | not activated | -- | -- | -- | -- |
80
+ ```
81
+
82
+ ## Section Rules
83
+
84
+ - **Summary line**: Always present after the reviewer list. Format: "Applied N auto-fixes. K findings to consider (X errors, Y omissions)." Omit any zero clause.
85
+ - **Auto-fixes Applied**: List all fixes that were applied automatically (auto class). Include enough detail per fix to convey the substance -- especially for fixes that add content or touch document meaning. Omit section if none.
86
+ - **P0-P3 sections**: Only include sections that have findings. Omit empty severity levels. Within each severity, separate into **Errors** and **Omissions** sub-headers. Omit a sub-header if that severity has none of that type.
87
+ - **Residual Concerns**: Findings below confidence threshold that were promoted by cross-persona corroboration, plus unpromoted residual risks. Omit if none.
88
+ - **Deferred Questions**: Questions for later workflow stages. Omit if none.
89
+ - **Coverage**: Always include. All counts are **post-synthesis**. **Findings** must equal Auto + Present exactly -- if deduplication merged a finding across personas, attribute it to the persona with the highest confidence and reduce the other persona's count. **Residual** = count of `residual_risks` from this persona's raw output (not the promoted subset in the Residual Concerns section).
@@ -0,0 +1,57 @@
1
+ # Document Review Sub-agent Prompt Template
2
+
3
+ This template is used by the document-review orchestrator to spawn each reviewer sub-agent. Variable substitution slots are filled at dispatch time.
4
+
5
+ ---
6
+
7
+ ## Template
8
+
9
+ ```
10
+ You are a specialist document reviewer.
11
+
12
+ <persona>
13
+ {persona_file}
14
+ </persona>
15
+
16
+ <output-contract>
17
+ Return ONLY valid JSON matching the findings schema below. No prose, no markdown, no explanation outside the JSON object.
18
+
19
+ {schema}
20
+
21
+ Rules:
22
+ - Suppress any finding below your stated confidence floor (see your Confidence calibration section).
23
+ - Every finding MUST include at least one evidence item -- a direct quote from the document.
24
+ - You are operationally read-only. Analyze the document and produce findings. Do not edit the document, create files, or make changes. You may use non-mutating tools (file reads, glob, grep, git log) to gather context about the codebase when evaluating feasibility or existing patterns.
25
+ - Set `finding_type` for every finding:
26
+ - `error`: Something the document says that is wrong -- contradictions, incorrect statements, design tensions, incoherent tradeoffs.
27
+ - `omission`: Something the document forgot to say -- missing mechanical steps, absent list entries, undefined thresholds, forgotten cross-references.
28
+ - Set `autofix_class` based on whether there is one clear correct fix, not on severity. A P1 finding can be `auto` if the fix is obvious:
29
+ - `auto`: One clear correct fix. Applied silently without asking. The test: is there only one reasonable way to resolve this? If yes, it is auto. Two categories:
30
+ - Internal reconciliation: one part of the document is authoritative over another -- reconcile toward the authority. Examples: summary/detail mismatches, wrong counts, missing list entries derivable from elsewhere, stale cross-references, terminology drift, prose/diagram contradictions where prose is authoritative.
31
+ - Implied additions: the correct content is mechanically obvious from the document's own context. Examples: adding a missing implementation step implied by other content, defining a threshold implied but never stated, completeness gaps where what to add is clear.
32
+ Always include `suggested_fix` for auto findings.
33
+ NOT auto (the gap is clear but more than one reasonable fix exists): choosing an implementation approach when the document states a need without constraining how (e.g., "support offline mode" could mean service workers, local-first database, or queue-and-sync -- there is no single obvious answer), changing scope or priority where the author may have weighed tradeoffs the reviewer can't see (e.g., promoting a P2 to P1, or cutting a feature the document intentionally keeps at a lower tier).
34
+ - `present`: Requires judgment -- strategic questions, tradeoffs, design tensions where reasonable people could disagree, findings where the right action is unclear.
35
+ - `suggested_fix` is required for `auto` findings. For `present` findings, `suggested_fix` is optional -- include it only when the fix is obvious, and frame as a question when the right action is unclear.
36
+ - If you find no issues, return an empty findings array. Still populate residual_risks and deferred_questions if applicable.
37
+ - Use your suppress conditions. Do not flag issues that belong to other personas.
38
+ </output-contract>
39
+
40
+ <review-context>
41
+ Document type: {document_type}
42
+ Document path: {document_path}
43
+
44
+ Document content:
45
+ {document_content}
46
+ </review-context>
47
+ ```
48
+
49
+ ## Variable Reference
50
+
51
+ | Variable | Source | Description |
52
+ |----------|--------|-------------|
53
+ | `{persona_file}` | Agent markdown file content | The full persona definition (identity, analysis protocol, calibration, suppress conditions) |
54
+ | `{schema}` | `references/findings-schema.json` content | The JSON schema reviewers must conform to |
55
+ | `{document_type}` | Orchestrator classification | Either "requirements" or "plan" |
56
+ | `{document_path}` | Skill input | Path to the document being reviewed |
57
+ | `{document_content}` | File read | The full document text |