cc-devflow 4.5.11 → 4.5.12

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 (185) hide show
  1. package/.claude/skills/cc-act/CHANGELOG.md +18 -0
  2. package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
  3. package/.claude/skills/cc-act/SKILL.md +38 -425
  4. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
  5. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
  6. package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
  7. package/.claude/skills/cc-act/references/closure-contract.md +12 -63
  8. package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
  9. package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
  10. package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
  11. package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
  12. package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
  13. package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
  14. package/.claude/skills/cc-check/CHANGELOG.md +18 -0
  15. package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
  16. package/.claude/skills/cc-check/SKILL.md +33 -456
  17. package/.claude/skills/cc-check/references/review-contract.md +12 -147
  18. package/.claude/skills/cc-dev/CHANGELOG.md +15 -0
  19. package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
  20. package/.claude/skills/cc-dev/SKILL.md +52 -137
  21. package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
  22. package/.claude/skills/cc-do/CHANGELOG.md +11 -0
  23. package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
  24. package/.claude/skills/cc-do/SKILL.md +39 -245
  25. package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
  26. package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
  27. package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
  28. package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
  29. package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
  30. package/.claude/skills/cc-investigate/CHANGELOG.md +16 -0
  31. package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
  32. package/.claude/skills/cc-investigate/SKILL.md +64 -246
  33. package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -98
  34. package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -218
  35. package/.claude/skills/cc-next/CHANGELOG.md +6 -0
  36. package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
  37. package/.claude/skills/cc-next/SKILL.md +34 -140
  38. package/.claude/skills/cc-plan/CHANGELOG.md +16 -0
  39. package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
  40. package/.claude/skills/cc-plan/SKILL.md +45 -295
  41. package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -228
  42. package/.claude/skills/cc-plan/references/planning-contract.md +24 -161
  43. package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
  44. package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
  45. package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
  46. package/.claude/skills/cc-pr-land/SKILL.md +14 -114
  47. package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
  48. package/.claude/skills/cc-pr-review/SKILL.md +20 -103
  49. package/.claude/skills/cc-review/CHANGELOG.md +17 -0
  50. package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
  51. package/.claude/skills/cc-review/SKILL.md +53 -241
  52. package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
  53. package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
  54. package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
  55. package/.claude/skills/cc-review/references/review-methods.md +10 -218
  56. package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
  57. package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
  58. package/.claude/skills/cc-roadmap/SKILL.md +3 -3
  59. package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
  60. package/.claude/skills/cc-simplify/SKILL.md +26 -21
  61. package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
  62. package/.claude/skills/cc-spec-init/SKILL.md +29 -132
  63. package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
  64. package/CHANGELOG.md +13 -0
  65. package/bin/cc-devflow-cli.js +20 -260
  66. package/bin/cc-devflow.js +44 -7
  67. package/docs/commands/README.md +1 -1
  68. package/docs/commands/README.zh-CN.md +1 -1
  69. package/docs/examples/README.md +1 -1
  70. package/docs/examples/START-HERE.md +14 -15
  71. package/docs/examples/example-bindings.json +11 -11
  72. package/docs/examples/full-design-blocked/README.md +4 -6
  73. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
  74. package/docs/examples/local-handoff/README.md +8 -11
  75. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
  76. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
  77. package/docs/examples/pdca-loop/README.md +6 -9
  78. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
  79. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
  80. package/docs/examples/scripts/check-example-bindings.sh +11 -62
  81. package/docs/guides/artifact-contract.md +10 -40
  82. package/docs/guides/getting-started.md +8 -8
  83. package/docs/guides/getting-started.zh-CN.md +8 -8
  84. package/docs/guides/minimize-artifacts.md +16 -130
  85. package/docs/guides/project-postmortem.md +14 -71
  86. package/lib/compiler/__tests__/skills-registry.test.js +9 -8
  87. package/lib/compiler/resource-copier.js +29 -0
  88. package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
  89. package/lib/skill-runtime/__tests__/benchmark-skills.test.js +3 -3
  90. package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
  91. package/lib/skill-runtime/errors.js +3 -3
  92. package/lib/skill-runtime/index.js +5 -23
  93. package/lib/skill-runtime/paths.js +5 -52
  94. package/lib/skill-runtime/query-registry.js +4 -4
  95. package/lib/skill-runtime/query.js +89 -201
  96. package/lib/skill-runtime/store.js +4 -40
  97. package/lib/skill-runtime/trace.js +2 -2
  98. package/package.json +2 -5
  99. package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
  100. package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
  101. package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
  102. package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
  103. package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
  104. package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
  105. package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
  106. package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
  107. package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
  108. package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
  109. package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
  110. package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
  111. package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
  112. package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -224
  113. package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -178
  114. package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
  115. package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
  116. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
  117. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
  118. package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
  119. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
  120. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
  121. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
  122. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
  123. package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
  124. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
  125. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
  126. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
  127. package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
  128. package/docs/get-shit-done-strategy-audit.md +0 -518
  129. package/docs/skill-runtime-migration.md +0 -46
  130. package/lib/skill-runtime/__tests__/approve.test.js +0 -92
  131. package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
  132. package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
  133. package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
  134. package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
  135. package/lib/skill-runtime/__tests__/intent.test.js +0 -203
  136. package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
  137. package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
  138. package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
  139. package/lib/skill-runtime/__tests__/query.test.js +0 -860
  140. package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
  141. package/lib/skill-runtime/__tests__/release.test.js +0 -85
  142. package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
  143. package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
  144. package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
  145. package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
  146. package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
  147. package/lib/skill-runtime/__tests__/task-contract.test.js +0 -874
  148. package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
  149. package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
  150. package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
  151. package/lib/skill-runtime/__tests__/worker.test.js +0 -56
  152. package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
  153. package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
  154. package/lib/skill-runtime/artifacts.js +0 -88
  155. package/lib/skill-runtime/context-index.js +0 -545
  156. package/lib/skill-runtime/delegation.js +0 -533
  157. package/lib/skill-runtime/intent.js +0 -309
  158. package/lib/skill-runtime/lifecycle.js +0 -294
  159. package/lib/skill-runtime/operations/CLAUDE.md +0 -19
  160. package/lib/skill-runtime/operations/approve.js +0 -81
  161. package/lib/skill-runtime/operations/autopilot-core.js +0 -337
  162. package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
  163. package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
  164. package/lib/skill-runtime/operations/autopilot.js +0 -163
  165. package/lib/skill-runtime/operations/dispatch.js +0 -416
  166. package/lib/skill-runtime/operations/init.js +0 -60
  167. package/lib/skill-runtime/operations/janitor.js +0 -61
  168. package/lib/skill-runtime/operations/plan.js +0 -59
  169. package/lib/skill-runtime/operations/prepare-pr.js +0 -25
  170. package/lib/skill-runtime/operations/release.js +0 -99
  171. package/lib/skill-runtime/operations/resume.js +0 -126
  172. package/lib/skill-runtime/operations/review-records.js +0 -265
  173. package/lib/skill-runtime/operations/snapshot.js +0 -45
  174. package/lib/skill-runtime/operations/task-contract.js +0 -593
  175. package/lib/skill-runtime/operations/verify.js +0 -170
  176. package/lib/skill-runtime/operations/worker-run.js +0 -531
  177. package/lib/skill-runtime/operations/worker.js +0 -33
  178. package/lib/skill-runtime/planner.js +0 -539
  179. package/lib/skill-runtime/readiness.js +0 -84
  180. package/lib/skill-runtime/review-records.js +0 -123
  181. package/lib/skill-runtime/review.js +0 -855
  182. package/lib/skill-runtime/schemas.js +0 -746
  183. package/lib/skill-runtime/task-contract.js +0 -188
  184. package/lib/skill-runtime/team-state.js +0 -122
  185. package/lib/skill-runtime/workflow-context.js +0 -748
