claude-code-workflow 7.2.13 → 7.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/workflow/analyze-with-file.md +61 -40
- package/.claude/skills/workflow-lite-plan/SKILL.md +3 -7
- package/.codex/skills/analyze-with-file/SKILL.md +1181 -1182
- package/.codex/skills/brainstorm/SKILL.md +723 -725
- package/.codex/skills/brainstorm-with-file/SKILL.md +10 -5
- package/.codex/skills/clean/SKILL.md +33 -26
- package/.codex/skills/collaborative-plan-with-file/SKILL.md +830 -831
- package/.codex/skills/csv-wave-pipeline/SKILL.md +906 -906
- package/.codex/skills/issue-discover/SKILL.md +57 -50
- package/.codex/skills/issue-discover/phases/01-issue-new.md +18 -11
- package/.codex/skills/issue-discover/phases/02-discover.md +31 -26
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +13 -11
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +32 -27
- package/.codex/skills/parallel-dev-cycle/SKILL.md +402 -402
- package/.codex/skills/project-documentation-workflow/SKILL.md +13 -3
- package/.codex/skills/roadmap-with-file/SKILL.md +901 -897
- package/.codex/skills/session-sync/SKILL.md +222 -212
- package/.codex/skills/spec-add/SKILL.md +620 -613
- package/.codex/skills/spec-generator/SKILL.md +2 -2
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +10 -10
- package/.codex/skills/spec-generator/phases/01-discovery.md +11 -18
- package/.codex/skills/spec-generator/phases/02-product-brief.md +5 -5
- package/.codex/skills/spec-generator/phases/03-requirements.md +7 -7
- package/.codex/skills/spec-generator/phases/04-architecture.md +4 -4
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +5 -6
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +10 -17
- package/.codex/skills/spec-generator/phases/07-issue-export.md +326 -329
- package/.codex/skills/spec-setup/SKILL.md +669 -657
- package/.codex/skills/team-arch-opt/SKILL.md +50 -50
- package/.codex/skills/team-arch-opt/agents/completion-handler.md +3 -3
- package/.codex/skills/team-brainstorm/SKILL.md +724 -725
- package/.codex/skills/team-coordinate/SKILL.md +51 -51
- package/.codex/skills/team-coordinate/agents/completion-handler.md +3 -3
- package/.codex/skills/team-coordinate/agents/plan-reviewer.md +4 -4
- package/.codex/skills/team-designer/SKILL.md +691 -691
- package/.codex/skills/team-designer/agents/requirement-clarifier.md +11 -12
- package/.codex/skills/team-executor/SKILL.md +45 -45
- package/.codex/skills/team-frontend/SKILL.md +45 -45
- package/.codex/skills/team-frontend/agents/completion-handler.md +3 -3
- package/.codex/skills/team-frontend/agents/qa-gate-reviewer.md +4 -4
- package/.codex/skills/team-frontend-debug/SKILL.md +50 -50
- package/.codex/skills/team-frontend-debug/agents/completion-handler.md +3 -3
- package/.codex/skills/team-frontend-debug/agents/conditional-skip-gate.md +4 -4
- package/.codex/skills/team-issue/SKILL.md +751 -740
- package/.codex/skills/team-iterdev/SKILL.md +825 -826
- package/.codex/skills/team-lifecycle-v4/SKILL.md +775 -775
- package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +165 -165
- package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +163 -163
- package/.codex/skills/team-perf-opt/SKILL.md +50 -50
- package/.codex/skills/team-perf-opt/agents/completion-handler.md +3 -3
- package/.codex/skills/team-planex-v2/SKILL.md +652 -637
- package/.codex/skills/team-quality-assurance/SKILL.md +51 -52
- package/.codex/skills/team-review/SKILL.md +40 -40
- package/.codex/skills/team-roadmap-dev/SKILL.md +51 -51
- package/.codex/skills/team-roadmap-dev/agents/roadmap-discusser.md +8 -8
- package/.codex/skills/team-tech-debt/SKILL.md +50 -50
- package/.codex/skills/team-tech-debt/agents/plan-approver.md +5 -5
- package/.codex/skills/team-testing/SKILL.md +51 -52
- package/.codex/skills/team-uidesign/SKILL.md +40 -40
- package/.codex/skills/team-uidesign/agents/completion-handler.md +177 -177
- package/.codex/skills/team-ultra-analyze/SKILL.md +786 -787
- package/.codex/skills/team-ultra-analyze/agents/discussion-feedback.md +8 -8
- package/.codex/skills/team-ux-improve/SKILL.md +51 -52
- package/.codex/skills/team-ux-improve/agents/ux-designer.md +2 -2
- package/.codex/skills/team-ux-improve/agents/ux-explorer.md +1 -1
- package/.codex/skills/unified-execute-with-file/SKILL.md +797 -796
- package/.codex/skills/workflow-execute/SKILL.md +1117 -1118
- package/.codex/skills/workflow-lite-planex/SKILL.md +1144 -1141
- package/.codex/skills/workflow-plan/SKILL.md +631 -636
- package/.codex/skills/workflow-tdd-plan/SKILL.md +753 -759
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -392
- package/README.md +25 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +12 -0
- package/ccw/dist/commands/install.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,212 +1,222 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: session-sync
|
|
3
|
-
description: Quick-sync session work to specs/*.md and project-tech.json
|
|
4
|
-
argument-hint: "[-y|--yes] [\"what was done\"]"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Session Sync
|
|
9
|
-
|
|
10
|
-
One-shot update `specs/*.md` + `project-tech.json` from current session context.
|
|
11
|
-
|
|
12
|
-
**Design**: Scan context -> extract -> write. No interactive wizards.
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
$session-sync # Sync with preview + confirmation
|
|
18
|
-
$session-sync -y # Auto-sync, skip confirmation
|
|
19
|
-
$session-sync "Added JWT auth flow" # Sync with explicit summary
|
|
20
|
-
$session-sync -y "Fixed N+1 query" # Auto-sync with summary
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Process
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
Step 1: Gather Context
|
|
27
|
-
|- git diff --stat HEAD~3..HEAD (recent changes)
|
|
28
|
-
|- Active session folder (.workflow/.lite-plan/*) if exists
|
|
29
|
-
+- User summary ($ARGUMENTS or auto-generate from git log)
|
|
30
|
-
|
|
31
|
-
Step 2: Extract Updates
|
|
32
|
-
|- Guidelines: conventions / constraints / learnings
|
|
33
|
-
+- Tech: development_index entry
|
|
34
|
-
|
|
35
|
-
Step 3: Preview & Confirm (skip if --yes)
|
|
36
|
-
|
|
37
|
-
Step 4: Write both files
|
|
38
|
-
|
|
39
|
-
Step 5: One-line confirmation
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Implementation
|
|
43
|
-
|
|
44
|
-
### Step 1: Gather Context
|
|
45
|
-
|
|
46
|
-
```javascript
|
|
47
|
-
const AUTO_YES = "$ARGUMENTS".includes('--yes') || "$ARGUMENTS".includes('-y')
|
|
48
|
-
const userSummary = "$ARGUMENTS".replace(/--yes|-y/g, '').trim()
|
|
49
|
-
|
|
50
|
-
// Recent changes
|
|
51
|
-
const gitStat = Bash('git diff --stat HEAD~3..HEAD 2>/dev/null || git diff --stat HEAD 2>/dev/null')
|
|
52
|
-
const gitLog = Bash('git log --oneline -5')
|
|
53
|
-
|
|
54
|
-
// Active session (optional)
|
|
55
|
-
const sessionFolders = Glob('.workflow/.lite-plan/*/plan.json')
|
|
56
|
-
let sessionContext = null
|
|
57
|
-
if (sessionFolders.length > 0) {
|
|
58
|
-
const latest = sessionFolders[sessionFolders.length - 1]
|
|
59
|
-
sessionContext = JSON.parse(Read(latest))
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Build summary
|
|
63
|
-
const summary = userSummary
|
|
64
|
-
|| sessionContext?.summary
|
|
65
|
-
|| gitLog.split('\n')[0].replace(/^[a-f0-9]+ /, '')
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Step 2: Extract Updates
|
|
69
|
-
|
|
70
|
-
Analyze context and produce two update payloads. Use LLM reasoning (current agent) -- no CLI calls.
|
|
71
|
-
|
|
72
|
-
```javascript
|
|
73
|
-
// -- Guidelines extraction --
|
|
74
|
-
// Scan git diff + session for:
|
|
75
|
-
// - New patterns adopted -> convention
|
|
76
|
-
// - Restrictions discovered -> constraint
|
|
77
|
-
// - Surprises / gotchas -> learning
|
|
78
|
-
//
|
|
79
|
-
// Output: array of { type, category, text }
|
|
80
|
-
// RULE: Only extract genuinely reusable insights. Skip trivial/obvious items.
|
|
81
|
-
// RULE: Deduplicate against existing guidelines before adding.
|
|
82
|
-
|
|
83
|
-
// Load existing specs via ccw spec load
|
|
84
|
-
const existingSpecs = Bash('ccw spec load --dimension specs 2>/dev/null || echo ""')
|
|
85
|
-
const guidelineUpdates = [] // populated by agent analysis
|
|
86
|
-
|
|
87
|
-
// -- Tech extraction --
|
|
88
|
-
// Build one development_index entry from session work
|
|
89
|
-
|
|
90
|
-
function detectCategory(text) {
|
|
91
|
-
text = text.toLowerCase()
|
|
92
|
-
if (/\b(fix|bug|error|crash)\b/.test(text)) return 'bugfix'
|
|
93
|
-
if (/\b(refactor|cleanup|reorganize)\b/.test(text)) return 'refactor'
|
|
94
|
-
if (/\b(doc|readme|comment)\b/.test(text)) return 'docs'
|
|
95
|
-
if (/\b(add|new|create|implement)\b/.test(text)) return 'feature'
|
|
96
|
-
return 'enhancement'
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function detectSubFeature(gitStat) {
|
|
100
|
-
// Most-changed directory from git diff --stat
|
|
101
|
-
const dirs = gitStat.match(/\S+\//g) || []
|
|
102
|
-
const counts = {}
|
|
103
|
-
dirs.forEach(d => {
|
|
104
|
-
const seg = d.split('/').filter(Boolean).slice(-2, -1)[0] || 'general'
|
|
105
|
-
counts[seg] = (counts[seg] || 0) + 1
|
|
106
|
-
})
|
|
107
|
-
return Object.entries(counts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'general'
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const techEntry = {
|
|
111
|
-
title: summary.slice(0, 60),
|
|
112
|
-
sub_feature: detectSubFeature(gitStat),
|
|
113
|
-
date: new Date().toISOString().split('T')[0],
|
|
114
|
-
description: summary.slice(0, 100),
|
|
115
|
-
status: 'completed',
|
|
116
|
-
session_id: sessionContext ? sessionFolders[sessionFolders.length - 1].match(/lite-plan\/([^/]+)/)?.[1] : null
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Step 3: Preview & Confirm
|
|
121
|
-
|
|
122
|
-
```javascript
|
|
123
|
-
// Show preview
|
|
124
|
-
console.log(`
|
|
125
|
-
-- Sync Preview --
|
|
126
|
-
|
|
127
|
-
Guidelines (${guidelineUpdates.length} items):
|
|
128
|
-
${guidelineUpdates.map(g => ` [${g.type}/${g.category}] ${g.text}`).join('\n') || ' (none)'}
|
|
129
|
-
|
|
130
|
-
Tech [${detectCategory(summary)}]:
|
|
131
|
-
${techEntry.title}
|
|
132
|
-
|
|
133
|
-
Target files:
|
|
134
|
-
.ccw/specs/*.md
|
|
135
|
-
.workflow/project-tech.json
|
|
136
|
-
`)
|
|
137
|
-
|
|
138
|
-
if (!AUTO_YES) {
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
1
|
+
---
|
|
2
|
+
name: session-sync
|
|
3
|
+
description: Quick-sync session work to specs/*.md and project-tech.json
|
|
4
|
+
argument-hint: "[-y|--yes] [\"what was done\"]"
|
|
5
|
+
allowed-tools: request_user_input, Read, Write, Edit, Bash, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Session Sync
|
|
9
|
+
|
|
10
|
+
One-shot update `specs/*.md` + `project-tech.json` from current session context.
|
|
11
|
+
|
|
12
|
+
**Design**: Scan context -> extract -> write. No interactive wizards.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
$session-sync # Sync with preview + confirmation
|
|
18
|
+
$session-sync -y # Auto-sync, skip confirmation
|
|
19
|
+
$session-sync "Added JWT auth flow" # Sync with explicit summary
|
|
20
|
+
$session-sync -y "Fixed N+1 query" # Auto-sync with summary
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Step 1: Gather Context
|
|
27
|
+
|- git diff --stat HEAD~3..HEAD (recent changes)
|
|
28
|
+
|- Active session folder (.workflow/.lite-plan/*) if exists
|
|
29
|
+
+- User summary ($ARGUMENTS or auto-generate from git log)
|
|
30
|
+
|
|
31
|
+
Step 2: Extract Updates
|
|
32
|
+
|- Guidelines: conventions / constraints / learnings
|
|
33
|
+
+- Tech: development_index entry
|
|
34
|
+
|
|
35
|
+
Step 3: Preview & Confirm (skip if --yes)
|
|
36
|
+
|
|
37
|
+
Step 4: Write both files
|
|
38
|
+
|
|
39
|
+
Step 5: One-line confirmation
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Implementation
|
|
43
|
+
|
|
44
|
+
### Step 1: Gather Context
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
const AUTO_YES = "$ARGUMENTS".includes('--yes') || "$ARGUMENTS".includes('-y')
|
|
48
|
+
const userSummary = "$ARGUMENTS".replace(/--yes|-y/g, '').trim()
|
|
49
|
+
|
|
50
|
+
// Recent changes
|
|
51
|
+
const gitStat = Bash('git diff --stat HEAD~3..HEAD 2>/dev/null || git diff --stat HEAD 2>/dev/null')
|
|
52
|
+
const gitLog = Bash('git log --oneline -5')
|
|
53
|
+
|
|
54
|
+
// Active session (optional)
|
|
55
|
+
const sessionFolders = Glob('.workflow/.lite-plan/*/plan.json')
|
|
56
|
+
let sessionContext = null
|
|
57
|
+
if (sessionFolders.length > 0) {
|
|
58
|
+
const latest = sessionFolders[sessionFolders.length - 1]
|
|
59
|
+
sessionContext = JSON.parse(Read(latest))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Build summary
|
|
63
|
+
const summary = userSummary
|
|
64
|
+
|| sessionContext?.summary
|
|
65
|
+
|| gitLog.split('\n')[0].replace(/^[a-f0-9]+ /, '')
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Step 2: Extract Updates
|
|
69
|
+
|
|
70
|
+
Analyze context and produce two update payloads. Use LLM reasoning (current agent) -- no CLI calls.
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
73
|
+
// -- Guidelines extraction --
|
|
74
|
+
// Scan git diff + session for:
|
|
75
|
+
// - New patterns adopted -> convention
|
|
76
|
+
// - Restrictions discovered -> constraint
|
|
77
|
+
// - Surprises / gotchas -> learning
|
|
78
|
+
//
|
|
79
|
+
// Output: array of { type, category, text }
|
|
80
|
+
// RULE: Only extract genuinely reusable insights. Skip trivial/obvious items.
|
|
81
|
+
// RULE: Deduplicate against existing guidelines before adding.
|
|
82
|
+
|
|
83
|
+
// Load existing specs via ccw spec load
|
|
84
|
+
const existingSpecs = Bash('ccw spec load --dimension specs 2>/dev/null || echo ""')
|
|
85
|
+
const guidelineUpdates = [] // populated by agent analysis
|
|
86
|
+
|
|
87
|
+
// -- Tech extraction --
|
|
88
|
+
// Build one development_index entry from session work
|
|
89
|
+
|
|
90
|
+
function detectCategory(text) {
|
|
91
|
+
text = text.toLowerCase()
|
|
92
|
+
if (/\b(fix|bug|error|crash)\b/.test(text)) return 'bugfix'
|
|
93
|
+
if (/\b(refactor|cleanup|reorganize)\b/.test(text)) return 'refactor'
|
|
94
|
+
if (/\b(doc|readme|comment)\b/.test(text)) return 'docs'
|
|
95
|
+
if (/\b(add|new|create|implement)\b/.test(text)) return 'feature'
|
|
96
|
+
return 'enhancement'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function detectSubFeature(gitStat) {
|
|
100
|
+
// Most-changed directory from git diff --stat
|
|
101
|
+
const dirs = gitStat.match(/\S+\//g) || []
|
|
102
|
+
const counts = {}
|
|
103
|
+
dirs.forEach(d => {
|
|
104
|
+
const seg = d.split('/').filter(Boolean).slice(-2, -1)[0] || 'general'
|
|
105
|
+
counts[seg] = (counts[seg] || 0) + 1
|
|
106
|
+
})
|
|
107
|
+
return Object.entries(counts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'general'
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const techEntry = {
|
|
111
|
+
title: summary.slice(0, 60),
|
|
112
|
+
sub_feature: detectSubFeature(gitStat),
|
|
113
|
+
date: new Date().toISOString().split('T')[0],
|
|
114
|
+
description: summary.slice(0, 100),
|
|
115
|
+
status: 'completed',
|
|
116
|
+
session_id: sessionContext ? sessionFolders[sessionFolders.length - 1].match(/lite-plan\/([^/]+)/)?.[1] : null
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Step 3: Preview & Confirm
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
// Show preview
|
|
124
|
+
console.log(`
|
|
125
|
+
-- Sync Preview --
|
|
126
|
+
|
|
127
|
+
Guidelines (${guidelineUpdates.length} items):
|
|
128
|
+
${guidelineUpdates.map(g => ` [${g.type}/${g.category}] ${g.text}`).join('\n') || ' (none)'}
|
|
129
|
+
|
|
130
|
+
Tech [${detectCategory(summary)}]:
|
|
131
|
+
${techEntry.title}
|
|
132
|
+
|
|
133
|
+
Target files:
|
|
134
|
+
.ccw/specs/*.md
|
|
135
|
+
.workflow/project-tech.json
|
|
136
|
+
`)
|
|
137
|
+
|
|
138
|
+
if (!AUTO_YES) {
|
|
139
|
+
const answer = request_user_input({
|
|
140
|
+
questions: [{
|
|
141
|
+
header: "确认同步",
|
|
142
|
+
id: "confirm_sync",
|
|
143
|
+
question: "Apply these updates? (modify/skip items if needed)",
|
|
144
|
+
options: [
|
|
145
|
+
{ label: "Apply(Recommended)", description: "Apply all extracted updates to specs and project-tech.json" },
|
|
146
|
+
{ label: "Cancel", description: "Abort sync, no changes made" }
|
|
147
|
+
]
|
|
148
|
+
}]
|
|
149
|
+
}) // BLOCKS (wait for user response)
|
|
150
|
+
if (answer.answers.confirm_sync.answers[0] !== "Apply(Recommended)") {
|
|
151
|
+
console.log('Sync cancelled.')
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Step 4: Write
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
// -- Update specs/*.md --
|
|
161
|
+
// Uses .ccw/specs/ directory (same as frontend/backend spec-index-builder)
|
|
162
|
+
if (guidelineUpdates.length > 0) {
|
|
163
|
+
// Map guideline types to spec files
|
|
164
|
+
const specFileMap = {
|
|
165
|
+
convention: '.ccw/specs/coding-conventions.md',
|
|
166
|
+
constraint: '.ccw/specs/architecture-constraints.md',
|
|
167
|
+
learning: '.ccw/specs/coding-conventions.md' // learnings appended to conventions
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
for (const g of guidelineUpdates) {
|
|
171
|
+
const targetFile = specFileMap[g.type]
|
|
172
|
+
const existing = Read(targetFile)
|
|
173
|
+
const ruleText = g.type === 'learning'
|
|
174
|
+
? `- [${g.category}] ${g.text} (learned: ${new Date().toISOString().split('T')[0]})`
|
|
175
|
+
: `- [${g.category}] ${g.text}`
|
|
176
|
+
|
|
177
|
+
// Deduplicate: skip if text already in file
|
|
178
|
+
if (!existing.includes(g.text)) {
|
|
179
|
+
const newContent = existing.trimEnd() + '\n' + ruleText + '\n'
|
|
180
|
+
Write(targetFile, newContent)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Rebuild spec index after writing
|
|
185
|
+
Bash('ccw spec rebuild')
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// -- Update project-tech.json --
|
|
189
|
+
const techPath = '.workflow/project-tech.json'
|
|
190
|
+
const tech = JSON.parse(Read(techPath))
|
|
191
|
+
|
|
192
|
+
if (!tech.development_index) {
|
|
193
|
+
tech.development_index = { feature: [], enhancement: [], bugfix: [], refactor: [], docs: [] }
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const category = detectCategory(summary)
|
|
197
|
+
tech.development_index[category].push(techEntry)
|
|
198
|
+
tech._metadata.last_updated = new Date().toISOString()
|
|
199
|
+
|
|
200
|
+
Write(techPath, JSON.stringify(tech, null, 2))
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Step 5: Confirm
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
Synced: ${guidelineUpdates.length} guidelines + 1 tech entry [${category}]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Error Handling
|
|
210
|
+
|
|
211
|
+
| Error | Resolution |
|
|
212
|
+
|-------|------------|
|
|
213
|
+
| File missing | Create scaffold (same as $spec-setup Step 4) |
|
|
214
|
+
| No git history | Use user summary or session context only |
|
|
215
|
+
| No meaningful updates | Skip guidelines, still add tech entry |
|
|
216
|
+
| Duplicate entry | Skip silently (dedup check in Step 4) |
|
|
217
|
+
|
|
218
|
+
## Related Commands
|
|
219
|
+
|
|
220
|
+
- `$spec-setup` - Initialize project with specs scaffold
|
|
221
|
+
- `$spec-add` - Interactive wizard to create individual specs with scope selection
|
|
222
|
+
- `$workflow-plan` - Start planning with initialized project context
|