@event4u/agent-config 1.18.0 → 1.20.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 (181) hide show
  1. package/.agent-src/commands/agent-handoff.md +14 -10
  2. package/.agent-src/commands/chat-history/import.md +170 -0
  3. package/.agent-src/commands/chat-history/learn.md +178 -0
  4. package/.agent-src/commands/chat-history/show.md +17 -18
  5. package/.agent-src/commands/chat-history.md +26 -25
  6. package/.agent-src/commands/council/default.md +77 -82
  7. package/.agent-src/commands/create-pr.md +28 -8
  8. package/.agent-src/commands/feature/roadmap.md +22 -0
  9. package/.agent-src/commands/roadmap/create.md +38 -6
  10. package/.agent-src/commands/roadmap/execute.md +36 -9
  11. package/.agent-src/commands/sync-gitignore.md +1 -1
  12. package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +76 -0
  13. package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +3 -3
  14. package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +5 -12
  15. package/.agent-src/rules/agent-authority.md +1 -0
  16. package/.agent-src/rules/agent-docs.md +1 -0
  17. package/.agent-src/rules/analysis-skill-routing.md +1 -0
  18. package/.agent-src/rules/architecture.md +1 -0
  19. package/.agent-src/rules/artifact-drafting-protocol.md +1 -0
  20. package/.agent-src/rules/artifact-engagement-recording.md +1 -0
  21. package/.agent-src/rules/ask-when-uncertain.md +1 -0
  22. package/.agent-src/rules/augment-portability.md +1 -0
  23. package/.agent-src/rules/augment-source-of-truth.md +1 -0
  24. package/.agent-src/rules/autonomous-execution.md +1 -0
  25. package/.agent-src/rules/capture-learnings.md +1 -0
  26. package/.agent-src/rules/cli-output-handling.md +2 -2
  27. package/.agent-src/rules/command-suggestion-policy.md +1 -0
  28. package/.agent-src/rules/commit-conventions.md +1 -0
  29. package/.agent-src/rules/commit-policy.md +1 -0
  30. package/.agent-src/rules/context-hygiene.md +22 -0
  31. package/.agent-src/rules/direct-answers.md +11 -2
  32. package/.agent-src/rules/docker-commands.md +1 -0
  33. package/.agent-src/rules/docs-sync.md +1 -0
  34. package/.agent-src/rules/downstream-changes.md +1 -0
  35. package/.agent-src/rules/e2e-testing.md +1 -0
  36. package/.agent-src/rules/guidelines.md +1 -0
  37. package/.agent-src/rules/improve-before-implement.md +1 -0
  38. package/.agent-src/rules/language-and-tone.md +38 -6
  39. package/.agent-src/rules/laravel-translations.md +1 -0
  40. package/.agent-src/rules/markdown-safe-codeblocks.md +1 -0
  41. package/.agent-src/rules/minimal-safe-diff.md +1 -0
  42. package/.agent-src/rules/missing-tool-handling.md +1 -0
  43. package/.agent-src/rules/model-recommendation.md +1 -0
  44. package/.agent-src/rules/no-attribution-footers.md +48 -0
  45. package/.agent-src/rules/no-cheap-questions.md +1 -0
  46. package/.agent-src/rules/no-roadmap-references.md +2 -1
  47. package/.agent-src/rules/non-destructive-by-default.md +1 -0
  48. package/.agent-src/rules/onboarding-gate.md +26 -0
  49. package/.agent-src/rules/package-ci-checks.md +1 -0
  50. package/.agent-src/rules/php-coding.md +1 -0
  51. package/.agent-src/rules/preservation-guard.md +1 -0
  52. package/.agent-src/rules/review-routing-awareness.md +1 -0
  53. package/.agent-src/rules/reviewer-awareness.md +1 -0
  54. package/.agent-src/rules/roadmap-progress-sync.md +22 -0
  55. package/.agent-src/rules/role-mode-adherence.md +2 -2
  56. package/.agent-src/rules/rule-type-governance.md +1 -0
  57. package/.agent-src/rules/runtime-safety.md +1 -0
  58. package/.agent-src/rules/scope-control.md +1 -0
  59. package/.agent-src/rules/security-sensitive-stop.md +1 -0
  60. package/.agent-src/rules/size-enforcement.md +1 -0
  61. package/.agent-src/rules/skill-improvement-trigger.md +1 -0
  62. package/.agent-src/rules/skill-quality.md +50 -0
  63. package/.agent-src/rules/slash-command-routing-policy.md +39 -0
  64. package/.agent-src/rules/think-before-action.md +1 -0
  65. package/.agent-src/rules/token-efficiency.md +1 -0
  66. package/.agent-src/rules/tool-safety.md +1 -0
  67. package/.agent-src/rules/ui-audit-gate.md +1 -0
  68. package/.agent-src/rules/upstream-proposal.md +1 -0
  69. package/.agent-src/rules/user-interaction.md +22 -5
  70. package/.agent-src/rules/verify-before-complete.md +1 -0
  71. package/.agent-src/skills/ai-council/SKILL.md +4 -5
  72. package/.agent-src/skills/dcf-modeling/SKILL.md +89 -0
  73. package/.agent-src/skills/funnel-analysis/SKILL.md +100 -0
  74. package/.agent-src/skills/md-language-check/SKILL.md +1 -1
  75. package/.agent-src/skills/okr-tree-modeling/SKILL.md +93 -0
  76. package/.agent-src/skills/rice-prioritization/SKILL.md +100 -0
  77. package/.agent-src/skills/roadmap-management/SKILL.md +29 -4
  78. package/.agent-src/skills/subagent-orchestration/SKILL.md +34 -2
  79. package/.agent-src/skills/unit-economics-modeling/SKILL.md +104 -0
  80. package/.agent-src/skills/using-git-worktrees/SKILL.md +1 -0
  81. package/.agent-src/skills/verify-completion-evidence/SKILL.md +8 -1
  82. package/.agent-src/templates/agent-settings.md +21 -26
  83. package/.agent-src/templates/roadmaps.md +8 -3
  84. package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +16 -5
  85. package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +4 -4
  86. package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +4 -4
  87. package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +7 -51
  88. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +1 -2
  89. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +1 -2
  90. package/.agent-src/templates/scripts/work_engine/hooks/builtin/decision_trace.py +163 -0
  91. package/.agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.py +110 -0
  92. package/.agent-src/templates/scripts/work_engine/hooks/settings.py +36 -0
  93. package/.agent-src/templates/scripts/work_engine/scoring/decision_trace.py +141 -0
  94. package/.agent-src/templates/scripts/work_engine/scoring/memory_visibility.py +125 -0
  95. package/.agent-src/templates/skill.md +30 -1
  96. package/.claude-plugin/marketplace.json +8 -4
  97. package/AGENTS.md +44 -3
  98. package/CHANGELOG.md +173 -0
  99. package/README.md +22 -22
  100. package/config/agent-settings.template.yml +42 -13
  101. package/config/gitignore-block.txt +4 -4
  102. package/docs/architecture.md +3 -3
  103. package/docs/catalog.md +18 -13
  104. package/docs/contracts/adr-chat-history-split.md +10 -1
  105. package/docs/contracts/adr-settings-sync-engine.md +127 -0
  106. package/docs/contracts/command-clusters.md +1 -1
  107. package/docs/contracts/cross-wing-handoff.md +133 -0
  108. package/docs/contracts/decision-trace-v1.md +146 -0
  109. package/docs/contracts/file-ownership-matrix.json +348 -126
  110. package/docs/contracts/hook-architecture-v1.md +220 -0
  111. package/docs/contracts/memory-visibility-v1.md +122 -0
  112. package/docs/contracts/one-off-script-lifecycle.md +109 -0
  113. package/docs/contracts/rule-interactions.yml +22 -0
  114. package/docs/customization.md +2 -1
  115. package/docs/development.md +4 -1
  116. package/docs/getting-started.md +21 -29
  117. package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +1 -1
  118. package/docs/guidelines/agent-infra/layered-settings.md +32 -13
  119. package/docs/hook-payload-capture.md +221 -0
  120. package/docs/migrations/commands-1.15.0.md +17 -12
  121. package/docs/skills-catalog.md +5 -4
  122. package/llms.txt +4 -3
  123. package/package.json +1 -1
  124. package/scripts/agent-config +45 -1
  125. package/scripts/ai_council/_default_prices.py +4 -4
  126. package/scripts/ai_council/bundler.py +3 -3
  127. package/scripts/ai_council/clients.py +25 -9
  128. package/scripts/ai_council/modes.py +3 -4
  129. package/scripts/ai_council/one_off_archive/2026-05/README.md +22 -0
  130. package/scripts/ai_council/one_off_archive/2026-05/_one_off_roundtrip.py +13 -8
  131. package/scripts/ai_council/one_off_archive/2026-05/_one_off_tier_retrofit.py +180 -0
  132. package/scripts/ai_council/pricing.py +10 -9
  133. package/scripts/ai_council/session.py +92 -0
  134. package/scripts/build_rule_trigger_matrix.py +1 -9
  135. package/scripts/capture_showcase_session.py +361 -0
  136. package/scripts/chat_history.py +963 -597
  137. package/scripts/check_always_budget.py +7 -2
  138. package/scripts/check_references.py +12 -2
  139. package/scripts/context_hygiene_hook.py +14 -6
  140. package/scripts/council_cli.py +407 -0
  141. package/scripts/hook_manifest.yaml +217 -0
  142. package/scripts/hooks/__init__.py +1 -0
  143. package/scripts/hooks/augment-chat-history.sh +10 -0
  144. package/scripts/hooks/augment-dispatcher.sh +72 -0
  145. package/scripts/hooks/cline-dispatcher.sh +86 -0
  146. package/scripts/hooks/cowork-dispatcher.sh +98 -0
  147. package/scripts/hooks/cursor-dispatcher.sh +76 -0
  148. package/scripts/hooks/dispatch_hook.py +383 -0
  149. package/scripts/hooks/envelope.py +98 -0
  150. package/scripts/hooks/gemini-dispatcher.sh +117 -0
  151. package/scripts/hooks/state_io.py +122 -0
  152. package/scripts/hooks/windsurf-dispatcher.sh +123 -0
  153. package/scripts/hooks_status.py +157 -0
  154. package/scripts/install-hooks.sh +2 -2
  155. package/scripts/install.py +725 -87
  156. package/scripts/install.sh +38 -1
  157. package/scripts/lint_handoffs.py +214 -0
  158. package/scripts/lint_hook_manifest.py +217 -0
  159. package/scripts/lint_one_off_age.py +184 -0
  160. package/scripts/lint_rule_tiers.py +78 -0
  161. package/scripts/lint_showcase_sessions.py +148 -0
  162. package/scripts/minimal_safe_diff_hook.py +245 -0
  163. package/scripts/onboarding_gate_hook.py +13 -8
  164. package/scripts/readme_linter.py +12 -3
  165. package/scripts/redact_hook_capture.py +148 -0
  166. package/scripts/roadmap_progress_hook.py +5 -0
  167. package/scripts/schemas/skill.schema.json +5 -0
  168. package/scripts/skill_linter.py +163 -1
  169. package/scripts/sync_agent_settings.py +32 -129
  170. package/scripts/sync_yaml_rt.py +734 -0
  171. package/scripts/update_prices.py +3 -3
  172. package/scripts/verify_before_complete_hook.py +216 -0
  173. package/.agent-src/commands/chat-history/checkpoint.md +0 -126
  174. package/.agent-src/commands/chat-history/clear.md +0 -103
  175. package/.agent-src/commands/chat-history/resume.md +0 -183
  176. package/.agent-src/rules/chat-history-cadence.md +0 -109
  177. package/.agent-src/rules/chat-history-ownership.md +0 -123
  178. package/.agent-src/rules/chat-history-visibility.md +0 -96
  179. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +0 -50
  180. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +0 -49
  181. package/scripts/check_phase_coupling.py +0 -148
