claude-code-workflow 7.2.29 → 7.3.0

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.
Files changed (169) hide show
  1. package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
  2. package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
  3. package/.claude/agents/action-planning-agent.md +7 -4
  4. package/.claude/agents/cli-explore-agent.md +77 -63
  5. package/.claude/agents/cli-lite-planning-agent.md +11 -10
  6. package/.claude/agents/issue-plan-agent.md +421 -426
  7. package/.claude/commands/workflow/spec/setup.md +1 -1
  8. package/.claude/commands/workflow-skill.md +130 -0
  9. package/.claude/skills/ccw-chain/SKILL.md +92 -0
  10. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +31 -0
  11. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +58 -0
  12. package/.claude/skills/ccw-chain/chains/ccw-issue.json +44 -0
  13. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +71 -0
  14. package/.claude/skills/ccw-chain/chains/ccw-main.json +65 -0
  15. package/.claude/skills/ccw-chain/chains/ccw-standard.json +51 -0
  16. package/.claude/skills/ccw-chain/chains/ccw-team.json +15 -0
  17. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +47 -0
  18. package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
  19. package/.claude/skills/chain-loader/SKILL.md +78 -0
  20. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
  21. package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
  22. package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
  23. package/.claude/skills/chain-loader/specs/chain-schema.md +126 -0
  24. package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
  25. package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
  26. package/.claude/skills/review-cycle/phases/review-module.md +764 -764
  27. package/.claude/skills/review-cycle/phases/review-session.md +775 -775
  28. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
  29. package/.claude/skills/workflow-plan/SKILL.md +1 -0
  30. package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
  31. package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
  32. package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
  33. package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
  34. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
  35. package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
  36. package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
  37. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
  38. package/.codex/skills/analyze-with-file/SKILL.md +383 -134
  39. package/.codex/skills/brainstorm/SKILL.md +3 -3
  40. package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
  41. package/.codex/skills/clean/SKILL.md +1 -1
  42. package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
  43. package/.codex/skills/investigate/orchestrator.md +24 -0
  44. package/.codex/skills/issue-discover/SKILL.md +374 -361
  45. package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
  46. package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
  47. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
  48. package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
  49. package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
  50. package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
  51. package/.codex/skills/review-cycle/SKILL.md +31 -12
  52. package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
  53. package/.codex/skills/security-audit/orchestrator.md +29 -0
  54. package/.codex/skills/session-sync/SKILL.md +1 -1
  55. package/.codex/skills/ship/orchestrator.md +24 -0
  56. package/.codex/skills/spec-add/SKILL.md +5 -5
  57. package/.codex/skills/spec-generator/SKILL.md +33 -2
  58. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
  59. package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
  60. package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
  61. package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
  62. package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
  63. package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
  64. package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
  65. package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
  66. package/.codex/skills/spec-setup/SKILL.md +669 -669
  67. package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
  68. package/.codex/skills/team-brainstorm/SKILL.md +259 -259
  69. package/.codex/skills/team-coordinate/SKILL.md +359 -359
  70. package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
  71. package/.codex/skills/team-designer/SKILL.md +27 -1
  72. package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
  73. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  74. package/.codex/skills/team-designer/phases/04-validation.md +1 -1
  75. package/.codex/skills/team-executor/SKILL.md +218 -218
  76. package/.codex/skills/team-frontend/SKILL.md +227 -227
  77. package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
  78. package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
  79. package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
  80. package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
  81. package/.codex/skills/team-issue/SKILL.md +269 -269
  82. package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
  83. package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
  84. package/.codex/skills/team-motion-design/SKILL.md +222 -222
  85. package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
  86. package/.codex/skills/team-perf-opt/SKILL.md +258 -258
  87. package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
  88. package/.codex/skills/team-planex/SKILL.md +216 -216
  89. package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
  90. package/.codex/skills/team-review/SKILL.md +227 -227
  91. package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
  92. package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
  93. package/.codex/skills/team-tech-debt/SKILL.md +206 -206
  94. package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
  95. package/.codex/skills/team-testing/SKILL.md +237 -237
  96. package/.codex/skills/team-ui-polish/SKILL.md +218 -218
  97. package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
  98. package/.codex/skills/team-uidesign/SKILL.md +219 -219
  99. package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
  100. package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
  101. package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
  102. package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
  103. package/.codex/skills/team-ux-improve/SKILL.md +227 -227
  104. package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
  105. package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
  106. package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
  107. package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
  108. package/.codex/skills/workflow-execute/SKILL.md +5 -5
  109. package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
  110. package/.codex/skills/workflow-plan/SKILL.md +3 -3
  111. package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
  112. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
  113. package/README.md +14 -0
  114. package/ccw/dist/cli.d.ts.map +1 -1
  115. package/ccw/dist/cli.js +16 -0
  116. package/ccw/dist/cli.js.map +1 -1
  117. package/ccw/dist/commands/chain-loader.d.ts +2 -0
  118. package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
  119. package/ccw/dist/commands/chain-loader.js +11 -0
  120. package/ccw/dist/commands/chain-loader.js.map +1 -0
  121. package/ccw/dist/commands/install.d.ts.map +1 -1
  122. package/ccw/dist/commands/install.js +52 -1
  123. package/ccw/dist/commands/install.js.map +1 -1
  124. package/ccw/dist/commands/launcher.d.ts +2 -0
  125. package/ccw/dist/commands/launcher.d.ts.map +1 -0
  126. package/ccw/dist/commands/launcher.js +434 -0
  127. package/ccw/dist/commands/launcher.js.map +1 -0
  128. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  129. package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
  130. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  131. package/ccw/dist/tools/chain-loader.d.ts +10 -0
  132. package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
  133. package/ccw/dist/tools/chain-loader.js +1054 -0
  134. package/ccw/dist/tools/chain-loader.js.map +1 -0
  135. package/ccw/dist/tools/index.d.ts.map +1 -1
  136. package/ccw/dist/tools/index.js +2 -0
  137. package/ccw/dist/tools/index.js.map +1 -1
  138. package/ccw/dist/tools/json-builder.js +20 -0
  139. package/ccw/dist/tools/json-builder.js.map +1 -1
  140. package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
  141. package/ccw/dist/tools/skill-context-loader.js +12 -26
  142. package/ccw/dist/tools/skill-context-loader.js.map +1 -1
  143. package/ccw/dist/types/chain-types.d.ts +112 -0
  144. package/ccw/dist/types/chain-types.d.ts.map +1 -0
  145. package/ccw/dist/types/chain-types.js +5 -0
  146. package/ccw/dist/types/chain-types.js.map +1 -0
  147. package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
  148. package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
  149. package/ccw/dist/utils/chain-visualizer.js +164 -0
  150. package/ccw/dist/utils/chain-visualizer.js.map +1 -0
  151. package/ccw/scripts/prepublish-clean.mjs +0 -1
  152. package/package.json +1 -3
  153. package/.claude/commands/cli/cli-init.md +0 -441
  154. package/.claude/commands/cli/codex-review.md +0 -361
  155. package/.claude/commands/flow-create.md +0 -663
  156. package/.claude/skills/team-edict.zip +0 -0
  157. package/ccw-litellm/README.md +0 -180
  158. package/ccw-litellm/pyproject.toml +0 -35
  159. package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
  160. package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
  161. package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
  162. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
  163. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
  164. package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
  165. package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
  166. package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
  167. package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
  168. package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
  169. package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "recommended_execution": {
40
40
  "type": "string",
41
- "enum": ["Agent", "Codex"],
42
- "description": "推荐执行方式"
41
+ "enum": ["Agent", "Codex", "Sequential", "Parallel", "Phased"],
42
+ "description": "推荐执行方式 (工具: Agent/Codex, 策略: Sequential/Parallel/Phased)"
43
43
  },