@@ -1,16 +1,15 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  # ------------------------------------------------------------
4
- # cc-do: canonical devflow layout 解析
4
+ # cc-do: task.md only path helpers
5
5
  # ------------------------------------------------------------
6
6
 
7
7
  req_do_resolve_change_dir() {
8
8
  local input="$1"
9
- local normalized
9
+ local normalized="${input%/}"
10
10
 
11
- normalized="${input%/}"
12
11
  case "$(basename "$normalized")" in
13
- planning|execution|review|handoff|meta)
12
+ handoff)
14
13
  dirname "$normalized"
15
14
  ;;
16
15
  *)
@@ -19,61 +18,10 @@ req_do_resolve_change_dir() {
19
18
  esac
20
19
  }
21
20
 
22
- req_do_planning_dir() {
23
- printf '%s/planning\n' "$(req_do_resolve_change_dir "$1")"
24
- }
25
-
26
- req_do_execution_dir() {
27
- printf '%s/execution\n' "$(req_do_resolve_change_dir "$1")"
28
- }
29
-
30
- req_do_review_dir() {
31
- printf '%s/review\n' "$(req_do_resolve_change_dir "$1")"
21
+ req_do_tasks_path() {
22
+ printf '%s/task.md\n' "$(req_do_resolve_change_dir "$1")"
32
23
  }
33
24
 
34
25
  req_do_handoff_dir() {
35
26
  printf '%s/handoff\n' "$(req_do_resolve_change_dir "$1")"
36
27
  }
37
-
38
- req_do_manifest_path() {
39
- printf '%s/task-manifest.json\n' "$(req_do_planning_dir "$1")"
40
- }
41
-
42
- req_do_tasks_path() {
43
- printf '%s/tasks.md\n' "$(req_do_planning_dir "$1")"
44
- }
45
-
46
- req_do_change_meta_path() {
47
- printf '%s/change-meta.json\n' "$(req_do_resolve_change_dir "$1")"
48
- }
49
-
50
- req_do_contract_path() {
51
- local planning_dir
52
- local design_file
53
- local analysis_file
54
-
55
- planning_dir="$(req_do_planning_dir "$1")"
56
- design_file="$planning_dir/design.md"
57
- analysis_file="$planning_dir/analysis.md"
58
-
59
- if [[ -f "$analysis_file" && ! -f "$design_file" ]]; then
60
- printf '%s\n' "$analysis_file"
61
- return 0
62
- fi
63
-
64
- printf '%s\n' "$design_file"
65
- }
66
-
67
- req_do_report_card_path() {
68
- printf '%s/report-card.json\n' "$(req_do_review_dir "$1")"
69
- }
70
-
71
- req_do_resume_index_path() {
72
- printf '%s/resume-index.md\n' "$(req_do_handoff_dir "$1")"
73
- }
74
-
75
- req_do_task_runtime_dir() {
76
- local change_dir="$1"
77
- local task_id="$2"
78
- printf '%s/tasks/%s\n' "$(req_do_execution_dir "$change_dir")" "$task_id"
79
- }
@@ -2,25 +2,17 @@
2
2
 
3
3
  set -euo pipefail
4
4
 
5
- # ------------------------------------------------------------
6
- # 查询 manifest / TASKS 的任务状态
7
- # ------------------------------------------------------------
8
-
9
5
  usage() {
10
6
  cat <<'EOF'
11
- Usage:
12
- check-task-status.sh --manifest task-manifest.json [--task T001]
13
- check-task-status.sh --tasks tasks.md [--task T001]
7
+ Usage: check-task-status.sh --tasks task.md [--task T001]
14
8
  EOF
15
9
  }
16
10
 
17
11
  TASKS=""
18
- MANIFEST=""
19
12
  TASK_ID=""
20
13
 
21
14
  while [[ $# -gt 0 ]]; do
22
15
  case "$1" in
23
- --manifest) MANIFEST="$2"; shift 2 ;;
24
16
  --tasks) TASKS="$2"; shift 2 ;;
25
17
  --task) TASK_ID="$(echo "$2" | tr '[:lower:]' '[:upper:]')"; shift 2 ;;
