opencodekit 0.20.4 → 0.20.6

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.
Files changed (30) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +71 -9
  3. package/dist/template/.opencode/agent/build.md +82 -32
  4. package/dist/template/.opencode/agent/plan.md +22 -14
  5. package/dist/template/.opencode/agent/review.md +18 -40
  6. package/dist/template/.opencode/agent/scout.md +17 -0
  7. package/dist/template/.opencode/command/compound.md +24 -2
  8. package/dist/template/.opencode/command/create.md +65 -69
  9. package/dist/template/.opencode/command/explore.md +170 -0
  10. package/dist/template/.opencode/command/health.md +124 -2
  11. package/dist/template/.opencode/command/iterate.md +200 -0
  12. package/dist/template/.opencode/command/plan.md +74 -14
  13. package/dist/template/.opencode/command/pr.md +4 -16
  14. package/dist/template/.opencode/command/research.md +7 -16
  15. package/dist/template/.opencode/command/resume.md +2 -11
  16. package/dist/template/.opencode/command/review-codebase.md +9 -15
  17. package/dist/template/.opencode/command/ship.md +12 -53
  18. package/dist/template/.opencode/memory/_templates/prd.md +16 -5
  19. package/dist/template/.opencode/memory/project/user.md +7 -0
  20. package/dist/template/.opencode/memory.db +0 -0
  21. package/dist/template/.opencode/memory.db-shm +0 -0
  22. package/dist/template/.opencode/memory.db-wal +0 -0
  23. package/dist/template/.opencode/opencode.json +54 -67
  24. package/dist/template/.opencode/package.json +1 -1
  25. package/dist/template/.opencode/skill/memory-grounding/SKILL.md +68 -0
  26. package/dist/template/.opencode/skill/reconcile/SKILL.md +183 -0
  27. package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +75 -0
  28. package/dist/template/.opencode/skill/verification-gates/SKILL.md +63 -0
  29. package/dist/template/.opencode/skill/workspace-setup/SKILL.md +76 -0
  30. package/package.json +1 -1
@@ -175,23 +175,25 @@
175
175
  "output": 32000
176
176
  },
177
177
  "options": {
178
- "thinking_budget": 24000,
179
- "type": "enabled"
178
+ "reasoningEffort": "high"
180
179
  },
181
180
  "reasoning": true,
182
181
  "temperature": true,
183
182
  "tool_call": true,