44
44
 
45
45
  "data_flow": {
@@ -25,7 +25,7 @@
25
25
  "_comment_CLASSIFICATION": "CLASSIFICATION 区块 (可选) — 任务分类",
26
26
  "type": {
27
27
  "type": "string",
28
- "enum": ["infrastructure", "feature", "enhancement", "fix", "refactor", "testing", "docs", "chore"],
28
+ "enum": ["infrastructure", "feature", "enhancement", "fix", "bugfix", "refactor", "testing", "test-gen", "test-fix", "docs", "chore"],
29
29
  "description": "任务类型"
30
30
  },
31
31
  "priority": {
@@ -148,8 +148,13 @@
148
148
  "type": "object",
149
149
  "required": ["step", "description"],
150
150
  "properties": {
151
- "step": { "type": "string", "description": "步骤编号/名称" },
151
+ "step": { "oneOf": [{ "type": "string" }, { "type": "integer" }], "description": "步骤编号/名称" },
152
+ "title": { "type": "string", "description": "步骤标题" },
152
153
  "description": { "type": "string", "description": "步骤描述" },
154
+ "modification_points": { "type": "array", "items": { "type": "string" }, "description": "量化修改点 (文件/函数/行数)" },
155
+ "logic_flow": { "type": "array", "items": { "type": "string" }, "description": "实施逻辑序列" },
156
+ "depends_on": { "type": "array", "items": { "oneOf": [{ "type": "string" }, { "type": "integer" }] }, "description": "依赖步骤" },
157
+ "output": { "type": "string", "description": "输出变量名" },
153
158
  "tdd_phase": { "type": "string", "enum": ["red", "green", "refactor"], "description": "TDD 阶段" },
154
159
  "actions": { "type": "array", "items": { "type": "string" }, "description": "具体操作列表" },
155
160
  "test_fix_cycle": {
@@ -164,15 +169,17 @@
164
169
  }
165
170
  ]
166
171
  },
167
- "description": "步骤化实施指南 — 支持字符串 (简单步骤) 或对象 (含 TDD 阶段等详情)"
172
+ "description": "步骤化实施指南 — 支持字符串 (简单步骤) 或对象 (含 modification_points/logic_flow/TDD 阶段等详情)"
168
173
  },
