dev-playbooks 1.2.7 → 1.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.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/skills/_shared/references/spec-structure-template.md +161 -0
  3. package/skills/_shared/references/universal-gating-protocol.md +2 -2
  4. package/skills/devbooks-archiver/SKILL.md +27 -1
  5. package/skills/devbooks-brownfield-bootstrap/SKILL.md +1 -1
  6. package/skills/devbooks-code-review/SKILL.md +1 -1
  7. package/skills/devbooks-code-review/references/code-review-prompt.md +10 -0
  8. package/skills/devbooks-coder/SKILL.md +2 -2
  9. package/skills/devbooks-delivery-workflow/SKILL.md +1 -1
  10. package/skills/devbooks-delivery-workflow/scripts/change-check.sh +4 -4
  11. package/skills/devbooks-design-backport/SKILL.md +1 -1
  12. package/skills/devbooks-design-doc/SKILL.md +1 -1
  13. package/skills/devbooks-design-doc/references/design-doc-prompt.md +12 -2
  14. package/skills/devbooks-docs-sync/SKILL.md +1 -1
  15. package/skills/devbooks-entropy-monitor/SKILL.md +1 -1
  16. package/skills/devbooks-impact-analysis/SKILL.md +1 -1
  17. package/skills/devbooks-impact-analysis/references/impact-analysis-prompt.md +17 -0
  18. package/skills/devbooks-implementation-plan/SKILL.md +1 -1
  19. package/skills/devbooks-proposal-author/SKILL.md +1 -1
  20. package/skills/devbooks-proposal-challenger/SKILL.md +1 -1
  21. package/skills/devbooks-proposal-judge/SKILL.md +1 -1
  22. package/skills/devbooks-router/SKILL.md +1 -1
  23. package/skills/devbooks-spec-contract/SKILL.md +1 -1
  24. package/skills/devbooks-spec-contract/references/spec-change-prompt.md +11 -0
  25. package/skills/devbooks-test-owner/SKILL.md +2 -2
  26. package/skills/devbooks-test-owner/references/test-code-prompt.md +14 -0
  27. package/skills/devbooks-test-reviewer/SKILL.md +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-playbooks",
3
- "version": "1.2.7",
3
+ "version": "1.3.0",
4
4
  "description": "AI-powered spec-driven development workflow",