@@ -0,0 +1,221 @@
1
+ # Hook payload capture guide
2
+
3
+ **Purpose:** walk through the live-session payload capture for one platform
4
+ in roughly 5 minutes, so the corresponding entry in
5
+ [`agents/contexts/chat-history-platform-hooks.md`](../agents/contexts/chat-history-platform-hooks.md)
6
+ can move from `docs-verified` to `payload-verified`.
7
+
8
+ **Scope:** Cursor · Cline · Windsurf · Gemini CLI. Augment Code and Claude
9
+ Code already shipped as `docs-verified` in Phase 1 of the now-archived
10
+ [`road-to-verified-chat-history-platforms.md`](../agents/roadmaps/archive/road-to-verified-chat-history-platforms.md).
11
+ Cowork is upstream-blocked separately
12
+ ([`#40495`](https://github.com/anthropics/claude-code/issues/40495)) and
13
+ not in scope here.
14
+
15
+ **Why this is opportunistic:** the payload-verified upgrade is a nice-to-have.
16
+ The shipping `docs-verified` extractors already match the vendor docs —
17
+ captures are insurance against silent vendor-side schema drift. Pick one
18
+ platform when convenient; do not run all four in one sitting unless you
19
+ already have all four IDEs installed and licensed.
20
+
21
+ ## Pre-flight (one-time, ~30 seconds)
22
+
23
+ ```bash
24
+ cd /path/to/agent-config
25
+
26
+ # Confirm the dispatcher is wired in this project (idempotent — safe to rerun).
27
+ # Replace <platform> with cursor / cline / windsurf / gemini as appropriate
28
+ # when you reach that platform's section.
29
+ python3 scripts/install.py --<platform>
30
+
31
+ # Confirm the trampoline + project-scope hooks file landed.
32
+ ./agent-config hooks:status | grep -E "^[ ✓✅⚠️❌·] (cursor|cline|windsurf|gemini)"
33
+ ```
34
+
35
+ `hooks:status` should report `installed` for the platform you just wired
36
+ (or `missing` if the project-scope file did not land — in that case rerun
37
+ the install with `--force`).
38
+
39
+ ## Common capture loop (steps reused on every platform)
40
+
41
+ ```bash
42
+ # 1. Pick a per-platform capture dir (gitignored; never committed).
43
+ export AGENT_HOOK_CAPTURE_DIR="$HOME/.agent-config-captures/<platform>"
44
+ mkdir -p "$AGENT_HOOK_CAPTURE_DIR"
45
+
46
+ # 2. Restart / reload the platform so it picks up the env var.
47
+ # Per-platform commands below.
48
+
49
+ # 3. Run ONE short, boring session in the platform.
50
+ # Recommended prompt: "echo hello" or "what time is it".
51
+ # Goal is to capture the envelope shape, not interesting content.
52
+
53
+ # 4. Confirm capture files exist.
54
+ ls -1 "$AGENT_HOOK_CAPTURE_DIR" | head
55
+
56
+ # 5. Redact (replaces user-content fields with <REDACTED>;
57
+ # envelope keys preserved).
58
+ python3 scripts/redact_hook_capture.py "$AGENT_HOOK_CAPTURE_DIR" --strict
59
+
60
+ # 6. Pick the smallest representative file.
61
+ ls -1Sr "$AGENT_HOOK_CAPTURE_DIR"/*.redacted.json | head -1
62
+
63
+ # 7. cat it; copy the JSON; paste into the archived roadmap section
64
+ # (see § Where to paste below).
65
+ ```
66
+
67
+ The redaction step is non-negotiable. The goal is to lock schemas, not to
68
+ archive conversations.
69
+
70
+ ## Per-platform notes
71
+
72
+ ### Cursor (~5 min)
73
+
74
+ - **Install:** `python3 scripts/install.py --cursor` (project) or
75
+ `--cursor-user-hooks` (covers every project you open).
76
+ - **Restart:** quit Cursor (Cmd+Q on macOS), then relaunch from the
77
+ shell where you exported `AGENT_HOOK_CAPTURE_DIR` so the env var
78
+ propagates to the renderer process. Reopening a window from the
79
+ Dock will not inherit the env.
80
+ - **Trigger event:** type a prompt in Cursor's agent panel and let it
81
+ finish. Expected captures: one `sessionStart`, one
82
+ `beforeSubmitPrompt`, one `afterAgentResponse` and/or `stop`,
83
+ zero or more `postToolUse`.
84
+ - **File pattern:** `cursor__afterAgentResponse__<ts>__<pid>.json` is
85
+ the most useful one to paste.
86
+ - **CLI vs IDE:** Cursor CLI fires only
87
+ `beforeShellExecution`/`afterShellExecution` — for the
88
+ per-turn payload you need the IDE.
89
+
90
+ ### Cline (~5 min)
91
+
92
+ - **Install:** `python3 scripts/install.py --cline` (project) or
93
+ `--cline-user-hooks` (user-scope, covers every workspace).
94
+ - **Restart:** in VS Code or JetBrains, run "Developer: Reload
95
+ Window" (Cmd+Shift+P) from a terminal where the env is exported.
96
+ Cline reads hooks at task start, so a fresh task is required —
97
+ closing and reopening the side panel is not enough.
98
+ - **Trigger event:** start a new Cline task and let one turn complete.
99
+ Cline calls them "tasks" not "sessions"; the equivalent boundaries
100
+ are `TaskStart` → `UserPromptSubmit` → `PostToolUse`* →
101
+ `TaskComplete`.
102
+ - **File pattern:** `cline__TaskComplete__<ts>__<pid>.json` if you let
103
+ the task finish; `cline__UserPromptSubmit__<ts>__<pid>.json` is also
104
+ acceptable (carries the `prompt` envelope).
105
+ - **Windows caveat:** hooks are unsupported on Windows
106
+ ([`cline/cline#8073`](https://github.com/cline/cline/issues/8073));
107
+ capture from macOS or Linux.
108
+
109
+ ### Windsurf (~5 min)
110
+
111
+ - **Install:** `python3 scripts/install.py --windsurf` (project) or
112
+ `--windsurf-user-hooks` (user-scope at `~/.codeium/windsurf/hooks.json`).
113
+ - **Restart:** quit Cascade fully, then relaunch from the shell with
114
+ the env exported. The `pre_user_prompt` event fires on every turn —
115
+ no full restart needed once Cascade is up, but the *first* turn after
116
+ launch must be the captured one.
117
+ - **Trigger event:** ask Cascade one short question and let it answer.
118
+ Expected captures: `pre_user_prompt`,
119
+ `post_cascade_response_with_transcript`. The
120
+ `_with_transcript` variant is the more useful one to paste because it
121
+ carries the full response inline.
122
+ - **File pattern:** `windsurf__post_cascade_response_with_transcript__<ts>__<pid>.json`.
123
+ - **Async caveat:** `post_cascade_response` fires asynchronously off
124
+ the critical path. The capture file might land a second or two after
125
+ the response renders — wait briefly before running the redact step.
126
+
127
+ ### Gemini CLI (~5 min)
128
+
129
+ - **Install:** `python3 scripts/install.py --gemini` (project) or
130
+ `--gemini-user-hooks` (user-scope at `~/.gemini/settings.json`).
131
+ - **Restart:** Gemini CLI is invoked per command — no daemon to
132
+ restart. Just open a new shell with `AGENT_HOOK_CAPTURE_DIR`
133
+ exported and run the next session there.
134
+ - **Trigger event:** any short Gemini CLI session
135
+ (`gemini "what time is it"` or similar). Hooks fire on
136
+ `SessionStart` → `BeforeAgent` → `AfterTool`* → `AfterAgent` →
137
+ `SessionEnd`.
138
+ - **File pattern:** `gemini__AfterAgent__<ts>__<pid>.json` carries the
139
+ per-turn close envelope and is the recommended paste target.
140
+ - **Advisory hooks:** `SessionStart` and `SessionEnd` are advisory only
141
+ in Gemini CLI — do not be alarmed if those captures look thinner than
142
+ the others.
143
+
144
+ ## Where to paste the redacted payload
145
+
146
+ The roadmap is now archived. Paste under the matching phase:
147
+
148
+ [`agents/roadmaps/archive/road-to-verified-chat-history-platforms.md`](../agents/roadmaps/archive/road-to-verified-chat-history-platforms.md)
149
+
150
+ - Cursor → § Phase 2 — Cursor
151
+ - Cline → § Phase 3 — Cline
152
+ - Windsurf → § Phase 4 — Windsurf
153
+ - Gemini CLI → § Phase 5 — Gemini CLI
154
+
155
+ In the chosen phase, paste the redacted JSON inside a fenced
156
+ `json` block under a heading like `### <Platform> payload shape (captured 2026-MM-DD)`,
157
+ then flip the `[ ] Optional upgrade — payload-verified` checkbox to
158
+ `[x]`.
159
+
160
+ Then update the matching row in
161
+ [`agents/contexts/chat-history-platform-hooks.md`](../agents/contexts/chat-history-platform-hooks.md):
162
+ the `Verification` column moves from `docs-verified` to
163
+ `payload-verified`.
164
+
165
+ If the captured shape diverges from the docs-verified extractor
166
+ branch, that is the trigger for a code patch — open a tiny new roadmap
167
+ under `agents/roadmaps/` for the divergence work, do **not** edit the
168
+ archived roadmap to track new code work
169
+ (see [`no-roadmap-references`](../.agent-src/rules/no-roadmap-references.md)).
170
+
171
+ ## Final verify
172
+
173
+ After pasting and flipping the checkbox:
174
+
175
+ ```bash
176
+ # Lint gates must stay green.
177
+ python3 scripts/lint_hook_manifest.py
178
+ python3 scripts/check_references.py
179
+ python3 scripts/check_portability.py
180
+
181
+ # Tests still green.
182
+ python3 -m pytest tests/hooks/ -q
183
+
184
+ # Optional: regenerate the dashboard if the archived roadmap's
185
+ # checkbox change should bubble up. Iron Law from
186
+ # `roadmap-progress-sync` says yes if it does.
187
+ ./agent-config roadmap:progress
188
+ ```
189
+
190
+ Per
191
+ [`commit-policy`](../.agent-src/rules/commit-policy.md):
192
+ do **not** commit unless explicitly told to. The user owns the commit
193
+ step.
194
+
195
+ ## Cleanup after capture
196
+
197
+ ```bash
198
+ # Raw captures (not redacted) contain real prompt content.
199
+ # Either delete the directory or leave it for repeat captures.
200
+ rm -rf "$AGENT_HOOK_CAPTURE_DIR"
201
+
202
+ # Or keep redacted ones only:
203
+ # find "$AGENT_HOOK_CAPTURE_DIR" -type f ! -name '*.redacted.json' -delete
204
+
205
+ # Unset the env var when done so subsequent sessions do not capture.
206
+ unset AGENT_HOOK_CAPTURE_DIR
207
+ ```
208
+
209
+ The capture directory is gitignored project-wide; raw captures are
210
+ never accidentally committed. The redaction step is still mandatory
211
+ before paste because the redacted output goes into a tracked file
212
+ (the archived roadmap) and would otherwise leak.
213
+
214
+ ## Sources
215
+
216
+ - Capture engine: [`scripts/hooks/dispatch_hook.py`](../scripts/hooks/dispatch_hook.py) — `_maybe_capture_payload`
217
+ - Redactor: [`scripts/redact_hook_capture.py`](../scripts/redact_hook_capture.py)
218
+ - Per-platform install logic: [`scripts/install.py`](../scripts/install.py) — search `ensure_<platform>_bridge` / `ensure_<platform>_user_hooks`
219
+ - Platform matrix + payload schemas: [`agents/contexts/chat-history-platform-hooks.md`](../agents/contexts/chat-history-platform-hooks.md)
220
+ - Hook architecture: [`docs/contracts/hook-architecture-v1.md`](contracts/hook-architecture-v1.md)
221
+ - Archived roadmap with per-phase paste sections: [`agents/roadmaps/archive/road-to-verified-chat-history-platforms.md`](../agents/roadmaps/archive/road-to-verified-chat-history-platforms.md)
@@ -85,18 +85,23 @@ the deprecation cycle for Phase 1 closes. Tracked in
85
85
  [`agents/roadmaps/archive/road-to-governance-cleanup.md`](../../agents/roadmaps/archive/road-to-governance-cleanup.md)
86
86
  § F2.
87
87
 
88
- ## Related rule split — `chat-history` (post-1.15.0)
89
-
90
- The monolithic `rules/chat-history.md` was split into three sibling
91
- `always` rules in the post-1.15.0 optimization phase:
92
-
93
- - [`chat-history-ownership`](../../.agent-src/rules/chat-history-ownership.md) sole owner of file I/O + first-turn handshake.
94
- - [`chat-history-cadence`](../../.agent-src/rules/chat-history-cadence.md) when to persist (SessionStart / StepEnd / append boundaries).
95
- - [`chat-history-visibility`](../../.agent-src/rules/chat-history-visibility.md)heartbeat marker contract for user-facing reporting.
96
-
97
- Decision record: [`docs/contracts/adr-chat-history-split.md`](../contracts/adr-chat-history-split.md).
98
- Cross-references in commands and contexts now point to
99
- `chat-history-ownership` as the entry point.
88
+ ## Related rule split — `chat-history` (post-1.15.0, superseded)
89
+
90
+ > **Superseded · 2026-05-04** by
91
+ > [`agents/contexts/chat-history-platform-hooks.md`](../../agents/contexts/chat-history-platform-hooks.md).
92
+ > The three sibling rules (`chat-history-ownership`,
93
+ > `chat-history-cadence`, `chat-history-visibility`) and the heartbeat
94
+ > marker no longer exist. Persistence is now a pure platform-hook
95
+ > contract`session_start` auto-adopts foreign sessions silently;
96
+ > the agent never reads or writes `agents/.agent-chat-history` cooperatively.
97
+ > Manual recovery lever: `./agent-config chat-history:adopt`.
98
+
99
+ For historical context: the monolithic `rules/chat-history.md` was
100
+ first split into three sibling `always` rules in the post-1.15.0
101
+ optimization phase, recorded in
102
+ [`docs/contracts/adr-chat-history-split.md`](../contracts/adr-chat-history-split.md)
103
+ (also marked superseded). The hook-only roadmap then collapsed all
104
+ three rules into structural-only artefacts.
100
105
 
101
106
  ## Rollback
102
107
 
@@ -1,6 +1,6 @@
1
1
  # Skills Catalog
2
2
 
3
- All **128 skills** available in this package, in alphabetical order.
3
+ All **129 skills** available in this package, in alphabetical order.
4
4
  Click a skill name to open its SKILL.md and read the full guidance.
5
5
 
6
6
  > **Regenerate:** `python3 scripts/generate_catalog.py`
@@ -10,6 +10,7 @@ Click a skill name to open its SKILL.md and read the full guidance.
10
10
  |---|---|
11
11
  | [`adversarial-review`](../.agent-src/skills/adversarial-review/SKILL.md) | ONLY when user explicitly requests adversarial review, devil's advocate analysis, stress-testing a plan, or 'poke holes in this' — NOT for regular code review or design feedback. |
12
12
  | [`agent-docs-writing`](../.agent-src/skills/agent-docs-writing/SKILL.md) | Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure. |
13
+ | [`ai-council`](../.agent-src/skills/ai-council/SKILL.md) | Use when polling external AIs (OpenAI, Anthropic) outside the host session for a neutral second opinion on a roadmap, diff, prompt, or file set — or 'cross-check with another model'. |
13
14
  | [`analysis-autonomous-mode`](../.agent-src/skills/analysis-autonomous-mode/SKILL.md) | ONLY when user explicitly requests autonomous analysis, deep investigation, multi-step research, or 'dig into this end-to-end without asking me each step' — NOT for normal feature work. |
14
15
  | [`analysis-skill-router`](../.agent-src/skills/analysis-skill-router/SKILL.md) | Use when picking which analysis or project-analysis-* skill fits a request — routes by scope, framework, and symptom — even if the user just says 'analyze this' or 'dig into the codebase'. |
15
16
  | [`api-design`](../.agent-src/skills/api-design/SKILL.md) | Use when designing APIs, planning endpoints, REST conventions, versioning, or deprecation — even when the user just says 'expose this as an endpoint' without naming API design. |
@@ -18,7 +19,7 @@ Click a skill name to open its SKILL.md and read the full guidance.
18
19
  | [`artisan-commands`](../.agent-src/skills/artisan-commands/SKILL.md) | Use when creating or modifying Artisan commands. Covers clear signatures, safe execution flow, helpful output, and project conventions for console tooling. |
19
20
  | [`authz-review`](../.agent-src/skills/authz-review/SKILL.md) | Use when reviewing authorization end-to-end — route → gate → policy → query scope → response filter — before changes to permissions, tenants, ownership, or admin flows. |
20
21
  | [`aws-infrastructure`](../.agent-src/skills/aws-infrastructure/SKILL.md) | Use when working with AWS resources — ECS Fargate, ECR, EFS, Secrets Manager, gomplate templates, multi-env deployments — even when the user says 'deploy to staging' without naming AWS. |
21
- | [`blade-ui`](../.agent-src/skills/blade-ui/SKILL.md) | Stack-implementation skill for Laravel Blade — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Blade. Covers views, components, partials, layouts, and view logic. |
22
+ | [`blade-ui`](../.agent-src/skills/blade-ui/SKILL.md) | Use when the project's frontend stack is Blade — dispatched by `directives/ui/{apply,review,polish}.py`. Covers views, components, partials, layouts, and view logic. |
22
23
  | [`blast-radius-analyzer`](../.agent-src/skills/blast-radius-analyzer/SKILL.md) | Use BEFORE editing shared code — enumerates every call site, event consumer, queue worker, API client, migration, and test that a planned change will touch, with a file:line citation per dependency. |
23
24
  | [`bug-analyzer`](../.agent-src/skills/bug-analyzer/SKILL.md) | Use when the user shares a Sentry error, Jira bug ticket, or error description and wants root cause analysis. Also for proactive bug hunting and code audits for hidden bugs. |
24
25
  | [`check-refs`](../.agent-src/skills/check-refs/SKILL.md) | Use when verifying cross-references between skills, rules, commands, guidelines, and context documents are not broken after edits, renames, or deletions. |
@@ -49,7 +50,7 @@ Click a skill name to open its SKILL.md and read the full guidance.
49
50
  | [`feature-planning`](../.agent-src/skills/feature-planning/SKILL.md) | Use when the user says "plan a feature", "brainstorm", "explore this idea", or wants to go from idea to structured plan and roadmap. |
50
51
  | [`file-editor`](../.agent-src/skills/file-editor/SKILL.md) | Use when opening edited files in the user's IDE. Reads settings from .agent-settings.yml to determine IDE and whether auto-open is enabled. |
51
52
  | [`finishing-a-development-branch`](../.agent-src/skills/finishing-a-development-branch/SKILL.md) | Use when the feature is implementation-complete and the next step is 'ship it' — verifies, cleans up, and routes to merge/PR/park/discard — even when the user just says 'I'm done, what now?'. |
52
- | [`flux`](../.agent-src/skills/flux/SKILL.md) | Stack-implementation skill for Laravel Flux — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project uses `livewire/flux`. Covers Flux components, slots, variants, and form primitives. |
53
+ | [`flux`](../.agent-src/skills/flux/SKILL.md) | Use when the project uses `livewire/flux` — dispatched by `directives/ui/{apply,review,polish}.py`. Covers Flux components, slots, variants, and form primitives. |
53
54
  | [`git-workflow`](../.agent-src/skills/git-workflow/SKILL.md) | Use when working with Git — branch naming, commit messages, PR creation, rebasing, or the code review process — even when the user says 'push this' or 'merge the branch' without naming Git. |
54
55
  | [`github-ci`](../.agent-src/skills/github-ci/SKILL.md) | Use when working with GitHub Actions — workflow YAML, quality gates, test matrices, deployment triggers, reusable workflows — even when the user just says 'my CI is failing' or 'add a check'. |
55
56
  | [`grafana`](../.agent-src/skills/grafana/SKILL.md) | Use when working with Grafana — dashboards, Loki LogQL queries, alerting rules, monitoring panels — even when the user just says 'build me a dashboard' or 'query the logs' without naming Grafana. |
@@ -72,7 +73,7 @@ Click a skill name to open its SKILL.md and read the full guidance.
72
73
  | [`laravel-validation`](../.agent-src/skills/laravel-validation/SKILL.md) | Use when writing validation — Form Requests, rules, custom rule objects, request-boundary design — even when the user just says 'validate this input' or 'check the request' without naming it. |
73
74
  | [`learning-to-rule-or-skill`](../.agent-src/skills/learning-to-rule-or-skill/SKILL.md) | Use when a repeated learning, mistake, or successful pattern should be turned into a new rule or skill. Also use after completing a task to capture learnings from the work. |
74
75
  | [`lint-skills`](../.agent-src/skills/lint-skills/SKILL.md) | Use when running the package's skill linter against all skills and rules to validate frontmatter, required sections, and execution metadata. |
75
- | [`livewire`](../.agent-src/skills/livewire/SKILL.md) | Stack-implementation skill for Livewire — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Livewire. Covers reactive state, events, lifecycle hooks, and component/view separation. |
76
+ | [`livewire`](../.agent-src/skills/livewire/SKILL.md) | Use when the project's frontend stack is Livewire — dispatched by `directives/ui/{apply,review,polish}.py`. Covers reactive state, events, lifecycle hooks, and component/view separation. |
76
77
  | [`logging-monitoring`](../.agent-src/skills/logging-monitoring/SKILL.md) | Use when working with logging or monitoring — Sentry error tracking, Grafana/Loki log aggregation, structured logging channels, or monitoring helpers. |
77
78
  | [`mcp`](../.agent-src/skills/mcp/SKILL.md) | Use when working with MCP (Model Context Protocol) servers — their tools, capabilities, and best practices for effective agent workflows. |
78
79
  | [`md-language-check`](../.agent-src/skills/md-language-check/SKILL.md) | Use BEFORE saving any .md under .augment/, .agent-src*/, or agents/ — scans umlauts, German function words, and quoted German phrases outside DE:/EN: anchor blocks. Hard gate per language-and-tone. |
package/llms.txt CHANGED
@@ -8,6 +8,7 @@ Catalog: docs/skills-catalog.md
8
8
 
9
9
  adversarial-review: ONLY when user explicitly requests adversarial review, devil's advocate analysis, stress-testing a plan, or 'poke holes in this' — NOT for regular code review or design feedback.
10
10
  agent-docs-writing: Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.
11
+ ai-council: Use when polling external AIs (OpenAI, Anthropic) outside the host session for a neutral second opinion on a roadmap, diff, prompt, or file set — or 'cross-check with another model'.
11
12
  analysis-autonomous-mode: ONLY when user explicitly requests autonomous analysis, deep investigation, multi-step research, or 'dig into this end-to-end without asking me each step' — NOT for normal feature work.
12
13
  analysis-skill-router: Use when picking which analysis or project-analysis-* skill fits a request — routes by scope, framework, and symptom — even if the user just says 'analyze this' or 'dig into the codebase'.
13
14
  api-design: Use when designing APIs, planning endpoints, REST conventions, versioning, or deprecation — even when the user just says 'expose this as an endpoint' without naming API design.
@@ -16,7 +17,7 @@ api-testing: Use when writing API endpoint tests — integration tests, contract
16
17
  artisan-commands: Use when creating or modifying Artisan commands. Covers clear signatures, safe execution flow, helpful output, and project conventions for console tooling.
17
18
  authz-review: Use when reviewing authorization end-to-end — route → gate → policy → query scope → response filter — before changes to permissions, tenants, ownership, or admin flows.
18
19
  aws-infrastructure: Use when working with AWS resources — ECS Fargate, ECR, EFS, Secrets Manager, gomplate templates, multi-env deployments — even when the user says 'deploy to staging' without naming AWS.
19
- blade-ui: Stack-implementation skill for Laravel Blade — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Blade. Covers views, components, partials, layouts, and view logic.
20
+ blade-ui: Use when the project's frontend stack is Blade — dispatched by `directives/ui/{apply,review,polish}.py`. Covers views, components, partials, layouts, and view logic.
20
21
  blast-radius-analyzer: Use BEFORE editing shared code — enumerates every call site, event consumer, queue worker, API client, migration, and test that a planned change will touch, with a file:line citation per dependency.
21
22
  bug-analyzer: Use when the user shares a Sentry error, Jira bug ticket, or error description and wants root cause analysis. Also for proactive bug hunting and code audits for hidden bugs.
22
23
  check-refs: Use when verifying cross-references between skills, rules, commands, guidelines, and context documents are not broken after edits, renames, or deletions.
@@ -47,7 +48,7 @@ fe-design: Reference for frontend-design heuristics — component architecture,
47
48
  feature-planning: Use when the user says "plan a feature", "brainstorm", "explore this idea", or wants to go from idea to structured plan and roadmap.
48
49
  file-editor: Use when opening edited files in the user's IDE. Reads settings from .agent-settings.yml to determine IDE and whether auto-open is enabled.
49
50
  finishing-a-development-branch: Use when the feature is implementation-complete and the next step is 'ship it' — verifies, cleans up, and routes to merge/PR/park/discard — even when the user just says 'I'm done, what now?'.
50
- flux: Stack-implementation skill for Laravel Flux — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project uses `livewire/flux`. Covers Flux components, slots, variants, and form primitives.
51
+ flux: Use when the project uses `livewire/flux` — dispatched by `directives/ui/{apply,review,polish}.py`. Covers Flux components, slots, variants, and form primitives.
51
52
  git-workflow: Use when working with Git — branch naming, commit messages, PR creation, rebasing, or the code review process — even when the user says 'push this' or 'merge the branch' without naming Git.
52
53
  github-ci: Use when working with GitHub Actions — workflow YAML, quality gates, test matrices, deployment triggers, reusable workflows — even when the user just says 'my CI is failing' or 'add a check'.
53
54
  grafana: Use when working with Grafana — dashboards, Loki LogQL queries, alerting rules, monitoring panels — even when the user just says 'build me a dashboard' or 'query the logs' without naming Grafana.
@@ -70,7 +71,7 @@ laravel-scheduling: Use when configuring Laravel task scheduling — cron expres
70
71
  laravel-validation: Use when writing validation — Form Requests, rules, custom rule objects, request-boundary design — even when the user just says 'validate this input' or 'check the request' without naming it.
71
72
  learning-to-rule-or-skill: Use when a repeated learning, mistake, or successful pattern should be turned into a new rule or skill. Also use after completing a task to capture learnings from the work.
72
73
  lint-skills: Use when running the package's skill linter against all skills and rules to validate frontmatter, required sections, and execution metadata.
73
- livewire: Stack-implementation skill for Livewire — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Livewire. Covers reactive state, events, lifecycle hooks, and component/view separation.
74
+ livewire: Use when the project's frontend stack is Livewire — dispatched by `directives/ui/{apply,review,polish}.py`. Covers reactive state, events, lifecycle hooks, and component/view separation.
74
75
  logging-monitoring: Use when working with logging or monitoring — Sentry error tracking, Grafana/Loki log aggregation, structured logging channels, or monitoring helpers.
75
76
  mcp: Use when working with MCP (Model Context Protocol) servers — their tools, capabilities, and best practices for effective agent workflows.
76
77
  md-language-check: Use BEFORE saving any .md under .augment/, .agent-src*/, or agents/ — scans umlauts, German function words, and quoted German phrases outside DE:/EN: anchor blocks. Hard gate per language-and-tone.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event4u/agent-config",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "description": "Shared agent configuration \u2014 skills, rules, commands, guidelines, and templates for AI coding tools",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -68,7 +68,7 @@ Commands:
68
68
  refine-ticket:detect Run the deterministic refine-ticket detection helper
69
69
  chat-history:hook Platform hook entry point (read JSON from stdin)
70
70
  Usage: chat-history:hook --platform <claude|augment|cursor|cline|windsurf|gemini>
71
- chat-history:checkpoint Append a phase-boundary entry to .agent-chat-history
71
+ chat-history:checkpoint Append a phase-boundary entry to agents/.agent-chat-history
72
72
  (CHECKPOINT fallback for platforms without native hooks)
73
73
  roadmap-progress:hook PostToolUse hook entry point (read JSON from stdin)
74
74
  Regenerates roadmaps-progress.md when a tool wrote under agents/roadmaps/
@@ -76,9 +76,20 @@ Commands:
76
76
  Writes .augment/state/onboarding-gate.json from .agent-settings.yml
77
77
  context-hygiene:hook PostToolUse hook entry point (read JSON from stdin)
78
78
  Maintains .augment/state/context-hygiene.json (turn count, loop, freshness)
79
+ dispatch:hook Universal hook dispatcher (Phase 7, hook-architecture-v1.md)
80
+ Usage: dispatch:hook --platform <name> --event <event> [--native-event <native>]
81
+ Reads scripts/hook_manifest.yaml and runs the resolved concern chain.
82
+ hooks:status Print the runtime hook matrix (per-platform install + bindings)
83
+ Flags: --format json|table, --strict (CI), --project-root <path>
79
84
  telemetry:record Append one artefact-engagement event (default-off)
80
85
  telemetry:status Print artefact-engagement telemetry status (read-only)
81
86
  telemetry:report Aggregate the engagement log into a quartile report
87
+ council:estimate Pre-call council cost preview (no API call, no spend)
88
+ Usage: council:estimate <question> [--input-mode prompt|roadmap]
89
+ council:run Run the council. Requires --confirm to spend.
90
+ Usage: council:run <question> --output <path> --confirm
91
+ council:render Re-render a saved council responses JSON to markdown
92
+ Usage: council:render <responses.json>
82
93
  help Show this help
83
94
  --version, -V Print package version
84
95
 
@@ -102,6 +113,9 @@ Examples:
102
113
  ./agent-config telemetry:status --format json
103
114
  ./agent-config telemetry:report --since 30d --top 20
104
115
  ./agent-config telemetry:report --since 7d --format json --top 0
116
+ ./agent-config council:estimate prompt.txt
117
+ ./agent-config council:run prompt.txt --output agents/council-sessions/out.json --confirm
118
+ ./agent-config council:render agents/council-sessions/out.json
105
119
 
106
120
  All commands operate on the CURRENT DIRECTORY (your project root).
107
121
  The CLI is strictly consumer-facing. Maintainer tasks live in Taskfile.yml.
@@ -343,6 +357,20 @@ cmd_context_hygiene_hook() {
343
357
  exec python3 "$script" "$@"
344
358
  }
345
359
 
360
+ cmd_dispatch_hook() {
361
+ require_python3
362
+ local script
363
+ script="$(resolve_script "scripts/hooks/dispatch_hook.py")" || return 1
364
+ exec python3 "$script" "$@"
365
+ }
366
+
367
+ cmd_hooks_status() {
368
+ require_python3
369
+ local script
370
+ script="$(resolve_script "scripts/hooks_status.py")" || return 1
371
+ exec python3 "$script" "$@"
372
+ }
373
+
346
374
  cmd_chat_history_checkpoint() {
347
375
  require_python3
348
376
  local script
@@ -438,6 +466,17 @@ cmd_keys_install_openai() {
438
466
  exec bash "$script" "$@"
439
467
  }
440
468
 
469
+ # Council CLI — non-interactive wrapper around scripts.ai_council.orchestrator.
470
+ # Three subcommands share one Python entry point; we forward the subcommand
471
+ # verb so `./agent-config council:run --confirm` lands on `council_cli.py run`.
472
+ cmd_council() {
473
+ require_python3
474
+ local sub="$1"; shift || true
475
+ local script
476
+ script="$(resolve_script "scripts/council_cli.py")" || return 1
477
+ exec env PYTHONPATH="$PACKAGE_ROOT" python3 "$script" "$sub" "$@"
478
+ }
479
+
441
480
  main() {
442
481
  local cmd="${1-}"
443
482
  [[ $# -gt 0 ]] && shift || true
@@ -466,9 +505,14 @@ main() {
466
505
  roadmap-progress:hook) cmd_roadmap_progress_hook "$@" ;;
467
506
  onboarding-gate:hook) cmd_onboarding_gate_hook "$@" ;;
468
507
  context-hygiene:hook) cmd_context_hygiene_hook "$@" ;;
508
+ dispatch:hook) cmd_dispatch_hook "$@" ;;
509
+ hooks:status) cmd_hooks_status "$@" ;;
469
510
  telemetry:record) cmd_telemetry_record "$@" ;;
470
511
  telemetry:status) cmd_telemetry_status "$@" ;;
471
512
  telemetry:report) cmd_telemetry_report "$@" ;;
513
+ council:estimate) cmd_council estimate "$@" ;;
514
+ council:run) cmd_council run "$@" ;;
515
+ council:render) cmd_council render "$@" ;;
472
516
  help|--help|-h|"") usage ;;
