opencodekit 0.21.9 → 0.22.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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +116 -499
- package/dist/template/.opencode/README.md +1 -1
- package/dist/template/.opencode/agent/build.md +56 -396
- package/dist/template/.opencode/agent/explore.md +15 -16
- package/dist/template/.opencode/agent/general.md +2 -2
- package/dist/template/.opencode/agent/plan.md +3 -3
- package/dist/template/.opencode/agent/review.md +2 -3
- package/dist/template/.opencode/agent/scout.md +34 -16
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/command/clarify.md +48 -0
- package/dist/template/.opencode/command/commit.md +53 -0
- package/dist/template/.opencode/command/design.md +4 -4
- package/dist/template/.opencode/command/fix.md +56 -0
- package/dist/template/.opencode/command/improve-architecture.md +55 -0
- package/dist/template/.opencode/command/init.md +88 -68
- package/dist/template/.opencode/command/refactor.md +66 -0
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/ship.md +1 -1
- package/dist/template/.opencode/command/test.md +66 -0
- package/dist/template/.opencode/dcp.jsonc +29 -46
- package/dist/template/.opencode/memory/README.md +3 -5
- package/dist/template/.opencode/memory/_templates/adr.md +45 -0
- package/dist/template/.opencode/memory/project/gotchas.md +1 -1
- package/dist/template/.opencode/memory/project/user.md +1 -2
- package/dist/template/.opencode/memory/session-context.md +1 -1
- package/dist/template/.opencode/opencode.json +10 -332
- package/dist/template/.opencode/plugin/README.md +1 -1
- package/dist/template/.opencode/plugin/guard.ts +62 -0
- package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
- package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
- package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
- package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
- package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
- package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
- package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
- package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
- package/dist/template/.opencode/plugin/memory.ts +7 -17
- package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
- package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
- package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
- package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
- package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
- package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
- package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
- package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
- package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
- package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
- package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
- package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
- package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
- package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
- package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
- package/dist/template/.opencode/tool/context7.ts +1 -1
- package/dist/template/.opencode/tool/grepsearch.ts +1 -1
- package/package.json +1 -1
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
- package/dist/template/.opencode/agent/painter.md +0 -83
- package/dist/template/.opencode/command/compound.md +0 -240
- package/dist/template/.opencode/command/curate.md +0 -299
- package/dist/template/.opencode/command/handoff.md +0 -149
- package/dist/template/.opencode/command/health.md +0 -356
- package/dist/template/.opencode/command/init-context.md +0 -297
- package/dist/template/.opencode/command/init-user.md +0 -125
- package/dist/template/.opencode/command/iterate.md +0 -200
- package/dist/template/.opencode/command/lfg.md +0 -173
- package/dist/template/.opencode/command/resume.md +0 -78
- package/dist/template/.opencode/command/status.md +0 -126
- package/dist/template/.opencode/command/ui-slop-check.md +0 -169
- package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
- package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
- package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
- package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -253
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
- package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
- package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
- package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
- package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
- package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
- package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
- package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
- package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
- package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
- package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
- package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
- package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
- package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
- package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
- package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
- package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
- package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
- package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
- package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
- package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
- package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
- package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
- package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
- package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
- package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
- package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
- package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
- package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
- package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
- package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
- package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
- package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
- package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
- package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
- package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
- package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
- package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
- package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
- package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
- package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
- package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
- /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: reflection-checkpoints
|
|
3
|
-
description: >
|
|
4
|
-
Use when executing long-running commands (/ship, /lfg) to add self-assessment
|
|
5
|
-
checkpoints that detect scope drift, stalled progress, and premature completion claims.
|
|
6
|
-
Inspired by ByteRover's reflection prompt architecture.
|
|
7
|
-
version: 1.0.0
|
|
8
|
-
tags: [workflow, quality, autonomous]
|
|
9
|
-
dependencies: [verification-before-completion]
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Reflection Checkpoints
|
|
13
|
-
|
|
14
|
-
## When to Use
|
|
15
|
-
|
|
16
|
-
- During `/ship` execution after completing 50%+ of tasks
|
|
17
|
-
- During `/lfg` at each phase transition (Plan→Work→Review→Compound)
|
|
18
|
-
- When a task takes significantly longer than estimated
|
|
19
|
-
- When context usage exceeds 60% of budget
|
|
20
|
-
|
|
21
|
-
## When NOT to Use
|
|
22
|
-
|
|
23
|
-
- Simple, single-task work (< 3 tasks)
|
|
24
|
-
- Pure research or exploration commands
|
|
25
|
-
- When user explicitly requests fast execution without checkpoints
|
|
26
|
-
|
|
27
|
-
## Overview
|
|
28
|
-
|
|
29
|
-
Long-running autonomous execution drifts silently. By the time you notice, you've burned context on the wrong thing. Reflection checkpoints force self-assessment at critical moments — catching drift before it compounds.
|
|
30
|
-
|
|
31
|
-
**Core principle:** Pause to assess, don't just assess to pause.
|
|
32
|
-
|
|
33
|
-
## The Four Reflection Types
|
|
34
|
-
|
|
35
|
-
### 1. Mid-Point Check
|
|
36
|
-
|
|
37
|
-
**Trigger:** After completing ~50% of planned tasks (e.g., 3 of 6 tasks done)
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
## 🔍 Mid-Point Reflection
|
|
41
|
-
|
|
42
|
-
**Progress:** [N/M] tasks complete
|
|
43
|
-
**Context used:** ~[X]% estimated
|
|
44
|
-
|
|
45
|
-
### Scope Check
|
|
46
|
-
- [ ] Am I still solving the original problem?
|
|
47
|
-
- [ ] Have I introduced any unplanned work?
|
|
48
|
-
- [ ] Are remaining tasks still correctly scoped?
|
|
49
|
-
|
|
50
|
-
### Quality Check
|
|
51
|
-
- [ ] Do completed tasks actually work (not just "done")?
|
|
52
|
-
- [ ] Any verification steps I deferred?
|
|
53
|
-
- [ ] Any TODO/FIXME I left that needs addressing?
|
|
54
|
-
|
|
55
|
-
### Efficiency Check
|
|
56
|
-
- [ ] Am I spending context on the right things?
|
|
57
|
-
- [ ] Should remaining tasks be parallelized?
|
|
58
|
-
- [ ] Any tasks that should be deferred to a follow-up bead?
|
|
59
|
-
|
|
60
|
-
**Assessment:** [On track / Drifting / Blocked]
|
|
61
|
-
**Adjustment:** [None needed / Describe change]
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### 2. Completion Check
|
|
65
|
-
|
|
66
|
-
**Trigger:** Before claiming any task or phase is complete
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
## ✅ Completion Check
|
|
70
|
-
|
|
71
|
-
**Claiming complete:** [task/phase name]
|
|
72
|
-
|
|
73
|
-
### Evidence Audit
|
|
74
|
-
- [ ] Verification command was run (not assumed)
|
|
75
|
-
- [ ] Output confirms the claim (not inferred)
|
|
76
|
-
- [ ] No stub patterns in modified files
|
|
77
|
-
- [ ] Imports/exports are wired (not just declared)
|
|
78
|
-
|
|
79
|
-
### Goal-Backward Check
|
|
80
|
-
- [ ] Does this task achieve its stated end-state?
|
|
81
|
-
- [ ] Would a user see the expected behavior?
|
|
82
|
-
- [ ] If tested manually, would it work?
|
|
83
|
-
|
|
84
|
-
**Verdict:** [Complete / Needs work: describe what]
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### 3. Near-Limit Warning
|
|
88
|
-
|
|
89
|
-
**Trigger:** When context usage exceeds ~70% or step count approaches limit
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
## ⚠️ Near-Limit Warning
|
|
93
|
-
|
|
94
|
-
**Context pressure:** [High / Critical]
|
|
95
|
-
**Remaining tasks:** [N]
|
|
96
|
-
|
|
97
|
-
### Triage
|
|
98
|
-
1. What MUST be done before stopping? [list critical tasks]
|
|
99
|
-
2. What CAN be deferred? [list deferrable tasks]
|
|
100
|
-
3. What should be handed off? [list with context needed]
|
|
101
|
-
|
|
102
|
-
### Action
|
|
103
|
-
- [ ] Compress completed work
|
|
104
|
-
- [ ] Prioritize remaining tasks ruthlessly
|
|
105
|
-
- [ ] Prepare handoff if needed
|
|
106
|
-
|
|
107
|
-
**Decision:** [Continue (enough budget) / Compress and continue / Handoff now]
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 4. Phase Transition Check
|
|
111
|
-
|
|
112
|
-
**Trigger:** At `/lfg` phase boundaries (Plan→Work, Work→Review, Review→Compound)
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
## 🔄 Phase Transition: [Previous] → [Next]
|
|
116
|
-
|
|
117
|
-
### Previous Phase Assessment
|
|
118
|
-
- **Objective met?** [Yes / Partially / No]
|
|
119
|
-
- **Artifacts produced:** [list]
|
|
120
|
-
- **Open issues carried forward:** [list or "none"]
|
|
121
|
-
|
|
122
|
-
### Next Phase Readiness
|
|
123
|
-
- [ ] Prerequisites satisfied
|
|
124
|
-
- [ ] Context is clean (no stale noise)
|
|
125
|
-
- [ ] Correct skills loaded for next phase
|
|
126
|
-
|
|
127
|
-
**Proceed:** [Yes / Need to resolve: describe]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Integration Points
|
|
131
|
-
|
|
132
|
-
### In `/ship` (Phase 3 task loop)
|
|
133
|
-
|
|
134
|
-
After every ceil(totalTasks / 2) tasks, run **Mid-Point Check**:
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
const midpoint = Math.ceil(totalTasks / 2);
|
|
138
|
-
if (completedTasks === midpoint) {
|
|
139
|
-
// Run mid-point reflection
|
|
140
|
-
// Log assessment to .beads/artifacts/$BEAD_ID/reflections.md
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Before each task completion claim, run **Completion Check** (lightweight — just the evidence audit).
|
|
145
|
-
|
|
146
|
-
### In `/lfg` (phase transitions)
|
|
147
|
-
|
|
148
|
-
At each step boundary (Plan→Work, Work→Review, Review→Compound), run **Phase Transition Check**.
|
|
149
|
-
|
|
150
|
-
### Context pressure monitoring
|
|
151
|
-
|
|
152
|
-
When context usage estimate exceeds 70%, run **Near-Limit Warning** regardless of task position.
|
|
153
|
-
|
|
154
|
-
## Reflection Log
|
|
155
|
-
|
|
156
|
-
Append all reflections to `.beads/artifacts/$BEAD_ID/reflections.md` (or session-level if no bead):
|
|
157
|
-
|
|
158
|
-
```markdown
|
|
159
|
-
## Reflection Log
|
|
160
|
-
|
|
161
|
-
### [timestamp] Mid-Point Check
|
|
162
|
-
|
|
163
|
-
Assessment: On track
|
|
164
|
-
Context: ~45% used
|
|
165
|
-
Adjustment: None
|
|
166
|
-
|
|
167
|
-
### [timestamp] Completion Check — Task 3
|
|
168
|
-
|
|
169
|
-
Verdict: Complete
|
|
170
|
-
Evidence: typecheck pass, test pass (12/12)
|
|
171
|
-
|
|
172
|
-
### [timestamp] Near-Limit Warning
|
|
173
|
-
|
|
174
|
-
Decision: Compress and continue
|
|
175
|
-
Deferred: Task 6 (cosmetic cleanup) → follow-up bead
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Gotchas
|
|
179
|
-
|
|
180
|
-
- **Don't over-reflect** — these are quick self-checks, not long analyses. Each should take < 30 seconds of reasoning.
|
|
181
|
-
- **Don't block on minor drift** — if drift is cosmetic (variable naming, style), note it and continue. Only pause for scope drift.
|
|
182
|
-
- **Context cost** — each reflection adds ~200-400 tokens. Budget accordingly. Skip mid-point check for < 4 tasks.
|
|
183
|
-
- **Not a replacement for verification** — reflections assess trajectory, not correctness. Always run actual verification commands.
|
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: requesting-code-review
|
|
3
|
-
description: Use when completing meaningful implementation work and needing a high-signal review pass before merge or release - dispatches scoped review agents, synthesizes findings, and routes follow-up actions by severity.
|
|
4
|
-
version: 1.2.0
|
|
5
|
-
tags: [workflow, code-quality, research]
|
|
6
|
-
dependencies: []
|
|
7
|
-
references:
|
|
8
|
-
- references/specialist-profiles.md
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Requesting Code Review
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
Request review when work is **potentially shippable** and you need fresh scrutiny before moving on.
|
|
16
|
-
|
|
17
|
-
This skill is for **asking for review**, not blindly obeying reviewers. The review output is advisory until verified against the codebase.
|
|
18
|
-
|
|
19
|
-
**Core principle:** tighter review packet → better findings. Fewer files + clearer requirements beats dumping a vague diff at five agents.
|
|
20
|
-
|
|
21
|
-
## When to Use
|
|
22
|
-
|
|
23
|
-
- After completing a feature, bugfix, or meaningful task batch
|
|
24
|
-
- Before merging to main or creating a PR
|
|
25
|
-
- Before release or after a risky refactor
|
|
26
|
-
- When you need multiple review angles on the same implementation
|
|
27
|
-
|
|
28
|
-
## When NOT to Use
|
|
29
|
-
|
|
30
|
-
- During TDD RED phase or any intentionally failing state
|
|
31
|
-
- When you only need a single targeted technical answer
|
|
32
|
-
- When implementation is still obviously incomplete and review would be premature
|
|
33
|
-
|
|
34
|
-
## Golden Path
|
|
35
|
-
|
|
36
|
-
1. **Stabilize the work** — run the relevant verification first
|
|
37
|
-
2. **Build a tight review packet** — what changed, requirements, diff range, notable risks
|
|
38
|
-
3. **Choose review depth** — targeted, standard, or full multi-angle review
|
|
39
|
-
4. **Dispatch review agents in parallel**
|
|
40
|
-
5. **Deduplicate + synthesize findings**
|
|
41
|
-
6. **Fix or push back with evidence**
|
|
42
|
-
7. **Re-verify after changes**
|
|
43
|
-
|
|
44
|
-
## Review Packet
|
|
45
|
-
|
|
46
|
-
Before dispatching any reviewer, assemble a packet with:
|
|
47
|
-
|
|
48
|
-
- **What changed** — 2-6 bullet summary
|
|
49
|
-
- **Requirements / plan** — acceptance criteria or plan excerpt
|
|
50
|
-
- **Diff range** — `BASE_SHA..HEAD_SHA`
|
|
51
|
-
- **Risk hints** — auth, migrations, concurrency, data deletion, perf-sensitive path, etc.
|
|
52
|
-
- **Verification already run** — typecheck/lint/test/build status
|
|
53
|
-
|
|
54
|
-
Minimal packet template:
|
|
55
|
-
|
|
56
|
-
```markdown
|
|
57
|
-
What was implemented:
|
|
58
|
-
|
|
59
|
-
- [change 1]
|
|
60
|
-
- [change 2]
|
|
61
|
-
|
|
62
|
-
Requirements:
|
|
63
|
-
|
|
64
|
-
- [acceptance criterion 1]
|
|
65
|
-
- [acceptance criterion 2]
|
|
66
|
-
|
|
67
|
-
Diff:
|
|
68
|
-
|
|
69
|
-
- BASE_SHA: {BASE_SHA}
|
|
70
|
-
- HEAD_SHA: {HEAD_SHA}
|
|
71
|
-
|
|
72
|
-
Already verified:
|
|
73
|
-
|
|
74
|
-
- [command] — [result]
|
|
75
|
-
|
|
76
|
-
Risk areas:
|
|
77
|
-
|
|
78
|
-
- [auth | migrations | concurrency | performance | none]
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Review Depth Selection
|
|
82
|
-
|
|
83
|
-
Choose the smallest review depth that still covers the risk.
|
|
84
|
-
|
|
85
|
-
| Depth | Use When | Agents |
|
|
86
|
-
| ------------ | ------------------------------------------- | ------ |
|
|
87
|
-
| **targeted** | Small fix, one main risk, one area changed | 1-2 |
|
|
88
|
-
| **standard** | Typical feature/fix ready for merge | 3 |
|
|
89
|
-
| **full** | Risky, cross-cutting, release-critical work | 5 |
|
|
90
|
-
|
|
91
|
-
### Routing Rules
|
|
92
|
-
|
|
93
|
-
- **targeted**: use 1-2 specific review prompts
|
|
94
|
-
- **standard**: use security/correctness, tests/types, and completeness
|
|
95
|
-
- **full**: use all 5 specialized review prompts + specialist profiles from [references/specialist-profiles.md](references/specialist-profiles.md)
|
|
96
|
-
|
|
97
|
-
For **standard** and **full** reviews, enhance dispatch prompts with specialist reviewer profiles (security, architecture, performance) and run an adversarial pass on findings. See [references/specialist-profiles.md](references/specialist-profiles.md) for the exact prompt additions and confidence thresholds.
|
|
98
|
-
|
|
99
|
-
Do **not** dispatch 5 reviewers by reflex for every tiny change. That produces noise, not rigor.
|
|
100
|
-
|
|
101
|
-
## Review Scope Self-Check
|
|
102
|
-
|
|
103
|
-
Before writing ANY review finding, the reviewer MUST ask:
|
|
104
|
-
|
|
105
|
-
> **"Am I questioning APPROACH or DOCUMENTATION/CORRECTNESS?"**
|
|
106
|
-
|
|
107
|
-
| Answer | Action |
|
|
108
|
-
| --- | --- |
|
|
109
|
-
| **APPROACH** — "I would have done it differently" | **Stay silent.** The approach was decided during planning. Review doesn't re-litigate design. |
|
|
110
|
-
| **DOCUMENTATION** — "A new developer couldn't execute this" | **Raise it.** Missing file paths, vague acceptance criteria, assumed context. |
|
|
111
|
-
| **CORRECTNESS** — "This will break at runtime" | **Raise it.** Bugs, security holes, type errors, logic flaws. |
|
|
112
|
-
|
|
113
|
-
### Red Flags for Scope Creep
|
|
114
|
-
|
|
115
|
-
- Suggesting alternative libraries or frameworks → **out of scope** (approach)
|
|
116
|
-
- "I would rename this to..." without a concrete bug → **out of scope** (style preference)
|
|
117
|
-
- "Consider adding feature X" that wasn't in requirements → **out of scope** (scope inflation)
|
|
118
|
-
- "This could be more performant" without evidence of a real problem → **out of scope** (premature optimization)
|
|
119
|
-
|
|
120
|
-
### What Reviewers SHOULD Flag
|
|
121
|
-
|
|
122
|
-
- Missing error handling that will crash in production → **correctness**
|
|
123
|
-
- Vague acceptance criteria that workers can't verify → **documentation**
|
|
124
|
-
- Hardcoded values with no explanation → **documentation**
|
|
125
|
-
- Missing file paths for tasks that require edits → **documentation**
|
|
126
|
-
- "Use the existing pattern" without specifying which pattern → **documentation**
|
|
127
|
-
- Security vulnerabilities (injection, auth bypass, secrets) → **correctness**
|
|
128
|
-
|
|
129
|
-
Include this self-check instruction in EVERY review dispatch prompt to prevent bikeshedding.
|
|
130
|
-
|
|
131
|
-
## Step 1: Get Git Context
|
|
132
|
-
|
|
133
|
-
### Setup Checklist
|
|
134
|
-
|
|
135
|
-
- [ ] Determine `BASE_SHA` and `HEAD_SHA`
|
|
136
|
-
- [ ] Summarize requirements or link plan
|
|
137
|
-
- [ ] Decide review depth
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
BASE_SHA=$(git rev-parse origin/main 2>/dev/null || git rev-parse HEAD~1)
|
|
141
|
-
HEAD_SHA=$(git rev-parse HEAD)
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
If work is still uncommitted, use the working tree review path and clearly say so in the review packet.
|
|
145
|
-
|
|
146
|
-
## Step 2: Dispatch Reviewers in Parallel
|
|
147
|
-
|
|
148
|
-
### A. Security + Correctness
|
|
149
|
-
|
|
150
|
-
```typescript
|
|
151
|
-
task({
|
|
152
|
-
subagent_type: "review",
|
|
153
|
-
description: "Security + correctness review",
|
|
154
|
-
prompt: `Review this implementation for real bugs in changed code only.
|
|
155
|
-
|
|
156
|
-
Review packet:
|
|
157
|
-
{REVIEW_PACKET}
|
|
158
|
-
|
|
159
|
-
Run:
|
|
160
|
-
git diff {BASE_SHA}..{HEAD_SHA}
|
|
161
|
-
|
|
162
|
-
Check for:
|
|
163
|
-
- Security vulnerabilities (injection, auth bypass, secrets exposure, missing validation)
|
|
164
|
-
- Logic errors, null/undefined access, incorrect guards
|
|
165
|
-
- Broken async/error handling
|
|
166
|
-
- Data integrity issues
|
|
167
|
-
|
|
168
|
-
Rules:
|
|
169
|
-
- Review only changed code
|
|
170
|
-
- Read full changed files for context before flagging issues
|
|
171
|
-
- Do not speculate; explain the concrete failure scenario
|
|
172
|
-
|
|
173
|
-
Return:
|
|
174
|
-
- CRITICAL / IMPORTANT / MINOR findings
|
|
175
|
-
- file:line references
|
|
176
|
-
- brief reasoning for each finding`,
|
|
177
|
-
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### B. Performance + Architecture
|
|
181
|
-
|
|
182
|
-
```typescript
|
|
183
|
-
task({
|
|
184
|
-
subagent_type: "review",
|
|
185
|
-
description: "Performance + architecture review",
|
|
186
|
-
prompt: `Review this implementation for performance and architecture issues.
|
|
187
|
-
|
|
188
|
-
Review packet:
|
|
189
|
-
{REVIEW_PACKET}
|
|
190
|
-
|
|
191
|
-
Run:
|
|
192
|
-
git diff {BASE_SHA}..{HEAD_SHA}
|
|
193
|
-
|
|
194
|
-
Check for:
|
|
195
|
-
- Obviously expensive loops / N+1 / repeated work
|
|
196
|
-
- Over-engineering or abstraction without clear value
|
|
197
|
-
- Coupling that will make maintenance painful
|
|
198
|
-
- Missing use of existing abstractions/utilities
|
|
199
|
-
|
|
200
|
-
Rules:
|
|
201
|
-
- Flag only meaningful issues
|
|
202
|
-
- Skip style-only comments unless they cause structural problems
|
|
203
|
-
|
|
204
|
-
Return:
|
|
205
|
-
- CRITICAL / IMPORTANT / MINOR findings
|
|
206
|
-
- file:line references`,
|
|
207
|
-
});
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### C. Type Safety + Test Quality
|
|
211
|
-
|
|
212
|
-
```typescript
|
|
213
|
-
task({
|
|
214
|
-
subagent_type: "review",
|
|
215
|
-
description: "Type safety + test review",
|
|
216
|
-
prompt: `Review this implementation for type safety and test quality.
|
|
217
|
-
|
|
218
|
-
Review packet:
|
|
219
|
-
{REVIEW_PACKET}
|
|
220
|
-
|
|
221
|
-
Run:
|
|
222
|
-
git diff {BASE_SHA}..{HEAD_SHA}
|
|
223
|
-
|
|
224
|
-
Check for:
|
|
225
|
-
- Unsafe assertions, type holes, lossy casts
|
|
226
|
-
- Missing coverage on important branches or edge cases
|
|
227
|
-
- Tests that only prove mocks, not behavior
|
|
228
|
-
- Tests that would still pass if implementation were wrong
|
|
229
|
-
|
|
230
|
-
Return:
|
|
231
|
-
- CRITICAL / IMPORTANT / MINOR findings
|
|
232
|
-
- file:line references`,
|
|
233
|
-
});
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
### D. Conventions + Existing Patterns
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
task({
|
|
240
|
-
subagent_type: "review",
|
|
241
|
-
description: "Conventions + patterns review",
|
|
242
|
-
prompt: `Review this implementation against existing codebase patterns.
|
|
243
|
-
|
|
244
|
-
Review packet:
|
|
245
|
-
{REVIEW_PACKET}
|
|
246
|
-
|
|
247
|
-
Run:
|
|
248
|
-
git diff {BASE_SHA}..{HEAD_SHA}
|
|
249
|
-
git log --oneline -10
|
|
250
|
-
|
|
251
|
-
Check for:
|
|
252
|
-
- Divergence from existing code organization or naming
|
|
253
|
-
- Reimplementation of existing utilities/helpers
|
|
254
|
-
- Documentation drift where changed code no longer matches docs
|
|
255
|
-
- New patterns that conflict with established ones
|
|
256
|
-
|
|
257
|
-
Return:
|
|
258
|
-
- CRITICAL / IMPORTANT / MINOR findings
|
|
259
|
-
- file:line references`,
|
|
260
|
-
});
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### E. Simplicity + Completeness
|
|
264
|
-
|
|
265
|
-
```typescript
|
|
266
|
-
task({
|
|
267
|
-
subagent_type: "review",
|
|
268
|
-
description: "Simplicity + completeness review",
|
|
269
|
-
prompt: `Review this implementation for completeness and unnecessary complexity.
|
|
270
|
-
|
|
271
|
-
Review packet:
|
|
272
|
-
{REVIEW_PACKET}
|
|
273
|
-
|
|
274
|
-
Run:
|
|
275
|
-
git diff {BASE_SHA}..{HEAD_SHA}
|
|
276
|
-
|
|
277
|
-
Check for:
|
|
278
|
-
- Missing requirements or acceptance criteria
|
|
279
|
-
- Dead code, TODOs, unreachable branches
|
|
280
|
-
- Complexity that can be deleted without losing behavior
|
|
281
|
-
- Behavior changes that appear unintentional
|
|
282
|
-
|
|
283
|
-
Return:
|
|
284
|
-
- CRITICAL / IMPORTANT / MINOR findings
|
|
285
|
-
- file:line references`,
|
|
286
|
-
});
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
## Dispatch Matrix
|
|
290
|
-
|
|
291
|
-
| Depth | Reviewers to Run |
|
|
292
|
-
| ------------ | ---------------------------- |
|
|
293
|
-
| **targeted** | Choose the 1-2 most relevant |
|
|
294
|
-
| **standard** | A + C + E |
|
|
295
|
-
| **full** | A + B + C + D + E |
|
|
296
|
-
|
|
297
|
-
## Step 3: Synthesize Findings
|
|
298
|
-
|
|
299
|
-
### Synthesis Checklist
|
|
300
|
-
|
|
301
|
-
- [ ] Merge duplicate findings across reviewers
|
|
302
|
-
- [ ] Keep the strongest explanation when multiple reviewers report same issue
|
|
303
|
-
- [ ] Separate real blockers from optional improvements
|
|
304
|
-
- [ ] Mark disputed / uncertain findings explicitly
|
|
305
|
-
|
|
306
|
-
Output format:
|
|
307
|
-
|
|
308
|
-
```markdown
|
|
309
|
-
## Review Summary
|
|
310
|
-
|
|
311
|
-
**Review depth:** [targeted | standard | full]
|
|
312
|
-
**Agents run:** [N]
|
|
313
|
-
**Critical:** [N]
|
|
314
|
-
**Important:** [N]
|
|
315
|
-
**Minor:** [N]
|
|
316
|
-
|
|
317
|
-
### Critical Issues
|
|
318
|
-
|
|
319
|
-
- `path/to/file.ts:123` — [issue + why it breaks]
|
|
320
|
-
|
|
321
|
-
### Important Issues
|
|
322
|
-
|
|
323
|
-
- `path/to/file.ts:123` — [issue]
|
|
324
|
-
|
|
325
|
-
### Minor Issues
|
|
326
|
-
|
|
327
|
-
- `path/to/file.ts:123` — [optional improvement]
|
|
328
|
-
|
|
329
|
-
### Disputed / Needs Verification
|
|
330
|
-
|
|
331
|
-
- [finding that may be wrong, plus what evidence would confirm it]
|
|
332
|
-
|
|
333
|
-
### Assessment
|
|
334
|
-
|
|
335
|
-
- [ ] Ready to proceed
|
|
336
|
-
- [ ] Fix required first
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
## Step 4: Act on Findings
|
|
340
|
-
|
|
341
|
-
### Remediation Checklist
|
|
342
|
-
|
|
343
|
-
- [ ] Fix all Critical findings before proceeding
|
|
344
|
-
- [ ] Fix Important findings in the current branch unless consciously deferred
|
|
345
|
-
- [ ] Record deferred Minor findings somewhere durable
|
|
346
|
-
- [ ] Push back on wrong findings with code/tests, not opinion
|
|
347
|
-
|
|
348
|
-
| Severity | Action |
|
|
349
|
-
| ------------- | --------------------------------------------- |
|
|
350
|
-
| **Critical** | Fix immediately before any further work |
|
|
351
|
-
| **Important** | Fix now or explicitly defer with reason |
|
|
352
|
-
| **Minor** | Track for later if not worth immediate change |
|
|
353
|
-
|
|
354
|
-
If a finding looks wrong, verify it against the codebase before changing anything.
|
|
355
|
-
|
|
356
|
-
## Step 5: Re-verify
|
|
357
|
-
|
|
358
|
-
After fixing review findings, re-run the relevant verification commands.
|
|
359
|
-
|
|
360
|
-
At minimum, use the commands appropriate for the project toolchain:
|
|
361
|
-
|
|
362
|
-
- `npm run typecheck`
|
|
363
|
-
- `npm run lint`
|
|
364
|
-
- `npm test`
|
|
365
|
-
- `npm run build` (if release/build-sensitive)
|
|
366
|
-
|
|
367
|
-
Do not claim review is resolved until fresh verification passes.
|
|
368
|
-
|
|
369
|
-
## Placeholders Reference
|
|
370
|
-
|
|
371
|
-
| Placeholder | What to fill |
|
|
372
|
-
| ----------------- | -------------------------------- |
|
|
373
|
-
| `{REVIEW_PACKET}` | Tight review packet with context |
|
|
374
|
-
| `{BASE_SHA}` | Starting commit SHA |
|
|
375
|
-
| `{HEAD_SHA}` | Ending commit SHA |
|
|
376
|
-
|
|
377
|
-
## Integration with Workflows
|
|
378
|
-
|
|
379
|
-
| Command | When review runs |
|
|
380
|
-
| ------- | ------------------------------------ |
|
|
381
|
-
| `/ship` | After work is complete and verified |
|
|
382
|
-
| `/pr` | Before pushing or opening PR |
|
|
383
|
-
| `/lfg` | Between execution and compound steps |
|
|
384
|
-
|
|
385
|
-
## Common Mistakes
|
|
386
|
-
|
|
387
|
-
- Running 5 reviewers on a tiny one-file fix with no real risk
|
|
388
|
-
- Sending vague prompts with no requirements or verification status
|
|
389
|
-
- Treating reviewer output as automatically correct
|
|
390
|
-
- Failing to deduplicate repeated findings
|
|
391
|
-
- Skipping re-verification after review fixes
|
|
392
|
-
|
|
393
|
-
## After Review: Compound
|
|
394
|
-
|
|
395
|
-
Run `/compound` after resolving review findings to capture:
|
|
396
|
-
|
|
397
|
-
- Patterns review caught that should be prevented earlier
|
|
398
|
-
- False positives that should not be repeated
|
|
399
|
-
- Newly discovered codebase conventions
|
|
400
|
-
|
|
401
|
-
That turns review from a gate into a feedback loop.
|
|
402
|
-
|
|
403
|
-
## Autofix Classification
|
|
404
|
-
|
|
405
|
-
Every review finding should include a **fix category** that routes remediation. This prevents the user from manually triaging every finding.
|
|
406
|
-
|
|
407
|
-
| Category | Meaning | Agent Action |
|
|
408
|
-
| -------------- | ------------------------------------------------ | ----------------------------------------- |
|
|
409
|
-
| `safe_auto` | Zero-risk fix (formatting, unused imports, typos) | Fix immediately without asking |
|
|
410
|
-
| `gated_auto` | Likely correct fix, but verify first | Fix and show diff before committing |
|
|
411
|
-
| `manual` | Requires human judgment or architectural decision | Report to user with context, don't touch |
|
|
412
|
-
| `advisory` | Informational only, no action required | Include in report, no remediation needed |
|
|
413
|
-
|
|
414
|
-
### Reviewer Output Format (Enhanced)
|
|
415
|
-
|
|
416
|
-
Reviewers should return findings in this structure:
|
|
417
|
-
|
|
418
|
-
```markdown
|
|
419
|
-
### [SEVERITY]: [Title]
|
|
420
|
-
|
|
421
|
-
- **File:** `path/to/file.ts:123`
|
|
422
|
-
- **Category:** safe_auto | gated_auto | manual | advisory
|
|
423
|
-
- **Issue:** [concrete description of the problem]
|
|
424
|
-
- **Fix:** [specific fix if category is safe_auto or gated_auto]
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
### Classification Rules
|
|
428
|
-
|
|
429
|
-
1. **safe_auto** — formatting, whitespace, unused imports, typo in comments, missing trailing newlines. Must not change behavior.
|
|
430
|
-
2. **gated_auto** — missing null checks, error handling gaps, type narrowing fixes. Changes behavior but fix is clear and low-risk.
|
|
431
|
-
3. **manual** — architectural concerns, API design questions, security decisions, breaking changes. Requires human context.
|
|
432
|
-
4. **advisory** — "consider doing X", performance suggestions without evidence, alternative patterns. No action needed.
|
|
433
|
-
|
|
434
|
-
### Post-Synthesis Routing
|
|
435
|
-
|
|
436
|
-
After synthesizing all findings:
|
|
437
|
-
|
|
438
|
-
1. **Apply all `safe_auto` fixes** immediately
|
|
439
|
-
2. **Show `gated_auto` diffs** to user for approval before applying
|
|
440
|
-
3. **Present `manual` findings** as a prioritized list for user decision
|
|
441
|
-
4. **Append `advisory` findings** at the end of the report for reference
|
|
442
|
-
|
|
443
|
-
This routing ensures trivial fixes don't block the review while keeping humans in the loop for judgment calls.
|