aiwcli 0.12.7 → 0.13.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 (134) hide show
  1. package/dist/commands/clean.d.ts +7 -0
  2. package/dist/commands/clean.js +17 -8
  3. package/dist/commands/clear.d.ts +85 -0
  4. package/dist/commands/clear.js +455 -347
  5. package/dist/commands/init/index.d.ts +15 -0
  6. package/dist/commands/init/index.js +79 -38
  7. package/dist/lib/gitignore-manager.js +12 -13
  8. package/dist/lib/settings-hierarchy.d.ts +13 -1
  9. package/dist/lib/settings-hierarchy.js +1 -1
  10. package/dist/lib/template-linter.d.ts +4 -0
  11. package/dist/lib/template-linter.js +1 -1
  12. package/dist/lib/tty-detection.d.ts +1 -0
  13. package/dist/lib/tty-detection.js +1 -0
  14. package/dist/templates/CLAUDE.md +27 -0
  15. package/dist/templates/_shared/.claude/settings.json +7 -7
  16. package/dist/templates/_shared/.claude/{commands/handoff.md → skills/handoff/SKILL.md} +4 -3
  17. package/dist/templates/_shared/.claude/{commands/handoff-resume.md → skills/handoff-resume/SKILL.md} +3 -2
  18. package/dist/templates/_shared/.claude/skills/meta-plan/SKILL.md +43 -0
  19. package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
  20. package/dist/templates/_shared/.codex/workflows/meta-plan.md +347 -0
  21. package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
  22. package/dist/templates/_shared/.windsurf/workflows/meta-plan.md +347 -0
  23. package/dist/templates/_shared/hooks-ts/lint_after_edit.ts +59 -0
  24. package/dist/templates/_shared/hooks-ts/session_end.ts +11 -10
  25. package/dist/templates/_shared/hooks-ts/session_start.ts +15 -12
  26. package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +12 -12
  27. package/dist/templates/_shared/lib-ts/CLAUDE.md +3 -3
  28. package/dist/templates/_shared/lib-ts/base/constants.ts +324 -306
  29. package/dist/templates/_shared/lib-ts/base/hook-utils.ts +26 -7
  30. package/dist/templates/_shared/lib-ts/base/inference.ts +19 -19
  31. package/dist/templates/_shared/lib-ts/base/lint-dispatch.ts +287 -0
  32. package/dist/templates/_shared/lib-ts/base/state-io.ts +4 -3
  33. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +3 -3
  34. package/dist/templates/_shared/lib-ts/context/CLAUDE.md +134 -0
  35. package/dist/templates/_shared/lib-ts/context/context-formatter.ts +16 -15
  36. package/dist/templates/_shared/lib-ts/context/context-selector.ts +16 -16
  37. package/dist/templates/_shared/lib-ts/context/context-store.ts +15 -14
  38. package/dist/templates/_shared/lib-ts/context/plan-manager.ts +2 -2
  39. package/dist/templates/_shared/scripts/resolve-run.ts +61 -0
  40. package/dist/templates/_shared/scripts/resolve_context.ts +1 -1
  41. package/dist/templates/_shared/scripts/status_line.ts +100 -94
  42. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/CLAUDE.md +433 -421
  43. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/document-generator.ts +5 -4
  44. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/lib/handoff-reader.ts +2 -1
  45. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/resume_handoff.ts +6 -6
  46. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/scripts/save_handoff.ts +16 -17
  47. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff-resume.md +2 -2
  48. package/dist/templates/_shared/{handoff-system → skills/handoff-system}/workflows/handoff.md +3 -3
  49. package/dist/templates/_shared/skills/meta-plan/CLAUDE.md +44 -0
  50. package/dist/templates/_shared/skills/meta-plan/workflows/meta-plan.md +347 -0
  51. package/dist/templates/cc-native/.claude/commands/cc-native/specdev.md +1 -1
  52. package/dist/templates/cc-native/.claude/settings.json +86 -57
  53. package/dist/templates/cc-native/_cc-native/artifacts/CLAUDE.md +64 -0
  54. package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/format.ts +599 -597
  55. package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/index.ts +26 -26
  56. package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/tracker.ts +107 -106
  57. package/dist/templates/cc-native/_cc-native/{lib-ts/artifacts → artifacts/lib}/write.ts +119 -118
  58. package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +237 -247
  59. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +76 -74
  60. package/dist/templates/cc-native/_cc-native/hooks/validate_task_prompt.ts +76 -0
  61. package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +163 -156
  62. package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +15 -16
  63. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +116 -116
  64. package/dist/templates/cc-native/_cc-native/lib-ts/plan-discovery.ts +3 -3
  65. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/embedding-indexer.ts +16 -12
  66. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/hyde.ts +2 -3
  67. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/index.ts +31 -31
  68. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/logger.ts +7 -6
  69. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/ollama-client.ts +9 -7
  70. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/retrieval-pipeline.ts +17 -14
  71. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-indexer.ts +41 -37
  72. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-loader.ts +43 -33
  73. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/transcript-searcher.ts +20 -20
  74. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/types.ts +9 -8
  75. package/dist/templates/cc-native/_cc-native/lib-ts/rlm/vector-store.ts +4 -3
  76. package/dist/templates/cc-native/_cc-native/lib-ts/settings.ts +9 -10
  77. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +20 -19
  78. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +329 -329
  79. package/dist/templates/cc-native/_cc-native/plan-review/CLAUDE.md +149 -0
  80. package/dist/templates/cc-native/_cc-native/plan-review/agents/CLAUDE.md +143 -0
  81. package/dist/templates/cc-native/_cc-native/plan-review/agents/PLAN-ORCHESTRATOR.md +213 -0
  82. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-questions/PLAN-QUESTIONER.md +70 -0
  83. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-EVOLUTION.md +62 -0
  84. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-PATTERNS.md +61 -0
  85. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ARCH-STRUCTURE.md +62 -0
  86. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/ASSUMPTION-TRACER.md +56 -0
  87. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CLARITY-AUDITOR.md +53 -0
  88. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-FEASIBILITY.md +66 -0
  89. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-GAPS.md +70 -0
  90. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/COMPLETENESS-ORDERING.md +62 -0
  91. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/CONSTRAINT-VALIDATOR.md +72 -0
  92. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-ADR-VALIDATOR.md +61 -0
  93. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DESIGN-SCALE-MATCHER.md +64 -0
  94. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DEVILS-ADVOCATE.md +56 -0
  95. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/DOCUMENTATION-PHILOSOPHY.md +86 -0
  96. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HANDOFF-READINESS.md +59 -0
  97. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/HIDDEN-COMPLEXITY.md +58 -0
  98. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/INCREMENTAL-DELIVERY.md +66 -0
  99. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-DEPENDENCY.md +62 -0
  100. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-FMEA.md +66 -0
  101. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-PREMORTEM.md +71 -0
  102. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/RISK-REVERSIBILITY.md +74 -0
  103. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SCOPE-BOUNDARY.md +77 -0
  104. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SIMPLICITY-GUARDIAN.md +62 -0
  105. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/SKEPTIC.md +68 -0
  106. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md +61 -0
  107. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-CHARACTERIZATION.md +71 -0
  108. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-FIRST-VALIDATOR.md +61 -0
  109. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md +61 -0
  110. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-COSTS.md +67 -0
  111. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/TRADEOFF-STAKEHOLDERS.md +65 -0
  112. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-COVERAGE.md +74 -0
  113. package/dist/templates/cc-native/_cc-native/plan-review/agents/plan-review/VERIFY-STRENGTH.md +69 -0
  114. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/agent-selection.ts +162 -163
  115. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/corroboration.ts +119 -119
  116. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/graduation.ts +132 -132
  117. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/orchestrator.ts +70 -70
  118. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/output-builder.ts +121 -130
  119. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/plan-questions.ts +101 -102
  120. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/review-pipeline.ts +507 -511
  121. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/agent.ts +73 -74
  122. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/base/base-agent.ts +217 -217
  123. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/index.ts +12 -12
  124. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/claude-agent.ts +66 -66
  125. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/codex-agent.ts +185 -185
  126. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/gemini-agent.ts +39 -39
  127. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/providers/orchestrator-claude-agent.ts +196 -196
  128. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/schemas.ts +201 -201
  129. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/reviewers/types.ts +23 -23
  130. package/dist/templates/cc-native/_cc-native/{lib-ts → plan-review/lib}/verdict.ts +72 -72
  131. package/dist/templates/cc-native/_cc-native/{workflows → plan-review/workflows}/specdev.md +9 -9
  132. package/oclif.manifest.json +1 -1
  133. package/package.json +6 -5
  134. package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +0 -21
