claude-code-workflow 6.3.36 → 6.3.38
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/lite-execute.md +2 -0
- package/.claude/commands/workflow/lite-fix.md +108 -9
- package/.claude/skills/ccw-loop/README.md +303 -0
- package/.claude/skills/ccw-loop/SKILL.md +259 -0
- package/.claude/skills/ccw-loop/phases/actions/action-complete.md +320 -0
- package/.claude/skills/ccw-loop/phases/actions/action-debug-with-file.md +485 -0
- package/.claude/skills/ccw-loop/phases/actions/action-develop-with-file.md +365 -0
- package/.claude/skills/ccw-loop/phases/actions/action-init.md +200 -0
- package/.claude/skills/ccw-loop/phases/actions/action-menu.md +192 -0
- package/.claude/skills/ccw-loop/phases/actions/action-validate-with-file.md +307 -0
- package/.claude/skills/ccw-loop/phases/orchestrator.md +486 -0
- package/.claude/skills/ccw-loop/phases/state-schema.md +474 -0
- package/.claude/skills/ccw-loop/specs/action-catalog.md +300 -0
- package/.claude/skills/ccw-loop/specs/loop-requirements.md +192 -0
- package/.claude/skills/ccw-loop/templates/progress-template.md +175 -0
- package/.claude/skills/ccw-loop/templates/understanding-template.md +303 -0
- package/.claude/skills/ccw-loop/templates/validation-template.md +258 -0
- package/.codex/agents/action-planning-agent.md +885 -0
- package/.codex/agents/ccw-loop-executor.md +260 -0
- package/.codex/agents/cli-discuss-agent.md +391 -0
- package/.codex/agents/cli-execution-agent.md +333 -0
- package/.codex/agents/cli-explore-agent.md +186 -0
- package/.codex/agents/cli-lite-planning-agent.md +736 -0
- package/.codex/agents/cli-planning-agent.md +562 -0
- package/.codex/agents/code-developer.md +408 -0
- package/.codex/agents/conceptual-planning-agent.md +321 -0
- package/.codex/agents/context-search-agent.md +585 -0
- package/.codex/agents/debug-explore-agent.md +436 -0
- package/.codex/agents/doc-generator.md +334 -0
- package/.codex/agents/issue-plan-agent.md +417 -0
- package/.codex/agents/issue-queue-agent.md +311 -0
- package/.codex/agents/memory-bridge.md +96 -0
- package/.codex/agents/test-context-search-agent.md +402 -0
- package/.codex/agents/test-fix-agent.md +359 -0
- package/.codex/agents/ui-design-agent.md +595 -0
- package/.codex/agents/universal-executor.md +135 -0
- package/.codex/prompts/issue-discover-by-prompt.md +364 -0
- package/.codex/prompts/issue-discover.md +261 -0
- package/.codex/prompts/issue-execute.md +10 -0
- package/.codex/prompts/issue-new.md +285 -0
- package/.codex/prompts/issue-plan.md +161 -63
- package/.codex/prompts/issue-queue.md +298 -288
- package/.codex/prompts/lite-execute.md +627 -133
- package/.codex/prompts/lite-fix.md +670 -0
- package/.codex/prompts/lite-plan-a.md +337 -0
- package/.codex/prompts/lite-plan-b.md +485 -0
- package/.codex/prompts/{lite-plan.md → lite-plan-c.md} +601 -469
- package/.codex/skills/ccw-loop/README.md +171 -0
- package/.codex/skills/ccw-loop/SKILL.md +349 -0
- package/.codex/skills/ccw-loop/phases/actions/action-complete.md +269 -0
- package/.codex/skills/ccw-loop/phases/actions/action-debug.md +286 -0
- package/.codex/skills/ccw-loop/phases/actions/action-develop.md +183 -0
- package/.codex/skills/ccw-loop/phases/actions/action-init.md +164 -0
- package/.codex/skills/ccw-loop/phases/actions/action-menu.md +205 -0
- package/.codex/skills/ccw-loop/phases/actions/action-validate.md +250 -0
- package/.codex/skills/ccw-loop/phases/orchestrator.md +416 -0
- package/.codex/skills/ccw-loop/phases/state-schema.md +388 -0
- package/.codex/skills/ccw-loop/specs/action-catalog.md +182 -0
- package/.codex/skills/ccw-loop-b/README.md +102 -0
- package/.codex/skills/ccw-loop-b/SKILL.md +322 -0
- package/.codex/skills/ccw-loop-b/phases/orchestrator.md +257 -0
- package/.codex/skills/ccw-loop-b/phases/state-schema.md +181 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +12 -1
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +14 -1
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +38 -7
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +3 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +107 -0
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/commands/loop.d.ts +10 -0
- package/ccw/dist/commands/loop.d.ts.map +1 -0
- package/ccw/dist/commands/loop.js +289 -0
- package/ccw/dist/commands/loop.js.map +1 -0
- package/ccw/dist/commands/upgrade.js +1 -1
- package/ccw/dist/commands/upgrade.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +3 -2
- package/ccw/dist/config/litellm-api-config-manager.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/memory-embedder-bridge.d.ts.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.js +2 -5
- package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
- package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/claude-routes.js +5 -3
- package/ccw/dist/core/routes/claude-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts +6 -0
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +42 -13
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/cli-settings-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-settings-routes.js +44 -0
- package/ccw/dist/core/routes/cli-settings-routes.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.js +7 -6
- package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js +5 -4
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
- package/ccw/dist/core/routes/core-memory-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/core-memory-routes.js +4 -2
- package/ccw/dist/core/routes/core-memory-routes.js.map +1 -1
- package/ccw/dist/core/routes/files-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/files-routes.js +4 -2
- package/ccw/dist/core/routes/files-routes.js.map +1 -1
- package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/graph-routes.js +17 -2
- package/ccw/dist/core/routes/graph-routes.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +280 -33
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/core/routes/loop-routes.d.ts +24 -0
- package/ccw/dist/core/routes/loop-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/loop-routes.js +334 -0
- package/ccw/dist/core/routes/loop-routes.js.map +1 -0
- package/ccw/dist/core/routes/loop-v2-routes.d.ts +44 -0
- package/ccw/dist/core/routes/loop-v2-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/loop-v2-routes.js +1260 -0
- package/ccw/dist/core/routes/loop-v2-routes.js.map +1 -0
- package/ccw/dist/core/routes/memory-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/memory-routes.js +2 -1
- package/ccw/dist/core/routes/memory-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +3 -2
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/routes/task-routes.d.ts +12 -0
- package/ccw/dist/core/routes/task-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/task-routes.js +321 -0
- package/ccw/dist/core/routes/task-routes.js.map +1 -0
- package/ccw/dist/core/routes/test-loop-routes.d.ts +11 -0
- package/ccw/dist/core/routes/test-loop-routes.d.ts.map +1 -0
- package/ccw/dist/core/routes/test-loop-routes.js +298 -0
- package/ccw/dist/core/routes/test-loop-routes.js.map +1 -0
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +47 -5
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/core/websocket.d.ts +59 -0
- package/ccw/dist/core/websocket.d.ts.map +1 -1
- package/ccw/dist/core/websocket.js +34 -0
- package/ccw/dist/core/websocket.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts +40 -0
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +119 -0
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.js +2 -5
- package/ccw/dist/tools/codex-lens-lsp.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +22 -32
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/dist/tools/litellm-client.d.ts +6 -0
- package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-client.js +15 -2
- package/ccw/dist/tools/litellm-client.js.map +1 -1
- package/ccw/dist/tools/loop-manager.d.ts +84 -0
- package/ccw/dist/tools/loop-manager.d.ts.map +1 -0
- package/ccw/dist/tools/loop-manager.js +425 -0
- package/ccw/dist/tools/loop-manager.js.map +1 -0
- package/ccw/dist/tools/loop-state-manager.d.ts +47 -0
- package/ccw/dist/tools/loop-state-manager.d.ts.map +1 -0
- package/ccw/dist/tools/loop-state-manager.js +149 -0
- package/ccw/dist/tools/loop-state-manager.js.map +1 -0
- package/ccw/dist/tools/loop-task-manager.d.ts +149 -0
- package/ccw/dist/tools/loop-task-manager.d.ts.map +1 -0
- package/ccw/dist/tools/loop-task-manager.js +270 -0
- package/ccw/dist/tools/loop-task-manager.js.map +1 -0
- package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
- package/ccw/dist/tools/native-session-discovery.js +35 -7
- package/ccw/dist/tools/native-session-discovery.js.map +1 -1
- package/ccw/dist/types/index.d.ts +1 -0
- package/ccw/dist/types/index.d.ts.map +1 -1
- package/ccw/dist/types/index.js +1 -0
- package/ccw/dist/types/index.js.map +1 -1
- package/ccw/dist/types/loop.d.ts +257 -0
- package/ccw/dist/types/loop.d.ts.map +1 -0
- package/ccw/dist/types/loop.js +17 -0
- package/ccw/dist/types/loop.js.map +1 -0
- package/ccw/dist/utils/codexlens-path.d.ts +36 -0
- package/ccw/dist/utils/codexlens-path.d.ts.map +1 -0
- package/ccw/dist/utils/codexlens-path.js +56 -0
- package/ccw/dist/utils/codexlens-path.js.map +1 -0
- package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
- package/ccw/dist/utils/uv-manager.js +3 -2
- package/ccw/dist/utils/uv-manager.js.map +1 -1
- package/ccw/src/cli.ts +13 -1
- package/ccw/src/commands/cli.ts +14 -1
- package/ccw/src/commands/install.ts +50 -7
- package/ccw/src/commands/issue.ts +119 -0
- package/ccw/src/commands/loop.ts +344 -0
- package/ccw/src/commands/upgrade.ts +1 -1
- package/ccw/src/config/litellm-api-config-manager.ts +3 -2
- package/ccw/src/core/dashboard-generator.ts +4 -1
- package/ccw/src/core/memory-embedder-bridge.ts +2 -6
- package/ccw/src/core/routes/claude-routes.ts +5 -3
- package/ccw/src/core/routes/cli-routes.ts +48 -16
- package/ccw/src/core/routes/cli-settings-routes.ts +47 -0
- package/ccw/src/core/routes/codexlens/config-handlers.ts +7 -6
- package/ccw/src/core/routes/codexlens/semantic-handlers.ts +5 -4
- package/ccw/src/core/routes/core-memory-routes.ts +4 -2
- package/ccw/src/core/routes/files-routes.ts +4 -2
- package/ccw/src/core/routes/graph-routes.ts +18 -2
- package/ccw/src/core/routes/issue-routes.ts +308 -33
- package/ccw/src/core/routes/loop-routes.ts +386 -0
- package/ccw/src/core/routes/loop-v2-routes.ts +1470 -0
- package/ccw/src/core/routes/memory-routes.ts +2 -1
- package/ccw/src/core/routes/system-routes.ts +3 -2
- package/ccw/src/core/routes/task-routes.ts +361 -0
- package/ccw/src/core/routes/test-loop-routes.ts +312 -0
- package/ccw/src/core/server.ts +49 -5
- package/ccw/src/core/websocket.ts +104 -0
- package/ccw/src/templates/dashboard-css/02-session.css +2 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +103 -1
- package/ccw/src/templates/dashboard-css/12-cli-legacy.css +56 -0
- package/ccw/src/templates/dashboard-css/32-issue-manager.css +32 -0
- package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +55 -0
- package/ccw/src/templates/dashboard-css/36-loop-monitor.css +1896 -0
- package/ccw/src/templates/dashboard-css/36-loop-monitor.css.backup +1877 -0
- package/ccw/src/templates/dashboard-js/components/cli-history.js +48 -48
- package/ccw/src/templates/dashboard-js/components/cli-status.js +64 -3
- package/ccw/src/templates/dashboard-js/components/cli-stream-viewer.js +251 -110
- package/ccw/src/templates/dashboard-js/components/navigation.js +16 -0
- package/ccw/src/templates/dashboard-js/components/notifications.js +22 -0
- package/ccw/src/templates/dashboard-js/components/version-check.js +38 -0
- package/ccw/src/templates/dashboard-js/i18n.js +601 -1
- package/ccw/src/templates/dashboard-js/state.js +2 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +4 -3
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +183 -1
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +55 -11
- package/ccw/src/templates/dashboard-js/views/loop-monitor.js +3345 -0
- package/ccw/src/templates/dashboard.html +68 -4
- package/ccw/src/tools/claude-cli-tools.ts +143 -0
- package/ccw/src/tools/codex-lens-lsp.ts +2 -5
- package/ccw/src/tools/codex-lens.ts +27 -38
- package/ccw/src/tools/litellm-client.ts +16 -2
- package/ccw/src/tools/loop-manager.ts +519 -0
- package/ccw/src/tools/loop-state-manager.ts +173 -0
- package/ccw/src/tools/loop-task-manager.ts +391 -0
- package/ccw/src/tools/native-session-discovery.ts +38 -7
- package/ccw/src/types/index.ts +1 -0
- package/ccw/src/types/loop.ts +316 -0
- package/ccw/src/utils/codexlens-path.ts +60 -0
- package/ccw/src/utils/uv-manager.ts +3 -2
- package/package.json +1 -1
|
@@ -390,6 +390,8 @@ ${t.verification?.success_metrics?.length > 0 ? `\n**Success metrics**: ${t.veri
|
|
|
390
390
|
if (executionContext?.session?.artifacts?.plan) {
|
|
391
391
|
context.push(`### Artifacts\nPlan: ${executionContext.session.artifacts.plan}`)
|
|
392
392
|
}
|
|
393
|
+
// Project guidelines (user-defined constraints from /workflow:session:solidify)
|
|
394
|
+
context.push(`### Project Guidelines\n@.workflow/project-guidelines.json`)
|
|
393
395
|
if (context.length > 0) sections.push(`## Context\n${context.join('\n\n')}`)
|
|
394
396
|
|
|
395
397
|
sections.push(`Complete each task according to its "Done when" checklist.`)
|
|
@@ -380,6 +380,7 @@ if (uniqueClarifications.length > 0) {
|
|
|
380
380
|
const schema = Bash(`cat ~/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json`)
|
|
381
381
|
|
|
382
382
|
// Step 2: Generate fix-plan following schema (Claude directly, no agent)
|
|
383
|
+
// For Medium complexity: include rationale + verification (optional, but recommended)
|
|
383
384
|
const fixPlan = {
|
|
384
385
|
summary: "...",
|
|
385
386
|
root_cause: "...",
|
|
@@ -389,13 +390,67 @@ const fixPlan = {
|
|
|
389
390
|
recommended_execution: "Agent",
|
|
390
391
|
severity: severity,
|
|
391
392
|
risk_level: "...",
|
|
392
|
-
|
|
393
|
+
|
|
394
|
+
// Medium complexity fields (optional for direct planning, auto-filled for Low)
|
|
395
|
+
...(severity === "Medium" ? {
|
|
396
|
+
design_decisions: [
|
|
397
|
+
{
|
|
398
|
+
decision: "Use immediate_patch strategy for minimal risk",
|
|
399
|
+
rationale: "Keeps changes localized and quick to review",
|
|
400
|
+
tradeoff: "Defers comprehensive refactoring"
|
|
401
|
+
}
|
|
402
|
+
],
|
|
403
|
+
tasks_with_rationale: {
|
|
404
|
+
// Each task gets rationale if Medium
|
|
405
|
+
task_rationale_example: {
|
|
406
|
+
rationale: {
|
|
407
|
+
chosen_approach: "Direct fix approach",
|
|
408
|
+
alternatives_considered: ["Workaround", "Refactor"],
|
|
409
|
+
decision_factors: ["Minimal impact", "Quick turnaround"],
|
|
410
|
+
tradeoffs: "Doesn't address underlying issue"
|
|
411
|
+
},
|
|
412
|
+
verification: {
|
|
413
|
+
unit_tests: ["test_bug_fix_basic"],
|
|
414
|
+
integration_tests: [],
|
|
415
|
+
manual_checks: ["Reproduce issue", "Verify fix"],
|
|
416
|
+
success_metrics: ["Issue resolved", "No regressions"]
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
} : {}),
|
|
421
|
+
|
|
422
|
+
_metadata: {
|
|
423
|
+
timestamp: getUtc8ISOString(),
|
|
424
|
+
source: "direct-planning",
|
|
425
|
+
planning_mode: "direct",
|
|
426
|
+
complexity: severity === "Medium" ? "Medium" : "Low"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Step 3: Merge task rationale into tasks array
|
|
431
|
+
if (severity === "Medium") {
|
|
432
|
+
fixPlan.tasks = fixPlan.tasks.map(task => ({
|
|
433
|
+
...task,
|
|
434
|
+
rationale: fixPlan.tasks_with_rationale[task.id]?.rationale || {
|
|
435
|
+
chosen_approach: "Standard fix",
|
|
436
|
+
alternatives_considered: [],
|
|
437
|
+
decision_factors: ["Correctness", "Simplicity"],
|
|
438
|
+
tradeoffs: "None"
|
|
439
|
+
},
|
|
440
|
+
verification: fixPlan.tasks_with_rationale[task.id]?.verification || {
|
|
441
|
+
unit_tests: [`test_${task.id}_basic`],
|
|
442
|
+
integration_tests: [],
|
|
443
|
+
manual_checks: ["Verify fix works"],
|
|
444
|
+
success_metrics: ["Test pass"]
|
|
445
|
+
}
|
|
446
|
+
}))
|
|
447
|
+
delete fixPlan.tasks_with_rationale // Clean up temp field
|
|
393
448
|
}
|
|
394
449
|
|
|
395
|
-
// Step
|
|
450
|
+
// Step 4: Write fix-plan to session folder
|
|
396
451
|
Write(`${sessionFolder}/fix-plan.json`, JSON.stringify(fixPlan, null, 2))
|
|
397
452
|
|
|
398
|
-
// Step
|
|
453
|
+
// Step 5: MUST continue to Phase 4 (Confirmation) - DO NOT execute code here
|
|
399
454
|
```
|
|
400
455
|
|
|
401
456
|
**High/Critical Severity** - Invoke cli-lite-planning-agent:
|
|
@@ -451,11 +506,41 @@ Generate fix-plan.json with:
|
|
|
451
506
|
- description
|
|
452
507
|
- modification_points: ALL files to modify for this fix (group related changes)
|
|
453
508
|
- implementation (2-5 steps covering all modification_points)
|
|
454
|
-
-
|
|
509
|
+
- acceptance: Quantified acceptance criteria
|
|
455
510
|
- depends_on: task IDs this task depends on (use sparingly)
|
|
511
|
+
|
|
512
|
+
**High/Critical complexity fields per task** (REQUIRED):
|
|
513
|
+
- rationale:
|
|
514
|
+
- chosen_approach: Why this fix approach (not alternatives)
|
|
515
|
+
- alternatives_considered: Other approaches evaluated
|
|
516
|
+
- decision_factors: Key factors influencing choice
|
|
517
|
+
- tradeoffs: Known tradeoffs of this approach
|
|
518
|
+
- verification:
|
|
519
|
+
- unit_tests: Test names to add/verify
|
|
520
|
+
- integration_tests: Integration test names
|
|
521
|
+
- manual_checks: Manual verification steps
|
|
522
|
+
- success_metrics: Quantified success criteria
|
|
523
|
+
- risks:
|
|
524
|
+
- description: Risk description
|
|
525
|
+
- probability: Low|Medium|High
|
|
526
|
+
- impact: Low|Medium|High
|
|
527
|
+
- mitigation: How to mitigate
|
|
528
|
+
- fallback: Fallback if fix fails
|
|
529
|
+
- code_skeleton (optional): Key interfaces/functions to implement
|
|
530
|
+
- interfaces: [{name, definition, purpose}]
|
|
531
|
+
- key_functions: [{signature, purpose, returns}]
|
|
532
|
+
|
|
533
|
+
**Top-level High/Critical fields** (REQUIRED):
|
|
534
|
+
- data_flow: How data flows through affected code
|
|
535
|
+
- diagram: "A → B → C" style flow
|
|
536
|
+
- stages: [{stage, input, output, component}]
|
|
537
|
+
- design_decisions: Global fix decisions
|
|
538
|
+
- [{decision, rationale, tradeoff}]
|
|
539
|
+
|
|
456
540
|
- estimated_time, recommended_execution, severity, risk_level
|
|
457
541
|
- _metadata:
|
|
458
542
|
- timestamp, source, planning_mode
|
|
543
|
+
- complexity: "High" | "Critical"
|
|
459
544
|
- diagnosis_angles: ${JSON.stringify(manifest.diagnoses.map(d => d.angle))}
|
|
460
545
|
|
|
461
546
|
## Task Grouping Rules
|
|
@@ -467,11 +552,21 @@ Generate fix-plan.json with:
|
|
|
467
552
|
|
|
468
553
|
## Execution
|
|
469
554
|
1. Read ALL diagnosis files for comprehensive context
|
|
470
|
-
2. Execute CLI planning using Gemini (Qwen fallback)
|
|
555
|
+
2. Execute CLI planning using Gemini (Qwen fallback) with --rule planning-fix-strategy template
|
|
471
556
|
3. Synthesize findings from multiple diagnosis angles
|
|
472
|
-
4.
|
|
473
|
-
|
|
474
|
-
|
|
557
|
+
4. Generate fix-plan with:
|
|
558
|
+
- For High/Critical: REQUIRED new fields (rationale, verification, risks, code_skeleton, data_flow, design_decisions)
|
|
559
|
+
- Each task MUST have rationale (why this fix), verification (how to verify success), and risks (potential issues)
|
|
560
|
+
5. Parse output and structure fix-plan
|
|
561
|
+
6. Write JSON: Write('${sessionFolder}/fix-plan.json', jsonContent)
|
|
562
|
+
7. Return brief completion summary
|
|
563
|
+
|
|
564
|
+
## Output Format for CLI
|
|
565
|
+
Include these sections in your fix-plan output:
|
|
566
|
+
- Summary, Root Cause, Strategy (existing)
|
|
567
|
+
- Data Flow: Diagram showing affected code paths
|
|
568
|
+
- Design Decisions: Key architectural choices in the fix
|
|
569
|
+
- Tasks: Each with rationale (Medium/High), verification (Medium/High), risks (High), code_skeleton (High)
|
|
475
570
|
`
|
|
476
571
|
)
|
|
477
572
|
```
|
|
@@ -565,7 +660,11 @@ const fixPlan = JSON.parse(Read(`${sessionFolder}/fix-plan.json`))
|
|
|
565
660
|
executionContext = {
|
|
566
661
|
mode: "bugfix",
|
|
567
662
|
severity: fixPlan.severity,
|
|
568
|
-
planObject:
|
|
663
|
+
planObject: {
|
|
664
|
+
...fixPlan,
|
|
665
|
+
// Ensure complexity is set based on severity for new field consumption
|
|
666
|
+
complexity: fixPlan.complexity || (fixPlan.severity === 'Critical' ? 'High' : (fixPlan.severity === 'High' ? 'High' : 'Medium'))
|
|
667
|
+
},
|
|
569
668
|
diagnosisContext: diagnoses,
|
|
570
669
|
diagnosisAngles: manifest.diagnoses.map(d => d.angle),
|
|
571
670
|
diagnosisManifest: manifest,
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# CCW Loop Skill
|
|
2
|
+
|
|
3
|
+
无状态迭代开发循环工作流,支持开发 (Develop)、调试 (Debug)、验证 (Validate) 三个阶段,每个阶段都有独立的文件记录进展。
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
CCW Loop 是一个自主模式 (Autonomous) 的 Skill,通过文件驱动的无状态循环,帮助开发者系统化地完成开发任务。
|
|
8
|
+
|
|
9
|
+
### 核心特性
|
|
10
|
+
|
|
11
|
+
1. **无状态循环**: 每次执行从文件读取状态,不依赖内存
|
|
12
|
+
2. **文件驱动**: 所有进度记录在 Markdown 文件中,可审计、可回顾
|
|
13
|
+
3. **Gemini 辅助**: 关键决策点使用 CLI 工具进行深度分析
|
|
14
|
+
4. **可恢复**: 任何时候中断后可继续
|
|
15
|
+
5. **双模式**: 支持交互式和自动循环
|
|
16
|
+
|
|
17
|
+
### 三大阶段
|
|
18
|
+
|
|
19
|
+
- **Develop**: 任务分解 → 代码实现 → 进度记录
|
|
20
|
+
- **Debug**: 假设生成 → 证据收集 → 根因分析 → 修复验证
|
|
21
|
+
- **Validate**: 测试执行 → 覆盖率检查 → 质量评估
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
已包含在 `.claude/skills/ccw-loop/`,无需额外安装。
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### 基本用法
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 启动新循环
|
|
33
|
+
/ccw-loop "实现用户认证功能"
|
|
34
|
+
|
|
35
|
+
# 继续现有循环
|
|
36
|
+
/ccw-loop --resume LOOP-auth-2026-01-22
|
|
37
|
+
|
|
38
|
+
# 自动循环模式
|
|
39
|
+
/ccw-loop --auto "修复登录bug并添加测试"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 交互式流程
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
1. 启动: /ccw-loop "任务描述"
|
|
46
|
+
2. 初始化: 自动分析任务并生成子任务列表
|
|
47
|
+
3. 显示菜单:
|
|
48
|
+
- 📝 继续开发 (Develop)
|
|
49
|
+
- 🔍 开始调试 (Debug)
|
|
50
|
+
- ✅ 运行验证 (Validate)
|
|
51
|
+
- 📊 查看详情 (Status)
|
|
52
|
+
- 🏁 完成循环 (Complete)
|
|
53
|
+
- 🚪 退出 (Exit)
|
|
54
|
+
4. 执行选择的动作
|
|
55
|
+
5. 重复步骤 3-4 直到完成
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 自动循环流程
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Develop (所有任务) → Debug (如有需要) → Validate → 完成
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Directory Structure
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
.workflow/.loop/{session-id}/
|
|
68
|
+
├── meta.json # 会话元数据 (不可修改)
|
|
69
|
+
├── state.json # 当前状态 (每次更新)
|
|
70
|
+
├── summary.md # 完成报告 (结束时生成)
|
|
71
|
+
├── develop/
|
|
72
|
+
│ ├── progress.md # 开发进度时间线
|
|
73
|
+
│ ├── tasks.json # 任务列表
|
|
74
|
+
│ └── changes.log # 代码变更日志 (NDJSON)
|
|
75
|
+
├── debug/
|
|
76
|
+
│ ├── understanding.md # 理解演变文档
|
|
77
|
+
│ ├── hypotheses.json # 假设历史
|
|
78
|
+
│ └── debug.log # 调试日志 (NDJSON)
|
|
79
|
+
└── validate/
|
|
80
|
+
├── validation.md # 验证报告
|
|
81
|
+
├── test-results.json # 测试结果
|
|
82
|
+
└── coverage.json # 覆盖率数据
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Action Reference
|
|
86
|
+
|
|
87
|
+
| Action | 描述 | 触发条件 |
|
|
88
|
+
|--------|------|----------|
|
|
89
|
+
| action-init | 初始化会话 | 首次启动 |
|
|
90
|
+
| action-menu | 显示操作菜单 | 交互模式下每次循环 |
|
|
91
|
+
| action-develop-with-file | 执行开发任务 | 有待处理任务 |
|
|
92
|
+
| action-debug-with-file | 假设驱动调试 | 需要调试 |
|
|
93
|
+
| action-validate-with-file | 运行测试验证 | 需要验证 |
|
|
94
|
+
| action-complete | 完成并生成报告 | 所有任务完成 |
|
|
95
|
+
|
|
96
|
+
详细说明见 [specs/action-catalog.md](specs/action-catalog.md)
|
|
97
|
+
|
|
98
|
+
## CLI Integration
|
|
99
|
+
|
|
100
|
+
CCW Loop 在关键决策点集成 CLI 工具:
|
|
101
|
+
|
|
102
|
+
### 任务分解 (action-init)
|
|
103
|
+
```bash
|
|
104
|
+
ccw cli -p "PURPOSE: 分解开发任务..."
|
|
105
|
+
--tool gemini
|
|
106
|
+
--mode analysis
|
|
107
|
+
--rule planning-breakdown-task-steps
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 代码实现 (action-develop)
|
|
111
|
+
```bash
|
|
112
|
+
ccw cli -p "PURPOSE: 实现功能代码..."
|
|
113
|
+
--tool gemini
|
|
114
|
+
--mode write
|
|
115
|
+
--rule development-implement-feature
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 假设生成 (action-debug - 探索)
|
|
119
|
+
```bash
|
|
120
|
+
ccw cli -p "PURPOSE: Generate debugging hypotheses..."
|
|
121
|
+
--tool gemini
|
|
122
|
+
--mode analysis
|
|
123
|
+
--rule analysis-diagnose-bug-root-cause
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 证据分析 (action-debug - 分析)
|
|
127
|
+
```bash
|
|
128
|
+
ccw cli -p "PURPOSE: Analyze debug log evidence..."
|
|
129
|
+
--tool gemini
|
|
130
|
+
--mode analysis
|
|
131
|
+
--rule analysis-diagnose-bug-root-cause
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 质量评估 (action-validate)
|
|
135
|
+
```bash
|
|
136
|
+
ccw cli -p "PURPOSE: Analyze test results and coverage..."
|
|
137
|
+
--tool gemini
|
|
138
|
+
--mode analysis
|
|
139
|
+
--rule analysis-review-code-quality
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## State Management
|
|
143
|
+
|
|
144
|
+
### State Schema
|
|
145
|
+
|
|
146
|
+
参见 [phases/state-schema.md](phases/state-schema.md)
|
|
147
|
+
|
|
148
|
+
### State Transitions
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
pending → running → completed
|
|
152
|
+
↓
|
|
153
|
+
user_exit
|
|
154
|
+
↓
|
|
155
|
+
failed
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### State Recovery
|
|
159
|
+
|
|
160
|
+
如果 `state.json` 损坏,可从其他文件重建:
|
|
161
|
+
- develop/tasks.json → develop.*
|
|
162
|
+
- debug/hypotheses.json → debug.*
|
|
163
|
+
- validate/test-results.json → validate.*
|
|
164
|
+
|
|
165
|
+
## Examples
|
|
166
|
+
|
|
167
|
+
### Example 1: 功能开发
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# 1. 启动循环
|
|
171
|
+
/ccw-loop "Add user profile page"
|
|
172
|
+
|
|
173
|
+
# 2. 系统初始化,生成任务:
|
|
174
|
+
# - task-001: Create profile component
|
|
175
|
+
# - task-002: Add API endpoints
|
|
176
|
+
# - task-003: Implement tests
|
|
177
|
+
|
|
178
|
+
# 3. 选择 "继续开发"
|
|
179
|
+
# → 执行 task-001 (Gemini 辅助实现)
|
|
180
|
+
# → 更新 progress.md
|
|
181
|
+
|
|
182
|
+
# 4. 重复开发直到所有任务完成
|
|
183
|
+
|
|
184
|
+
# 5. 选择 "运行验证"
|
|
185
|
+
# → 运行测试
|
|
186
|
+
# → 检查覆盖率
|
|
187
|
+
# → 生成 validation.md
|
|
188
|
+
|
|
189
|
+
# 6. 选择 "完成循环"
|
|
190
|
+
# → 生成 summary.md
|
|
191
|
+
# → 询问是否扩展为 Issue
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Example 2: Bug 修复
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# 1. 启动循环
|
|
198
|
+
/ccw-loop "Fix login timeout issue"
|
|
199
|
+
|
|
200
|
+
# 2. 选择 "开始调试"
|
|
201
|
+
# → 输入 bug 描述: "Login times out after 30s"
|
|
202
|
+
# → Gemini 生成假设 (H1, H2, H3)
|
|
203
|
+
# → 添加 NDJSON 日志
|
|
204
|
+
# → 提示复现 bug
|
|
205
|
+
|
|
206
|
+
# 3. 复现 bug (在应用中操作)
|
|
207
|
+
|
|
208
|
+
# 4. 再次选择 "开始调试"
|
|
209
|
+
# → 解析 debug.log
|
|
210
|
+
# → Gemini 分析证据
|
|
211
|
+
# → H2 确认为根因
|
|
212
|
+
# → 生成修复代码
|
|
213
|
+
# → 更新 understanding.md
|
|
214
|
+
|
|
215
|
+
# 5. 选择 "运行验证"
|
|
216
|
+
# → 测试通过
|
|
217
|
+
|
|
218
|
+
# 6. 完成
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Templates
|
|
222
|
+
|
|
223
|
+
- [progress-template.md](templates/progress-template.md): 开发进度文档模板
|
|
224
|
+
- [understanding-template.md](templates/understanding-template.md): 调试理解文档模板
|
|
225
|
+
- [validation-template.md](templates/validation-template.md): 验证报告模板
|
|
226
|
+
|
|
227
|
+
## Specifications
|
|
228
|
+
|
|
229
|
+
- [loop-requirements.md](specs/loop-requirements.md): 循环需求规范
|
|
230
|
+
- [action-catalog.md](specs/action-catalog.md): 动作目录
|
|
231
|
+
|
|
232
|
+
## Integration
|
|
233
|
+
|
|
234
|
+
### Dashboard Integration
|
|
235
|
+
|
|
236
|
+
CCW Loop 与 Dashboard Loop Monitor 集成:
|
|
237
|
+
- Dashboard 创建 Loop → 触发此 Skill
|
|
238
|
+
- state.json → Dashboard 实时显示
|
|
239
|
+
- 任务列表双向同步
|
|
240
|
+
- 控制按钮映射到 actions
|
|
241
|
+
|
|
242
|
+
### Issue System Integration
|
|
243
|
+
|
|
244
|
+
完成后可扩展为 Issue:
|
|
245
|
+
- 维度: test, enhance, refactor, doc
|
|
246
|
+
- 自动调用 `/issue:new`
|
|
247
|
+
- 上下文自动填充
|
|
248
|
+
|
|
249
|
+
## Error Handling
|
|
250
|
+
|
|
251
|
+
| 情况 | 处理 |
|
|
252
|
+
|------|------|
|
|
253
|
+
| Session 不存在 | 创建新会话 |
|
|
254
|
+
| state.json 损坏 | 从文件重建 |
|
|
255
|
+
| CLI 工具失败 | 回退到手动模式 |
|
|
256
|
+
| 测试失败 | 循环回到 develop/debug |
|
|
257
|
+
| >10 迭代 | 警告用户,建议拆分 |
|
|
258
|
+
|
|
259
|
+
## Limitations
|
|
260
|
+
|
|
261
|
+
1. **单会话限制**: 同一时间只能有一个活跃会话
|
|
262
|
+
2. **迭代限制**: 建议不超过 10 次迭代
|
|
263
|
+
3. **CLI 依赖**: 部分功能依赖 Gemini CLI 可用性
|
|
264
|
+
4. **测试框架**: 需要 package.json 中定义测试脚本
|
|
265
|
+
|
|
266
|
+
## Troubleshooting
|
|
267
|
+
|
|
268
|
+
### Q: 如何查看当前会话状态?
|
|
269
|
+
|
|
270
|
+
A: 在菜单中选择 "查看详情 (Status)"
|
|
271
|
+
|
|
272
|
+
### Q: 如何恢复中断的会话?
|
|
273
|
+
|
|
274
|
+
A: 使用 `--resume` 参数:
|
|
275
|
+
```bash
|
|
276
|
+
/ccw-loop --resume LOOP-xxx-2026-01-22
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Q: 如果 CLI 工具失败怎么办?
|
|
280
|
+
|
|
281
|
+
A: Skill 会自动降级到手动模式,提示用户手动输入
|
|
282
|
+
|
|
283
|
+
### Q: 如何添加自定义 action?
|
|
284
|
+
|
|
285
|
+
A: 参见 [specs/action-catalog.md](specs/action-catalog.md) 的 "Action Extensions" 部分
|
|
286
|
+
|
|
287
|
+
## Contributing
|
|
288
|
+
|
|
289
|
+
添加新功能:
|
|
290
|
+
1. 创建 action 文件在 `phases/actions/`
|
|
291
|
+
2. 更新 orchestrator 决策逻辑
|
|
292
|
+
3. 添加到 action-catalog.md
|
|
293
|
+
4. 更新 action-menu.md
|
|
294
|
+
|
|
295
|
+
## License
|
|
296
|
+
|
|
297
|
+
MIT
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
**Version**: 1.0.0
|
|
302
|
+
**Last Updated**: 2026-01-22
|
|
303
|
+
**Author**: CCW Team
|