aiwcli 0.11.1 → 0.12.1

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 (117) hide show
  1. package/dist/commands/clear.d.ts +8 -0
  2. package/dist/commands/clear.js +86 -0
  3. package/dist/lib/bmad-installer.d.ts +2 -27
  4. package/dist/lib/bmad-installer.js +3 -43
  5. package/dist/lib/claude-settings-types.d.ts +2 -1
  6. package/dist/lib/env-compat.d.ts +0 -8
  7. package/dist/lib/env-compat.js +0 -12
  8. package/dist/lib/git/index.d.ts +0 -1
  9. package/dist/lib/gitignore-manager.d.ts +0 -2
  10. package/dist/lib/gitignore-manager.js +1 -1
  11. package/dist/lib/hooks-merger.d.ts +1 -15
  12. package/dist/lib/hooks-merger.js +1 -1
  13. package/dist/lib/index.d.ts +3 -7
  14. package/dist/lib/index.js +3 -11
  15. package/dist/lib/output.d.ts +2 -1
  16. package/dist/lib/settings-hierarchy.d.ts +1 -13
  17. package/dist/lib/settings-hierarchy.js +1 -1
  18. package/dist/lib/template-installer.d.ts +5 -9
  19. package/dist/lib/template-installer.js +3 -13
  20. package/dist/lib/template-linter.d.ts +3 -10
  21. package/dist/lib/template-linter.js +2 -2
  22. package/dist/lib/template-resolver.d.ts +6 -0
  23. package/dist/lib/template-resolver.js +10 -0
  24. package/dist/lib/template-settings-reconstructor.d.ts +1 -1
  25. package/dist/lib/template-settings-reconstructor.js +17 -24
  26. package/dist/lib/terminal.d.ts +3 -14
  27. package/dist/lib/terminal.js +0 -4
  28. package/dist/lib/version.d.ts +2 -11
  29. package/dist/lib/version.js +3 -3
  30. package/dist/lib/windsurf-hooks-merger.d.ts +1 -15
  31. package/dist/lib/windsurf-hooks-merger.js +1 -1
  32. package/dist/templates/_shared/.codex/workflows/handoff.md +1 -1
  33. package/dist/templates/_shared/.windsurf/workflows/handoff.md +1 -1
  34. package/dist/templates/_shared/hooks-ts/session_end.ts +75 -4
  35. package/dist/templates/_shared/hooks-ts/session_start.ts +11 -13
  36. package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +6 -8
  37. package/dist/templates/_shared/lib-ts/CLAUDE.md +56 -7
  38. package/dist/templates/_shared/lib-ts/base/hook-utils.ts +176 -29
  39. package/dist/templates/_shared/lib-ts/base/logger.ts +1 -1
  40. package/dist/templates/_shared/lib-ts/base/state-io.ts +11 -2
  41. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +181 -165
  42. package/dist/templates/_shared/lib-ts/context/plan-manager.ts +14 -13
  43. package/dist/templates/_shared/lib-ts/handoff/handoff-reader.ts +3 -2
  44. package/dist/templates/_shared/lib-ts/package.json +1 -2
  45. package/dist/templates/_shared/lib-ts/templates/plan-context.ts +27 -34
  46. package/dist/templates/_shared/lib-ts/types.ts +17 -2
  47. package/dist/templates/_shared/scripts/resume_handoff.ts +4 -4
  48. package/dist/templates/_shared/scripts/save_handoff.ts +7 -7
  49. package/dist/templates/_shared/scripts/status_line.ts +104 -71
  50. package/dist/templates/_shared/workflows/handoff.md +1 -1
  51. package/dist/templates/cc-native/.claude/settings.json +182 -175
  52. package/dist/templates/cc-native/_cc-native/agents/CLAUDE.md +23 -1
  53. package/dist/templates/cc-native/_cc-native/agents/plan-questions/PLAN-QUESTIONER.md +70 -0
  54. package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +6 -1
  55. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +142 -111
  56. package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_subagent.ts +54 -0
  57. package/dist/templates/cc-native/_cc-native/hooks/enhance_plan_post_write.ts +52 -0
  58. package/dist/templates/cc-native/_cc-native/hooks/mark_questions_asked.ts +53 -0
  59. package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +19 -19
  60. package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +6 -5
  61. package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +114 -83
  62. package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +107 -10
  63. package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +1 -1
  64. package/dist/templates/cc-native/_cc-native/lib-ts/corroboration.ts +6 -2
  65. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +0 -4
  66. package/dist/templates/cc-native/_cc-native/lib-ts/orchestrator.ts +40 -219
  67. package/dist/templates/cc-native/_cc-native/lib-ts/plan-enhancement.ts +41 -0
  68. package/dist/templates/cc-native/_cc-native/lib-ts/plan-questions.ts +102 -0
  69. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/agent.ts +26 -227
  70. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/base/base-agent.ts +217 -0
  71. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/index.ts +4 -2
  72. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/claude-agent.ts +65 -0
  73. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/codex-agent.ts +185 -0
  74. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/gemini-agent.ts +39 -0
  75. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/providers/orchestrator-claude-agent.ts +195 -0
  76. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/schemas.ts +201 -0
  77. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/types.ts +2 -2
  78. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +17 -16
  79. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +13 -108
  80. package/dist/templates/cc-native/_cc-native/lib-ts/verdict.ts +3 -3
  81. package/dist/templates/cc-native/_cc-native/plan-review.config.json +2 -14
  82. package/oclif.manifest.json +1 -1
  83. package/package.json +1 -2
  84. package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.ts +0 -119
  85. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/codex.ts +0 -130
  86. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/gemini.ts +0 -107
  87. /package/dist/templates/cc-native/_cc-native/agents/{ARCH-EVOLUTION.md → plan-review/ARCH-EVOLUTION.md} +0 -0
  88. /package/dist/templates/cc-native/_cc-native/agents/{ARCH-PATTERNS.md → plan-review/ARCH-PATTERNS.md} +0 -0
  89. /package/dist/templates/cc-native/_cc-native/agents/{ARCH-STRUCTURE.md → plan-review/ARCH-STRUCTURE.md} +0 -0
  90. /package/dist/templates/cc-native/_cc-native/agents/{ASSUMPTION-TRACER.md → plan-review/ASSUMPTION-TRACER.md} +0 -0
  91. /package/dist/templates/cc-native/_cc-native/agents/{CLARITY-AUDITOR.md → plan-review/CLARITY-AUDITOR.md} +0 -0
  92. /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-FEASIBILITY.md → plan-review/COMPLETENESS-FEASIBILITY.md} +0 -0
  93. /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-GAPS.md → plan-review/COMPLETENESS-GAPS.md} +0 -0
  94. /package/dist/templates/cc-native/_cc-native/agents/{COMPLETENESS-ORDERING.md → plan-review/COMPLETENESS-ORDERING.md} +0 -0
  95. /package/dist/templates/cc-native/_cc-native/agents/{CONSTRAINT-VALIDATOR.md → plan-review/CONSTRAINT-VALIDATOR.md} +0 -0
  96. /package/dist/templates/cc-native/_cc-native/agents/{DESIGN-ADR-VALIDATOR.md → plan-review/DESIGN-ADR-VALIDATOR.md} +0 -0
  97. /package/dist/templates/cc-native/_cc-native/agents/{DESIGN-SCALE-MATCHER.md → plan-review/DESIGN-SCALE-MATCHER.md} +0 -0
  98. /package/dist/templates/cc-native/_cc-native/agents/{DEVILS-ADVOCATE.md → plan-review/DEVILS-ADVOCATE.md} +0 -0
  99. /package/dist/templates/cc-native/_cc-native/agents/{DOCUMENTATION-PHILOSOPHY.md → plan-review/DOCUMENTATION-PHILOSOPHY.md} +0 -0
  100. /package/dist/templates/cc-native/_cc-native/agents/{HANDOFF-READINESS.md → plan-review/HANDOFF-READINESS.md} +0 -0
  101. /package/dist/templates/cc-native/_cc-native/agents/{HIDDEN-COMPLEXITY.md → plan-review/HIDDEN-COMPLEXITY.md} +0 -0
  102. /package/dist/templates/cc-native/_cc-native/agents/{INCREMENTAL-DELIVERY.md → plan-review/INCREMENTAL-DELIVERY.md} +0 -0
  103. /package/dist/templates/cc-native/_cc-native/agents/{RISK-DEPENDENCY.md → plan-review/RISK-DEPENDENCY.md} +0 -0
  104. /package/dist/templates/cc-native/_cc-native/agents/{RISK-FMEA.md → plan-review/RISK-FMEA.md} +0 -0
  105. /package/dist/templates/cc-native/_cc-native/agents/{RISK-PREMORTEM.md → plan-review/RISK-PREMORTEM.md} +0 -0
  106. /package/dist/templates/cc-native/_cc-native/agents/{RISK-REVERSIBILITY.md → plan-review/RISK-REVERSIBILITY.md} +0 -0
  107. /package/dist/templates/cc-native/_cc-native/agents/{SCOPE-BOUNDARY.md → plan-review/SCOPE-BOUNDARY.md} +0 -0
  108. /package/dist/templates/cc-native/_cc-native/agents/{SIMPLICITY-GUARDIAN.md → plan-review/SIMPLICITY-GUARDIAN.md} +0 -0
  109. /package/dist/templates/cc-native/_cc-native/agents/{SKEPTIC.md → plan-review/SKEPTIC.md} +0 -0
  110. /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-BEHAVIOR-AUDITOR.md → plan-review/TESTDRIVEN-BEHAVIOR-AUDITOR.md} +0 -0
  111. /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-CHARACTERIZATION.md → plan-review/TESTDRIVEN-CHARACTERIZATION.md} +0 -0
  112. /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-FIRST-VALIDATOR.md → plan-review/TESTDRIVEN-FIRST-VALIDATOR.md} +0 -0
  113. /package/dist/templates/cc-native/_cc-native/agents/{TESTDRIVEN-PYRAMID-ANALYZER.md → plan-review/TESTDRIVEN-PYRAMID-ANALYZER.md} +0 -0
  114. /package/dist/templates/cc-native/_cc-native/agents/{TRADEOFF-COSTS.md → plan-review/TRADEOFF-COSTS.md} +0 -0
  115. /package/dist/templates/cc-native/_cc-native/agents/{TRADEOFF-STAKEHOLDERS.md → plan-review/TRADEOFF-STAKEHOLDERS.md} +0 -0
  116. /package/dist/templates/cc-native/_cc-native/agents/{VERIFY-COVERAGE.md → plan-review/VERIFY-COVERAGE.md} +0 -0
  117. /package/dist/templates/cc-native/_cc-native/agents/{VERIFY-STRENGTH.md → plan-review/VERIFY-STRENGTH.md} +0 -0
