@event4u/agent-config 9.0.0 → 9.1.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 (66) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +67 -20
  3. package/MIGRATION.md +14 -0
  4. package/README.md +2 -2
  5. package/dist/agent-src/commands/explain-run.md +88 -0
  6. package/dist/agent-src/commands/pr/create/description-only.md +138 -8
  7. package/dist/agent-src/commands/pr/create.md +16 -5
  8. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +146 -0
  9. package/dist/agent-src/skills/llm-provider-knowledge/evals/triggers.json +20 -0
  10. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +11 -0
  11. package/dist/agent-src/skills/token-optimizer/SKILL.md +10 -4
  12. package/dist/agent-src/templates/agent-settings.md +28 -0
  13. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  14. package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +4 -1
  15. package/dist/discovery/deprecation-report.md +1 -1
  16. package/dist/discovery/discovery-manifest.json +68 -14
  17. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  18. package/dist/discovery/discovery-manifest.summary.md +3 -3
  19. package/dist/discovery/orphan-report.md +1 -1
  20. package/dist/discovery/packs.json +8 -6
  21. package/dist/discovery/trust-report.md +8 -8
  22. package/dist/discovery/workspaces.json +6 -4
  23. package/dist/install/install.mjs +38 -31
  24. package/dist/mcp/registry-manifest.json +3 -3
  25. package/dist/scripts/_lib/agent_settings.js +4 -1
  26. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  27. package/dist/server/schemas/settings.js +5 -0
  28. package/dist/server/schemas/settings.js.map +1 -1
  29. package/docs/CLAIMS.md +2 -2
  30. package/docs/MIGRATION.md +20 -0
  31. package/docs/architecture.md +3 -3
  32. package/docs/command-flows.md +1 -1
  33. package/docs/contracts/agents-layout.md +1 -1
  34. package/docs/contracts/consumer-bridge.md +55 -63
  35. package/docs/contracts/install-layout.md +1 -1
  36. package/docs/contracts/migrate-command.md +1 -1
  37. package/docs/customization.md +22 -1
  38. package/docs/decisions/ADR-020-global-only-consumer-scope.md +34 -0
  39. package/docs/featured-skills.md +2 -2
  40. package/docs/getting-started-by-role.md +1 -1
  41. package/docs/getting-started.md +1 -1
  42. package/docs/governance-advantage.md +1 -1
  43. package/docs/guidelines/agent-infra/api-cost-levers.md +126 -0
  44. package/docs/installation.md +2 -1
  45. package/docs/maintainers/dev-mode.md +3 -2
  46. package/docs/proof.md +5 -5
  47. package/package.json +1 -1
  48. package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +4 -1
  49. package/src/config/agent-settings.template.yml +39 -0
  50. package/src/config/gitignore-block.txt +16 -6
  51. package/src/scripts/_cli/cmd_conformance.ts +2 -2
  52. package/src/scripts/_cli/cmd_doctor.ts +162 -13
  53. package/src/scripts/_cli/cmd_refresh.ts +35 -118
  54. package/src/scripts/_lib/agent_settings.ts +4 -1
  55. package/src/scripts/ai_council/clients.ts +68 -6
  56. package/src/scripts/ai_council/pricing.ts +62 -0
  57. package/src/scripts/council_cli.ts +19 -3
  58. package/src/scripts/install.ts +44 -45
  59. package/src/scripts/lint_agents_layout.ts +10 -4
  60. package/src/scripts/lint_breaking_changes_index.ts +303 -0
  61. package/src/scripts/mcp_server/tools.ts +1 -3
  62. package/src/scripts/schemas/agent-settings.schema.json +17 -0
  63. package/src/scripts/self_review_gate.test.ts +11 -0
  64. package/src/scripts/self_review_gate.ts +7 -1
  65. package/src/scripts/skill_eval_coverage.ts +4 -1
  66. package/src/server/schemas/settings.ts +15 -0
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Bootstrap shim for the event4u agent-config suite. This plugin ships ONLY the dispatcher hooks plus one install-pointer skill — ALL content (skills, rules, commands) is installed via `npx -y @event4u/agent-config init`, which writes the file projection AND registers the same hooks in ~/.claude/settings.json. DEPRECATED as a content channel; kept so the marketplace listing stays discoverable and existing installs keep working hooks.",
9
- "version": "9.0.0",
9
+ "version": "9.1.0",
10
10
  "keywords": [
11
11
  "agent-config",
12
12
  "skills",
package/CHANGELOG.md CHANGED
@@ -48,26 +48,6 @@ foundation also land — both non-breaking by default.
48
48
 
49
49
  ### Breaking changes (6.0.0)
50
50
 
51
- **0. Consumer rule projection is scoped by default** (`road-to-request-scoped-rule-load` Phase 1 human gate, 2026-07-13)
52
-
53
- - **Who is affected:** fresh consumer installs — the settings template now
54
- ships `projection.rule_workspaces` filled with every consumer workspace, so
55
- the 16 exclusively-maintainer specification rules (plus the recorded
56
- `source-of-truth.md` compat exclusion) no longer arrive: 103 → 88 rules,
57
- −9,880 cl100k tokens (−13.1%) per install. All domain safety floors and
58
- domain rules keep shipping; kernel rules always ship.
59
- - **Existing installs:** unchanged until you run `agent-config sync` /
60
- re-install (settings sync preserves your current value; fill the list to
61
- opt in). The first session after opting in rebuilds the KV-cache prefix
62
- once (1.25–2× write cost, one session only).
63
- - **Quality evidence:** deterministic set-inclusion verification
64
- (`src/scripts/check_consumer_scope_flip.ts` →
65
- `internal/bench/reports/2026-07-13-consumer-scoped-default-flip.json`):
66
- only exclusively-maintainer rules drop; zero golden-set-exercised consumer
67
- rules affected (90/90 labelled tasks, coverage 86/86).
68
- - **Rollback:** set `projection.rule_workspaces: []` (= legacy-all).
69
-
70
-
71
51
  **1. Condensed output moved: root `.agent-src/` → `dist/agent-src/`** ([ADR-058])
72
52
 
73
53
  - **Who is affected:** consumers whose scripts or tool configs hard-code
@@ -1044,12 +1024,79 @@ our recommendation order, not its support status.
1044
1024
  > that forces a new era split (`# Era: 8.13.x`, etc.) — see
1045
1025
  > [`docs/contracts/CHANGELOG-conventions.md § Era splits`](docs/contracts/CHANGELOG-conventions.md).
1046
1026
 
1027
+ ## [9.1.0](https://github.com/event4u-app/agent-config/compare/9.0.0...9.1.0) (2026-07-14)
1028
+
1029
+ ### Features
1030
+
1031
+ * **create-pr:** tier-driven body, grounded API examples, capability-gated screenshots ([306f7d5](https://github.com/event4u-app/agent-config/commit/306f7d59e6e7dee4a22e9c34aad4fbc89a75e3e2))
1032
+ * **create-pr:** settings for description detail level, API examples, screenshots ([65275bb](https://github.com/event4u-app/agent-config/commit/65275bb1237fc4dfbbcefd86d27bc45ef4be257c))
1033
+ * **ai-council:** prompt caching + right-sized output on the paid Anthropic path ([3ec7ff0](https://github.com/event4u-app/agent-config/commit/3ec7ff09d49283b096901e5d4716cc529fef1609))
1034
+ * **skills:** add llm-provider-knowledge — verify LLM product facts against official docs ([ba34d94](https://github.com/event4u-app/agent-config/commit/ba34d94530d1b30066470a0316f247be84b5ac2d))
1035
+ * **commands:** register discoverable /explain-run command ([13955a1](https://github.com/event4u-app/agent-config/commit/13955a1e7ab40a658ed0879e21266fe49a54c6a0))
1036
+ * **doctor:** add rule-scope-drift check for the scoped-projection flip ([71353f8](https://github.com/event4u-app/agent-config/commit/71353f8c6bb66b404916f599c5e168bef1f85601))
1037
+
1038
+ ### Bug Fixes
1039
+
1040
+ * **ai-council:** make prompt caching explicit opt-in (default off) ([bad8070](https://github.com/event4u-app/agent-config/commit/bad80707eda42aacbd3698575e1d22383dbea8b3))
1041
+ * **refs:** treat external claude-api plugin as non-repo reference ([75a3431](https://github.com/event4u-app/agent-config/commit/75a34314ca802e8cda39df8ff6b375c52621ae63))
1042
+ * **commands:** reference agent-docs-writing skill in /explain-run ([c104279](https://github.com/event4u-app/agent-config/commit/c104279abaaad1035758cc86140be847ed4f4a06))
1043
+ * **ci:** honest gate status in skill-lint + self-review comments ([5098465](https://github.com/event4u-app/agent-config/commit/50984659e028c8c0029b1cd1deb8a69bf1c4e61b))
1044
+ * **install:** rebuild install bundle with real node_modules paths ([f875244](https://github.com/event4u-app/agent-config/commit/f8752443b1b27bd9471dbf056a65097d898e15de))
1045
+ * **install:** rebuild install bundle + reword source-repo comment ([48e9dc2](https://github.com/event4u-app/agent-config/commit/48e9dc2a6f694610322d533b0196346cf07a151d))
1046
+ * **tests:** make wrapper-delegation install test hermetic ([8ef5ea2](https://github.com/event4u-app/agent-config/commit/8ef5ea2bdc60f90fde7979bee2dca3d15a2e118e))
1047
+
1048
+ ### Documentation
1049
+
1050
+ * **create-pr:** document PR-description content settings ([812ae6b](https://github.com/event4u-app/agent-config/commit/812ae6ba84ba5508a71b3ab02c351cad4a3a2e55))
1051
+ * subagent prompt-cache break-even + record the follow-up council verdict ([fdba56d](https://github.com/event4u-app/agent-config/commit/fdba56dbe06818c4bc50c5b3e94322e10b34bd0d))
1052
+ * **roadmap:** API cost-optimization roadmap + dashboard ([3d1b313](https://github.com/event4u-app/agent-config/commit/3d1b3132b0d0d3a52c7eba555b1e3afd95d5750e))
1053
+ * **agent-infra:** API cost-levers guideline + token-optimizer index wiring ([a97d0e7](https://github.com/event4u-app/agent-config/commit/a97d0e7eaa4c61eb4db59f8bdf469d112595b1b5))
1054
+ * **roadmap:** archive completed road-to-llm-provider-knowledge-skill ([059aa10](https://github.com/event4u-app/agent-config/commit/059aa10b3405597986c12c0de3da6c767385bb97))
1055
+ * **roadmap:** add + archive feedback-9.0-followups roadmap ([c8aa510](https://github.com/event4u-app/agent-config/commit/c8aa5104ac774f77f1354ac9c6c3816096b769fe))
1056
+ * **changelog:** repair breaking-surface index + add sync lint ([e333d71](https://github.com/event4u-app/agent-config/commit/e333d7150254310fe569dcb6e0fad2c487568d32))
1057
+
1058
+ ### Refactoring
1059
+
1060
+ * **install:** retire the consumer bridge marker (ADR-020 amendment) ([2737b04](https://github.com/event4u-app/agent-config/commit/2737b04441b7e807240c979e874d8e2bb3967b9b))
1061
+
1062
+ ### Build
1063
+
1064
+ * **install:** rebuild bundle with repo-relative module paths ([f30adb5](https://github.com/event4u-app/agent-config/commit/f30adb5a109ac6aee9777bad722ef0146fc208fa))
1065
+ * **install:** rebuild install bundle after create_pr settings addition ([a760b9f](https://github.com/event4u-app/agent-config/commit/a760b9f39a41a9621b21ad2fb92851c4a1ea66b2))
1066
+
1067
+ ### Chores
1068
+
1069
+ * **roadmaps:** archive completed pr-description-tiers roadmap ([2c4615f](https://github.com/event4u-app/agent-config/commit/2c4615fe42129eb8bd33e87a368cbed8f5f1ded7))
1070
+ * sync generated guideline count (98 -> 99) for api-cost-levers ([17ce22b](https://github.com/event4u-app/agent-config/commit/17ce22bdfc2d99341d7a3edeaaf80554f4d75f33))
1071
+ * **evals:** ratchet behavioural-eval coverage floor to current ([84f42fa](https://github.com/event4u-app/agent-config/commit/84f42fab93d77ad8b0b28ce430b79ae222748719))
1072
+
1073
+ Tests: 7737 (+21 since 9.0.0)
1074
+
1047
1075
  ## [9.0.0](https://github.com/event4u-app/agent-config/compare/8.13.0...9.0.0) (2026-07-13)
1048
1076
 
1049
1077
  ### BREAKING CHANGES
1050
1078
 
1051
1079
  * **scoping:** flip consumer rule projection default to scoped (Phase-1 human gate, approved) ([565c91a](https://github.com/event4u-app/agent-config/commit/565c91aa25e4c970d5b37258f497366f33e7a7a9))
1052
1080
 
1081
+ **Consumer rule projection is scoped by default** (`road-to-request-scoped-rule-load` Phase 1 human gate, 2026-07-13)
1082
+
1083
+ - **Who is affected:** fresh consumer installs — the settings template now
1084
+ ships `projection.rule_workspaces` filled with every consumer workspace, so
1085
+ the 16 exclusively-maintainer specification rules (plus the recorded
1086
+ `source-of-truth.md` compat exclusion) no longer arrive: 103 → 88 rules,
1087
+ −9,880 cl100k tokens (−13.1%) per install. All domain safety floors and
1088
+ domain rules keep shipping; kernel rules always ship.
1089
+ - **Existing installs:** unchanged until you run `agent-config sync` /
1090
+ re-install (settings sync preserves your current value; fill the list to
1091
+ opt in). The first session after opting in rebuilds the KV-cache prefix
1092
+ once (1.25–2× write cost, one session only).
1093
+ - **Quality evidence:** deterministic set-inclusion verification
1094
+ (`src/scripts/check_consumer_scope_flip.ts` →
1095
+ `internal/bench/reports/2026-07-13-consumer-scoped-default-flip.json`):
1096
+ only exclusively-maintainer rules drop; zero golden-set-exercised consumer
1097
+ rules affected (90/90 labelled tasks, coverage 86/86).
1098
+ - **Rollback:** set `projection.rule_workspaces: []` (= legacy-all).
1099
+
1053
1100
  ### Features
1054
1101
 
1055
1102
  * **product:** pre-build demand gate folded into improve-before-implement — plate complete, archived ([d6b0fcb](https://github.com/event4u-app/agent-config/commit/d6b0fcb9d020f983a98f8cd0c744d758bb758f9a))
package/MIGRATION.md CHANGED
@@ -16,6 +16,20 @@ firing (now from `settings.json`), skills/commands stop listing twice, and
16
16
  `claude-plugin` no longer reporting a duplicate surface). Augment CLI and
17
17
  Copilot CLI plugins are unaffected.
18
18
 
19
+ # Migrating to 9.0
20
+
21
+ > Consumer rule projection is **scoped by default** in 9.0. Full
22
+ > breaking-change detail: [`CHANGELOG.md` § 9.0.0](CHANGELOG.md).
23
+
24
+ Fresh installs now ship `projection.rule_workspaces` pre-filled with every
25
+ consumer workspace, so the 16 exclusively-maintainer specification rules no
26
+ longer arrive: **103 → 88 rules** per install. All domain safety floors,
27
+ domain rules, and kernel rules keep shipping.
28
+
29
+ Existing installs are unchanged until you run `agent-config sync` /
30
+ re-install (settings sync preserves your current value). To stay on the
31
+ legacy every-rule behaviour, set `projection.rule_workspaces: []`.
32
+
19
33
  # Migrating to 6.0
20
34
 
21
35
  > Upgrading an existing install to the **6.0 experience-first** layout.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Smoke](https://github.com/event4u-app/agent-config/actions/workflows/smoke.yml/badge.svg)](https://github.com/event4u-app/agent-config/actions/workflows/smoke.yml) [![Public install smoke (3 OS × 2 Node)](https://github.com/event4u-app/agent-config/actions/workflows/smoke-public-install.yml/badge.svg)](https://github.com/event4u-app/agent-config/actions/workflows/smoke-public-install.yml) [![npm](https://img.shields.io/npm/v/@event4u/agent-config?style=flat-square&label=npm&color=orange)](https://www.npmjs.com/package/@event4u/agent-config) [![agent-config MCP server](https://glama.ai/mcp/servers/event4u-app/agent-config/badges/score.svg)](https://glama.ai/mcp/servers/event4u-app/agent-config)
6
6
 
7
- [![Skills](https://img.shields.io/badge/Skills-274-orange?style=flat-square)](dist/agent-src/skills/) [![Rules](https://img.shields.io/badge/Rules-104-orange?style=flat-square)](dist/agent-src/rules/) [![Commands](https://img.shields.io/badge/Commands-183-orange?style=flat-square)](dist/agent-src/commands/) [![Guidelines](https://img.shields.io/badge/Guidelines-98-orange?style=flat-square)](docs/guidelines/) [![Personas](https://img.shields.io/badge/Personas-29-orange?style=flat-square)](dist/agent-src/personas/) [![Advisors](https://img.shields.io/badge/Advisors-5-orange?style=flat-square)](dist/agent-src/personas/advisors/)
7
+ [![Skills](https://img.shields.io/badge/Skills-275-orange?style=flat-square)](dist/agent-src/skills/) [![Rules](https://img.shields.io/badge/Rules-104-orange?style=flat-square)](dist/agent-src/rules/) [![Commands](https://img.shields.io/badge/Commands-184-orange?style=flat-square)](dist/agent-src/commands/) [![Guidelines](https://img.shields.io/badge/Guidelines-99-orange?style=flat-square)](docs/guidelines/) [![Personas](https://img.shields.io/badge/Personas-29-orange?style=flat-square)](dist/agent-src/personas/) [![Advisors](https://img.shields.io/badge/Advisors-5-orange?style=flat-square)](dist/agent-src/personas/advisors/)
8
8
 
9
9
  > **Choose your experience — developer · founder · content · agency · finance · ops. Add packs. Get a focused command set, not a 500-artefact dump.** Bring your own AI provider.
10
10
 
@@ -178,7 +178,7 @@ npx -y @event4u/agent-config init
178
178
 
179
179
  **Verify hook coverage:** `npx @event4u/agent-config hooks:status` prints the per-platform matrix (`--strict` for CI, `--format json` for tooling).
180
180
 
181
- > **Scope (v2.5+):** `init` writes **global** only — `~/.event4u/agent-config/`, `~/.claude/`, `~/.cursor/`, …. The project tree gets `agents/overrides/` + `agents/.event4u-bridge.yml`. `--project` is maintainer-only behind `AGENT_CONFIG_DEV_MODE=1` ([ADR-020](docs/decisions/ADR-020-global-only-consumer-scope.md), [dev-mode](docs/maintainers/dev-mode.md)).
181
+ > **Scope (v2.5+):** `init` writes **global** only — `~/.event4u/agent-config/`, `~/.claude/`, `~/.cursor/`, …. The project tree gets `agents/overrides/` only (the bridge marker was retired — ADR-020 amendment 2026-07-13; the global root resolves from `~/.event4u/agent-config`). `--project` is maintainer-only behind `AGENT_CONFIG_DEV_MODE=1` ([ADR-020](docs/decisions/ADR-020-global-only-consumer-scope.md), [dev-mode](docs/maintainers/dev-mode.md)).
182
182
 
183
183
  Migrating from a v1.x install? `npx @event4u/agent-config migrate` — full notes in [`docs/migration/v1-to-v2.md`](docs/migration/v1-to-v2.md).
184
184
 
@@ -0,0 +1,88 @@
1
+ ---
2
+ model_tier: inherit
3
+ name: explain-run
4
+ pack: meta
5
+ tier: 2
6
+ visibility: internal
7
+ description: "Read-only 'why did that happen' run report — resolved rule set, rules fired, artefact engagement, subagent dispatches, hook/loop/freshness state — even when the user just says 'explain the last run'."
8
+ argument-hint: "[--task <id>] [--since <ref>]"
9
+ skills: [agent-docs-writing]
10
+ suggestion:
11
+ eligible: false
12
+ rationale: "Package-internal maintainer diagnostic — only the event4u/agent-config repo runs this."
13
+ workspaces:
14
+ - agent-config-maintainer
15
+ packs:
16
+ - meta
17
+ ---
18
+
19
+ # explain-run
20
+
21
+ Thin runner for the read-only explainability engine `explain_run`
22
+ (`src/scripts/explain_run.ts`). Renders one Markdown
23
+ report answering **"why did the agent do that this run?"** entirely from
24
+ artefacts other parts of the suite already write — no new state, no capture,
25
+ no daemon.
26
+
27
+ The report covers: the resolved rule set (kernel vs trigger-routed, from
28
+ `dist/router.json`), rules the audit log actually observed firing, artefact
29
+ engagement (consulted vs applied), subagent dispatches (mode / tiers / token
30
+ deltas), a hook / loop / freshness state snapshot, and a parked list of
31
+ "why" questions this v0 cannot answer yet (surfaced, never silently omitted).
32
+
33
+ ## Instructions
34
+
35
+ ### 1. Resolve the window
36
+
37
+ Both arguments are optional and narrow the report:
38
+
39
+ - `--task <id>` — restrict to one task id seen in the audit log.
40
+ - `--since <ref>` — an ISO-8601 timestamp / date cutoff (e.g. `2026-07-01`).
41
+
42
+ With neither, the engine reports over all available artefacts. Pass through
43
+ exactly what the user gave — do not invent a task id or a date.
44
+
45
+ ### 2. Run the engine
46
+
47
+ ```bash
48
+ ./scripts-run src/scripts/explain_run [--task <id>] [--since <ISO-8601>]
49
+ ```
50
+
51
+ Exit codes:
52
+
53
+ - `0` → report rendered to stdout; continue to step 3.
54
+ - `2` → bad argument (unknown flag or unparsable `--since`); surface stderr
55
+ and stop.
56
+
57
+ The engine prints an honest `no data — <source> absent or empty` for any
58
+ section whose source file is missing — that is expected output, not an error.
59
+
60
+ ### 3. Surface the report
61
+
62
+ Show the engine's Markdown output. Do not re-summarize or re-order it — the
63
+ report already opens with a plain-language `## Summary`. If the user wants the
64
+ report written to a file, add `--output <path>` and confirm the write.
65
+
66
+ ## Rules
67
+
68
+ - **Read-only** — this command only reads on-disk artefacts. It never edits,
69
+ captures, or writes state (aside from an explicit `--output` file).
70
+ - **Do NOT commit or push** — the working tree is left to the user.
71
+ - **Never edit generated trees** — per [`source-of-truth`](../rules/source-of-truth.md),
72
+ the engine lives in `src/scripts/`; never hand-edit `dist/agent-src/` or any
73
+ tool projection.
74
+ - **Honest nulls, not invented rows** — the engine's `no data` lines are
75
+ correct output; do not fabricate rule firings or dispatches to fill them.
76
+
77
+ ## When NOT to use
78
+
79
+ - To *change* behaviour — this only explains it. Rule / routing edits go
80
+ through the normal source-of-truth flow.
81
+ - Kill criterion: the engine self-documents a delete-if-unused-after-3-releases
82
+ criterion; if this command sees zero use, retire it with the engine.
83
+
84
+ ## See also
85
+
86
+ - `explain_run` (`src/scripts/explain_run.ts`) — the read-only engine this wraps.
87
+ - `/agent-status` — live session snapshot (this is the retrospective, artefact-sourced view).
88
+ - [`source-of-truth`](../rules/source-of-truth.md) — edit `src/`, never generated trees.
@@ -95,34 +95,164 @@ That's 6 round-trips for what should be 2.
95
95
 
96
96
  ### 4. Build the PR body
97
97
 
98
+ #### 4.0 Resolve the detail level
99
+
100
+ Read `commands.create_pr.detail_level` from `.agent-settings.yml` (default
101
+ `min` when unset). This tier governs **only the explanatory depth of the
102
+ Description section** — never which template sections exist, and never
103
+ whether a critical callout appears (see 4.1 critical-info-always).
104
+
105
+ | Tier | Description section content |
106
+ |---|---|
107
+ | `min` (default) | Title-level summary in 2-3 sentences: *what* changed, *why*, and the user/system impact. No per-file walk, no restating commit subjects, no "how to test". |
108
+ | `med` | `min` + grouped logical changes as 3-5 bullets (by concern, not by file) + a one-line tests note (added / none / coverage). |
109
+ | `max` | `med` + how-to-test steps + edge cases / trade-offs + one "reviewer guidance" line (what to focus on). ≈ the legacy output. |
110
+
111
+ `min` is the default because this is a token-cost optimization: a shorter
112
+ description costs fewer output tokens on every PR. Keep `min` genuinely
113
+ minimal — but never at the expense of the critical-info block below.
114
+
115
+ #### 4.1 Critical-info-always — tier-independent MUST
116
+
117
+ ```
118
+ CRITICAL INFORMATION APPEARS AT EVERY TIER, INCLUDING min.
119
+ THE TIER GOVERNS EXPLANATORY DEPTH, NEVER WHETHER A CRITICAL CALLOUT APPEARS.
120
+ DROPPING A BREAKING-CHANGE / MIGRATION / SECURITY / ROLLBACK CALLOUT AT min
121
+ IS A P0 DEFECT, NOT A TOKEN SAVING.
122
+ ```
123
+
124
+ If the diff shows any of the following, a one-line callout for it is included
125
+ in the Description **regardless of `detail_level`** (grounded in the diff, not
126
+ guessed):
127
+
128
+ - **Breaking change** — API contract change (new/removed/renamed field, changed
129
+ endpoint or response shape), CLI-arg change, changed env var, or a renamed
130
+ route the frontend depends on. Prefix `⚠️ Breaking:`.
131
+ - **Migration required** — DB migration, config migration, or a deployment step.
132
+ Prefix `Migration:`.
133
+ - **Security implication** — new permission/scope, auth change, or data-exposure
134
+ surface. Prefix `🔒 Security:`.
135
+ - **Non-trivial rollback** — when reverting is not a plain `git revert`. Prefix
136
+ `Rollback:`.
137
+
138
+ None present → omit the block entirely (do not emit empty "No breaking
139
+ changes" filler at `min`).
140
+
141
+ #### 4.2 Fill the template sections
142
+
98
143
  **ALWAYS** use the PR template (`.github/pull_request_template.md`). Fill in its sections:
99
144
 
100
145
  - **Jira badge**: Replace `{TICKET-NUMBER}` with the actual ticket ID.
101
- - **Description**: Summarize the changes in 2-5 sentences. Explain *what* changed and *why*.
102
- Use the Jira ticket description and commit messages as input.
146
+ - **Description**: Write it to the resolved tier (4.0) with the critical-info
147
+ block (4.1) always present. Use the Jira ticket description + commit messages
148
+ as input.
103
149
  - **Type of change**: Check the appropriate checkbox(es) based on the changes.
104
150
  - **Checklist**: Leave as-is (the developer fills this in).
105
151
  - **Links**: Replace `{TICKET-NUMBER}` with the actual ticket ID.
106
- - **Screenshots**: Leave as `...` unless the user provides screenshots.
152
+ - **Screenshots**: Handled by Step 4.4 (default: leave the placeholder / `...`).
107
153
 
108
- If no PR template exists, use this structure:
154
+ If no PR template exists, use this structure — including only the sections the
155
+ tier calls for (at `min`, the `## Changes` bullets collapse to the 2-3 sentence
156
+ summary and `## How to test` is omitted):
109
157
 
110
158
  ```markdown
111
159
  ## Jira
112
160
  [{TICKET-ID}]({JIRA_BASE_URL}/browse/{TICKET-ID})
113
161
 
114
- ## Changes
115
- - Bullet list of what was changed and why
162
+ ## Description
163
+ - 2-3 sentence what/why/impact (min) — grouped bullets (med/max)
164
+ - Critical-info callouts (any tier, only if present)
116
165
 
117
166
  ### Migrations
118
167
  - List new/changed migrations (if any)
119
168
 
120
169
  ### Tests
121
- - List new/changed tests (if any)
170
+ - List new/changed tests (med/max)
122
171
 
123
172
  ## How to test
124
- - Steps to verify the changes
173
+ - Steps to verify the changes (max)
174
+ ```
175
+
176
+ #### 4.3 API response examples (evidence-grounded)
177
+
178
+ Read `commands.create_pr.api_examples` (default `true`). When `true` **and**
179
+ the diff touches an API endpoint, add a fenced request/response example under
180
+ the Description.
181
+
182
+ **Detect an API-endpoint change** (fail-open — no false enrichment when
183
+ ambiguous): a changed file matches `commands.create_pr.api_paths` (if set), or
184
+ the light heuristic — a route file (`routes/`, `**/api/**`, `*Controller*`,
185
+ resource/serializer classes) whose diff adds or changes an endpoint or its
186
+ request/response shape. No confident match → skip silently.
187
+
188
+ **Ground the example in a real source — never invent one:**
189
+
190
+ ```
191
+ NEVER FABRICATE A JSON EXAMPLE. AN INVENTED CONTRACT MISLEADS REVIEWERS
192
+ AND IS WORSE THAN NONE. EMIT A JSON BLOCK ONLY FROM A REAL SOURCE.
193
+ ```
194
+
195
+ Grounding sources, in priority order: the response DTO / API-resource /
196
+ serializer class in the diff · an OpenAPI/JSON-schema in the repo · a test
197
+ fixture or assertion exercising the endpoint · the actual output of a probe you
198
+ ran this session (`curl` / test client). If **none** exists, emit a one-line
199
+ pointer instead — `API contract changed — see \`<file>\`` — never a guessed
200
+ example. This is [`senior-engineering-discipline`](../rules/senior-engineering-discipline.md)
201
+ (never invent an API) applied to the description surface.
202
+
203
+ Format when grounded:
204
+
205
+ ~~~markdown
206
+ ### API example (`POST /api/...`)
207
+ Request:
208
+ ```json
209
+ { ...grounded... }
210
+ ```
211
+ Response `201`:
212
+ ```json
213
+ { ...grounded... }
125
214
  ```
215
+ ~~~
216
+
217
+ `api_examples: false` → skip this step entirely.
218
+
219
+ #### 4.4 Screenshots for frontend changes (capability-gated)
220
+
221
+ Read `commands.create_pr.screenshots` (default `false`). `false` → skip this
222
+ step entirely; leave the template Screenshots placeholder as-is.
223
+
224
+ When `true`, this is a **capability-gated contract, never a runtime
225
+ orchestrator** — the package ships instructions, the host provides the tools:
226
+
227
+ 1. **Frontend-change gate.** Only proceed if the diff touches a frontend
228
+ surface — a changed file matches `commands.create_pr.ui_paths` (if set), or
229
+ the light heuristic (`.vue` / `.tsx` / `.jsx` / `.blade.php` / `.svelte`,
230
+ component/view/page/template dirs, CSS/Tailwind). No match → skip silently.
231
+ 2. **Capability gate — explicit, never silent.** Screenshots need host
232
+ browser/preview tooling (a Playwright/browser MCP **and** a reachable dev-server
233
+ or preview URL). There is no capability flag to read, so probe cheaply. If the
234
+ tooling or a running preview is **absent**:
235
+ - Leave the template Screenshots placeholder untouched, **and**
236
+ - Emit ONE line in the chat reply: `Screenshots requested (screenshots: true)
237
+ but no browser/preview tooling was reachable — skipped.`
238
+ - **Never** fail, block, or delay PR creation over this.
239
+ 3. **Capture (when capable).** Capture the current (head) state of each changed
240
+ surface. Before/after (base vs head) with changed-region highlighting is
241
+ **best-effort only** — a base checkout mid-PR is fragile and expensive;
242
+ attempt it only if cheap and safe, otherwise after-only. One screenshot per
243
+ changed surface, each with a one-line caption.
244
+ 4. **Embedding — honest limits.** The `github-api pulls` write path cannot
245
+ upload image bytes and GitHub markdown does not render `data:` URIs, so an
246
+ agent cannot inline captured bytes into the body via the API. Use, in order:
247
+ (a) a host image-upload capability if one exists (embed the returned URL);
248
+ (b) otherwise save the screenshots to a local path, reference them in the
249
+ Screenshots section, and tell the user to drag them into the PR in the
250
+ GitHub UI. **Never claim an embed that did not happen**
251
+ ([`direct-answers`](../rules/direct-answers.md) Iron Law 2).
252
+
253
+ Limitations (state them so expectations are set): default off; depends on host
254
+ browser tooling + a running preview; before/after + highlighting is best-effort;
255
+ byte-embedding into the PR body is not possible via the API.
126
256
 
127
257
  ### 5. Present as copyable block
128
258
 
@@ -140,6 +140,12 @@ completion is read from the checkbox counts.
140
140
  Run `/create-pr:description-only` Steps 1–4 to generate the PR title and body.
141
141
  This handles: Jira ticket extraction, diff analysis, commit messages, **PR template filling**.
142
142
 
143
+ The generation honors the cached content flags from step 1 (§4e):
144
+ `detail_level` sets the Description tier (default `min`), `api_examples`
145
+ adds a grounded JSON block for API-endpoint changes, and `screenshots`
146
+ (capability-gated) adds frontend screenshots. Critical-info callouts
147
+ (breaking changes / migrations / security / rollback) appear at every tier.
148
+
143
149
  **CRITICAL**: The PR body MUST use the project's PR template (`.github/pull_request_template.md`).
144
150
  Read the template file and fill in its sections. If the template does not exist, use the
145
151
  fallback structure defined in `/create-pr:description-only`. NEVER invent a custom body structure.
@@ -316,11 +322,16 @@ an actual Jira API call succeeded** — never announce "skipped".
316
322
 
317
323
  #### 4e. Settings short-circuit — single read per run
318
324
 
319
- `verbosity.routine_confirmations`, `verbosity.post_action_reports`, and
320
- `commands.create_pr.preview_description` are read **once** at the top
321
- of the run and cached for the whole `/create-pr` invocation. Do **not**
322
- re-read `.agent-settings.yml` in 4b / 4d — both branches resolve from
323
- the cached values from step 1.
325
+ `verbosity.routine_confirmations`, `verbosity.post_action_reports`,
326
+ `commands.create_pr.preview_description`, `commands.create_pr.detail_level`,
327
+ `commands.create_pr.api_examples`, `commands.create_pr.screenshots`,
328
+ `commands.create_pr.ui_paths`, and `commands.create_pr.api_paths` are read
329
+ **once** at the top of the run and cached for the whole `/create-pr`
330
+ invocation. Do **not** re-read `.agent-settings.yml` in Step 2 or 4b / 4d —
331
+ every branch resolves from the cached values from step 1. The content flags
332
+ (`detail_level`, `api_examples`, `screenshots`, `ui_paths`, `api_paths`) are
333
+ consumed by the `/create-pr:description-only` generation step (Step 2); the
334
+ confirmation/report flags by steps 3–4.
324
335
 
325
336
  When all three resolve to their silent defaults (`false` / `minimal` /
326
337
  `false`), steps 4b + 4d collapse to the single `→ #N opened: <url>` line
@@ -0,0 +1,146 @@
1
+ ---
2
+ model_tier: inherit
3
+ name: llm-provider-knowledge
4
+ description: "Before stating any specific fact about an LLM provider's product — models, pricing, limits, context windows, SDK/API — for OpenAI, Gemini, Claude & others, verify against official docs, not memory."
5
+ source: package
6
+ domain: process
7
+ personas: []
8
+ workspaces:
9
+ - agent-config-maintainer
10
+ - engineering
11
+ - product
12
+ - founder
13
+ - small-business
14
+ - gtm
15
+ - ops
16
+ packs:
17
+ - meta
18
+ trust:
19
+ level: experimental
20
+ install:
21
+ removable: true
22
+ execution:
23
+ type: manual
24
+ ---
25
+
26
+ # llm-provider-knowledge
27
+
28
+ Verify LLM-provider product facts against **official documentation**, never
29
+ memory. This skill is the multi-provider sibling of Claude Code's bundled
30
+ `product-self-knowledge` — extended to OpenAI, Google Gemini, Anthropic,
31
+ Mistral, xAI, DeepSeek, Cohere, and Meta Llama, and portable to every host this
32
+ package projects to (not just Claude Code).
33
+
34
+ **This skill is a signpost, not a library.** It routes you to the authoritative
35
+ source and forces a source-cited answer. It does **not** cache model IDs,
36
+ context windows, prices, or rate limits — those churn constantly, and a cached
37
+ copy is exactly the stale "from memory" answer this skill exists to prevent.
38
+
39
+ ## When to use
40
+
41
+ - Your reply would state a specific fact about a provider's product: a model ID
42
+ or its context window, token pricing, a rate/quota limit, an SDK/API detail
43
+ (endpoint, parameter, auth, batch, streaming, function-calling shape), or a
44
+ consumer-app plan limit (ChatGPT/Gemini/Claude app tiers).
45
+ - Coding against a provider SDK where a wrong model name, parameter, or limit
46
+ would break at runtime.
47
+ - Content or comparisons that assert provider capabilities or pricing.
48
+ - Any time you would otherwise answer such a fact from training data — it may be
49
+ outdated or wrong.
50
+
51
+ ## When NOT to fire
52
+
53
+ - Ordinary SDK code that asserts **no** product fact (wiring a call whose model
54
+ and params the user already gave).
55
+ - The user already supplied the verified fact — use it; don't re-litigate.
56
+ - Writing provider-specific prompt grammar → `prompt-engineering-patterns`.
57
+ - Choosing which model to use for the host → `model-recommendation` (never
58
+ recommend another vendor's model over the host's; this skill only reports
59
+ facts, it does not steer model choice).
60
+ - Image-provider selection → `image-provider-routing`.
61
+
62
+ ## Core principles
63
+
64
+ 1. **Accuracy over guessing** — if unsure, route to the docs; never assert.
65
+ 2. **Distinguish products** — a provider's API, its developer platform, and its
66
+ consumer app are separate surfaces with separate facts and separate docs.
67
+ 3. **Source everything** — every product fact in the reply carries an official
68
+ URL. No URL → not verified → don't state it as fact.
69
+ 4. **Route, don't cache** — hand off to the live docs; do not transcribe
70
+ volatile specs into the reply as if durable.
71
+
72
+ ## Provider routing table
73
+
74
+ Route to the **stable root** and read live from there — do not deep-link to
75
+ pages that churn. Prefer a provider's machine-readable index where one exists.
76
+
77
+ | Provider | Docs root | API reference | Product / support |
78
+ |---|---|---|---|
79
+ | **OpenAI** (GPT) | `platform.openai.com/docs` | `platform.openai.com/docs/api-reference` | `help.openai.com` |
80
+ | **Google Gemini** | `ai.google.dev/gemini-api/docs` | `ai.google.dev/api` | `support.google.com` (Gemini app) |
81
+ | **Anthropic** (Claude) | `docs.claude.com/en/docs` (index: `/en/docs_site_map.md`) | `docs.claude.com/en/api/overview` | `support.claude.com` |
82
+ | **Mistral** | `docs.mistral.ai` | `docs.mistral.ai/api` | `help.mistral.ai` |
83
+ | **xAI** (Grok) | `docs.x.ai` | `docs.x.ai/developers` | `x.ai` |
84
+ | **DeepSeek** | `api-docs.deepseek.com` | `api-docs.deepseek.com/api` | `platform.deepseek.com` |
85
+ | **Cohere** | `docs.cohere.com` (index: `docs.cohere.com/llms.txt`) | `docs.cohere.com/reference` | `dashboard.cohere.com` |
86
+ | **Meta Llama** | `llama.com` (dev docs: `ai.developer.meta.com/docs`) | `ai.developer.meta.com/docs` | `llama.com` |
87
+
88
+ **Claude Code specifics** (install, Node.js requirement, MCP, config):
89
+ `docs.anthropic.com/en/docs/claude-code/claude_code_docs_map.md`.
90
+
91
+ **Hosted access** (not a distinct vendor): Azure OpenAI, AWS Bedrock, and
92
+ Google Vertex AI resell the underlying vendor's models. Route to BOTH the
93
+ underlying vendor's row above AND the cloud's own docs (`learn.microsoft.com`,
94
+ `docs.aws.amazon.com/bedrock`, `cloud.google.com/vertex-ai`) — model IDs,
95
+ quotas, and regions differ from the vendor's direct API.
96
+
97
+ ## Procedure
98
+
99
+ 1. **Identify the provider and the surface** — API / developer platform /
100
+ consumer app. A ChatGPT-Plus limit is not an OpenAI-API rate limit.
101
+ 2. **Pick the row + column** from the table; go to the stable root.
102
+ 3. **Read the live docs** for the exact fact (navigate from the root; follow
103
+ the provider's own index / `llms.txt` where present).
104
+ 4. **State the fact with its source URL.** If the docs can't be reached or are
105
+ ambiguous, say so and point the user at the root rather than guessing.
106
+ 5. **Never transcribe a volatile spec as durable** — frame it as "per <URL> as
107
+ of now"; the source is authoritative, the reply is a pointer.
108
+
109
+ ## Output format
110
+
111
+ Every reply that states a provider product fact MUST include:
112
+
113
+ 1. **The fact, scoped to the product surface** — name the provider AND which
114
+ surface (API / platform / consumer app) it applies to.
115
+ 2. **The official source URL** — the specific docs page the fact came from (or
116
+ the stable root when you're directing the user to read it themselves).
117
+ 3. **A freshness caveat when the fact is volatile** (pricing, limits, model
118
+ availability): "verify at <URL> — these change without notice."
119
+
120
+ ## Do NOT
121
+
122
+ - **Do NOT** state a model ID, context window, price, or rate limit from
123
+ memory — route to the docs and cite the URL, or say you're unsure.
124
+ - **Do NOT** transcribe a volatile spec (pricing, limits, model availability)
125
+ into the reply as if durable — frame it as "per <URL> as of now".
126
+ - **Do NOT** conflate a provider's API with its consumer app — they carry
127
+ different limits and different docs.
128
+ - **Do NOT** steer the user to another vendor's model over the host's — that is
129
+ `model-recommendation`; this skill reports facts neutrally.
130
+ - **Do NOT** cache a provider's docs into this skill. When a root URL moves,
131
+ fix the one table row; a mismatch a user reports is a signal to correct the
132
+ row, never to start transcribing pages here.
133
+
134
+ ## Gotcha
135
+
136
+ - **Provider docs URLs churn** (Meta's Llama dev-docs host redirected during
137
+ this skill's authoring). That is *why* the skill links to stable roots and
138
+ reads live — a deep-linked page memorised here would rot. If a root itself
139
+ moves, fix the one table row; never start caching pages to compensate.
140
+ - **Do not conflate surfaces.** "Gemini" the app and the Gemini API have
141
+ different limits and different docs; the same for ChatGPT vs the OpenAI API
142
+ and Claude.ai vs the Claude API.
143
+ - **Redundant with the harness on Claude Code.** Claude Code's own
144
+ `product-self-knowledge` also fires for Anthropic facts — both route to the
145
+ same Anthropic docs, so the overlap is harmless. On every other host this is
146
+ the only such skill.
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "llm-provider-knowledge",
3
+ "last_eval": "2026-07-14",
4
+ "description": "7 should-trigger + 6 should-not-trigger. Should-trigger covers specific product-fact claims (context window, pricing, rate limit, API detail, model spec, consumer-app plan limit) across OpenAI, Google, Anthropic, Mistral, DeepSeek, Cohere. Should-not-trigger covers near-misses: SDK wiring with a user-supplied model, prompt authoring (prompt-engineering-patterns), model choice for the host (model-recommendation), image-provider selection (image-provider-routing), a user-supplied fact, and a plain SDK refactor.",
5
+ "queries": [
6
+ {"q": "what's the context window of GPT-5?", "trigger": true},
7
+ {"q": "how much does Gemini 2.5 Pro cost per million input tokens?", "trigger": true},
8
+ {"q": "what are the rate limits on the Anthropic API for tier 1?", "trigger": true},
9
+ {"q": "does the Mistral API support function calling, and what parameter enables it?", "trigger": true},
10
+ {"q": "what's the max output length for DeepSeek's chat model?", "trigger": true},
11
+ {"q": "how many messages does ChatGPT Plus allow in the app per window?", "trigger": true},
12
+ {"q": "what embedding dimension does Cohere's embed model return?", "trigger": true},
13
+ {"q": "wire up an openai chat completions call using the model id I already gave you", "trigger": false, "note": "SDK wiring; user supplied the model — no unverified product fact asserted"},
14
+ {"q": "write a good prompt to make Gemini summarize this document", "trigger": false, "note": "prompt authoring → prompt-engineering-patterns"},
15
+ {"q": "which model should I use for this task on my current host?", "trigger": false, "note": "model choice → model-recommendation (never steer to another vendor)"},
16
+ {"q": "route this logo-with-text image to the right generation provider", "trigger": false, "note": "image-provider selection → image-provider-routing"},
17
+ {"q": "I already know Claude Sonnet has a 200k context window — just use that number", "trigger": false, "note": "user supplied the verified fact; use it, do not re-litigate"},
18
+ {"q": "refactor this function that calls the Anthropic SDK to add retries", "trigger": false, "note": "plain code refactor; asserts no product fact"}
19
+ ]
20
+ }
@@ -33,6 +33,17 @@ hits (Anthropic `cache_control: ephemeral`) across the cohort — the prefix is
33
33
  cached after the first sibling and served from cache for the rest, cutting
34
34
  input-token cost proportionally to cohort size.
35
35
 
36
+ **Break-even + failure modes.** A cache write costs ~1.25× the base input rate
37
+ (5-min TTL); a read costs ~0.1×. So the prefix pays off once **≥ 2** siblings
38
+ read it — a lone subagent with no sibling reuse only pays the write premium and
39
+ saves nothing. The cache is a **byte-exact prefix match**: any drift in the
40
+ shared prefix (a timestamp, a per-sibling id, reordered text) forces a re-write
41
+ instead of a read, and the prefix must be re-hit within the **5-minute TTL**, so
42
+ dispatch siblings promptly rather than trickling them. This is why the win is
43
+ real for **fan-out** (many siblings, one prefix) and marginal for one-shot
44
+ dispatch. Verify a cohort is actually reading, not re-writing, by checking
45
+ `usage.cache_read_input_tokens > 0` on the 2nd+ sibling.
46
+
36
47
  ## Loading
37
48
 
38
49
  `tests/test_subagent_prompt_loading.py` asserts that every mode named