473
517
  --version|-V) print_version ;;
474
518
  *)
@@ -1,7 +1,7 @@
1
1
  """Shipped baseline prices for the AI Council.
2
2
 
3
- This file is the bootstrap source for `.agent-prices.md` when the
4
- runtime file is missing. It is also the network-fallback source for
3
+ This file is the bootstrap source for `agents/.agent-prices.md` when
4
+ the runtime file is missing. It is also the network-fallback source for
5
5
  `scripts/update_prices.py` when the upstream feed (LiteLLM) is
6
6
  unreachable.
7
7
 
@@ -9,8 +9,8 @@ Prices are USD per **1 000 000** tokens. Models are identified by the
9
9
  exact `model:` string the user puts into `.agent-settings.yml`.
10
10
 
11
11
  Numbers below are a hand-curated snapshot — they will drift. The
12
- runtime never reads them directly once `.agent-prices.md` exists; the
13
- weekly refresh and user edits are the live source of truth.
12
+ runtime never reads them directly once `agents/.agent-prices.md`
13
+ exists; the weekly refresh and user edits are the live source of truth.
14
14
  """
15
15
 
16
16
  from __future__ import annotations
@@ -38,11 +38,11 @@ class CouncilContext:
38
38
  # placeholder. Order matters — the most specific pattern goes first.