@@ -1,175 +1,182 @@
1
- {
2
- "statusLine": {
3
- "type": "command",
4
- "command": "bun .aiwcli/_shared/scripts/status_line.ts"
5
- },
6
- "permissions": {
7
- "allow": [],
8
- "deny": []
9
- },
10
- "env": {},
11
- "enabledPlugins": {},
12
- "fileSuggestion": {
13
- "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
- }
23
- },
24
- "hooks": {
25
- "SessionStart": [
26
- {
27
- "hooks": [
28
- {
29
- "type": "command",
30
- "command": "bun .aiwcli/_shared/hooks-ts/session_start.ts",
31
- "timeout": 5000
32
- }
33
- ]
34
- }
35
- ],
36
- "SessionEnd": [
37
- {
38
- "hooks": [
39
- {
40
- "type": "command",
41
- "command": "bun .aiwcli/_shared/hooks-ts/session_end.ts",
42
- "timeout": 5000
43
- }
44
- ]
45
- }
46
- ],
47
- "PreCompact": [
48
- {
49
- "hooks": [
50
- {
51
- "type": "command",
52
- "command": "bun .aiwcli/_shared/hooks-ts/pre_compact.ts",
53
- "timeout": 5000
54
- }
55
- ]
56
- }
57
- ],
58
- "UserPromptSubmit": [
59
- {
60
- "hooks": [
61
- {
62
- "type": "command",
63
- "command": "bun .aiwcli/_shared/hooks-ts/user_prompt_submit.ts",
64
- "timeout": 10000
65
- }
66
- ]
67
- },
68
- {
69
- "hooks": [
70
- {
71
- "type": "command",
72
- "command": "bun .aiwcli/_cc-native/hooks/plan_questions_early.ts",
73
- "timeout": 3000
74
- }
75
- ]
76
- }
77
- ],
78
- "PostToolUse": [
79
- {
80
- "matcher": "*",
81
- "hooks": [
82
- {
83
- "type": "command",
84
- "command": "bun .aiwcli/_shared/hooks-ts/context_monitor.ts",
85
- "timeout": 5000
86
- }
87
- ]
88
- },
89
- {
90
- "matcher": "TaskCreate",
91
- "hooks": [
92
- {
93
- "type": "command",
94
- "command": "bun .aiwcli/_shared/hooks-ts/task_create_capture.ts",
95
- "timeout": 3000,
96
- "async": true
97
- }
98
- ]
99
- },
100
- {
101
- "matcher": "TaskUpdate",
102
- "hooks": [
103
- {
104
- "type": "command",
105
- "command": "bun .aiwcli/_shared/hooks-ts/task_update_capture.ts",
106
- "timeout": 3000,
107
- "async": true
108
- }
109
- ]
110
- },
111
- {
112
- "matcher": "AskUserQuestion",
113
- "hooks": [
114
- {
115
- "type": "command",
116
- "command": "bun .aiwcli/_cc-native/hooks/add_plan_context.ts",
117
- "timeout": 3000
118
- }
119
- ]
120
- }
121
- ],
122
- "PermissionRequest": [
123
- {
124
- "matcher": "ExitPlanMode",
125
- "hooks": [
126
- {
127
- "type": "command",
128
- "command": "bun .aiwcli/_shared/hooks-ts/archive_plan.ts",
129
- "timeout": 5000
130
- }
131
- ]
132
- }
133
- ],
134
- "PreToolUse": [
135
- {
136
- "matcher": "^TaskCreate$",
137
- "hooks": [
138
- {
139
- "type": "prompt",
140
- "prompt": "Evaluate this TaskCreate call for atomicity. Tasks become ISC criteria checked during verification — vague criteria cannot be verified, so precision matters. A well-specified task includes: (1) Explicit file paths like 'src/lib/auth.py' instead of 'the file above' or 'as discussed', (2) Specific function or component names instead of pronouns like 'it' or 'the function', (3) Clear expected state or behavior that is binary-testable in 2 seconds, (4) Concrete scope — one concern per task, not compound goals. If all four criteria are met and an agent with zero conversation history could verify the task was completed, return ok:true. If any criterion is missing, return ok:false with a response like: 'Missing context: [list each gap — e.g., no file path specified for the auth module, expected behavior is vague: what does fix the bug mean specifically, compound task should be split into separate criteria]'. When returning ok:false, end your response with: 'Retry: Re-invoke TaskCreate with a revised subject and description that address the gaps above.' This directive ensures the calling agent corrects and retries rather than abandoning the task."
141
- }
142
- ]
143
- },
144
- {
145
- "matcher": "^Task$",
146
- "hooks": [
147
- {
148
- "type": "prompt",
149
- "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.'"
150
- }
151
- ]
152
- },
153
- {
154
- "matcher": "^Task$",
155
- "hooks": [
156
- {
157
- "type": "command",
158
- "command": "bun .aiwcli/_cc-native/hooks/add_plan_context.ts",
159
- "timeout": 5000
160
- }
161
- ]
162
- },
163
- {
164
- "matcher": "ExitPlanMode",
165
- "hooks": [
166
- {
167
- "type": "command",
168
- "command": "bun .aiwcli/_cc-native/hooks/cc-native-plan-review.ts",
169
- "timeout": 600000
170
- }
171
- ]
172
- }
173
- ]
174
- }
175
- }
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "bun .aiwcli/_shared/scripts/status_line.ts"
5
+ },
6
+ "permissions": {
7
+ "allow": [],
8
+ "deny": []
9
+ },
10
+ "env": {},
11
+ "enabledPlugins": {},
12
+ "fileSuggestion": {
13
+ "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
+ }
23
+ },
24
+ "hooks": {
25
+ "SessionStart": [
26
+ {
27
+ "hooks": [
28
+ {
29
+ "type": "command",
30
+ "command": "bun .aiwcli/_shared/hooks-ts/session_start.ts",
31
+ "timeout": 5000
32
+ }
33
+ ]
34
+ }
35
+ ],
36
+ "SessionEnd": [
37
+ {
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "bun .aiwcli/_shared/hooks-ts/session_end.ts",
42
+ "timeout": 5000
43
+ }
44
+ ]
45
+ }
46
+ ],
47
+ "PreCompact": [
48
+ {
49
+ "hooks": [
50
+ {
51
+ "type": "command",
52
+ "command": "bun .aiwcli/_shared/hooks-ts/pre_compact.ts",
53
+ "timeout": 5000
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "UserPromptSubmit": [
59
+ {
60
+ "hooks": [
61
+ {
62
+ "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",
69
+ "timeout": 3000
70
+ }
71
+ ]
72
+ }
73
+ ],
74
+ "PostToolUse": [
75
+ {
76
+ "matcher": "*",
77
+ "hooks": [
78
+ {
79
+ "type": "command",
80
+ "command": "bun .aiwcli/_shared/hooks-ts/context_monitor.ts",
81
+ "timeout": 5000
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "matcher": "TaskCreate",
87
+ "hooks": [
88
+ {
89
+ "type": "command",
90
+ "command": "bun .aiwcli/_shared/hooks-ts/task_create_capture.ts",
91
+ "timeout": 3000,
92
+ "async": true
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "matcher": "TaskUpdate",
98
+ "hooks": [
99
+ {
100
+ "type": "command",
101
+ "command": "bun .aiwcli/_shared/hooks-ts/task_update_capture.ts",
102
+ "timeout": 3000,
103
+ "async": true
104
+ }
105
+ ]
106
+ },
107
+ {
108
+ "matcher": "AskUserQuestion",
109
+ "hooks": [
110
+ {
111
+ "type": "command",
112
+ "command": "bun .aiwcli/_cc-native/hooks/mark_questions_asked.ts",
113
+ "timeout": 3000
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "matcher": "Write",
119
+ "hooks": [
120
+ {
121
+ "type": "command",
122
+ "command": "bun .aiwcli/_cc-native/hooks/enhance_plan_post_write.ts",
123
+ "timeout": 5000
124
+ }
125
+ ]
126
+ },
127
+ {
128
+ "matcher": "^Task$",
129
+ "hooks": [
130
+ {
131
+ "type": "command",
132
+ "command": "bun .aiwcli/_cc-native/hooks/enhance_plan_post_subagent.ts",
133
+ "timeout": 10000,
134
+ "blockOnFail": false
135
+ }
136
+ ]
137
+ }
138
+ ],
139
+ "PermissionRequest": [
140
+ {
141
+ "matcher": "ExitPlanMode",
142
+ "hooks": [
143
+ {
144
+ "type": "command",
145
+ "command": "bun .aiwcli/_shared/hooks-ts/archive_plan.ts",
146
+ "timeout": 5000
147
+ }
148
+ ]
149
+ }
150
+ ],
151
+ "PreToolUse": [
152
+ {
153
+ "matcher": "^TaskCreate$",
154
+ "hooks": [
155
+ {
156
+ "type": "prompt",
157
+ "prompt": "Evaluate this TaskCreate call for atomicity. Tasks become ISC criteria checked during verification — vague criteria cannot be verified, so precision matters. A well-specified task includes: (1) Explicit file paths like 'src/lib/auth.py' instead of 'the file above' or 'as discussed', (2) Specific function or component names instead of pronouns like 'it' or 'the function', (3) Clear expected state or behavior that is binary-testable in 2 seconds, (4) Concrete scope — one concern per task, not compound goals. If all four criteria are met and an agent with zero conversation history could verify the task was completed, return ok:true. If any criterion is missing, return ok:false with a response like: 'Missing context: [list each gap — e.g., no file path specified for the auth module, expected behavior is vague: what does fix the bug mean specifically, compound task should be split into separate criteria]'. When returning ok:false, end your response with: 'Retry: Re-invoke TaskCreate with a revised subject and description that address the gaps above.' This directive ensures the calling agent corrects and retries rather than abandoning the task."
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ "matcher": "^Task$",
163
+ "hooks": [
164
+ {
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.'"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "matcher": "ExitPlanMode",
172
+ "hooks": [
173
+ {
174
+ "type": "command",
175
+ "command": "bun .aiwcli/_cc-native/hooks/cc-native-plan-review.ts",
176
+ "timeout": 5000
177
+ }
178
+ ]
179
+ }
180
+ ]
181
+ }
182
+ }
@@ -1,6 +1,28 @@
1
1
  # CC-Native Plan Review Agents
2
2
 
3
- Agent persona definitions for single-turn plan review. 31 agents total: 4 mandatory + 27 selectable (organized into 7 variation families + 7 standalone).
3
+ Agent persona definitions for single-turn plan review. 31 review agents + 1 question agent.
4
+
5
+ ## Directory Structure
6
+
7
+ ```
8
+ agents/
9
+ ├── CLAUDE.md # This file
10
+ ├── PLAN-ORCHESTRATOR.md # Complexity/agent selection orchestrator
11
+ ├── plan-review/ # Review agents (31 files)
12
+ │ ├── HANDOFF-READINESS.md
13
+ │ ├── CLARITY-AUDITOR.md
14
+ │ ├── SKEPTIC.md
15
+ │ ├── ... # All review agent .md files
16
+ │ └── TESTDRIVEN-CHARACTERIZATION.md
17
+ └── plan-questions/ # Question generation agents
18
+ └── PLAN-QUESTIONER.md # Fresh-context question generator
19
+ ```
20
+
21
+ **Important:** Review agents MUST be in `plan-review/`. The hook loads from `agents/plan-review/` — files in the root `agents/` directory (other than CLAUDE.md and PLAN-ORCHESTRATOR.md) are ignored.
22
+
23
+ ## Review Agents (31 total)
24
+
25
+ 4 mandatory + 27 selectable (organized into 7 variation families + 7 standalone).
4
26
 
5
27
  ## Agent Roster (31 agents)
6
28
 
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: plan-questioner
3
+ description: Reviews plans in a fresh context and generates questions that should be asked before implementation.
4
+ model: sonnet
5
+ focus: question generation from fresh perspective
6
+ enabled: false
7
+ categories:
8
+ - code
9
+ - infrastructure
10
+ - documentation
11
+ - design
12
+ - research
13
+ - life
14
+ - business
15
+ ---
16
+
17
+ # OVERRIDE: You are a QUESTION GENERATOR, not a plan reviewer.
18
+
19
+ IGNORE any preceding instructions about verdicts, issues, severity, or review output. Your ONLY job is to generate questions, assumptions, and ambiguities. Call StructuredOutput with the schema provided — it accepts ONLY questions/assumptions/ambiguities arrays, nothing else.
20
+
21
+ # Plan Questioner - Fresh Context Question Generator
22
+
23
+ You review plans with deliberately zero context. You haven't seen the codebase, the conversation history, or the exploration that led to this plan. This blindness is your strength.
24
+
25
+ ## Your Purpose
26
+
27
+ Plans will be executed by a fresh agent in a new session with no prior context. If the plan assumes knowledge that isn't written down, that agent will fail or make wrong decisions. Your job is to find those gaps before implementation begins.
28
+
29
+ ## What Makes a Good Question
30
+
31
+ A good question is one where:
32
+ - The answer would change how the plan is implemented
33
+ - A reasonable person could answer it multiple ways
34
+ - The plan author probably knows the answer but didn't write it down
35
+ - Getting it wrong would cause rework or bugs
36
+
37
+ ## What to Look For
38
+
39
+ ### Questions
40
+ - Decisions the plan makes without explaining why
41
+ - Places where "the right approach" depends on context you don't have
42
+ - Steps that require judgment calls not specified in the plan
43
+ - Integration points where behavior depends on external systems
44
+
45
+ ### Assumptions
46
+ - Things that must be true for the plan to work but aren't stated
47
+ - Environmental requirements (tools, versions, permissions, configs)
48
+ - Behavioral expectations about existing code or systems
49
+ - Implicit ordering or dependency constraints
50
+
51
+ ### Ambiguities
52
+ - Steps that could be interpreted multiple ways
53
+ - Terms used without definition that could mean different things
54
+ - Scope boundaries that aren't clearly drawn
55
+ - Success criteria that are subjective or unmeasurable
56
+
57
+ ## Anti-Patterns (Don't Do These)
58
+
59
+ - Don't ask about things clearly stated in the plan
60
+ - Don't generate generic questions that apply to any plan ("Have you considered testing?")
61
+ - Don't ask rhetorical questions or make statements disguised as questions
62
+ - Don't question the goal itself — question the plan's completeness for achieving it
63
+ - Don't ask more than 6 questions — prioritize ruthlessly
64
+
65
+ ## CRITICAL: Single-Turn Output
66
+
67
+ 1. Read the plan content provided
68
+ 2. Call StructuredOutput immediately with your assessment
69
+ 3. Do NOT use any file tools, do NOT ask follow-up questions
70
+ 4. Complete your entire analysis in one response
@@ -8,10 +8,14 @@
8
8
 
9
9
  | Hook | Trigger | Purpose |
10
10
  |------|---------|---------|
11
- | `cc-native-plan-review.ts` | PreToolUse: ExitPlanMode | Review plans before user approval |
11
+ | `cc-native-plan-review.ts` | PreToolUse: ExitPlanMode | Questions gate + plan review before user approval |
12
12
  | `add_plan_context.ts` | PostToolUse: AskUserQuestion, PreToolUse: Task | Mark questions asked; nudge Plan subagent to ask questions first |
13
13
  | `plan_questions_early.ts` | UserPromptSubmit | Inject Phase A clarification prompt in plan mode |
14
14
 
15
+ ### Questions Gate (in cc-native-plan-review.ts)
16
+
17
+ Before running plan review agents, the hook checks `wasQuestionsAsked()`. If the user hasn't been asked questions yet, it runs a fresh-context plan-questions agent (from `agents/plan-questions/PLAN-QUESTIONER.md`) that independently reviews the plan and generates questions, assumptions, and ambiguities. If questions are found, ExitPlanMode is denied with the question list injected as context. After the user answers via AskUserQuestion (which triggers `mark_questions_asked.ts`), the next ExitPlanMode attempt passes the gate and proceeds to normal plan review.
18
+
15
19
  ---
16
20
 
17
21
  ## Import Pattern
@@ -210,6 +214,7 @@ Hooks fail silently on import errors — verify after any import path changes.
210
214
 
211
215
  | Date | Change |
212
216
  |------|--------|
217
+ | 2026-02-14 | **Questions gate added to plan review.** `cc-native-plan-review.ts` now runs a fresh-context plan-questions agent before plan review. If `wasQuestionsAsked()` returns false, the PLAN-QUESTIONER agent (from `agents/plan-questions/`) generates questions/assumptions/ambiguities using `QUESTIONS_SCHEMA`. On questions found, ExitPlanMode is denied with question list as context. New library module: `lib-ts/plan-questions.ts`. Agent directory reorganized: review agents moved to `agents/plan-review/`, question agents in `agents/plan-questions/`. |
213
218
  | 2026-02-10 | **Migrated cc-native hooks from Python to TypeScript.** `cc-native-plan-review.ts` (async, parallel agent reviews via `Promise.all()`), `add_plan_context.ts`, `plan_questions_early.ts`. All hooks use `runHook()`/`runHookAsync()` entry points. Library code in `_cc-native/lib-ts/` (18 files). Settings.json updated to use `bun` runner. Python `.py` files kept as fallback until TS hooks verified. |
214
219
  | 2026-02-10 | Flipped TS logger stderr default to opt-in (`opts?.stderr === true`). Added `logBlocking()` for intentional stderr visibility. Removed redundant `{stderr: false}` from hook-utils.ts, user_prompt_submit.ts, context_monitor.ts. Added "Hook Error Visibility" section documenting visibility tiers and exit code behavior. |
215
220
  | 2026-02-10 | Fixed `debug.py` `context_path` crash. Added local try/catch around `maybeActivate` in `user_prompt_submit.ts` and `context_monitor.ts` to prevent stderr error display on non-critical I/O failures. Removed dead `context_path` from `_emitHookEnd` in `hook-utils.ts`. Added "Error Handling" section to CLAUDE.md. |