5
5
  "keywords": [
6
6
  "devbooks",
@@ -0,0 +1,161 @@
1
+ # Spec Structure Template
2
+
3
+ > This template defines the standard structure for Spec truth files, ensuring Specs are verifiable, traceable, and can drive test generation.
4
+
5
+ ## File Location
6
+
7
+ ```
8
+ <truth-root>/specs/<capability>/spec.md
9
+ ```
10
+
11
+ ## Standard Structure
12
+
13
+ ```markdown
14
+ ---
15
+ # Metadata (required)
16
+ capability: <capability-name>
17
+ owner: @<owner>
18
+ last_verified: YYYY-MM-DD
19
+ last_referenced_by: <last-referencing-change-id>
20
+ health: active | stale | deprecated
21
+ freshness_check: monthly | quarterly | on-change
22
+ ---
23
+
24
+ # <Capability Name> Specification
25
+
26
+ ## Glossary
27
+
28
+ > Capability-specific terms, consistent with `<truth-root>/_meta/glossary.md`.
29
+
30
+ | Term | Definition | Constraints |
31
+ |------|------------|-------------|
32
+ | Order | Order entity | Must have at least one OrderItem |
33
+ | OrderItem | Order line item | qty > 0, price >= 0 |
34
+
35
+ ## Invariants
36
+
37
+ > Constraints that must always hold; violations are system bugs.
38
+
39
+ | ID | Description | Verification |
40
+ |----|-------------|--------------|
41
+ | INV-001 | Order total = SUM(item.price * item.qty) | A (automated test) |
42
+ | INV-002 | Inventory quantity >= 0 | A (automated test) |
43
+ | INV-003 | Shipped orders cannot be cancelled | A (state machine test) |
44
+
45
+ ## Contracts
46
+
47
+ ### Preconditions
48
+
49
+ | ID | Operation | Condition | Violation Behavior |
50
+ |----|-----------|-----------|-------------------|
51
+ | PRE-001 | Create order | user.isAuthenticated | Return 401 |
52
+ | PRE-002 | Pay order | order.status == 'pending' | Return 400 |
53
+
54
+ ### Postconditions
55
+
56
+ | ID | Operation | Guarantee |
57
+ |----|-----------|-----------|
58
+ | POST-001 | Create order success | Generate unique order.id |
59
+ | POST-002 | Payment success | inventory.decreased(qty) |
60
+
61
+ ## State Machine
62
+
63
+ > If this capability involves state transitions, a state machine must be defined.
64
+
65
+ ### State Set
66
+
67
+ ```
68
+ States: {Created, Paid, Shipped, Done, Cancelled}
69
+ ```
70
+
71
+ ### Transition Rules
72
+
73
+ | Current State | Action | Target State | Condition |
74
+ |---------------|--------|--------------|-----------|
75
+ | Created | pay | Paid | payment.success |
76
+ | Created | cancel | Cancelled | - |
77
+ | Paid | ship | Shipped | inventory.reserved |
78
+ | Paid | refund | Cancelled | - |
79
+ | Shipped | deliver | Done | - |
80
+
81
+ ### Forbidden Transitions
82
+
83
+ | Current State | Action | Reason |
84
+ |---------------|--------|--------|
85
+ | Shipped | cancel | Violates INV-003 |
86
+ | Done | * | Terminal state, cannot exit |
87
+ | Cancelled | * | Terminal state, cannot exit |
88
+
89
+ ## Requirements
90
+
91
+ ### REQ-001: <Requirement Title>
92
+
93
+ **Description**: <one-sentence description>
94
+
95
+ **SHALL/SHOULD/MAY**:
96
+ - The system **SHALL** ...
97
+ - The system **SHOULD** ...
98
+
99
+ **Trace**: AC-001 (from design.md)
100
+
101
+ #### Scenario: <scenario-name>
102
+
103
+ - **GIVEN** user is logged in and cart is non-empty
104
+ - **WHEN** user clicks "Submit Order"
105
+ - **THEN** system creates order and returns order ID
106
+
107
+ **Data Instances** (boundary conditions):
108
+
109
+ | Input | Expected Output | Notes |
110
+ |-------|-----------------|-------|
111
+ | qty=1, price=100 | total=100 | Normal value |
112
+ | qty=0 | Reject | Boundary - zero |
113
+ | qty=-1 | Reject | Boundary - negative |
114
+
115
+ ---
116
+
117
+ ## Change History
118
+
119
+ | Date | Change Package | Changes |
120
+ |------|----------------|---------|
121
+ | 2024-01-16 | 20240116-1030-add-cancel | Add cancel order scenario |
122
+ ```
123
+
124
+ ## Usage Guide
125
+
126
+ ### 1. Who Writes Specs?
127
+
128
+ - **spec-contract skill**: Creates/updates spec deltas
129
+ - **archiver skill**: Merges spec deltas into truth-root
130
+
131
+ ### 2. Who Reads Specs?
132
+
133
+ | Skill | Reading Purpose |
134
+ |-------|-----------------|
135
+ | design-doc | Check if design conflicts with existing Specs, reference REQ-xxx |
136
+ | test-owner | Generate tests from contracts/state machines |
137
+ | impact-analysis | Identify affected Specs |
138
+ | code-review | Check terminology consistency |
139
+ | archiver | Update metadata, build reference chain |
140
+
141
+ ### 3. Test Generation Mapping
142
+
143
+ | Spec Element | Generated Test Type |
144
+ |--------------|---------------------|
145
+ | INV-xxx | Invariant tests |
146
+ | PRE-xxx | Precondition tests (satisfied + violated) |
147
+ | POST-xxx | Postcondition tests |
148
+ | State Transition | State transition tests |
149
+ | Forbidden Transition | Forbidden transition tests |
150
+ | Data Instance Table | Parameterized test cases |
151
+
152
+ ### 4. Health Detection
153
+
154
+ The `health` field in Spec files is automatically detected by entropy-monitor:
155
+
156
+ | Condition | health Status |
157
+ |-----------|---------------|
158
+ | last_verified < 90 days | `active` |
159
+ | last_verified > 90 days | `stale` (needs review) |
160
+ | Explicitly marked deprecated | `deprecated` |
161
+ | last_referenced_by empty for >6 months | Recommend deletion |
@@ -39,9 +39,9 @@ From now on, each time you write files, restate the `<truth-root>` and `<change-
39
39
  | Spec deltas | `<change-root>/<change-id>/specs/` | `./specs/` |
40
40
  | Traceability doc | `<change-root>/<change-id>/verification.md` | `./verification.md` |
41
41
 
42
- ### DevBooks 2.0 Default Paths
42
+ ### Dev-Playbooks Default Paths
43
43
 
44
- When using DevBooks 2.0 protocol:
44
+ When using Dev-Playbooks protocol:
45
45
  - `<change-root>` = `dev-playbooks/changes`
46
46
  - `<truth-root>` = `dev-playbooks/specs`
47
47
 
@@ -49,7 +49,7 @@ proposal → design → test-owner(P1) → coder → test-owner(P2) → code-rev
49
49
 
50
50
  Before execution, **must** search for configuration in the following order (stop when found):
51
51
  1. `.devbooks/config.yaml` (if exists) → Parse and use the mappings within
52
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
52
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
53
53
  3. `project.md` (if exists) → Template protocol, use default mappings
54
54
  4. If still unable to determine → **Stop and ask the user**
55
55
 
@@ -120,6 +120,32 @@ Merge change package spec artifacts into `<truth-root>`:
120
120
  | `<change-root>/<change-id>/specs/**` | `<truth-root>/specs/**` | Incremental merge |
121
121
  | `<change-root>/<change-id>/contracts/**` | `<truth-root>/contracts/**` | Versioned merge |
122
122
 
123
+ **Spec Metadata Update** (must execute during merge):
124
+
125
+ When merging specs into truth-root, the following metadata must be updated:
126
+
127
+ ```yaml
128
+ # Update in each merged/referenced spec file header
129
+ ---
130
+ last_referenced_by: <change-id> # Last change package referencing this spec
131
+ last_verified: <archive-date> # Last verification date
132
+ health: active # Health status: active | stale | deprecated
133
+ ---
134
+ ```
135
+
136
+ **Metadata Update Rules**:
137
+
138
+ | Scenario | Update Behavior |
139
+ |----------|-----------------|
140
+ | New Spec | Create complete metadata header |
141
+ | Modify existing Spec | Update `last_referenced_by` and `last_verified` |
142
+ | Spec referenced by design doc but not modified | Update only `last_referenced_by` |
143
+ | Marked as deprecated | Set `health: deprecated` |
144
+
145
+ **Building Reference Traceability Chain**:
146
+
147
+ During archiving, archiver automatically scans the "Affected Specs" declared in design.md and updates the `last_referenced_by` field for these Specs, even if they weren't directly modified. This establishes a reverse traceability chain from Specs to change packages.
148
+
123
149
  ### Step 4: Architecture Merge
124
150
 
125
151
  > **Design Decision**: C4 architecture changes are recorded in design.md's Architecture Impact section and merged into truth by Archiver during archiving.
@@ -20,7 +20,7 @@ allowed-tools:
20
20
 
21
21
  Before execution, **must** search for configuration in the following order (stop when found):
22
22
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
23
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
23
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
24
24
  3. `project.md` (if exists) → Template protocol, use default mappings
25
25
  5. If still unable to determine → **Create DevBooks directory structure and initialize basic configuration**
26
26
 
@@ -45,7 +45,7 @@ proposal → design → test-owner(phase1) → coder → test-owner(phase2) →
45
45
 
46
46
  Before execution, **must** search for configuration in the following order (stop when found):
47
47
  1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
48
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
48
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
49
49
  3. `project.md` (if exists) -> template protocol, use default mappings
50
50
  4. If still undetermined -> **Stop and ask user**
51
51
 
@@ -13,6 +13,10 @@ Inputs (provided by me):
13
13
  - Glossary / ubiquitous language (if present): `<truth-root>/_meta/glossary.md`
14
14
  - High-ROI pitfalls list (if present): `<truth-root>/engineering/pitfalls.md`
15
15
 
16
+ **Required Spec Truth Reading** (mandatory before review):
17
+ - `<truth-root>/specs/**`: existing spec files
18
+ - Purpose: verify code naming/structure aligns with terminology and contracts defined in Specs
19
+
16
20
  Hard constraints (must follow):
17
21
  1) Output only review findings and concrete change suggestions; do not directly modify `tests/` or design documents.
18
22
  2) Do not debate business correctness (tests/specs decide that); focus only on maintainability and engineering quality.
@@ -64,6 +68,12 @@ Review focus (must cover):
64
68
  - Is the same concept named inconsistently across modules (e.g., User/Account/Member mixed)?
65
69
  - Is Entity vs Value Object modeled correctly? (Entity has an ID; VO has no ID and is immutable.)
66
70
 
71
+ **Spec Truth Terminology Alignment** (must check):
72
+ - Do code names match terminology defined in `<truth-root>/specs/`?
73
+ - Do state names/enum values match state machine definitions in Specs?
74
+ - Do method names reflect actions/transitions in Specs? (e.g., `cancel()` corresponds to `order --[cancel]--> cancelled`)
75
+ - If naming inconsistencies are found, mark as "terminology drift risk" and recommend unification
76
+
67
77
  ---
68
78
 
69
79
  ## Invariant Protection (must check)
@@ -53,7 +53,7 @@ proposal → design → test-owner(phase1) → [Coder] → test-owner(phase2)
53
53
 
54
54
  Before execution, you **must** search for configuration in the following order (stop when found):
55
55
  1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
56
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
56
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
57
57
  3. `project.md` (if exists) -> template protocol, use default mappings
58
58
  5. If still unable to determine -> **Stop and ask the user**
59
59
 
@@ -161,7 +161,7 @@ GOOD: 3 tests failed, see <change-root>/<change-id>/evidence/green-final/test-ou
161
161
 
162
162
  **Correct path examples**:
163
163
  ```bash
164
- # DevBooks 2.0 default path
164
+ # Dev-Playbooks default path
165
165
  dev-playbooks/changes/<change-id>/evidence/green-final/test-$(date +%Y%m%d-%H%M%S).log
166
166
 
167
167
  # Using the script
@@ -19,7 +19,7 @@ allowed-tools:
19
19
 
20
20
  Before execution, **must** search for configuration in the following order (stop when found):
21
21
  1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
22
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
22
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
23
23
  3. `project.md` (if exists) -> template protocol, use default mappings
24
24
  4. If still undetermined -> **Stop and ask the user**
25
25
 
@@ -529,7 +529,7 @@ check_spec_deltas() {
529
529
  }
530
530
 
531
531
  # =============================================================================
532
- # Constitution Check (DevBooks 2.0)
532
+ # Constitution Check (Dev-Playbooks)
533
533
  # Verify project constitution is present and valid
534
534
  # =============================================================================
535
535
  check_constitution() {
@@ -557,7 +557,7 @@ check_constitution() {
557
557
  }
558
558
 
559
559
  # =============================================================================
560
- # Fitness Check (DevBooks 2.0)
560
+ # Fitness Check (Dev-Playbooks)
561
561
  # Verify architecture fitness rules
562
562
  # =============================================================================
563
563
  check_fitness() {
@@ -1037,9 +1037,9 @@ else
1037
1037
  check_verification
1038
1038
  check_no_tests_changed
1039
1039
  check_implicit_changes
1040
- # DevBooks 2.0: Constitution check
1040
+ # Dev-Playbooks: Constitution check
1041
1041
  check_constitution # Constitution validity check (strict mode)
1042
- # DevBooks 2.0: Fitness check
1042
+ # Dev-Playbooks: Fitness check
1043
1043
  check_fitness # Architecture fitness check (apply/archive/strict)
1044
1044
  # New quality gates (harden-devbooks-quality-gates)
1045
1045
  check_evidence_closure # AC-001: Green evidence required for archive
@@ -52,7 +52,7 @@ coder has deviations → archiver auto-detects and backports during archive →
52
52
 
53
53
  Before execution, you **must** search for configuration in the following order (stop when found):
54
54
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
55
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
55
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
56
56
  3. `project.md` (if exists) → Template protocol, use default mappings
57
57
  4. If still undetermined → **Stop and ask the user**
58
58
 
@@ -40,7 +40,7 @@ proposal → [Design Doc] → spec-contract → implementation-plan → test-own
40
40
 
41
41
  Before execution, **must** search for configuration in the following order (stop when found):
42
42
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
43
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
43
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
44
44
  3. `project.md` (if exists) → Template protocol, use default mappings
45
45
  5. If still unable to determine → **Stop and ask user**
46
46
 
@@ -18,6 +18,10 @@ Inputs (provided by me):
18
18
  - Chat history
19
19
  - Glossary / ubiquitous language (if present): `<truth-root>/_meta/glossary.md`
20
20
 
21
+ **Required Spec Truth Reading** (mandatory before designing):
22
+ - `<truth-root>/specs/**`: existing spec files (REQ/Invariants/Contracts)
23
+ - Purpose: ensure design does not conflict with existing specs and explicitly references affected specs
24
+
21
25
  Tasks:
22
26
  1) Output a design doc (not an implementation plan, not code).
23
27
  2) The doc must be concrete enough to drive acceptance and task decomposition: clear boundaries, contracts, red lines, and acceptance.
@@ -182,7 +186,13 @@ Limits:
182
186
 
183
187
  Additional requirements (for traceability in large projects):
184
188
  - Explicitly list affected capabilities/modules/external contracts (names and boundaries only; no implementation)
185
- - If external interfaces/APIs/events/data structures are involved: specify versioning strategy in the Core data and event contracts section (`schema_version`, compatibility window, migration/replay principles)
186
- - If architecture boundaries change: add an optional **C4 Delta** subsection under Target architecture describing what C1/C2/C3 elements were added/modified/removed (full maps are maintained by the C4 map maintainer)
189
+ - If external interfaces/APIs/events/data structures are involved: specify versioning strategy in the "Core data and event contracts" section (`schema_version`, compatibility window, migration/replay principles)
190
+ - If architecture boundaries change: add an optional **C4 Delta** subsection under "Target architecture" describing what C1/C2/C3 elements were added/modified/removed (full maps are maintained by the C4 map maintainer)
191
+
192
+ **Spec Truth Reference Requirements** (core traceability):
193
+ - **Must declare affected existing Specs**: list spec files under `<truth-root>/specs/` impacted by this design
194
+ - **Must reference REQ/Invariant**: each constraint in the design must trace back to REQ-xxx or INV-xxx in Specs
195
+ - **Gap declaration**: if design cannot satisfy an existing REQ, explicitly declare it as a Gap with justification
196
+ - **Terminology consistency**: domain terms must match `<truth-root>/_meta/glossary.md`; new terms must be declared and proposed for glossary addition
187
197
 
188
198
  Now output the Design Doc in Markdown. Do not output extra explanations.
@@ -16,7 +16,7 @@ allowed-tools:
16
16
 
17
17
  Before execution, you **must** search for configuration in the following order (stop when found):
18
18
  1. `.devbooks/config.yaml` (if exists) -> Parse and use the mappings within
19
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
19
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
20
20
  3. `project.md` (if exists) -> Template protocol, use default mappings
21
21
  4. If still undetermined -> **Stop and ask the user**
22
22
 
@@ -19,7 +19,7 @@ allowed-tools:
19
19
 
20
20
  Before execution, **must** search for configuration in the following order (stop when found):
21
21
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
22
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
22
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
23
23
  3. `project.md` (if exists) → Template protocol, use default mappings
24
24
  5. If still unable to determine → **Stop and ask the user**
25
25
 
@@ -17,7 +17,7 @@ allowed-tools:
17
17
 
18
18
  Before execution, **must** search for configuration in the following order (stop when found):
19
19
  1. `.devbooks/config.yaml` (if exists) -> Parse and use the mappings within
20
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
20
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
21
21
  3. `project.md` (if exists) -> template protocol, use default mappings
22
22
  5. If still unable to determine -> **Stop and ask the user**
23
23
 
@@ -17,6 +17,10 @@ Input materials (provided by me):
17
17
  - Current truth source: `<truth-root>/`
18
18
  - Codebase (read-only analysis)
19
19
 
20
+ **Required Spec Truth Reading** (mandatory before analysis):
21
+ - `<truth-root>/specs/**`: existing spec files
22
+ - Purpose: identify which existing Specs (REQ/Invariants/Contracts) are impacted by this change
23
+
20
24
  Hard constraints (must follow):
21
25
  - Impact analysis first, code later
22
26
  - No "decorative/surface refactors" unless they directly reduce risk for this change
@@ -53,6 +57,19 @@ Output format (MECE):
53
57
  - Are external system/API changes isolated by ACL? (External model changes must not leak into internal models)
54
58
  - Are there direct calls to external APIs bypassing the adapter layer?
55
59
  - If adding external dependency: suggested ACL interface definition
60
+ - **F. Affected Spec Truth** (required):
61
+ - List spec files under `<truth-root>/specs/` impacted by this change
62
+ - For each affected Spec, mark impact type:
63
+ - `[BREAK]`: breaks existing REQ/Invariant (needs Spec update or redesign)
64
+ - `[EXTEND]`: extends existing capability (needs new REQ/Scenario)
65
+ - `[DEPRECATE]`: deprecates existing capability (needs Spec marked deprecated)
66
+ - Output format:
67
+ ```
68
+ Affected Specs:
69
+ - [EXTEND] specs/order/spec.md - add cancel order scenario
70
+ - [BREAK] specs/payment/spec.md - INV-002 "paid orders cannot be cancelled" needs modification
71
+ - [DEPRECATE] specs/legacy-checkout/spec.md - entire spec deprecated
72
+ ```
56
73
  4) Compatibility and Risks
57
74
  - Breaking changes (explicitly mark if any)
58
75
  - Migration/rollback paths
@@ -54,7 +54,7 @@ proposal → design → [Implementation Plan] → test-owner(phase1) → coder
54
54
 
55
55
  Before execution, **must** search for configuration in the following order (stop when found):
56
56
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
57
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
57
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
58
58
  3. `project.md` (if exists) → Template protocol, use default mappings
59
59
  5. If still unable to determine → **Stop and ask the user**
60
60
 
@@ -18,7 +18,7 @@ allowed-tools:
18
18
 
19
19
  Before execution, you **must** search for configuration in the following order (stop when found):
20
20
  1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
21
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
21
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
22
22
  3. `project.md` (if exists) -> Template protocol, use default mappings
23
23
  4. If still undetermined -> **Stop and ask the user**
24
24
 
@@ -16,7 +16,7 @@ allowed-tools:
16
16
 
17
17
  Before execution, **must** search for configuration in the following order (stop when found):
18
18
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
19
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
19
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
20
20
  3. `project.md` (if exists) → Template protocol, use default mappings
21
21
  4. If still undetermined → **Stop and ask user**
22
22
 
@@ -18,7 +18,7 @@ allowed-tools:
18
18
 
19
19
  Before execution, you **must** search for configuration in the following order (stop when found):
20
20
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
21
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
21
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
22
22
  3. `project.md` (if exists) → Template protocol, use default mappings
23
23
  5. If still unable to determine → **Stop and ask the user**
24
24
 
@@ -32,7 +32,7 @@ allowed-tools:
32
32
 
33
33
  Before execution, you **must** search for configuration in the following order (stop when found):
34
34
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
35
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
35
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
36
36
  3. `project.md` (if exists) → Template protocol, use default mappings
37
37
  4. If still undetermined → **Stop and ask user**
38
38
 
@@ -21,7 +21,7 @@ allowed-tools:
21
21
 
22
22
  Before execution, you **must** search for configuration in the following order (stop when found):
23
23
  1. `.devbooks/config.yaml` (if exists) -> Parse and use its mappings
24
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
24
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
25
25
  3. `project.md` (if exists) -> Template protocol, use default mappings
26
26
  5. If still unable to determine -> **Stop and ask the user**
27
27
 
@@ -18,6 +18,10 @@ Inputs (provided by me):
18
18
  - Project profile (if present; follow formatting conventions first): `<truth-root>/_meta/project-profile.md`
19
19
  - Glossary / ubiquitous language (if present): `<truth-root>/_meta/glossary.md`
20
20
 
21
+ **Spec Truth Conflict Detection** (must complete before writing):
22
+ - **Must read existing Specs**: before writing spec delta, read all specs under `<truth-root>/specs/**`
23
+ - **Purpose**: detect conflicts between new spec delta and existing Specs
24
+
21
25
  Hard constraints (must follow):
22
26
  - Output a **spec delta**, not a design doc, not an implementation plan, not code
23
27
  - Do not write implementation details (class names/function names/specific production file paths/library calls)
@@ -26,6 +30,13 @@ Hard constraints (must follow):
26
30
  - Avoid duplicating capabilities: search/reuse/modify existing capability specs first; create a new capability only when necessary
27
31
  - Ubiquitous language: if `<truth-root>/_meta/glossary.md` exists, you must use those terms; do not invent new terms
28
32
 
33
+ **Conceptual Integrity Guardian** (conflict detection rules):
34
+ - **Terminology conflict**: does the new spec use terminology inconsistent with existing specs? (e.g., `Order.status` vs `Order.state`)
35
+ - **Rule conflict**: do new spec rules contradict existing spec rules? (e.g., "paid orders can be cancelled" vs "paid orders cannot be cancelled")
36
+ - **Boundary conflict**: does the new spec's responsibility overlap with existing specs? (e.g., two specs both claim ownership of payment logic)
37
+ - **Invariant compatibility**: does the new spec violate Invariants declared in existing specs?
38
+ - **Conflict report**: if conflicts are detected, declare them at the top of the spec delta with resolution suggestions; archiving is forbidden until conflicts are resolved
39
+
29
40
  Workshop (internal step; do not output separately):
30
41
  - Before writing the spec, run a “virtual three-amigos workshop” (business/dev/test) and incorporate consensus + edge examples into Requirements/Scenarios; do not output workshop notes.
31
42
 
@@ -59,7 +59,7 @@ When user says "Coder is done, please verify" or similar, Test Owner enters **Ph
59
59
 
60
60
  Before execution, **must** search for configuration in the following order (stop when found):
61
61
  1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
62
- 2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
62
+ 2. `dev-playbooks/project.md` (if exists) → Dev-Playbooks protocol, use default mappings
63
63
  3. `project.md` (if exists) → Template protocol, use default mappings
64
64
  5. If still unable to determine → **Stop and ask user**
65
65
 
@@ -205,7 +205,7 @@ Test Owner must produce a structured `verification.md` that serves as both test
205
205
 
206
206
  **Correct path examples**:
207
207
  ```bash
208
- # DevBooks 2.0 default path
208
+ # Dev-Playbooks default path
209
209
  dev-playbooks/changes/<change-id>/evidence/red-baseline/test-$(date +%Y%m%d-%H%M%S).log
210
210
 
211
211
  # Using the script
@@ -11,6 +11,10 @@ Inputs (provided by me):
11
11
  - Design/spec documents
12
12
  - Test methodology references (see: `references/test-driven-development.md`)
13
13
 
14
+ **Required Spec Truth Reading** (mandatory before testing):
15
+ - `<truth-root>/specs/**`: existing spec files
16
+ - Purpose: auto-generate test skeletons from contracts (Preconditions/Postconditions/Invariants) and state machines
17
+
14
18
  Artifact locations (directory conventions; protocol-agnostic):
15
19
  - Test plan + traceability should live at: `<change-root>/<change-id>/verification.md`
16
20
  - Test code changes live in the repo’s normal place (e.g., `tests/`), but traceability matrices and MANUAL-* checklists should live in the change package (`verification.md`), not scattered into external `docs/`
@@ -63,6 +67,16 @@ Core principles (must follow):
63
67
  3) **Deterministic and reproducible**: default to offline, no real external services; freeze time; fix random seeds; use fakes/mocks; fixed inputs.
64
68
  4) **Few but strong (risk-driven)**: prioritize the highest-risk failure modes (isolation, idempotency/replay, quality gates, error cascades, contract drift).
65
69
 
70
+ **Contract Tests from Spec Truth** (must follow):
71
+ - **Invariants → invariant tests**: each `[Invariant]` or `INV-xxx` in Specs must have a corresponding test
72
+ - **Preconditions → precondition tests**: each `PRE-xxx` generates two tests: (1) success when satisfied (2) rejection when violated
73
+ - **Postconditions → postcondition tests**: each `POST-xxx` generates result verification tests
74
+ - **State Machine → transition tests**: if Spec contains state machine, generate:
75
+ - All legal transition path tests
76
+ - All forbidden transition rejection tests
77
+ - Terminal state cannot exit tests
78
+ - **REQ coverage traceability**: each test must annotate which REQ-xxx/INV-xxx/PRE-xxx/POST-xxx it covers (in comments or verification.md)
79
+
66
80
  Coverage targets (debate edition; guidance only):
67
81
 
68
82
  | Code type | Coverage target | Rationale |
@@ -14,7 +14,7 @@ allowed-tools:
14
14
 
15
15
  Before execution, you **must** search for configuration in the following order (stop when found):
16
16
  1. `.devbooks/config.yaml` (if exists) -> Parse and use the mappings within
17
- 2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
17
+ 2. `dev-playbooks/project.md` (if exists) -> Dev-Playbooks protocol, use default mappings
18
18
  3. `project.md` (if exists) -> Template protocol, use default mappings
19
19
  4. If still undetermined -> **Stop and ask the user**
20
20