@fro.bot/systematic 2.2.0 → 2.3.0
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.
- package/agents/document-review/adversarial-document-reviewer.md +87 -0
- package/agents/review/adversarial-reviewer.md +107 -0
- package/agents/review/cli-agent-readiness-reviewer.md +443 -0
- package/agents/review/cli-readiness-reviewer.md +69 -0
- package/agents/review/previous-comments-reviewer.md +64 -0
- package/agents/review/project-standards-reviewer.md +80 -0
- package/package.json +1 -1
- package/skills/ce-compound/assets/resolution-template.md +90 -0
- package/skills/ce-compound/references/schema.yaml +222 -0
- package/skills/ce-compound/references/yaml-schema.md +87 -0
- package/skills/ce-compound-refresh/assets/resolution-template.md +90 -0
- package/skills/ce-compound-refresh/references/schema.yaml +222 -0
- package/skills/ce-compound-refresh/references/yaml-schema.md +87 -0
- package/skills/{ce-review-beta → ce-review}/references/findings-schema.json +8 -7
- package/skills/ce-review/references/persona-catalog.md +67 -0
- package/skills/ce-review/references/resolve-base.sh +94 -0
- package/skills/{ce-review-beta → ce-review}/references/review-output-template.md +36 -3
- package/skills/ce-review/references/subagent-template.md +84 -0
- package/skills/claude-permissions-optimizer/scripts/extract-commands.mjs +2 -2
- package/skills/claude-permissions-optimizer/scripts/normalize.mjs +8 -8
- package/skills/document-review/references/findings-schema.json +109 -0
- package/skills/document-review/references/review-output-template.md +89 -0
- package/skills/document-review/references/subagent-template.md +57 -0
- package/skills/git-clean-gone-branches/SKILL.md +63 -0
- package/skills/git-clean-gone-branches/scripts/clean-gone +48 -0
- package/skills/git-commit/SKILL.md +103 -0
- package/skills/git-commit-push-pr/SKILL.md +419 -0
- package/skills/onboarding/SKILL.md +407 -0
- package/skills/onboarding/scripts/inventory.mjs +1043 -0
- package/skills/resolve-pr-feedback/SKILL.md +374 -0
- package/skills/resolve-pr-feedback/scripts/get-pr-comments +104 -0
- package/skills/resolve-pr-feedback/scripts/get-thread-for-comment +58 -0
- package/skills/resolve-pr-feedback/scripts/reply-to-pr-thread +33 -0
- package/skills/{resolve-pr-parallel → resolve-pr-feedback}/scripts/resolve-pr-thread +0 -0
- package/skills/todo-create/SKILL.md +109 -0
- package/skills/todo-resolve/SKILL.md +68 -0
- package/skills/todo-triage/SKILL.md +70 -0
- package/skills/ce-review-beta/SKILL.md +0 -506
- package/skills/ce-review-beta/references/persona-catalog.md +0 -50
- package/skills/ce-review-beta/references/subagent-template.md +0 -56
- package/skills/file-todos/SKILL.md +0 -231
- package/skills/resolve-pr-parallel/SKILL.md +0 -96
- package/skills/resolve-pr-parallel/scripts/get-pr-comments +0 -68
- package/skills/resolve-todo-parallel/SKILL.md +0 -68
- package/skills/triage/SKILL.md +0 -312
- package/skills/workflows-brainstorm/SKILL.md +0 -11
- package/skills/workflows-compound/SKILL.md +0 -10
- package/skills/workflows-plan/SKILL.md +0 -10
- package/skills/workflows-review/SKILL.md +0 -10
- package/skills/workflows-work/SKILL.md +0 -10
- /package/skills/{ce-review-beta → ce-review}/references/diff-scope.md +0 -0
- /package/skills/{file-todos → todo-create}/assets/todo-template.md +0 -0
|
@@ -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 |
|
|
@@ -93,7 +93,7 @@ function matchGlob(pattern, command) {
|
|
|
93
93
|
if (normalized.endsWith(' *')) {
|
|
94
94
|
const base = normalized.slice(0, -2)
|
|
95
95
|
const escaped = base.replace(/[.+^${}()|[\]\\]/g, '\\$&')
|
|
96
|
-
regexStr =
|
|
96
|
+
regexStr = '^' + escaped + '($| .*)'
|
|
97
97
|
} else {
|
|
98
98
|
regexStr =
|
|
99
99
|
'^' +
|
|
@@ -530,7 +530,7 @@ for (const [command, data] of commands) {
|
|
|
530
530
|
continue
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
const pattern =
|
|
533
|
+
const pattern = 'Bash(' + normalize(command) + ')'
|
|
534
534
|
const { tier, reason } = classify(command)
|
|
535
535
|
|
|
536
536
|
const existing = patternGroups.get(pattern)
|
|
@@ -47,20 +47,20 @@ export function normalize(command) {
|
|
|
47
47
|
|
|
48
48
|
// Handle pnpm --filter <pkg> <subcommand> specially
|
|
49
49
|
const pnpmFilter = command.match(/^pnpm\s+--filter\s+\S+\s+(\S+)/)
|
|
50
|
-
if (pnpmFilter) return
|
|
50
|
+
if (pnpmFilter) return 'pnpm --filter * ' + pnpmFilter[1] + ' *'
|
|
51
51
|
|
|
52
52
|
// Handle sed specially -- preserve the mode flag to keep safe patterns narrow.
|
|
53
53
|
// sed -i (in-place) is destructive; sed -n, sed -e, bare sed are read-only.
|
|
54
54
|
if (/^sed\s/.test(command)) {
|
|
55
55
|
if (/\s-i\b/.test(command)) return 'sed -i *'
|
|
56
56
|
const sedFlag = command.match(/^sed\s+(-[a-zA-Z])\s/)
|
|
57
|
-
return sedFlag ?
|
|
57
|
+
return sedFlag ? 'sed ' + sedFlag[1] + ' *' : 'sed *'
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Handle ast-grep specially -- preserve --rewrite flag.
|
|
61
61
|
if (/^(ast-grep|sg)\s/.test(command)) {
|
|
62
62
|
const base = command.startsWith('sg') ? 'sg' : 'ast-grep'
|
|
63
|
-
return /\s--rewrite\b/.test(command) ?
|
|
63
|
+
return /\s--rewrite\b/.test(command) ? base + ' --rewrite *' : base + ' *'
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// Handle find specially -- preserve key action flags.
|
|
@@ -70,12 +70,12 @@ export function normalize(command) {
|
|
|
70
70
|
if (/\s-exec\s/.test(command)) return 'find -exec *'
|
|
71
71
|
// Extract the first predicate flag for a narrower safe pattern
|
|
72
72
|
const findFlag = command.match(/\s(-(?:name|type|path|iname))\s/)
|
|
73
|
-
return findFlag ?
|
|
73
|
+
return findFlag ? 'find ' + findFlag[1] + ' *' : 'find *'
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// Handle git -C <dir> <subcommand> -- strip the -C <dir> and normalize the git subcommand
|
|
77
77
|
const gitC = command.match(/^git\s+-C\s+\S+\s+(.+)$/)
|
|
78
|
-
if (gitC) return normalize(
|
|
78
|
+
if (gitC) return normalize('git ' + gitC[1])
|
|
79
79
|
|
|
80
80
|
// Split on compound operators -- normalize the first command only
|
|
81
81
|
const compoundMatch = command.match(/^(.+?)\s*(&&|\|\||;)\s*(.+)$/)
|
|
@@ -123,7 +123,7 @@ export function normalize(command) {
|
|
|
123
123
|
let argStart = 1
|
|
124
124
|
|
|
125
125
|
if (multiWordBases.includes(base) && parts.length > 1) {
|
|
126
|
-
prefix =
|
|
126
|
+
prefix = base + ' ' + parts[1]
|
|
127
127
|
argStart = 2
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -141,11 +141,11 @@ export function normalize(command) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
const flagStr =
|
|
144
|
-
preservedFlags.length > 0 ?
|
|
144
|
+
preservedFlags.length > 0 ? ' ' + preservedFlags.join(' ') : ''
|
|
145
145
|
const hasVaryingArgs = parts.length > argStart + preservedFlags.length
|
|
146
146
|
|
|
147
147
|
if (hasVaryingArgs) {
|
|
148
|
-
return
|
|
148
|
+
return prefix + flagStr + ' *'
|
|
149
149
|
}
|
|
150
150
|
return prefix + flagStr
|
|
151
151
|
}
|
|
@@ -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 |
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-clean-gone-branches
|
|
3
|
+
description: Clean up local branches whose remote tracking branch is gone. Use when the user says "clean up branches", "delete gone branches", "prune local branches", "clean gone", or wants to remove stale local branches that no longer exist on the remote. Also handles removing associated worktrees for branches that have them.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Clean Gone Branches
|
|
7
|
+
|
|
8
|
+
Delete local branches whose remote tracking branch has been deleted, including any associated worktrees.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
### Step 1: Discover gone branches
|
|
13
|
+
|
|
14
|
+
Run the discovery script to fetch the latest remote state and identify gone branches:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bash scripts/clean-gone
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
[scripts/clean-gone](./scripts/clean-gone)
|
|
21
|
+
|
|
22
|
+
The script runs `git fetch --prune` first, then parses `git branch -vv` for branches marked `: gone]`.
|
|
23
|
+
|
|
24
|
+
If the script outputs `__NONE__`, report that no stale branches were found and stop.
|
|
25
|
+
|
|
26
|
+
### Step 2: Present branches and ask for confirmation
|
|
27
|
+
|
|
28
|
+
Show the user the list of branches that will be deleted. Format as a simple list:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
These local branches have been deleted from the remote:
|
|
32
|
+
|
|
33
|
+
- feature/old-thing
|
|
34
|
+
- bugfix/resolved-issue
|
|
35
|
+
- experiment/abandoned
|
|
36
|
+
|
|
37
|
+
Delete all of them? (y/n)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Wait for the user's answer using the platform's question tool (e.g., `question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the list and wait for the user's reply before proceeding.
|
|
41
|
+
|
|
42
|
+
This is a yes-or-no decision on the entire list -- do not offer multi-selection or per-branch choices.
|
|
43
|
+
|
|
44
|
+
### Step 3: Delete confirmed branches
|
|
45
|
+
|
|
46
|
+
If the user confirms, delete each branch. For each branch:
|
|
47
|
+
|
|
48
|
+
1. Check if it has an associated worktree (`git worktree list | grep "\\[$branch\\]"`)
|
|
49
|
+
2. If a worktree exists and is not the main repo root, remove it first: `git worktree remove --force "$worktree_path"`
|
|
50
|
+
3. Delete the branch: `git branch -D "$branch"`
|
|
51
|
+
|
|
52
|
+
Report results as you go:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Removed worktree: .worktrees/feature/old-thing
|
|
56
|
+
Deleted branch: feature/old-thing
|
|
57
|
+
Deleted branch: bugfix/resolved-issue
|
|
58
|
+
Deleted branch: experiment/abandoned
|
|
59
|
+
|
|
60
|
+
Cleaned up 3 branches.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If the user declines, acknowledge and stop without deleting anything.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# clean-gone: List local branches whose remote tracking branch is gone.
|
|
3
|
+
# Outputs one branch name per line, or nothing if none found.
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Ensure we have current remote state
|
|
8
|
+
git fetch --prune 2>/dev/null
|
|
9
|
+
|
|
10
|
+
# Find branches marked [gone] in tracking info.
|
|
11
|
+
# `git branch -vv` output format:
|
|
12
|
+
# * main abc1234 [origin/main] commit msg
|
|
13
|
+
# + feature-x def5678 [origin/feature-x: gone] commit msg
|
|
14
|
+
# old-branch 789abcd [origin/old-branch: gone] commit msg
|
|
15
|
+
#
|
|
16
|
+
# The leading column can be: ' ' (normal), '*' (current), '+' (worktree).
|
|
17
|
+
# We match lines containing ": gone]" to find branches whose remote is deleted.
|
|
18
|
+
|
|
19
|
+
gone_branches=()
|
|
20
|
+
|
|
21
|
+
while IFS= read -r line; do
|
|
22
|
+
# Skip the currently checked-out branch (marked with '*').
|
|
23
|
+
# git branch -D cannot delete the active branch, and attempting it
|
|
24
|
+
# would halt cleanup before other stale branches are processed.
|
|
25
|
+
if [[ "$line" =~ ^\* ]]; then
|
|
26
|
+
continue
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Strip the leading marker character(s) and whitespace
|
|
30
|
+
# The branch name is the first non-whitespace token after the marker
|
|
31
|
+
branch_name=$(echo "$line" | sed 's/^[+* ]*//' | awk '{print $1}')
|
|
32
|
+
|
|
33
|
+
# Validate: skip empty, skip if it looks like a hash or flag, skip HEAD
|
|
34
|
+
if [[ -z "$branch_name" ]] || [[ "$branch_name" =~ ^[0-9a-f]{7,}$ ]] || [[ "$branch_name" == "HEAD" ]]; then
|
|
35
|
+
continue
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
gone_branches+=("$branch_name")
|
|
39
|
+
done < <(git branch -vv 2>/dev/null | grep ': gone]')
|
|
40
|
+
|
|
41
|
+
if [[ ${#gone_branches[@]} -eq 0 ]]; then
|
|
42
|
+
echo "__NONE__"
|
|
43
|
+
exit 0
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
for branch in "${gone_branches[@]}"; do
|
|
47
|
+
echo "$branch"
|
|
48
|
+
done
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-commit
|
|
3
|
+
description: Create a git commit with a clear, value-communicating message. Use when the user says "commit", "commit this", "save my changes", "create a commit", or wants to commit staged or unstaged work. Produces well-structured commit messages that follow repo conventions when they exist, and defaults to conventional commit format otherwise.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Commit
|
|
7
|
+
|
|
8
|
+
Create a single, well-crafted git commit from the current working tree changes.
|
|
9
|
+
|
|
10
|
+
## Context
|
|
11
|
+
|
|
12
|
+
**If you are not OpenCode**, skip to the "Context fallback" section below and run the command there to gather context.
|
|
13
|
+
|
|
14
|
+
**If you are OpenCode**, the five labeled sections below (Git status, Working tree diff, Current branch, Recent commits, Remote default branch) contain pre-populated data. Use them directly throughout this skill -- do not re-run these commands.
|
|
15
|
+
|
|
16
|
+
**Git status:**
|
|
17
|
+
!`git status`
|
|
18
|
+
|
|
19
|
+
**Working tree diff:**
|
|
20
|
+
!`git diff HEAD`
|
|
21
|
+
|
|
22
|
+
**Current branch:**
|
|
23
|
+
!`git branch --show-current`
|
|
24
|
+
|
|
25
|
+
**Recent commits:**
|
|
26
|
+
!`git log --oneline -10`
|
|
27
|
+
|
|
28
|
+
**Remote default branch:**
|
|
29
|
+
!`git rev-parse --abbrev-ref origin/HEAD 2>/dev/null || echo '__DEFAULT_BRANCH_UNRESOLVED__'`
|
|
30
|
+
|
|
31
|
+
### Context fallback
|
|
32
|
+
|
|
33
|
+
**If you are OpenCode, skip this section — the data above is already available.**
|
|
34
|
+
|
|
35
|
+
Run this single command to gather all context:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
printf '=== STATUS ===\n'; git status; printf '\n=== DIFF ===\n'; git diff HEAD; printf '\n=== BRANCH ===\n'; git branch --show-current; printf '\n=== LOG ===\n'; git log --oneline -10; printf '\n=== DEFAULT_BRANCH ===\n'; git rev-parse --abbrev-ref origin/HEAD 2>/dev/null || echo '__DEFAULT_BRANCH_UNRESOLVED__'
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Workflow
|
|
44
|
+
|
|
45
|
+
### Step 1: Gather context
|
|
46
|
+
|
|
47
|
+
Use the context above (git status, working tree diff, current branch, recent commits, remote default branch). All data needed for this step is already available -- do not re-run those commands.
|
|
48
|
+
|
|
49
|
+
The remote default branch value returns something like `origin/main`. Strip the `origin/` prefix to get the branch name. If it returned `__DEFAULT_BRANCH_UNRESOLVED__` or a bare `HEAD`, try:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
If both fail, fall back to `main`.
|
|
56
|
+
|
|
57
|
+
If the git status from the context above shows a clean working tree (no staged, modified, or untracked files), report that there is nothing to commit and stop.
|
|
58
|
+
|
|
59
|
+
If the current branch from the context above is empty, the repository is in detached HEAD state. Explain that a branch is required before committing if the user wants this work attached to a branch. Ask whether to create a feature branch now. Use the platform's blocking question tool (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the options and wait for the user's reply before proceeding.
|
|
60
|
+
|
|
61
|
+
- If the user chooses to create a branch, derive the name from the change content, create it with `git checkout -b <branch-name>`, then run `git branch --show-current` again and use that result as the current branch name for the rest of the workflow.
|
|
62
|
+
- If the user declines, continue with the detached HEAD commit.
|
|
63
|
+
|
|
64
|
+
### Step 2: Determine commit message convention
|
|
65
|
+
|
|
66
|
+
Follow this priority order:
|
|
67
|
+
|
|
68
|
+
1. **Repo conventions already in context** -- If project instructions (AGENTS.md, AGENTS.md, or similar) are already loaded and specify commit message conventions, follow those. Do not re-read these files; they are loaded at session start.
|
|
69
|
+
2. **Recent commit history** -- If no explicit convention is documented, examine the 10 most recent commits from Step 1. If a clear pattern emerges (e.g., conventional commits, ticket prefixes, emoji prefixes), match that pattern.
|
|
70
|
+
3. **Default: conventional commits** -- If neither source provides a pattern, use conventional commit format: `type(scope): description` where type is one of `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `ci`, `style`, `build`.
|
|
71
|
+
|
|
72
|
+
### Step 3: Consider logical commits
|
|
73
|
+
|
|
74
|
+
Before staging everything together, scan the changed files for naturally distinct concerns. If modified files clearly group into separate logical changes (e.g., a refactor in one directory and a new feature in another, or test files for a different change than source files), create separate commits for each group.
|
|
75
|
+
|
|
76
|
+
Keep this lightweight:
|
|
77
|
+
- Group at the **file level only** -- do not use `git add -p` or try to split hunks within a file.
|
|
78
|
+
- If the separation is obvious (different features, unrelated fixes), split. If it's ambiguous, one commit is fine.
|
|
79
|
+
- Two or three logical commits is the sweet spot. Do not over-slice into many tiny commits.
|
|
80
|
+
|
|
81
|
+
### Step 4: Stage and commit
|
|
82
|
+
|
|
83
|
+
If the current branch from the context above is `main`, `master`, or the resolved default branch from Step 1, warn the user and ask whether to continue committing here or create a feature branch first. Use the platform's blocking question tool (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the options and wait for the user's reply before proceeding. If the user chooses to create a branch, derive the name from the change content, create it with `git checkout -b <branch-name>`, then continue.
|
|
84
|
+
|
|
85
|
+
Write the commit message:
|
|
86
|
+
- **Subject line**: Concise, imperative mood, focused on *why* not *what*. Follow the convention determined in Step 2.
|
|
87
|
+
- **Body** (when needed): Add a body separated by a blank line for non-trivial changes. Explain motivation, trade-offs, or anything a future reader would need. Omit the body for obvious single-purpose changes.
|
|
88
|
+
|
|
89
|
+
For each commit group, stage and commit in a single call. Prefer staging specific files by name over `git add -A` or `git add .` to avoid accidentally including sensitive files (.env, credentials) or unrelated changes. Use a heredoc to preserve formatting:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git add file1 file2 file3 && git commit -m "$(cat <<'EOF'
|
|
93
|
+
type(scope): subject line here
|
|
94
|
+
|
|
95
|
+
Optional body explaining why this change was made,
|
|
96
|
+
not just what changed.
|
|
97
|
+
EOF
|
|
98
|
+
)"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Step 5: Confirm
|
|
102
|
+
|
|
103
|
+
Run `git status` after the commit to verify success. Report the commit hash(es) and subject line(s).
|