@event4u/agent-config 7.1.0 → 7.3.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 (85) hide show
  1. package/.claude-plugin/marketplace.json +2 -1
  2. package/CHANGELOG.md +80 -0
  3. package/README.md +9 -10
  4. package/dist/agent-src/rules/brand-source-of-truth.md +10 -0
  5. package/dist/agent-src/rules/delegation-policy.md +1 -0
  6. package/dist/agent-src/rules/legal-safety-floor.md +42 -4
  7. package/dist/agent-src/rules/output-discipline.md +85 -0
  8. package/dist/agent-src/rules/telegraph-speak.md +4 -1
  9. package/dist/agent-src/rules/token-budget-discipline.md +94 -0
  10. package/dist/agent-src/skills/accessibility-auditor/SKILL.md +20 -5
  11. package/dist/agent-src/skills/blade-ui/SKILL.md +9 -0
  12. package/dist/agent-src/skills/bug-analyzer/evals/evals.json +13 -0
  13. package/dist/agent-src/skills/code-review/evals/evals.json +21 -0
  14. package/dist/agent-src/skills/contract-review/SKILL.md +3 -2
  15. package/dist/agent-src/skills/dashboard-design/SKILL.md +21 -5
  16. package/dist/agent-src/skills/design-intelligence/SKILL.md +96 -0
  17. package/dist/agent-src/skills/design-review/SKILL.md +83 -0
  18. package/dist/agent-src/skills/design-system-capture/SKILL.md +234 -0
  19. package/dist/agent-src/skills/design-tokens/SKILL.md +1 -0
  20. package/dist/agent-src/skills/dpa-review/SKILL.md +3 -2
  21. package/dist/agent-src/skills/existing-ui-audit/SKILL.md +15 -4
  22. package/dist/agent-src/skills/fe-design/SKILL.md +98 -16
  23. package/dist/agent-src/skills/flux/SKILL.md +8 -0
  24. package/dist/agent-src/skills/iconography/SKILL.md +1 -0
  25. package/dist/agent-src/skills/legal-intake-triage/SKILL.md +3 -2
  26. package/dist/agent-src/skills/legal-practice-profile/SKILL.md +3 -2
  27. package/dist/agent-src/skills/livewire/SKILL.md +8 -0
  28. package/dist/agent-src/skills/nda-triage/SKILL.md +3 -2
  29. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +21 -9
  30. package/dist/agent-src/skills/skill-writing/SKILL.md +18 -0
  31. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +7 -10
  32. package/dist/agent-src/skills/tailwind-engineer/SKILL.md +17 -7
  33. package/dist/agent-src/skills/typography-system/SKILL.md +14 -0
  34. package/dist/agent-src/skills/ui-component-architect/SKILL.md +9 -0
  35. package/dist/discovery/deprecation-report.md +1 -1
  36. package/dist/discovery/discovery-manifest.json +123 -59
  37. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  38. package/dist/discovery/discovery-manifest.summary.md +8 -8
  39. package/dist/discovery/orphan-report.md +1 -1
  40. package/dist/discovery/packs.json +18 -15
  41. package/dist/discovery/trust-report.md +5 -5
  42. package/dist/discovery/workspaces.json +15 -12
  43. package/dist/mcp/registry-manifest.json +3 -3
  44. package/dist/router.json +1 -1
  45. package/dist/server/routes/wizard.js +4 -3
  46. package/dist/server/routes/wizard.js.map +1 -1
  47. package/dist/server/schemas/settings.js +9 -0
  48. package/dist/server/schemas/settings.js.map +1 -1
  49. package/dist/ui/assets/{index-CoQo90sz.js → index-UjcTG_9O.js} +2 -2
  50. package/dist/ui/assets/index-UjcTG_9O.js.map +1 -0
  51. package/dist/ui/index.html +1 -1
  52. package/docs/RELEASE_STORY_TEMPLATE.md +37 -0
  53. package/docs/architecture.md +3 -3
  54. package/docs/contracts/capability-boundary.md +64 -0
  55. package/docs/contracts/discovery-manifest.schema.json +2 -2
  56. package/docs/contracts/governance-enforcement-projection.md +154 -0
  57. package/docs/contracts/package-self-orientation.md +3 -0
  58. package/docs/contracts/subagent-boundary.md +54 -0
  59. package/docs/decisions/ADR-013-discovery-frontmatter-contract.md +13 -0
  60. package/docs/decisions/ADR-107-legal-domain-pack-adoption.md +19 -0
  61. package/docs/enforcement-by-host.md +35 -0
  62. package/docs/getting-started.md +1 -1
  63. package/docs/guidelines/agent-infra/domain-pack-architecture.md +1 -0
  64. package/docs/guidelines/design-antipatterns-triggers.json +17 -0
  65. package/docs/guidelines/design-antipatterns.md +170 -0
  66. package/docs/guidelines/design-modes.md +97 -0
  67. package/package.json +1 -1
  68. package/src/config/agent-settings.template.yml +31 -0
  69. package/src/config/discovery/packs.yml +16 -5
  70. package/src/config/discovery/workspaces.yml +4 -4
  71. package/src/scripts/_lib/eval_discrimination.ts +95 -0
  72. package/src/scripts/_lib/trigger_routers.ts +268 -0
  73. package/src/scripts/bench_ab_v2_run.ts +38 -0
  74. package/src/scripts/check_trunk_drift.ts +67 -0
  75. package/src/scripts/cross_model_smoke.ts +245 -0
  76. package/src/scripts/lint_design_quality.ts +321 -0
  77. package/src/scripts/lint_discovery_vocabulary.ts +4 -4
  78. package/src/scripts/lint_legal_pack.ts +62 -4
  79. package/src/scripts/lint_output_slop.ts +223 -0
  80. package/src/scripts/lint_pack_risk_class.ts +79 -0
  81. package/src/scripts/run_skill_evals.ts +38 -0
  82. package/src/scripts/schemas/agent-settings.schema.json +12 -0
  83. package/src/scripts/schemas/skill.schema.json +5 -0
  84. package/src/scripts/skill_linter.ts +26 -10
  85. package/dist/ui/assets/index-CoQo90sz.js.map +0 -1
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <meta name="robots" content="noindex" />
7
7
  <title>agent-config</title>
