aiwcli 0.15.7 → 0.17.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 (272) hide show
  1. package/README.md +106 -1125
  2. package/bin/run.js +0 -4
  3. package/dist/capabilities/installation/control-plane/clear-command.d.ts +2 -0
  4. package/dist/capabilities/installation/control-plane/clear-command.js +32 -3
  5. package/dist/capabilities/installation/control-plane/init-command.js +2 -2
  6. package/dist/capabilities/launch/contracts.d.ts +39 -4
  7. package/dist/capabilities/launch/control-plane/execute-launch.js +158 -119
  8. package/dist/capabilities/launch/runtime-core/launch-decisions.d.ts +82 -0
  9. package/dist/capabilities/launch/runtime-core/launch-decisions.js +202 -0
  10. package/dist/commands/branch.d.ts +1 -1
  11. package/dist/commands/branch.js +1 -1
  12. package/dist/commands/launch.d.ts +0 -5
  13. package/dist/commands/launch.js +2 -37
  14. package/dist/lib/config.js +1 -2
  15. package/dist/lib/context/context-store.js +28 -2
  16. package/dist/lib/core-installer.d.ts +1 -1
  17. package/dist/lib/core-installer.js +6 -27
  18. package/dist/lib/debug.d.ts +0 -10
  19. package/dist/lib/debug.js +0 -10
  20. package/dist/lib/env-sanitizer.d.ts +25 -0
  21. package/dist/lib/env-sanitizer.js +46 -0
  22. package/dist/lib/errors.d.ts +0 -13
  23. package/dist/lib/errors.js +0 -15
  24. package/dist/lib/git-exclude-manager.js +1 -1
  25. package/dist/lib/hooks/context-monitor-logic.d.ts +6 -0
  26. package/dist/lib/hooks/context-monitor-logic.js +25 -0
  27. package/dist/lib/hooks/hook-utils.js +11 -0
  28. package/dist/lib/hooks/prompt-binding-logic.d.ts +7 -0
  29. package/dist/lib/hooks/prompt-binding-logic.js +50 -0
  30. package/dist/lib/hooks/session-end-logic.js +2 -14
  31. package/dist/lib/install-state.js +6 -13
  32. package/dist/lib/json-io.d.ts +12 -0
  33. package/dist/lib/json-io.js +30 -0
  34. package/dist/lib/multiplexer.d.ts +43 -35
  35. package/dist/lib/multiplexer.js +21 -2
  36. package/dist/lib/multiplexers/psmux.d.ts +14 -34
  37. package/dist/lib/multiplexers/psmux.js +70 -130
  38. package/dist/lib/multiplexers/tmux.d.ts +11 -19
  39. package/dist/lib/multiplexers/tmux.js +79 -120
  40. package/dist/lib/multiplexers/wezterm.d.ts +38 -0
  41. package/dist/lib/multiplexers/wezterm.js +225 -0
  42. package/dist/lib/mux-utils.d.ts +4 -3
  43. package/dist/lib/mux-utils.js +7 -13
  44. package/dist/lib/prompt-file-manager.d.ts +23 -0
  45. package/dist/lib/prompt-file-manager.js +41 -0
  46. package/dist/lib/runtime/agent-launcher.d.ts +67 -0
  47. package/dist/lib/runtime/agent-launcher.js +262 -0
  48. package/dist/lib/runtime/aiw-cli.d.ts +2 -0
  49. package/dist/lib/runtime/aiw-cli.js +3 -1
  50. package/dist/lib/runtime/cli-args.d.ts +5 -2
  51. package/dist/lib/runtime/cli-args.js +18 -3
  52. package/dist/lib/runtime/inference.js +3 -14
  53. package/dist/lib/runtime/models.d.ts +6 -0
  54. package/dist/lib/runtime/models.js +6 -0
  55. package/dist/lib/runtime/state-io.d.ts +2 -1
  56. package/dist/lib/runtime/state-io.js +9 -4
  57. package/dist/lib/runtime/utils.d.ts +8 -0
  58. package/dist/lib/runtime/utils.js +31 -1
  59. package/dist/lib/schemas.d.ts +250 -0
  60. package/dist/lib/schemas.js +216 -0
  61. package/dist/lib/sentinel-manager.d.ts +32 -0
  62. package/dist/lib/sentinel-manager.js +62 -0
  63. package/dist/lib/sentinel-wrapper.d.ts +1 -0
  64. package/dist/lib/sentinel-wrapper.js +12 -3
  65. package/dist/lib/settings-hierarchy.js +3 -20
  66. package/dist/lib/shell-adapters/bash-adapter.d.ts +18 -0
  67. package/dist/lib/shell-adapters/bash-adapter.js +69 -0
  68. package/dist/lib/shell-adapters/index.d.ts +5 -0
  69. package/dist/lib/shell-adapters/index.js +7 -0
  70. package/dist/lib/shell-adapters/powershell-adapter.d.ts +18 -0
  71. package/dist/lib/shell-adapters/powershell-adapter.js +62 -0
  72. package/dist/lib/shell-adapters/shell-adapter.d.ts +45 -0
  73. package/dist/lib/shell-adapters/shell-adapter.js +5 -0
  74. package/dist/lib/spawn-errors.d.ts +3 -0
  75. package/dist/lib/spawn-errors.js +15 -1
  76. package/dist/lib/spinner.d.ts +0 -5
  77. package/dist/lib/spinner.js +0 -16
  78. package/dist/lib/template-installer.d.ts +10 -0
  79. package/dist/lib/template-installer.js +4 -4
  80. package/dist/lib/terminal-strategy.d.ts +1 -0
  81. package/dist/lib/terminal-strategy.js +12 -6
  82. package/dist/lib/terminal.d.ts +7 -5
  83. package/dist/lib/terminal.js +42 -19
  84. package/dist/lib/tmux-primitives.d.ts +0 -2
  85. package/dist/lib/tmux-primitives.js +0 -4
  86. package/dist/lib/tmux-session.js +2 -1
  87. package/dist/lib/windsurf-hooks-hierarchy.js +6 -23
  88. package/dist/platform/launch.d.ts +2 -1
  89. package/dist/platform/launch.js +1 -0
  90. package/dist/templates/CLAUDE.md +0 -1
  91. package/dist/templates/cc-native/.claude/settings.json +0 -10
  92. package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +11 -4
  93. package/dist/templates/cc-native/_cc-native/cc-native.config.json +3 -7
  94. package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +26 -47
  95. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +7 -9
  96. package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_write.ts +2 -3
  97. package/dist/templates/cc-native/_cc-native/hooks/mark_questions_asked.ts +2 -2
  98. package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +0 -25
  99. package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +4 -4
  100. package/dist/templates/cc-native/_cc-native/lib-ts/.mocharc.json +9 -0
  101. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/aggregate-agents.test.ts +118 -0
  102. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/artifacts.test.ts +234 -0
  103. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/cc-native-state.test.ts +170 -0
  104. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/cli-output-parser.test.ts +73 -0
  105. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/config.test.ts +64 -0
  106. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/constants.test.ts +40 -0
  107. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/debug.test.ts +42 -0
  108. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/exports.test.ts +58 -0
  109. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/helpers.ts +107 -0
  110. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/add-plan-context.hook.test.ts +97 -0
  111. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/plan-questions.hook.test.ts +81 -0
  112. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/hooks/plan-review.hook.test.ts +71 -0
  113. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/json-parser.test.ts +99 -0
  114. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/orchestrator-agent.test.ts +288 -0
  115. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/orchestrator.test.ts +48 -0
  116. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/reviewers.test.ts +32 -0
  117. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/state.test.ts +124 -0
  118. package/dist/templates/cc-native/_cc-native/lib-ts/__tests__/verdict.test.ts +93 -0
  119. package/dist/templates/cc-native/_cc-native/lib-ts/agent-selection.ts +163 -0
  120. package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +6 -14
  121. package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/format.ts +597 -599
  122. package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/index.ts +26 -26
  123. package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/tracker.ts +106 -107
  124. package/dist/templates/cc-native/_cc-native/{artifacts/lib → lib-ts/artifacts}/write.ts +118 -119
  125. package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +21 -0
  126. package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +16 -15
  127. package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +132 -10
  128. package/dist/templates/cc-native/_cc-native/lib-ts/constants.ts +6 -6
  129. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/corroboration.ts +119 -119
  130. package/dist/templates/cc-native/_cc-native/lib-ts/debug.ts +1 -2
  131. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/graduation.ts +132 -132
  132. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +88 -86
  133. package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +5 -6
  134. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/orchestrator.ts +70 -70
  135. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/output-builder.ts +130 -121
  136. package/dist/templates/cc-native/_cc-native/lib-ts/package-lock.json +1679 -0
  137. package/dist/templates/cc-native/_cc-native/lib-ts/package.json +24 -0
  138. package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +4 -4
  139. package/dist/templates/cc-native/_cc-native/lib-ts/plan-enhancement.ts +1 -6
  140. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/plan-questions.ts +101 -101
  141. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/review-pipeline.ts +511 -543
  142. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/__tests__/agent-providers.test.ts +262 -0
  143. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/agent.ts +71 -85
  144. package/dist/templates/{core/lib-ts/agent-exec → cc-native/_cc-native/lib-ts/reviewers/base}/base-agent.ts +138 -152
  145. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/index.ts +12 -12
  146. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/claude-agent.ts +66 -57
  147. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/codex-agent.ts +185 -200
  148. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/gemini-agent.ts +39 -40
  149. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/providers/orchestrator-claude-agent.ts +196 -224
  150. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/schemas.ts +201 -201
  151. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/reviewers/types.ts +21 -23
  152. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/__tests__/hyde.test.ts +365 -0
  153. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/__tests__/ollama-client.test.ts +223 -0
  154. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/embedding-indexer.ts +12 -16
  155. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/hyde.ts +3 -2
  156. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/index.ts +31 -31
  157. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +6 -7
  158. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/ollama-client.ts +7 -9
  159. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +14 -17
  160. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +37 -41
  161. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-loader.ts +33 -43
  162. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-searcher.ts +20 -20
  163. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +8 -9
  164. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/vector-store.ts +3 -4
  165. package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +50 -126
  166. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +19 -21
  167. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +13 -88
  168. package/dist/templates/cc-native/_cc-native/{plan-review/lib → lib-ts}/verdict.ts +72 -72
  169. package/dist/templates/cc-native/_cc-native/plan-review/CLAUDE.md +35 -0
  170. package/dist/templates/cc-native/_cc-native/plan-review/lib/agent-selection.ts +1 -1
  171. package/dist/templates/cc-native/_cc-native/scripts/council_debate.ts +242 -0
  172. package/dist/templates/cc-native/_cc-native/scripts/council_debate_simple.ts +294 -0
  173. package/dist/templates/cc-native/_cc-native/{plan-review/workflows → workflows}/specdev.md +9 -9
  174. package/dist/templates/core/.claude/skills/codex/SKILL.md +25 -0
  175. package/dist/templates/core/.claude/skills/devin/SKILL.md +25 -0
  176. package/dist/templates/core/.claude/skills/handoff/SKILL.md +11 -0
  177. package/dist/templates/core/.claude/skills/handoff-resume/SKILL.md +11 -0
  178. package/dist/templates/core/.claude/skills/meta-plan/SKILL.md +13 -0
  179. package/dist/templates/core/.codex/skills/codex/SKILL.md +13 -0
  180. package/dist/templates/core/.codex/skills/devin/SKILL.md +19 -0
  181. package/dist/templates/core/.codex/skills/handoff/SKILL.md +11 -0
  182. package/dist/templates/core/.codex/skills/handoff-resume/SKILL.md +11 -0
  183. package/dist/templates/core/.codex/{workflows/meta-plan.md → skills/meta-plan/SKILL.md} +6 -0
  184. package/dist/templates/core/{.cognition → .devin}/AGENTS.md +2 -2
  185. package/dist/templates/core/.devin/skills/codex/SKILL.md +19 -0
  186. package/dist/templates/core/.devin/skills/devin/SKILL.md +13 -0
  187. package/dist/templates/core/.devin/skills/handoff/SKILL.md +11 -0
  188. package/dist/templates/core/.devin/skills/handoff-resume/SKILL.md +11 -0
  189. package/dist/templates/core/.devin/skills/meta-plan/SKILL.md +13 -0
  190. package/dist/templates/core/.windsurf/workflows/handoff-resume.md +9 -0
  191. package/dist/templates/core/hooks-ts/archive_plan.ts +1 -21
  192. package/dist/templates/core/hooks-ts/file-suggestion.ts +1 -19
  193. package/dist/templates/core/hooks-ts/pre_compact.ts +5 -18
  194. package/dist/templates/core/lib-ts/context/context-store.ts +29 -2
  195. package/dist/templates/core/lib-ts/hooks/hook-utils.ts +11 -0
  196. package/dist/templates/core/lib-ts/hooks/session-end-logic.ts +2 -13
  197. package/dist/templates/core/lib-ts/runtime/agent-launcher.ts +74 -0
  198. package/dist/templates/core/lib-ts/runtime/aiw-cli.ts +4 -2
  199. package/dist/templates/core/lib-ts/runtime/cli-args.ts +18 -4
  200. package/dist/templates/core/lib-ts/runtime/inference.ts +3 -15
  201. package/dist/templates/core/lib-ts/runtime/models.ts +7 -0
  202. package/dist/templates/core/lib-ts/runtime/state-io.ts +9 -4
  203. package/dist/templates/core/lib-ts/runtime/utils.ts +30 -1
  204. package/dist/templates/core/lib-ts/schemas.ts +233 -0
  205. package/dist/templates/core/scripts/resolve-run.ts +34 -2
  206. package/dist/templates/core/scripts/status_line.ts +1 -1
  207. package/dist/templates/core/skills/codex/CLAUDE.md +9 -4
  208. package/dist/templates/core/skills/codex/SKILL.md +6 -0
  209. package/dist/templates/core/skills/codex/lib/codex-watcher.ts +3 -10
  210. package/dist/templates/core/skills/codex/scripts/launch-codex.ts +26 -26
  211. package/dist/templates/core/skills/devin/CLAUDE.md +63 -6
  212. package/dist/templates/core/skills/devin/lib/devin-watcher.ts +116 -96
  213. package/dist/templates/core/skills/devin/scripts/launch-devin.ts +22 -21
  214. package/dist/templates/core/skills/handoff-system/CLAUDE.md +1 -1
  215. package/oclif.manifest.json +4 -4
  216. package/package.json +4 -4
  217. package/dist/lib/base-command.d.ts +0 -1
  218. package/dist/lib/base-command.js +0 -1
  219. package/dist/lib/env-compat.d.ts +0 -18
  220. package/dist/lib/env-compat.js +0 -23
  221. package/dist/lib/launch-options.d.ts +0 -1
  222. package/dist/lib/launch-options.js +0 -1
  223. package/dist/lib/stdin.d.ts +0 -48
  224. package/dist/lib/stdin.js +0 -60
  225. package/dist/templates/cc-native/_cc-native/CLAUDE.md +0 -73
  226. package/dist/templates/cc-native/_cc-native/artifacts/CLAUDE.md +0 -64
  227. package/dist/templates/cc-native/_cc-native/lib-ts/CLAUDE.md +0 -70
  228. package/dist/templates/cc-native/_cc-native/plan-review/CODING-STANDARDS-CHECKLIST.md +0 -75
  229. package/dist/templates/cc-native/_cc-native/plan-review/agents/CLAUDE.md +0 -143
  230. package/dist/templates/cc-native/_cc-native/plan-review/agents/PLAN-ORCHESTRATOR.md +0 -213
  231. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-questions/PLAN-QUESTIONER.md +0 -70
  232. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-EVOLUTION.md +0 -62
  233. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-PATTERNS.md +0 -61
  234. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-STRUCTURE.md +0 -62
  235. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ASSUMPTION-TRACER.md +0 -56
  236. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CLARITY-AUDITOR.md +0 -53
  237. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-FEASIBILITY.md +0 -66
  238. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-GAPS.md +0 -70
  239. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-ORDERING.md +0 -62
  240. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CONSTRAINT-VALIDATOR.md +0 -72
  241. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-ADR-VALIDATOR.md +0 -61
  242. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-SCALE-MATCHER.md +0 -64
  243. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DEVILS-ADVOCATE.md +0 -56
  244. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DOCUMENTATION-PHILOSOPHY.md +0 -86
  245. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HANDOFF-READINESS.md +0 -59
  246. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HIDDEN-COMPLEXITY.md +0 -58
  247. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/INCREMENTAL-DELIVERY.md +0 -66
  248. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-DEPENDENCY.md +0 -62
  249. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-FMEA.md +0 -66
  250. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-PREMORTEM.md +0 -71
  251. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-REVERSIBILITY.md +0 -74
  252. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SCOPE-BOUNDARY.md +0 -77
  253. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SIMPLICITY-GUARDIAN.md +0 -62
  254. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SKEPTIC.md +0 -68
  255. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md +0 -61
  256. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-CHARACTERIZATION.md +0 -71
  257. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-FIRST-VALIDATOR.md +0 -61
  258. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md +0 -61
  259. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-COSTS.md +0 -67
  260. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-STAKEHOLDERS.md +0 -65
  261. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-COVERAGE.md +0 -74
  262. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-STRENGTH.md +0 -69
  263. package/dist/templates/cc-native/_cc-native/plan-review/lib/reviewers/base/base-agent.ts +0 -7
  264. package/dist/templates/core/.codex/workflows/codex.md +0 -17
  265. package/dist/templates/core/.codex/workflows/handoff.md +0 -5
  266. package/dist/templates/core/lib-ts/agent-exec/backends/headless.ts +0 -34
  267. package/dist/templates/core/lib-ts/agent-exec/backends/index.ts +0 -6
  268. package/dist/templates/core/lib-ts/agent-exec/backends/tmux.ts +0 -148
  269. package/dist/templates/core/lib-ts/agent-exec/execution-backend.ts +0 -50
  270. package/dist/templates/core/lib-ts/agent-exec/index.ts +0 -6
  271. package/dist/templates/core/lib-ts/agent-exec/structured-output.ts +0 -165
  272. /package/dist/templates/core/{.cognition → .devin}/config.json +0 -0