169
174
  "test": {
170
175
  "type": "object",
171
176
  "properties": {
172
177
  "commands": {
173
- "type": "array",
174
- "items": { "type": "string" },
175
- "description": "测试命令"
178
+ "oneOf": [
179
+ { "type": "array", "items": { "type": "string" } },
180
+ { "type": "object", "additionalProperties": { "type": "string" } }
181
+ ],
182
+ "description": "测试命令 (数组或命名对象如 {run_tests, run_coverage, run_specific})"
176
183
  },
177
184
  "unit": {
178
185
  "type": "array",
@@ -513,7 +520,7 @@
513
520
  "_comment_RUNTIME": "RUNTIME 区块 (执行时填充) — 运行时状态",
514
521
  "status": {
515
522
  "type": "string",
516
- "enum": ["pending", "in_progress", "completed", "failed", "skipped", "blocked"],
523
+ "enum": ["pending", "in_progress", "active", "completed", "failed", "skipped", "blocked"],
517
524
  "default": "pending",
518
525
  "description": "执行状态 (执行引擎填充)"
519
526
  },
@@ -829,11 +829,14 @@ Generate at `.workflow/active/{session_id}/plan.json` following `plan-overview-b
829
829
 
830
830
  **Generation Timing**: After all `.task/IMPL-*.json` files are generated, aggregate into plan.json.
831
831
 
832
- **Validation**: After writing plan.json and task files, validate with json_builder:
833
- ```bash
834
- ccw tool exec json_builder '{"cmd":"validate","target":"<session>/plan.json","schema":"plan"}'
835
- ccw tool exec json_builder '{"cmd":"validate","target":"<session>/.task/IMPL-001.json","schema":"task"}'
832
+ **Schema Reference Fallback** (resolve enum/field conflicts):
833
+
834
+ If unsure about field enums or structure, read authoritative schema files before generating:
835
+ ```
836
+ Read(~/.ccw/workflows/cli-templates/schemas/task-schema.json)
837
+ Read(~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json)
836
838
  ```
839
+ Rule: If this agent doc's inline examples conflict with schema file → **schema file wins**.
837
840
 
838
841
  ### 2.3 IMPL_PLAN.md Structure
839
842
 
@@ -5,7 +5,6 @@ description: |
5
5
  Orchestrates 4-phase workflow: Task Understanding → Analysis Execution → Schema Validation → Output Generation.
6
6
  Spawned by /explore command orchestrator.
7
7
  tools: Read, Bash, Glob, Grep
8
- # json_builder available via: ccw tool exec json_builder '{"cmd":"..."}' (Bash)
9
8
  color: yellow
10
9
  ---
11
10
 
@@ -67,9 +66,9 @@ Phase 4: Output Generation
67
66
  Store result as `project_structure` for module-aware file discovery in Phase 2.
68
67
 
69
68
  2. **Output Schema Loading** (if output file path specified in prompt):
70
- - Get schema summary: `ccw tool exec json_builder '{"cmd":"info","schema":"explore"}'` (or "diagnosis" for bug analysis)
71
- - Initialize output file: `ccw tool exec json_builder '{"cmd":"init","schema":"explore","output":"<output_path>"}'`
72
- - The tool returns requiredFields, arrayFields, and enumFields memorize these for Phase 2.
69
+ - Exploration output `cat ~/.ccw/workflows/cli-templates/schemas/explore-json-schema.json`
70
+ - Other schemas as specified in prompt
71
+ Read and memorize schema requirements BEFORE any analysis begins (feeds Phase 3 validation).
73
72
 
74
73
  3. **Project Context Loading** (from spec system):
75
74
  - Load exploration specs using: `ccw spec load --category exploration`
@@ -151,56 +150,55 @@ RULES: {from prompt, if template specified} | analysis=READ-ONLY
151
150
  ---
152
151
 
153
152
  <schema_validation>
154
- ## Phase 3: Incremental Build & Validation (via json_builder)
153
+ ## Phase 3: Schema Validation
155
154
 
156
- **This phase replaces manual JSON writing + self-validation with tool-assisted construction.**
155
+ ### CRITICAL: Schema Compliance Protocol
157
156
 
158
- **Step 1: Set text fields** (discovered during Phase 2 analysis)
159
- ```bash
160
- ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
161
- {"path":"project_structure","value":"..."},
162
- {"path":"patterns","value":"..."},
163
- {"path":"dependencies","value":"..."},
164
- {"path":"integration_points","value":"..."},
165
- {"path":"constraints","value":"..."}
166
- ]}'
167
- ```
168
-
169
- **Step 2: Append file entries** (as discovered — one `set` per batch)
170
- ```bash
171
- ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
172
- {"path":"relevant_files[+]","value":{"path":"src/auth.ts","relevance":0.9,"rationale":"Contains AuthService.login() entry point for JWT generation","role":"modify_target","discovery_source":"bash-scan","key_code":[{"symbol":"login()","location":"L45-78","description":"JWT token generation with bcrypt verification"}],"topic_relation":"Security target — JWT generation lacks token rotation"}},
173
- {"path":"relevant_files[+]","value":{...}}
174
- ]}'
175
- ```
157
+ **This phase is MANDATORY when schema file is specified in prompt.**
176
158
 
177
- The tool **automatically validates** each operation:
178
- - enum values (role, discovery_source) → rejects invalid
179
- - minLength (rationale >= 10) → rejects too short
180
- - type checking → rejects wrong types
181
-
182
- **Step 3: Set metadata**
183
- ```bash
184
- ccw tool exec json_builder '{"cmd":"set","target":"<output_path>","ops":[
185
- {"path":"_metadata.timestamp","value":"auto"},
186
- {"path":"_metadata.task_description","value":"..."},
187
- {"path":"_metadata.source","value":"cli-explore-agent"},
188
- {"path":"_metadata.exploration_angle","value":"..."},
189
- {"path":"_metadata.exploration_index","value":1},
190
- {"path":"_metadata.total_explorations","value":2}
191
- ]}'
159
+ **Step 1: Read Schema FIRST**
192
160
  ```
193
-
194
- **Step 4: Final validation**
195
- ```bash
196
- ccw tool exec json_builder '{"cmd":"validate","target":"<output_path>"}'
161
+ Read(schema_file_path)
197
162
  ```
198
- Returns `{valid, errors, warnings, stats}`. If errors exist → fix with `set` → re-validate.
199
163
 
200
- **Quality reminders** (enforced by tool, but be aware):
201
- - `rationale`: Must be specific, not generic ("Related to auth" → rejected by semantic check)
202
- - `key_code`: Strongly recommended for relevance >= 0.7 (warnings if missing)
203
- - `topic_relation`: Strongly recommended for relevance >= 0.7 (warnings if missing)
164
+ **Step 2: Extract Schema Requirements**
165
+
166
+ Parse and memorize:
167
+ 1. **Root structure** - Is it array `[...]` or object `{...}`?
168
+ 2. **Required fields** - List all `"required": [...]` arrays
169
+ 3. **Field names EXACTLY** - Copy character-by-character (case-sensitive)
170
+ 4. **Enum values** - Copy exact strings (e.g., `"critical"` not `"Critical"`)
171
+ 5. **Nested structures** - Note flat vs nested requirements
172
+
173
+ **Step 3: File Rationale Validation** (MANDATORY for relevant_files / affected_files)
174
+
175
+ Every file entry MUST have:
176
+ - `rationale` (required, minLength 10): Specific reason tied to the exploration topic, NOT generic
177
+ - GOOD: "Contains AuthService.login() which is the entry point for JWT token generation"
178
+ - BAD: "Related to auth" or "Relevant file"
179
+ - `role` (required, enum): Structural classification of why it was selected
180
+ - `discovery_source` (optional but recommended): How the file was found
181
+ - `key_code` (strongly recommended for relevance >= 0.7): Array of {symbol, location?, description}
182
+ - GOOD: [{"symbol": "AuthService.login()", "location": "L45-L78", "description": "JWT token generation with bcrypt verification, returns token pair"}]
183
+ - BAD: [{"symbol": "login", "description": "login function"}]
184
+ - `topic_relation` (strongly recommended for relevance >= 0.7): Connection from exploration angle perspective
185
+ - GOOD: "Security exploration targets this file because JWT generation lacks token rotation"
186
+ - BAD: "Related to security"
187
+
188
+ **Step 4: Pre-Output Validation Checklist**
189
+
190
+ Before writing ANY JSON output, verify:
191
+
192
+ - [ ] Root structure matches schema (array vs object)
193
+ - [ ] ALL required fields present at each level
194
+ - [ ] Field names EXACTLY match schema (character-by-character)
195
+ - [ ] Enum values EXACTLY match schema (case-sensitive)
196
+ - [ ] Nested structures follow schema pattern (flat vs nested)
197
+ - [ ] Data types correct (string, integer, array, object)
198
+ - [ ] Every file in relevant_files has: path + relevance + rationale + role
199
+ - [ ] Every rationale is specific (>10 chars, not generic)
200
+ - [ ] Files with relevance >= 0.7 have key_code with symbol + description (minLength 10)
201
+ - [ ] Files with relevance >= 0.7 have topic_relation explaining connection to angle (minLength 15)
204
202
  </schema_validation>
205
203
 
206
204
  ---
@@ -214,12 +212,16 @@ Brief summary:
214
212
  - Task completion status
215
213
  - Key findings summary
216
214
  - Generated file paths (if any)
217
- - Validation result (from Phase 3 Step 4)
218
215
 
219
- ### File Output
216
+ ### File Output (as specified in prompt)
217
+
218
+ **MANDATORY WORKFLOW**:
220
219
 
221
- File is already written by json_builder during Phase 3 (init + set operations).
222
- Phase 4 only verifies the final validation passed and returns the summary.
220
+ 1. `Read()` schema file BEFORE generating output
221
+ 2. Extract ALL field names from schema
222
+ 3. Build JSON using ONLY schema field names
223
+ 4. Validate against checklist before writing
224
+ 5. Write file with validated content
223
225
  </output_generation>
224
226
 
225
227
  ---
@@ -241,19 +243,28 @@ Phase 4 only verifies the final validation passed and returns the summary.
241
243
 
242
244
  **ALWAYS**:
243
245
  1. **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`)
244
- 2. **Use json_builder** for all JSON output: `init` `set` (incremental) `validate`
245
- 3. Include file:line references in findings
246
- 4. **Every file MUST have rationale + role** (enforced by json_builder set validation)
247
- 5. **Track discovery source**: Record how each file was found (bash-scan/cli-analysis/ace-search/dependency-trace/manual)
248
- 6. **Populate key_code + topic_relation for high-relevance files** (relevance >= 0.7; json_builder warns if missing)
246
+ 2. Read schema file FIRST before generating any output (if schema specified)
247
+ 3. Copy field names EXACTLY from schema (case-sensitive)
248
+ 4. Verify root structure matches schema (array vs object)
249
+ 5. Match nested/flat structures as schema requires
250
+ 6. Use exact enum values from schema (case-sensitive)
251
+ 7. Include ALL required fields at every level
252
+ 8. Include file:line references in findings
253
+ 9. **Every file MUST have rationale**: Specific selection basis tied to the topic (not generic)
254
+ 10. **Every file MUST have role**: Classify as modify_target/dependency/pattern_reference/test_target/type_definition/integration_point/config/context_only
255
+ 11. **Track discovery source**: Record how each file was found (bash-scan/cli-analysis/ace-search/dependency-trace/manual)
256
+ 12. **Populate key_code for high-relevance files**: relevance >= 0.7 → key_code array with symbol, location, description
257
+ 13. **Populate topic_relation for high-relevance files**: relevance >= 0.7 → topic_relation explaining file-to-angle connection
249
258
 
250
259
  **Bash Tool**:
251
260
  - Use `run_in_background=false` for all Bash/CLI calls to ensure foreground execution
252
261
 
253
262
  **NEVER**:
254
- 1. Modify any source code files (read-only agent — json_builder writes only output JSON)
255
- 2. Hand-write JSON output always use json_builder
256
- 3. Skip the `validate` step before returning
263
+ 1. Modify any files (read-only agent)
264
+ 2. Skip schema reading step when schema is specified
265
+ 3. Guess field names - ALWAYS copy from schema
266
+ 4. Assume structure - ALWAYS verify against schema
267
+ 5. Omit required fields
257
268
  </operational_rules>
258
269
 
259
270
  <output_contract>
@@ -271,8 +282,11 @@ When exploration is complete, return one of:
271
282
 
272
283
  Before returning, verify:
273
284
  - [ ] All 4 phases were executed (or skipped with justification)
274
- - [ ] json_builder `init` was called at start
275
- - [ ] json_builder `validate` returned `valid: true` (or all errors were fixed)
285
+ - [ ] Schema was read BEFORE output generation (if schema specified)
286
+ - [ ] All field names match schema exactly (case-sensitive)
287
+ - [ ] Every file entry has rationale (specific, >10 chars) and role
288
+ - [ ] High-relevance files (>= 0.7) have key_code and topic_relation
276
289
  - [ ] Discovery sources are tracked for all findings
277
- - [ ] No source code files were modified (read-only agent)
290
+ - [ ] No files were modified (read-only agent)
291
+ - [ ] Output format matches schema root structure (array vs object)
278
292
  </quality_gate>
@@ -139,15 +139,16 @@ When `process_docs: true`, generate planning-context.md before sub-plan.json:
139
139
 
140
140
  ## Schema-Driven Output
141
141
 
142
- **CRITICAL**: Get schema info via json_builder to determine output structure:
143
- - `ccw tool exec json_builder '{"cmd":"info","schema":"plan"}'` → Implementation plan with `approach`, `complexity`
144
- - `ccw tool exec json_builder '{"cmd":"info","schema":"plan-fix"}'` → Fix plan with `root_cause`, `severity`, `risk_level`
142
+ **CRITICAL**: Read the schema reference first to determine output structure:
143
+ - `plan-overview-base-schema.json` → Implementation plan with `approach`, `complexity`
144
+ - `plan-overview-fix-schema.json` → Fix plan with `root_cause`, `severity`, `risk_level`
145
145
 
146
- After generating plan.json and .task/*.json, validate:
147
- ```bash
148
- ccw tool exec json_builder '{"cmd":"validate","target":"<session>/plan.json","schema":"plan"}'
149
- # For each task file:
150
- ccw tool exec json_builder '{"cmd":"validate","target":"<session>/.task/TASK-001.json","schema":"task"}'
146
+ ```javascript
147
+ // Step 1: Always read schema first
148
+ const schema = Bash(`cat ${schema_path}`)
149
+
150
+ // Step 2: Generate plan conforming to schema
151
+ const planObject = generatePlanFromSchema(schema, context)
151
152
  ```
152
153
 
153
154
  </schema_driven_output>
@@ -862,7 +863,7 @@ function validateTask(task) {
862
863
 
863
864
  **ALWAYS**:
864
865
  - **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`)
865
- - **Get schema info via json_builder** to determine output structure
866
+ - **Read schema first** to determine output structure
866
867
  - Generate task IDs (TASK-001/TASK-002 for plan, FIX-001/FIX-002 for fix-plan)
867
868
  - Include depends_on (even if empty [])
868
869
  - **Assign cli_execution_id** (`{sessionId}-{taskId}`)
@@ -980,7 +981,7 @@ Upon completion, return one of:
980
981
 
981
982
  Before returning, verify:
982
983
 
983
- - [ ] Schema info was obtained via json_builder and output structure matches schema type (base vs fix)
984
+ - [ ] Schema reference was read and output structure matches schema type (base vs fix)
984
985
  - [ ] All tasks have valid IDs (TASK-NNN or FIX-NNN format)
985
986
  - [ ] All tasks have 2+ implementation steps
986
987
  - [ ] All convergence criteria are quantified and testable (no vague language)