184
183
  "variants": {
185
- "high": {
184
+ "low": {
186
185
  "options": {
187
- "thinking_budget": 16000,
188
- "type": "enabled"
186
+ "reasoningEffort": "low"
189
187
  }
190
188
  },
191
- "max": {
189
+ "medium": {
192
190
  "options": {
193
- "thinking_budget": 32000,
194
- "type": "enabled"
191
+ "reasoningEffort": "medium"
192
+ }
193
+ },
194
+ "high": {
195
+ "options": {
196
+ "reasoningEffort": "high"
195
197
  }
196
198
  }
197
199
  }
@@ -203,20 +205,25 @@
203
205
  "output": 32000
204
206
  },
205
207
  "options": {
206
- "thinking_budget": 10000
208
+ "reasoningEffort": "medium"
207
209
  },
208
210
  "reasoning": true,
209
211
  "temperature": true,
210
212
  "tool_call": true,
211
213
  "variants": {
212
- "high": {
214
+ "low": {
213
215
  "options": {
214
- "thinking_budget": 16000
216
+ "reasoningEffort": "low"
215
217
  }
216
218
  },
217
- "max": {
219
+ "medium": {
218
220
  "options": {
219
- "thinking_budget": 32000
221
+ "reasoningEffort": "medium"
222
+ }
223
+ },
224
+ "high": {
225
+ "options": {
226
+ "reasoningEffort": "high"
220
227
  }
221
228
  }
222
229
  }
@@ -228,40 +235,25 @@
228
235
  "output": 64000
229
236
  },
230
237
  "options": {
231
- "thinking": {
232
- "budget_tokens": 24000,
233
- "type": "enabled"
234
- }
238
+ "reasoningEffort": "high"
235
239
  },
236
240
  "reasoning": true,
237
241
  "temperature": true,
238
242
  "tool_call": true,
239
243
  "variants": {
240
- "adaptive": {
244
+ "low": {
241
245
  "options": {
242
- "max_tokens": 16000,
243
- "output_config": {
244
- "effort": "max"
245
- },
246
- "thinking": {
247
- "type": "adaptive"
248
- }
246
+ "reasoningEffort": "low"
249
247
  }
250
248
  },
251
- "high": {
249
+ "medium": {
252
250
  "options": {
253
- "thinking": {
254
- "budget_tokens": 24000,
255
- "type": "enabled"
256
- }
251
+ "reasoningEffort": "medium"
257
252
  }
258
253
  },
259
- "max": {
254
+ "high": {
260
255
  "options": {
261
- "thinking": {
262
- "budget_tokens": 32000,
263
- "type": "enabled"
264
- }
256
+ "reasoningEffort": "high"
265
257
  }
266
258
  }
267
259
  }
@@ -273,20 +265,25 @@
273
265
  "output": 16000
274
266
  },
275
267
  "options": {
276
- "thinking_budget": 10000
268
+ "reasoningEffort": "medium"
277
269
  },
278
270
  "reasoning": true,
279
271
  "temperature": true,
280
272
  "tool_call": true,
281
273
  "variants": {
282
- "high": {
274
+ "low": {
283
275
  "options": {
284
- "thinking_budget": 16000
276
+ "reasoningEffort": "low"
285
277
  }
286
278
  },
287
- "max": {
279
+ "medium": {
280
+ "options": {
281
+ "reasoningEffort": "medium"
282
+ }
283
+ },
284
+ "high": {
288
285
  "options": {
289
- "thinking_budget": 32000
286
+ "reasoningEffort": "high"
290
287
  }
291
288
  }
292
289
  }
@@ -298,20 +295,25 @@
298
295
  "output": 32000
299
296
  },
300
297
  "options": {
301
- "thinking_budget": 10000
298
+ "reasoningEffort": "medium"
302
299
  },
303
300
  "reasoning": true,
304
301
  "temperature": true,
305
302
  "tool_call": true,
306
303
  "variants": {
307
- "high": {
304
+ "low": {
308
305
  "options": {
309
- "thinking_budget": 16000
306
+ "reasoningEffort": "low"
310
307
  }
311
308
  },
312
- "max": {
309
+ "medium": {
313
310
  "options": {
314
- "thinking_budget": 32000
311
+ "reasoningEffort": "medium"
312
+ }
313
+ },
314
+ "high": {
315
+ "options": {
316
+ "reasoningEffort": "high"
315
317
  }
316
318
  }
317
319
  }
@@ -323,40 +325,25 @@
323
325
  "output": 32000
324
326
  },
325
327
  "options": {
326
- "thinking": {
327
- "budget_tokens": 24000,
328
- "type": "enabled"
329
- }
328
+ "reasoningEffort": "high"
330
329
  },
331
330
  "reasoning": true,
332
331
  "temperature": true,
333
332
  "tool_call": true,
334
333
  "variants": {
335
- "adaptive": {
334
+ "low": {
336
335
  "options": {
337
- "max_tokens": 16000,
338
- "output_config": {
339
- "effort": "max"
340
- },
341
- "thinking": {
342
- "type": "adaptive"
343
- }
336
+ "reasoningEffort": "low"
344
337
  }
345
338
  },
346
- "high": {
339
+ "medium": {
347
340
  "options": {
348
- "thinking": {
349
- "budget_tokens": 16000,
350
- "type": "enabled"
351
- }
341
+ "reasoningEffort": "medium"
352
342
  }
353
343
  },
354
- "max": {
344
+ "high": {
355
345
  "options": {
356
- "thinking": {
357
- "budget_tokens": 32000,
358
- "type": "enabled"
359
- }
346
+ "reasoningEffort": "high"
360
347
  }
361
348
  }
362
349
  }
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@google/stitch-sdk": "^0.0.3",
15
- "@opencode-ai/plugin": "1.3.17"
15
+ "@opencode-ai/plugin": "1.4.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^25.3.0",
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: memory-grounding
3
+ description: >
4
+ Use at the start of any command that needs prior context — searches memory for decisions, patterns, and handoffs before execution to avoid re-solving solved problems.
5
+ version: 1.0.0
6
+ tags: [memory, grounding, pre-flight]
7
+ ---
8
+
9
+ # Memory Grounding
10
+
11
+ Search institutional memory before executing any command that modifies state or makes decisions.
12
+
13
+ ## When to Use
14
+
15
+ - At the start of `/ship`, `/plan`, `/create`, `/pr`, `/research`, `/resume`
16
+ - Before any command that benefits from prior context
17
+ - When you need to check if work was already done or decisions already made
18
+
19
+ ## When NOT to Use
20
+
21
+ - Read-only commands that don't need historical context (e.g., `/status`)
22
+ - Commands that explicitly skip grounding (e.g., `--no-memory` flag)
23
+
24
+ ## Protocol
25
+
26
+ ### Step 1: Search for relevant context
27
+
28
+ ```typescript
29
+ // Primary: search by bead ID or topic
30
+ memory-search({ query: "$ARGUMENTS" });
31
+
32
+ // Secondary: search by keywords with limit
33
+ memory-search({ query: "<feature or topic keywords>", limit: 5 });
34
+
35
+ // Optional: filter by type for specific needs
36
+ memory-search({ query: "<keywords>", type: "decision" }); // Past decisions
37
+ memory-search({ query: "<keywords>", type: "bugfix" }); // Known issues
38
+ ```
39
+
40
+ ### Step 2: Check last session handoff
41
+
42
+ ```typescript
43
+ memory-read({ file: "handoffs/last" });
44
+ ```
45
+
46
+ ### Step 3: Check session history (if resuming work)
47
+
48
+ ```typescript
49
+ find_sessions({ query: "$ARGUMENTS", limit: 3 });
50
+ ```
51
+
52
+ ### Step 4: Apply findings
53
+
54
+ - **If relevant findings exist:** Incorporate them directly. Don't re-solve solved problems.
55
+ - **If prior decisions found:** Follow them unless there's a clear reason to diverge (document the divergence).
56
+ - **If known issues found:** Account for them in the current approach.
57
+ - **If nothing found:** Proceed normally — absence of memory is not a blocker.
58
+
59
+ ## Command-Specific Variations
60
+
61
+ | Command | Extra Focus |
62
+ | ----------- | ------------------------------------------------------ |
63
+ | `/plan` | Search bugfixes; check for existing plans to overwrite |
64
+ | `/ship` | Search for failed approaches to avoid repeating |
65
+ | `/create` | Search for duplicate beads before creating |
66
+ | `/pr` | Include findings in PR description |
67
+ | `/research` | Search before spawning agents; narrow scope to gaps |
68
+ | `/resume` | Read handoff file by bead ID; check session history |
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: reconcile
3
+ description: >
4
+ Use when verifying implementation matches its specification — detects drift between PRD requirements
5
+ and actual code, identifies missing features, extra features, and diverged behavior. Load after /ship
6
+ or before closing a bead.
7
+ version: 1.0.0
8
+ tags: [workflow, verification, quality]
9
+ dependencies: [verification-before-completion]
10
+ ---
11
+
12
+ # Reconcile — Spec↔Code Drift Detection
13
+
14
+ ## When to Use
15
+
16
+ - After `/ship` completes all tasks, before closing the bead
17
+ - When you suspect implementation has drifted from the original spec
18
+ - During `/review-codebase` to check spec adherence
19
+ - Before creating a PR to verify completeness
20
+
21
+ ## When NOT to Use
22
+
23
+ - During active implementation (wait until tasks are done)
24
+ - For code quality issues (use `requesting-code-review` instead)
25
+ - For structural config audits (use `/health` instead)
26
+
27
+ ## Overview
28
+
29
+ Implementation drift is the silent killer of spec-driven development. Tasks can pass all verification gates while the overall feature drifts from its specification. This skill systematically compares PRD artifacts against code evidence.
30
+
31
+ ## Reconciliation Process
32
+
33
+ ### Step 1: Load Artifacts
34
+
35
+ ```bash
36
+ # Read the PRD
37
+ cat .beads/artifacts/$BEAD_ID/prd.md
38
+
39
+ # Read the plan (if exists)
40
+ cat .beads/artifacts/$BEAD_ID/plan.md 2>/dev/null
41
+
42
+ # Determine comparison base (works with main, master, or any default branch)
43
+ BASE=$(git rev-parse origin/main 2>/dev/null || git rev-parse origin/master 2>/dev/null || git merge-base HEAD $(git rev-parse --abbrev-ref HEAD@{upstream} 2>/dev/null || echo HEAD~10))
44
+
45
+ # Get the actual diff
46
+ git diff $BASE --name-only
47
+ git diff $BASE --stat
48
+ ```
49
+
50
+ ### Step 2: Extract Spec Claims
51
+
52
+ From the PRD, extract these verifiable claims:
53
+
54
+ | Claim Type | Source Section | Example |
55
+ | --------------------------- | --------------------------------------- | ----------------------------------- |
56
+ | **Success Criteria** | `## Success Criteria` | "User can see existing messages" |
57
+ | **Functional Requirements** | `## Requirements` | "WHEN user clicks X THEN Y happens" |
58
+ | **Affected Files** | `## Technical Context > Affected Files` | `src/api/users.ts` |
59
+ | **Scope Boundaries** | `## Scope` | "In-scope: X, Out-of-scope: Y" |
60
+ | **Task Deliverables** | `## Tasks` | Each task's end-state description |
61
+
62
+ ### Step 3: Verify Each Claim
63
+
64
+ For each extracted claim, gather evidence:
65
+
66
+ #### Success Criteria Verification
67
+
68
+ ```bash
69
+ # For each success criterion, find code evidence
70
+ # Example: "User can see existing messages"
71
+ grep -r "messages" src/ --include="*.ts" --include="*.tsx" -l
72
+ grep -r "fetchMessages\|getMessages\|listMessages" src/ -l
73
+ ```
74
+
75
+ Map each criterion to:
76
+
77
+ - **VERIFIED**: Code evidence confirms the criterion is met
78
+ - **PARTIAL**: Some evidence exists but incomplete
79
+ - **MISSING**: No code evidence found
80
+ - **UNTESTABLE**: Cannot be verified via code search (needs manual check)
81
+
82
+ #### Affected Files Verification
83
+
84
+ ```bash
85
+ # Compare PRD affected files vs actual changed files
86
+ # PRD claims these files would be modified:
87
+ PRD_FILES=$(grep -A 50 "Affected Files" .beads/artifacts/$BEAD_ID/prd.md | grep "src/" | sed 's/.*`//' | sed 's/`.*//')
88
+
89
+ # Actually modified files:
90
+ ACTUAL_FILES=$(git diff $BASE --name-only)
91
+
92
+ # Files in PRD but not modified (missing implementation):
93
+ comm -23 <(echo "$PRD_FILES" | sort) <(echo "$ACTUAL_FILES" | sort)
94
+
95
+ # Files modified but not in PRD (scope creep):
96
+ comm -13 <(echo "$PRD_FILES" | sort) <(echo "$ACTUAL_FILES" | sort)
97
+ ```
98
+
99
+ #### Scope Boundary Check
100
+
101
+ - **In-scope items**: Verify each has corresponding code changes
102
+ - **Out-of-scope items**: Verify NO code touches those areas (scope creep detection)
103
+
104
+ ### Step 4: Detect Drift Patterns
105
+
106
+ | Drift Type | Detection Method | Severity |
107
+ | -------------------------- | ------------------------------------------------------ | -------- |
108
+ | **Missing Feature** | Success criterion with no code evidence | HIGH |
109
+ | **Partial Implementation** | Criterion partially met (stub, TODO) | HIGH |
110
+ | **Scope Creep** | Files modified that aren't in PRD affected files | MEDIUM |
111
+ | **Spec Rot** | PRD sections that contradict actual implementation | MEDIUM |
112
+ | **Over-Engineering** | Significant code not traceable to any PRD requirement | LOW |
113
+ | **Diverged Behavior** | Code does something different from WHEN/THEN scenarios | HIGH |
114
+
115
+ ### Step 5: Calculate Drift Score
116
+
117
+ ```
118
+ Drift Score Calculation:
119
+ - Total claims: [N]
120
+ - VERIFIED: [n] (×1.0)
121
+ - PARTIAL: [n] (×0.5)
122
+ - MISSING: [n] (×0.0)
123
+ - UNTESTABLE: [n] (excluded from calculation)
124
+
125
+ Adherence = (VERIFIED×1.0 + PARTIAL×0.5) / (Total - UNTESTABLE) × 100
126
+
127
+ Scope Creep = Extra files modified / Total files modified × 100
128
+ ```
129
+
130
+ ## Drift Report Format
131
+
132
+ ```markdown
133
+ ## Reconciliation Report: <bead-id>
134
+
135
+ **PRD:** `.beads/artifacts/<id>/prd.md`
136
+ **Branch:** `<branch-name>`
137
+ **Adherence Score:** [N]%
138
+ **Scope Creep:** [N]%
139
+
140
+ ### Success Criteria
141
+
142
+ | # | Criterion | Status | Evidence |
143
+ | --- | ---------------- | ----------- | ------------------------------------------ |
144
+ | 1 | [criterion text] | ✅ VERIFIED | `src/file.ts:42` — [what confirms it] |
145
+ | 2 | [criterion text] | ⚠️ PARTIAL | `src/file.ts` exists but handler is a stub |
146
+ | 3 | [criterion text] | ❌ MISSING | No code evidence found |
147
+
148
+ ### File Reconciliation
149
+
150
+ | Category | Files | Count |
151
+ | --------------------------- | -------------------------- | ----- |
152
+ | ✅ Expected & Modified | `src/api/users.ts`, ... | [N] |
153
+ | ❌ Expected but Untouched | `src/models/user.ts`, ... | [N] |
154
+ | ⚠️ Unexpected Modifications | `src/utils/helper.ts`, ... | [N] |
155
+
156
+ ### Drift Issues
157
+
158
+ | # | Type | Severity | Description | Recommendation |
159
+ | --- | --------------- | -------- | ---------------- | -------------------------------------------------------------- |
160
+ | 1 | Missing Feature | HIGH | [what's missing] | Implement or use `/iterate --scope reduce` to remove from spec |
161
+ | 2 | Scope Creep | MEDIUM | [what's extra] | Document in PRD or revert |
162
+
163
+ ### Verdict
164
+
165
+ | Score | Meaning | Action |
166
+ | ----------- | -------------------- | ------------------------------------------------------ |
167
+ | **90-100%** | Excellent adherence | Ready to close |
168
+ | **70-89%** | Good with minor gaps | Fix gaps or document as intentional deviations |
169
+ | **50-69%** | Significant drift | Use `/iterate` to reconcile spec and code |
170
+ | **<50%** | Major drift | **BLOCK** — spec and code are fundamentally misaligned |
171
+ ```
172
+
173
+ ## Integration Points
174
+
175
+ - **`/ship` Phase 5**: Run reconcile after review, before close decision
176
+ - **`/compound`**: Include adherence score in retrospective observations
177
+ - **`/pr`**: Include drift report in PR description
178
+
179
+ ## Gotchas
180
+
181
+ - Some criteria genuinely can't be verified by code search (UI behavior, UX feel) — mark as UNTESTABLE, don't count against score
182
+ - Scope creep isn't always bad — sometimes good engineering requires touching adjacent files. Flag it, don't auto-block.
183
+ - Run AFTER phantom completion detection — reconcile assumes code is substantive, not stubs
@@ -245,6 +245,81 @@ After ANY `task()` subagent returns with "success", follow the **Worker Distrust
245
245
  > check a file, verify a condition, reject if unmet. Don't rely on the agent
246
246
  > "remembering" to follow the rule.
247
247
 
248
+ ## Phantom Completion Detection
249
+
250
+ Tasks can "pass" verification while containing stub implementations. This gate catches completions that are technically correct but substantively empty.
251
+
252
+ ### When to Run
253
+
254
+ - After all PRD tasks are marked complete (during `/ship` Phase 4-5)
255
+ - Before closing any bead
256
+ - When `--full` verification is requested
257
+
258
+ ### Stub Patterns to Detect
259
+
260
+ Scan all files modified in the current task/bead for these phantom indicators:
261
+
262
+ ```bash
263
+ # Run against modified code files only (exclude .md, .json, .yml to avoid false positives)
264
+ git diff --name-only origin/main | grep -E '\.(ts|tsx|js|jsx|py|rs|go|swift|kt|java)$' | xargs grep -nE \
265
+ 'return null|return undefined|return \{\}|return \[\]|onClick=\{?\(\) => \{\}\}?|TODO|FIXME|placeholder|stub|not.?implemented|throw new Error\(.Not implemented' \
266
+ 2>/dev/null
267
+ ```
268
+
269
+ | Pattern | What It Indicates | Severity |
270
+ | -------------------------------------------------------- | ------------------------- | -------- |
271
+ | `return null` / `return undefined` | Empty implementation | HIGH |
272
+ | `return {}` / `return []` | Hollow data | HIGH |
273
+ | `onClick={() => {}}` | No-op handler | HIGH |
274
+ | `<div>Component</div>` / `<div>{/* TODO */}</div>` | Placeholder UI | HIGH |
275
+ | `TODO` / `FIXME` / `HACK` | Acknowledged incomplete | MEDIUM |
276
+ | `placeholder` / `stub` / `not implemented` | Self-documenting stubs | HIGH |
277
+ | `throw new Error("Not implemented")` | Explicit stub | HIGH |
278
+ | `fetch('/api/...')` without `await` or error handling | Disconnected call | MEDIUM |
279
+ | `Response.json({ok: true})` or static hardcoded response | Fake API response | HIGH |
280
+ | `console.log` as only function body | Debug-only implementation | MEDIUM |
281
+
282
+ ### Three-Level Artifact Verification
283
+
284
+ For each file listed in PRD `Affected Files`:
285
+
286
+ | Level | Check | How |
287
+ | ------------------ | ---------------------- | -------------------------------------------------------------------------------------------- |
288
+ | **1: Exists** | File is present | `ls path/to/file.ts` |
289
+ | **2: Substantive** | Not a stub/placeholder | `grep -v "TODO\|FIXME\|return null\|placeholder" path/to/file.ts` — verify real logic exists |
290
+ | **3: Wired** | Connected and used | `grep -r "import.*ExportName" src/` — verify other files import/use it |
291
+
292
+ ### Key Link Verification
293
+
294
+ Check that components are actually connected (not just existing side-by-side):
295
+
296
+ | Connection Type | Check Command |
297
+ | --------------- | -------------------------------------------------------------- |
298
+ | Component → API | `grep -E "fetch.*api/\|axios\|useSWR\|useQuery" Component.tsx` |
299
+ | API → Database | `grep -E "prisma\.\|db\.\|sql\|query" route.ts` |
300
+ | Form → Handler | `grep "onSubmit\|handleSubmit" Component.tsx` |
301
+ | State → Render | `grep "{stateVar}" Component.tsx` |
302
+ | Route → Page | Check router config references the page component |
303
+
304
+ ### Phantom Score
305
+
306
+ After running all checks, report a phantom score:
307
+
308
+ ```
309
+ Phantom Completion Check:
310
+ - Files scanned: [N]
311
+ - Stubs found: [N] (HIGH: [n], MEDIUM: [n])
312
+ - Artifact levels: [N] exist, [M] substantive, [K] wired
313
+ - Key links verified: [N]/[M]
314
+ - Score: [CLEAN | SUSPECT | PHANTOM]
315
+ ```
316
+
317
+ | Score | Criteria | Action |
318
+ | ----------- | ---------------------------------------------- | --------------------------------- |
319
+ | **CLEAN** | 0 HIGH stubs, all artifacts Level 3 | Proceed |
320
+ | **SUSPECT** | 1-2 MEDIUM stubs OR 1 artifact not Level 3 | Report, ask user |
321
+ | **PHANTOM** | Any HIGH stubs OR >2 artifacts not substantive | **BLOCK** — fix before completion |
322
+
248
323
  ## Why This Matters
249
324
 
250
325
  From 24 failure memories:
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: verification-gates
3
+ description: >
4
+ Use when running pre-merge or pre-PR verification checks. Detects project type and runs appropriate build, test, lint, and typecheck commands.
5
+ version: 1.0.0
6
+ tags: [verification, testing, lint, typecheck, ci]
7
+ ---
8
+
9
+ # Verification Gates
10
+
11
+ Detect project type and run the appropriate verification commands before merging or creating PRs.
12
+
13
+ ## When to Use
14
+
15
+ - In `/pr` before creating a pull request
16
+ - In `/review-codebase` during automated checks phase
17
+ - In `/ship` during final verification
18
+ - Any command that needs to verify code quality before completion
19
+
20
+ ## When NOT to Use
21
+
22
+ - For incremental checks during development (just run the specific tool)
23
+ - When only one check type is needed (e.g., lint-only)
24
+
25
+ ## Project Type Detection
26
+
27
+ | Project Type | Detect Via | Build | Test | Lint | Typecheck |
28
+ | --------------- | ----------------------------- | ---------------- | --------------- | ----------------------------- | ------------------------------------- |
29
+ | Node/TypeScript | `package.json` | `npm run build` | `npm test` | `npm run lint` | `npm run typecheck` or `tsc --noEmit` |
30
+ | Rust | `Cargo.toml` | `cargo build` | `cargo test` | `cargo clippy -- -D warnings` | (included in build) |
31
+ | Python | `pyproject.toml` / `setup.py` | — | `pytest` | `ruff check .` | `mypy .` |
32
+ | Go | `go.mod` | `go build ./...` | `go test ./...` | `golangci-lint run` | (included in build) |
33
+
34
+ ## Protocol
35
+
36
+ ### Step 1: Detect project type
37
+
38
+ Check for indicator files in the project root. Multiple types may coexist (e.g., Node + Python monorepo).
39
+
40
+ ### Step 2: Run checks in parallel where possible
41
+
42
+ ```bash
43
+ # Run typecheck and lint in parallel
44
+ npm run typecheck &
45
+ npm run lint &
46
+ wait
47
+
48
+ # Then run tests (may depend on build)
49
+ npm test
50
+ ```
51
+
52
+ ### Step 3: Report results
53
+
54
+ For each check, report:
55
+
56
+ - **Pass/Fail** status
57
+ - **Error count** (if failed)
58
+ - **Key error messages** (first 5)
59
+
60
+ ### Step 4: Gate decision
61
+
62
+ - **All pass:** Proceed with the command
63
+ - **Any fail:** Stop and report. Let the user decide whether to proceed or fix.