dev-playbooks 2.2.1 → 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/CHANGELOG.md +30 -0
- package/README.md +133 -462
- package/package.json +1 -1
- package/scripts/config-discovery.sh +1 -1
- package/scripts/detect-mcp.sh +86 -0
- package/skills/Skill-Development-Guide.md +1 -2
- package/skills/_shared/mcp-enhancement-template-mcp-enhancement.md +30 -113
- package/skills/_shared/references/completeness-thinking-framework.md +86 -0
- package/skills/_shared/references/human-advice-calibration-prompt.md +27 -0
- package/skills/devbooks-archiver/SKILL.md +20 -12
- package/skills/devbooks-archiver/references/archiver-prompt.md +66 -38
- package/skills/devbooks-brownfield-bootstrap/SKILL.md +32 -65
- package/skills/devbooks-coder/SKILL.md +61 -240
- package/skills/devbooks-coder/references/completion-status-and-routing.md +8 -8
- package/skills/devbooks-convergence-audit/SKILL.md +20 -0
- package/skills/devbooks-delivery-workflow/SKILL.md +26 -227
- package/skills/devbooks-delivery-workflow/references/orchestration-bans-and-stage-table.md +45 -0
- package/skills/devbooks-design-backport/SKILL.md +16 -3
- package/skills/devbooks-design-doc/SKILL.md +21 -9
- package/skills/devbooks-docs-consistency/SKILL.md +170 -0
- package/skills/devbooks-docs-consistency/references/completeness-dimensions.yaml +31 -0
- package/skills/devbooks-docs-consistency/references/doc-classification.yaml +11 -0
- package/skills/devbooks-docs-consistency/references/docs-rules-schema.yaml +11 -0
- package/skills/devbooks-docs-consistency/scripts/alias.sh +5 -0
- package/skills/devbooks-docs-consistency/scripts/completeness-checker.sh +153 -0
- package/skills/devbooks-docs-consistency/scripts/doc-classifier.sh +121 -0
- package/skills/devbooks-docs-consistency/scripts/git-adapter.sh +32 -0
- package/skills/devbooks-docs-consistency/scripts/rules-engine.sh +255 -0
- package/skills/devbooks-docs-consistency/scripts/scanner.sh +93 -0
- package/skills/devbooks-docs-consistency/scripts/style-checker.sh +123 -0
- package/skills/devbooks-docs-sync/SKILL.md +23 -318
- package/skills/devbooks-entropy-monitor/SKILL.md +15 -32
- package/skills/devbooks-impact-analysis/SKILL.md +26 -46
- package/skills/devbooks-implementation-plan/SKILL.md +23 -9
- package/skills/devbooks-proposal-author/SKILL.md +21 -15
- package/skills/devbooks-proposal-challenger/SKILL.md +16 -3
- package/skills/devbooks-proposal-judge/SKILL.md +16 -3
- package/skills/devbooks-reviewer/SKILL.md +23 -42
- package/skills/devbooks-router/SKILL.md +22 -356
- package/skills/devbooks-router/references/routing-rules-and-templates.md +120 -0
- package/skills/devbooks-spec-contract/SKILL.md +23 -39
- package/skills/devbooks-test-owner/SKILL.md +68 -309
- package/skills/devbooks-test-reviewer/SKILL.md +15 -5
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Router: routing rules and output templates (reference)
|
|
2
|
+
|
|
3
|
+
This file carries the detailed rules and examples for Router, to keep `skills/devbooks-router/SKILL.md` small and stable.
|
|
4
|
+
|
|
5
|
+
## Config discovery (protocol-agnostic, mandatory)
|
|
6
|
+
|
|
7
|
+
- `<truth-root>`: truth directory root
|
|
8
|
+
- `<change-root>`: change package root
|
|
9
|
+
|
|
10
|
+
Discovery order (stop at the first match):
|
|
11
|
+
1. `.devbooks/config.yaml` (if exists) → parse mappings
|
|
12
|
+
2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks default mapping
|
|
13
|
+
3. `project.md` (if exists) → template default mapping
|
|
14
|
+
4. If still unknown → stop and ask the user
|
|
15
|
+
|
|
16
|
+
Constraints:
|
|
17
|
+
- If `agents_doc` is specified, read it before doing anything.
|
|
18
|
+
- Do not guess directory roots.
|
|
19
|
+
|
|
20
|
+
## Structured analysis capability check (automatic)
|
|
21
|
+
|
|
22
|
+
Before routing, check whether structured code analysis is available (dependency/ref tracking):
|
|
23
|
+
|
|
24
|
+
- If unavailable: warn that impact analysis/review will degrade to text search; continue routing.
|
|
25
|
+
- If available: continue silently.
|
|
26
|
+
|
|
27
|
+
## Output template (mandatory)
|
|
28
|
+
|
|
29
|
+
1) Ask 2 minimum key questions (skip if already known from context):
|
|
30
|
+
- What is the `<change-id>`?
|
|
31
|
+
- What are the final values of `<truth-root>` / `<change-root>` in this project?
|
|
32
|
+
|
|
33
|
+
2) Output 3–6 next-step routing items:
|
|
34
|
+
- Each item: Skill to use + artifact path + why it’s needed.
|
|
35
|
+
|
|
36
|
+
3) If the user asks to “start producing file content”, switch to the target Skill’s output mode.
|
|
37
|
+
|
|
38
|
+
## Default routing rules
|
|
39
|
+
|
|
40
|
+
### A) Proposal phase
|
|
41
|
+
|
|
42
|
+
Signals: “proposal/why/risks/scope/refactor proposal/don’t write code yet”.
|
|
43
|
+
|
|
44
|
+
Default:
|
|
45
|
+
- `devbooks-proposal-author` → `(<change-root>/<change-id>/proposal.md)`
|
|
46
|
+
- `devbooks-design-doc` → `(<change-root>/<change-id>/design.md)`
|
|
47
|
+
- `devbooks-implementation-plan` → `(<change-root>/<change-id>/tasks.md)`
|
|
48
|
+
|
|
49
|
+
Add when needed:
|
|
50
|
+
- cross-module / unclear impact → `devbooks-impact-analysis`
|
|
51
|
+
- high risk / trade-offs → `devbooks-proposal-challenger` + `devbooks-proposal-judge`
|
|
52
|
+
- external behavior / contract change → `devbooks-spec-contract` → `(<change-root>/<change-id>/specs/**)`
|
|
53
|
+
|
|
54
|
+
### B) Apply phase (Test Owner / Coder)
|
|
55
|
+
|
|
56
|
+
Signals: “start implementing/run tests/fix failures/make gates green”.
|
|
57
|
+
|
|
58
|
+
Default (role isolation):
|
|
59
|
+
- Test Owner (separate conversation): `devbooks-test-owner` → `(<change-root>/<change-id>/verification.md)` + `tests/**`
|
|
60
|
+
- Coder (separate conversation): `devbooks-coder` (must not modify `tests/**`)
|
|
61
|
+
|
|
62
|
+
### C) Review phase
|
|
63
|
+
|
|
64
|
+
Signals: “review/maintainability/smells/consistency”.
|
|
65
|
+
|
|
66
|
+
Default:
|
|
67
|
+
- `devbooks-reviewer`
|
|
68
|
+
- `devbooks-test-reviewer`
|
|
69
|
+
|
|
70
|
+
### D) Docs sync
|
|
71
|
+
|
|
72
|
+
Signals: “update docs/sync docs/README update”.
|
|
73
|
+
|
|
74
|
+
Default:
|
|
75
|
+
- `devbooks-docs-consistency`
|
|
76
|
+
|
|
77
|
+
### E) Archive phase
|
|
78
|
+
|
|
79
|
+
Signals: “archive/close the loop/merge specs”.
|
|
80
|
+
|
|
81
|
+
Default:
|
|
82
|
+
- `devbooks-archiver`
|
|
83
|
+
|
|
84
|
+
Pre-archive check (recommended):
|
|
85
|
+
- `change-check.sh <change-id> --mode strict ...`
|
|
86
|
+
|
|
87
|
+
### F) Prototype track
|
|
88
|
+
|
|
89
|
+
Signals: “prototype/spike/throwaway prototype/--prototype”.
|
|
90
|
+
|
|
91
|
+
Default:
|
|
92
|
+
1. `change-scaffold.sh <change-id> --prototype ...`
|
|
93
|
+
2. Test Owner: `devbooks-test-owner --prototype`
|
|
94
|
+
3. Coder: `devbooks-coder --prototype` (write under `(<change-root>/<change-id>/prototype/src/)`)
|
|
95
|
+
4. Promote explicitly: `prototype-promote.sh <change-id>`
|
|
96
|
+
|
|
97
|
+
## Optional: Impact profile parsing
|
|
98
|
+
|
|
99
|
+
If `proposal.md` includes an `impact_profile:` YAML block, Router can use it to refine routing.
|
|
100
|
+
|
|
101
|
+
Example:
|
|
102
|
+
```yaml
|
|
103
|
+
impact_profile:
|
|
104
|
+
external_api: true/false
|
|
105
|
+
architecture_boundary: true/false
|
|
106
|
+
data_model: true/false
|
|
107
|
+
cross_repo: true/false
|
|
108
|
+
risk_level: high/medium/low
|
|
109
|
+
affected_modules:
|
|
110
|
+
- name: <module-path>
|
|
111
|
+
type: add/modify/delete
|
|
112
|
+
files: <count>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Context detection (resume)
|
|
116
|
+
|
|
117
|
+
Infer phase from existing artifacts:
|
|
118
|
+
- `proposal.md`, `design.md`, `tasks.md`, `verification.md`
|
|
119
|
+
- `evidence/green-final/`
|
|
120
|
+
|
|
@@ -12,7 +12,28 @@ allowed-tools:
|
|
|
12
12
|
|
|
13
13
|
# DevBooks: Spec & Contract
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## Progressive Disclosure
|
|
16
|
+
|
|
17
|
+
### Base (Required)
|
|
18
|
+
Goal: Produce a spec delta and external contract notes for a change, without implementation steps.
|
|
19
|
+
Inputs: `proposal.md`, `design.md`, existing truth specs, and change scope.
|
|
20
|
+
Outputs: spec deltas under `<change-root>/<change-id>/specs/<capability>/spec.md` and contract notes (as required).
|
|
21
|
+
Boundaries: spec stage only; do not write implementation steps; do not modify code or `tests/**`.
|
|
22
|
+
Evidence: reference spec paths, contract IDs, and evidence outputs.
|
|
23
|
+
|
|
24
|
+
### Advanced (Optional)
|
|
25
|
+
Use when you need: compatibility strategy, migration notes, implicit change detection.
|
|
26
|
+
|
|
27
|
+
### Extended (Optional)
|
|
28
|
+
Use when you need: faster search/impact via optional MCP capabilities.
|
|
29
|
+
|
|
30
|
+
## Recommended MCP Capability Types
|
|
31
|
+
- Code search (code-search)
|
|
32
|
+
- Reference tracking (reference-tracking)
|
|
33
|
+
- Impact analysis (impact-analysis)
|
|
34
|
+
- Doc retrieval (doc-retrieval)
|
|
35
|
+
|
|
36
|
+
> This skill combines the functionality of the original `devbooks-spec-delta` and `devbooks-contract-data`.
|
|
16
37
|
|
|
17
38
|
## Prerequisites: Configuration Discovery (Protocol-Agnostic)
|
|
18
39
|
|
|
@@ -178,48 +199,11 @@ After completing spec-contract, output:
|
|
|
178
199
|
|
|
179
200
|
**Next: `devbooks-implementation-plan`**
|
|
180
201
|
|
|
181
|
-
|
|
202
|
+
Next: Create an implementation plan (`tasks.md`) with trackable tasks and acceptance anchors.
|
|
182
203
|
|
|
183
204
|
### How to invoke
|
|
184
205
|
```
|
|
185
206
|
Run devbooks-implementation-plan skill for change <change-id>
|
|
186
207
|
```
|
|
187
|
-
```
|
|
188
208
|
|
|
189
209
|
---
|
|
190
|
-
|
|
191
|
-
## MCP Enhancement
|
|
192
|
-
|
|
193
|
-
This Skill supports MCP runtime enhancement, automatically detecting and enabling advanced features.
|
|
194
|
-
|
|
195
|
-
MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template-mcp-enhancement.md`
|
|
196
|
-
|
|
197
|
-
### Dependent MCP Services
|
|
198
|
-
|
|
199
|
-
| Service | Purpose | Timeout |
|
|
200
|
-
|---------|---------|---------|
|
|
201
|
-
| `mcp__ckb__findReferences` | Detect contract reference scope | 2s |
|
|
202
|
-
| `mcp__ckb__getStatus` | Detect CKB index availability | 2s |
|
|
203
|
-
|
|
204
|
-
### Detection Process
|
|
205
|
-
|
|
206
|
-
1. Call `mcp__ckb__getStatus` (2s timeout)
|
|
207
|
-
2. If CKB available -> Use `findReferences` to detect reference scope of contract symbols
|
|
208
|
-
3. If timeout or failure -> Fallback to Grep text search
|
|
209
|
-
|
|
210
|
-
### Enhanced Mode vs Basic Mode
|
|
211
|
-
|
|
212
|
-
| Feature | Enhanced Mode | Basic Mode |
|
|
213
|
-
|---------|---------------|------------|
|
|
214
|
-
| Reference detection | Symbol-level precise matching | Grep text search |
|
|
215
|
-
| Contract impact scope | Call graph analysis | Direct reference counting |
|
|
216
|
-
| Compatibility risk | Automatic assessment | Manual judgment |
|
|
217
|
-
|
|
218
|
-
### Fallback Notice
|
|
219
|
-
|
|
220
|
-
When MCP is unavailable, output the following notice:
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
Warning: CKB unavailable, using Grep text search for contract reference detection.
|
|
224
|
-
Results may be less precise. Consider manually generating SCIP index for more precise results.
|
|
225
|
-
```
|
|
@@ -12,325 +12,84 @@ allowed-tools:
|
|
|
12
12
|
|
|
13
13
|
# DevBooks: Test Owner
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Progressive Disclosure
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
### Base (Required)
|
|
18
|
+
Goal: Author acceptance tests and `verification.md`, produce a Red baseline first, then audit Green evidence before checking off the AC matrix.
|
|
19
|
+
Inputs: design/specs, change package context, project test conventions.
|
|
20
|
+
Outputs: `tests/**`, `<change-root>/<change-id>/verification.md`, evidence logs under `evidence/red-baseline/` and `evidence/green-final/`.
|
|
21
|
+
Boundaries: do not modify implementation code (e.g. `src/**`); do not edit `tasks.md`.
|
|
22
|
+
Evidence: reference test logs and evidence paths.
|
|
20
23
|
|
|
21
|
-
|
|
24
|
+
### Advanced (Optional)
|
|
25
|
+
Use when you need: test layering, edge cases, isolation techniques, deviation routing.
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
↓ ↓ ↓
|
|
26
|
-
Red baseline Implement Evidence audit
|
|
27
|
-
(incremental) (@smoke) (no @full rerun)
|
|
28
|
-
```
|
|
27
|
+
### Extended (Optional)
|
|
28
|
+
Use when you need: faster search/impact via optional MCP capabilities.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Recommended MCP Capability Types
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| **Phase 2: Green Verification** | After Coder completes + @full passes | **Audit evidence**, check off AC matrix | Default no rerun, optional sampling | AC matrix checked, Status=Verified |
|
|
32
|
+
- Code search (code-search)
|
|
33
|
+
- Reference tracking (reference-tracking)
|
|
34
|
+
- Impact analysis (impact-analysis)
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
## Role Isolation (Mandatory)
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| Phase 2 reruns full tests | Phase 2 defaults to **evidence audit**, optional sampling rerun | Avoid slow test multiple runs |
|
|
43
|
-
| No test layering requirement | Mandatory test layering: `@smoke`/`@critical`/`@full` | Fast feedback loop |
|
|
38
|
+
- Test Owner and Coder must be separate conversations/instances.
|
|
39
|
+
- Do not switch roles within one conversation.
|
|
40
|
+
- This role only produces `tests/**` and `verification.md`.
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Prerequisites: Configuration Discovery
|
|
48
|
-
|
|
49
|
-
- `<truth-root>`: Current truth directory root
|
|
50
|
-
- `<change-root>`: Change package directory root
|
|
51
|
-
|
|
52
|
-
Before execution, **must** search for configuration in the following order (stop when found):
|
|
53
|
-
1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
|
|
54
|
-
2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
|
|
55
|
-
3. `project.md` (if exists) → Template protocol, use default mappings
|
|
56
|
-
4. If still unable to determine → **Stop and ask user**
|
|
57
|
-
|
|
58
|
-
**Key Constraints**:
|
|
59
|
-
- If `agents_doc` (rules document) is specified in configuration, **must read that document first** before performing any operations
|
|
60
|
-
- Do not guess directory roots
|
|
61
|
-
|
|
62
|
-
## Artifact Locations
|
|
63
|
-
|
|
64
|
-
- Test plan and traceability: `<change-root>/<change-id>/verification.md`
|
|
65
|
-
- Test code: Per repository conventions (e.g., `tests/**`)
|
|
66
|
-
- Red baseline evidence: `<change-root>/<change-id>/evidence/red-baseline/`
|
|
67
|
-
- Green evidence: `<change-root>/<change-id>/evidence/green-final/`
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 📚 Reference Documentation
|
|
72
|
-
|
|
73
|
-
### Must Read (Read Immediately)
|
|
42
|
+
## Core Responsibilities
|
|
74
43
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
44
|
+
- Maintain `<change-root>/<change-id>/verification.md` (traceability + status).
|
|
45
|
+
- Phase 1 (Red baseline): write tests and capture failing evidence.
|
|
46
|
+
- Phase 2 (Green verification): audit Green evidence after full gates pass, then check off the AC matrix.
|
|
47
|
+
- Record design/spec gaps to `deviation-log.md` for backporting.
|
|
78
48
|
|
|
79
|
-
|
|
80
|
-
- No stub tests, no demo mode, tests must not be decoupled from AC
|
|
81
|
-
- AC coverage matrix checkbox permissions
|
|
82
|
-
- Test isolation and stability requirements
|
|
49
|
+
## Hard Boundaries
|
|
83
50
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
- Strictly follow this prompt
|
|
87
|
-
|
|
88
|
-
### Read as Needed for Phase 1 (When Writing Tests)
|
|
89
|
-
|
|
90
|
-
4. **Test Driven Development**: `references/test-driven-development.md`
|
|
91
|
-
- Complete TDD methodology
|
|
92
|
-
- Red-Green-Refactor cycle
|
|
93
|
-
- When to read: When needing to understand TDD principles
|
|
94
|
-
|
|
95
|
-
5. **Test Layering Strategy**: `references/test-layering-strategy.md`
|
|
96
|
-
- Unit/Integration/E2E test layering
|
|
97
|
-
- Test pyramid principles
|
|
98
|
-
- When to read: When planning test type distribution
|
|
99
|
-
|
|
100
|
-
6. **Test Layering and Execution Strategy**: `references/test-layering-and-execution-strategy.md`
|
|
101
|
-
- @smoke/@critical/@full label details
|
|
102
|
-
- Test run strategy by phase
|
|
103
|
-
- Async vs sync boundaries
|
|
104
|
-
- When to read: When needing to understand test run strategy
|
|
105
|
-
|
|
106
|
-
7. **Decoupling Techniques Cheatsheet**: `references/decoupling-techniques-cheatsheet.md`
|
|
107
|
-
- Mock/Stub/Fake techniques
|
|
108
|
-
- Dependency injection patterns
|
|
109
|
-
- When to read: When needing to isolate external dependencies
|
|
110
|
-
|
|
111
|
-
8. **Async System Test Strategy**: `references/async-system-test-strategy.md`
|
|
112
|
-
- Async code testing techniques
|
|
113
|
-
- Event-driven system testing
|
|
114
|
-
- When to read: When testing async functionality
|
|
115
|
-
|
|
116
|
-
9. **Verification Template and Structure**: `references/verification-template-and-structure.md`
|
|
117
|
-
- Complete verification.md template
|
|
118
|
-
- Status field permissions
|
|
119
|
-
- AC coverage matrix structure
|
|
120
|
-
- When to read: When creating verification.md
|
|
121
|
-
|
|
122
|
-
10. **Change Verification and Traceability Template**: `references/9-change-verification-traceability-template.md`
|
|
123
|
-
- Traceability matrix template
|
|
124
|
-
- Boundary condition checklist
|
|
125
|
-
- When to read: When needing complete template reference
|
|
126
|
-
|
|
127
|
-
### Must Read for Phase 2 (When Auditing Evidence)
|
|
128
|
-
|
|
129
|
-
11. **Phase 2 Evidence Audit Checklist**: `references/phase2-evidence-audit-checklist.md`
|
|
130
|
-
- Complete evidence audit steps
|
|
131
|
-
- When to sample rerun
|
|
132
|
-
- How to check off AC matrix
|
|
133
|
-
- When to read: Immediately upon entering Phase 2
|
|
134
|
-
|
|
135
|
-
---
|
|
51
|
+
- Allowed: `tests/**`, `verification.md`, evidence logs.
|
|
52
|
+
- Prohibited: implementation changes, editing `tasks.md`.
|
|
136
53
|
|
|
137
|
-
##
|
|
138
|
-
|
|
139
|
-
### Phase 1: Red Baseline (Write Tests)
|
|
140
|
-
|
|
141
|
-
1. **Read design documents**:
|
|
142
|
-
```bash
|
|
143
|
-
# Read design.md and ACs
|
|
144
|
-
cat <change-root>/<change-id>/design.md
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
2. **Create verification.md**:
|
|
148
|
-
- Use `references/verification-template-and-structure.md`
|
|
149
|
-
- Establish AC coverage matrix
|
|
150
|
-
- Set Status = `Draft`
|
|
151
|
-
|
|
152
|
-
3. **Write tests**:
|
|
153
|
-
- Strictly follow `references/absolute-rules-and-constraints.md`
|
|
154
|
-
- Reference `references/test-code-prompt.md`
|
|
155
|
-
- At least one test per AC
|
|
156
|
-
|
|
157
|
-
4. **Run tests to produce Red baseline**:
|
|
158
|
-
```bash
|
|
159
|
-
# Only run newly written tests (incremental)
|
|
160
|
-
npm test -- --grep "AC-001|AC-002"
|
|
161
|
-
|
|
162
|
-
# Save failure evidence
|
|
163
|
-
npm test 2>&1 | tee <change-root>/<change-id>/evidence/red-baseline/test-$(date +%Y%m%d-%H%M%S).log
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
5. **Update verification.md**:
|
|
167
|
-
- Set Status = `Ready`
|
|
168
|
-
- Record Red baseline evidence path
|
|
169
|
-
|
|
170
|
-
6. **Check for deviations**:
|
|
171
|
-
- If design gaps found, record to `deviation-log.md`
|
|
172
|
-
- Reference `~/.claude/skills/_shared/references/deviation-detection-routing-protocol.md`
|
|
173
|
-
|
|
174
|
-
### Phase 2: Green Verification (Audit Evidence)
|
|
175
|
-
|
|
176
|
-
**Complete steps detailed in**: `references/phase2-evidence-audit-checklist.md`
|
|
177
|
-
|
|
178
|
-
Brief workflow:
|
|
179
|
-
1. Check `@full` tests have passed
|
|
180
|
-
2. Audit `evidence/green-final/` directory
|
|
181
|
-
3. Verify commit hash consistency
|
|
182
|
-
4. Audit test logs
|
|
183
|
-
5. Verify AC coverage
|
|
184
|
-
6. Optional sampling rerun
|
|
185
|
-
7. Check off AC matrix
|
|
186
|
-
8. Set Status = `Verified`
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Key Constraints
|
|
191
|
-
|
|
192
|
-
### Role Boundaries
|
|
193
|
-
|
|
194
|
-
| Allowed | Prohibited |
|
|
195
|
-
|---------|------------|
|
|
196
|
-
| Write tests in `tests/**` | ❌ Modify `src/**` code |
|
|
197
|
-
| Check off AC matrix (Phase 2) | ❌ Modify `tasks.md` |
|
|
198
|
-
| Set verification.md Status to Ready/Verified | ❌ Set Status to Done (Reviewer only) |
|
|
199
|
-
| Record deviations to `deviation-log.md` | ❌ Modify design.md directly |
|
|
200
|
-
| Run incremental tests (Phase 1) | ❌ Skip Red baseline |
|
|
201
|
-
| Audit evidence (Phase 2) | ❌ Check off AC matrix before @full passes |
|
|
202
|
-
|
|
203
|
-
### Code Quality Constraints
|
|
204
|
-
|
|
205
|
-
#### Test Isolation Requirements
|
|
206
|
-
|
|
207
|
-
- [ ] Each test must run independently, not dependent on execution order of other tests
|
|
208
|
-
- [ ] Integration tests must have `beforeEach`/`afterEach` cleanup
|
|
209
|
-
- [ ] Shared mutable state is prohibited
|
|
210
|
-
- [ ] Tests must clean up created files/data after completion
|
|
211
|
-
|
|
212
|
-
#### Test Stability Requirements
|
|
213
|
-
|
|
214
|
-
- [ ] Committing `test.only` / `it.only` / `describe.only` is prohibited
|
|
215
|
-
- [ ] Flaky tests must be marked and fixed within a deadline (no more than 1 week)
|
|
216
|
-
- [ ] Test timeouts must be reasonably set (unit tests < 5s, integration tests < 30s)
|
|
217
|
-
- [ ] External network dependencies are prohibited (mock all external calls)
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
## Output Management
|
|
222
|
-
|
|
223
|
-
Prevent large outputs from polluting context:
|
|
224
|
-
|
|
225
|
-
| Scenario | Handling |
|
|
226
|
-
|----------|----------|
|
|
227
|
-
| Test output > 50 lines | Keep only first and last 10 lines + failure summary |
|
|
228
|
-
| Red baseline logs | Write to `evidence/red-baseline/`, only reference path in dialogue |
|
|
229
|
-
| Green evidence logs | Write to `evidence/green-final/`, only reference path in dialogue |
|
|
230
|
-
| Large test case lists | Use table summary, do not paste item by item |
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## Evidence Path Convention
|
|
235
|
-
|
|
236
|
-
**Green evidence must be saved**:
|
|
237
|
-
```
|
|
238
|
-
<change-root>/<change-id>/evidence/green-final/
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**Correct path examples**:
|
|
242
|
-
```bash
|
|
243
|
-
# Dev-Playbooks default path
|
|
244
|
-
dev-playbooks/changes/<change-id>/evidence/green-final/test-$(date +%Y%m%d-%H%M%S).log
|
|
245
|
-
|
|
246
|
-
# Using the script
|
|
247
|
-
devbooks change-evidence <change-id> --label green-final -- npm test
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Deviation Detection and Persistence
|
|
253
|
-
|
|
254
|
-
**Reference**: `~/.claude/skills/_shared/references/deviation-detection-routing-protocol.md`
|
|
255
|
-
|
|
256
|
-
During test writing, **must immediately** write to `deviation-log.md` in these situations:
|
|
257
|
-
|
|
258
|
-
| Situation | Type | Example |
|
|
259
|
-
|-----------|------|---------|
|
|
260
|
-
| Found boundary case not covered by design.md | DESIGN_GAP | Concurrent write scenario |
|
|
261
|
-
| Found additional constraints needed | CONSTRAINT_CHANGE | Need to add parameter validation |
|
|
262
|
-
| Found interface adjustment needed | API_CHANGE | Need to add return field |
|
|
263
|
-
| Found configuration change needed | CONSTRAINT_CHANGE | Need new config parameter |
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Context Awareness
|
|
268
|
-
|
|
269
|
-
This Skill automatically detects context before execution to ensure role isolation and prerequisite satisfaction.
|
|
270
|
-
|
|
271
|
-
Detection rules reference: `~/.claude/skills/_shared/context-detection-template.md`
|
|
272
|
-
|
|
273
|
-
### Modes Supported by This Skill
|
|
274
|
-
|
|
275
|
-
| Mode | Trigger Condition | Behavior |
|
|
276
|
-
|------|-------------------|----------|
|
|
277
|
-
| **Initial Writing** | `verification.md` does not exist | Create complete acceptance test suite |
|
|
278
|
-
| **Supplementary Tests** | `verification.md` exists but has `[TODO]` | Add missing test cases |
|
|
279
|
-
| **Red Baseline Verification** | Tests exist, need to confirm Red status | Run tests and record failure logs |
|
|
280
|
-
| **Evidence Audit** | User says "verify/check off" and @full passes | Audit evidence and check off AC matrix |
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## Completion Status and Next Step Routing
|
|
285
|
-
|
|
286
|
-
### Phase 1 Completion Status
|
|
287
|
-
|
|
288
|
-
| Code | Status | Determination Criteria | Next Step |
|
|
289
|
-
|:----:|--------|------------------------|-----------|
|
|
290
|
-
| ✅ | PHASE1_COMPLETED | Red baseline produced, no deviations | Switch to `[CODER]` mode |
|
|
291
|
-
| ⚠️ | PHASE1_COMPLETED_WITH_DEVIATION | Red baseline produced, deviation-log has pending records | `devbooks-design-backport` |
|
|
292
|
-
| ❌ | BLOCKED | Needs external input/decision | Record breakpoint, wait for user |
|
|
293
|
-
| 💥 | FAILED | Test framework issues etc. | Fix and retry |
|
|
294
|
-
|
|
295
|
-
### Phase 2 Completion Status
|
|
296
|
-
|
|
297
|
-
| Code | Status | Determination Criteria | Next Step |
|
|
298
|
-
|:----:|--------|------------------------|-----------|
|
|
299
|
-
| ✅ | PHASE2_VERIFIED | Evidence audit passed, AC matrix checked | `devbooks-reviewer` |
|
|
300
|
-
| ⏳ | PHASE2_WAITING | @full tests still running | Wait for CI to complete |
|
|
301
|
-
| ❌ | PHASE2_FAILED | @full tests not passing | Notify Coder to fix |
|
|
302
|
-
| 🔄 | PHASE2_HANDOFF | Found issues with tests themselves | Fix tests then re-verify |
|
|
303
|
-
|
|
304
|
-
### Routing Output Template (Must Use)
|
|
305
|
-
|
|
306
|
-
```markdown
|
|
307
|
-
## Completion Status
|
|
308
|
-
|
|
309
|
-
**Phase**: Phase 1 (Red Baseline) / Phase 2 (Green Verification)
|
|
310
|
-
|
|
311
|
-
**Status**: ✅ PHASE1_COMPLETED / ✅ PHASE2_VERIFIED / ...
|
|
312
|
-
|
|
313
|
-
**Red Baseline**: Produced / Not completed (Phase 1 only)
|
|
314
|
-
|
|
315
|
-
**@full Tests**: Passed / Running / Failed (Phase 2 only)
|
|
316
|
-
|
|
317
|
-
**Evidence Audit**: Completed / Pending (Phase 2 only)
|
|
318
|
-
|
|
319
|
-
**AC Matrix**: Checked N/M / Not checked (Phase 2 only)
|
|
320
|
-
|
|
321
|
-
**Deviation Records**: Has N pending / None
|
|
322
|
-
|
|
323
|
-
## Next Step
|
|
324
|
-
|
|
325
|
-
**Recommended**: Switch to `[CODER]` mode / `devbooks-xxx skill`
|
|
326
|
-
|
|
327
|
-
**Reason**: [specific reason]
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
---
|
|
331
|
-
|
|
332
|
-
## MCP Enhancement
|
|
333
|
-
|
|
334
|
-
This Skill does not depend on MCP services, no runtime detection required.
|
|
54
|
+
## Prerequisites: Configuration Discovery
|
|
335
55
|
|
|
336
|
-
|
|
56
|
+
Before execution, you **must** search for configuration in the following order (stop when found):
|
|
57
|
+
1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
|
|
58
|
+
2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
|
|
59
|
+
3. `project.md` (if exists) -> Template protocol, use default mappings
|
|
60
|
+
4. If still undetermined -> **Stop and ask the user**
|
|
61
|
+
|
|
62
|
+
If the configuration specifies `agents_doc` (rules document), you **must read that document first** before performing any operations.
|
|
63
|
+
|
|
64
|
+
## Minimal Workflow
|
|
65
|
+
|
|
66
|
+
### Phase 1: Red Baseline
|
|
67
|
+
1. Read `design.md` and relevant specs.
|
|
68
|
+
2. Create or update `verification.md` with an AC coverage matrix.
|
|
69
|
+
3. Write tests under `tests/**`.
|
|
70
|
+
4. Run incremental tests and save Red baseline logs under `evidence/red-baseline/`.
|
|
71
|
+
5. Set verification status to `Ready` and reference the Red evidence path.
|
|
72
|
+
|
|
73
|
+
### Phase 2: Green Verification
|
|
74
|
+
1. Confirm Green evidence exists under `evidence/green-final/`.
|
|
75
|
+
2. Audit logs and consistency of commit hashes (if applicable).
|
|
76
|
+
3. Optionally rerun a small sampling set when evidence is insufficient.
|
|
77
|
+
4. Check off the AC matrix and set status to `Verified`.
|
|
78
|
+
|
|
79
|
+
## References
|
|
80
|
+
|
|
81
|
+
Required:
|
|
82
|
+
- `~/.claude/skills/_shared/references/ai-behavior-guidelines.md`
|
|
83
|
+
- `references/absolute-rules-and-constraints.md`
|
|
84
|
+
- `references/test-code-prompt.md`
|
|
85
|
+
- `references/verification-template-and-structure.md`
|
|
86
|
+
- `references/phase2-evidence-audit-checklist.md`
|
|
87
|
+
|
|
88
|
+
As needed:
|
|
89
|
+
- `references/test-driven-development.md`
|
|
90
|
+
- `references/test-layering-strategy.md`
|
|
91
|
+
- `references/test-layering-and-execution-strategy.md`
|
|
92
|
+
- `references/decoupling-techniques-cheatsheet.md`
|
|
93
|
+
- `references/async-system-test-strategy.md`
|
|
94
|
+
- `references/9-change-verification-traceability-template.md`
|
|
95
|
+
- `~/.claude/skills/_shared/references/deviation-detection-routing-protocol.md`
|
|
@@ -244,12 +244,22 @@ Detection Results:
|
|
|
244
244
|
|
|
245
245
|
---
|
|
246
246
|
|
|
247
|
-
## MCP Enhancement
|
|
248
247
|
|
|
249
|
-
|
|
248
|
+
## Progressive Disclosure
|
|
249
|
+
### Base (Required)
|
|
250
|
+
Goal: Clarify this Skill's core outputs and usage scope.
|
|
251
|
+
Inputs: User goals, existing documents, change package context, or project path.
|
|
252
|
+
Outputs: Executable artifacts, next-step guidance, or recorded paths.
|
|
253
|
+
Boundaries: Does not replace other roles; does not touch `tests/`.
|
|
254
|
+
Evidence: Reference output paths or execution records.
|
|
250
255
|
|
|
251
|
-
|
|
256
|
+
### Advanced (Optional)
|
|
257
|
+
Use when you need to refine strategy, boundaries, or risk notes.
|
|
252
258
|
|
|
253
|
-
|
|
259
|
+
### Extended (Optional)
|
|
260
|
+
Use when you need to coordinate with external systems or optional tools.
|
|
254
261
|
|
|
255
|
-
|
|
262
|
+
## Recommended MCP Capability Types
|
|
263
|
+
- Code search (code-search)
|
|
264
|
+
- Reference tracking (reference-tracking)
|
|
265
|
+
- Impact analysis (impact-analysis)
|