claude-code-workflow 7.2.11 → 7.2.13
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/.claude/agents/workflow-research-agent.md +112 -0
- package/.claude/commands/workflow/analyze-with-file.md +185 -60
- package/.claude/commands/workflow-tune.md +811 -0
- package/.claude/skills/workflow-lite-execute/SKILL.md +106 -14
- package/.claude/skills/workflow-lite-plan/SKILL.md +34 -72
- package/.claude/skills/workflow-lite-test-review/SKILL.md +39 -26
- package/package.json +1 -1
- package/.claude/commands/ddd/auto.md +0 -359
- package/.claude/commands/ddd/doc-generate.md +0 -222
- package/.claude/commands/ddd/doc-refresh.md +0 -218
- package/.claude/commands/ddd/execute.md +0 -416
- package/.claude/commands/ddd/index-build.md +0 -212
- package/.claude/commands/ddd/plan.md +0 -611
- package/.claude/commands/ddd/scan.md +0 -365
- package/.claude/commands/ddd/sync.md +0 -353
- package/.claude/commands/ddd/update.md +0 -160
- package/.claude/commands/idaw/add.md +0 -287
- package/.claude/commands/idaw/resume.md +0 -442
- package/.claude/commands/idaw/run-coordinate.md +0 -648
- package/.claude/commands/idaw/run.md +0 -539
- package/.claude/commands/idaw/status.md +0 -182
- package/.claude/skills/workflow-tune/SKILL.md +0 -487
- package/.claude/skills/workflow-tune/phases/01-setup.md +0 -548
- package/.claude/skills/workflow-tune/phases/02-step-execute.md +0 -197
- package/.claude/skills/workflow-tune/phases/03-step-analyze.md +0 -386
- package/.claude/skills/workflow-tune/phases/04-synthesize.md +0 -257
- package/.claude/skills/workflow-tune/phases/05-optimize-report.md +0 -246
- package/.claude/skills/workflow-tune/specs/workflow-eval-criteria.md +0 -57
- package/.claude/skills/workflow-tune/templates/step-analysis-prompt.md +0 -88
- package/.claude/skills/workflow-tune/templates/synthesis-prompt.md +0 -90
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sync
|
|
3
|
-
description: Post-task synchronization - update document index, generate action log, and refresh feature/component docs after completing a development task.
|
|
4
|
-
argument-hint: "[-y|--yes] [--dry-run] [--from-manifest <path>] [--task-id <id>] [--commit <hash>] \"task summary\""
|
|
5
|
-
allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*), mcp__ace-tool__search_context(*)
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Auto Mode
|
|
9
|
-
|
|
10
|
-
When `--yes` or `-y`: Auto-detect changes, auto-update all docs, skip review prompts.
|
|
11
|
-
|
|
12
|
-
# DDD Sync Command (/ddd:sync)
|
|
13
|
-
|
|
14
|
-
## Purpose
|
|
15
|
-
|
|
16
|
-
After completing a development task, synchronize the document index with actual code changes:
|
|
17
|
-
1. **Analyze** what changed (git diff)
|
|
18
|
-
2. **Trace** which features/requirements/components are affected
|
|
19
|
-
3. **Update** index entries (status, code locations, links)
|
|
20
|
-
4. **Generate** action log entry
|
|
21
|
-
5. **Refresh** feature-map and tech-registry documents
|
|
22
|
-
|
|
23
|
-
## When to Use: sync vs update
|
|
24
|
-
|
|
25
|
-
| Scenario | Use |
|
|
26
|
-
|----------|-----|
|
|
27
|
-
| Task completed, ready to commit | **ddd:sync** — full post-task reconciliation |
|
|
28
|
-
| Mid-development, quick impact check | ddd:update |
|
|
29
|
-
| Pre-commit validation | ddd:update --check-only |
|
|
30
|
-
| Auto-triggered after ddd:execute | **ddd:sync** (automatic) |
|
|
31
|
-
| Periodic index refresh during refactoring | ddd:update |
|
|
32
|
-
|
|
33
|
-
**Rule of thumb**: `sync` = task boundary (done something), `update` = development pulse (doing something).
|
|
34
|
-
|
|
35
|
-
## Prerequisite
|
|
36
|
-
|
|
37
|
-
- `doc-index.json` must exist
|
|
38
|
-
- Git repository with committed or staged changes
|
|
39
|
-
|
|
40
|
-
## Phase 0: Consistency Validation
|
|
41
|
-
|
|
42
|
-
Before processing changes, verify that `doc-index.json` entries are consistent with actual code state.
|
|
43
|
-
|
|
44
|
-
### 0.1 Validate Code Locations
|
|
45
|
-
|
|
46
|
-
For each `technicalComponents[].codeLocations[]`:
|
|
47
|
-
- Verify file exists on disk
|
|
48
|
-
- If file was deleted/moved → flag for removal or update
|
|
49
|
-
- If file exists → verify listed `symbols[]` still exist (quick grep/AST check)
|
|
50
|
-
|
|
51
|
-
### 0.2 Validate Symbols
|
|
52
|
-
|
|
53
|
-
For components with `codeLocations[].symbols[]`:
|
|
54
|
-
- Check each symbol still exists in the referenced file
|
|
55
|
-
- Detect new exported symbols not yet tracked
|
|
56
|
-
- Report: `{N} stale symbols, {N} untracked symbols`
|
|
57
|
-
|
|
58
|
-
### 0.3 Validation Report
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
Consistency Check:
|
|
62
|
-
Components validated: {N}
|
|
63
|
-
Files verified: {N}
|
|
64
|
-
Stale references: {N} (files missing or symbols removed)
|
|
65
|
-
Untracked symbols: {N} (new exports not in index)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
If stale references found: warn and auto-fix during Phase 3 updates.
|
|
69
|
-
If `--dry-run`: report only, no fixes.
|
|
70
|
-
|
|
71
|
-
## Phase 1: Change Detection
|
|
72
|
-
|
|
73
|
-
### 1.0.1 Schema Version Check
|
|
74
|
-
|
|
75
|
-
Before processing changes, verify doc-index.json schema compatibility:
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
78
|
-
const docIndex = JSON.parse(Read('.workflow/.doc-index/doc-index.json'));
|
|
79
|
-
const schemaVersion = docIndex.schema_version || '0.0'; // Default for legacy
|
|
80
|
-
|
|
81
|
-
if (schemaVersion !== '1.0') {
|
|
82
|
-
console.warn(`Schema version mismatch: found ${schemaVersion}, expected 1.0`);
|
|
83
|
-
console.warn('Consider running schema migration or regenerating doc-index with /ddd:scan');
|
|
84
|
-
// Continue with degraded functionality - may encounter missing fields
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Graceful degradation**: If version mismatch detected → log warning → continue with caution (some features may not work as expected).
|
|
89
|
-
|
|
90
|
-
### 1.0 Data Source Selection
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
IF --from-manifest <path>:
|
|
94
|
-
Load execution-manifest.json
|
|
95
|
-
→ files_modified[] provides precise file list + action type + task attribution
|
|
96
|
-
→ TASK-*.result.json provides symbol-level changes + convergence results
|
|
97
|
-
→ Skip Phase 1.1/1.2 (already classified by execute)
|
|
98
|
-
→ Proceed directly to Phase 2 with manifest data
|
|
99
|
-
ELSE:
|
|
100
|
-
→ Fall through to Phase 1.1 (git-based discovery)
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**`--from-manifest` advantages** (used automatically by ddd:execute):
|
|
104
|
-
- Precise file → task attribution (which task modified which file)
|
|
105
|
-
- Symbol-level change tracking (not just file-level)
|
|
106
|
-
- Convergence verification results carried forward to action-log
|
|
107
|
-
- Survives process interruptions (manifest is persisted to disk)
|
|
108
|
-
|
|
109
|
-
### 1.1 Identify Changes (git-based fallback)
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
# If --commit provided:
|
|
113
|
-
git diff --name-only {commit}^..{commit}
|
|
114
|
-
git diff --stat {commit}^..{commit}
|
|
115
|
-
|
|
116
|
-
# If --task-id provided, find related commits:
|
|
117
|
-
git log --oneline --grep="task-{id}" | head -10
|
|
118
|
-
|
|
119
|
-
# Otherwise: changes since last ddd:sync
|
|
120
|
-
git diff --name-only HEAD~1..HEAD
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### 1.2 Classify Changes (git-based fallback)
|
|
124
|
-
|
|
125
|
-
For each changed file, determine:
|
|
126
|
-
- **Type**: added | modified | deleted | renamed
|
|
127
|
-
- **Category**: source | test | config | docs | other
|
|
128
|
-
- **Symbols affected**: parse diff for changed functions/classes (use Gemini if complex)
|
|
129
|
-
|
|
130
|
-
## Phase 2: Impact Tracing (Layer-Based, TASK-004)
|
|
131
|
-
|
|
132
|
-
**Strategy**: Trace impact through layers (files → components → features → indexes) following memory-manage pattern.
|
|
133
|
-
|
|
134
|
-
### 2.1 Match to Index
|
|
135
|
-
|
|
136
|
-
For each changed file path:
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
Search doc-index.json.technicalComponents[].codeLocations[].path
|
|
140
|
-
→ Find matching component IDs (Layer 3)
|
|
141
|
-
→ From components, find linked featureIds (Layer 2)
|
|
142
|
-
→ From features, find linked requirementIds (Layer 2)
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### 2.2 Discover New Components
|
|
146
|
-
|
|
147
|
-
If changed files don't match any existing component:
|
|
148
|
-
- Flag as potential new component
|
|
149
|
-
- Ask user if it should be registered (or auto-register with `-y`)
|
|
150
|
-
|
|
151
|
-
### 2.3 Build Impact Report
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
154
|
-
## Impact Summary
|
|
155
|
-
|
|
156
|
-
### Changed Files (5)
|
|
157
|
-
- src/services/auth.ts (modified) → tech-auth-service → feat-auth
|
|
158
|
-
- src/models/user.ts (modified) → tech-user-model → feat-auth
|
|
159
|
-
- src/routes/login.ts (added) → NEW COMPONENT → feat-auth
|
|
160
|
-
- src/tests/auth.test.ts (modified) → [test file, skip]
|
|
161
|
-
- package.json (modified) → [config, skip]
|
|
162
|
-
|
|
163
|
-
### Affected Features
|
|
164
|
-
- feat-auth: User Authentication (2 components modified, 1 new)
|
|
165
|
-
|
|
166
|
-
### Affected Requirements
|
|
167
|
-
- REQ-001: Email login (implementation updated)
|
|
168
|
-
- REQ-002: JWT token generation (implementation updated)
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
## Phase 2.4: DeepWiki Freshness Check
|
|
172
|
-
|
|
173
|
-
If DeepWiki integration is configured (`doc-index.json.freshness` exists):
|
|
174
|
-
|
|
175
|
-
### 2.4.1 Identify Modified Files
|
|
176
|
-
From `execution-manifest.json` or git diff, collect `files_modified[]` with `action == "modified"`.
|
|
177
|
-
|
|
178
|
-
### 2.4.2 Check Staleness
|
|
179
|
-
Query DeepWiki: `POST /api/deepwiki/stale-files { files: [{path, hash}] }`
|
|
180
|
-
|
|
181
|
-
For each stale file's symbols, calculate staleness score:
|
|
182
|
-
```
|
|
183
|
-
S(symbol) = min(1.0, w_t × T + w_c × C + w_s × M)
|
|
184
|
-
```
|
|
185
|
-
Where weights come from `doc-index.json.freshness.weights`.
|
|
186
|
-
|
|
187
|
-
### 2.4.3 Score Propagation (max aggregation)
|
|
188
|
-
```
|
|
189
|
-
S_file = max(S_symbol_1, S_symbol_2, ...)
|
|
190
|
-
S_component = max(S_file_1, S_file_2, ...)
|
|
191
|
-
S_feature = max(S_component_1, S_component_2, ...)
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### 2.4.4 Status Assignment
|
|
195
|
-
Using thresholds from `doc-index.json.freshness.thresholds`:
|
|
196
|
-
- `fresh`: score in [0, warning_threshold)
|
|
197
|
-
- `warning`: score in [warning_threshold, stale_threshold)
|
|
198
|
-
- `stale`: score in [stale_threshold, 1.0]
|
|
199
|
-
|
|
200
|
-
### 2.4.5 Update Records
|
|
201
|
-
- Update `deepwiki_symbols.staleness_score` and `deepwiki_files.staleness_score` in DeepWiki SQLite
|
|
202
|
-
- Update `tech-registry/{slug}.md` YAML frontmatter with freshness block
|
|
203
|
-
- Update `feature-maps/{slug}.md` YAML frontmatter with freshness block
|
|
204
|
-
- Update `deepwiki_feature_to_symbol_index` in doc-index.json
|
|
205
|
-
|
|
206
|
-
### 2.4.6 Staleness Report
|
|
207
|
-
Add to action-log:
|
|
208
|
-
- Number of stale symbols/files/components
|
|
209
|
-
- Top-5 most stale items with scores
|
|
210
|
-
- Auto-regeneration candidates (if `auto_regenerate: true` and score >= stale threshold)
|
|
211
|
-
|
|
212
|
-
## Phase 3: Update Index
|
|
213
|
-
|
|
214
|
-
### 3.0 Dry-Run Gate
|
|
215
|
-
|
|
216
|
-
If `--dry-run` is set:
|
|
217
|
-
- Execute Phase 3 analysis (determine what would change)
|
|
218
|
-
- Display planned modifications as a preview report
|
|
219
|
-
- Skip all file writes (Phase 3.1-3.5 and Phase 4)
|
|
220
|
-
- Output: "Dry-run complete. Run without --dry-run to apply changes."
|
|
221
|
-
|
|
222
|
-
### 3.0.1 Backup Index
|
|
223
|
-
|
|
224
|
-
Before any modifications, create backup:
|
|
225
|
-
- Copy `doc-index.json` → `doc-index.json.bak`
|
|
226
|
-
- On failure: restore from `.bak` and report error
|
|
227
|
-
- On success: remove `.bak`
|
|
228
|
-
|
|
229
|
-
### 3.1 Update Technical Components
|
|
230
|
-
|
|
231
|
-
For each affected component in `doc-index.json`:
|
|
232
|
-
- Update `codeLocations` if file paths or line ranges changed
|
|
233
|
-
- Update `symbols` if new exports were added
|
|
234
|
-
- Add new `actionIds` entry
|
|
235
|
-
- **Auto-update `responsibility`**: If symbols changed (new methods/exports added or removed), re-infer responsibility from current symbols list using Gemini analysis. This prevents stale descriptions (e.g., responsibility still says "登录、注册" after adding logout support)
|
|
236
|
-
|
|
237
|
-
### 3.2 Register New Components
|
|
238
|
-
|
|
239
|
-
For newly discovered components:
|
|
240
|
-
- Generate `tech-{slug}` ID
|
|
241
|
-
- Create entry in `technicalComponents[]`
|
|
242
|
-
- Link to appropriate features
|
|
243
|
-
- Generate new `tech-registry/{slug}.md` document
|
|
244
|
-
|
|
245
|
-
### 3.3 Update Feature Status
|
|
246
|
-
|
|
247
|
-
For each affected feature:
|
|
248
|
-
- If all requirements now have mapped components → `status: "implemented"`
|
|
249
|
-
- If some requirements still unmapped → `status: "in-progress"`
|
|
250
|
-
|
|
251
|
-
### 3.4 Add Action Entry
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
{
|
|
255
|
-
"id": "task-{id}",
|
|
256
|
-
"description": "{task summary from user}",
|
|
257
|
-
"type": "feature|bugfix|refactor",
|
|
258
|
-
"status": "completed",
|
|
259
|
-
"affectedFeatures": ["feat-auth"],
|
|
260
|
-
"affectedComponents": ["tech-auth-service", "tech-user-model"],
|
|
261
|
-
"changedFiles": [
|
|
262
|
-
{ "path": "src/services/auth.ts", "action": "modified", "task_id": "TASK-001" },
|
|
263
|
-
{ "path": "src/models/user.ts", "action": "modified", "task_id": "TASK-001" }
|
|
264
|
-
],
|
|
265
|
-
"symbolsChanged": ["AuthService.validate", "UserModel.toJSON"],
|
|
266
|
-
"convergenceResults": {
|
|
267
|
-
"passed": 2,
|
|
268
|
-
"total": 2,
|
|
269
|
-
"details": ["Rate limiter middleware exists", "Config accepts per-route limits"]
|
|
270
|
-
},
|
|
271
|
-
"verifyGate": "PASS|WARN|FAIL|skipped",
|
|
272
|
-
"relatedCommit": "{commit hash}",
|
|
273
|
-
"manifestPath": "{execution-manifest.json path | null}",
|
|
274
|
-
"timestamp": "ISO8601"
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### 3.5 Update Timestamp
|
|
279
|
-
|
|
280
|
-
Set `doc-index.json.last_updated` to current time.
|
|
281
|
-
|
|
282
|
-
## Phase 4: Refresh Documents & Action Log
|
|
283
|
-
|
|
284
|
-
### 4.1 Delegate Document Refresh to /ddd:doc-refresh
|
|
285
|
-
|
|
286
|
-
From Phase 2 impact tracing, collect affected component and feature IDs, then delegate:
|
|
287
|
-
|
|
288
|
-
```
|
|
289
|
-
Invoke /ddd:doc-refresh [-y] --components {affected_component_ids} --features {affected_feature_ids}
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
This handles Layer 3 → 2 → 1 selective document refresh. See `/ddd:doc-refresh` for full details.
|
|
293
|
-
|
|
294
|
-
### 4.2 Generate Action Log Entry
|
|
295
|
-
|
|
296
|
-
Create `.workflow/.doc-index/action-logs/{task-id}.md`:
|
|
297
|
-
|
|
298
|
-
```markdown
|
|
299
|
-
---
|
|
300
|
-
id: task-{id}
|
|
301
|
-
type: feature|bugfix|refactor
|
|
302
|
-
status: completed
|
|
303
|
-
features: [feat-auth]
|
|
304
|
-
components: [tech-auth-service, tech-user-model]
|
|
305
|
-
commit: {hash}
|
|
306
|
-
timestamp: ISO8601
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
# Task: {summary}
|
|
310
|
-
|
|
311
|
-
## Changes
|
|
312
|
-
| File | Type | Component |
|
|
313
|
-
|------|------|-----------|
|
|
314
|
-
| src/services/auth.ts | modified | tech-auth-service |
|
|
315
|
-
|
|
316
|
-
## Impact
|
|
317
|
-
- Features affected: feat-auth
|
|
318
|
-
- Requirements addressed: REQ-001, REQ-002
|
|
319
|
-
|
|
320
|
-
## Staleness (if DeepWiki freshness enabled)
|
|
321
|
-
| Item | Type | Score | Status |
|
|
322
|
-
|------|------|-------|--------|
|
|
323
|
-
| {symbol/file/component} | {type} | {score} | {fresh/warning/stale} |
|
|
324
|
-
|
|
325
|
-
## Notes
|
|
326
|
-
{any user-provided notes}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
## Phase 5: Confirmation (unless -y)
|
|
330
|
-
|
|
331
|
-
Present update summary to user:
|
|
332
|
-
- Files updated in doc-index
|
|
333
|
-
- New documents created
|
|
334
|
-
- Status changes
|
|
335
|
-
- Ask for confirmation before writing
|
|
336
|
-
|
|
337
|
-
## Flags
|
|
338
|
-
|
|
339
|
-
| Flag | Effect |
|
|
340
|
-
|------|--------|
|
|
341
|
-
| `-y, --yes` | Auto-confirm all updates |
|
|
342
|
-
| `--dry-run` | Preview all changes without modifying any files |
|
|
343
|
-
| `--from-manifest <path>` | Use execution-manifest.json as data source (auto-set by ddd:execute) |
|
|
344
|
-
| `--task-id <id>` | Associate with specific task ID |
|
|
345
|
-
| `--commit <hash>` | Analyze specific commit |
|
|
346
|
-
|
|
347
|
-
## Integration Points
|
|
348
|
-
|
|
349
|
-
- **Input from**: `execution-manifest.json` (preferred, from ddd:execute) OR Git history (fallback), `doc-index.json`, `/ddd:plan` output
|
|
350
|
-
- **Delegates to**: `/ddd:doc-refresh` (Phase 4.1, selective document refresh)
|
|
351
|
-
- **Output to**: Updated `doc-index.json`, feature-maps/, tech-registry/, action-logs/
|
|
352
|
-
- **Triggers**: After completing any development task
|
|
353
|
-
- **Data source priority**: `--from-manifest` > `--commit` > `--task-id` > git diff HEAD~1
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: update
|
|
3
|
-
description: Incremental index update - detect code changes and trace impact to related features/requirements. Lightweight alternative to full sync.
|
|
4
|
-
argument-hint: "[-y|--yes] [--files <file1,file2,...>] [--staged] [--check-only]"
|
|
5
|
-
allowed-tools: TodoWrite(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*), mcp__ace-tool__search_context(*)
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Auto Mode
|
|
9
|
-
|
|
10
|
-
When `--yes` or `-y`: Auto-update index without confirmation prompts.
|
|
11
|
-
|
|
12
|
-
# DDD Update Command (/ddd:update)
|
|
13
|
-
|
|
14
|
-
## Purpose
|
|
15
|
-
|
|
16
|
-
Lightweight incremental update: given a set of changed files, trace their impact through the document index and update affected entries. Unlike `/ddd:sync` (full post-task sync), this command focuses on keeping the index fresh during development.
|
|
17
|
-
|
|
18
|
-
## When to Use: update vs sync
|
|
19
|
-
|
|
20
|
-
| Scenario | Use |
|
|
21
|
-
|----------|-----|
|
|
22
|
-
| Quick impact check during development | **ddd:update** |
|
|
23
|
-
| Preview what sync would change | **ddd:update --check-only** |
|
|
24
|
-
| Task completed, full reconciliation | ddd:sync |
|
|
25
|
-
| Register new components + update all docs | ddd:sync |
|
|
26
|
-
|
|
27
|
-
**Rule of thumb**: `update` = lightweight pulse (during work), `sync` = full checkpoint (after work).
|
|
28
|
-
|
|
29
|
-
## Use Cases
|
|
30
|
-
|
|
31
|
-
1. **During development**: Quick check which docs are affected by current changes
|
|
32
|
-
2. **Pre-commit check**: Ensure index is up-to-date before committing
|
|
33
|
-
3. **Periodic refresh**: Update stale code locations after refactoring
|
|
34
|
-
|
|
35
|
-
## Prerequisite
|
|
36
|
-
|
|
37
|
-
- `doc-index.json` must exist at `.workflow/.doc-index/doc-index.json`
|
|
38
|
-
|
|
39
|
-
## Phase 1: Identify Changed Files
|
|
40
|
-
|
|
41
|
-
### Source Priority
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
1. --files <list> → Explicit file list
|
|
45
|
-
2. --staged → git diff --cached --name-only
|
|
46
|
-
3. (default) → git diff --name-only (unstaged changes)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Output
|
|
50
|
-
|
|
51
|
-
List of changed file paths with change type (added/modified/deleted/renamed).
|
|
52
|
-
|
|
53
|
-
## Phase 2: Trace Impact
|
|
54
|
-
|
|
55
|
-
### 2.1 Forward Lookup (Code → Components → Features)
|
|
56
|
-
|
|
57
|
-
For each changed file:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
doc-index.json.technicalComponents[]
|
|
61
|
-
.codeLocations[].path MATCH changed_file
|
|
62
|
-
→ component_ids[]
|
|
63
|
-
|
|
64
|
-
doc-index.json.technicalComponents[component_ids]
|
|
65
|
-
.featureIds[]
|
|
66
|
-
→ feature_ids[]
|
|
67
|
-
|
|
68
|
-
doc-index.json.features[feature_ids]
|
|
69
|
-
.requirementIds[]
|
|
70
|
-
→ requirement_ids[]
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### 2.2 Orphan Detection
|
|
74
|
-
|
|
75
|
-
Files not matching any component → flag as:
|
|
76
|
-
- **Potential new component**: if in src/ directory
|
|
77
|
-
- **Ignorable**: if in test/, docs/, config/ directories
|
|
78
|
-
|
|
79
|
-
### 2.3 Impact Report
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
Impact Analysis for 3 changed files:
|
|
83
|
-
|
|
84
|
-
src/services/auth.ts (modified)
|
|
85
|
-
→ Component: tech-auth-service (AuthService)
|
|
86
|
-
→ Feature: feat-auth (User Authentication)
|
|
87
|
-
→ Requirements: REQ-001, REQ-002
|
|
88
|
-
|
|
89
|
-
src/middleware/rate-limit.ts (added)
|
|
90
|
-
→ No matching component (new file)
|
|
91
|
-
→ Suggested: Register as new component
|
|
92
|
-
|
|
93
|
-
src/utils/hash.ts (modified)
|
|
94
|
-
→ Component: tech-hash-util
|
|
95
|
-
→ Features: feat-auth, feat-password-reset
|
|
96
|
-
→ Requirements: REQ-001, REQ-005
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## Phase 3: Update Index (unless --check-only)
|
|
100
|
-
|
|
101
|
-
### 3.1 Update Code Locations
|
|
102
|
-
|
|
103
|
-
For matched components:
|
|
104
|
-
- If file was renamed → update `codeLocations[].path`
|
|
105
|
-
- If file was deleted → remove code location entry
|
|
106
|
-
- If symbols changed → update `symbols` list (requires AST or Gemini analysis)
|
|
107
|
-
|
|
108
|
-
### 3.2 Register New Components (interactive unless -y)
|
|
109
|
-
|
|
110
|
-
For orphan files in src/:
|
|
111
|
-
- Prompt user for component name and type
|
|
112
|
-
- Or auto-generate with `-y`: derive name from file path
|
|
113
|
-
- Create `technicalComponents[]` entry
|
|
114
|
-
- Ask which feature it belongs to (or auto-link by directory structure)
|
|
115
|
-
|
|
116
|
-
### 3.3 Update Timestamps
|
|
117
|
-
|
|
118
|
-
- Update `technicalComponents[].docPath` last_updated in corresponding .md
|
|
119
|
-
- Update `doc-index.json.last_updated`
|
|
120
|
-
|
|
121
|
-
## Phase 4: Refresh Documents (if updates were made)
|
|
122
|
-
|
|
123
|
-
### 4.1 Delegate to /ddd:doc-refresh
|
|
124
|
-
|
|
125
|
-
From Phase 2 impact tracing, collect affected component and feature IDs, then delegate:
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
Invoke /ddd:doc-refresh [-y] --minimal --components {affected_component_ids} --features {affected_feature_ids}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
The `--minimal` flag ensures only metadata/frontmatter is updated (code locations, timestamps), skipping full content regeneration. This keeps the update lightweight.
|
|
132
|
-
|
|
133
|
-
See `/ddd:doc-refresh` for full details.
|
|
134
|
-
|
|
135
|
-
### 4.2 Skip If --check-only
|
|
136
|
-
|
|
137
|
-
With `--check-only`, skip Phase 3 and Phase 4 entirely — only output the impact report.
|
|
138
|
-
|
|
139
|
-
## Flags
|
|
140
|
-
|
|
141
|
-
| Flag | Effect |
|
|
142
|
-
|------|--------|
|
|
143
|
-
| `-y, --yes` | Auto-confirm updates |
|
|
144
|
-
| `--files <list>` | Explicit comma-separated file list |
|
|
145
|
-
| `--staged` | Analyze staged (git cached) files |
|
|
146
|
-
| `--check-only` | Report impact without modifying index |
|
|
147
|
-
|
|
148
|
-
## Output
|
|
149
|
-
|
|
150
|
-
- **Console**: Impact report showing affected features/requirements
|
|
151
|
-
- **Updated**: `doc-index.json` (if not --check-only)
|
|
152
|
-
- **Updated**: Affected tech-registry/ and feature-maps/ docs
|
|
153
|
-
|
|
154
|
-
## Integration Points
|
|
155
|
-
|
|
156
|
-
- **Input from**: Git working tree, `doc-index.json`
|
|
157
|
-
- **Delegates to**: `/ddd:doc-refresh` (Phase 4.1, incremental document refresh with --minimal)
|
|
158
|
-
- **Output to**: Updated `doc-index.json`, impact report
|
|
159
|
-
- **Triggers**: During development, pre-commit, or periodic refresh
|
|
160
|
-
- **Can chain to**: `/ddd:sync` for full post-task synchronization
|