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,365 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: scan
|
|
3
|
-
description: Scan existing codebase to build document index without specs. Analyzes code structure, infers features, discovers components, and reverse-engineers project knowledge graph.
|
|
4
|
-
argument-hint: "[-y|--yes] [--from-scratch] [--scope <dir>] \"optional project description\""
|
|
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-confirm feature groupings, component naming, skip interactive review.
|
|
11
|
-
|
|
12
|
-
# DDD Scan Command (/ddd:scan)
|
|
13
|
-
|
|
14
|
-
## Purpose
|
|
15
|
-
|
|
16
|
-
For **existing projects without specifications**: analyze codebase to construct the document index by reverse-engineering project structure. This is the code-first entry point — no spec-generator required.
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
Codebase → Components → Features (inferred) → Requirements (inferred) → doc-index.json
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## When to Use
|
|
23
|
-
|
|
24
|
-
- Existing project, no spec-generator outputs
|
|
25
|
-
- Want to start using doc-driven workflow on a legacy codebase
|
|
26
|
-
- Quick project mapping for onboarding or audit
|
|
27
|
-
|
|
28
|
-
## Prerequisite
|
|
29
|
-
|
|
30
|
-
- A codebase must exist (src/, lib/, app/, or similar source directories)
|
|
31
|
-
- Git repository recommended (for action history seeding)
|
|
32
|
-
|
|
33
|
-
## Storage Location
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
.workflow/.doc-index/
|
|
37
|
-
├── doc-index.json ← Central index (primary output)
|
|
38
|
-
├── feature-maps/ ← Inferred feature documentation
|
|
39
|
-
│ ├── _index.md
|
|
40
|
-
│ └── {feature-slug}.md
|
|
41
|
-
├── tech-registry/ ← Discovered component documentation
|
|
42
|
-
│ ├── _index.md
|
|
43
|
-
│ └── {component-slug}.md
|
|
44
|
-
└── action-logs/ ← Git history seeds
|
|
45
|
-
├── _index.md
|
|
46
|
-
└── {act-hash}.md
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Phase 1: Project Structure Analysis
|
|
50
|
-
|
|
51
|
-
### 1.1 Framework & Stack Detection
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
ccw cli -p "PURPOSE: Analyze project structure, tech stack, and architecture for documentation indexing.
|
|
55
|
-
TASK:
|
|
56
|
-
• Detect language/framework from manifest files (package.json, go.mod, Cargo.toml, requirements.txt, etc.)
|
|
57
|
-
• Map directory structure: source dirs, test dirs, config dirs, entry points
|
|
58
|
-
• Identify architectural pattern: monolith, microservices, monorepo, library, CLI tool
|
|
59
|
-
• Detect key dependencies and their roles (ORM, HTTP framework, auth library, etc.)
|
|
60
|
-
• List all major source directories with brief purpose description
|
|
61
|
-
MODE: analysis
|
|
62
|
-
CONTEXT: @**/*
|
|
63
|
-
EXPECTED: JSON with: {
|
|
64
|
-
project_name, language, framework, architecture_pattern,
|
|
65
|
-
source_dirs: [{ path, purpose, file_count }],
|
|
66
|
-
dependencies: [{ name, role }],
|
|
67
|
-
entry_points: [{ path, description }]
|
|
68
|
-
}
|
|
69
|
-
CONSTRAINTS: Prioritize source directories | Ignore node_modules, dist, build, vendor" --tool gemini --mode analysis
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### 1.2 Merge with project-tech.json
|
|
73
|
-
|
|
74
|
-
If `.workflow/project-tech.json` exists, merge to reduce redundant analysis.
|
|
75
|
-
|
|
76
|
-
## Phase 2: Component Discovery
|
|
77
|
-
|
|
78
|
-
### 2.1 Deep Module Scan
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
ccw cli -p "PURPOSE: Discover all significant code components/modules for documentation indexing.
|
|
82
|
-
TASK:
|
|
83
|
-
• For each source directory, identify distinct modules/components
|
|
84
|
-
• For each component extract:
|
|
85
|
-
- Name (class name, module name, or logical group)
|
|
86
|
-
- Type: service | controller | model | util | hook | route | config | middleware | component
|
|
87
|
-
- File paths (primary file + related files)
|
|
88
|
-
- Exported symbols (public API: classes, functions, types, constants)
|
|
89
|
-
- Internal dependencies: what other modules it imports from within the project
|
|
90
|
-
- Responsibility: one-line description of what it does
|
|
91
|
-
• Group small utility files under parent module when they share domain
|
|
92
|
-
MODE: analysis
|
|
93
|
-
CONTEXT: @{source_dirs from Phase 1}
|
|
94
|
-
EXPECTED: JSON array: [{ name, type, files, symbols, depends_on, responsibility }]
|
|
95
|
-
CONSTRAINTS: Focus on business logic | Min threshold: components with 2+ exports or clear domain purpose | Group utilities under parent domain" --tool gemini --mode analysis
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### 2.2 Generate Component IDs
|
|
99
|
-
|
|
100
|
-
For each discovered component:
|
|
101
|
-
- ID: `tech-{kebab-case-name}` (e.g., `tech-auth-service`, `tech-user-model`)
|
|
102
|
-
- Validate uniqueness, append counter on collision
|
|
103
|
-
|
|
104
|
-
### 2.3 Build Dependency Graph
|
|
105
|
-
|
|
106
|
-
From `depends_on` fields, construct internal dependency edges:
|
|
107
|
-
```
|
|
108
|
-
tech-auth-service → tech-user-model
|
|
109
|
-
tech-auth-service → tech-jwt-util
|
|
110
|
-
tech-order-controller → tech-auth-service
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Phase 3: Feature Inference
|
|
114
|
-
|
|
115
|
-
**Key step: group components into logical features without formal specs.**
|
|
116
|
-
|
|
117
|
-
### 3.1 Inference Strategy (priority order)
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
Strategy 1 — Directory grouping:
|
|
121
|
-
src/auth/** → feat-auth
|
|
122
|
-
src/orders/** → feat-orders
|
|
123
|
-
src/payments/** → feat-payments
|
|
124
|
-
|
|
125
|
-
Strategy 2 — Route/endpoint grouping (web apps):
|
|
126
|
-
/api/users/* → feat-user-management
|
|
127
|
-
/api/orders/* → feat-order-management
|
|
128
|
-
|
|
129
|
-
Strategy 3 — Dependency clustering:
|
|
130
|
-
Components that heavily import each other → same feature
|
|
131
|
-
|
|
132
|
-
Strategy 4 — Domain keyword extraction:
|
|
133
|
-
Class names + file names → domain terms → feature names
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### 3.2 Gemini Feature Synthesis
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
ccw cli -p "PURPOSE: Infer high-level features from discovered code components. This project has no formal specification.
|
|
140
|
-
TASK:
|
|
141
|
-
Given these discovered components:
|
|
142
|
-
{component list from Phase 2: names, types, files, responsibilities, dependencies}
|
|
143
|
-
|
|
144
|
-
• Group them into logical features (3-10 features for a typical project)
|
|
145
|
-
• For each feature:
|
|
146
|
-
- name: human-readable (Chinese OK)
|
|
147
|
-
- component_ids: which components belong
|
|
148
|
-
- description: what the feature does (inferred from code)
|
|
149
|
-
- inferred_requirements: what this feature needs to accomplish (1-3 per feature)
|
|
150
|
-
- status: 'implemented' (code complete) or 'partial' (incomplete patterns)
|
|
151
|
-
- tags: search keywords
|
|
152
|
-
• Identify cross-cutting concerns (logging, auth middleware, error handling) as separate features
|
|
153
|
-
MODE: analysis
|
|
154
|
-
CONTEXT: {component list JSON}
|
|
155
|
-
EXPECTED: JSON: { features: [{ name, description, component_ids, inferred_requirements: [{ id, title }], status, tags }] }
|
|
156
|
-
CONSTRAINTS: Every component must belong to at least 1 feature | Prefer fewer broad features over many narrow ones" --tool gemini --mode analysis
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### 3.3 Interactive Feature Review (unless -y)
|
|
160
|
-
|
|
161
|
-
Present inferred features to user:
|
|
162
|
-
- Allow renaming, merging, splitting
|
|
163
|
-
- Allow reassigning components between features
|
|
164
|
-
- Confirm final feature list
|
|
165
|
-
|
|
166
|
-
## Phase 4: Implicit Requirement & Architecture Extraction
|
|
167
|
-
|
|
168
|
-
### 4.1 Inferred Requirements
|
|
169
|
-
|
|
170
|
-
For each feature, generate lightweight requirement entries from its components:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Feature: feat-auth (User Authentication)
|
|
174
|
-
→ IREQ-001: "Users can log in with email and password" (from LoginController)
|
|
175
|
-
→ IREQ-002: "JWT tokens for session management" (from AuthMiddleware + jwt dep)
|
|
176
|
-
→ IREQ-003: "Password reset via email" (from PasswordResetService)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
**ID Convention**: `IREQ-NNN` — distinguishes inferred from formal `REQ-NNN`.
|
|
180
|
-
|
|
181
|
-
### 4.2 Inferred Architecture Decisions
|
|
182
|
-
|
|
183
|
-
Detect patterns from code + dependencies:
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
Express.js + JWT middleware → IADR-001: "REST API with JWT authentication"
|
|
187
|
-
Prisma ORM + PostgreSQL → IADR-002: "PostgreSQL via Prisma ORM"
|
|
188
|
-
React + Redux → IADR-003: "React frontend with Redux state"
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**ID Convention**: `IADR-NNN` — distinguishes inferred from formal `ADR-NNN`.
|
|
192
|
-
|
|
193
|
-
### 4.3 Glossary Generation
|
|
194
|
-
|
|
195
|
-
Extract domain terms from:
|
|
196
|
-
- Class/function names (CamelCase → terms)
|
|
197
|
-
- Key business terms in comments and strings
|
|
198
|
-
- Framework-specific terminology
|
|
199
|
-
|
|
200
|
-
Write to `.workflow/.doc-index/glossary.json`.
|
|
201
|
-
|
|
202
|
-
## Phase 5: Git History Seeds
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
git log --oneline --since="3 months ago" --no-merges --format="%H|%s|%ai" | head -30
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
For each significant commit:
|
|
209
|
-
- Match changed files to discovered components
|
|
210
|
-
- Create action entry with `type: "historical"`
|
|
211
|
-
|
|
212
|
-
## Phase 6: Assemble doc-index.json
|
|
213
|
-
|
|
214
|
-
Write the index with code-first markers:
|
|
215
|
-
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"version": "1.0",
|
|
219
|
-
"project": "{project-name}",
|
|
220
|
-
"build_path": "code-first",
|
|
221
|
-
"spec_session": null,
|
|
222
|
-
"last_updated": "ISO8601",
|
|
223
|
-
"glossary": [...],
|
|
224
|
-
"features": [{
|
|
225
|
-
"id": "feat-{slug}",
|
|
226
|
-
"name": "Feature Name",
|
|
227
|
-
"epicId": null,
|
|
228
|
-
"status": "implemented|partial",
|
|
229
|
-
"docPath": "feature-maps/{slug}.md",
|
|
230
|
-
"requirementIds": ["IREQ-NNN"],
|
|
231
|
-
"tags": ["tag"]
|
|
232
|
-
}],
|
|
233
|
-
"requirements": [{
|
|
234
|
-
"id": "IREQ-NNN",
|
|
235
|
-
"title": "Inferred requirement",
|
|
236
|
-
"source": "inferred",
|
|
237
|
-
"priority": "inferred",
|
|
238
|
-
"sourcePath": null,
|
|
239
|
-
"techComponentIds": ["tech-{slug}"],
|
|
240
|
-
"featureId": "feat-{slug}"
|
|
241
|
-
}],
|
|
242
|
-
"technicalComponents": [{
|
|
243
|
-
"id": "tech-{slug}",
|
|
244
|
-
"name": "ComponentName",
|
|
245
|
-
"type": "service|controller|model|...",
|
|
246
|
-
"responsibility": "One-line description",
|
|
247
|
-
"adrId": "IADR-NNN|null",
|
|
248
|
-
"docPath": "tech-registry/{slug}.md",
|
|
249
|
-
"codeLocations": [{ "path": "src/...", "symbols": [...] }],
|
|
250
|
-
"dependsOn": ["tech-{other}"],
|
|
251
|
-
"featureIds": ["feat-{slug}"],
|
|
252
|
-
"actionIds": []
|
|
253
|
-
}],
|
|
254
|
-
"architectureDecisions": [{
|
|
255
|
-
"id": "IADR-NNN",
|
|
256
|
-
"title": "Inferred decision",
|
|
257
|
-
"source": "inferred",
|
|
258
|
-
"sourcePath": null,
|
|
259
|
-
"componentIds": ["tech-{slug}"]
|
|
260
|
-
}],
|
|
261
|
-
"actions": [{
|
|
262
|
-
"id": "act-{short-hash}",
|
|
263
|
-
"description": "Commit message",
|
|
264
|
-
"type": "historical",
|
|
265
|
-
"status": "historical",
|
|
266
|
-
"affectedComponents": ["tech-{slug}"],
|
|
267
|
-
"relatedCommit": "full-hash",
|
|
268
|
-
"timestamp": "ISO8601"
|
|
269
|
-
}],
|
|
270
|
-
"freshness": {
|
|
271
|
-
"thresholds": { "warning": 0.3, "stale": 0.7 },
|
|
272
|
-
"weights": { "time": 0.1, "churn": 0.4, "symbol": 0.5 },
|
|
273
|
-
"time_decay_k": 0.05,
|
|
274
|
-
"auto_regenerate": false
|
|
275
|
-
},
|
|
276
|
-
"deepwiki_feature_to_symbol_index": {}
|
|
277
|
-
}
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
## Phase 7: Build DeepWiki Feature-to-Symbol Index
|
|
282
|
-
|
|
283
|
-
If DeepWiki is available (`.codexlens/deepwiki_index.db` exists):
|
|
284
|
-
|
|
285
|
-
1. Collect all `codeLocations[].path` from `technicalComponents[]`
|
|
286
|
-
2. Query DeepWiki: `POST /api/deepwiki/symbols-for-paths { paths: [...] }`
|
|
287
|
-
3. Build `deepwiki_feature_to_symbol_index` by traversing:
|
|
288
|
-
`feature → requirementIds → techComponentIds → codeLocations → symbols`
|
|
289
|
-
|
|
290
|
-
```json
|
|
291
|
-
"deepwiki_feature_to_symbol_index": {
|
|
292
|
-
"feat-auth": [
|
|
293
|
-
"deepwiki:symbol:src/auth/jwt.ts#L30-L55",
|
|
294
|
-
"deepwiki:symbol:src/models/user.ts#L12-L40"
|
|
295
|
-
]
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
**Symbol URN format**: `deepwiki:symbol:<file_path>#L<start>-L<end>`
|
|
300
|
-
|
|
301
|
-
**Graceful degradation**: If DeepWiki is unavailable, set `deepwiki_feature_to_symbol_index: {}` and log warning.
|
|
302
|
-
|
|
303
|
-
## Phase 8: Generate Documents
|
|
304
|
-
|
|
305
|
-
Delegate all document generation to `/ddd:doc-generate`:
|
|
306
|
-
|
|
307
|
-
```
|
|
308
|
-
Invoke /ddd:doc-generate [-y]
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
This generates the complete document tree (Layer 3 → 2 → 1):
|
|
312
|
-
- `tech-registry/{slug}.md` — component docs (Layer 3)
|
|
313
|
-
- `feature-maps/{slug}.md` — feature docs (Layer 2)
|
|
314
|
-
- `_index.md`, `README.md`, `ARCHITECTURE.md`, `SCHEMA.md` — index/overview docs (Layer 1)
|
|
315
|
-
|
|
316
|
-
See `/ddd:doc-generate` for full details on generation strategy and flags.
|
|
317
|
-
|
|
318
|
-
## Phase 9: Validation & Report
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
Scan Report
|
|
322
|
-
|
|
323
|
-
Project: {name} ({language}/{framework})
|
|
324
|
-
Architecture: {pattern}
|
|
325
|
-
Source dirs: {N}
|
|
326
|
-
|
|
327
|
-
Discovered:
|
|
328
|
-
Components: {N} ({by type breakdown})
|
|
329
|
-
Features: {N} (inferred)
|
|
330
|
-
Requirements: {N} (IREQ, inferred)
|
|
331
|
-
Architecture Decisions: {N} (IADR, inferred)
|
|
332
|
-
Historical Actions: {N} (from git)
|
|
333
|
-
|
|
334
|
-
Coverage:
|
|
335
|
-
Components → Features: {%}
|
|
336
|
-
Dependencies mapped: {%}
|
|
337
|
-
|
|
338
|
-
Recommendations:
|
|
339
|
-
- Run /spec-generator to formalize {N} inferred requirements
|
|
340
|
-
- {N} components have unclear responsibility — review tech-registry docs
|
|
341
|
-
- Use /ddd:plan to start planning tasks with this index
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
## Flags
|
|
345
|
-
|
|
346
|
-
| Flag | Effect |
|
|
347
|
-
|------|--------|
|
|
348
|
-
| `-y, --yes` | Auto-confirm all decisions |
|
|
349
|
-
| `--from-scratch` | Delete existing index and rebuild |
|
|
350
|
-
| `--scope <dir>` | Limit scan to specific directory (e.g., `--scope src/auth`) |
|
|
351
|
-
|
|
352
|
-
## Upgrade Path: scan → spec
|
|
353
|
-
|
|
354
|
-
When a scanned project later runs `spec-generator` + `/ddd:index-build`:
|
|
355
|
-
- `/ddd:index-build` detects existing code-first index
|
|
356
|
-
- Merges: `IREQ-NNN` → `REQ-NNN`, `IADR-NNN` → `ADR-NNN` where content overlaps
|
|
357
|
-
- Updates `build_path` to `"spec-first"`
|
|
358
|
-
- Preserves all `tech-*` and `feat-*` entries (updates links only)
|
|
359
|
-
|
|
360
|
-
## Integration Points
|
|
361
|
-
|
|
362
|
-
- **Input from**: Codebase, git history, `project-tech.json`
|
|
363
|
-
- **Delegates to**: `/ddd:doc-generate` (Phase 8, full document generation)
|
|
364
|
-
- **Output to**: `ddd:plan`, `ddd:sync`, `ddd:update`, `ddd:index-build` (upgrade)
|
|
365
|
-
- **Standalone**: Can be used independently on any project
|