@event4u/agent-config 9.13.0 → 9.14.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 (33) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/optimize/deep.md +147 -0
  5. package/dist/agent-src/commands/optimize.md +12 -6
  6. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  7. package/dist/cli-delegate/{chunk-QFKQLQ7X.js → chunk-GCVFLBP2.js} +399 -365
  8. package/dist/cli-delegate/cmd_export.js +1 -1
  9. package/dist/cli-delegate/cmd_prune.js +1 -1
  10. package/dist/cli-delegate/cmd_settings_migrate.js +1 -1
  11. package/dist/cli-delegate/cmd_sync.js +1 -1
  12. package/dist/cli-delegate/cmd_uninstall.js +1 -1
  13. package/dist/cli-delegate/cmd_validate.js +1 -1
  14. package/dist/discovery/deprecation-report.md +1 -1
  15. package/dist/discovery/discovery-manifest.json +39 -11
  16. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  17. package/dist/discovery/discovery-manifest.summary.md +3 -3
  18. package/dist/discovery/orphan-report.md +1 -1
  19. package/dist/discovery/packs.json +6 -5
  20. package/dist/discovery/trust-report.md +3 -3
  21. package/dist/discovery/workspaces.json +5 -4
  22. package/dist/install/install.mjs +648 -614
  23. package/dist/mcp/registry-manifest.json +2 -2
  24. package/dist/mcp/server.json +2 -2
  25. package/dist/mcp/server.mjs +46 -13
  26. package/package.json +1 -1
  27. package/src/scripts/_lib/exec_evidence.ts +5 -0
  28. package/src/scripts/_lib/scoped_projection.ts +212 -0
  29. package/src/scripts/check_artefact_count_messaging.ts +128 -15
  30. package/src/scripts/count_scoped_projection.ts +104 -0
  31. package/src/scripts/install.ts +13 -90
  32. package/src/scripts/skill_linter.ts +81 -14
  33. package/src/scripts/update_counts.ts +90 -11