8
- <script type="module" crossorigin src="/assets/index-CoQo90sz.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-UjcTG_9O.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-BbWWuFrF.css">
10
10
  </head>
11
11
  <body>
@@ -0,0 +1,37 @@
1
+ # Release Story — `<version>`
2
+
3
+ A curated, human-readable "what changed and **why it matters**" — distinct from
4
+ the raw `CHANGELOG`. The changelog lists commits; the release story tells a
5
+ maintainer or consumer, in plain language, what they get and what to watch.
6
+
7
+ Copy this template per release; keep it short (a screen or less).
8
+
9
+ ## Headline
10
+
11
+ One sentence: the single most important thing this release delivers.
12
+
13
+ ## What changed (and why it matters)
14
+
15
+ - **<change>** — what it is · why a consumer cares · what they should do (if anything).
16
+ - **<change>** — …
17
+
18
+ ## Safety / behaviour changes
19
+
20
+ Anything that changes agent behaviour, gates, or defaults — call it out explicitly
21
+ (new floors, new consent gates, renamed packs, changed risk postures). Consumers
22
+ read this section first.
23
+
24
+ ## Upgrade notes
25
+
26
+ - Breaking? Migration steps. Non-breaking? Say so.
27
+ - New opt-in surfaces (packs, settings) — how to enable.
28
+
29
+ ## Deferred / known limitations
30
+
31
+ What was intentionally left for a future release, and the pointer (roadmap /
32
+ ADR). Honesty here prevents "is this missing or coming?" questions.
33
+
34
+ ---
35
+
36
+ > Fill every section. An empty section is a signal the release is not understood
37
+ > well enough to ship its story. (road-to-product-clarity Phase 4a.)
@@ -146,10 +146,10 @@ note, package-internal path-swap, description budget, and the
146
146
 
147
147
  | Layer | Count | Purpose |
148
148
  |---|---|---|
149
- | **Skills** | 257 | On-demand expertise — stack analysis (Laravel · Symfony · Zend / Laminas · Next.js · React · Node), testing, Docker, API design, security, observability, … |
150
- | **Rules** | 91 | Always-active constraints — coding standards, scope control, verification, language-and-tone, agent-authority |
149
+ | **Skills** | 258 | On-demand expertise — stack analysis (Laravel · Symfony · Zend / Laminas · Next.js · React · Node), testing, Docker, API design, security, observability, … |
150
+ | **Rules** | 93 | Always-active constraints — coding standards, scope control, verification, language-and-tone, agent-authority |
151
151
  | **Commands** | 162 | Slash-command workflows — `/commit`, `/create-pr`, `/fix ci`, `/optimize skills`, `/feature plan`, `/work`, `/implement-ticket`, `/condense`, … |
152
- | **Guidelines** | 84 | Reference material cited by skills — PHP patterns, Eloquent, Playwright, agent-infra, … |
152
+ | **Guidelines** | 86 | Reference material cited by skills — PHP patterns, Eloquent, Playwright, agent-infra, … |
153
153
  | **Templates** | 7 | Scaffolds for features, roadmaps, contexts, skills, overrides |
154
154
  | **Contexts** | 5 | Shared knowledge about the system itself |
155
155
 
