@atlashub/smartstack-cli 2.7.3 → 2.8.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/.documentation/agents.html +0 -4
- package/.documentation/business-analyse.html +0 -4
- package/.documentation/cli-commands.html +0 -4
- package/.documentation/commands.html +0 -77
- package/.documentation/css/styles.css +0 -8
- package/.documentation/efcore.html +0 -4
- package/.documentation/gitflow.html +0 -4
- package/.documentation/hooks.html +0 -4
- package/.documentation/index.html +2 -28
- package/.documentation/init.html +8 -14
- package/.documentation/installation.html +0 -11
- package/.documentation/js/app.js +2 -16
- package/.documentation/ralph-loop.html +0 -4
- package/.documentation/test-web.html +0 -4
- package/README.md +0 -1
- package/dist/index.js +100 -23
- package/dist/index.js.map +1 -1
- package/package.json +2 -3
- package/templates/agents/docs-sync-checker.md +2 -2
- package/templates/hooks/docs-drift-check.md +4 -5
- package/templates/skills/_resources/context-digest-template.md +2 -2
- package/templates/skills/_resources/doc-context-cache.md +0 -2
- package/templates/skills/_resources/docs-manifest-schema.md +1 -3
- package/templates/skills/_resources/mcp-validate-documentation-spec.md +1 -3
- package/templates/skills/_shared.md +24 -25
- package/templates/skills/application/steps/step-04-backend.md +185 -11
- package/templates/skills/application/steps/step-06-migration.md +41 -2
- package/templates/skills/application/templates-seed.md +151 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +59 -17
- package/templates/skills/controller/steps/step-01-analyze.md +1 -1
- package/templates/skills/ralph-loop/steps/step-01-task.md +21 -1
- package/templates/skills/ralph-loop/steps/step-02-execute.md +75 -3
- package/.documentation/apex.html +0 -1027
- package/templates/skills/apex/SKILL.md +0 -297
- package/templates/skills/apex/steps/step-00-init.md +0 -212
- package/templates/skills/apex/steps/step-01-analyze.md +0 -263
- package/templates/skills/apex/steps/step-02-plan.md +0 -255
- package/templates/skills/apex/steps/step-03-execute.md +0 -217
- package/templates/skills/apex/steps/step-04-validate.md +0 -273
- package/templates/skills/apex/steps/step-04b-doc-sync.md +0 -162
- package/templates/skills/apex/steps/step-05-examine.md +0 -214
- package/templates/skills/apex/steps/step-06-resolve.md +0 -181
- package/templates/skills/apex/steps/step-07-tests.md +0 -206
- package/templates/skills/apex/steps/step-08-run-tests.md +0 -207
- package/templates/skills/apex/templates/00-context.md +0 -46
- package/templates/skills/apex/templates/01-analyze.md +0 -63
- package/templates/skills/apex/templates/02-plan.md +0 -63
- package/templates/skills/apex/templates/03-execute.md +0 -34
- package/templates/skills/apex/templates/04-validate.md +0 -61
- package/templates/skills/apex/templates/04b-doc-sync.md +0 -31
- package/templates/skills/apex/templates/05-examine.md +0 -58
- package/templates/skills/apex/templates/06-resolve.md +0 -39
- package/templates/skills/apex/templates/07-tests.md +0 -56
- package/templates/skills/apex/templates/08-run-tests.md +0 -41
- package/templates/skills/apex/templates/README.md +0 -69
- package/templates/skills/apex/templates/context-digest.md +0 -35
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-03-execute
|
|
3
|
-
description: Todo-driven implementation - execute the plan file by file
|
|
4
|
-
prev_step: steps/step-02-plan.md
|
|
5
|
-
next_step: steps/step-04-validate.md
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Step 3: Execute (Implementation)
|
|
9
|
-
|
|
10
|
-
## MANDATORY EXECUTION RULES:
|
|
11
|
-
|
|
12
|
-
- NEVER deviate from the approved plan
|
|
13
|
-
- NEVER add features not in the plan (scope creep)
|
|
14
|
-
- NEVER modify files without reading them first
|
|
15
|
-
- ALWAYS follow the plan file-by-file
|
|
16
|
-
- ALWAYS mark todos complete immediately after each task
|
|
17
|
-
- ALWAYS read files BEFORE editing them
|
|
18
|
-
- YOU ARE AN IMPLEMENTER following a plan, not a designer
|
|
19
|
-
- FORBIDDEN to add "improvements" not in the plan
|
|
20
|
-
|
|
21
|
-
## YOUR TASK:
|
|
22
|
-
|
|
23
|
-
Execute the approved implementation plan file-by-file, tracking progress with todos.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
<available_state>
|
|
28
|
-
From previous steps:
|
|
29
|
-
|
|
30
|
-
| Variable | Description |
|
|
31
|
-
|----------|-------------|
|
|
32
|
-
| `{task_description}` | What to implement |
|
|
33
|
-
| `{task_id}` | Kebab-case identifier |
|
|
34
|
-
| `{auto_mode}` | Skip confirmations |
|
|
35
|
-
| `{save_mode}` | Save outputs to files |
|
|
36
|
-
| `{output_dir}` | Path to output (if save_mode) |
|
|
37
|
-
| Implementation plan | File-by-file changes from step-02 |
|
|
38
|
-
| Patterns | How to implement from step-01 |
|
|
39
|
-
</available_state>
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## EXECUTION SEQUENCE:
|
|
44
|
-
|
|
45
|
-
### 1. Create Todos from Plan
|
|
46
|
-
|
|
47
|
-
Convert each file change from the plan into todos:
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
Plan entry:
|
|
51
|
-
#### `src/auth/handler.ts`
|
|
52
|
-
- Add `validateToken` function
|
|
53
|
-
- Handle error case: expired token
|
|
54
|
-
|
|
55
|
-
Becomes:
|
|
56
|
-
- [ ] src/auth/handler.ts: Add validateToken function
|
|
57
|
-
- [ ] src/auth/handler.ts: Handle expired token error
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Use TodoWrite to create the full list.
|
|
61
|
-
|
|
62
|
-
### 2. Execute File by File
|
|
63
|
-
|
|
64
|
-
For each todo:
|
|
65
|
-
|
|
66
|
-
**2.1 Mark In Progress**
|
|
67
|
-
- Only ONE todo in_progress at a time
|
|
68
|
-
|
|
69
|
-
**2.2 Read Before Edit**
|
|
70
|
-
```
|
|
71
|
-
ALWAYS read the file before modifying:
|
|
72
|
-
- Understand current structure
|
|
73
|
-
- Find exact insertion points
|
|
74
|
-
- Verify patterns match expectations
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
**2.3 Implement Changes**
|
|
78
|
-
```
|
|
79
|
-
Make changes specified in the plan:
|
|
80
|
-
- Follow patterns from step-01 analysis
|
|
81
|
-
- Use exact names from plan
|
|
82
|
-
- Handle error cases as specified
|
|
83
|
-
- NO comments unless truly necessary
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
**2.4 Mark Complete Immediately**
|
|
87
|
-
- Mark todo complete RIGHT AFTER finishing
|
|
88
|
-
- Don't batch completions
|
|
89
|
-
|
|
90
|
-
**2.5 Log Progress (if save_mode)**
|
|
91
|
-
|
|
92
|
-
Append to `{output_dir}/03-execute.md`:
|
|
93
|
-
```markdown
|
|
94
|
-
### file.ts
|
|
95
|
-
- Added `functionName` (lines 45-78)
|
|
96
|
-
- Added error handling
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 3. Handle Blockers
|
|
100
|
-
|
|
101
|
-
**If `{auto_mode}` = true:**
|
|
102
|
-
Make reasonable decision and continue.
|
|
103
|
-
|
|
104
|
-
**If `{auto_mode}` = false:**
|
|
105
|
-
|
|
106
|
-
```yaml
|
|
107
|
-
questions:
|
|
108
|
-
- header: "Blocker"
|
|
109
|
-
question: "Encountered an issue. How should we proceed?"
|
|
110
|
-
options:
|
|
111
|
-
- label: "Use alternative approach (Recommended)"
|
|
112
|
-
description: "Description of alternative"
|
|
113
|
-
- label: "Skip this part"
|
|
114
|
-
description: "Continue without this change"
|
|
115
|
-
- label: "Stop for discussion"
|
|
116
|
-
description: "I want to discuss before continuing"
|
|
117
|
-
multiSelect: false
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### 4. Verify Implementation
|
|
121
|
-
|
|
122
|
-
After completing all todos:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
pnpm run typecheck && pnpm run lint --fix
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Fix any errors immediately.
|
|
129
|
-
|
|
130
|
-
### 5. Implementation Summary
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
**Implementation Complete**
|
|
134
|
-
|
|
135
|
-
**Files Modified:**
|
|
136
|
-
- `src/auth/handler.ts` - Added validateToken, error handling
|
|
137
|
-
- `src/api/auth/route.ts` - Integrated token validation
|
|
138
|
-
|
|
139
|
-
**New Files:**
|
|
140
|
-
- `src/types/auth.ts` - Auth type definitions
|
|
141
|
-
|
|
142
|
-
**Todos:** {X}/{Y} complete
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### 6. Save Output (if save_mode)
|
|
146
|
-
|
|
147
|
-
**If `{save_mode}` = true:**
|
|
148
|
-
|
|
149
|
-
Finalize `{output_dir}/03-execute.md` with:
|
|
150
|
-
- Summary of all changes
|
|
151
|
-
- Timestamp
|
|
152
|
-
- Update 00-context.md Progress table: 03-execute -> Complete
|
|
153
|
-
|
|
154
|
-
**Then proceed to validation.**
|
|
155
|
-
|
|
156
|
-
### 6b. Generate Context Digest (if save_mode)
|
|
157
|
-
|
|
158
|
-
**If `{save_mode}` = true:**
|
|
159
|
-
|
|
160
|
-
Generate a compact digest (max 50 lines) for inter-step context transfer.
|
|
161
|
-
Use the template from `_resources/context-digest-template.md`.
|
|
162
|
-
|
|
163
|
-
```markdown
|
|
164
|
-
## Context Digest — step-03-execute
|
|
165
|
-
|
|
166
|
-
### Changes
|
|
167
|
-
- {files modified with line ranges and summary}
|
|
168
|
-
- {new files created}
|
|
169
|
-
|
|
170
|
-
### Decisions
|
|
171
|
-
- {implementation choices made during execution}
|
|
172
|
-
|
|
173
|
-
### Findings
|
|
174
|
-
- {issues encountered and how resolved}
|
|
175
|
-
- {patterns that deviated from plan}
|
|
176
|
-
|
|
177
|
-
### State
|
|
178
|
-
- Todos completed: {X}/{Y}
|
|
179
|
-
- Files modified: {count}
|
|
180
|
-
- Files created: {count}
|
|
181
|
-
|
|
182
|
-
### Blockers
|
|
183
|
-
- {any remaining issues}
|
|
184
|
-
|
|
185
|
-
### Next
|
|
186
|
-
- Step-04 should validate: {specific checks needed}
|
|
187
|
-
- Files to verify: {list of modified files}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Write digest to `{output_dir}/03-execute-digest.md`
|
|
191
|
-
|
|
192
|
-
**Purpose:** Step-04 reads ONLY this digest (not full execution log) to minimize token usage.
|
|
193
|
-
Exception: If `{resume_task}` is set, read the full outputs instead.
|
|
194
|
-
|
|
195
|
-
---
|
|
196
|
-
|
|
197
|
-
## SUCCESS METRICS:
|
|
198
|
-
|
|
199
|
-
- All plan items implemented
|
|
200
|
-
- All todos marked complete
|
|
201
|
-
- No scope creep - only plan items
|
|
202
|
-
- Files read before modification
|
|
203
|
-
- Typecheck and lint pass
|
|
204
|
-
|
|
205
|
-
## FAILURE MODES:
|
|
206
|
-
|
|
207
|
-
- Adding features not in the plan
|
|
208
|
-
- Modifying files without reading first
|
|
209
|
-
- Not updating todos as you work
|
|
210
|
-
- Multiple todos in_progress simultaneously
|
|
211
|
-
- Ignoring type or lint errors
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
|
-
## NEXT STEP:
|
|
216
|
-
|
|
217
|
-
After implementation complete, load `./step-04-validate.md`
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-04-validate
|
|
3
|
-
description: Self-check - run tests, verify AC, audit implementation quality
|
|
4
|
-
prev_step: steps/step-03-execute.md
|
|
5
|
-
next_step: steps/step-05-examine.md
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Step 4: Validate (Self-Check)
|
|
9
|
-
|
|
10
|
-
## MANDATORY EXECUTION RULES:
|
|
11
|
-
|
|
12
|
-
- NEVER claim checks pass when they don't
|
|
13
|
-
- NEVER skip any validation step
|
|
14
|
-
- ALWAYS run typecheck, lint, and tests
|
|
15
|
-
- ALWAYS verify each acceptance criterion
|
|
16
|
-
- ALWAYS fix failures before proceeding
|
|
17
|
-
- YOU ARE A VALIDATOR, not an implementer
|
|
18
|
-
- FORBIDDEN to proceed with failing checks
|
|
19
|
-
|
|
20
|
-
## YOUR TASK:
|
|
21
|
-
|
|
22
|
-
Validate the implementation by running checks, verifying acceptance criteria, and ensuring quality.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
<available_state>
|
|
27
|
-
From previous steps:
|
|
28
|
-
|
|
29
|
-
| Variable | Description |
|
|
30
|
-
|----------|-------------|
|
|
31
|
-
| `{task_description}` | What was implemented |
|
|
32
|
-
| `{task_id}` | Kebab-case identifier |
|
|
33
|
-
| `{acceptance_criteria}` | Success criteria |
|
|
34
|
-
| `{auto_mode}` | Skip confirmations |
|
|
35
|
-
| `{save_mode}` | Save outputs to files |
|
|
36
|
-
| `{test_mode}` | Include test steps |
|
|
37
|
-
| `{examine_mode}` | Auto-proceed to review |
|
|
38
|
-
| `{doc_mode}` | Documentation sync enabled |
|
|
39
|
-
| `{output_dir}` | Path to output (if save_mode) |
|
|
40
|
-
| Implementation | Completed in step-03 |
|
|
41
|
-
</available_state>
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## EXECUTION SEQUENCE:
|
|
46
|
-
|
|
47
|
-
### 1. Discover Available Commands
|
|
48
|
-
|
|
49
|
-
Check `package.json` for exact command names:
|
|
50
|
-
```bash
|
|
51
|
-
cat package.json | grep -A 20 '"scripts"'
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Look for: `typecheck`, `lint`, `test`, `build`, `format`
|
|
55
|
-
|
|
56
|
-
### 2. Run Validation Suite
|
|
57
|
-
|
|
58
|
-
**2.1 Typecheck**
|
|
59
|
-
```bash
|
|
60
|
-
pnpm run typecheck # or npm run typecheck
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**MUST PASS.** If fails:
|
|
64
|
-
1. Read error messages
|
|
65
|
-
2. Fix type issues
|
|
66
|
-
3. Re-run until passing
|
|
67
|
-
|
|
68
|
-
**2.2 Lint**
|
|
69
|
-
```bash
|
|
70
|
-
pnpm run lint
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**MUST PASS.** If fails:
|
|
74
|
-
1. Try auto-fix: `pnpm run lint --fix`
|
|
75
|
-
2. Manually fix remaining
|
|
76
|
-
3. Re-run until passing
|
|
77
|
-
|
|
78
|
-
**2.3 Tests**
|
|
79
|
-
```bash
|
|
80
|
-
pnpm run test
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**MUST PASS.** If fails:
|
|
84
|
-
1. Identify failing test
|
|
85
|
-
2. Determine if code bug or test bug
|
|
86
|
-
3. Fix the root cause
|
|
87
|
-
4. Re-run until passing
|
|
88
|
-
|
|
89
|
-
### 3. SmartStack Convention Validation (if MCP available)
|
|
90
|
-
|
|
91
|
-
**Use MCP to validate SmartStack conventions:**
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
mcp__smartstack__validate_conventions:
|
|
95
|
-
checks: ["all"]
|
|
96
|
-
# Valide: tables, migrations, services, namespaces, entities, tenants, controllers
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**If EF Core changes detected, also run:**
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
mcp__smartstack__check_migrations:
|
|
103
|
-
# Vérifie conflits, ordre chronologique, ModelSnapshot
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
**MCP validation checks:**
|
|
107
|
-
- [ ] Table naming (domain prefixes: auth_, nav_, cfg_, etc.)
|
|
108
|
-
- [ ] Migration naming ({context}_v{version}_{sequence}_{Description})
|
|
109
|
-
- [ ] Service interfaces (I*Service pattern)
|
|
110
|
-
- [ ] Namespace structure (Domain → Application → Infrastructure → API)
|
|
111
|
-
- [ ] Entity conventions (base classes, soft delete, audit)
|
|
112
|
-
- [ ] Tenant isolation (ITenantEntity where required)
|
|
113
|
-
- [ ] Controller routes (NavRoute attributes)
|
|
114
|
-
|
|
115
|
-
### 3b. Documentation Impact Check (informative)
|
|
116
|
-
|
|
117
|
-
**If `{doc_mode}` = true:**
|
|
118
|
-
|
|
119
|
-
Check if `docs-manifest.json` exists in the project root. If it does:
|
|
120
|
-
|
|
121
|
-
1. Read `docs-manifest.json`
|
|
122
|
-
2. Compare modified files (from step-03 todos) against `codeFiles` in manifest
|
|
123
|
-
3. For each impacted module, note:
|
|
124
|
-
- Module name and featureId
|
|
125
|
-
- Last documentation update date
|
|
126
|
-
- Which code-to-doc mapping applies (entity → businessRules, controller → apiEndpoints, etc.)
|
|
127
|
-
|
|
128
|
-
**Report (informative only, does not block validation):**
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
Documentation Impact:
|
|
132
|
-
- Module: {app}/{module} (FEAT-NNN) — last doc update: {date}
|
|
133
|
-
- Entity changes → businessRules, features may need update
|
|
134
|
-
- Controller changes → apiEndpoints need update
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
**If `docs-manifest.json` absent:** Skip silently.
|
|
138
|
-
|
|
139
|
-
> **Note:** Actual documentation sync happens in step-04b-doc-sync.md (next step if doc_mode enabled).
|
|
140
|
-
|
|
141
|
-
### 4. Self-Audit Checklist
|
|
142
|
-
|
|
143
|
-
Verify each item:
|
|
144
|
-
|
|
145
|
-
**Tasks Complete:**
|
|
146
|
-
- [ ] All todos from step-03 marked complete
|
|
147
|
-
- [ ] No tasks skipped without reason
|
|
148
|
-
- [ ] Any blocked tasks have explanation
|
|
149
|
-
|
|
150
|
-
**Tests Passing:**
|
|
151
|
-
- [ ] All existing tests pass
|
|
152
|
-
- [ ] New tests written for new functionality
|
|
153
|
-
- [ ] No skipped tests without reason
|
|
154
|
-
|
|
155
|
-
**Acceptance Criteria:**
|
|
156
|
-
- [ ] Each AC demonstrably met
|
|
157
|
-
- [ ] Can explain how implementation satisfies AC
|
|
158
|
-
- [ ] Edge cases considered
|
|
159
|
-
|
|
160
|
-
**Patterns Followed:**
|
|
161
|
-
- [ ] Code follows existing patterns
|
|
162
|
-
- [ ] Error handling consistent
|
|
163
|
-
- [ ] Naming conventions match
|
|
164
|
-
|
|
165
|
-
### 5. Format Code
|
|
166
|
-
|
|
167
|
-
If format command available:
|
|
168
|
-
```bash
|
|
169
|
-
pnpm run format
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 6. Final Verification
|
|
173
|
-
|
|
174
|
-
Re-run all checks:
|
|
175
|
-
```bash
|
|
176
|
-
pnpm run typecheck && pnpm run lint
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Both MUST pass.
|
|
180
|
-
|
|
181
|
-
### 7. Present Validation Results
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
**Validation Complete**
|
|
185
|
-
|
|
186
|
-
**Typecheck:** Pass
|
|
187
|
-
**Lint:** Pass
|
|
188
|
-
**Tests:** {X}/{X} passing
|
|
189
|
-
**Format:** Applied
|
|
190
|
-
|
|
191
|
-
**Acceptance Criteria:**
|
|
192
|
-
- [x] AC1: Verified by [how]
|
|
193
|
-
- [x] AC2: Verified by [how]
|
|
194
|
-
|
|
195
|
-
**Files Modified:** {list}
|
|
196
|
-
|
|
197
|
-
**Summary:** All checks passing, ready for next step.
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### 8. Save Output (if save_mode)
|
|
201
|
-
|
|
202
|
-
**If `{save_mode}` = true:**
|
|
203
|
-
|
|
204
|
-
Write to `{output_dir}/04-validate.md`:
|
|
205
|
-
- Validation results
|
|
206
|
-
- AC verification
|
|
207
|
-
- Timestamp
|
|
208
|
-
- Update 00-context.md Progress table: 04-validate -> Complete
|
|
209
|
-
|
|
210
|
-
### 9. Determine Next Step
|
|
211
|
-
|
|
212
|
-
**Decision tree:**
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
IF {doc_mode} = true AND docs-manifest.json exists:
|
|
216
|
-
-> Load step-04b-doc-sync.md (documentation sync)
|
|
217
|
-
|
|
218
|
-
ELSE IF {test_mode} = true:
|
|
219
|
-
-> Load step-07-tests.md (test analysis and creation)
|
|
220
|
-
|
|
221
|
-
ELSE IF {examine_mode} = true:
|
|
222
|
-
-> Load step-05-examine.md (adversarial review)
|
|
223
|
-
|
|
224
|
-
ELSE IF {auto_mode} = false:
|
|
225
|
-
-> Ask user what to do next
|
|
226
|
-
|
|
227
|
-
ELSE:
|
|
228
|
-
-> Complete workflow (show final summary)
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**If `{auto_mode}` = false:**
|
|
232
|
-
|
|
233
|
-
```yaml
|
|
234
|
-
questions:
|
|
235
|
-
- header: "Next"
|
|
236
|
-
question: "Validation complete. What would you like to do?"
|
|
237
|
-
options:
|
|
238
|
-
- label: "Run adversarial review"
|
|
239
|
-
description: "Deep review for security, logic, and quality"
|
|
240
|
-
- label: "Complete workflow"
|
|
241
|
-
description: "Skip review and finalize"
|
|
242
|
-
- label: "Add tests"
|
|
243
|
-
description: "Create additional tests first"
|
|
244
|
-
multiSelect: false
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## SUCCESS METRICS:
|
|
250
|
-
|
|
251
|
-
- Typecheck passes
|
|
252
|
-
- Lint passes
|
|
253
|
-
- All tests pass
|
|
254
|
-
- All AC verified
|
|
255
|
-
- Code formatted
|
|
256
|
-
- User informed of status
|
|
257
|
-
|
|
258
|
-
## FAILURE MODES:
|
|
259
|
-
|
|
260
|
-
- Claiming checks pass when they don't
|
|
261
|
-
- Not running all validation commands
|
|
262
|
-
- Skipping tests for modified code
|
|
263
|
-
- Missing AC verification
|
|
264
|
-
- Proceeding with failures
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
|
|
268
|
-
## NEXT STEP:
|
|
269
|
-
|
|
270
|
-
Based on flags (check in order):
|
|
271
|
-
- **If test_mode:** Load `./step-07-tests.md`
|
|
272
|
-
- **If examine_mode OR user requests:** Load `./step-05-examine.md`
|
|
273
|
-
- **Otherwise:** Workflow complete - show summary
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-04b-doc-sync
|
|
3
|
-
description: Documentation sync - detect affected modules and update documentation
|
|
4
|
-
prev_step: steps/step-04-validate.md
|
|
5
|
-
next_step: steps/step-05-examine.md
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Step 4b: Documentation Sync
|
|
9
|
-
|
|
10
|
-
## MANDATORY EXECUTION RULES:
|
|
11
|
-
|
|
12
|
-
- NEVER skip this step when {doc_mode} = true
|
|
13
|
-
- NEVER create documentation from scratch (that is BA skill's job)
|
|
14
|
-
- ALWAYS update existing documentation only
|
|
15
|
-
- ALWAYS update docs-manifest.json after changes
|
|
16
|
-
- IF docs-manifest.json is absent → skip with note "No documentation manifest found"
|
|
17
|
-
|
|
18
|
-
## YOUR TASK:
|
|
19
|
-
|
|
20
|
-
Detect which documented modules are affected by the code changes and update their documentation data files.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
<available_state>
|
|
25
|
-
From previous steps:
|
|
26
|
-
|
|
27
|
-
| Variable | Description |
|
|
28
|
-
|----------|-------------|
|
|
29
|
-
| `{task_description}` | What was implemented |
|
|
30
|
-
| `{task_id}` | Full task identifier |
|
|
31
|
-
| `{doc_mode}` | Documentation sync enabled (should be true) |
|
|
32
|
-
| `{economy_mode}` | No subagents if true |
|
|
33
|
-
| `{save_mode}` | Save outputs to disk |
|
|
34
|
-
| `{output_dir}` | Output directory path |
|
|
35
|
-
</available_state>
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## EXECUTION SEQUENCE:
|
|
40
|
-
|
|
41
|
-
### 1. Check Documentation Manifest
|
|
42
|
-
|
|
43
|
-
Read `docs-manifest.json` from project root.
|
|
44
|
-
|
|
45
|
-
**If absent:**
|
|
46
|
-
```
|
|
47
|
-
Display: "No docs-manifest.json found. Skipping documentation sync."
|
|
48
|
-
Display: "TIP: Run /business-analyse to create documentation for your modules."
|
|
49
|
-
→ Load next step
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**If present:** Continue.
|
|
53
|
-
|
|
54
|
-
### 2. Identify Affected Modules
|
|
55
|
-
|
|
56
|
-
Get files modified during step-03 (from TodoList or git diff):
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
git diff --name-only HEAD~1
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Match modified files against `codeFiles` in each manifest module entry.
|
|
63
|
-
|
|
64
|
-
**Build affected modules list:**
|
|
65
|
-
|
|
66
|
-
| Module | Changed Files | Impact |
|
|
67
|
-
|--------|---------------|--------|
|
|
68
|
-
| business/{app}/{module} | [list] | [sections] |
|
|
69
|
-
|
|
70
|
-
### 3. Map Code Changes to Documentation Sections
|
|
71
|
-
|
|
72
|
-
For each affected module, classify changes:
|
|
73
|
-
|
|
74
|
-
| Code Change Pattern | Documentation Section |
|
|
75
|
-
|--------------------|-----------------------|
|
|
76
|
-
| `**/Entities/**` modified | businessRules, features |
|
|
77
|
-
| `**/Controllers/**` modified | apiEndpoints, technicalRef |
|
|
78
|
-
| `**/Permissions*` modified | permissions |
|
|
79
|
-
| `**/Validators/**` modified | businessRules |
|
|
80
|
-
| `**/i18n/**` modified | useCases (labels), faq |
|
|
81
|
-
| `**/Migrations/**` created | technicalRef |
|
|
82
|
-
| `**/DTOs/**` modified | apiEndpoints |
|
|
83
|
-
| `**/Commands/**` modified | useCases, features |
|
|
84
|
-
| `**/Queries/**` modified | useCases, features |
|
|
85
|
-
|
|
86
|
-
### 4. Read Current Documentation
|
|
87
|
-
|
|
88
|
-
For each affected module:
|
|
89
|
-
|
|
90
|
-
**If {economy_mode} = false:**
|
|
91
|
-
- Launch `docs-context-reader` agent for the module
|
|
92
|
-
- Agent returns structured summary of current doc state
|
|
93
|
-
|
|
94
|
-
**If {economy_mode} = true:**
|
|
95
|
-
- Read `doc-data.ts` directly
|
|
96
|
-
- Read i18n FR file directly
|
|
97
|
-
|
|
98
|
-
### 5. Update Documentation Data
|
|
99
|
-
|
|
100
|
-
For each affected module and impacted section:
|
|
101
|
-
|
|
102
|
-
1. Read current `doc-data.ts`
|
|
103
|
-
2. Compare with actual code state
|
|
104
|
-
3. Update affected fields:
|
|
105
|
-
- **apiEndpoints**: Scan controller for `[Http*]` attributes
|
|
106
|
-
- **permissions**: Scan PermissionConfiguration.cs for module
|
|
107
|
-
- **businessRules**: Scan validators and entity methods
|
|
108
|
-
- **useCases**: Update if commands/queries changed
|
|
109
|
-
- **features**: Update if new functionality added
|
|
110
|
-
4. Write updated `doc-data.ts`
|
|
111
|
-
5. Update i18n FR file if label keys changed
|
|
112
|
-
|
|
113
|
-
### 6. Update Documentation Manifest
|
|
114
|
-
|
|
115
|
-
For each updated module:
|
|
116
|
-
|
|
117
|
-
```json
|
|
118
|
-
{
|
|
119
|
-
"lastDocUpdate": "{current_timestamp}",
|
|
120
|
-
"gitCommitDoc": "{current_commit_sha}",
|
|
121
|
-
"status": "synced"
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Update `docs-manifest.json` root `lastUpdated`.
|
|
126
|
-
|
|
127
|
-
### 7. Save Output (if save_mode)
|
|
128
|
-
|
|
129
|
-
Write `{output_dir}/04b-doc-sync.md` with:
|
|
130
|
-
- Modules checked
|
|
131
|
-
- Modules updated
|
|
132
|
-
- Sections modified
|
|
133
|
-
- Files changed
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## SUCCESS METRICS:
|
|
138
|
-
|
|
139
|
-
- All affected modules identified
|
|
140
|
-
- Documentation data files updated for impacted sections
|
|
141
|
-
- docs-manifest.json timestamps updated
|
|
142
|
-
- No new documentation created (only updates)
|
|
143
|
-
|
|
144
|
-
## FAILURE MODES:
|
|
145
|
-
|
|
146
|
-
- docs-manifest.json absent → skip gracefully (not a failure)
|
|
147
|
-
- doc-data.ts has unexpected format → report warning, skip module
|
|
148
|
-
- No modules affected → display "No documented modules affected by changes"
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## NEXT STEP:
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
IF {test_mode} = true AND step-07 not yet done:
|
|
156
|
-
→ Load steps/step-07-tests.md
|
|
157
|
-
ELSE IF {examine_mode} = true:
|
|
158
|
-
→ Load steps/step-05-examine.md
|
|
159
|
-
ELSE:
|
|
160
|
-
→ Display completion summary
|
|
161
|
-
→ IF {pr_mode} = true: Load steps/step-09-finish.md
|
|
162
|
-
```
|