claude-code-workflow 6.0.5 → 6.1.1
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/action-planning-agent.md +1 -1
- package/.claude/agents/cli-execution-agent.md +269 -269
- package/.claude/agents/cli-explore-agent.md +182 -182
- package/.claude/agents/context-search-agent.md +582 -582
- package/.claude/agents/memory-bridge.md +93 -93
- package/.claude/commands/cli/cli-init.md +1 -1
- package/.claude/commands/memory/docs-full-cli.md +471 -471
- package/.claude/commands/memory/docs-related-cli.md +386 -386
- package/.claude/commands/memory/docs.md +615 -615
- package/.claude/commands/memory/load.md +1 -1
- package/.claude/commands/memory/update-full.md +332 -332
- package/.claude/commands/memory/update-related.md +5 -5
- package/.claude/commands/workflow/init.md +1 -1
- package/.claude/commands/workflow/lite-fix.md +621 -621
- package/.claude/commands/workflow/lite-plan.md +592 -592
- package/.claude/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/commands/workflow/ui-design/generate.md +504 -504
- package/.claude/commands/workflow/ui-design/import-from-code.md +537 -537
- package/.claude/scripts/classify-folders.sh +4 -0
- package/.claude/scripts/convert_tokens_to_css.sh +4 -0
- package/.claude/scripts/detect_changed_modules.sh +5 -1
- package/.claude/scripts/discover-design-files.sh +87 -83
- package/.claude/scripts/generate_module_docs.sh +717 -713
- package/.claude/scripts/get_modules_by_depth.sh +5 -1
- package/.claude/scripts/ui-generate-preview.sh +4 -0
- package/.claude/scripts/ui-instantiate-prototypes.sh +4 -0
- package/.claude/scripts/update_module_claude.sh +4 -0
- package/.claude/skills/command-guide/index/all-commands.json +1 -12
- package/.claude/skills/command-guide/index/by-category.json +1 -12
- package/.claude/skills/command-guide/index/by-use-case.json +1 -12
- package/.claude/skills/command-guide/index/essential-commands.json +1 -12
- package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +127 -71
- package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +269 -269
- package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +182 -182
- package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +18 -38
- package/.claude/skills/command-guide/reference/agents/context-search-agent.md +582 -577
- package/.claude/skills/command-guide/reference/agents/memory-bridge.md +93 -93
- package/.claude/skills/command-guide/reference/commands/cli/cli-init.md +1 -1
- package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +471 -471
- package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +386 -386
- package/.claude/skills/command-guide/reference/commands/memory/docs.md +615 -610
- package/.claude/skills/command-guide/reference/commands/memory/load.md +1 -1
- package/.claude/skills/command-guide/reference/commands/memory/update-full.md +332 -332
- package/.claude/skills/command-guide/reference/commands/memory/update-related.md +5 -5
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/artifacts.md +299 -451
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +14 -37
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/synthesis.md +252 -350
- package/.claude/skills/command-guide/reference/commands/workflow/init.md +2 -2
- package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +52 -0
- package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +621 -602
- package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +46 -36
- package/.claude/skills/command-guide/reference/commands/workflow/review-fix.md +18 -58
- package/.claude/skills/command-guide/reference/commands/workflow/review-module-cycle.md +22 -52
- package/.claude/skills/command-guide/reference/commands/workflow/review-session-cycle.md +19 -48
- package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +25 -5
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +7 -7
- package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +151 -11
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +4 -4
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-task-generate.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/generate.md +504 -504
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +537 -537
- package/.claude/workflows/context-search-strategy.md +77 -77
- package/.claude/workflows/tool-strategy.md +90 -71
- package/.claude/workflows/workflow-architecture.md +1 -1
- package/README.md +285 -285
- package/ccw/src/cli.js +7 -0
- package/ccw/src/commands/tool.js +217 -0
- package/ccw/src/core/dashboard-generator.js +18 -3
- package/ccw/src/core/lite-scanner.js +35 -11
- package/ccw/src/core/server.js +531 -46
- package/ccw/src/templates/dashboard-css/01-base.css +161 -0
- package/ccw/src/templates/dashboard-css/02-session.css +726 -0
- package/ccw/src/templates/dashboard-css/03-tasks.css +512 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +843 -0
- package/ccw/src/templates/dashboard-css/05-context.css +2206 -0
- package/ccw/src/templates/dashboard-css/06-cards.css +1570 -0
- package/ccw/src/templates/dashboard-css/07-managers.css +936 -0
- package/ccw/src/templates/dashboard-css/08-review.css +1266 -0
- package/ccw/src/templates/dashboard-css/09-explorer.css +1397 -0
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +219 -0
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +10 -0
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +11 -1
- package/ccw/src/templates/dashboard-js/components/navigation.js +11 -5
- package/ccw/src/templates/dashboard-js/components/tabs-context.js +20 -20
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +11 -11
- package/ccw/src/templates/dashboard-js/components/theme.js +29 -1
- package/ccw/src/templates/dashboard-js/main.js +4 -0
- package/ccw/src/templates/dashboard-js/state.js +5 -0
- package/ccw/src/templates/dashboard-js/views/explorer.js +852 -0
- package/ccw/src/templates/dashboard-js/views/home.js +13 -9
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +8 -5
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +21 -16
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +90 -19
- package/ccw/src/templates/dashboard-js/views/project-overview.js +15 -11
- package/ccw/src/templates/dashboard-js/views/review-session.js +3 -3
- package/ccw/src/templates/dashboard-js/views/session-detail.js +38 -28
- package/ccw/src/templates/dashboard.html +129 -28
- package/ccw/src/tools/classify-folders.js +204 -0
- package/ccw/src/tools/convert-tokens-to-css.js +250 -0
- package/ccw/src/tools/detect-changed-modules.js +288 -0
- package/ccw/src/tools/discover-design-files.js +134 -0
- package/ccw/src/tools/edit-file.js +266 -0
- package/ccw/src/tools/generate-module-docs.js +416 -0
- package/ccw/src/tools/get-modules-by-depth.js +308 -0
- package/ccw/src/tools/index.js +176 -0
- package/ccw/src/tools/ui-generate-preview.js +327 -0
- package/ccw/src/tools/ui-instantiate-prototypes.js +301 -0
- package/ccw/src/tools/update-module-claude.js +380 -0
- package/package.json +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/status.md +0 -352
- package/ccw/src/core/server.js.bak +0 -385
- package/ccw/src/core/server_original.bak +0 -385
- package/ccw/src/templates/dashboard.css +0 -8187
- package/ccw/src/templates/dashboard_tailwind.html +0 -42
- package/ccw/src/templates/dashboard_test.html +0 -37
- package/ccw/src/templates/tailwind-base.css +0 -212
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Module CLAUDE.md Tool
|
|
3
|
+
* Generate/update CLAUDE.md module documentation using CLI tools
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { readdirSync, statSync, existsSync, readFileSync, writeFileSync, unlinkSync } from 'fs';
|
|
7
|
+
import { join, resolve, basename, extname } from 'path';
|
|
8
|
+
import { execSync } from 'child_process';
|
|
9
|
+
import { tmpdir } from 'os';
|
|
10
|
+
|
|
11
|
+
// Directories to exclude
|
|
12
|
+
const EXCLUDE_DIRS = [
|
|
13
|
+
'.git', '__pycache__', 'node_modules', '.venv', 'venv', 'env',
|
|
14
|
+
'dist', 'build', '.cache', '.pytest_cache', '.mypy_cache',
|
|
15
|
+
'coverage', '.nyc_output', 'logs', 'tmp', 'temp'
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
// Default models for each tool
|
|
19
|
+
const DEFAULT_MODELS = {
|
|
20
|
+
gemini: 'gemini-2.5-flash',
|
|
21
|
+
qwen: 'coder-model',
|
|
22
|
+
codex: 'gpt5-codex'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Count files in directory
|
|
27
|
+
*/
|
|
28
|
+
function countFiles(dirPath) {
|
|
29
|
+
try {
|
|
30
|
+
const entries = readdirSync(dirPath, { withFileTypes: true });
|
|
31
|
+
return entries.filter(e => e.isFile() && !e.name.startsWith('.')).length;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Scan directory structure
|
|
39
|
+
*/
|
|
40
|
+
function scanDirectoryStructure(targetPath, strategy) {
|
|
41
|
+
const lines = [];
|
|
42
|
+
const dirName = basename(targetPath);
|
|
43
|
+
|
|
44
|
+
let totalFiles = 0;
|
|
45
|
+
let totalDirs = 0;
|
|
46
|
+
|
|
47
|
+
function countRecursive(dir) {
|
|
48
|
+
try {
|
|
49
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
50
|
+
entries.forEach(e => {
|
|
51
|
+
if (e.name.startsWith('.') || EXCLUDE_DIRS.includes(e.name)) return;
|
|
52
|
+
if (e.isFile()) totalFiles++;
|
|
53
|
+
else if (e.isDirectory()) {
|
|
54
|
+
totalDirs++;
|
|
55
|
+
countRecursive(join(dir, e.name));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
} catch (e) {
|
|
59
|
+
// Ignore
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
countRecursive(targetPath);
|
|
64
|
+
|
|
65
|
+
lines.push(`Directory: ${dirName}`);
|
|
66
|
+
lines.push(`Total files: ${totalFiles}`);
|
|
67
|
+
lines.push(`Total directories: ${totalDirs}`);
|
|
68
|
+
lines.push('');
|
|
69
|
+
|
|
70
|
+
if (strategy === 'multi-layer') {
|
|
71
|
+
lines.push('Subdirectories with files:');
|
|
72
|
+
// List subdirectories with file counts
|
|
73
|
+
function listSubdirs(dir, prefix = '') {
|
|
74
|
+
try {
|
|
75
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
76
|
+
entries.forEach(e => {
|
|
77
|
+
if (!e.isDirectory() || e.name.startsWith('.') || EXCLUDE_DIRS.includes(e.name)) return;
|
|
78
|
+
const subPath = join(dir, e.name);
|
|
79
|
+
const fileCount = countFiles(subPath);
|
|
80
|
+
if (fileCount > 0) {
|
|
81
|
+
const relPath = subPath.replace(targetPath, '').replace(/^[/\\]/, '');
|
|
82
|
+
lines.push(` - ${relPath}/ (${fileCount} files)`);
|
|
83
|
+
}
|
|
84
|
+
listSubdirs(subPath, prefix + ' ');
|
|
85
|
+
});
|
|
86
|
+
} catch (e) {
|
|
87
|
+
// Ignore
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
listSubdirs(targetPath);
|
|
91
|
+
} else {
|
|
92
|
+
lines.push('Direct subdirectories:');
|
|
93
|
+
try {
|
|
94
|
+
const entries = readdirSync(targetPath, { withFileTypes: true });
|
|
95
|
+
entries.forEach(e => {
|
|
96
|
+
if (!e.isDirectory() || e.name.startsWith('.') || EXCLUDE_DIRS.includes(e.name)) return;
|
|
97
|
+
const subPath = join(targetPath, e.name);
|
|
98
|
+
const fileCount = countFiles(subPath);
|
|
99
|
+
const hasClaude = existsSync(join(subPath, 'CLAUDE.md')) ? ' [has CLAUDE.md]' : '';
|
|
100
|
+
lines.push(` - ${e.name}/ (${fileCount} files)${hasClaude}`);
|
|
101
|
+
});
|
|
102
|
+
} catch (e) {
|
|
103
|
+
// Ignore
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Count file types in current directory
|
|
108
|
+
lines.push('');
|
|
109
|
+
lines.push('Current directory files:');
|
|
110
|
+
try {
|
|
111
|
+
const entries = readdirSync(targetPath, { withFileTypes: true });
|
|
112
|
+
const codeExts = ['.ts', '.tsx', '.js', '.jsx', '.py', '.sh'];
|
|
113
|
+
const configExts = ['.json', '.yaml', '.yml', '.toml'];
|
|
114
|
+
|
|
115
|
+
let codeCount = 0, configCount = 0, docCount = 0;
|
|
116
|
+
entries.forEach(e => {
|
|
117
|
+
if (!e.isFile()) return;
|
|
118
|
+
const ext = extname(e.name).toLowerCase();
|
|
119
|
+
if (codeExts.includes(ext)) codeCount++;
|
|
120
|
+
else if (configExts.includes(ext)) configCount++;
|
|
121
|
+
else if (ext === '.md') docCount++;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
lines.push(` - Code files: ${codeCount}`);
|
|
125
|
+
lines.push(` - Config files: ${configCount}`);
|
|
126
|
+
lines.push(` - Documentation: ${docCount}`);
|
|
127
|
+
} catch (e) {
|
|
128
|
+
// Ignore
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return lines.join('\n');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Load template content
|
|
136
|
+
*/
|
|
137
|
+
function loadTemplate() {
|
|
138
|
+
const templatePath = join(
|
|
139
|
+
process.env.HOME || process.env.USERPROFILE,
|
|
140
|
+
'.claude/workflows/cli-templates/prompts/memory/02-document-module-structure.txt'
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (existsSync(templatePath)) {
|
|
144
|
+
return readFileSync(templatePath, 'utf8');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return 'Create comprehensive CLAUDE.md documentation following standard structure with Purpose, Structure, Components, Dependencies, Integration, and Implementation sections.';
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Create temporary prompt file and return cleanup function
|
|
152
|
+
*/
|
|
153
|
+
function createPromptFile(prompt) {
|
|
154
|
+
const timestamp = Date.now();
|
|
155
|
+
const randomSuffix = Math.random().toString(36).substring(2, 8);
|
|
156
|
+
const promptFile = join(tmpdir(), `claude-prompt-${timestamp}-${randomSuffix}.txt`);
|
|
157
|
+
writeFileSync(promptFile, prompt, 'utf8');
|
|
158
|
+
return promptFile;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Build CLI command using stdin piping for prompt (avoids shell escaping issues)
|
|
163
|
+
*/
|
|
164
|
+
function buildCliCommand(tool, promptFile, model) {
|
|
165
|
+
// Use stdin piping: cat file | tool or Get-Content | tool
|
|
166
|
+
// This avoids shell escaping issues with multiline prompts
|
|
167
|
+
const normalizedPath = promptFile.replace(/\\/g, '/');
|
|
168
|
+
const isWindows = process.platform === 'win32';
|
|
169
|
+
|
|
170
|
+
// Build the cat/read command based on platform
|
|
171
|
+
const catCmd = isWindows ? `Get-Content -Raw "${normalizedPath}" | ` : `cat "${normalizedPath}" | `;
|
|
172
|
+
|
|
173
|
+
switch (tool) {
|
|
174
|
+
case 'qwen':
|
|
175
|
+
return model === 'coder-model'
|
|
176
|
+
? `${catCmd}qwen --yolo`
|
|
177
|
+
: `${catCmd}qwen -m "${model}" --yolo`;
|
|
178
|
+
case 'codex':
|
|
179
|
+
// codex uses different syntax - prompt as exec argument
|
|
180
|
+
if (isWindows) {
|
|
181
|
+
return `codex --full-auto exec (Get-Content -Raw "${normalizedPath}") -m "${model}" --skip-git-repo-check -s danger-full-access`;
|
|
182
|
+
}
|
|
183
|
+
return `codex --full-auto exec "$(cat "${normalizedPath}")" -m "${model}" --skip-git-repo-check -s danger-full-access`;
|
|
184
|
+
case 'gemini':
|
|
185
|
+
default:
|
|
186
|
+
// gemini reads from stdin when no positional prompt is given
|
|
187
|
+
return `${catCmd}gemini -m "${model}" --yolo`;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Main execute function
|
|
193
|
+
*/
|
|
194
|
+
async function execute(params) {
|
|
195
|
+
const { strategy, path: modulePath, tool = 'gemini', model } = params;
|
|
196
|
+
|
|
197
|
+
// Validate parameters
|
|
198
|
+
if (!strategy) {
|
|
199
|
+
throw new Error('Parameter "strategy" is required. Valid: single-layer, multi-layer');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if (!['single-layer', 'multi-layer'].includes(strategy)) {
|
|
203
|
+
throw new Error(`Invalid strategy '${strategy}'. Valid: single-layer, multi-layer`);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (!modulePath) {
|
|
207
|
+
throw new Error('Parameter "path" is required');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const targetPath = resolve(process.cwd(), modulePath);
|
|
211
|
+
|
|
212
|
+
if (!existsSync(targetPath)) {
|
|
213
|
+
throw new Error(`Directory not found: ${targetPath}`);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (!statSync(targetPath).isDirectory()) {
|
|
217
|
+
throw new Error(`Not a directory: ${targetPath}`);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Check if directory has files
|
|
221
|
+
const fileCount = countFiles(targetPath);
|
|
222
|
+
if (fileCount === 0) {
|
|
223
|
+
return {
|
|
224
|
+
success: false,
|
|
225
|
+
message: `Skipping '${modulePath}' - no files found`,
|
|
226
|
+
skipped: true
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Set model
|
|
231
|
+
const actualModel = model || DEFAULT_MODELS[tool] || DEFAULT_MODELS.gemini;
|
|
232
|
+
|
|
233
|
+
// Load template
|
|
234
|
+
const templateContent = loadTemplate();
|
|
235
|
+
|
|
236
|
+
// Scan directory structure
|
|
237
|
+
const structureInfo = scanDirectoryStructure(targetPath, strategy);
|
|
238
|
+
|
|
239
|
+
// Build prompt based on strategy
|
|
240
|
+
let prompt;
|
|
241
|
+
if (strategy === 'multi-layer') {
|
|
242
|
+
prompt = `Directory Structure Analysis:
|
|
243
|
+
${structureInfo}
|
|
244
|
+
|
|
245
|
+
Read: @**/*
|
|
246
|
+
|
|
247
|
+
Generate CLAUDE.md files:
|
|
248
|
+
- Primary: ./CLAUDE.md (current directory)
|
|
249
|
+
- Additional: CLAUDE.md in each subdirectory containing files
|
|
250
|
+
|
|
251
|
+
Template Guidelines:
|
|
252
|
+
${templateContent}
|
|
253
|
+
|
|
254
|
+
Instructions:
|
|
255
|
+
- Work bottom-up: deepest directories first
|
|
256
|
+
- Parent directories reference children
|
|
257
|
+
- Each CLAUDE.md file must be in its respective directory
|
|
258
|
+
- Follow the template guidelines above for consistent structure
|
|
259
|
+
- Use the structure analysis to understand directory hierarchy`;
|
|
260
|
+
} else {
|
|
261
|
+
prompt = `Directory Structure Analysis:
|
|
262
|
+
${structureInfo}
|
|
263
|
+
|
|
264
|
+
Read: @*/CLAUDE.md @*.ts @*.tsx @*.js @*.jsx @*.py @*.sh @*.md @*.json @*.yaml @*.yml
|
|
265
|
+
|
|
266
|
+
Generate single file: ./CLAUDE.md
|
|
267
|
+
|
|
268
|
+
Template Guidelines:
|
|
269
|
+
${templateContent}
|
|
270
|
+
|
|
271
|
+
Instructions:
|
|
272
|
+
- Create exactly one CLAUDE.md file in the current directory
|
|
273
|
+
- Reference child CLAUDE.md files, do not duplicate their content
|
|
274
|
+
- Follow the template guidelines above for consistent structure
|
|
275
|
+
- Use the structure analysis to understand the current directory context`;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Create temporary prompt file (avoids shell escaping issues with multiline prompts)
|
|
279
|
+
const promptFile = createPromptFile(prompt);
|
|
280
|
+
|
|
281
|
+
// Build command using file-based prompt
|
|
282
|
+
const command = buildCliCommand(tool, promptFile, actualModel);
|
|
283
|
+
|
|
284
|
+
// Log execution info
|
|
285
|
+
console.log(`⚡ Updating: ${modulePath}`);
|
|
286
|
+
console.log(` Strategy: ${strategy} | Tool: ${tool} | Model: ${actualModel} | Files: ${fileCount}`);
|
|
287
|
+
console.log(` Prompt file: ${promptFile}`);
|
|
288
|
+
|
|
289
|
+
try {
|
|
290
|
+
const startTime = Date.now();
|
|
291
|
+
|
|
292
|
+
execSync(command, {
|
|
293
|
+
cwd: targetPath,
|
|
294
|
+
encoding: 'utf8',
|
|
295
|
+
stdio: 'inherit',
|
|
296
|
+
timeout: 300000, // 5 minutes
|
|
297
|
+
shell: process.platform === 'win32' ? 'powershell.exe' : '/bin/bash'
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
const duration = Math.round((Date.now() - startTime) / 1000);
|
|
301
|
+
|
|
302
|
+
// Cleanup prompt file
|
|
303
|
+
try {
|
|
304
|
+
unlinkSync(promptFile);
|
|
305
|
+
} catch (e) {
|
|
306
|
+
// Ignore cleanup errors
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
console.log(` ✅ Completed in ${duration}s`);
|
|
310
|
+
|
|
311
|
+
return {
|
|
312
|
+
success: true,
|
|
313
|
+
strategy,
|
|
314
|
+
path: modulePath,
|
|
315
|
+
tool,
|
|
316
|
+
model: actualModel,
|
|
317
|
+
file_count: fileCount,
|
|
318
|
+
duration_seconds: duration,
|
|
319
|
+
message: `CLAUDE.md updated successfully in ${duration}s`
|
|
320
|
+
};
|
|
321
|
+
} catch (error) {
|
|
322
|
+
// Cleanup prompt file on error
|
|
323
|
+
try {
|
|
324
|
+
unlinkSync(promptFile);
|
|
325
|
+
} catch (e) {
|
|
326
|
+
// Ignore cleanup errors
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
console.log(` ❌ Update failed: ${error.message}`);
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
success: false,
|
|
333
|
+
strategy,
|
|
334
|
+
path: modulePath,
|
|
335
|
+
tool,
|
|
336
|
+
model: actualModel,
|
|
337
|
+
error: error.message
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Tool Definition
|
|
344
|
+
*/
|
|
345
|
+
export const updateModuleClaudeTool = {
|
|
346
|
+
name: 'update_module_claude',
|
|
347
|
+
description: `Generate/update CLAUDE.md module documentation using CLI tools.
|
|
348
|
+
|
|
349
|
+
Strategies:
|
|
350
|
+
- single-layer: Read current dir code + child CLAUDE.md, generate ./CLAUDE.md
|
|
351
|
+
- multi-layer: Read all files, generate CLAUDE.md for each directory
|
|
352
|
+
|
|
353
|
+
Tools: gemini (default), qwen, codex`,
|
|
354
|
+
parameters: {
|
|
355
|
+
type: 'object',
|
|
356
|
+
properties: {
|
|
357
|
+
strategy: {
|
|
358
|
+
type: 'string',
|
|
359
|
+
enum: ['single-layer', 'multi-layer'],
|
|
360
|
+
description: 'Generation strategy'
|
|
361
|
+
},
|
|
362
|
+
path: {
|
|
363
|
+
type: 'string',
|
|
364
|
+
description: 'Module directory path'
|
|
365
|
+
},
|
|
366
|
+
tool: {
|
|
367
|
+
type: 'string',
|
|
368
|
+
enum: ['gemini', 'qwen', 'codex'],
|
|
369
|
+
description: 'CLI tool to use (default: gemini)',
|
|
370
|
+
default: 'gemini'
|
|
371
|
+
},
|
|
372
|
+
model: {
|
|
373
|
+
type: 'string',
|
|
374
|
+
description: 'Model name (optional, uses tool defaults)'
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
required: ['strategy', 'path']
|
|
378
|
+
},
|
|
379
|
+
execute
|
|
380
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-workflow",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.1",
|
|
4
4
|
"description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "ccw/src/index.js",
|