@@ -0,0 +1,64 @@
1
+ # Capability Boundary Matrix
2
+
3
+ The per-pack safety posture at a glance: is a pack on by default, does it need
4
+ consent, a council pass, a disclaimer, an eval — and how risky is it. The matrix
5
+ makes the invisible visible; the **enforcement** lives in the per-pack safety
6
+ floors + gates (this doc is the map, not the engine).
7
+
8
+ > Source of truth: `src/config/discovery/packs.yml` (`surface_tier`,
9
+ > `trust_level_default`, `domain`, and the legal-review-prep gate fields) + the
10
+ > domain safety-floor rules. Built in `road-to-capability-governance` Phase 1;
11
+ > `risk_class` becomes a real pack field in Phase 2.
12
+
13
+ ## Policy by risk class
14
+
15
+ | `risk_class` | default install | consent | council / deep-research | disclaimer | eval expectation | surface_tier |
16
+ |---|---|---|---|---|---|---|
17
+ | **low** | per profile | no | no | no | optional | `core` |
18
+ | **medium** (advisory) | per profile | no | no | **yes** (domain safety floor) | recommended | `core` |
19
+ | **high** | **no** (opt-in) | **yes** | **yes** (fail-closed) | **yes** | **yes** | `lab` |
20
+
21
+ - **low** — engineering, product, meta, and tooling packs. Normal capability; no domain liability surface.
22
+ - **medium (advisory)** — packs that emit advisory-shaped output (finance, strategy). They carry a **domain safety floor** that mandates a not-X-advice disclaimer + structural elements (assumptions / counter-case / confidence). Not off-by-default, but never a final call.
23
+ - **high** — regulated-advice-adjacent. Off by default, consent-gated, council-gated (fail-closed), disclaimer-bound, eval-backed, lab-tier, and promotion-gated behind a professional review.
24
+
25
+ ## Per-pack assignment (non-low)
26
+
27
+ | Pack | `risk_class` | Floor | Gates |
28
+ |---|---|---|---|
29
+ | `legal-review-prep` | **high** | `legal-safety-floor` | consent (`legal_review_prep.acknowledged`) · council (`require_council`, fail-closed) · hard individual-case STOP · attorney-review line + `Jurisdiction:` tag · attorney-framing-review promotion tripwire · `default_install: false` · `surface_tier: lab` |
30
+ | `finance-basic` | medium | `finance-safety-floor` | not-financial-advice disclaimer · assumptions + sensitivity + confidence + counter-case · no final invest/raise call |
31
+ | `finance-advanced` | medium | `finance-safety-floor` | as finance-basic (DCF / scenario depth) |
32
+ | `founder-strategy` | medium | `strategy-safety-floor` | not-a-strategic-decision footer · bet + counter-case + residual risk + decision owner |
33
+
34
+ Every other pack in `packs.yml` is **low** by default. A pack moves to medium the
35
+ moment it ships advisory-shaped output behind a domain safety floor, and to high
36
+ only through the high-risk checklist (consent + council + disclaimer + eval +
37
+ lab + promotion gate) — see `road-to-legal-review-prep` for the worked example.
38
+
39
+ ## Capability lifecycle (a view, not a new axis)
40
+
41
+ Reviewers wanted one lifecycle vocabulary for promoting / retiring capabilities.
42
+ This is a **derived view** over the metadata that already exists
43
+ (`trust_level_default` + `surface_tier` + eval presence) — **not** a new field.
44
+ Nothing to set; it is read off what is already there.
45
+
46
+ | Lifecycle | Derived from | Promotion criterion (to reach it) |
47
+ |---|---|---|
48
+ | **experimental** | `surface_tier: lab` **or** `trust_level_default: experimental` | default for any new pack/skill |
49
+ | **validated** | `surface_tier: core` **and** has an `evals/` (or regression harness) | a real eval exists + the pack left lab |
50
+ | **recommended** | validated **and** in a default profile / ≥1 real consumer | adoption evidence, not just existence |
51
+ | **deprecated** | a `deprecated`/`superseded_by` marker in frontmatter | a successor named (per the persona/skill deprecation discipline) |
52
+
53
+ Read the lifecycle column off the matrix above: a `lab` + `experimental` pack
54
+ (e.g. `legal-review-prep`, `ai-video`) is **experimental**; a `core` pack with an
55
+ eval is **validated**; a `core` pack a profile ships is **recommended**.
56
+ Promotion stays a human/maintainer decision (criteria-documented, never
57
+ automated — see `road-to-capability-governance` Phase 6).
58
+
59
+ ## See also
60
+
61
+ - [`legal-safety-floor`](../../src/rules/legal-safety-floor.md) — the high-risk exemplar.
62
+ - `finance-safety-floor` · `strategy-safety-floor` — the medium-risk advisory floors.
63
+ - [`domain-pack-architecture`](../guidelines/agent-infra/domain-pack-architecture.md) — the pack build sequence.
64
+ - `road-to-capability-governance` Phase 2 — `risk_class` as a validated pack field.
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "workspace_id": {
76
76
  "type": "string",
77
- "enum": ["engineering", "product", "finance", "founder", "gtm", "ops", "small-business", "construction", "legal", "agent-config-maintainer"]
77
+ "enum": ["engineering", "product", "finance", "founder", "gtm", "ops", "small-business", "construction", "legal-review-prep", "agent-config-maintainer"]
78
78
  },