@@ -12,7 +12,10 @@ import path from "node:path";
12
12
 
13
13
  import { findLatestPlan } from "../../../lib-ts/context/plan-manager.js";
14
14
  import {
15
+ cleanupSentinel,
16
+ eprint,
15
17
  findLatestPlanByMtime,
18
+ getWellKnownSummaryPath,
16
19
  resolveContextForLaunch,
17
20
  writeFileRefPromptFile,
18
21
  writeInlinePromptFile,
@@ -31,22 +34,6 @@ const DEVIN_ALIASES: Record<string, string> = {
31
34
  opus: DEVIN_MODELS.opus,
32
35
  };
33
36
 
34
- // ---------------------------------------------------------------------------
35
- // Helpers
36
- // ---------------------------------------------------------------------------
37
-
38
- function eprint(...args: unknown[]): void {
39
- process.stderr.write(args.map(String).join(" ") + "\n");
40
- }
41
-
42
- function cleanupSentinel(sentinelPath: string | null | undefined): void {
43
- if (!sentinelPath) return;
44
- try {
45
- const dir = path.dirname(sentinelPath);
46
- fs.rmSync(dir, { recursive: true, force: true });
47
- } catch { /* best-effort */ }
48
- }
49
-
50
37
  // ---------------------------------------------------------------------------
51
38
  // Arg parsing
52
39
  // ---------------------------------------------------------------------------
@@ -61,6 +48,7 @@ if (rawArgs.length === 0) {
61
48
  let modelFlag: string | undefined;
62
49
  let contextFlag: string | undefined;
63
50
  let extraPrompt: string | undefined;
51
+ let taskId: string | undefined;
64
52
  let watch = true;
65
53
  const args: string[] = [];
66
54
 
@@ -71,6 +59,8 @@ for (let i = 0; i < rawArgs.length; i++) {
71
59
  contextFlag = rawArgs[++i];
72
60
  } else if (rawArgs[i] === "--prompt" && i + 1 < rawArgs.length) {
73
61
  extraPrompt = rawArgs[++i];
62
+ } else if (rawArgs[i] === "--task-id" && i + 1 < rawArgs.length) {
63
+ taskId = rawArgs[++i];
74
64
  } else if (rawArgs[i] === "--no-watch") {
75
65
  watch = false;
76
66
  } else if (rawArgs[i] === "--prompt") {
@@ -160,9 +150,18 @@ if (args[0] === "plan") {
160
150
  // ---------------------------------------------------------------------------
161
151
 
162
152
  const launchCwd = process.env.AIW_CALLER_CWD?.trim() || process.cwd();
153
+
154
+ // Generate task ID if not provided by caller.
155
+ if (!taskId) {
156
+ taskId = `${Date.now()}-${process.pid}`;
157
+ }
158
+ const wellKnownPath = getWellKnownSummaryPath("devin", taskId, projectRoot);
159
+ console.log(`Task ID: ${taskId}`);
160
+ console.log(`Summary will be at: ${wellKnownPath}`);
161
+
163
162
  if (resolvedModel) console.log(`Model: ${resolvedModel}${modelFlag !== resolvedModel ? ` (from "${modelFlag}")` : ""}`);
164
163
 
165
- logDebug("devin-skill", `Launching: model=${resolvedModel ?? "default"}, extraPrompt=${Boolean(extraPrompt)}, source=${args[0]}, bytes=${promptPath ? fs.statSync(promptPath).size : 0}`);
164
+ logDebug("devin-skill", `Launching: model=${resolvedModel ?? "default"}, taskId=${taskId}, extraPrompt=${Boolean(extraPrompt)}, source=${args[0]}, bytes=${promptPath ? fs.statSync(promptPath).size : 0}`);
166
165
 
167
166
  const launchStartedAtMs = Date.now();
168
167
 
@@ -228,22 +227,24 @@ if (watch && (result.paneId || result.sentinelPath)) {
228
227
 
229
228
  const summary = (await summarizeDevinSession(projectRoot, launchStartedAtMs, result.paneId))
230
229
  ?? SUMMARY_UNAVAILABLE_MESSAGE;
231
- const summaryPath = persistSummary(summary, "devin");
230
+ const summaryPath = persistSummary(summary, "devin", undefined, taskId, projectRoot);
232
231
 
233
232
  console.log("\n--- Devin Session Summary ---");
234
233
  console.log(summary);
234
+ console.log(`\n[well_known_summary:${wellKnownPath}]`);
235
235
  if (summaryPath) {
236
- console.log(`\n[summary_file:${summaryPath}]`);
236
+ console.log(`[summary_file:${summaryPath}]`);
237
237
  }
238
238
  } catch (error) {
239
239
  logWarn("devin-skill", `Watch flow failed: ${String(error)}`);
240
240
  const { persistSummary: persistFallback } = await import("../lib/devin-watcher.js");
241
241
  const fallbackMsg = "Devin session completed. Summary unavailable (watch error).";
242
- const fallbackPath = persistFallback(fallbackMsg, "devin");
242
+ const fallbackPath = persistFallback(fallbackMsg, "devin", undefined, taskId, projectRoot);
243
243
  console.log("\n--- Devin Session Summary ---");
244
244
  console.log(fallbackMsg);
245
+ console.log(`\n[well_known_summary:${wellKnownPath}]`);
245
246
  if (fallbackPath) {
246
- console.log(`\n[summary_file:${fallbackPath}]`);
247
+ console.log(`[summary_file:${fallbackPath}]`);
247
248
  }
248
249
  } finally {
249
250
  cleanupSentinel(result.sentinelPath);
@@ -432,5 +432,5 @@ Both `.aiwcli/_core/skills/handoff-system/` (working copy) and `packages/cli/src
432
432
  **Windsurf and Codex workflows also reference scripts:**
433
433
  When updating script paths, check:
434
434
  - `packages/cli/src/templates/core/.windsurf/workflows/handoff.md`
435
- - `packages/cli/src/templates/core/.codex/workflows/handoff.md`
435
+ - `packages/cli/src/templates/core/.codex/skills/handoff.md`
436
436
 
@@ -393,15 +393,15 @@
393
393
  "type": "option"
394
394
  },
395
395
  "split": {
396
- "description": "Split direction when in tmux (auto|h|v, default: auto)",
396
+ "description": "Split direction when in multiplexer (auto|horizontal|vertical, default: auto)",
397
397
  "name": "split",
398
398
  "required": false,
399
399
  "hasDynamicHelp": false,
400
400
  "multiple": false,
401
401
  "options": [
402
402
  "auto",
403
- "h",
404
- "v"
403
+ "horizontal",
404
+ "vertical"
405
405
  ],
406
406
  "type": "option"
407
407
  },
@@ -510,5 +510,5 @@
510
510
  ]
511
511
  }
512
512
  },
513
- "version": "0.15.7"
513
+ "version": "0.17.0"
514
514
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiwcli",
3
3
  "description": "AI Workflow CLI - Command-line interface for AI-powered workflows",
4
- "version": "0.15.7",
4
+ "version": "0.17.0",
5
5
  "author": "jofu-tofu",
6
6
  "bin": {
7
7
  "aiw": "bin/run.js"
@@ -27,6 +27,7 @@
27
27
  "@types/chai": "^4",
28
28
  "@types/node": "^18",
29
29
  "@types/sinon": "^21.0.0",
30
+ "@vitest/coverage-v8": "^3.2.4",
30
31
  "c8": "^10.1.3",
31
32
  "chai": "^4",
32
33
  "chokidar": "^5.0.0",
@@ -43,7 +44,7 @@
43
44
  "ts-node": "^10",
44
45
  "typescript": "^5",
45
46
  "vitest": "^3.2.4",
46
- "@vitest/coverage-v8": "^3.2.4"
47
+ "zod": "^4.3.6"
47
48
  },
48
49
  "engines": {
49
50
  "node": ">=18.0.0"
@@ -82,7 +83,7 @@
82
83
  },
83
84
  "scripts": {
84
85
  "build": "shx rm -rf dist && tsc -b && npm run build:templates",
85
- "build:templates": "npm run sync:shared-lib && npm run sync:cc-native && shx mkdir -p dist/templates && shx cp -r src/templates/core dist/templates/ && shx cp -r src/templates/cc-native dist/templates/ && shx cp src/templates/CLAUDE.md dist/templates/",
86
+ "build:templates": "npm run sync:shared-lib && shx mkdir -p dist/templates && shx cp -r src/templates/core dist/templates/ && shx cp -r src/templates/cc-native dist/templates/ && shx cp src/templates/CLAUDE.md dist/templates/",
86
87
  "build:watch": "tsc -b --watch",
87
88
  "check": "npm run lint && npm run build",
88
89
  "clean": "shx rm -rf dist",
@@ -103,7 +104,6 @@
103
104
  "test:watch": "vitest",
104
105
  "version": "oclif readme && git add README.md",
105
106
  "watch": "run-p dev:watch test:watch",
106
- "sync:cc-native": "node ./scripts/sync-cc-native.mjs",
107
107
  "sync:shared-lib": "node ./scripts/sync-shared-lib.mjs"
108
108
  },
109
109
  "types": "dist/index.d.ts"
@@ -1 +0,0 @@
1
- export { default } from '../cli/base-command.js';
@@ -1 +0,0 @@
1
- export { default } from '../cli/base-command.js';
@@ -1,18 +0,0 @@
1
- /**
2
- * Environment Variable Layer
3
- *
4
- * Provides environment variable resolution for AIW CLI.
5
- *
6
- * Environment variables:
7
- * - AIW_DIR: Main installation directory
8
- * - AIW_CONFIG: Configuration file path
9
- */
10
- /**
11
- * Load environment variables.
12
- * Call this early in application bootstrap.
13
- */
14
- export declare function loadEnvWithCompatibility(): void;
15
- /**
16
- * Get AIW_DIR environment variable
17
- */
18
- export declare function getAiwDir(): string | undefined;
@@ -1,23 +0,0 @@
1
- /**
2
- * Environment Variable Layer
3
- *
4
- * Provides environment variable resolution for AIW CLI.
5
- *
6
- * Environment variables:
7
- * - AIW_DIR: Main installation directory
8
- * - AIW_CONFIG: Configuration file path
9
- */
10
- /**
11
- * Load environment variables.
12
- * Call this early in application bootstrap.
13
- */
14
- export function loadEnvWithCompatibility() {
15
- // DA (Assistant name) - Keep for backward compatibility, no warning
16
- // This is commonly used and doesn't need migration
17
- }
18
- /**
19
- * Get AIW_DIR environment variable
20
- */
21
- export function getAiwDir() {
22
- return process.env['AIW_DIR'];
23
- }
@@ -1 +0,0 @@
1
- export { buildSpawnedWindowArgs, type BuildSpawnedWindowArgsParams, buildUniqueSessionName, parseExtraEnv, resolvePromptText, sanitizeSessionName, } from '../capabilities/launch/runtime-core/launch-options.js';
@@ -1 +0,0 @@
1
- export { buildSpawnedWindowArgs, buildUniqueSessionName, parseExtraEnv, resolvePromptText, sanitizeSessionName, } from '../capabilities/launch/runtime-core/launch-options.js';
@@ -1,48 +0,0 @@
1
- /**
2
- * stdin Detection and Reading Utilities
3
- *
4
- * Provides utilities for detecting and reading piped input from stdin.
5
- * Used by commands that need to accept piped data from other commands.
6
- *
7
- * @example Basic stdin detection
8
- * ```typescript
9
- * if (hasStdin()) {
10
- * const input = await readStdin()
11
- * // Process piped input
12
- * } else {
13
- * // Interactive mode - prompt user
14
- * }
15
- * ```
16
- */
17
- /**
18
- * Check if stdin has piped data available.
19
- * Returns true when data is piped into the command, false in interactive terminals.
20
- *
21
- * @returns True if stdin is piped (not a TTY), false if interactive terminal
22
- *
23
- * @example
24
- * ```typescript
25
- * // echo "data" | pai process
26
- * hasStdin() // Returns true
27
- *
28
- * // pai process (no pipe)
29
- * hasStdin() // Returns false
30
- * ```
31
- */
32
- export declare function hasStdin(): boolean;
33
- /**
34
- * Read all data from stdin.
35
- * Reads piped input data and returns as UTF-8 string.
36
- * Returns empty string if no stdin available.
37
- *
38
- * @returns Promise resolving to stdin content as string, or empty string if no stdin
39
- *
40
- * @example
41
- * ```typescript
42
- * const input = await readStdin()
43
- * if (input) {
44
- * console.log(`Received: ${input}`)
45
- * }
46
- * ```
47
- */
48
- export declare function readStdin(): Promise<string>;
package/dist/lib/stdin.js DELETED
@@ -1,60 +0,0 @@
1
- /**
2
- * stdin Detection and Reading Utilities
3
- *
4
- * Provides utilities for detecting and reading piped input from stdin.
5
- * Used by commands that need to accept piped data from other commands.
6
- *
7
- * @example Basic stdin detection
8
- * ```typescript
9
- * if (hasStdin()) {
10
- * const input = await readStdin()
11
- * // Process piped input
12
- * } else {
13
- * // Interactive mode - prompt user
14
- * }
15
- * ```
16
- */
17
- import { stdin } from 'node:process';
18
- /**
19
- * Check if stdin has piped data available.
20
- * Returns true when data is piped into the command, false in interactive terminals.
21
- *
22
- * @returns True if stdin is piped (not a TTY), false if interactive terminal
23
- *
24
- * @example
25
- * ```typescript
26
- * // echo "data" | pai process
27
- * hasStdin() // Returns true
28
- *
29
- * // pai process (no pipe)
30
- * hasStdin() // Returns false
31
- * ```
32
- */
33
- export function hasStdin() {
34
- return stdin.isTTY !== true;
35
- }
36
- /**
37
- * Read all data from stdin.
38
- * Reads piped input data and returns as UTF-8 string.
39
- * Returns empty string if no stdin available.
40
- *
41
- * @returns Promise resolving to stdin content as string, or empty string if no stdin
42
- *
43
- * @example
44
- * ```typescript
45
- * const input = await readStdin()
46
- * if (input) {
47
- * console.log(`Received: ${input}`)
48
- * }
49
- * ```
50
- */
51
- export async function readStdin() {
52
- if (!hasStdin()) {
53
- return '';
54
- }
55
- const chunks = [];
56
- for await (const chunk of stdin) {
57
- chunks.push(chunk);
58
- }
59
- return Buffer.concat(chunks).toString('utf8');
60
- }
@@ -1,73 +0,0 @@
1
- # CC-Native Method
2
-
3
- **Location:** `.aiwcli/_cc-native/` — Claude Code-specific plan review, artifacts, and agent orchestration.
4
-
5
- ---
6
-
7
- ## Subsystems
8
-
9
- | Directory | Purpose | CLAUDE.md |
10
- |-----------|---------|-----------|
11
- | `agents/` | Plan review agent roster and specs | `agents/CLAUDE.md` |
12
- | `artifacts/` | Review artifact generation and tracking | `artifacts/CLAUDE.md` |
13
- | `hooks/` | CC-native hook entry points (plan review triggers) | `hooks/CLAUDE.md` |
14
- | `lib-ts/` | Shared TypeScript library for cc-native subsystems | `lib-ts/CLAUDE.md` |
15
- | `lib-ts/rlm/` | Retrieval-augmented learning memory | `lib-ts/rlm/CLAUDE.md` |
16
- | `plan-review/` | Multi-agent plan review pipeline | `plan-review/CLAUDE.md` |
17
-
18
- ---
19
-
20
- ## Shared Infrastructure (`_core/lib-ts/`)
21
-
22
- CC-native code depends heavily on shared infrastructure. Full API details: `_core/lib-ts/CLAUDE.md`.
23
-
24
- | Module | Capability | Use When |
25
- |--------|-----------|----------|
26
- | `hooks/hook-utils` | Hook lifecycle (load input, run, emit context) | Writing hooks |
27
- | `runtime/logger` | Structured logging (debug/info/warn/error) | Any hook or lib module |
28
- | `runtime/constants` | Project paths, context dirs, sanitization | Resolving file locations |
29
- | `runtime/subprocess-utils` | Find executables, exec with env, shell quoting | Spawning agent CLIs |
30
- | `runtime/cli-args` | CLI invocation builder, review spec construction | Launching review agents |
31
- | `runtime/atomic-write` | Crash-safe file writes | Writing state or artifacts |
32
- | `runtime/state-io` | State read/write helpers | Context state persistence |
33
- | `runtime/inference` | Claude CLI subprocess calls | AI inference from hooks |
34
- | `context/context-store` | Context CRUD (get by session, list all) | Session/context binding |
35
- | `context/plan-manager` | Plan lifecycle (archive, hash, sign) | Plan discovery and hashing |
36
- | `types` | Shared type definitions (`ContextState`, etc.) | Type imports |
37
-
38
- ---
39
-
40
- ## Import Patterns
41
-
42
- **Import direction:** `hooks/` → `lib-ts/` → `_core/lib-ts/`. Never the reverse.
43
-
44
- ```typescript
45
- // From hooks/ (2 levels up to _core):
46
- import { runHook, logInfo } from "../../_core/lib-ts/hooks/hook-utils.js";
47
- import { loadConfig } from "../lib-ts/config.js";
48
-
49
- // From lib-ts/ (2 levels up to _core):
50
- import { logDebug } from "../../_core/lib-ts/runtime/logger.js";
51
- import { atomicWrite } from "../../_core/lib-ts/runtime/atomic-write.js";
52
-
53
- // From plan-review/lib/ (3 levels up to _core):
54
- import { logInfo } from "../../../_core/lib-ts/runtime/logger.js";
55
- ```
56
-
57
- ---
58
-
59
- ## Context Maintenance
60
-
61
- **After modifying files in this directory:** scan the entries above — if any claim is now
62
- false or incomplete, update this file before ending the task. Do not defer.
63
-
64
- **Add** an entry only if an agent would fail without knowing it, it is not obvious from
65
- the code, and it belongs at this scope.
66
-
67
- **Remove** any entry that fails the falsifiability test: if removing it would not change
68
- how an agent acts here, remove it.
69
-
70
- **Staleness anchor:** This file assumes `lib-ts/index.ts` exists. If it doesn't, this file
71
- is stale — update or regenerate before relying on it.
72
-
73
- <!-- context-layer: generated=2026-03-01 | last-audited=2026-03-01 | version=1 | dir-commits-at-audit=15 -->
@@ -1,64 +0,0 @@
1
- # Artifacts System
2
-
3
- Review artifact generation, formatting, and file I/O for the plan review pipeline.
4
-
5
- ## Overview
6
-
7
- The artifacts system handles all output files produced by plan review runs: combined markdown reports, JSON results, inline summaries, corroboration reports, and the review tracker. It is a pure library — no hooks or scripts.
8
-
9
- ## File Structure
10
-
11
- ```
12
- artifacts/
13
- ├── CLAUDE.md ← This file
14
- └── lib/
15
- ├── index.ts ← Barrel re-export of all public API
16
- ├── format.ts ← Pure formatting functions (markdown, JSON, summaries)
17
- ├── write.ts ← File I/O: atomic writes to context reviews dir
18
- └── tracker.ts ← Review tracker: read/write/hash extraction
19
- ```
20
-
21
- ## Public API (`lib/index.ts`)
22
-
23
- | Function | Source | Purpose |
24
- |----------|--------|---------|
25
- | `formatReviewMarkdown` | format.ts | Format single agent review as markdown |
26
- | `formatCombinedMarkdown` | format.ts | Format all agent reviews into combined markdown |
27
- | `buildInlineReviewSummary` | format.ts | Short inline summary for context injection |
28
- | `extractTopIssuesText` | format.ts | Extract top issues as text block |
29
- | `buildHighIssuesDocument` | format.ts | Full high-issues document for context |
30
- | `buildCorroborationReport` | format.ts | Corroboration analysis markdown report |
31
- | `generateReviewIndex` | format.ts | Index markdown linking all review files |
32
- | `buildCombinedJson` | format.ts | Combined JSON artifact for all reviews |
33
- | `writeCombinedArtifacts` | write.ts | Write all artifacts to context reviews dir |
34
- | `writeFile` | write.ts | Atomic file write |
35
- | `writeFileNonCritical` | write.ts | Non-atomic file write (non-critical paths) |
36
- | `writeReviewTracker` | tracker.ts | Write review tracker JSON to disk |
37
- | `extractPreviousHashes` | tracker.ts | Read previous plan hashes from tracker |
38
- | `ReviewTrackerEntry` | tracker.ts | Type: single tracker entry |
39
-
40
- ## Dependencies
41
-
42
- - `../../lib-ts/types.ts` — `CombinedReviewResult`, `CorroborationResult` types
43
- - `../../lib-ts/constants.ts` — `ENABLE_ROBUST_PLAN_WRITES` feature flag
44
- - `../../../_core/lib-ts/runtime/atomic-write.ts` — atomic file I/O
45
- - `../../../_core/lib-ts/runtime/constants.ts` — `sanitizeFilename`
46
- - `../../../_core/lib-ts/runtime/logger.ts` — logging
47
-
48
- ## Hooks
49
-
50
- Hooks for this system are NOT co-located here. Hooks are path-referenced in `.claude/settings.json` at install time. Moving a hook file requires settings.json updates in both `.aiwcli/` and `packages/cli/src/templates/`, which is high blast-radius and fragile.
51
-
52
- The artifacts system is invoked indirectly through the plan review pipeline — it has no dedicated hooks. See `../_cc-native/hooks/` for the plan review hooks that drive this system.
53
-
54
- ## Callers
55
-
56
- - `../plan-review/lib/review-pipeline.ts` — primary caller, writes all review artifacts
57
- - `../../lib-ts/index.ts` — re-exports public API surface
58
-
59
- ## Design Decisions
60
-
61
- - **Pure library:** No global state, no side effects except file I/O in write.ts/tracker.ts
62
- - **Atomic writes:** `write.ts` uses atomic writes (write to temp + rename) for critical review files when `ENABLE_ROBUST_PLAN_WRITES` is set, preventing partial writes on crash
63
- - **format.ts is pure:** All formatting is pure functions — takes data, returns strings. No file I/O.
64
- - **Co-location:** Moved from `lib-ts/artifacts/` to `artifacts/lib/` to give the system peer-level status alongside `plan-review/` and `rlm/`
@@ -1,70 +0,0 @@
1
- # CC-Native Library
2
-
3
- **Location:** `_cc-native/lib-ts/` — TypeScript modules for plan review, state, and agent orchestration.
4
-
5
- **Import direction:** `hooks/` → `lib-ts/` → `_core/lib-ts/`. Never the reverse.
6
-
7
- ---
8
-
9
- ## Module Reference
10
-
11
- The barrel `index.ts` re-exports most modules. Three files are **not** re-exported and must be imported directly: `plan-discovery.ts`, `plan-enhancement.ts`, `settings.ts`.
12
-
13
- | File | Purpose | Key Exports |
14
- |------|---------|-------------|
15
- | `aggregate-agents.ts` | Agent frontmatter parser — loads agent configs from markdown | `aggregateAgents`, `extractBody`, `extractFrontmatter` |
16
- | `cc-native-state.ts` | CC-native state accessor for context `state.json` | `getCcNativeState`, `saveCcNativeState`, `isPlanAlreadyReviewed`, `markPlanReviewed`, `markQuestionsAsked` |
17
- | `cli-output-parser.ts` | Unified Claude CLI JSON output parser | `parseCliOutput` |
18
- | `config.ts` | Configuration loading from `cc-native.config.json` | `loadConfig`, `getDisplaySettings` |
19
- | `constants.ts` | Feature flags, security limits, path validation | `ENABLE_ROBUST_PLAN_WRITES`, `PLANS_DIR`, `validatePlanPath`, `MAX_RETRY_ATTEMPTS` |
20
- | `debug.ts` | Per-context debug logging (thin layer over shared logger) | `debugLog`, `debugRaw`, `getDebugDir`, `cleanupDebugFolder` |
21
- | `index.ts` | Barrel — re-exports public API from all modules | (see individual modules) |
22
- | `json-parser.ts` | JSON parsing with recovery for LLM responses | `parseJsonMaybe`, `coerceToReview` |
23
- | `plan-discovery.ts` | Plan file discovery, reading, and hashing | *(not re-exported)* — import directly |
24
- | `plan-enhancement.ts` | Plan quality guidance prompt for context emission | *(not re-exported)* — import directly |
25
- | `settings.ts` | Settings loading, defaults, agent library management | *(not re-exported)* — import directly |
26
- | `state.ts` | Iteration state management for plan review cycles | `loadState`, `saveStateToPlan`, `getIterationState`, `shouldContinueIterating` |
27
- | `types.ts` | All cc-native type definitions and prompt constants | `Verdict`, `ReviewData`, `AgentConfig`, `PlanReviewConfig`, `REVIEW_SCHEMA` |
28
-
29
- **Subfolder:** `rlm/` — retrieval-augmented learning memory. Has its own `rlm/CLAUDE.md`.
30
-
31
- ---
32
-
33
- ## Shared Dependencies
34
-
35
- These `_core/lib-ts` modules are used across cc-native lib-ts:
36
-
37
- | Shared Module | Used By |
38
- |--------------|---------|
39
- | `runtime/logger` | All modules (logging) |
40
- | `runtime/atomic-write` | `state.ts` (crash-safe writes) |
41
- | `runtime/utils` | `cc-native-state.ts` (`nowIso`) |
42
- | `context/context-store` | `cc-native-state.ts` (state access) |
43
- | `context/plan-manager` | `plan-discovery.ts` (plan path lookup) |
44
- | `types` | `types.ts` (re-exports `ContextState`, `HookInput`, `HookOutput`) |
45
-
46
- ---
47
-
48
- ## Import Direction
49
-
50
- ```
51
- hooks/ (entry points — import from lib-ts/ and _core/)
52
-
53
- lib-ts/ (this directory — import from _core/ only)
54
-
55
- _core/lib-ts/ (cross-method infrastructure — no reverse imports)
56
- ```
57
-
58
- Never import from `hooks/` or `plan-review/` into `lib-ts/`. The one exception noted in `aggregate-agents.ts`: it stays in `lib-ts/` because both `settings.ts` and `plan-review/` depend on it.
59
-
60
- ---
61
-
62
- ## Context Maintenance
63
-
64
- **After modifying files in this directory:** scan the entries above — if any claim is now
65
- false or incomplete, update this file before ending the task. Do not defer.
66
-
67
- **Staleness anchor:** This file assumes `index.ts` exists with 13 sibling `.ts` files. If the
68
- count changes, update the Module Reference table.
69
-
70
- <!-- context-layer: generated=2026-03-01 | last-audited=2026-03-01 | version=1 | dir-commits-at-audit=15 -->
@@ -1,75 +0,0 @@
1
- # Coding Standards Checklist
2
-
3
- Standards that address the most common plan review failure modes. Reference this
4
- when planning code changes in established codebases.
5
-
6
- ---
7
-
8
- ## 1. Test-First Design Thinking
9
-
10
- Tests are an architectural constraint, not an afterthought. Design from the test
11
- perspective first.
12
-
13
- - **Interface-first:** Before describing implementation, ask: "Can I write the test
14
- for this before the implementation exists?" If the answer is unclear, the interface
15
- needs more thought.
16
- - **Structure tests before code:** Plans that describe "implement then test" consistently
17
- fail review. Restructure: define what the tests assert, then describe the implementation
18
- that satisfies them.
19
- - **Testability as architecture:** Design for dependency injection, interface seams, and
20
- fakes. If a component can't be tested in isolation, the coupling is too tight.
21
- - **Test categories:** Consider which test types apply — unit (isolated logic), integration
22
- (module boundaries), contract (API surfaces), and characterization (existing behavior
23
- preservation during refactoring).
24
- - **Verification clarity:** Each planned change should have a corresponding verification
25
- step that is binary-testable (pass/fail in one check, no subjective judgment).
26
-
27
- ---
28
-
29
- ## 2. File Structure & Codebase Convention Fit
30
-
31
- Don't pick a "plausible" location — pick the location that matches the project's
32
- established patterns.
33
-
34
- - **Discover before proposing:** Before suggesting new files or directories, verify where
35
- similar things already live in this project. Use Glob/Grep to find existing patterns.
36
- - **Naming conventions:** Match existing module and file naming patterns. If the project
37
- uses `kebab-case.ts`, don't introduce `camelCase.ts`. If hooks live in `hooks/`, don't
38
- create a `hook-handlers/` directory.
39
- - **Co-location patterns:** Check if the project follows co-location (tests next to source,
40
- types with implementation) or separation (dedicated `__tests__/`, `types/` directories).
41
- Follow what exists.
42
- - **Import depth:** Verify that new files fit the existing import hierarchy. Adding a file
43
- that requires imports to cross architectural boundaries (e.g., shared lib importing from
44
- feature code) signals a structural problem.
45
- - **Existing system boundaries:** Check if the project has documented system boundaries
46
- (CLAUDE.md, architecture docs). New files should respect these boundaries rather than
47
- create cross-cutting dependencies.
48
-
49
- ---
50
-
51
- ## 3. Extensibility & Future-Proofing Analysis
52
-
53
- Balance: don't over-engineer (YAGNI), but don't create designs that actively resist
54
- extension.
55
-
56
- - **Adjacent features:** What features are most commonly built after this one? Does the
57
- design accommodate those extensions without major restructuring?
58
- - **Extension points:** Where would future developers need to hook in? Are those seams
59
- accessible, or does the design require forking/copying to extend?
60
- - **Configuration vs. code changes:** Will common customizations require code changes, or
61
- can they be handled through configuration? Prefer the latter when the variation space
62
- is predictable.
63
- - **Data model flexibility:** Are data structures designed to accommodate likely additions
64
- (new fields, new types) without breaking existing consumers?
65
- - **Inversion of control:** Does the design allow callers to inject behavior, or does it
66
- hardcode decisions that callers will need to override? Prefer interfaces and callbacks
67
- over concrete implementations when variation is expected.
68
-
69
- ---
70
-
71
- ## Applicability
72
-
73
- These standards apply to production code in established codebases with existing conventions.
74
- For prototypes, scripts, spike explorations, or greenfield projects without established
75
- patterns, use judgment on which standards apply — not all will be relevant.