26
18
  -h|--help) usage; exit 0 ;;
@@ -28,65 +20,43 @@ while [[ $# -gt 0 ]]; do
28
20
  esac
29
21
  done
30
22
 
31
- if [[ -n "$MANIFEST" ]]; then
32
- if [[ ! -f "$MANIFEST" ]]; then
33
- usage
34
- exit 1
35
- fi
36
-
37
- if [[ -n "$TASK_ID" ]]; then
38
- output="$(jq -r --arg task "$TASK_ID" '
39
- def normalized_status:
40
- .status // (if (.completed // false) then "passed" else "pending" end);
41
- def review_status($gate):
42
- (.reviews[$gate].status // .reviews[$gate] // "pending");
43
- [.tasks[] | select(.id == $task) | "id=\(.id) status=\(normalized_status) phase=\(.phase // 0) dependsOn=\((.dependsOn // []) | join(",")) parallel=\(.parallel // false) spec=\(review_status("spec")) code=\(review_status("code"))"] | .[0] // empty
44
- ' "$MANIFEST")"
45
-
46
- if [[ -z "$output" ]]; then
47
- echo "$TASK_ID not_found"
48
- exit 1
49
- fi
50
-
51
- echo "$output"
52
- exit 0
53
- fi
54
-
55
- jq -r '
56
- def normalized_status:
57
- .status // (if (.completed // false) then "passed" else "pending" end);
58
- {
59
- currentTaskId: (.currentTaskId // "none"),
60
- passed: ([.tasks[] | select((normalized_status == "passed") or (normalized_status == "completed") or (normalized_status == "done") or (normalized_status == "verified"))] | length),
61
- running: ([.tasks[] | select(normalized_status == "running")] | length),
62
- pending: ([.tasks[] | select(normalized_status == "pending")] | length),
63
- blocked: ([.tasks[] | select((normalized_status == "blocked") or (normalized_status == "failed") or (normalized_status == "skipped"))] | length),
64
- total: (.tasks | length)
65
- }
66
- | "current=\(.currentTaskId) passed=\(.passed) running=\(.running) pending=\(.pending) blocked=\(.blocked) total=\(.total)"
67
- ' "$MANIFEST"
68
- exit 0
69
- fi
70
-
71
23
  if [[ -z "$TASKS" || ! -f "$TASKS" ]]; then
72
24
  usage
73
25
  exit 1
74
26
  fi
75
27
 
76
- if [[ -n "$TASK_ID" ]]; then
77
- if rg -n "^- \\[x\\].*$TASK_ID" "$TASKS" >/dev/null 2>&1; then
78
- echo "$TASK_ID complete"
79
- exit 0
80
- fi
81
- if rg -n "^- \\[ \\].*$TASK_ID" "$TASKS" >/dev/null 2>&1; then
82
- echo "$TASK_ID pending"
83
- exit 0
84
- fi
85
- echo "$TASK_ID not_found"
86
- exit 1
87
- fi
28
+ node - "$TASKS" "$TASK_ID" <<'NODE'
29
+ const fs = require('fs');
30
+
31
+ const tasksPath = process.argv[2];
32
+ const requested = process.argv[3] || '';
33
+ const text = fs.readFileSync(tasksPath, 'utf8');
34
+ const tasks = [];
35
+
36
+ for (const line of text.split(/\r?\n/)) {
37
+ const match = line.match(/^\s*-\s+\[( |x|X)\]\s+(T\d{3})\b\s*(.*)$/);
38
+ if (!match) continue;
39
+ tasks.push({
40
+ id: match[2],
41
+ title: match[3].trim(),
42
+ status: match[1].toLowerCase() === 'x' ? 'done' : 'pending'
43
+ });
44
+ }
45
+
46
+ const payload = requested
47
+ ? tasks.find((task) => task.id === requested) || null
48
+ : {
49
+ taskFile: tasksPath,
50
+ total: tasks.length,
51
+ done: tasks.filter((task) => task.status === 'done').length,
52
+ pending: tasks.filter((task) => task.status === 'pending').length,
53
+ next: tasks.find((task) => task.status === 'pending') || null
54
+ };
55
+
56
+ if (requested && !payload) {
57
+ process.stderr.write(`${requested} not found\n`);
58
+ process.exit(1);
59
+ }
88
60
 
89
- done_count="$(grep -c '^- \[x\]' "$TASKS" 2>/dev/null || echo 0)"
90
- todo_count="$(grep -c '^- \[ \]' "$TASKS" 2>/dev/null || echo 0)"
91
- total=$((done_count + todo_count))
92
- echo "done=$done_count todo=$todo_count total=$total"
61
+ process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
62
+ NODE
@@ -3,13 +3,13 @@
3
3
  set -euo pipefail
4
4
 
5
5
  # ------------------------------------------------------------
6
- # 把任务标记为完成,并同步 manifest / TASKS
6
+ # task.md 中的任务标记为完成
7
7
  # ------------------------------------------------------------
8
8
 
9
9
  usage() {
10
10
  cat <<'EOF'
11
11
  Usage:
12
- mark-task-complete.sh --manifest task-manifest.json [--tasks tasks.md] --task T001
12
+ mark-task-complete.sh --tasks task.md --task T001
13
13
  EOF
14
14
  }
15
15
 
@@ -47,13 +47,11 @@ mark_first_task_complete() {
47
47
  }
48
48
 
49
49
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
50
- MANIFEST=""
51
50
  TASKS=""
52
51
  TASK_ID=""
53
52
 
54
53
  while [[ $# -gt 0 ]]; do
55
54
  case "$1" in
56
- --manifest) MANIFEST="$2"; shift 2 ;;
57
55
  --tasks) TASKS="$2"; shift 2 ;;
58
56
  --task) TASK_ID="$(echo "$2" | tr '[:lower:]' '[:upper:]')"; shift 2 ;;
59
57
  -h|--help) usage; exit 0 ;;
@@ -61,53 +59,18 @@ while [[ $# -gt 0 ]]; do
61
59
  esac
62
60
  done
63
61
 
64
- if [[ -z "$TASK_ID" || (-z "$MANIFEST" && -z "$TASKS") ]]; then
62
+ if [[ -z "$TASK_ID" || -z "$TASKS" ]]; then
65
63
  usage
66
64
  exit 1
67
65
  fi
68
66
 
69
- if [[ -n "$MANIFEST" ]]; then
70
- if [[ ! -f "$MANIFEST" ]]; then
71
- usage
72
- exit 1
73
- fi
74
-
75
- req_dir="$(cd "$(dirname "$MANIFEST")" && pwd)"
76
- "$SCRIPT_DIR/verify-task-gates.sh" --dir "$req_dir" --task "$TASK_ID" >/dev/null
77
-
78
- tmp_manifest="$(mktemp)"
79
- jq --arg task "$TASK_ID" '
80
- .tasks |= map(
81
- if .id == $task then
82
- . + {
83
- status: "passed",
84
- reviews: ((.reviews // {}) + {spec: ((.reviews.spec // "pass") | tostring), code: ((.reviews.code // "pass") | tostring)})
85
- }
86
- else
87
- .
88
- end
89
- )
90
- ' "$MANIFEST" > "$tmp_manifest"
91
- mv "$tmp_manifest" "$MANIFEST"
92
-
93
- next_task="$("$SCRIPT_DIR/select-ready-tasks.sh" --manifest "$MANIFEST" | jq -r '.readyTasks[0].id // empty')"
94
-
95
- tmp_manifest="$(mktemp)"
96
- jq --arg next "$next_task" '
97
- .currentTaskId = (if $next == "" then null else $next end)
98
- ' "$MANIFEST" > "$tmp_manifest"
99
- mv "$tmp_manifest" "$MANIFEST"
67
+ if [[ ! -f "$TASKS" ]]; then
68
+ usage
69
+ exit 1
100
70
  fi
101
71
 
102
- if [[ -n "$TASKS" ]]; then
103
- if [[ ! -f "$TASKS" ]]; then
104
- usage
105
- exit 1
106
- fi
107
-
108
- tmp_tasks="$(mktemp)"
109
- mark_first_task_complete "$TASKS" "$TASK_ID" > "$tmp_tasks"
110
- mv "$tmp_tasks" "$TASKS"
111
- fi
72
+ tmp_tasks="$(mktemp)"
73
+ mark_first_task_complete "$TASKS" "$TASK_ID" > "$tmp_tasks"
74
+ mv "$tmp_tasks" "$TASKS"
112
75
 
113
76
  echo "Marked $TASK_ID complete"
@@ -3,133 +3,65 @@
3
3
  set -euo pipefail
4
4
 
5
5
  # ------------------------------------------------------------
6
- # 根据 manifest 选出当前 ready tasks / 并行候选
6
+ # task.md 选出第一个未完成任务
7
7
  # ------------------------------------------------------------
8
8
 
9
9
  usage() {
10
10
  cat <<'EOF'
11
- Usage: select-ready-tasks.sh --manifest task-manifest.json [--task T001]
11
+ Usage: select-ready-tasks.sh --tasks task.md [--task T001]
12
12
  EOF
13
13
  }
14
14
 
15
- MANIFEST=""
15
+ TASKS=""
16
16
  TASK_ID=""
17
17
 
18
18
  while [[ $# -gt 0 ]]; do
19
19
  case "$1" in
20
- --manifest) MANIFEST="$2"; shift 2 ;;
20
+ --tasks) TASKS="$2"; shift 2 ;;
21
21
  --task) TASK_ID="$(echo "$2" | tr '[:lower:]' '[:upper:]')"; shift 2 ;;
22
22
  -h|--help) usage; exit 0 ;;
23
23
  *) echo "Unknown arg: $1" >&2; usage; exit 1 ;;
24
24
  esac
25
25
  done
26
26
 
27
- if [[ -z "$MANIFEST" || ! -f "$MANIFEST" ]]; then
27
+ if [[ -z "$TASKS" || ! -f "$TASKS" ]]; then
28
28
  usage
29
29
  exit 1
30
30
  fi
31
31
 
32
- node - "$MANIFEST" "$TASK_ID" <<'NODE'
32
+ node - "$TASKS" "$TASK_ID" <<'NODE'
33
33
  const fs = require('fs');
34
34
 
35
- const manifestPath = process.argv[2];
36
- const taskId = process.argv[3] || '';
37
- const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
38
- const tasks = Array.isArray(manifest.tasks) ? manifest.tasks : [];
39
- const doneStates = new Set(['passed', 'completed', 'done', 'verified']);
40
- const blockedStates = new Set(['failed', 'skipped', 'blocked']);
41
-
42
- function statusOf(task) {
43
- if (task.status) return task.status;
44
- return task.completed ? 'passed' : 'pending';
45
- }
46
-
47
- const taskMap = new Map(tasks.map((task) => [task.id, task]));
48
- const unfinished = tasks.filter((task) => !doneStates.has(statusOf(task)));
49
- const phases = unfinished.map((task) => Number.isFinite(task.phase) ? task.phase : 0);
50
- const activePhase = phases.length > 0 ? Math.min(...phases) : null;
51
-
52
- function unmetDependencies(task) {
53
- return (task.dependsOn || []).filter((depId) => {
54
- const depTask = taskMap.get(depId);
55
- return !depTask || !doneStates.has(statusOf(depTask));
35
+ const tasksPath = process.argv[2];
36
+ const requestedTask = process.argv[3] || '';
37
+ const text = fs.readFileSync(tasksPath, 'utf8');
38
+ const tasks = [];
39
+
40
+ for (const line of text.split(/\r?\n/)) {
41
+ const match = line.match(/^- \[( |x|X)\]\s+(T\d{3})\b\s*(.*)$/);
42
+ if (!match) continue;
43
+ const [, mark, id, title] = match;
44
+ tasks.push({
45
+ id,
46
+ title: title.trim(),
47
+ status: mark.toLowerCase() === 'x' ? 'passed' : 'pending'
56
48
  });
57
49
  }
58
50
 
59
- function summarize(task) {
60
- return {
61
- id: task.id,
62
- title: task.title,
63
- phase: task.phase || 0,
64
- status: statusOf(task),
65
- dependsOn: task.dependsOn || [],
66
- parallel: Boolean(task.parallel),
67
- touches: task.touches || task.files || [],
68
- waitingOn: unmetDependencies(task)
69
- };
70
- }
71
-
72
- const runningTasks = unfinished
73
- .filter((task) => (activePhase === null || (task.phase || 0) === activePhase) && statusOf(task) === 'running')
74
- .map(summarize);
75
-
76
- const readyTasks = unfinished
77
- .filter((task) => {
78
- const taskPhase = task.phase || 0;
79
- const status = statusOf(task);
80
- return (
81
- (activePhase === null || taskPhase === activePhase) &&
82
- status === 'pending' &&
83
- unmetDependencies(task).length === 0
84
- );
85
- })
86
- .map(summarize);
87
-
88
- const blockedTasks = unfinished
89
- .filter((task) => {
90
- const taskPhase = task.phase || 0;
91
- const status = statusOf(task);
92
- return (
93
- (activePhase === null || taskPhase === activePhase) &&
94
- (unmetDependencies(task).length > 0 || blockedStates.has(status))
95
- );
96
- })
97
- .map(summarize);
98
-
99
- const deferredTasks = unfinished
100
- .filter((task) => activePhase !== null && (task.phase || 0) !== activePhase)
101
- .map(summarize);
102
-
103
- const payload = {
104
- changeId: manifest.changeId || manifest.requirementId || 'unknown',
105
- currentTaskId: manifest.currentTaskId || null,
106
- activePhase,
107
- runningTasks,
108
- readyTasks,
109
- parallelCandidates: readyTasks.filter((task) => task.parallel),
110
- blockedTasks,
111
- deferredTasks
112
- };
113
-
114
- if (taskId) {
115
- const task = tasks.find((item) => item.id === taskId);
51
+ if (requestedTask) {
52
+ const task = tasks.find((item) => item.id === requestedTask);
116
53
  if (!task) {
117
- process.stderr.write(`${taskId} not found\n`);
54
+ process.stderr.write(`${requestedTask} not found\n`);
118
55
  process.exit(1);
119
56
  }
120
-
121
- const summary = summarize(task);
122
- process.stdout.write(JSON.stringify({
123
- changeId: payload.changeId,
124
- activePhase,
125
- task: {
126
- ...summary,
127
- ready: readyTasks.some((item) => item.id === taskId),
128
- running: runningTasks.some((item) => item.id === taskId)
129
- }
130
- }, null, 2) + '\n');
57
+ process.stdout.write(`${JSON.stringify({ task, ready: task.status === 'pending' }, null, 2)}\n`);
131
58
  process.exit(0);
132
59
  }
133
60
 
134
- process.stdout.write(JSON.stringify(payload, null, 2) + '\n');
61
+ process.stdout.write(`${JSON.stringify({
62
+ taskFile: tasksPath,
63
+ readyTasks: tasks.filter((task) => task.status === 'pending').slice(0, 1),
64
+ openTasks: tasks.filter((task) => task.status === 'pending'),
65
+ completedTasks: tasks.filter((task) => task.status === 'passed')
66
+ }, null, 2)}\n`);
135
67
  NODE
@@ -1,5 +1,21 @@
1
1
  # CC-Investigate Skill Changelog
2
2
 
3
+ ## v1.6.1 - 2026-05-13
4
+
5
+ - simplify the investigation artifact contract to `task.md` plus Git history
6
+ - remove legacy process-file filename lists from the root-cause handoff rules
7
+
8
+ ## v1.5.3 - 2026-05-13
9
+
10
+ - require repair task blocks to be written directly from `assets/TASKS_TEMPLATE.md`; shorthand TODO tasks are invalid and rejected before machine JSON generation
11
+ - clarify that task document budgets are advisory only and must not cause deletion of root-cause proof, evidence chain, repair boundary, verification, completion, or required task fields
12
+
13
+ ## v1.5.2 - 2026-05-13
14
+
15
+ - route investigation workflow commands through the shared `resolve-cc-devflow.sh` CLI resolver before freezing machine artifacts
16
+ - fail closed when the available CLI lacks `query workflow-context`, `task-contract`, `next-change-key`, or `review`
17
+ - update root-cause task templates so machine JSON generation cannot fall back to simulated adapter output
18
+
3
19
  ## v1.5.1 - 2026-05-13
4
20
 
5
21
  - slim the public `SKILL.md` entrypoint into a thin root-cause contract with conditional escalation packs