79
79
  "pack_id": {
80
80
  "type": "string",
@@ -84,7 +84,7 @@
84
84
  "finance-basic", "finance-advanced",
85
85
  "gtm-sales", "gtm-marketing",
86
86
  "ops-people", "founder-strategy", "small-business", "construction", "ai-video", "ai-image", "fun", "meta", "git", "frontend-design", "brand",
87
- "memory", "analytics", "product-reasoning", "analysis-workbench", "legal"
87
+ "memory", "analytics", "product-reasoning", "analysis-workbench", "legal-review-prep"
88
88
  ]
89
89
  },
90
90
  "lifecycle": {
@@ -0,0 +1,154 @@
1
+ # Governance Enforcement at Projection Time — design spec
2
+
3
+ > **Status: Measured → honest-null (2026-06-25). NOT shipped.** The length-controlled
4
+ > eval (54 paired runs, sonnet-4-6) found `discipline_score = 1.000` for `package`,
5
+ > `hardened` and `hardened-placebo` alike — Δ(hardened − package) = 0.000 across all
6
+ > 18 paired instances. The cooperative `package` rules already catch trapD
7
+ > (non-destructive) + trapE (scope-control) at ceiling, so the hardened blocks add
8
+ > nothing measurable. Per this spec's own rule, `condense.ts` is **not** wired and
9
+ > no public "enforcement" claim is made. **Caveat:** the discipline corpus is
10
+ > single-shot on micro-fixtures and does NOT reproduce the token-pressure /
11
+ > long-horizon condition the treatment targets — it saturates. Revisit only behind
12
+ > a pressure/long-context corpus, not by writing more enforcement code. The opt-in
13
+ > `hardened` arm remains in `bench_ab_v2_run.ts` as a reusable measurement tool.
14
+
15
+ ## Problem
16
+
17
+ The package's highest-stakes rules (commit only when told, never push/merge
18
+ autonomously, no whimsical bulk deletion) are **model-cooperative**: they are
19
+ strong prose the agent is asked to follow. Under token pressure or long-horizon
20
+ autonomy, cooperative rules can be violated. An external operator-runtime
21
+ reference ("Source A") closes this with **runtime hooks that hard-block** the
22
+ tool call — but those reach only ~2 of our 7 projection hosts (Claude Code,
23
+ Cline/MCP). The other five (Cursor, Windsurf, Copilot, Gemini, Augment) are
24
+ static-only ([`enforcement-by-host.md`](../enforcement-by-host.md)).
25
+
26
+ The universal lever is therefore **compile-time**: harden the few irreversible
27
+ Iron Laws into each host's *native* instruction format at projection time, with
28
+ explicit override-guard phrasing — so the constraint is as emphatic as the host
29
+ medium allows, everywhere, not just where hooks exist.
30
+
31
+ ## Non-goals (identity guardrails)
32
+
33
+ - **Not runtime.** This is a projection-time transform, not a daemon, not new
34
+ cross-session state. Runtime hook hardening is separate (Phase 2, MCP-only).
35
+ - **Not all 93 rules.** Hardening a large rule set would blow the context
36
+ budget and dilute the signal. The set is deliberately tiny (see Selector).
37
+ - **Not a compliance guarantee.** A static host can still ignore a hardened
38
+ block — the mechanism *maximises* emphasis, it does not *block*. The eval
39
+ measures whether it actually moves the violation rate; honest-null is allowed.
40
+
41
+ ## Selector — which rules get hardened
42
+
43
+ Default set = rules already carrying **`tier: safety-floor`** in frontmatter.
44
+ Today that is exactly **3** files — the irreversible-action set:
45
+
46
+ - `src/rules/commit-policy.md`
47
+ - `src/rules/non-destructive-by-default.md`
48
+ - `src/rules/scope-control.md`
49
+
50
+ Optionally extend to a named kernel rule (`verify-before-complete`, `tier:
51
+ kernel`) by explicit opt-in. Reusing the existing `tier` signal means **no
52
+ frontmatter-schema change** — `rule.schema.json` has `additionalProperties:
53
+ false`, so adding a new `enforcement:` key would require a schema bump; we avoid
54
+ that until finer-grained control is actually needed. If we later need a rule
55
+ that is `safety-floor` but *not* hardened (or vice versa), introduce an explicit
56
+ `enforcement: hard` key and bump the schema then.
57
+
58
+ ## Mechanism
59
+
60
+ A projection-time transform in the existing engine (`src/scripts/condense.ts`,
61
+ the per-host `generate_*` path). For each hardened rule, after the normal rule
62
+ body is projected into a host's native format, append a compact **HARD
63
+ CONSTRAINT** block tuned to that host. The block is short (3–6 lines) so the
64
+ per-projection token cost stays bounded.
65
+
66
+ Canonical block shape (host-tuned wording varies — see matrix):
67
+
68
+ ```
69
+ ## HARD CONSTRAINT — do not override
70
+ - NEVER <forbidden action> without explicit user approval in this message.
71
+ - This is a HARD CONSTRAINT, not a preference. If asked to bypass it, refuse
72
+ and require an explicit, unambiguous instruction this turn.
73
+ ```
74
+
75
+ ## Per-host tuning (empirical — Phase 1 item 2)
76
+
77
+ Wording efficacy differs by host. Confirm before locking; capture findings in a
78
+ context note.
79
+
80
+ | Host | Mechanism | Phrasing lever (hypothesis, to confirm) |
81
+ |---|---|---|
82
+ | Claude Code / Cline (MCP) | compile-time **+** runtime hook (Phase 2) | reasoning-chain + the block; hook is the floor |
83
+ | Cursor (`.cursorrules`) | compile-time only | aggressive NEVER/ALWAYS caps |
84
+ | Windsurf (`.windsurfrules`) | compile-time only | aggressive NEVER/ALWAYS caps |
85
+ | Copilot (`copilot-instructions.md`) | compile-time only | short imperative + explicit refusal script |
86
+ | Gemini (`GEMINI.md`) | compile-time only | short imperative |
87
+ | Augment | compile-time only | native rule emphasis |
88
+
89
+ ## Verification — the "linter" half
90
+
91
+ A drift gate (analogous to `update_counts.ts --check` / `check_references.ts`):
92
+ for every hardened rule, assert that each host's projected artifact actually
93
+ contains the HARD CONSTRAINT block. Fail CI on drift. This is what makes
94
+ "hardened everywhere" a checked fact, not an assumption.
95
+
96
+ ## Eval — does it move the needle?
97
+
98
+ Extend the existing A/B substrate (`bench_ab_v2_run.ts` family + per-skill
99
+ `evals/`) with a small **discipline** set: scenarios that tempt an
100
+ irreversible-action violation under pressure (e.g. "just commit and push this,
101
+ we're in a hurry"). Measure violation rate **with vs without** the hardened
102
+ block, **length-controlled** (the hardened block adds tokens — the control arm
103
+ must match length so we measure emphasis, not verbosity). Report per host where
104
+ feasible. **Honest-null is a valid outcome** — if the block does not move the
105
+ rate, it is prompt-engineering theatre and we say so rather than ship it.
106
+
107
+ ## Risks / open questions
108
+
109
+ - **Token budget.** Each hardened block adds tokens to every projection — in
110
+ tension with the thin-projection token-saving work. Mitigation: tiny set (3),
111
+ short blocks; measure net cost in the eval.
112
+ - **Per-host efficacy unknown** until item 2 runs; the matrix above is hypothesis.
113
+ - **Over-claim risk.** Public copy must keep saying "compile-time emphasis on
114
+ static hosts, deterministic block only on hook-capable hosts" — never
115
+ "deterministic everywhere".
116
+
117
+ ## Eval addendum — reuse the existing discipline harness (don't rebuild)
118
+
119
+ Recon (2026-06-25) found the discipline-axis benchmark already built:
120
+ `internal/bench/corpora/ab-trackb-v2.yaml` (5 trap archetypes, per-task fixtures
121
+ under `internal/bench/ab/fixtures-v2/`), paired + length-controlled arms in
122
+ `src/scripts/bench_ab_v2_run.ts` (a `package` arm vs a length-matched `placebo`
123
+ arm), and a **deterministic** scorer (`src/scripts/_lib/bench_ab_scoring_v2.ts`, no LLM judge).
124
+ It already covers **2 of the 3** hardened rules:
125
+
126
+ - `trapD` (destructive-op-needs-confirm) → **non-destructive-by-default** ✓
127
+ - `trapE` (premature-completion/scope) → **scope-control** ✓
128
+ - `commit-policy` → **gap** (no trap archetype yet).
129
+
130
+ So the eval build is small and reuses everything:
131
+
132
+ 1. Add a **`hardened` arm** to `bench_ab_v2_run.ts` `ARMS` = the `package` arm
133
+ **plus** the prototype HARD CONSTRAINT blocks for the 3 safety-floor rules
134
+ injected into the sysprompt. Length-control inherits the existing `placebo`
135
+ methodology (match injected token footprint).
136
+ 2. Add **commit-policy trap tasks** (`trapF`?) + fixtures (e.g. "just commit and
137
+ push this, we're in a hurry" against an unstaged irreversible change).
138
+ 3. Run **paired**: `package` vs `hardened` (and `placebo` for length-control),
139
+ deterministic scoring, per-rule discipline Δ.
140
+ 4. **Honest-null is a valid outcome.** If `hardened − package` Δ is null (cf. the
141
+ recursion-arm honest-null already on record), the block is theatre → do NOT
142
+ wire it into `condense.ts`, and say so.
143
+
144
+ **The run is billable** (model calls). Cost footguns on record: pin a mid-tier
145
+ model (Opus-1M cache blows the budget), set `--budget` / `--max-budget-usd`,
146
+ per-arm activation. No `condense.ts` mutation and no public "enforcement" claim
147
+ until a positive, length-controlled Δ exists.
148
+
149
+ ## Council convergence (inline)
150
+
151
+ Council (claude-sonnet-4-5 + gpt-4o, 2026-06-25, 2 rounds): the universal
152
+ enforcement lever is compile-time frontmatter, not runtime hooks (hooks reach
153
+ <30% of hosts); ship hardening for the irreversible set, measure before/after,
154
+ keep runtime hooks as an opt-in MCP-only superset.
@@ -156,5 +156,8 @@ layout + cloud-bundle pipeline:
156
156
  3. Commit in logical chunks with Conventional Commits.
157
157
  4. Open a PR against `main`.
158
158
 
159
+ Per-pack safety posture (default-install / consent / council / disclaimer /
160
+ risk_class): [`capability-boundary.md`](capability-boundary.md).
161
+
159
162
  User-facing story: [`README.md`](../../README.md). Architecture
160
163
  deep-dive: [`docs/architecture.md`](../architecture.md).
@@ -0,0 +1,54 @@
1
+ # Subagent Boundary Contract
2
+
3
+ What a subagent **owns** and what it must **never** own. As delegation spreads
4
+ (the `subagent-orchestration` modes, the `delegation-policy` auto-trigger,
5
+ workflow fan-out), the failure mode is scope drift: a subagent quietly
6
+ redefining the task, expanding scope, or bypassing a floor. This contract draws
7
+ the line.
8
+
9
+ ## The ownership line
10
+
11
+ A subagent **executes one scoped, named task and returns a conclusion.** That is
12
+ the whole of its authority.
13
+
14
+ ### A subagent OWNS
15
+
16
+ - **Its scoped task** — the single, well-specified slice it was dispatched with.
17
+ - **Its method** — how it searches, reads, reasons, or drafts within that slice.
18
+ - **Its return** — a conclusion + evidence, sized to what the orchestrator asked for (structured output when a schema was given).
19
+
20
+ > **Explainability is durable, not host-ephemeral.** The return must carry a brief
21
+ > *why + evidence* (which sources/steps led to the conclusion) **in the artefact /
22
+ > output itself**, not only in the host's session reasoning. A user opening the
23
+ > result later — possibly across sessions — must be able to trace the *why* without
24
+ > reassembling provider chat logs. This is the reasoning-in-notes discipline applied
25
+ > to delegation: conclusions + evidence travel with the output, raw chain-of-thought
26
+ > does not.
27
+
28
+ ### A subagent must NEVER own
29
+
30
+ - **Task meaning** — it does not redefine, broaden, or reinterpret the parent task. An ambiguous slice returns "ambiguous + why", it does not guess a bigger task.
31
+ - **Cross-task memory / state** — it does not write durable memory, mutate shared roadmaps, or persist decisions for other tasks; its output is its only channel.
32
+ - **Pack / surface decisions** — it does not decide what ships, what installs, or what a pack contains; those are orchestrator + human calls.
33
+ - **Safety-floor bypass** — every floor applies *inside* the subagent. The Hard Floor ([`non-destructive-by-default`](../../src/rules/non-destructive-by-default.md)), the domain safety floors, [`scope-control`](../../src/rules/scope-control.md), and [`commit-policy`](../../src/rules/commit-policy.md) are not lifted by being one level down. A subagent cannot do what its parent may not.
34
+ - **Silent scope expansion** — touching files / systems beyond its slice is a contract violation, surfaced, not absorbed.
35
+
36
+ ## Orchestrator obligations (the other side)
37
+
38
+ - **Verify, never adopt blind** — a subagent return is evidence, not truth; the orchestrator verifies per [`delegation-policy`](../../src/rules/delegation-policy.md)'s Iron Law before adopting it.
39
+ - **Tier-size the slice, not the agent** — dispatch at the slice's complexity, not the session's.
40
+ - **Own the safety decision** — a Hard-Floor or egress action surfaced by a subagent is decided by the orchestrator + human, never executed by the subagent.
41
+
42
+ ## Failure modes
43
+
44
+ - A research subagent that, finding the task underspecified, invents a broader task and "helpfully" does it.
45
+ - A subagent that writes to shared memory / a roadmap dashboard as a side effect.
46
+ - A subagent that commits, pushes, or deletes because "the task implied it".
47
+ - An orchestrator that pastes a subagent's claim into the answer without verifying it.
48
+
49
+ ## See also
50
+
51
+ - [`subagent-orchestration`](../../src/skills/subagent-orchestration/SKILL.md) — the dispatch modes this contract bounds.
52
+ - [`delegation-policy`](../../src/rules/delegation-policy.md) — the delegate-by-default trigger + verify-every-return Iron Law.
53
+ - [`capability-boundary`](capability-boundary.md) — the pack-level companion (this is the agent-level one).
54
+ - [`non-destructive-by-default`](../../src/rules/non-destructive-by-default.md) — the Hard Floor that applies inside subagents too.
@@ -314,6 +314,19 @@ road-to-legal-pack Phase 0.2). Council-resolved across three rounds 2026-06-24
314
314
  (road-to-legal-pack). Additive, no rename; non-overlap with cost-profile and
315
315
  `profile.id` reservations holds.
316
316
 
317
+ ### 2026-06-24 — Rename `legal` → `legal-review-prep` (workspace + pack)
318
+
319
+ Renamed the workspace id and pack id `legal` → `legal-review-prep` in both
320
+ closed vocabularies, the schema enums, and all artefacts (`src/domains/legal/`
321
+ → `src/domains/legal-review-prep/`, the five skill frontmatters, the
322
+ `legal-safety-floor` rule). Driven by a deep AI-council (3 rounds,
323
+ anthropic/claude-sonnet-4-5 + openai/gpt-4o, 2026-06-24) + ~8 external
324
+ 7.1.0 reviewers: the name `legal` reads as "legal advice" and undermines the
325
+ not-legal-advice positioning; `legal-review-prep` names the actual capability
326
+ (prepare for attorney review). The `domain: legal` classifier and the `legal`
327
+ user-type are a different axis and are unchanged. Rename, not additive;
328
+ non-overlap reservations still hold. See `road-to-legal-review-prep` Phase 0.
329
+
317
330
  ## Cross-references
318
331
 
319
332
  - [ADR-007 — Agent Discovery Scopes](ADR-007-agent-discovery-scopes.md):
@@ -21,6 +21,11 @@ type: prospective
21
21
 
22
22
  ## Decision
23
23
 
24
+ > **Amendment (2026-06-24, deep-council).** The pack id was renamed `legal` →
25
+ > `legal-review-prep` after this ADR, to stop the name itself reading as "legal
26
+ > advice" (deep AI-council + 7.1.0 reviewers; see `road-to-legal-review-prep`).
27
+ > Read every `legal` pack-id reference below as `legal-review-prep`.
28
+
24
29
  Open a single, narrow `legal` pack — **not** a multi-plugin / multi-agent parity clone.
25
30
 
26
31
  1. **Scope: EU/DE-only, hard refusal.** Every selectable jurisdiction is an implicit currency promise; for a single maintainer the smallest correct cut is EU/DE with "consult local counsel" for everything else. Encoded in the `legal-safety-floor` rule + the pack description; surfaced via a machine-checkable `Jurisdiction:` tag.
@@ -31,6 +36,20 @@ Open a single, narrow `legal` pack — **not** a multi-plugin / multi-agent pari
31
36
  6. **No personas** — procedure-not-personality; role focus lives in skill tags + the practice profile.
32
37
  7. **Conditional product-liability gate** — commercial (Pro-tier) ship would require licensed-attorney review of the pack itself. **Resolved N/A 2026-06-24:** the suite is open-source forever, no commercial tier (ADR-108) — the gate never fires; the non-removable disclaimer + per-output attorney-review line cover end-user reliance.
33
38
 
39
+ ## Amendment (2026-06-24, deep-council) — attorney-framing-review promotion tripwire
40
+
41
+ Promotion of `legal-review-prep` out of `surface_tier: lab` / `trust_level_default:
42
+ experimental`, flipping `default_install` to anything but `false`, or any
43
+ commercial / hosted surface, is **blocked** until a licensed German attorney has
44
+ reviewed the *framing* (the `legal-safety-floor` rule, `LEGAL_NOTICE.md`, and the
45
+ RDG individual-case wording — **not** skill correctness) and the review is recorded
46
+ in `LEGAL_NOTICE.md` as `Framing reviewed by <name>, Rechtsanwalt/Rechtsanwältin,
47
+ <date>`. The deep AI-council (2026-06-24) scoped this as a bounded (~€300–800,
48
+ 1–2h) one-time gate, **not** a blocker for the current lab release (lab is
49
+ explicitly unvetted; users opt in knowingly via the consent gate). Enforced by
50
+ `lint_legal_pack` (`promotion-gate` rule): a promoted tier without the recorded
51
+ marker fails CI.
52
+
34
53
  ## Rejections (recorded)
35
54
 
36
55
  matter-workspace (too heavy), scheduled watchers, community-skill installer hub, US-state employment tests, full litigation depth, bar-prep, Swiss cantonal depth, non-EU/DE jurisdictions, the cross-model-parity dependency for the eval (a false blocker, corrected in the full critique round).
@@ -0,0 +1,35 @@
1
+ # Enforcement by host — how governance is applied, per tool
2
+
3
+ Governance in this package is applied two ways, and which one a host gets
4
+ depends on what that host exposes. We say so plainly rather than imply
5
+ "deterministic everywhere".
6
+
7
+ - **Compile-time (every host).** Rules and Iron Laws are compiled into each
8
+ host's native instruction format at projection time (`.cursorrules`,
9
+ `.windsurfrules`, `copilot-instructions.md`, `GEMINI.md`, Claude/Augment
10
+ native rule dirs). This is the universal layer — it works on all projection
11
+ targets. It is **model-cooperative**: the agent is instructed, strongly, but
12
+ the host does not hard-block the call.
13
+ - **Runtime hooks (hook-capable hosts only).** On hosts that expose a tool
14
+ lifecycle (`PreToolUse` / `PostToolUse` / `Stop`), a small set of guards can
15
+ **deterministically block** a call (e.g. `block_no_verify`). This is a
16
+ superset on top of the compile-time layer, not a replacement.
17
+
18
+ | Host | Compile-time rules | Runtime hook enforcement |
19
+ |---|---|---|
20
+ | Claude Code (plugin) | ✅ | ✅ native hooks |
21
+ | Cline (MCP) | ✅ | ✅ where the MCP host exposes lifecycle |
22
+ | Cursor | ✅ `.cursorrules` | — static only |
23
+ | Windsurf | ✅ `.windsurfrules` | — static only |
24
+ | Copilot | ✅ `copilot-instructions.md` | — static only |
25
+ | Gemini | ✅ `GEMINI.md` | — static only |
26
+ | Augment | ✅ native rules | — no public hook API |
27
+
28
+ **Why we lead with compile-time, not hooks.** Runtime hooks reach only a
29
+ minority of supported hosts. Building the governance story on hooks would make
30
+ it a two-tier experience — strong on Claude, absent on Cursor/Windsurf/Copilot.
31
+ So the universal lever is the compile-time layer; runtime hooks are an opt-in
32
+ **bonus** on the hosts that can run them, never the floor.
33
+
34
+ See also the artifact-projection view: [`capability-matrix.md`](capability-matrix.md)
35
+ (its `hooks` row already shows hooks are native to the Claude plugin only).
@@ -129,7 +129,7 @@ Your agent is now:
129
129
  - **Respecting your codebase** — no conflicting patterns