@@ -1,116 +1,97 @@
1
1
  {
2
2
  "statusLine": {
3
3
  "type": "command",
4
- "command": "bun .aiwcli/_shared/scripts/status_line.ts"
4
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/scripts/status_line.ts"
5
5
  },
6
- "permissions": {
7
- "allow": [],
8
- "deny": []
9
- },
10
- "env": {},
11
- "enabledPlugins": {},
12
6
  "fileSuggestion": {
13
7
  "type": "command",
14
- "command": "bun .aiwcli/_shared/hooks-ts/file-suggestion.ts"
15
- },
16
- "methods": {
17
- "cc-native": {
18
- "ides": [
19
- "claude"
20
- ],
21
- "installedAt": "2026-01-29T01:59:02.558Z"
22
- }
8
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/file-suggestion.ts"
23
9
  },
24
10
  "hooks": {
25
- "SessionStart": [
11
+ "UserPromptSubmit": [
26
12
  {
27
13
  "hooks": [
28
14
  {
29
15
  "type": "command",
30
- "command": "bun .aiwcli/_shared/hooks-ts/session_start.ts",
31
- "timeout": 5000
16
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/user_prompt_submit.ts",
17
+ "timeout": 10000
18
+ },
19
+ {
20
+ "type": "command",
21
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/plan_questions_early.ts",
22
+ "timeout": 3000
32
23
  }
33
24
  ]
34
25
  }
35
26
  ],
36
- "SessionEnd": [
27
+ "PostToolUse": [
37
28
  {
29
+ "matcher": "Task|Read|Bash|WebFetch|Edit|Write|NotebookEdit",
38
30
  "hooks": [
39
31
  {
40
32
  "type": "command",
41
- "command": "bun .aiwcli/_shared/hooks-ts/session_end.ts",
33
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/context_monitor.ts",
42
34
  "timeout": 5000
43
35
  }
44
36
  ]
45
- }
46
- ],
47
- "PreCompact": [
37
+ },
48
38
  {
39
+ "matcher": "TaskCreate",
49
40
  "hooks": [
50
41
  {
51
42
  "type": "command",
52
- "command": "bun .aiwcli/_shared/hooks-ts/pre_compact.ts",
53
- "timeout": 5000
43
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/task_create_capture.ts",
44
+ "timeout": 3000
54
45
  }
55
46
  ]
56
- }
57
- ],
58
- "UserPromptSubmit": [
47
+ },
59
48
  {
49
+ "matcher": "TaskUpdate",
60
50
  "hooks": [
61
51
  {
62
52
  "type": "command",
63
- "command": "bun .aiwcli/_shared/hooks-ts/user_prompt_submit.ts",
64
- "timeout": 10000
65
- },
66
- {
67
- "type": "command",
68
- "command": "bun .aiwcli/_cc-native/hooks/plan_questions_early.ts",
53
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/task_update_capture.ts",
69
54
  "timeout": 3000
70
55
  }
71
56
  ]
72
- }
73
- ],
74
- "PostToolUse": [
57
+ },
75
58
  {
76
- "matcher": "*",
59
+ "matcher": "ExitPlanMode",
77
60
  "hooks": [
78
61
  {
79
62
  "type": "command",
80
- "command": "bun .aiwcli/_shared/hooks-ts/context_monitor.ts",
63
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/archive_plan.ts",
81
64
  "timeout": 5000
82
65
  }
83
66
  ]
84
67
  },
85
68
  {
86
- "matcher": "TaskCreate",
69
+ "matcher": "*",
87
70
  "hooks": [
88
71
  {
89
72
  "type": "command",
90
- "command": "bun .aiwcli/_shared/hooks-ts/task_create_capture.ts",
91
- "timeout": 3000,
92
- "async": true
73
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/context_monitor.ts",
74
+ "timeout": 5000
93
75
  }
94
76
  ]
95
77
  },
96
78
  {
97
- "matcher": "TaskUpdate",
79
+ "matcher": "AskUserQuestion",
98
80
  "hooks": [
99
81
  {
100
82
  "type": "command",
101
- "command": "bun .aiwcli/_shared/hooks-ts/task_update_capture.ts",
102
- "timeout": 3000,
103
- "async": true
83
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/mark_questions_asked.ts",
84
+ "timeout": 3000
104
85
  }
105
86
  ]
106
87
  },
107
88
  {
108
- "matcher": "AskUserQuestion",
89
+ "matcher": "Write|Edit",
109
90
  "hooks": [
110
91
  {
111
92
  "type": "command",
112
- "command": "bun .aiwcli/_cc-native/hooks/mark_questions_asked.ts",
113
- "timeout": 3000
93
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/lint_after_edit.ts",
94
+ "timeout": 10000
114
95
  }
115
96
  ]
116
97
  },
@@ -119,7 +100,7 @@
119
100
  "hooks": [
120
101
  {
121
102
  "type": "command",
122
- "command": "bun .aiwcli/_cc-native/hooks/enhance_plan_post_write.ts",
103
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/enhance_plan_post_write.ts",
123
104
  "timeout": 5000
124
105
  }
125
106
  ]
@@ -129,20 +110,53 @@
129
110
  "hooks": [
130
111
  {
131
112
  "type": "command",
132
- "command": "bun .aiwcli/_cc-native/hooks/enhance_plan_post_subagent.ts",
113
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/enhance_plan_post_subagent.ts",
133
114
  "timeout": 10000,
134
115
  "blockOnFail": false
135
116
  }
136
117
  ]
137
118
  }
138
119
  ],