@@ -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.13.0",
9
+ "version": "9.14.0",
10
10
  "keywords": [
11
11
  "agent-config",
12
12
  "skills",
package/CHANGELOG.md CHANGED
@@ -253,6 +253,54 @@ Entry-shape contract: [`docs/contracts/CHANGELOG-conventions.md`](docs/contracts
253
253
  > that forces a new era split (`# Era: 9.14.x`, etc.) — see
254
254
  > [`docs/contracts/CHANGELOG-conventions.md § Era splits`](docs/contracts/CHANGELOG-conventions.md).
255
255
 
256
+ ## [9.14.0](https://github.com/event4u-app/agent-config/compare/9.13.0...9.14.0) (2026-08-02)
257
+
258
+ ### Release highlights
259
+
260
+ <!-- Curated head: fill before merge, keep it under 10 lines, and leave `_none_` where it is genuinely the answer. The generated log below is unchanged. -->
261
+ - **Behaviour changes:** _none_
262
+ - **Default changes + migration:** _none_
263
+ - **Security and correctness:** _none_
264
+ - **Honest nulls:** _none_
265
+ - **Known limitations:** _none_
266
+
267
+ ### Features
268
+
269
+ * **gates:** fail on any count position the generator cannot rewrite ([71c8761](https://github.com/event4u-app/agent-config/commit/71c8761e1a7ba5a7d89e234c30b22daa41f2ee3f))
270
+ * **counts:** generate the scoped-projection and active-command figures ([0a69bad](https://github.com/event4u-app/agent-config/commit/0a69bad08a166295fbe0cf5be018742600f02450))
271
+ * **commands:** /optimize:deep — autonomous deep-refactoring loop ([a34efa9](https://github.com/event4u-app/agent-config/commit/a34efa9a78ecd45fbf1a3549c58bdd4b685b9ad8))
272
+ * **roadmaps:** package-renewal central roadmap + three sub-roadmaps ([1802712](https://github.com/event4u-app/agent-config/commit/1802712bc0e9dc161830ee8f714c9a81e1feab33))
273
+
274
+ ### Bug Fixes
275
+
276
+ * **ci:** discriminate dead scope from verified-empty release in corpus gates ([caa35e7](https://github.com/event4u-app/agent-config/commit/caa35e7b6f46900c987c3d12010f5db73fbec843))
277
+ * **ci:** probe only the canonical projection root in the liveness check ([11cbaa7](https://github.com/event4u-app/agent-config/commit/11cbaa7cda5b104f1b0aa5b6d4beb174659586bf))
278
+ * **commands:** shorten optimize-deep description below the 200-char cap ([2501034](https://github.com/event4u-app/agent-config/commit/250103476f6b362946475240f1087179fa38a236))
279
+
280
+ ### Documentation
281
+
282
+ * **roadmap:** close and archive road-to-reproducible-artefact-counts ([2599fc4](https://github.com/event4u-app/agent-config/commit/2599fc470e8390bc7f03dbc3787f74933e5cd5a7))
283
+ * **claims:** bind the default-install claim to the emitter, date the snapshot ([222c83c](https://github.com/event4u-app/agent-config/commit/222c83c0fb64105ff4819add5220c27182020cb6))
284
+ * **roadmaps:** close the refinement-loop step — set converged at N=3 ([9b50deb](https://github.com/event4u-app/agent-config/commit/9b50deb8a2f6cf7e048fc605170b04f05c170e2b))
285
+
286
+ ### Refactoring
287
+
288
+ * **install:** extract the scoped-projection predicate into _lib ([59be75f](https://github.com/event4u-app/agent-config/commit/59be75f3d7d9105a29e110424acce4bfeae1950e))
289
+ * **roadmaps:** apply maintainer-review fixes (win path, ci baseline, loop verification gate) ([62a0c72](https://github.com/event4u-app/agent-config/commit/62a0c72e7e7850197df1f0b4c2ed7ac9f331d93c))
290
+ * **roadmaps:** apply loop-3 convergence deltas ([d2dfd7d](https://github.com/event4u-app/agent-config/commit/d2dfd7df824d1a0f1b31ed975673bbe8c71e5119))
291
+ * **roadmaps:** apply loop-2 review deltas ([19f5bc2](https://github.com/event4u-app/agent-config/commit/19f5bc279dea4407d844199550a04cf46954709f))
292
+ * **roadmaps:** apply loop-1 adversarial-review deltas ([ba8e641](https://github.com/event4u-app/agent-config/commit/ba8e6414cf10eeab218e9aecf18d571946a6501f))
293
+
294
+ ### Tests
295
+
296
+ * **counts:** witness that the two gates now move together ([14ac65b](https://github.com/event4u-app/agent-config/commit/14ac65b73355363204784585d76640a23b98e3c9))
297
+
298
+ ### Build
299
+
300
+ * **install:** rebuild the install bundle for the extracted predicate ([00cc359](https://github.com/event4u-app/agent-config/commit/00cc359ce6a0582857b62f662b19e4cfd809b0b9))
301
+
302
+ Tests: 10056 (+14 since 9.13.0)
303
+
256
304
  ## [9.13.0](https://github.com/event4u-app/agent-config/compare/9.12.0...9.13.0) (2026-08-02)
257
305
 
258
306
  ### Release highlights
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) [![MCP Toplist](https://mcptoplist.com/badge/glama%2Fevent4u-app%2Fagent-config.svg)](https://mcptoplist.com/server/glama%2Fevent4u-app%2Fagent-config)
6
6
 
7
- [![Skills](https://img.shields.io/badge/Skills-288-orange?style=flat-square)](dist/agent-src/skills/) [![Rules](https://img.shields.io/badge/Rules-111-orange?style=flat-square)](dist/agent-src/rules/) [![Commands](https://img.shields.io/badge/Commands-191-orange?style=flat-square)](dist/agent-src/commands/) [![Guidelines](https://img.shields.io/badge/Guidelines-101-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-288-orange?style=flat-square)](dist/agent-src/skills/) [![Rules](https://img.shields.io/badge/Rules-111-orange?style=flat-square)](dist/agent-src/rules/) [![Commands](https://img.shields.io/badge/Commands-193-orange?style=flat-square)](dist/agent-src/commands/) [![Guidelines](https://img.shields.io/badge/Guidelines-101-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
  **Try it in 30 seconds** — drop one read-only subagent into any repo and watch it gate "done": `@production-validator check this branch is actually done`. No wizard, no lock-in, nothing else installed — the [30-second wedge ↓](#quickstart) is the whole first step. Start at the proof, not the catalog: **[event4u-app.github.io/agent-config/proof/](https://event4u-app.github.io/agent-config/proof/)**.
10
10
 
@@ -0,0 +1,147 @@
1
+ ---
2
+ model_tier: high
3
+ name: optimize-deep
4
+ pack: meta
5
+ tier: 2
6
+ visibility: internal
7
+ sub: deep
8
+ cluster: optimize
9
+ skills: [ai-council, roadmap-writing, subagent-orchestration, decision-review]
10
+ description: "Autonomous deep-refactoring loop — subagent analysis, verified findings, council, central + sub-roadmaps, PR, then N refinement loops (default 3). E.g. 'run a deep optimization pass'."
11
+ argument-hint: "[--loops=N] [--scope=<path>] [--no-external]"
12
+ suggestion:
13
+ eligible: false
14
+ rationale: "Cluster sub-command — reached via its cluster head's routing or its explicit /cluster:sub name; not independently suggested (surface-consolidation)."
15
+ workspaces:
16
+ - agent-config-maintainer
17
+ - engineering
18
+ packs:
19
+ - meta
20
+ ---
21
+
22
+ # /optimize-deep
23
+
24
+ Autonomous deep-improvement loop: **analyze → verify → council → roadmaps →
25
+ PR → refine ×N**. The autonomous sibling of [`/optimize project`](project.md)
26
+ (which is interview-driven and asks the user); this command answers its own
27
+ questions in the AI council and ends with a pull request plus a
28
+ council-refined roadmap set.
29
+
30
+ This is a **coordinator** over existing primitives — it composes, never
31
+ reimplements: subagent fan-out analysis, `/analyze:decision`-style decision
32
+ challenge, `ai-council` resolution, `/roadmap:create` output shape,
33
+ `/create-pr` mechanics.
34
+
35
+ ## When to invoke
36
+
37
+ - "Deep-analyze this package and build the improvement roadmap" /
38
+ "geh in die Tiefe und erstelle die Refactoring-Roadmap".
39
+ - Periodic renewal: question standing decisions after the environment
40
+ changed (new host capabilities, model generation, ecosystem shift).
41
+ - A refactoring mandate that should end in a reviewed PR, not a chat answer.
42
+
43
+ Do NOT invoke for: a single named bug, an interview-style sweep with the
44
+ user in the loop (route to `/optimize project`), a code-only analysis
45
+ (`/project-analyze`), or agent-layer file tooling (`/optimize` siblings).
46
+
47
+ ## Loop budget
48
+
49
+ `--loops=N` caps the refinement loops. **Default: 3** (council-locked
50
+ 2026-08-02: autonomous loops without a fast, trustworthy CI oracle are
51
+ compounding-error machines; 3 with a tripwire beats 5 on cost/benefit).
52
+ Hard ceiling: 5 — above that, re-invoke deliberately with fresh context.
53
+
54
+ **Halt-on-spin tripwire (checked after every loop, overrides the budget):**
55
+
56
+ - A loop ends with no material roadmap delta (no step added, removed,
57
+ re-scoped, or re-ordered) → STOP, the set has converged.
58
+ - The council splits on the same question twice → STOP, escalate that
59
+ question to the user instead of burning a third loop on it.
60
+ - Any validation target fails 3 consecutive refinement attempts → STOP
61
+ (N=3 budget, `autonomous-execution`).
62
+
63
+ ## Steps
64
+
65
+ ### Step 0 — Preflight (read-only)
66
+
67
+ 1. Live remote state first (`direct-answers` live-state law): fetch,
68
+ open PRs, recently merged work overlapping the scope — never from memory.
69
+ 2. Create or enter an isolated worktree on a fresh branch off the trunk
70
+ (branch/worktree creation is authorized by invoking this command; every
71
+ Hard-Floor action below stays gated).
72
+ 3. Honor any repo worktree-seeding convention when seeding the worktree;
73
+ never copy `.agent-settings.yml` into a worktree.
74
+ 4. Read the lock inventory: honest nulls, DR memories, `later/` resume
75
+ conditions, standing ADRs. These are constraints for Step 4, surfaced —
76
+ never silently relitigated (`decision-revisit-gate`).
77
+
78
+ ### Step 1 — Deep analysis (parallel subagents)
79
+
80
+ Fan out read-only analysis subagents over the repo's load-bearing surfaces
81
+ (token/context cost, execution flows, CI/PR pipeline, routing/activation,
82
+ decision debt, archived intelligence) plus — unless `--no-external` —
83
+ tree-level deep-dives of named external references (`external-reference-deep-dive`:
84
+ file trees + raw files, never README summaries). Each agent returns
85
+ structured findings with file:line evidence and an effort estimate.
86
+
87
+ ### Step 2 — Verification gate (non-negotiable)
88
+
89
+ Hand-verify every damning finding before it may steer the roadmap
90
+ (`plausible-mechanism-is-not-evidence`): re-run the grep/measurement the
91
+ finding rests on, in this checkout, at this SHA. A finding that fails
92
+ verification is dropped with a note. Findings colliding with a recorded
93
+ lock are marked and routed to Step 3 only if the mechanism differs
94
+ (mechanism-match test) — otherwise honored as locked.
95
+
96
+ ### Step 3 — Council pass
97
+
98
+ Run the AI council (`council:estimate` → `council:run --confirm`) on the
99
+ contested decisions only: priority order, roadmap topology, lock collisions
100
+ that pass the mechanism-match test, and the loop count when the user gave
101
+ none. Surface the fast-path marker verbatim where the low-impact path
102
+ resolves something. High-impact and user-required classes still reach the
103
+ user per `ai-council-config` — autonomy never rewires that floor.
104
+
105
+ ### Step 4 — Roadmap set
106
+
107
+ Author ONE central roadmap (goal, verified findings, locks honored,
108
+ sub-roadmap management table, pre-registered success criteria, provenance —
109
+ external sources anonymized + `ENC1:`-encrypted per `source-confidentiality`)
110
+ plus sub-roadmaps cut along the council's topology. Foundation-class
111
+ work (whatever must be true for the rest to be verifiable — typically the
112
+ CI oracle) gates the leverage-class work explicitly. Regenerate the
113
+ dashboard (`roadmap:progress`) in the same response as any roadmap write.
114
+
115
+ ### Step 5 — Pull request
116
+
117
+ Push the branch and open the PR per [`/create-pr`](../pr/create.md) — its
118
+ mechanics and the always-active PR-surface rules govern the body and reply
119
+ shape; do not restate them here.
120
+
121
+ ### Step 6 — Refinement loops (×N, autonomous)
122
+
123
+ Each loop: (a) re-read the roadmap set with fresh subagent reviewers
124
+ (adversarial: hunt over-building, missing evidence, lock violations,
125
+ sequencing errors); (b) resolve contested deltas in the council; (c) any
126
+ delta resting on a NEW factual claim re-enters the Step-2 verification gate
127
+ before application — reviewer assertions are findings, not facts; (d) apply
128
+ the surviving deltas to the roadmaps; (e) push to the same PR; (f) evaluate
129
+ the tripwire. Loop output is a delta summary in the PR description's
130
+ changelog section, not a comment (`no-pr-progress-comments`).
131
+
132
+ ## Output
133
+
134
+ - The PR URL (literal last line of the closing reply).
135
+ - Central + sub-roadmaps on the branch, dashboard regenerated.
136
+ - Council artifacts under `agents/runtime/council/` (local-only, auto-pruned).
137
+ - A one-paragraph verdict per refinement loop: what changed, what converged.
138
+
139
+ ## Gotchas
140
+
141
+ - Merge/deploy is where autonomy ends — Step 6 loop pushes go to the
142
+ already-open PR under the invocation's authorization; merging it,
143
+ deploying, or any irreversible external action stays this-turn gated.
144
+ - Council spend: estimate first; abort and surface if the configured budget
145
+ guard trips mid-run.
146
+ - Subagent cwd pins to the launch dir, not the worktree — pass absolute
147
+ paths into every subagent prompt.
@@ -2,19 +2,19 @@
2
2
  model_tier: medium
3
3
  name: optimize
4
4
  disable-model-invocation: true
5
- argument-hint: "[skills|agents-dir|augmentignore|rtk|project|prompt] [args]"
5
+ argument-hint: "[skills|agents-dir|augmentignore|rtk|project|prompt|deep] [args]"
6
6
  pack: meta
7
- intent: "Optimization dispatcher — skills, rtk, augmentignore, agents-dir, project sweep, prompt"
8
- routes_to: [optimize-skills, optimize-rtk, optimize-augmentignore, optimize-agents-dir, optimize-project, optimize-prompt]
7
+ intent: "Optimization dispatcher — skills, rtk, augmentignore, agents-dir, project sweep, prompt, deep autonomous loop"
8
+ routes_to: [optimize-skills, optimize-rtk, optimize-augmentignore, optimize-agents-dir, optimize-project, optimize-prompt, optimize-deep]
9
9
  replaces: []
10
10
  tier: 1
11
11
  visibility: advanced
12
- description: Optimize orchestrator — routes to skills, agents-dir, augmentignore, rtk-filters, project (project-wide sweep), prompt (AI-prompt polish)
12
+ description: Optimize orchestrator — routes to skills, agents-dir, augmentignore, rtk-filters, project (project-wide sweep), prompt (AI-prompt polish), deep (autonomous deep-refactoring loop)
13
13
  cluster: optimize
14
14
  type: orchestrator
15
15
  suggestion:
16
16
  eligible: true
17
- trigger_description: "optimize my skills, manage agents directory, tune augmentignore, optimize rtk filters, optimize this project, optimize this prompt"
17
+ trigger_description: "optimize my skills, manage agents directory, tune augmentignore, optimize rtk filters, optimize this project, optimize this prompt, run a deep optimization pass"
18
18
  trigger_context: "maintainer auditing/trimming the agent layer, running a project-wide optimization sweep, or polishing an AI prompt (NOT AGENTS.md — that's /agents)"
19
19
  workspaces:
20
20
  - agent-config-maintainer
@@ -42,6 +42,7 @@ the **agent layer** (skills, agents-dir, augmentignore, rtk), the **project**
42
42
  | `/optimize rtk` | `commands/optimize/rtk.md` | Create or refine project-local rtk filters |
43
43
  | `/optimize project` | `commands/optimize/project.md` | Project-wide optimization sweep — inventory roadmaps/ADRs/agent folders, challenge stale decisions, emit new roadmap(s) |
44
44
  | `/optimize prompt` | `commands/optimize/prompt.md` | Optimize a raw prompt for ChatGPT/Claude/Gemini via the 4-D methodology |
45
+ | `/optimize deep` | `commands/optimize/deep.md` | Autonomous deep-refactoring loop — subagent analysis, council, central + sub-roadmaps, PR, N refinement loops (default 3) |
45
46
 
46
47
  Sub-command names match the locked contract in
47
48
  [`docs/contracts/command-clusters.md`](../docs/contracts/command-clusters.md).
@@ -60,14 +61,19 @@ Sub-command names match the locked contract in
60
61
  > 4. rtk — create or refine project-local rtk filters
61
62
  > 5. project — project-wide sweep (roadmaps, ADRs, decisions → new roadmaps)
62
63
  > 6. prompt — polish a raw AI prompt (4-D methodology)
64
+ > 7. deep — autonomous deep-refactoring loop (analysis → council → roadmaps → PR → refine ×N)
63
65
 
64
66
  ## Rules
65
67
 
66
68
  - **Suggest only — never auto-apply.** All `/optimize` sub-commands are
67
69
  audit-grade: they report and propose, but the user approves every change.
70
+ Exception: `deep` is the explicitly autonomous variant — invoking it IS the
71
+ approval for its worktree/branch/roadmap/PR flow; the Hard Floor
72
+ (merge/deploy/prod/bulk-delete) still gates inside it.
68
73
  - **Scope check before routing.** Agent-layer subs (1–4) never touch project
69
74
  code or roadmaps; `project` never rewrites the agent layer; `prompt` only
70
- returns a rewritten prompt.
75
+ returns a rewritten prompt; `deep` writes roadmaps + a PR branch but never
76
+ merges.
71
77
  - **Do NOT chain sub-commands.** One `/optimize <sub>` per turn.
72
78
  - If the user invokes `/optimize` with no argument, **show the menu** — do
73
79
  not guess which sub-command they meant.
@@ -39,7 +39,7 @@ schema_version: 1
39
39
  # CI guard: a release bump of `package.json` must update this value
40
40
  # in lockstep — see scripts/check_template_pin_drift.ts (road-to-
41
41
  # portable-runtime-and-update-check P3.3).
42
- agent_config_version: "9.13.0"
42
+ agent_config_version: "9.14.0"
43
43
 
44
44
  # --- Project identity ---
45
45
  project: