diff --git a/.claude/skills/ccw-coordinator/README.md b/.claude/skills/ccw-coordinator/README.md index f2a4fcaf..77a83fb3 100644 --- a/.claude/skills/ccw-coordinator/README.md +++ b/.claude/skills/ccw-coordinator/README.md @@ -40,6 +40,6 @@ | phases/orchestrator.md | 编排逻辑 | | phases/state-schema.md | 状态定义 | | phases/actions/*.md | 动作实现 | -| specs/chain-registry.json | 命令元数据 | -| specs/chain-validation-rules.md | 验证规则 | -| tools/chain-validate.js | 验证工具 | +| specs/specs.md | 命令库、验证规则、注册表 | +| tools/chain-validate.cjs | 验证工具 | +| tools/command-registry.cjs | 命令注册表工具 | diff --git a/.claude/skills/ccw-coordinator/SKILL.md b/.claude/skills/ccw-coordinator/SKILL.md index a934f60e..9da64e18 100644 --- a/.claude/skills/ccw-coordinator/SKILL.md +++ b/.claude/skills/ccw-coordinator/SKILL.md @@ -224,10 +224,9 @@ Bash(`mkdir -p "${workDir}/logs"`); | [phases/actions/action-command-execute.md](phases/actions/action-command-execute.md) | 命令执行动作 | | [phases/actions/action-complete.md](phases/actions/action-complete.md) | 完成动作 | | [phases/actions/action-abort.md](phases/actions/action-abort.md) | 中止动作 | -| [specs/command-library.md](specs/command-library.md) | 命令库 | -| [specs/chain-registry.json](specs/chain-registry.json) | 命令元数据 | -| [specs/chain-validation-rules.md](specs/chain-validation-rules.md) | 验证规则 | -| [tools/chain-validate.js](tools/chain-validate.js) | 验证工具 | +| [specs/specs.md](specs/specs.md) | 命令库、验证规则、注册表 | +| [tools/chain-validate.cjs](tools/chain-validate.cjs) | 验证工具 | +| [tools/command-registry.cjs](tools/command-registry.cjs) | 命令注册表工具 | --- diff --git a/.claude/skills/ccw-coordinator/phases/actions/action-init.md b/.claude/skills/ccw-coordinator/phases/actions/action-init.md index 1a4ca211..2db437a0 100644 --- a/.claude/skills/ccw-coordinator/phases/actions/action-init.md +++ b/.claude/skills/ccw-coordinator/phases/actions/action-init.md @@ -12,6 +12,7 @@ const state = { session_id: `coord-${timestamp}`, status: 'running', started_at: new Date().toISOString(), + task_description: '', command_chain: [], current_command_index: 0, execution_results: [], diff --git a/.claude/skills/ccw-coordinator/specs/specs.md b/.claude/skills/ccw-coordinator/specs/specs.md index 50fa7bb0..ac0e4d4d 100644 --- a/.claude/skills/ccw-coordinator/specs/specs.md +++ b/.claude/skills/ccw-coordinator/specs/specs.md @@ -276,14 +276,14 @@ tdd-plan → lite-execute ## 验证工具 -### chain-validate.js +### chain-validate.cjs -位置: `tools/chain-validate.js` +位置: `tools/chain-validate.cjs` 验证命令链合法性: ```bash -node tools/chain-validate.js plan execute test-cycle-execute +node tools/chain-validate.cjs plan execute test-cycle-execute ``` 输出: diff --git a/.claude/skills/ccw-coordinator/tools/chain-validate.js b/.claude/skills/ccw-coordinator/tools/chain-validate.cjs similarity index 92% rename from .claude/skills/ccw-coordinator/tools/chain-validate.js rename to .claude/skills/ccw-coordinator/tools/chain-validate.cjs index 2f3f119d..9c84594a 100644 --- a/.claude/skills/ccw-coordinator/tools/chain-validate.js +++ b/.claude/skills/ccw-coordinator/tools/chain-validate.cjs @@ -14,9 +14,16 @@ const fs = require('fs'); const path = require('path'); -// Load registry -const registryPath = path.join(__dirname, '..', 'specs', 'chain-registry.json'); -const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8')); +// Optional registry loading - gracefully degrade if not found +let registry = null; +try { + const registryPath = path.join(__dirname, '..', 'specs', 'chain-registry.json'); + if (fs.existsSync(registryPath)) { + registry = JSON.parse(fs.readFileSync(registryPath, 'utf8')); + } +} catch (error) { + // Registry not available - dependency validation will be skipped +} class ChainValidator { constructor(registry) { @@ -161,10 +168,15 @@ class ChainValidator { } validateDependencies(chain) { + // Skip if registry not available + if (!this.registry || !this.registry.commands) { + return; + } + for (let i = 0; i < chain.length; i++) { const cmd = chain[i]; const cmdMeta = this.registry.commands[cmd]; - + if (!cmdMeta) continue; const deps = cmdMeta.dependencies || []; @@ -208,6 +220,11 @@ class ChainValidator { } validateCommandExistence(chain) { + // Skip if registry not available + if (!this.registry || !this.registry.commands) { + return; + } + for (const cmd of chain) { if (!this.registry.commands[cmd]) { this.errors.push({