claude-code-workflow 6.3.9 → 6.3.11
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/CLAUDE.md +1 -1
- package/.claude/agents/issue-plan-agent.md +21 -15
- package/.claude/agents/issue-queue-agent.md +114 -87
- package/.claude/commands/issue/discover.md +427 -0
- package/.claude/commands/issue/execute.md +195 -363
- package/.claude/commands/issue/new.md +13 -1
- package/.claude/commands/issue/plan.md +55 -32
- package/.claude/commands/issue/queue.md +145 -71
- package/.claude/commands/workflow/init.md +75 -29
- package/.claude/commands/workflow/lite-fix.md +8 -0
- package/.claude/commands/workflow/lite-plan.md +8 -0
- package/.claude/commands/workflow/review-module-cycle.md +4 -0
- package/.claude/commands/workflow/review-session-cycle.md +4 -0
- package/.claude/commands/workflow/review.md +4 -4
- package/.claude/commands/workflow/session/solidify.md +299 -0
- package/.claude/commands/workflow/session/start.md +10 -7
- package/.claude/commands/workflow/tools/context-gather.md +17 -10
- package/.claude/skills/software-manual/SKILL.md +184 -0
- package/.claude/skills/software-manual/phases/01-requirements-discovery.md +162 -0
- package/.claude/skills/software-manual/phases/02-project-exploration.md +101 -0
- package/.claude/skills/software-manual/phases/02.5-api-extraction.md +161 -0
- package/.claude/skills/software-manual/phases/03-parallel-analysis.md +183 -0
- package/.claude/skills/software-manual/phases/03.5-consolidation.md +82 -0
- package/.claude/skills/software-manual/phases/04-screenshot-capture.md +89 -0
- package/.claude/skills/software-manual/phases/05-html-assembly.md +132 -0
- package/.claude/skills/software-manual/phases/06-iterative-refinement.md +259 -0
- package/.claude/skills/software-manual/scripts/api-extractor.md +245 -0
- package/.claude/skills/software-manual/scripts/bundle-libraries.md +85 -0
- package/.claude/skills/software-manual/scripts/extract_apis.py +270 -0
- package/.claude/skills/software-manual/scripts/screenshot-helper.md +447 -0
- package/.claude/skills/software-manual/scripts/swagger-runner.md +419 -0
- package/.claude/skills/software-manual/scripts/typedoc-runner.md +357 -0
- package/.claude/skills/software-manual/specs/html-template.md +325 -0
- package/.claude/skills/software-manual/specs/quality-standards.md +253 -0
- package/.claude/skills/software-manual/specs/writing-style.md +298 -0
- package/.claude/skills/software-manual/templates/css/wiki-base.css +788 -0
- package/.claude/skills/software-manual/templates/css/wiki-dark.css +278 -0
- package/.claude/skills/software-manual/templates/tiddlywiki-shell.html +327 -0
- package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +219 -0
- package/.claude/workflows/cli-templates/schemas/discovery-state-schema.json +125 -0
- package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +168 -74
- package/.claude/workflows/cli-templates/schemas/queue-schema.json +225 -108
- package/.claude/workflows/cli-templates/schemas/solution-schema.json +6 -28
- package/.claude/workflows/context-tools.md +17 -25
- package/.codex/AGENTS.md +10 -5
- package/.codex/prompts/issue-execute.md +174 -84
- package/.codex/prompts/issue-plan.md +106 -0
- package/.codex/prompts/issue-queue.md +225 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +1 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +443 -123
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
- package/ccw/dist/core/dashboard-generator.js +4 -1
- package/ccw/dist/core/dashboard-generator.js.map +1 -1
- package/ccw/dist/core/data-aggregator.d.ts +32 -0
- package/ccw/dist/core/data-aggregator.d.ts.map +1 -1
- package/ccw/dist/core/data-aggregator.js +55 -11
- package/ccw/dist/core/data-aggregator.js.map +1 -1
- package/ccw/dist/core/routes/discovery-routes.d.ts +37 -0
- package/ccw/dist/core/routes/discovery-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/discovery-routes.js +514 -0
- package/ccw/dist/core/routes/discovery-routes.js.map +1 -0
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +9 -1
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts +12 -1
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +56 -7
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/src/cli.ts +1 -0
- package/ccw/src/commands/issue.ts +498 -158
- package/ccw/src/core/dashboard-generator.ts +4 -1
- package/ccw/src/core/data-aggregator.ts +94 -11
- package/ccw/src/core/routes/discovery-routes.ts +607 -0
- package/ccw/src/core/server.ts +9 -1
- package/ccw/src/templates/dashboard-css/34-discovery.css +783 -0
- package/ccw/src/templates/dashboard-js/components/cli-status.js +1 -78
- package/ccw/src/templates/dashboard-js/components/navigation.js +8 -0
- package/ccw/src/templates/dashboard-js/i18n.js +140 -4
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +0 -18
- package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +13 -3
- package/ccw/src/templates/dashboard-js/views/issue-discovery.js +730 -0
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +57 -26
- package/ccw/src/templates/dashboard-js/views/project-overview.js +153 -0
- package/ccw/src/templates/dashboard.html +5 -0
- package/ccw/src/tools/codex-lens.ts +75 -9
- package/package.json +1 -1
- package/.claude/workflows/context-tools-ace.md +0 -105
|
@@ -10,7 +10,11 @@ examples:
|
|
|
10
10
|
# Workflow Init Command (/workflow:init)
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
|
-
Initialize `.workflow/project.json` with comprehensive project understanding by delegating analysis to **cli-explore-agent**.
|
|
13
|
+
Initialize `.workflow/project-tech.json` and `.workflow/project-guidelines.json` with comprehensive project understanding by delegating analysis to **cli-explore-agent**.
|
|
14
|
+
|
|
15
|
+
**Dual File System**:
|
|
16
|
+
- `project-tech.json`: Auto-generated technical analysis (stack, architecture, components)
|
|
17
|
+
- `project-guidelines.json`: User-maintained rules and constraints (created as scaffold)
|
|
14
18
|
|
|
15
19
|
**Note**: This command may be called by other workflow commands. Upon completion, return immediately to continue the calling workflow without interrupting the task flow.
|
|
16
20
|
|
|
@@ -27,7 +31,7 @@ Input Parsing:
|
|
|
27
31
|
└─ Parse --regenerate flag → regenerate = true | false
|
|
28
32
|
|
|
29
33
|
Decision:
|
|
30
|
-
├─
|
|
34
|
+
├─ BOTH_EXIST + no --regenerate → Exit: "Already initialized"
|
|
31
35
|
├─ EXISTS + --regenerate → Backup existing → Continue analysis
|
|
32
36
|
└─ NOT_FOUND → Continue analysis
|
|
33
37
|
|
|
@@ -37,11 +41,14 @@ Analysis Flow:
|
|
|
37
41
|
│ ├─ Structural scan (get_modules_by_depth.sh, find, wc)
|
|
38
42
|
│ ├─ Semantic analysis (Gemini CLI)
|
|
39
43
|
│ ├─ Synthesis and merge
|
|
40
|
-
│ └─ Write .workflow/project.json
|
|
44
|
+
│ └─ Write .workflow/project-tech.json
|
|
45
|
+
├─ Create guidelines scaffold (if not exists)
|
|
46
|
+
│ └─ Write .workflow/project-guidelines.json (empty structure)
|
|
41
47
|
└─ Display summary
|
|
42
48
|
|
|
43
49
|
Output:
|
|
44
|
-
|
|
50
|
+
├─ .workflow/project-tech.json (+ .backup if regenerate)
|
|
51
|
+
└─ .workflow/project-guidelines.json (scaffold if new)
|
|
45
52
|
```
|
|
46
53
|
|
|
47
54
|
## Implementation
|
|
@@ -56,13 +63,18 @@ const regenerate = $ARGUMENTS.includes('--regenerate')
|
|
|
56
63
|
**Check existing state**:
|
|
57
64
|
|
|
58
65
|
```bash
|
|
59
|
-
bash(test -f .workflow/project.json && echo "
|
|
66
|
+
bash(test -f .workflow/project-tech.json && echo "TECH_EXISTS" || echo "TECH_NOT_FOUND")
|
|
67
|
+
bash(test -f .workflow/project-guidelines.json && echo "GUIDELINES_EXISTS" || echo "GUIDELINES_NOT_FOUND")
|
|
60
68
|
```
|
|
61
69
|
|
|
62
|
-
**If
|
|
70
|
+
**If BOTH_EXIST and no --regenerate**: Exit early
|
|
63
71
|
```
|
|
64
|
-
Project already initialized
|
|
65
|
-
|
|
72
|
+
Project already initialized:
|
|
73
|
+
- Tech analysis: .workflow/project-tech.json
|
|
74
|
+
- Guidelines: .workflow/project-guidelines.json
|
|
75
|
+
|
|
76
|
+
Use /workflow:init --regenerate to rebuild tech analysis
|
|
77
|
+
Use /workflow:session:solidify to add guidelines
|
|
66
78
|
Use /workflow:status --project to view state
|
|
67
79
|
```
|
|
68
80
|
|
|
@@ -78,7 +90,7 @@ bash(mkdir -p .workflow)
|
|
|
78
90
|
|
|
79
91
|
**For --regenerate**: Backup and preserve existing data
|
|
80
92
|
```bash
|
|
81
|
-
bash(cp .workflow/project.json .workflow/project.json.backup)
|
|
93
|
+
bash(cp .workflow/project-tech.json .workflow/project-tech.json.backup)
|
|
82
94
|
```
|
|
83
95
|
|
|
84
96
|
**Delegate analysis to agent**:
|
|
@@ -89,20 +101,17 @@ Task(
|
|
|
89
101
|
run_in_background=false,
|
|
90
102
|
description="Deep project analysis",
|
|
91
103
|
prompt=`
|
|
92
|
-
Analyze project for workflow initialization and generate .workflow/project.json.
|
|
104
|
+
Analyze project for workflow initialization and generate .workflow/project-tech.json.
|
|
93
105
|
|
|
94
106
|
## MANDATORY FIRST STEPS
|
|
95
|
-
1. Execute: cat ~/.claude/workflows/cli-templates/schemas/project-
|
|
107
|
+
1. Execute: cat ~/.claude/workflows/cli-templates/schemas/project-tech-schema.json (get schema reference)
|
|
96
108
|
2. Execute: ccw tool exec get_modules_by_depth '{}' (get project structure)
|
|
97
109
|
|
|
98
110
|
## Task
|
|
99
|
-
Generate complete project.json with:
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
- features: ${regenerate ? 'preserve from backup' : '[] (empty)'}
|
|
104
|
-
- development_index: ${regenerate ? 'preserve from backup' : '{feature: [], enhancement: [], bugfix: [], refactor: [], docs: []}'}
|
|
105
|
-
- statistics: ${regenerate ? 'preserve from backup' : '{total_features: 0, total_sessions: 0, last_updated}'}
|
|
111
|
+
Generate complete project-tech.json with:
|
|
112
|
+
- project_metadata: {name: ${projectName}, root_path: ${projectRoot}, initialized_at, updated_at}
|
|
113
|
+
- technology_analysis: {description, languages, frameworks, build_tools, test_frameworks, architecture, key_components, dependencies}
|
|
114
|
+
- development_status: ${regenerate ? 'preserve from backup' : '{completed_features: [], development_index: {feature: [], enhancement: [], bugfix: [], refactor: [], docs: []}, statistics: {total_features: 0, total_sessions: 0, last_updated}}'}
|
|
106
115
|
- _metadata: {initialized_by: "cli-explore-agent", analysis_timestamp, analysis_mode}
|
|
107
116
|
|
|
108
117
|
## Analysis Requirements
|
|
@@ -123,8 +132,8 @@ Generate complete project.json with:
|
|
|
123
132
|
1. Structural scan: get_modules_by_depth.sh, find, wc -l
|
|
124
133
|
2. Semantic analysis: Gemini for patterns/architecture
|
|
125
134
|
3. Synthesis: Merge findings
|
|
126
|
-
4. ${regenerate ? 'Merge with preserved
|
|
127
|
-
5. Write JSON: Write('.workflow/project.json', jsonContent)
|
|
135
|
+
4. ${regenerate ? 'Merge with preserved development_status from .workflow/project-tech.json.backup' : ''}
|
|
136
|
+
5. Write JSON: Write('.workflow/project-tech.json', jsonContent)
|
|
128
137
|
6. Report: Return brief completion summary
|
|
129
138
|
|
|
130
139
|
Project root: ${projectRoot}
|
|
@@ -132,29 +141,66 @@ Project root: ${projectRoot}
|
|
|
132
141
|
)
|
|
133
142
|
```
|
|
134
143
|
|
|
144
|
+
### Step 3.5: Create Guidelines Scaffold (if not exists)
|
|
145
|
+
|
|
146
|
+
```javascript
|
|
147
|
+
// Only create if not exists (never overwrite user guidelines)
|
|
148
|
+
if (!file_exists('.workflow/project-guidelines.json')) {
|
|
149
|
+
const guidelinesScaffold = {
|
|
150
|
+
conventions: {
|
|
151
|
+
coding_style: [],
|
|
152
|
+
naming_patterns: [],
|
|
153
|
+
file_structure: [],
|
|
154
|
+
documentation: []
|
|
155
|
+
},
|
|
156
|
+
constraints: {
|
|
157
|
+
architecture: [],
|
|
158
|
+
tech_stack: [],
|
|
159
|
+
performance: [],
|
|
160
|
+
security: []
|
|
161
|
+
},
|
|
162
|
+
quality_rules: [],
|
|
163
|
+
learnings: [],
|
|
164
|
+
_metadata: {
|
|
165
|
+
created_at: new Date().toISOString(),
|
|
166
|
+
version: "1.0.0"
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
Write('.workflow/project-guidelines.json', JSON.stringify(guidelinesScaffold, null, 2));
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
135
174
|
### Step 4: Display Summary
|
|
136
175
|
|
|
137
176
|
```javascript
|
|
138
|
-
const
|
|
177
|
+
const projectTech = JSON.parse(Read('.workflow/project-tech.json'));
|
|
178
|
+
const guidelinesExists = file_exists('.workflow/project-guidelines.json');
|
|
139
179
|
|
|
140
180
|
console.log(`
|
|
141
181
|
✓ Project initialized successfully
|
|
142
182
|
|
|
143
183
|
## Project Overview
|
|
144
|
-
Name: ${
|
|
145
|
-
Description: ${
|
|
184
|
+
Name: ${projectTech.project_metadata.name}
|
|
185
|
+
Description: ${projectTech.technology_analysis.description}
|
|
146
186
|
|
|
147
187
|
### Technology Stack
|
|
148
|
-
Languages: ${
|
|
149
|
-
Frameworks: ${
|
|
188
|
+
Languages: ${projectTech.technology_analysis.languages.map(l => l.name).join(', ')}
|
|
189
|
+
Frameworks: ${projectTech.technology_analysis.frameworks.join(', ')}
|
|
150
190
|
|
|
151
191
|
### Architecture
|
|
152
|
-
Style: ${
|
|
153
|
-
Components: ${
|
|
192
|
+
Style: ${projectTech.technology_analysis.architecture.style}
|
|
193
|
+
Components: ${projectTech.technology_analysis.key_components.length} core modules
|
|
154
194
|
|
|
155
195
|
---
|
|
156
|
-
|
|
157
|
-
|
|
196
|
+
Files created:
|
|
197
|
+
- Tech analysis: .workflow/project-tech.json
|
|
198
|
+
- Guidelines: .workflow/project-guidelines.json ${guidelinesExists ? '(scaffold)' : ''}
|
|
199
|
+
${regenerate ? '- Backup: .workflow/project-tech.json.backup' : ''}
|
|
200
|
+
|
|
201
|
+
Next steps:
|
|
202
|
+
- Use /workflow:session:solidify to add project guidelines
|
|
203
|
+
- Use /workflow:plan to start planning
|
|
158
204
|
`);
|
|
159
205
|
```
|
|
160
206
|
|
|
@@ -181,6 +181,8 @@ Execute **${angle}** diagnosis for bug root cause analysis. Analyze codebase fro
|
|
|
181
181
|
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
|
|
182
182
|
2. Run: rg -l "{error_keyword_from_bug}" --type ts (locate relevant files)
|
|
183
183
|
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/diagnosis-json-schema.json (get output schema reference)
|
|
184
|
+
4. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
185
|
+
5. Read: .workflow/project-guidelines.json (user-defined constraints and conventions)
|
|
184
186
|
|
|
185
187
|
## Diagnosis Strategy (${angle} focus)
|
|
186
188
|
|
|
@@ -409,6 +411,12 @@ Generate fix plan and write fix-plan.json.
|
|
|
409
411
|
## Output Schema Reference
|
|
410
412
|
Execute: cat ~/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json (get schema reference before generating plan)
|
|
411
413
|
|
|
414
|
+
## Project Context (MANDATORY - Read Both Files)
|
|
415
|
+
1. Read: .workflow/project-tech.json (technology stack, architecture, key components)
|
|
416
|
+
2. Read: .workflow/project-guidelines.json (user-defined constraints and conventions)
|
|
417
|
+
|
|
418
|
+
**CRITICAL**: All fix tasks MUST comply with constraints in project-guidelines.json
|
|
419
|
+
|
|
412
420
|
## Bug Description
|
|
413
421
|
${bug_description}
|
|
414
422
|
|
|
@@ -184,6 +184,8 @@ Execute **${angle}** exploration for task planning context. Analyze codebase fro
|
|
|
184
184
|
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
|
|
185
185
|
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
|
|
186
186
|
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)
|
|
187
|
+
4. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
188
|
+
5. Read: .workflow/project-guidelines.json (user-defined constraints and conventions)
|
|
187
189
|
|
|
188
190
|
## Exploration Strategy (${angle} focus)
|
|
189
191
|
|
|
@@ -416,6 +418,12 @@ Generate implementation plan and write plan.json.
|
|
|
416
418
|
## Output Schema Reference
|
|
417
419
|
Execute: cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json (get schema reference before generating plan)
|
|
418
420
|
|
|
421
|
+
## Project Context (MANDATORY - Read Both Files)
|
|
422
|
+
1. Read: .workflow/project-tech.json (technology stack, architecture, key components)
|
|
423
|
+
2. Read: .workflow/project-guidelines.json (user-defined constraints and conventions)
|
|
424
|
+
|
|
425
|
+
**CRITICAL**: All generated tasks MUST comply with constraints in project-guidelines.json
|
|
426
|
+
|
|
419
427
|
## Task Description
|
|
420
428
|
${task_description}
|
|
421
429
|
|
|
@@ -409,6 +409,8 @@ Task(
|
|
|
409
409
|
2. Get target files: Read resolved_files from review-state.json
|
|
410
410
|
3. Validate file access: bash(ls -la ${targetFiles.join(' ')})
|
|
411
411
|
4. Execute: cat ~/.claude/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
|
|
412
|
+
5. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
413
|
+
6. Read: .workflow/project-guidelines.json (user-defined constraints and conventions to validate against)
|
|
412
414
|
|
|
413
415
|
## Review Context
|
|
414
416
|
- Review Type: module (independent)
|
|
@@ -511,6 +513,8 @@ Task(
|
|
|
511
513
|
3. Identify related code: bash(grep -r "import.*${basename(file)}" ${projectDir}/src --include="*.ts")
|
|
512
514
|
4. Read test files: bash(find ${projectDir}/tests -name "*${basename(file, '.ts')}*" -type f)
|
|
513
515
|
5. Execute: cat ~/.claude/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
|
|
516
|
+
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
517
|
+
7. Read: .workflow/project-guidelines.json (user-defined constraints for remediation compliance)
|
|
514
518
|
|
|
515
519
|
## CLI Configuration
|
|
516
520
|
- Tool Priority: gemini → qwen → codex
|
|
@@ -420,6 +420,8 @@ Task(
|
|
|
420
420
|
3. Get changed files: bash(cd ${workflowDir} && git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u)
|
|
421
421
|
4. Read review state: ${reviewStateJsonPath}
|
|
422
422
|
5. Execute: cat ~/.claude/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference)
|
|
423
|
+
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
424
|
+
7. Read: .workflow/project-guidelines.json (user-defined constraints and conventions to validate against)
|
|
423
425
|
|
|
424
426
|
## Session Context
|
|
425
427
|
- Session ID: ${sessionId}
|
|
@@ -522,6 +524,8 @@ Task(
|
|
|
522
524
|
3. Identify related code: bash(grep -r "import.*${basename(file)}" ${workflowDir}/src --include="*.ts")
|
|
523
525
|
4. Read test files: bash(find ${workflowDir}/tests -name "*${basename(file, '.ts')}*" -type f)
|
|
524
526
|
5. Execute: cat ~/.claude/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference)
|
|
527
|
+
6. Read: .workflow/project-tech.json (technology stack and architecture context)
|
|
528
|
+
7. Read: .workflow/project-guidelines.json (user-defined constraints for remediation compliance)
|
|
525
529
|
|
|
526
530
|
## CLI Configuration
|
|
527
531
|
- Tool Priority: gemini → qwen → codex
|
|
@@ -139,7 +139,7 @@ After bash validation, the model takes control to:
|
|
|
139
139
|
ccw cli -p "
|
|
140
140
|
PURPOSE: Security audit of completed implementation
|
|
141
141
|
TASK: Review code for security vulnerabilities, insecure patterns, auth/authz issues
|
|
142
|
-
CONTEXT: @.summaries/IMPL-*.md,../.. @../../
|
|
142
|
+
CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../project-guidelines.json
|
|
143
143
|
EXPECTED: Security findings report with severity levels
|
|
144
144
|
RULES: Focus on OWASP Top 10, authentication, authorization, data validation, injection risks
|
|
145
145
|
" --tool gemini --mode write --cd .workflow/active/${sessionId}
|
|
@@ -151,7 +151,7 @@ After bash validation, the model takes control to:
|
|
|
151
151
|
ccw cli -p "
|
|
152
152
|
PURPOSE: Architecture compliance review
|
|
153
153
|
TASK: Evaluate adherence to architectural patterns, identify technical debt, review design decisions
|
|
154
|
-
CONTEXT: @.summaries/IMPL-*.md,../.. @../../
|
|
154
|
+
CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../project-guidelines.json
|
|
155
155
|
EXPECTED: Architecture assessment with recommendations
|
|
156
156
|
RULES: Check for patterns, separation of concerns, modularity, scalability
|
|
157
157
|
" --tool qwen --mode write --cd .workflow/active/${sessionId}
|
|
@@ -163,7 +163,7 @@ After bash validation, the model takes control to:
|
|
|
163
163
|
ccw cli -p "
|
|
164
164
|
PURPOSE: Code quality and best practices review
|
|
165
165
|
TASK: Assess code readability, maintainability, adherence to best practices
|
|
166
|
-
CONTEXT: @.summaries/IMPL-*.md,../.. @../../
|
|
166
|
+
CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../project-guidelines.json
|
|
167
167
|
EXPECTED: Quality assessment with improvement suggestions
|
|
168
168
|
RULES: Check for code smells, duplication, complexity, naming conventions
|
|
169
169
|
" --tool gemini --mode write --cd .workflow/active/${sessionId}
|
|
@@ -185,7 +185,7 @@ After bash validation, the model takes control to:
|
|
|
185
185
|
ccw cli -p "
|
|
186
186
|
PURPOSE: Verify all requirements and acceptance criteria are met
|
|
187
187
|
TASK: Cross-check implementation summaries against original requirements
|
|
188
|
-
CONTEXT: @.task/IMPL-*.json,.summaries/IMPL-*.md,../.. @../../
|
|
188
|
+
CONTEXT: @.task/IMPL-*.json,.summaries/IMPL-*.md,../.. @../../project-tech.json @../../project-guidelines.json
|
|
189
189
|
EXPECTED:
|
|
190
190
|
- Requirements coverage matrix
|
|
191
191
|
- Acceptance criteria verification
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solidify
|
|
3
|
+
description: Crystallize session learnings and user-defined constraints into permanent project guidelines
|
|
4
|
+
argument-hint: "[--type <convention|constraint|learning>] [--category <category>] \"rule or insight\""
|
|
5
|
+
examples:
|
|
6
|
+
- /workflow:session:solidify "Use functional components for all React code" --type convention
|
|
7
|
+
- /workflow:session:solidify "No direct DB access from controllers" --type constraint --category architecture
|
|
8
|
+
- /workflow:session:solidify "Cache invalidation requires event sourcing" --type learning --category architecture
|
|
9
|
+
- /workflow:session:solidify --interactive
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Session Solidify Command (/workflow:session:solidify)
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Crystallizes ephemeral session context (insights, decisions, constraints) into permanent project guidelines stored in `.workflow/project-guidelines.json`. This ensures valuable learnings persist across sessions and inform future planning.
|
|
17
|
+
|
|
18
|
+
## Use Cases
|
|
19
|
+
|
|
20
|
+
1. **During Session**: Capture important decisions as they're made
|
|
21
|
+
2. **After Session**: Reflect on lessons learned before archiving
|
|
22
|
+
3. **Proactive**: Add team conventions or architectural rules
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
| Parameter | Type | Required | Description |
|
|
27
|
+
|-----------|------|----------|-------------|
|
|
28
|
+
| `rule` | string | ✅ (unless --interactive) | The rule, convention, or insight to solidify |
|
|
29
|
+
| `--type` | enum | ❌ | Type: `convention`, `constraint`, `learning` (default: auto-detect) |
|
|
30
|
+
| `--category` | string | ❌ | Category for organization (see categories below) |
|
|
31
|
+
| `--interactive` | flag | ❌ | Launch guided wizard for adding rules |
|
|
32
|
+
|
|
33
|
+
### Type Categories
|
|
34
|
+
|
|
35
|
+
**convention** → Coding style preferences (goes to `conventions` section)
|
|
36
|
+
- Subcategories: `coding_style`, `naming_patterns`, `file_structure`, `documentation`
|
|
37
|
+
|
|
38
|
+
**constraint** → Hard rules that must not be violated (goes to `constraints` section)
|
|
39
|
+
- Subcategories: `architecture`, `tech_stack`, `performance`, `security`
|
|
40
|
+
|
|
41
|
+
**learning** → Session-specific insights (goes to `learnings` array)
|
|
42
|
+
- Subcategories: `architecture`, `performance`, `security`, `testing`, `process`, `other`
|
|
43
|
+
|
|
44
|
+
## Execution Process
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Input Parsing:
|
|
48
|
+
├─ Parse: rule text (required unless --interactive)
|
|
49
|
+
├─ Parse: --type (convention|constraint|learning)
|
|
50
|
+
├─ Parse: --category (subcategory)
|
|
51
|
+
└─ Parse: --interactive (flag)
|
|
52
|
+
|
|
53
|
+
Step 1: Ensure Guidelines File Exists
|
|
54
|
+
└─ If not exists → Create with empty structure
|
|
55
|
+
|
|
56
|
+
Step 2: Auto-detect Type (if not specified)
|
|
57
|
+
└─ Analyze rule text for keywords
|
|
58
|
+
|
|
59
|
+
Step 3: Validate and Format Entry
|
|
60
|
+
└─ Build entry object based on type
|
|
61
|
+
|
|
62
|
+
Step 4: Update Guidelines File
|
|
63
|
+
└─ Add entry to appropriate section
|
|
64
|
+
|
|
65
|
+
Step 5: Display Confirmation
|
|
66
|
+
└─ Show what was added and where
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Implementation
|
|
70
|
+
|
|
71
|
+
### Step 1: Ensure Guidelines File Exists
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
bash(test -f .workflow/project-guidelines.json && echo "EXISTS" || echo "NOT_FOUND")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**If NOT_FOUND**, create scaffold:
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
const scaffold = {
|
|
81
|
+
conventions: {
|
|
82
|
+
coding_style: [],
|
|
83
|
+
naming_patterns: [],
|
|
84
|
+
file_structure: [],
|
|
85
|
+
documentation: []
|
|
86
|
+
},
|
|
87
|
+
constraints: {
|
|
88
|
+
architecture: [],
|
|
89
|
+
tech_stack: [],
|
|
90
|
+
performance: [],
|
|
91
|
+
security: []
|
|
92
|
+
},
|
|
93
|
+
quality_rules: [],
|
|
94
|
+
learnings: [],
|
|
95
|
+
_metadata: {
|
|
96
|
+
created_at: new Date().toISOString(),
|
|
97
|
+
version: "1.0.0"
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
Write('.workflow/project-guidelines.json', JSON.stringify(scaffold, null, 2));
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Step 2: Auto-detect Type (if not specified)
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
function detectType(ruleText) {
|
|
108
|
+
const text = ruleText.toLowerCase();
|
|
109
|
+
|
|
110
|
+
// Constraint indicators
|
|
111
|
+
if (/\b(no|never|must not|forbidden|prohibited|always must)\b/.test(text)) {
|
|
112
|
+
return 'constraint';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Learning indicators
|
|
116
|
+
if (/\b(learned|discovered|realized|found that|turns out)\b/.test(text)) {
|
|
117
|
+
return 'learning';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Default to convention
|
|
121
|
+
return 'convention';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function detectCategory(ruleText, type) {
|
|
125
|
+
const text = ruleText.toLowerCase();
|
|
126
|
+
|
|
127
|
+
if (type === 'constraint' || type === 'learning') {
|
|
128
|
+
if (/\b(architecture|layer|module|dependency|circular)\b/.test(text)) return 'architecture';
|
|
129
|
+
if (/\b(security|auth|permission|sanitize|xss|sql)\b/.test(text)) return 'security';
|
|
130
|
+
if (/\b(performance|cache|lazy|async|sync|slow)\b/.test(text)) return 'performance';
|
|
131
|
+
if (/\b(test|coverage|mock|stub)\b/.test(text)) return 'testing';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (type === 'convention') {
|
|
135
|
+
if (/\b(name|naming|prefix|suffix|camel|pascal)\b/.test(text)) return 'naming_patterns';
|
|
136
|
+
if (/\b(file|folder|directory|structure|organize)\b/.test(text)) return 'file_structure';
|
|
137
|
+
if (/\b(doc|comment|jsdoc|readme)\b/.test(text)) return 'documentation';
|
|
138
|
+
return 'coding_style';
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return type === 'constraint' ? 'tech_stack' : 'other';
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Step 3: Build Entry
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
function buildEntry(rule, type, category, sessionId) {
|
|
149
|
+
if (type === 'learning') {
|
|
150
|
+
return {
|
|
151
|
+
date: new Date().toISOString().split('T')[0],
|
|
152
|
+
session_id: sessionId || null,
|
|
153
|
+
insight: rule,
|
|
154
|
+
category: category,
|
|
155
|
+
context: null
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// For conventions and constraints, just return the rule string
|
|
160
|
+
return rule;
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Step 4: Update Guidelines File
|
|
165
|
+
|
|
166
|
+
```javascript
|
|
167
|
+
const guidelines = JSON.parse(Read('.workflow/project-guidelines.json'));
|
|
168
|
+
|
|
169
|
+
if (type === 'convention') {
|
|
170
|
+
if (!guidelines.conventions[category]) {
|
|
171
|
+
guidelines.conventions[category] = [];
|
|
172
|
+
}
|
|
173
|
+
if (!guidelines.conventions[category].includes(rule)) {
|
|
174
|
+
guidelines.conventions[category].push(rule);
|
|
175
|
+
}
|
|
176
|
+
} else if (type === 'constraint') {
|
|
177
|
+
if (!guidelines.constraints[category]) {
|
|
178
|
+
guidelines.constraints[category] = [];
|
|
179
|
+
}
|
|
180
|
+
if (!guidelines.constraints[category].includes(rule)) {
|
|
181
|
+
guidelines.constraints[category].push(rule);
|
|
182
|
+
}
|
|
183
|
+
} else if (type === 'learning') {
|
|
184
|
+
guidelines.learnings.push(buildEntry(rule, type, category, sessionId));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
guidelines._metadata.updated_at = new Date().toISOString();
|
|
188
|
+
guidelines._metadata.last_solidified_by = sessionId;
|
|
189
|
+
|
|
190
|
+
Write('.workflow/project-guidelines.json', JSON.stringify(guidelines, null, 2));
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Step 5: Display Confirmation
|
|
194
|
+
|
|
195
|
+
```
|
|
196
|
+
✓ Guideline solidified
|
|
197
|
+
|
|
198
|
+
Type: ${type}
|
|
199
|
+
Category: ${category}
|
|
200
|
+
Rule: "${rule}"
|
|
201
|
+
|
|
202
|
+
Location: .workflow/project-guidelines.json → ${type}s.${category}
|
|
203
|
+
|
|
204
|
+
Total ${type}s in ${category}: ${count}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Interactive Mode
|
|
208
|
+
|
|
209
|
+
When `--interactive` flag is provided:
|
|
210
|
+
|
|
211
|
+
```javascript
|
|
212
|
+
AskUserQuestion({
|
|
213
|
+
questions: [
|
|
214
|
+
{
|
|
215
|
+
question: "What type of guideline are you adding?",
|
|
216
|
+
header: "Type",
|
|
217
|
+
multiSelect: false,
|
|
218
|
+
options: [
|
|
219
|
+
{ label: "Convention", description: "Coding style preference (e.g., use functional components)" },
|
|
220
|
+
{ label: "Constraint", description: "Hard rule that must not be violated (e.g., no direct DB access)" },
|
|
221
|
+
{ label: "Learning", description: "Insight from this session (e.g., cache invalidation needs events)" }
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Follow-up based on type selection...
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Examples
|
|
231
|
+
|
|
232
|
+
### Add a Convention
|
|
233
|
+
```bash
|
|
234
|
+
/workflow:session:solidify "Use async/await instead of callbacks" --type convention --category coding_style
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Result in `project-guidelines.json`:
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"conventions": {
|
|
241
|
+
"coding_style": ["Use async/await instead of callbacks"]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Add an Architectural Constraint
|
|
247
|
+
```bash
|
|
248
|
+
/workflow:session:solidify "No direct DB access from controllers" --type constraint --category architecture
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Result:
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"constraints": {
|
|
255
|
+
"architecture": ["No direct DB access from controllers"]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Capture a Session Learning
|
|
261
|
+
```bash
|
|
262
|
+
/workflow:session:solidify "Cache invalidation requires event sourcing for consistency" --type learning
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Result:
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"learnings": [
|
|
269
|
+
{
|
|
270
|
+
"date": "2024-12-28",
|
|
271
|
+
"session_id": "WFS-auth-feature",
|
|
272
|
+
"insight": "Cache invalidation requires event sourcing for consistency",
|
|
273
|
+
"category": "architecture"
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Integration with Planning
|
|
280
|
+
|
|
281
|
+
The `project-guidelines.json` is consumed by:
|
|
282
|
+
|
|
283
|
+
1. **`/workflow:tools:context-gather`**: Loads guidelines into context-package.json
|
|
284
|
+
2. **`/workflow:plan`**: Passes guidelines to task generation agent
|
|
285
|
+
3. **`task-generate-agent`**: Includes guidelines as "CRITICAL CONSTRAINTS" in system prompt
|
|
286
|
+
|
|
287
|
+
This ensures all future planning respects solidified rules without users needing to re-state them.
|
|
288
|
+
|
|
289
|
+
## Error Handling
|
|
290
|
+
|
|
291
|
+
- **Duplicate Rule**: Warn and skip if exact rule already exists
|
|
292
|
+
- **Invalid Category**: Suggest valid categories for the type
|
|
293
|
+
- **File Corruption**: Backup existing file before modification
|
|
294
|
+
|
|
295
|
+
## Related Commands
|
|
296
|
+
|
|
297
|
+
- `/workflow:session:start` - Start a session (may prompt for solidify at end)
|
|
298
|
+
- `/workflow:session:complete` - Complete session (prompts for learnings to solidify)
|
|
299
|
+
- `/workflow:init` - Creates project-guidelines.json scaffold if missing
|
|
@@ -38,26 +38,29 @@ ERROR: Invalid session type. Valid types: workflow, review, tdd, test, docs
|
|
|
38
38
|
|
|
39
39
|
## Step 0: Initialize Project State (First-time Only)
|
|
40
40
|
|
|
41
|
-
**Executed before all modes** - Ensures project-level state
|
|
41
|
+
**Executed before all modes** - Ensures project-level state files exist by calling `/workflow:init`.
|
|
42
42
|
|
|
43
43
|
### Check and Initialize
|
|
44
44
|
```bash
|
|
45
|
-
# Check if project state exists
|
|
46
|
-
bash(test -f .workflow/project.json && echo "
|
|
45
|
+
# Check if project state exists (both files required)
|
|
46
|
+
bash(test -f .workflow/project-tech.json && echo "TECH_EXISTS" || echo "TECH_NOT_FOUND")
|
|
47
|
+
bash(test -f .workflow/project-guidelines.json && echo "GUIDELINES_EXISTS" || echo "GUIDELINES_NOT_FOUND")
|
|
47
48
|
```
|
|
48
49
|
|
|
49
|
-
**If NOT_FOUND**, delegate to `/workflow:init`:
|
|
50
|
+
**If either NOT_FOUND**, delegate to `/workflow:init`:
|
|
50
51
|
```javascript
|
|
51
52
|
// Call workflow:init for intelligent project analysis
|
|
52
53
|
SlashCommand({command: "/workflow:init"});
|
|
53
54
|
|
|
54
55
|
// Wait for init completion
|
|
55
|
-
// project.json will be created
|
|
56
|
+
// project-tech.json and project-guidelines.json will be created
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
**Output**:
|
|
59
|
-
- If
|
|
60
|
-
- If NOT_FOUND: Calls `/workflow:init` → creates
|
|
60
|
+
- If BOTH_EXIST: `PROJECT_STATE: initialized`
|
|
61
|
+
- If NOT_FOUND: Calls `/workflow:init` → creates:
|
|
62
|
+
- `.workflow/project-tech.json` with full technical analysis
|
|
63
|
+
- `.workflow/project-guidelines.json` with empty scaffold
|
|
61
64
|
|
|
62
65
|
**Note**: `/workflow:init` uses cli-explore-agent to build comprehensive project understanding (technology stack, architecture, key components). This step runs once per project. Subsequent executions skip initialization.
|
|
63
66
|
|