39
39
 
40
40
  _REDACTION_LINE_PATTERNS: list[tuple[re.Pattern[str], str]] = [
41
- (re.compile(r".*~?/?\.config/agent-config/[^/\s]+\.key.*"),
41
+ (re.compile(r"~?/?\.config/agent-config/[^/\s]+\.key"),
42
42
  "[redacted: agent-config key path]"),
43
- (re.compile(r"^\s*Authorization:\s.*", re.IGNORECASE),
43
+ (re.compile(r"^\s*Authorization:\s", re.IGNORECASE),
44
44
  "[redacted: Authorization header]"),
45
- (re.compile(r"(?i).*(api[_-]?key|secret|token|password)\s*[:=].*"),
45
+ (re.compile(r"(?i)(api[_-]?key|secret|token|password)\s*[:=]"),
46
46
  "[redacted: secret-like assignment]"),
47
47
  (re.compile(r"sk-ant-[A-Za-z0-9_\-]{8,}"), "[redacted: anthropic-key-like token]"),
48
48
  (re.compile(r"sk-[A-Za-z0-9_\-]{20,}"), "[redacted: openai-key-like token]"),
@@ -34,6 +34,16 @@ OPENAI_KEY_PATH = Path.home() / ".config" / "agent-config" / "openai.key"
34
34
  DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-5"
35
35
  DEFAULT_OPENAI_MODEL = "gpt-4o"
36
36
 
37
+ # OpenAI reasoning models (o1, o3, o4 families) reject `max_tokens` and the
38
+ # `system` role; they require `max_completion_tokens` and accept only `user`
39
+ # (and `developer`) messages.
40
+ _REASONING_PREFIXES = ("o1", "o3", "o4")
41
+
42
+
43
+ def _is_reasoning_model(model: str) -> bool:
44
+ name = model.lower()
45
+ return any(name == p or name.startswith(p + "-") for p in _REASONING_PREFIXES)
46
+
37
47
 
38
48
  class KeyGateError(RuntimeError):
39
49
  """Raised when a provider key file violates the 0600 contract."""
@@ -90,7 +100,7 @@ class ExternalAIClient(ABC):
90
100
 
91
101
  name: str = ""
92
102
  model: str = ""
93
- billable: bool = True # API-mode subclasses spend money; manual/playwright don't.
103
+ billable: bool = True # API-mode subclasses spend money; manual doesn't.
94
104
 
95
105
  @abstractmethod
96
106
  def ask(
@@ -189,15 +199,21 @@ class OpenAIClient(ExternalAIClient):
189
199
 
190
200
  def ask(self, system_prompt: str, user_prompt: str, max_tokens: int = 1024) -> CouncilResponse:
191
201
  t0 = time.monotonic()
202
+ kwargs: dict[str, object] = {"model": self.model}
203
+ if _is_reasoning_model(self.model):
204
+ # o1/o3/o4 reasoning models reject `max_tokens` and `system` role.
205
+ kwargs["max_completion_tokens"] = max_tokens
206
+ kwargs["messages"] = [
207
+ {"role": "user", "content": f"{system_prompt}\n\n---\n\n{user_prompt}"},
208
+ ]
209
+ else:
210
+ kwargs["max_tokens"] = max_tokens
211
+ kwargs["messages"] = [
212
+ {"role": "system", "content": system_prompt},
213
+ {"role": "user", "content": user_prompt},
214
+ ]
192
215
  try:
193
- response = self._client.chat.completions.create(
194
- model=self.model,
195
- max_tokens=max_tokens,
196
- messages=[
197
- {"role": "system", "content": system_prompt},
198
- {"role": "user", "content": user_prompt},
199
- ],
200
- )
216
+ response = self._client.chat.completions.create(**kwargs)
201
217
  except Exception as exc: # noqa: BLE001 - normalise all SDK errors
202
218
  return CouncilResponse(
203
219
  provider=self.name, model=self.model, text="",
@@ -4,14 +4,13 @@ Each council member runs in exactly one transport mode per invocation:
4
4
 
5
5
  - ``api`` — direct SDK call against the provider's API (billable).
6
6
  - ``manual`` — copy-paste loop with the user as transport (free).
7
- - ``playwright`` — browser automation (Phase 2c, not yet wired).
8
7
 
9
8
  Resolution precedence — first non-empty wins:
10
9
 
11
10
  1. Invocation flag e.g. ``/council mode:manual``
12
11
  2. Per-member setting ``ai_council.members.<name>.mode``
13
12
  3. Global setting ``ai_council.mode``
14
- 4. Built-in default ``api``
13
+ 4. Built-in default ``manual``
15
14
 
16
15
  This mirrors how ``cost_profile`` resolves in
17
16
  ``.augment/guidelines/agent-infra/layered-settings.md``.
@@ -24,9 +23,9 @@ from __future__ import annotations
24
23
 
25
24
  from typing import Mapping
26
25
 
27
- VALID_MODES: frozenset[str] = frozenset({"api", "manual", "playwright"})
26
+ VALID_MODES: frozenset[str] = frozenset({"api", "manual"})
28
27
 
29
- DEFAULT_MODE: str = "api"
28
+ DEFAULT_MODE: str = "manual"
30
29
 
31
30
 
32
31
  class InvalidModeError(ValueError):
@@ -8,6 +8,28 @@
8
8
  > `scripts/check_one_off_location.py` enforces that no new
9
9
  > `_one_off_*.py` lands outside this folder.
10
10
 
11
+ ## Going forward — use the CLI, not new one-offs
12
+
13
+ > **Canonical pattern (Phase 6.7+):** new council runs go through
14
+ > `./agent-config council:{estimate,run,render}`. The CLI handles
15
+ > bundling, redaction, the cost gate, the `0600` key contract, the
16
+ > `enabled` check, and session persistence — every concern these
17
+ > archived one-offs reimplemented inline.
18
+ >
19
+ > ```bash
20
+ > ./agent-config council:estimate <question.md>
21
+ > ./agent-config council:run <question.md> \
22
+ > --output agents/council-sessions/<UTC-ts>.json --confirm
23
+ > ./agent-config council:render agents/council-sessions/<UTC-ts>.json
24
+ > ```
25
+ >
26
+ > Wire-level access (`scripts.ai_council.orchestrator`,
27
+ > `scripts.ai_council.bundler`) is still public for tests and library
28
+ > use, but writing a new `_one_off_*.py` purely to fan out to the
29
+ > council members is **not** the path. The scripts below are kept as
30
+ > historical evidence of the runs that produced specific roadmap
31
+ > decisions; they are not a template for new work.
32
+
11
33
  ## Lifecycle rule (uniform — Phase 0.2 of context-layer-maturity)
12
34
 
13
35
  > A one-off is **archived**, never deleted. The session manifest under
@@ -1,14 +1,19 @@
1
- """One-off Phase-1 round-trip runner.
1
+ """One-off Phase-1 round-trip runner — HISTORICAL ARCHIVE.
2
2
 
3
- Used exactly once to generate the evidence artefact required to lift
4
- the capture-only fence on `road-to-ai-council.md` Phase 2+ and the
5
- end-to-end verification on `road-to-council-modes.md` Phase 2a.
3
+ Going forward, council runs go through the CLI:
6
4
 
7
- Not part of the public CLI surface — `/council` remains the supported
8
- entry point. This script is committed under `scripts/ai_council/` so
9
- the evidence is reproducible from the git history alone.
5
+ ./agent-config council:estimate <question.md>
6
+ ./agent-config council:run <question.md> \
7
+ --output agents/council-sessions/<UTC-ts>.json --confirm
8
+ ./agent-config council:render agents/council-sessions/<UTC-ts>.json
10
9
 
11
- Invocation:
10
+ This script predates `scripts/council_cli.py` (Phase 6.7) and is kept
11
+ only as the evidence artefact that lifted the capture-only fence on
12
+ `road-to-ai-council.md` Phase 2+ and the end-to-end verification on
13
+ `road-to-council-modes.md` Phase 2a. Do **not** copy it as a template
14
+ for new one-offs — write a question file and use the CLI instead.
15
+
16
+ Invocation (historical):
12
17
  .venv/bin/python -m scripts.ai_council._one_off_roundtrip
13
18
  """
14
19
  from __future__ import annotations