dev-playbooks 1.0.13 → 1.0.15
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/README.md +0 -1
- package/package.json +1 -1
- package/skills/Skills-Usage-Guide.md +0 -22
- package/skills/_shared/mcp-enhancement-template.md +0 -1
- package/skills/devbooks-brownfield-bootstrap/SKILL.md +184 -139
- package/skills/devbooks-brownfield-bootstrap/references/brownfield-bootstrap.md +3 -2
- package/skills/devbooks-code-review/SKILL.md +3 -3
- package/skills/devbooks-code-review/references/code-review-prompt.md +5 -0
- package/skills/devbooks-code-review/references/pr-template-and-guidelines.md +2 -0
- package/skills/devbooks-coder/SKILL.md +1 -1
- package/skills/devbooks-coder/references/code-implementation-prompt.md +1 -1
- package/skills/devbooks-delivery-workflow/SKILL.md +2 -2
- package/skills/devbooks-design-backport/SKILL.md +2 -2
- package/skills/devbooks-design-doc/SKILL.md +76 -1
- package/skills/devbooks-entropy-monitor/SKILL.md +1 -1
- package/skills/devbooks-impact-analysis/SKILL.md +1 -1
- package/skills/devbooks-implementation-plan/SKILL.md +1 -1
- package/skills/devbooks-implementation-plan/references/implementation-plan-prompt.md +5 -3
- package/skills/devbooks-proposal-debate-workflow/SKILL.md +2 -2
- package/skills/devbooks-proposal-judge/SKILL.md +1 -1
- package/skills/devbooks-router/SKILL.md +5 -5
- package/skills/devbooks-spec-contract/SKILL.md +1 -1
- package/skills/devbooks-spec-gardener/SKILL.md +57 -1
- package/skills/devbooks-test-owner/SKILL.md +1 -1
- package/skills/devbooks-test-owner/references/test-code-prompt.md +4 -0
- package/skills/devbooks-test-reviewer/SKILL.md +2 -2
- package/templates/dev-playbooks/README.md +0 -1
- package/templates/dev-playbooks/docs/devbooks-setup-guide.md +1 -2
- package/skills/devbooks-c4-map/SKILL.md +0 -151
- package/skills/devbooks-c4-map/references/c4-architecture-map-prompt.md +0 -33
- package/skills/devbooks-c4-map/references/layered-constraint-checklist.md +0 -185
package/README.md
CHANGED
|
@@ -178,7 +178,6 @@ Run devbooks-spec-gardener skill for change add-oauth2
|
|
|
178
178
|
| devbooks-proposal-debate-workflow | Triangle debate (Author/Challenger/Judge) |
|
|
179
179
|
| devbooks-design-doc | Create a design doc |
|
|
180
180
|
| devbooks-spec-contract | Define specs & contracts |
|
|
181
|
-
| devbooks-c4-map | Generate a C4 map |
|
|
182
181
|
| devbooks-implementation-plan | Create an implementation plan |
|
|
183
182
|
|
|
184
183
|
### Apply stage
|
package/package.json
CHANGED
|
@@ -171,28 +171,6 @@ If you are not using DevBooks, replace `dev-playbooks/specs` / `dev-playbooks/ch
|
|
|
171
171
|
|
|
172
172
|
---
|
|
173
173
|
|
|
174
|
-
## `devbooks-c4-map` (C4 Map Maintainer)
|
|
175
|
-
|
|
176
|
-
- Purpose: maintain/update the authoritative C4 architecture map (truth) and produce a C4 Delta per change.
|
|
177
|
-
- When to use:
|
|
178
|
-
- Proposal stage: describe boundary/dependency direction changes in `design.md` (C4 Delta only; do not modify current truth)
|
|
179
|
-
- Review/archive stage: change is implemented; update the authoritative map at `(<truth-root>/architecture/c4.md)`
|
|
180
|
-
- Copy-paste prompts:
|
|
181
|
-
- Proposal stage (C4 Delta only; do not edit current truth):
|
|
182
|
-
```text
|
|
183
|
-
You are C4 Map Maintainer. Explicitly use `devbooks-c4-map`, but during proposal stage do NOT modify `dev-playbooks/specs/architecture/c4.md` (current truth).
|
|
184
|
-
First read: `dev-playbooks/specs/architecture/c4.md` (if present) + `dev-playbooks/changes/<change-id>/proposal.md` + `dev-playbooks/changes/<change-id>/design.md`.
|
|
185
|
-
Output: a **C4 Delta** section that I can paste into `dev-playbooks/changes/<change-id>/design.md` (C1/C2/C3 add/modify/remove + dependency direction changes + suggested architecture guardrails/fitness tests).
|
|
186
|
-
```
|
|
187
|
-
- Review/archive stage (update current truth map):
|
|
188
|
-
```text
|
|
189
|
-
You are C4 Map Maintainer. Explicitly use `devbooks-c4-map`.
|
|
190
|
-
First read: `dev-playbooks/specs/architecture/c4.md` (if present) + `dev-playbooks/changes/<change-id>/design.md` + relevant code changes (to confirm the change is real).
|
|
191
|
-
Update (or create a minimal skeleton with TODOs): `dev-playbooks/specs/architecture/c4.md`.
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
174
|
## `devbooks-implementation-plan` (Planner / tasks.md)
|
|
197
175
|
|
|
198
176
|
- Purpose: derive an implementation plan `tasks.md` from `design.md` (critical path / side quests / checkpoints), tied to verification anchors (must not reference `tests/`).
|
|
@@ -91,7 +91,6 @@ The following Skills depend on MCP and require the full MCP Enhancement section:
|
|
|
91
91
|
| devbooks-index-bootstrap | mcp__ckb__getStatus | Index status detection |
|
|
92
92
|
| devbooks-federation | mcp__ckb__*, mcp__github__* | Cross-repo analysis |
|
|
93
93
|
| devbooks-router | mcp__ckb__getStatus | Index availability detection |
|
|
94
|
-
| devbooks-c4-map | mcp__ckb__getArchitecture | Module dependency graph |
|
|
95
94
|
| devbooks-spec-contract | mcp__ckb__findReferences | Reference detection |
|
|
96
95
|
| devbooks-entropy-monitor | mcp__ckb__getHotspots | Hotspot trend analysis |
|
|
97
96
|
| devbooks-delivery-workflow | mcp__ckb__getStatus | Index detection |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: devbooks-brownfield-bootstrap
|
|
3
|
-
description: devbooks-brownfield-bootstrap
|
|
3
|
+
description: "devbooks-brownfield-bootstrap: Brownfield project initialization. When the truth directory is empty, generate project profile, glossary, baseline specs, and minimum verification anchors to avoid 'patching specs while changing behavior'. Use when user says 'brownfield init/baseline specs/project profile/establish glossary/onboard legacy project to context protocol' etc."
|
|
4
4
|
tools:
|
|
5
5
|
- Glob
|
|
6
6
|
- Grep
|
|
@@ -15,217 +15,262 @@ tools:
|
|
|
15
15
|
- mcp__ckb__getModuleOverview
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
# DevBooks
|
|
18
|
+
# DevBooks: Brownfield Bootstrap
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Prerequisites: Configuration Discovery (Protocol Agnostic)
|
|
21
21
|
|
|
22
|
-
- `<truth-root
|
|
23
|
-
- `<change-root
|
|
24
|
-
- `<devbooks-root
|
|
22
|
+
- `<truth-root>`: Current truth directory root
|
|
23
|
+
- `<change-root>`: Change package directory root
|
|
24
|
+
- `<devbooks-root>`: DevBooks management directory (usually `dev-playbooks/`)
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
1. `.devbooks/config.yaml
|
|
28
|
-
2. `dev-playbooks/project.md
|
|
29
|
-
|
|
30
|
-
5.
|
|
26
|
+
Before execution, **must** search for configuration in the following order (stop when found):
|
|
27
|
+
1. `.devbooks/config.yaml` (if exists) → Parse and use its mappings
|
|
28
|
+
2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
|
|
29
|
+
3. `project.md` (if exists) → Template protocol, use default mappings
|
|
30
|
+
5. If still unable to determine → **Create DevBooks directory structure and initialize basic configuration**
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
32
|
+
**Key Constraints**:
|
|
33
|
+
- If configuration specifies `agents_doc` (rules document), **must read that document first** before executing any operations
|
|
34
|
+
- Do not guess directory roots
|
|
35
|
+
- Do not skip reading rules document
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Core Responsibilities
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Brownfield project initialization includes the following responsibilities:
|
|
42
42
|
|
|
43
|
-
### 1.
|
|
43
|
+
### 1. Basic Configuration File Initialization
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Check and create in `<devbooks-root>/` (usually `dev-playbooks/`):
|
|
46
46
|
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
| `constitution.md` |
|
|
50
|
-
| `project.md` |
|
|
47
|
+
| File | Purpose | Creation Condition |
|
|
48
|
+
|------|---------|-------------------|
|
|
49
|
+
| `constitution.md` | Project constitution (GIP principles) | When file doesn't exist |
|
|
50
|
+
| `project.md` | Project context (tech stack/conventions) | When file doesn't exist |
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
- `constitution.md
|
|
55
|
-
- `project.md
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
52
|
+
**Creation Method**:
|
|
53
|
+
- **Not simple template copying**, but customized content based on code analysis results
|
|
54
|
+
- `constitution.md`: Based on default GIP principles, can be adjusted according to project characteristics
|
|
55
|
+
- `project.md`: Filled based on code analysis results:
|
|
56
|
+
- Tech stack (language/framework/database)
|
|
57
|
+
- Development conventions (code style/testing strategy/Git workflow)
|
|
58
|
+
- Domain context (core concepts/role definitions)
|
|
59
|
+
- Directory root mappings
|
|
60
60
|
|
|
61
|
-
### 2.
|
|
61
|
+
### 2. Project Profile and Metadata
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Generate in `<truth-root>/_meta/`:
|
|
64
64
|
|
|
65
|
-
|
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
65
|
+
| Artifact | Path | Description |
|
|
66
|
+
|----------|------|-------------|
|
|
67
|
+
| Project profile | `_meta/project-profile.md` | Detailed technical profile with three-layer architecture |
|
|
68
|
+
| Glossary | `_meta/glossary.md` | Unified language table (optional but recommended) |
|
|
69
|
+
| Domain concepts | `_meta/key-concepts.md` | Concepts extracted by CKB (enhanced mode) |
|
|
70
70
|
|
|
71
|
-
### 3.
|
|
71
|
+
### 3. Architecture Analysis Artifacts
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Generate in `<truth-root>/architecture/`:
|
|
74
74
|
|
|
75
|
-
|
|
|
76
|
-
|
|
77
|
-
|
|
|
78
|
-
|
|
|
75
|
+
| Artifact | Path | Data Source |
|
|
76
|
+
|----------|------|-------------|
|
|
77
|
+
| **C4 Architecture Map** | `architecture/c4.md` | Comprehensive analysis + CKB (enhanced mode) |
|
|
78
|
+
| Module dependency graph | `architecture/module-graph.md` | `mcp__ckb__getArchitecture` |
|
|
79
|
+
| Technical debt hotspots | `architecture/hotspots.md` | `mcp__ckb__getHotspots` |
|
|
80
|
+
| Layering constraints | `architecture/layering-constraints.md` | Code analysis (optional) |
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
> **Design Decision**: C4 architecture map is now generated by brownfield-bootstrap during initialization. Subsequent architecture changes are recorded in design.md's Architecture Impact section and merged by spec-gardener during archiving.
|
|
81
83
|
|
|
82
|
-
|
|
84
|
+
### 4. Baseline Change Package
|
|
83
85
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
86
|
+
Generate in `<change-root>/<baseline-id>/`:
|
|
87
|
+
|
|
88
|
+
| Artifact | Description |
|
|
89
|
+
|----------|-------------|
|
|
90
|
+
| `proposal.md` | Baseline scope, In/Out, risks |
|
|
91
|
+
| `design.md` | Current state inventory (capability inventory) |
|
|
92
|
+
| `specs/<cap>/spec.md` | Baseline spec deltas (mainly ADDED) |
|
|
93
|
+
| `verification.md` | Minimum verification anchor plan |
|
|
90
94
|
|
|
91
95
|
---
|
|
92
96
|
|
|
93
|
-
## COD
|
|
97
|
+
## COD Model Generation (Code Overview & Dependencies)
|
|
98
|
+
|
|
99
|
+
Automatically generate project's "code map" during initialization (requires CKB MCP Server available, otherwise skip):
|
|
100
|
+
|
|
101
|
+
### Auto-generated Artifacts
|
|
102
|
+
|
|
103
|
+
| Artifact | Path | Data Source |
|
|
104
|
+
|----------|------|-------------|
|
|
105
|
+
| **C4 Architecture Map** | `<truth-root>/architecture/c4.md` | Comprehensive analysis |
|
|
106
|
+
| Module dependency graph | `<truth-root>/architecture/module-graph.md` | `mcp__ckb__getArchitecture` |
|
|
107
|
+
| Technical debt hotspots | `<truth-root>/architecture/hotspots.md` | `mcp__ckb__getHotspots` |
|
|
108
|
+
| Domain concepts | `<truth-root>/_meta/key-concepts.md` | `mcp__ckb__listKeyConcepts` |
|
|
109
|
+
| Project profile | `<truth-root>/_meta/project-profile.md` | Comprehensive analysis |
|
|
110
|
+
|
|
111
|
+
### C4 Architecture Map Generation Rules
|
|
112
|
+
|
|
113
|
+
C4 map generated during initialization should include:
|
|
114
|
+
|
|
115
|
+
1. **Context Level**: System's relationship with external actors (users, external systems)
|
|
116
|
+
2. **Container Level**: Containers within the system (applications, databases, services)
|
|
117
|
+
3. **Component Level**: Components within main containers (modules, classes)
|
|
118
|
+
|
|
119
|
+
**Output Format**:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
# C4 Architecture Map
|
|
94
123
|
|
|
95
|
-
|
|
124
|
+
## System Context
|
|
96
125
|
|
|
97
|
-
|
|
126
|
+
[Describe system boundaries and external interactions]
|
|
98
127
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
103
|
-
|
|
|
104
|
-
|
|
128
|
+
## Container Diagram
|
|
129
|
+
|
|
130
|
+
| Container | Tech Stack | Responsibility |
|
|
131
|
+
|-----------|------------|----------------|
|
|
132
|
+
| <name> | <tech> | <responsibility> |
|
|
133
|
+
|
|
134
|
+
## Component Diagram
|
|
135
|
+
|
|
136
|
+
### <Container Name>
|
|
137
|
+
|
|
138
|
+
| Component | Responsibility | Dependencies |
|
|
139
|
+
|-----------|----------------|--------------|
|
|
140
|
+
| <name> | <responsibility> | <dependencies> |
|
|
141
|
+
|
|
142
|
+
## Architecture Guardrails
|
|
143
|
+
|
|
144
|
+
### Layering Constraints
|
|
145
|
+
|
|
146
|
+
| Layer | Can Depend On | Cannot Depend On |
|
|
147
|
+
|-------|---------------|------------------|
|
|
148
|
+
| <layer> | <allowed> | <forbidden> |
|
|
149
|
+
```
|
|
105
150
|
|
|
106
|
-
###
|
|
151
|
+
### Hotspot Calculation Formula
|
|
107
152
|
|
|
108
153
|
```
|
|
109
|
-
|
|
154
|
+
Hotspot Score = Change Frequency × Cyclomatic Complexity
|
|
110
155
|
```
|
|
111
156
|
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
157
|
+
- **High Hotspot** (score > threshold): Frequent changes + high complexity = Bug-dense area
|
|
158
|
+
- **Dormant Debt** (high complexity + low frequency): Temporarily safe but needs attention
|
|
159
|
+
- **Active Healthy** (high frequency + low complexity): Normal maintenance area
|
|
115
160
|
|
|
116
|
-
###
|
|
161
|
+
### Boundary Identification
|
|
117
162
|
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
163
|
+
Automatically distinguish:
|
|
164
|
+
- **User Code**: `src/`, `lib/`, `app/` etc. (modifiable)
|
|
165
|
+
- **Library Code**: `node_modules/`, `vendor/`, `.venv/` etc. (immutable interface)
|
|
166
|
+
- **Generated Code**: `dist/`, `build/`, `*.generated.*` etc. (manual modification prohibited)
|
|
122
167
|
|
|
123
|
-
###
|
|
168
|
+
### Execution Flow
|
|
124
169
|
|
|
125
|
-
1)
|
|
126
|
-
-
|
|
127
|
-
-
|
|
170
|
+
1) **Check Graph Index**: Call `mcp__ckb__getStatus`
|
|
171
|
+
- If SCIP available → Use graph-based analysis
|
|
172
|
+
- If unavailable → Prompt to generate index or use Git history analysis
|
|
128
173
|
|
|
129
|
-
2)
|
|
174
|
+
2) **Generate COD Artifacts**:
|
|
130
175
|
```bash
|
|
131
|
-
#
|
|
176
|
+
# Get module architecture
|
|
132
177
|
mcp__ckb__getArchitecture(depth=2, includeExternalDeps=false)
|
|
133
178
|
|
|
134
|
-
#
|
|
179
|
+
# Get hotspots (last 30 days)
|
|
135
180
|
mcp__ckb__getHotspots(limit=20)
|
|
136
181
|
|
|
137
|
-
#
|
|
182
|
+
# Get domain concepts
|
|
138
183
|
mcp__ckb__listKeyConcepts(limit=12)
|
|
139
184
|
```
|
|
140
185
|
|
|
141
|
-
3)
|
|
186
|
+
3) **Generate Project Profile**: Integrate above data + traditional analysis
|
|
142
187
|
|
|
143
|
-
##
|
|
188
|
+
## Reference Scaffolds and Templates
|
|
144
189
|
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
190
|
+
- Workflow: `references/brownfield-bootstrap.md`
|
|
191
|
+
- Code navigation strategy: `references/code-navigation-strategy.md`
|
|
192
|
+
- **Project profile template (three-layer architecture)**: `templates/project-profile-template.md`
|
|
193
|
+
- One-time prompt: `references/brownfield-bootstrap-prompt.md`
|
|
194
|
+
- Template (as needed): `references/glossary-template.md`
|
|
150
195
|
|
|
151
196
|
---
|
|
152
197
|
|
|
153
|
-
##
|
|
198
|
+
## Context Awareness
|
|
154
199
|
|
|
155
|
-
|
|
200
|
+
This Skill automatically detects context before execution and selects the appropriate initialization scope.
|
|
156
201
|
|
|
157
|
-
|
|
202
|
+
Detection rules reference: `skills/_shared/context-detection-template.md`
|
|
158
203
|
|
|
159
|
-
###
|
|
204
|
+
### Detection Flow
|
|
160
205
|
|
|
161
|
-
1.
|
|
162
|
-
2.
|
|
163
|
-
3.
|
|
164
|
-
4.
|
|
165
|
-
5.
|
|
206
|
+
1. Detect if `<devbooks-root>/constitution.md` exists
|
|
207
|
+
2. Detect if `<devbooks-root>/project.md` exists
|
|
208
|
+
3. Detect if `<truth-root>/` is empty or basically empty
|
|
209
|
+
4. Detect if CKB index is available
|
|
210
|
+
5. Detect project scale and language stack
|
|
166
211
|
|
|
167
|
-
###
|
|
212
|
+
### Modes Supported by This Skill
|
|
168
213
|
|
|
169
|
-
|
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
214
|
+
| Mode | Trigger Condition | Behavior |
|
|
215
|
+
|------|-------------------|----------|
|
|
216
|
+
| **Full New Init** | devbooks-root doesn't exist or is empty | Create complete directory structure + constitution + project + profile |
|
|
217
|
+
| **Supplement Config** | constitution/project missing | Only supplement missing configuration files |
|
|
218
|
+
| **Complete Init** | truth-root is empty | Generate all basic artifacts (profile/baseline/verification) |
|
|
219
|
+
| **Incremental Init** | truth-root partially exists | Only supplement missing artifacts |
|
|
220
|
+
| **Enhanced Mode** | CKB index available | Use graph analysis to generate more precise profile |
|
|
221
|
+
| **Basic Mode** | CKB index unavailable | Use traditional analysis methods |
|
|
177
222
|
|
|
178
|
-
###
|
|
223
|
+
### Detection Output Example
|
|
179
224
|
|
|
180
225
|
```
|
|
181
|
-
|
|
182
|
-
- devbooks-root
|
|
183
|
-
- constitution.md
|
|
184
|
-
- project.md
|
|
185
|
-
- truth-root
|
|
186
|
-
- CKB
|
|
187
|
-
-
|
|
188
|
-
-
|
|
226
|
+
Detection Results:
|
|
227
|
+
- devbooks-root: Exists
|
|
228
|
+
- constitution.md: Doesn't exist → Will create
|
|
229
|
+
- project.md: Doesn't exist → Will create
|
|
230
|
+
- truth-root: Empty
|
|
231
|
+
- CKB index: Available
|
|
232
|
+
- Project scale: Medium (~50K LOC)
|
|
233
|
+
- Running mode: Supplement Config + Complete Init + Enhanced Mode
|
|
189
234
|
```
|
|
190
235
|
|
|
191
236
|
---
|
|
192
237
|
|
|
193
|
-
## MCP
|
|
238
|
+
## MCP Enhancement
|
|
194
239
|
|
|
195
|
-
|
|
240
|
+
This Skill supports MCP runtime enhancement, automatically detecting and enabling advanced features.
|
|
196
241
|
|
|
197
|
-
MCP
|
|
242
|
+
MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template.md`
|
|
198
243
|
|
|
199
|
-
###
|
|
244
|
+
### Required MCP Services
|
|
200
245
|
|
|
201
|
-
|
|
|
202
|
-
|
|
203
|
-
| `mcp__ckb__getStatus` |
|
|
204
|
-
| `mcp__ckb__getArchitecture` |
|
|
205
|
-
| `mcp__ckb__getHotspots` |
|
|
206
|
-
| `mcp__ckb__listKeyConcepts` |
|
|
207
|
-
| `mcp__ckb__getModuleOverview` |
|
|
246
|
+
| Service | Purpose | Timeout |
|
|
247
|
+
|---------|---------|---------|
|
|
248
|
+
| `mcp__ckb__getStatus` | Detect CKB index availability | 2s |
|
|
249
|
+
| `mcp__ckb__getArchitecture` | Get module dependency graph | 2s |
|
|
250
|
+
| `mcp__ckb__getHotspots` | Get technical debt hotspots | 2s |
|
|
251
|
+
| `mcp__ckb__listKeyConcepts` | Get domain concepts | 2s |
|
|
252
|
+
| `mcp__ckb__getModuleOverview` | Get module overview | 2s |
|
|
208
253
|
|
|
209
|
-
###
|
|
254
|
+
### Detection Flow
|
|
210
255
|
|
|
211
|
-
1.
|
|
212
|
-
2.
|
|
213
|
-
3.
|
|
256
|
+
1. Call `mcp__ckb__getStatus` (2s timeout)
|
|
257
|
+
2. If CKB available → Use graph-based analysis to generate COD artifacts
|
|
258
|
+
3. If timeout or failure → Degrade to traditional analysis (Git history + file statistics)
|
|
214
259
|
|
|
215
|
-
###
|
|
260
|
+
### Enhanced Mode vs Basic Mode
|
|
216
261
|
|
|
217
|
-
|
|
|
218
|
-
|
|
219
|
-
|
|
|
220
|
-
|
|
|
221
|
-
|
|
|
222
|
-
|
|
|
262
|
+
| Feature | Enhanced Mode | Basic Mode |
|
|
263
|
+
|---------|---------------|------------|
|
|
264
|
+
| Module dependency graph | CKB getArchitecture | Directory structure inference |
|
|
265
|
+
| Technical debt hotspots | CKB getHotspots | Git log statistics |
|
|
266
|
+
| Domain concepts | CKB listKeyConcepts | Naming analysis |
|
|
267
|
+
| Boundary identification | Precise module boundaries | Directory conventions |
|
|
223
268
|
|
|
224
|
-
###
|
|
269
|
+
### Degradation Notice
|
|
225
270
|
|
|
226
|
-
|
|
271
|
+
When MCP is unavailable, output the following notice:
|
|
227
272
|
|
|
228
273
|
```
|
|
229
|
-
|
|
230
|
-
|
|
274
|
+
Warning: CKB unavailable, using traditional analysis methods to generate project profile.
|
|
275
|
+
For more precise architecture analysis, run devbooks-index-bootstrap skill to generate index.
|
|
231
276
|
```
|
|
@@ -6,7 +6,8 @@ Goal: One-time completion of "project profile and conventions + baseline specs"
|
|
|
6
6
|
|
|
7
7
|
Core principles:
|
|
8
8
|
- **Do not try to document the whole system at once**: start with external-facing surfaces (API/CLI/events/config/Schema), then fill internal core later.
|
|
9
|
-
- **Evidence first**: every spec item must point to code/tests/logs/runtime behavior
|
|
9
|
+
- **Evidence first**: every spec item must point to code/tests/logs/runtime behavior.
|
|
10
|
+
- **TBD policy**: `spec.md` forbids TBD/TODO (gates will reject); unknown items must go into `verification.md` Open Questions or MANUAL verification tasks with a specific verification plan.
|
|
10
11
|
- **Stabilize current behavior before refactoring**: the baseline phase should avoid behavioral change; do not "patch specs while changing behavior" and drift the truth source.
|
|
11
12
|
|
|
12
13
|
---
|
|
@@ -60,7 +61,7 @@ In `<change-root>/<baseline-id>/specs/<capability>/spec.md`, write **current-sta
|
|
|
60
61
|
- Requirements/Scenarios must be observable (inputs/outputs/error semantics/invariants)
|
|
61
62
|
|
|
62
63
|
Notes:
|
|
63
|
-
- If uncertain
|
|
64
|
+
- If uncertain: **do not write TBD in spec.md**; add a verification action to `verification.md` Open Questions or MANUAL verification tasks (with a verification plan).
|
|
64
65
|
- If you find obvious bugs, do not fix them during baseline; create a separate change for fixes (avoid mixing behavior changes into baseline).
|
|
65
66
|
|
|
66
67
|
---
|
|
@@ -18,8 +18,8 @@ tools:
|
|
|
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 its mappings
|
|
20
20
|
2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
3. `project.md` (if exists) -> template protocol, use default mappings
|
|
22
|
+
4. If still undetermined -> **Stop and ask user**
|
|
23
23
|
|
|
24
24
|
**Key Constraints**:
|
|
25
25
|
- If configuration specifies `agents_doc` (rules document), **must read that document first** before executing any operations
|
|
@@ -35,7 +35,7 @@ Before execution, **must** search for configuration in the following order (stop
|
|
|
35
35
|
- Code formatting
|
|
36
36
|
|
|
37
37
|
### 2. Dependency Health Review
|
|
38
|
-
- Layer constraint compliance (see
|
|
38
|
+
- Layer constraint compliance (see `<truth-root>/architecture/c4.md`)
|
|
39
39
|
- Circular dependency detection
|
|
40
40
|
- Internal module encapsulation (prohibit deep imports of *Internal files)
|
|
41
41
|
- Dependency direction correctness
|
|
@@ -98,3 +98,8 @@ Output format:
|
|
|
98
98
|
2) Maintainability risks (recommended)
|
|
99
99
|
3) Style & consistency suggestions (optional)
|
|
100
100
|
4) If new quality gates are needed (lint/complexity/dependency rules), propose them concretely
|
|
101
|
+
5) **Provide an explicit verdict**:
|
|
102
|
+
- ✅ **APPROVED**: Code quality meets standards, ready to merge
|
|
103
|
+
- ⚠️ **APPROVED WITH COMMENTS**: Can merge but recommend follow-up improvements (list specific items)
|
|
104
|
+
- 🔄 **REQUEST CHANGES**: Requires fixes before re-review (list must-fix items)
|
|
105
|
+
- ❌ **REJECTED**: Serious issues or design flaws, needs to return to design phase
|
|
@@ -83,6 +83,8 @@ Inspired by VS Code’s `.github/pull_request_template.md`, this document define
|
|
|
83
83
|
| L | 500–1000 | 2+ hours | Consider splitting |
|
|
84
84
|
| XL | > 1000 | half day+ | **Must split** |
|
|
85
85
|
|
|
86
|
+
**Note**: Line count is a **review cost signal**, not a hard structural splitting rule. When splitting would harm module cohesion, distort boundaries, or create duplication, exceeding is allowed but should be explained.
|
|
87
|
+
|
|
86
88
|
Principle: one PR does one thing; keep it atomic.
|
|
87
89
|
|
|
88
90
|
---
|
|
@@ -20,7 +20,7 @@ tools:
|
|
|
20
20
|
Before execution, you **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
22
|
2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 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
|
|
|
26
26
|
**Key Constraints**:
|
|
@@ -23,7 +23,7 @@ Hard constraints (must follow):
|
|
|
23
23
|
|
|
24
24
|
Quality gates (must execute):
|
|
25
25
|
- Run tests/static checks related to the change; retain failure outputs as fix evidence.
|
|
26
|
-
- Fix in small steps: each change focuses on one plan item, **single commit
|
|
26
|
+
- Fix in small steps: each change focuses on one plan item, **default target: single commit ≤200 lines**; if structural integrity requires exceeding, explain in commit message or PR, and ensure acceptance anchors cover the change and commit sequence is rollbackable.
|
|
27
27
|
- Avoid smells: long functions (P95 < 50 lines), deep nesting, duplicate logic, implicit dependencies, cycles, excessive coupling, cross-layer calls.
|
|
28
28
|
- If lint/complexity/dependency rules exist, comply; if not, state "recommended quality gates to add."
|
|
29
29
|
|
|
@@ -20,8 +20,8 @@ tools:
|
|
|
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
22
|
2. `dev-playbooks/project.md` (if exists) -> DevBooks 2.0 protocol, use default mappings
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
3. `project.md` (if exists) -> template protocol, use default mappings
|
|
24
|
+
4. If still undetermined -> **Stop and ask the user**
|
|
25
25
|
|
|
26
26
|
**Key Constraints**:
|
|
27
27
|
- If `agents_doc` (rules document) is specified in configuration, **must read that document first** before executing any operations
|
|
@@ -19,8 +19,8 @@ tools:
|
|
|
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
21
|
2. `dev-playbooks/project.md` (if exists) → DevBooks 2.0 protocol, use default mappings
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
3. `project.md` (if exists) → Template protocol, use default mappings
|
|
23
|
+
4. If still undetermined → **Stop and ask the user**
|
|
24
24
|
|
|
25
25
|
**Key Constraints**:
|
|
26
26
|
- If `agents_doc` (rules document) is specified in configuration, **you must read that document first** before executing any operations
|