120
+ "SessionStart": [
121
+ {
122
+ "hooks": [
123
+ {
124
+ "type": "command",
125
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/session_start.ts",
126
+ "timeout": 5000
127
+ }
128
+ ]
129
+ }
130
+ ],
131
+ "SessionEnd": [
132
+ {
133
+ "hooks": [
134
+ {
135
+ "type": "command",
136
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/session_end.ts",
137
+ "timeout": 5000
138
+ }
139
+ ]
140
+ }
141
+ ],
142
+ "PreCompact": [
143
+ {
144
+ "hooks": [
145
+ {
146
+ "type": "command",
147
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/pre_compact.ts",
148
+ "timeout": 5000
149
+ }
150
+ ]
151
+ }
152
+ ],
139
153
  "PermissionRequest": [
140
154
  {
141
155
  "matcher": "ExitPlanMode",
142
156
  "hooks": [
143
157
  {
144
158
  "type": "command",
145
- "command": "bun .aiwcli/_shared/hooks-ts/archive_plan.ts",
159
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_shared/hooks-ts/archive_plan.ts",
146
160
  "timeout": 5000
147
161
  }
148
162
  ]
@@ -162,8 +176,9 @@
162
176
  "matcher": "^Task$",
163
177
  "hooks": [
164
178
  {
165
- "type": "prompt",
166
- "prompt": "The sub-agent receives ONLY the prompt text — no conversation history, no prior context.\n\nCheck 1 — Dangling References: Does the prompt use pronouns or demonstratives that ONLY make sense with prior conversation? Violations: 'the file we looked at', 'as discussed above', 'that approach we chose', 'the error from earlier', 'fix the issue mentioned above'. NOT violations: relative paths ('_output/', 'src/lib/'), search terms ('context-manager', 'auth module'), directory exploration ('find files matching X'), tool names, or any concrete noun — even if imprecise. Only flag references that are truly UNRESOLVABLE without conversation history.\n\nCheck 2 — Implicit Contract: Does the prompt have ANY discernible goal? 'Explore the _output directory and find context files' IS a clear goal. 'Search for hooks that handle Task events' IS a clear goal. 'Read and summarize all files in X' IS a clear goal. Only flag if the prompt is truly goalless — e.g., a sentence fragment with no verb, or pure context with no request.\n\nIf both checks pass, return ok:true. When in doubt, pass — false negatives (letting a vague prompt through) are far less costly than false positives (blocking legitimate work).\n\nWhen returning ok:false, end your response with: 'Retry: Re-invoke the Task tool with a revised prompt that resolves the issues above.'"
179
+ "type": "command",
180
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/validate_task_prompt.ts",
181
+ "timeout": 20000
167
182
  }
168
183
  ]
169
184
  },
@@ -172,11 +187,25 @@
172
187
  "hooks": [
173
188
  {
174
189
  "type": "command",
175
- "command": "bun .aiwcli/_cc-native/hooks/cc-native-plan-review.ts",
190
+ "command": "bun ~/.aiwcli/bin/resolve-run.ts .aiwcli/_cc-native/hooks/cc-native-plan-review.ts",
176
191
  "timeout": 5000
177
192
  }
178
193
  ]
179
194
  }
180
195
  ]
196
+ },
197
+ "permissions": {
198
+ "allow": [],
199
+ "deny": []
200
+ },
201
+ "env": {},
202
+ "enabledPlugins": {},
203
+ "methods": {
204
+ "cc-native": {
205
+ "ides": [
206
+ "claude"
207
+ ],
208
+ "installedAt": "2026-02-16T23:59:38.727Z"
209
+ }
181
210
  }
182
211
  }
@@ -0,0 +1,64 @@
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
+ - `../../../_shared/lib-ts/base/atomic-write.ts` — atomic file I/O
45
+ - `../../../_shared/lib-ts/base/constants.ts` — `sanitizeFilename`
46
+ - `../../../_shared/lib-ts/base/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/`