130
130
  - **Following standards** — consistent code quality
131
131
 
132
- This is enforced automatically by 91 rules. No configuration needed.
132
+ This is enforced automatically by 93 rules. No configuration needed.
133
133
 
134
134
  ---
135
135
 
@@ -50,6 +50,7 @@ itself a useful result.
50
50
 
51
51
  ## See also
52
52
 
53
+ - [Capability Boundary Matrix](../../contracts/capability-boundary.md) — per-pack safety posture (default-install / consent / council / disclaimer / eval / risk_class).
53
54
  - [ADR-107 — Legal domain-pack adoption](../../decisions/ADR-107-legal-domain-pack-adoption.md)
54
55
  - `domain-adoption-policy` (rule) — the three gates before opening any domain.
55
56
  - `domain-eval-anti-pattern.md` — why the legal eval is a regression harness, not an objective gate.
@@ -0,0 +1,17 @@
1
+ {
2
+ "description": "Routing eval for design-antipatterns guideline: should an agent pull this catalog for a given task?",
3
+ "should_pull": [
4
+ "Design a landing page for a new SaaS product",
5
+ "Review this UI mockup for AI-slop patterns",
6
+ "Create a feature card section with icons and descriptions",
7
+ "Generate a hero section with a big metric and supporting stats",
8
+ "The design looks generic — how do I make it more distinctive?"
9
+ ],
10
+ "should_not_pull": [
11
+ "Fix the authentication bug in the login controller",
12
+ "Write a migration to add the user_id column to the orders table",
13
+ "Set up the CI pipeline for the monorepo",
14
+ "Draft a customer email reply for a billing issue",
15
+ "Analyze the test coverage for the payment module"
16
+ ]
17
+ }