@event4u/agent-config 9.1.0 → 9.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 (76) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +38 -234
  3. package/README.md +1 -1
  4. package/dist/agent-src/commands/fix/route.md +49 -0
  5. package/dist/agent-src/commands/fix.md +4 -2
  6. package/dist/agent-src/commands/implement-ticket.md +2 -0
  7. package/dist/agent-src/commands/review/changes.md +22 -0
  8. package/dist/agent-src/commands/tdd/green.md +32 -0
  9. package/dist/agent-src/commands/tdd/red.md +33 -0
  10. package/dist/agent-src/commands/tdd/refactor.md +31 -0
  11. package/dist/agent-src/commands/tdd.md +50 -0
  12. package/dist/agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -0
  13. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +41 -6
  14. package/dist/agent-src/contexts/execution/subagent-spawn-contract.md +81 -2
  15. package/dist/agent-src/contexts/execution/verify-budget.md +15 -0
  16. package/dist/agent-src/rules/architecture.md +7 -0
  17. package/dist/agent-src/rules/cross-source-consistency.md +92 -0
  18. package/dist/agent-src/rules/delegation-policy.md +1 -1
  19. package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -0
  20. package/dist/agent-src/skills/fe-design/SKILL.md +1 -0
  21. package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
  22. package/dist/agent-src/skills/judge-code-quality/SKILL.md +1 -0
  23. package/dist/agent-src/skills/persona-improvement/SKILL.md +81 -0
  24. package/dist/agent-src/skills/po-discovery/SKILL.md +2 -0
  25. package/dist/agent-src/skills/react-shadcn-ui/SKILL.md +10 -0
  26. package/dist/agent-src/skills/refine-ticket/SKILL.md +7 -0
  27. package/dist/agent-src/skills/roadmap-writing/SKILL.md +14 -0
  28. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +38 -28
  29. package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +18 -0
  30. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +3 -2
  31. package/dist/agent-src/skills/subagent-orchestration/prompts/adversarial-verification-council.md +79 -0
  32. package/dist/agent-src/skills/subagent-orchestration/schemas/adversarial-findings.json +56 -0
  33. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  34. package/dist/discovery/deprecation-report.md +1 -1
  35. package/dist/discovery/discovery-manifest.json +205 -29
  36. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  37. package/dist/discovery/discovery-manifest.summary.md +5 -5
  38. package/dist/discovery/orphan-report.md +1 -1
  39. package/dist/discovery/packs.json +19 -11
  40. package/dist/discovery/trust-report.md +4 -4
  41. package/dist/discovery/workspaces.json +16 -8
  42. package/dist/install/install.mjs +9 -0
  43. package/dist/mcp/registry-manifest.json +3 -3
  44. package/dist/router.json +1 -1
  45. package/dist/server/schemas/settings.js +5 -0
  46. package/dist/server/schemas/settings.js.map +1 -1
  47. package/docs/CLAIMS.md +10 -3
  48. package/docs/architecture.md +4 -4
  49. package/docs/archive/CHANGELOG-pre-9.2.0.md +276 -0
  50. package/docs/benchmark.md +24 -0
  51. package/docs/command-flows.md +9 -3
  52. package/docs/contracts/command-clusters.md +2 -1
  53. package/docs/decisions/ADR-122-adversarial-verification-council.md +136 -0
  54. package/docs/decisions/INDEX.md +1 -0
  55. package/docs/design/adversarial-council-eval.md +106 -0
  56. package/docs/development.md +10 -1
  57. package/docs/featured-skills.md +2 -2
  58. package/docs/getting-started-by-role.md +1 -1
  59. package/docs/getting-started.md +1 -1
  60. package/docs/governance-advantage.md +1 -1
  61. package/docs/guidelines/agent-infra/cross-source-consistency-mechanics.md +109 -0
  62. package/docs/guidelines/component-oriented-and-oop-development.md +181 -0
  63. package/docs/proof.md +7 -7
  64. package/package.json +3 -2
  65. package/src/config/agent-settings.template.yml +42 -0
  66. package/src/scripts/_lib/adversarial_council_gate.test.ts +112 -0
  67. package/src/scripts/_lib/adversarial_council_gate.ts +98 -0
  68. package/src/scripts/_lib/adversarial_reconcile.test.ts +197 -0
  69. package/src/scripts/_lib/adversarial_reconcile.ts +187 -0
  70. package/src/scripts/_lib/verify_budget.ts +4 -1
  71. package/src/scripts/ai_council/prompts.ts +7 -0
  72. package/src/scripts/hook_manifest.yaml +17 -6
  73. package/src/scripts/install-hooks.sh +32 -17
  74. package/src/scripts/pr_url_reminder_hook.ts +177 -0
  75. package/src/scripts/schemas/agent-settings.schema.json +11 -0
  76. package/src/server/schemas/settings.ts +9 -0
@@ -0,0 +1,106 @@
1
+ # Adversarial verification council eval — two-stage residual-detection design
2
+
3
+ > Design artifact for `road-to-adversarial-verification-council` Phase 4. It
4
+ > pins the benchmark that resolves the pre-registered `adversarial-council-
5
+ > finding-coverage` claim (docs/CLAIMS.md, ADR-122). Writing this design is
6
+ > autonomous; **curating the corpus and running the paid cross-vendor arm is a
7
+ > maintainer cost decision**, gated on the corpus-validity check below.
8
+
9
+ ## What the claim is — and is not
10
+
11
+ - **Is:** does a cross-vendor skeptic panel find materially more of the defects
12
+ that **survive a single strong judge** (the residual pool), at a false-positive
13
+ rate no worse than that judge on a controversial-but-correct control?
14
+ - **Is not:** whether the council beats a solo model on *decision quality* — that
15
+ is the separate, `unbacked`, spend-gated `council-vs-solo-baseline`
16
+ (docs/design/council-vs-solo-baseline.md), explicitly out of scope.
17
+
18
+ ## The council's load-bearing critique (folded in)
19
+
20
+ The AI-council debate (2026-07-14, anthropic/claude-sonnet-4-5 + openai/gpt-4o)
21
+ converged on one real risk: the existing `cross-model-parity` corpus was built
22
+ to show that different vendors catch different **obvious** things (parity), not
23
+ to simulate the **residual** state after a competent first pass. Running the
24
+ registered claim on it would force an honest-null as a *measurement artifact*,
25
+ not a mechanism result. This design answers that with a two-stage protocol, a
26
+ corpus-subtlety bar, a dual threshold, and a controversial-clean FP control.
27
+
28
+ ## Two-stage protocol
29
+
30
+ 1. **Stage 1 — single strong judge.** A single cross-model judge runs on every
31
+ planted-defect change. The defects it CATCHES are removed from scope.
32
+ 2. **Stage 2 — the panel on the residual.** Only the changes that PASS stage 1
33
+ (defect not caught) proceed to the Mode 9 panel. Recall is measured on this
34
+ **judge-passed residual pool** — the production-relevant quantity.
35
+
36
+ This makes "residual detection" explicit rather than implicit in corpus
37
+ selection.
38
+
39
+ ## Corpus-validity gate (blocks the registered run)
40
+
41
+ The corpus must contain **judge-survivable subtleties**, published as a
42
+ distribution before the registered run:
43
+
44
+ - multi-file interaction defects,
45
+ - subtle logic inversions that read as plausible,
46
+ - security masked by correct-looking patterns,
47
+ - edge cases in complex state.
48
+
49
+ Publish the severity/subtlety distribution (share single-file <5 LoC vs
50
+ multi-file interaction). A corpus skewed to trivially-detectable defects fails
51
+ this gate — the registered run does not proceed until it passes.
52
+
53
+ ### Assessment of the existing corpus (2026-07-14)
54
+
55
+ `internal/bench/orchestration/corpus/` (5 tasks: orch-01..03, pv-01 hollow,
56
+ pv-02 control) was purpose-built for the parity signal and for A3
57
+ production-validator Gate-A. `pv-01` is a deliberately **obvious** hollow impl
58
+ (a floor sanity check), and none of the five tasks is designed as a
59
+ judge-survivable residual defect. **Conclusion: this corpus does NOT meet the
60
+ subtlety bar** — so the registered run is **blocked** pending a curated
61
+ residual-defect corpus. The claim stays `unbacked` until then (no false
62
+ `backed`).
63
+
64
+ ## Controversial-but-correct FP control
65
+
66
+ The clean control includes correct-but-non-obvious cases (real perf/security
67
+ design tradeoffs, uncommon patterns) — not only obviously-clean code — so the
68
+ red-team posture's true FP cost is measured. Panel FP is compared to the
69
+ single-judge FP on the SAME control.
70
+
71
+ ## Panel = cross-vendor
72
+
73
+ The registered run and the opt-in high-risk tier use >=2 distinct **providers**
74
+ (e.g. anthropic + openai), via the council transport (`council_cli.ts`,
75
+ artefact/diff-as-text, read-only). The backed `cross-vendor-parity` signal is
76
+ provider-level; same-vendor model diversity is insufficient for the claim.
77
+
78
+ ## The gate (locked at pre-registration)
79
+
80
+ Encoded in [`src/scripts/_lib/adversarial_council_gate.ts`](../../src/scripts/_lib/adversarial_council_gate.ts)
81
+ (`evaluateCouncilBench`), covered by `adversarial_council_gate.test.ts`:
82
+
83
+ - (a) relative residual-recall lift >= **+25%**, AND
84
+ - (b) absolute residual-recall lift >= **+8 pp**, AND
85
+ - panel FP not worse than single-judge FP within the noise margin.
86
+
87
+ Both recall thresholds are required — the dual gate guards the base-rate
88
+ compression the council flagged (a high single-judge baseline makes relative
89
+ lift easy but absolute must still clear). Threshold values are **locked**;
90
+ corpus/protocol may be refined *before* the registered run, never the threshold
91
+ after seeing results.
92
+
93
+ ## Outcome handling
94
+
95
+ - **Pass** → flip `docs/CLAIMS.md#adversarial-council-finding-coverage` to
96
+ `backed` with the report pointer; document the recommended cross-vendor config.
97
+ - **Honest-null** → record it (ADR-122 addendum + `docs/benchmark.md`), keep the
98
+ surface `off` by default permanently, mark the roadmap null-but-shipped-inert
99
+ (like recursive-verification).
100
+
101
+ ## Status
102
+
103
+ - Gate logic: **built + tested** (deterministic TS).
104
+ - Corpus-validity gate: **assessed — existing corpus fails the subtlety bar.**
105
+ - Registered paid cross-vendor run: **deferred**, blocked on curating a
106
+ judge-survivable-subtlety corpus. Claim remains `unbacked`.
@@ -112,9 +112,18 @@ task tool-validate # Validate tool declarations
112
112
 
113
113
  ```bash
114
114
  task install -- --target <dir> # Run the installer orchestrator on a target
115
- task install-hooks # Install git hooks (pre-commit marketplace lint, pre-push sync check, chat-history bridges)
115
+ task install-hooks # Install git hooks (pre-commit marketplace lint, pre-push consistency gate, chat-history bridges)
116
116
  ```
117
117
 
118
+ The **pre-push hook runs `task consistency`** — the exact local mirror of the CI
119
+ "Sync + Generate Tools Consistency" gate (sync + hashes + generate-tools +
120
+ router + corpus + `git diff --quiet`). Any derived-output drift (counts, dist,
121
+ generated tool trees) is blocked **before** the push instead of failing remote
122
+ CI; the fix is `task consistency-fix`, stage, re-push. The hook auto-installs on
123
+ `npm install` in a git clone (the `prepare` script); run `task install-hooks`
124
+ manually if you skipped install scripts. Bypass a genuine WIP push with
125
+ `git push --no-verify`.
126
+
118
127
  ### Local dev install (no release)
119
128
 
120
129
  Use these tasks to run the working tree as if it were a published
@@ -1,6 +1,6 @@
1
1
  # Featured Skills
2
2
 
3
- A curated subset of the 275 skills. Three tiers, one per primary audience. Full catalog lives in [`dist/agent-src/skills/`](../dist/agent-src/skills/); see also [`docs/catalog.md`](catalog.md) for the complete index and [`docs/featured-commands.md`](featured-commands.md) for command-level highlights.
3
+ A curated subset of the 276 skills. Three tiers, one per primary audience. Full catalog lives in [`dist/agent-src/skills/`](../dist/agent-src/skills/); see also [`docs/catalog.md`](catalog.md) for the complete index and [`docs/featured-commands.md`](featured-commands.md) for command-level highlights.
4
4
 
5
5
  > **Eval-gated messaging note.** Until `task bench --corpus non-dev` reports `selection_accuracy >= 0.60` (see `road-to-product-adoption.md` Phase 1), this page is documentation, not marketing. The entries below are the candidates the corpus tests against; their description quality is what the eval validates.
6
6
 
@@ -92,4 +92,4 @@ task lint-featured-skills
92
92
 
93
93
  CI runs this in `taskfiles/ci-fast.yml`. Stale entries (renamed / removed skill or command) fail the build. See [`scripts/lint_featured_skills.py`](../src/scripts/lint_featured_skills.py) for the matcher.
94
94
 
95
- → Browse all 275 skills: [`dist/agent-src/skills/`](../dist/agent-src/skills/) · all 184 commands: [`dist/agent-src/commands/`](../dist/agent-src/commands/)
95
+ → Browse all 276 skills: [`dist/agent-src/skills/`](../dist/agent-src/skills/) · all 189 commands: [`dist/agent-src/commands/`](../dist/agent-src/commands/)
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Pick the entry that matches what you do day-to-day. Each section names the three skills you will reach for first and shows whether MCP (no terminal) or CLI (terminal) is the simpler install path for that role.
4
4
 
5
- `agent-config` ships 275 skills, 104 governed rules, and 184 commands. You do not need all of them. Each role below filters to the slice that pays back in week one; the rest stays available and shows up on demand when a task references it.
5
+ `agent-config` ships 276 skills, 105 governed rules, and 189 commands. You do not need all of them. Each role below filters to the slice that pays back in week one; the rest stays available and shows up on demand when a task references it.
6
6
 
7
7
  > **Taglines at a glance →** [`docs/role-experiences.md`](role-experiences.md) — the one-line pitch per role experience, in one table.
8
8
 
@@ -134,7 +134,7 @@ Your agent is now:
134
134
  - **Respecting your codebase** — no conflicting patterns
135
135
  - **Following standards** — consistent code quality
136
136
 
137
- This is enforced automatically by 104 rules. No configuration needed.
137
+ This is enforced automatically by 105 rules. No configuration needed.
138
138
 
139
139
  ---
140
140
 
@@ -33,7 +33,7 @@ the host lacks (a static host gives it no runtime attention guarantee, but a
33
33
  runtime-only system gives it nothing at all here). A runtime-only system contributes *nothing* on these hosts.
34
34
 
35
35
  ### 2. Intent routing, not a 500-artefact dump
36
- A prompt does not load all 275 skills. `dist/router.json` (100 routed rules, intent →
36
+ A prompt does not load all 276 skills. `dist/router.json` (101 routed rules, intent →
37
37
  skill, keyword/phrase/path triggers) carries the right skill on intent. The
38
38
  governance value is *selection discipline* — the host gets the relevant rule
39
39
  set, not the whole catalogue as context ballast.
@@ -0,0 +1,109 @@
1
+ # Cross-Source Consistency — Mechanics
2
+
3
+ > The discrepancy taxonomy, the scan procedure, the confidence-tiered noise control, worked examples, and the precedence table for the `cross-source-consistency` rule
4
+
5
+ _Companion to `src/rules/cross-source-consistency.md` (P4 pattern of `road-to-kernel-and-router.md`). The Iron Law, the fire/not-fire scope, and the subordination clauses stay in the rule; this file carries the taxonomy detail, the scan procedure, and the examples._
6
+
7
+ ## The discrepancy taxonomy
8
+
9
+ | # | Class | Definition | Canonical example |
10
+ |---|---|---|---|
11
+ | a | **text ↔ image** | The ticket/spec text contradicts an attached mockup, screenshot, or diagram. | Text: "show birthdays **today**". Mockup: a birthday from two days ago. |
12
+ | b | **silent-but-needed** | The spec is silent on a behavior that is clearly required for the feature to be correct. | Spec: weekend-shifting only. Clearly also needed: public-holiday shifting — but never specified. |
13
+ | c | **spec ↔ codebase/reality** | The spec contradicts what the code, DB, API, or a real source actually does. | Spec: "the endpoint returns `dueDate`". The DTO has no such field. |
14
+ | d | **intra-ticket** | Acceptance criteria, description, and comments contradict each other. | Description: real-time. AC: "nightly batch is fine." |
15
+
16
+ Type (a) and (d) are **contradictions between present sources** — the agent
17
+ must not pick one silently. Type (b) is a **scope decision** — the inferred
18
+ behavior may be right, but adding it is a scope expansion the user owns. Type
19
+ (c) routes the *verification* to `source-discovery` (read the real source); this
20
+ rule only owns *surfacing the conflict and asking*.
21
+
22
+ ## The scan procedure
23
+
24
+ Run this whenever planning, refining, estimating, roadmapping, or implementing
25
+ from a ticket/spec that carries a second source:
26
+
27
+ 1. **Enumerate the sources.** Ticket text, every attachment (mockup / screenshot
28
+ / diagram), the AC block, description, comments, and — for implementation —
29
+ the relevant codebase/DB/API surface. If an attachment cannot be read,
30
+ say so; do not assume it agrees.
31
+ 2. **Compare pairwise for type (a), (c), (d).** For each pair, ask: do they state
32
+ the same thing about the same requirement? A mismatch is a discrepancy.
33
+ 3. **Scan for type (b) — silence.** List the behaviors the feature obviously
34
+ needs but the spec never mentions (weekend/holiday shifts, empty states,
35
+ error paths, permission edges, pagination, timezone). Each unstated-but-needed
36
+ behavior is a candidate to surface — not to implement.
37
+ 4. **Classify confidence.** High = the sources plainly disagree, or the missing
38
+ behavior is clearly load-bearing. Low = the "conflict" is a plausible
39
+ re-reading, or the missing behavior may be intentionally out of scope.
40
+ 5. **Decide per the setting** (below), then **batch** every surviving discrepancy
41
+ into ONE question folded into this turn's single `ask-when-uncertain` prompt.
42
+
43
+ ## Confidence-tiered noise control (`consistency.cross_source`)
44
+
45
+ The rule fires only under a real trade-off (it must pass the
46
+ `no-cheap-questions` Pre-Send Self-Check). The setting tunes how aggressively:
47
+
48
+ | Value | High-confidence discrepancy | Low-confidence discrepancy |
49
+ |---|---|---|
50
+ | `on` (default) | Surface + ask before proceeding. | Surface + ask (batched into the same question). |
51
+ | `auto` | Surface + ask. | State as an explicit assumption and proceed (no question). |
52
+ | `off` | No cross-source checking — legacy behavior. | No cross-source checking. |
53
+
54
+ Batching is the anti-noise mechanism: N discrepancies for one artefact become
55
+ one numbered-options block, never N prompts. Plain vagueness (a single unclear
56
+ source, no second source to compare) is **not** a discrepancy — it stays with
57
+ `ask-when-uncertain` so the two disciplines never double-fire on the same input.
58
+
59
+ ## Worked examples
60
+
61
+ ### Example 1 — text ↔ image (type a)
62
+
63
+ Ticket: *"The tile shows employees who have their birthday **today**."* Attached
64
+ mockup: a card with a birthday dated **two days ago**.
65
+
66
+ - Wrong: implement "today" (or implement "recent, like the mockup") and move on.
67
+ Both are silent guesses on a real contradiction — a violation even if the
68
+ chosen reading turns out correct.
69
+ - Right: *"The ticket text says 'today' but the mockup shows a birthday from two
70
+ days ago. Which is authoritative — (1) strictly today, (2) a recent window as
71
+ the mockup implies, (3) something else?"* Then implement the confirmed reading;
72
+ `design-fidelity` governs building it 1:1 afterwards.
73
+
74
+ ### Example 2 — silent-but-needed (type b)
75
+
76
+ Ticket update: *"If a birthday falls on the weekend, show it on the next
77
+ workday."* The spec never mentions public holidays.
78
+
79
+ - Wrong: also shift birthdays that fall on a public holiday, because it is
80
+ "obviously" consistent with the weekend rule — a silent scope expansion.
81
+ - Right: *"The spec covers weekend-shifting but is silent on public holidays.
82
+ Should birthdays on a public holiday also shift to the next workday? (1) yes,
83
+ same as weekends, (2) no, holidays are out of scope, (3) only regional
84
+ holidays."* Obvious-to-the-agent ≠ in-scope; `scope-control` owns the
85
+ expansion permission.
86
+
87
+ ## Precedence & subordination
88
+
89
+ | Neighbour rule | Relationship |
90
+ |---|---|
91
+ | `ask-when-uncertain` | **Parent ask discipline.** This rule folds its discrepancy into that rule's single question. `ask-when-uncertain` fires on *missing* info; this adds *conflicting present* sources. Never a second question block. |
92
+ | `scope-control` | **Permission authority** for the type-(b) silent-scope-expansion. This rule surfaces the expansion; `scope-control` gates it. |
93
+ | `design-fidelity` | **Fires after** this rule. This rule resolves a text↔image conflict at decision time; `design-fidelity` then enforces build-time 1:1 fidelity to the resolved design. |
94
+ | `source-discovery` / `source-discovery-gate` | **Owns verification** for type (c). This rule surfaces the spec↔code conflict; `source-discovery` provides the evidence procedure. |
95
+ | `no-cheap-questions` | **Floor.** A discrepancy ask must carry a real trade-off; batch, never nag. |
96
+ | `active-remediation` | **Sibling shape.** Its never-silently-ignore ladder is the response model this rule applies to source discrepancies rather than code issues. |
97
+
98
+ ## Failure modes
99
+
100
+ - **Silent-correct-guess.** Picking the right reading of a contradiction without
101
+ asking. Correct output, wrong process — still a violation.
102
+ - **Double-firing.** Emitting a discrepancy question AND a separate
103
+ `ask-when-uncertain` / `improve-before-implement` question about the same
104
+ underlying uncertainty. Fold into one turn's one question.
105
+ - **Noise creep.** Surfacing plausible re-readings as if they were hard
106
+ contradictions. Use the confidence tier; `auto` states low-confidence as an
107
+ assumption instead of asking.
108
+ - **Silent scope expansion.** Implementing an inferred-but-unspecified behavior
109
+ because it seems obvious. It is a scope decision the user owns.
@@ -0,0 +1,181 @@
1
+ # Component-Oriented & Object-Oriented Development
2
+
3
+ > Cross-cutting development standard: **think in reusable units, and — in an
4
+ > object-oriented / class-based codebase — treat object-oriented design as a
5
+ > high-priority default where it reduces complexity.** Split by surface below
6
+ > (frontend / backend), each pointing to the stack-specific carve-outs rather
7
+ > than restating them. Framework-neutral by construction — React / Storybook /
8
+ > Laravel / Symfony specifics live in their own skills, never here.
9
+
10
+ ## Paradigm-appropriate first — detect, then apply
11
+
12
+ **Reuse is universal; OOP is paradigm-scoped.** Detect the codebase's paradigm
13
+ before applying the object-oriented half: class-based / OO code (PHP, Java, C#,
14
+ typical TS/React service layers) → this standard's OOP guidance is the
15
+ high-priority default. A **functional / pipeline / actor-model** codebase
16
+ (Elixir/Phoenix, Clojure, Haskell, Go-idiomatic, heavy FP-in-TS) → apply *that*
17
+ paradigm's principles (immutability, pure functions, pattern-matching,
18
+ composition of functions), and read the OOP bullets as "the same rigor, its
19
+ paradigm's shape." **Never impose classes on functional code to satisfy this
20
+ standard** — consistency with the codebase's chosen paradigm wins over OOP
21
+ advocacy, always.
22
+
23
+ ## The standard, in one breath
24
+
25
+ - **Reuse before you build** (every paradigm). Compose from units that already
26
+ exist — audit first, reuse the design system / shared abstractions, extract a
27
+ new unit only when the same shape repeats.
28
+ - **Object-oriented where it fits** (in an OO codebase). Encapsulation, single
29
+ responsibility, composition over inheritance, and behavior-rich objects are
30
+ the high-priority default *when they reduce complexity* — not a quota to hit,
31
+ and not imposed on a codebase that has chosen a different paradigm.
32
+
33
+ ## The load-bearing caveat — reuse/OOP is a tool, never a mandate to abstract
34
+
35
+ This standard **never** authorizes speculative abstraction. It is bounded by the
36
+ package's restraint posture and defers to it on every conflict:
37
+
38
+ - [`minimal-safe-diff`](../../src/rules/minimal-safe-diff.md) (+ its
39
+ anti-over-engineering mechanics) — smallest change; no premature abstraction,
40
+ no speculative feature, no rewrite for taste.
41
+ - [`senior-engineering-discipline`](../../src/rules/senior-engineering-discipline.md)
42
+ — reuse the *existing* abstraction; generalize, don't overfit; never invent an
43
+ API to look object-oriented.
44
+ - [`improve-before-implement`](../../src/rules/improve-before-implement.md) —
45
+ "does it fit the existing architecture?" before adding structure.
46
+ - **When NOT to use a pattern** ([`php/patterns.md`](php/patterns.md) §) — KISS &
47
+ YAGNI trump pattern purity: no interface for a single implementation, no
48
+ pattern for a five-line function, no class where a function is clearer.
49
+
50
+ Rule of thumb: **two real repetitions (or a genuine second axis of change)
51
+ before you extract.** One occurrence is not a component; one branch is not a
52
+ Strategy. A reviewer should be able to name the concrete duplication or the
53
+ concrete change-axis the abstraction removes.
54
+
55
+ **Precedence (explicit): `minimal-safe-diff` / YAGNI always trump OOP
56
+ advocacy.** When "prefer OO shape" and "smallest change" conflict, the smallest
57
+ change wins — this standard adds a *consideration*, never a competing objective
58
+ that pressures preemptive abstraction. The review lens (below) may flag OO shape
59
+ only where the duplication or the growing branch is **already present in the
60
+ diff**, never as "this could grow later."
61
+
62
+ ## Frontend — think in reusable components
63
+
64
+ Component-first is the default mindset, not an afterthought: decompose a screen
65
+ into composable units, reuse the project's primitives, and extract shared shells
66
+ when they repeat. Depth and mechanics already live in dedicated skills — consult
67
+ them, don't duplicate:
68
+
69
+ - [`fe-design`](../../src/skills/fe-design/SKILL.md) § Component Architecture —
70
+ the stack-agnostic "kind, not framework" taxonomy, granularity, extract-on-3+.
71
+ - [`ui-component-architect`](../../src/skills/ui-component-architect/SKILL.md) —
72
+ how to *shape* a reusable component: composition over inheritance, slot
73
+ contracts, prop-API caps, controlled/uncontrolled, the componentization
74
+ threshold (repeat **and** real state).
75
+ - [`existing-ui-audit`](../../src/skills/existing-ui-audit/SKILL.md) — the
76
+ reuse-before-invent gate: inventory existing components/tokens/primitives
77
+ first (enforced by [`ui-audit-gate`](../../src/rules/ui-audit-gate.md)).
78
+ - [`design-tokens`](../../src/skills/design-tokens/SKILL.md) /
79
+ [`design-system-capture`](../../src/skills/design-system-capture/SKILL.md) —
80
+ the shared token/design-system layer components draw from.
81
+
82
+ **Component workshop (Storybook et al.) — when the project is large enough.**
83
+ For a project with a real, growing shared-component library, isolating and
84
+ documenting each reusable component in a component workshop (Storybook or the
85
+ ecosystem equivalent) pays for itself — it makes components discoverable,
86
+ reviewable in isolation, and reused instead of re-invented. It is **not** worth
87
+ the setup for a small surface with a handful of one-off components. The
88
+ framework-specific setup is a carve-out, not a generic mandate — React /
89
+ Storybook specifics: [`react-shadcn-ui`](../../src/skills/react-shadcn-ui/SKILL.md)
90
+ § Component workshop.
91
+
92
+ Framework carve-outs (never restated here): React →
93
+ [`react-shadcn-ui`](../../src/skills/react-shadcn-ui/SKILL.md); Next.js
94
+ server/client component boundary →
95
+ [`nextjs-patterns`](../../src/skills/nextjs-patterns/SKILL.md); Laravel FE →
96
+ [`blade-ui`](../../src/skills/blade-ui/SKILL.md) /
97
+ [`livewire`](../../src/skills/livewire/SKILL.md) /
98
+ [`flux`](../../src/skills/flux/SKILL.md); styling →
99
+ [`tailwind-engineer`](../../src/skills/tailwind-engineer/SKILL.md).
100
+
101
+ ## Backend — object-oriented where it reduces complexity
102
+
103
+ The structural half — thin handlers, business logic in services / use-cases,
104
+ behavior-rich domain models, validation at the boundary — is owned by
105
+ [`architecture`](../../src/rules/architecture.md) and holds across paradigms. In
106
+ an **object-oriented / class-based** service layer, layer the OO principles below
107
+ on top of it, each applied only where it earns its place. In a **functional /
108
+ pipeline** codebase, apply that paradigm's equivalent (pure functions +
109
+ composition instead of behavior-rich objects; a dispatch map / pattern-match
110
+ instead of a Strategy class) — the goal (encapsulate change, one responsibility,
111
+ compose don't duplicate) is paradigm-independent; only its *shape* is OO here:
112
+
113
+ - **Encapsulation** — objects own their data + the behavior over it; no anemic
114
+ bags mutated from the outside.
115
+ - **Single responsibility** — one class, one reason to change; no god services.
116
+ - **Composition over inheritance** — inject collaborators; reach for a base
117
+ class only for genuine is-a substitutability, not code sharing.
118
+ - **Behavior-rich domain objects** — push rules into the model, keep services
119
+ orchestration-thin.
120
+ - **Patterns where they earn their place** — a Strategy when a branch on a
121
+ discriminator will grow (`if-else` chain → polymorphism); a Factory when
122
+ construction is non-trivial; DI on an abstraction when there is a *real*
123
+ second implementation. Not before.
124
+
125
+ Language / framework carve-outs (never restated here): PHP →
126
+ [`php-coding-patterns`](php/php-coding-patterns.md) +
127
+ [`patterns.md`](php/patterns.md) (+ `patterns/strategy.md`,
128
+ `patterns/dependency-injection.md`, `patterns/factory.md`, `patterns/service-layer.md`)
129
+ + skills [`php-coder`](../../src/skills/php-coder/SKILL.md) /
130
+ [`php-service`](../../src/skills/php-service/SKILL.md); Laravel →
131
+ [`laravel`](../../src/skills/laravel/SKILL.md); Symfony →
132
+ [`symfony-workflow`](../../src/skills/symfony-workflow/SKILL.md); Next.js / TS →
133
+ [`nextjs-patterns`](../../src/skills/nextjs-patterns/SKILL.md); cross-language
134
+ clean-code baseline → [`code-clarity`](code-clarity.md).
135
+
136
+ ## Enums over scattered literals
137
+
138
+ A field with two or more non-boolean states is an enum, not a bare string /
139
+ magic number — the small OO move that keeps a codebase greppable and safe to
140
+ change. Full rule + the defer-and-ask flow for pre-existing literals:
141
+ [`prefer-enums-over-literals`](../../src/rules/prefer-enums-over-literals.md).
142
+
143
+ ## How this is reviewed
144
+
145
+ "Reuse existing components + object-oriented shape (where it reduces
146
+ complexity)" is a check on the code-quality review lens
147
+ ([`judge-code-quality`](../../src/skills/judge-code-quality/SKILL.md)), so it
148
+ reaches `/review-changes`, `/judge`, the subagent judge modes, and team-mode's
149
+ fallback review frame. It fires **only where the duplication or the growing
150
+ branch is already present in the diff** — never "this could grow later" — and
151
+ in the **codebase's own paradigm** (it will not tell a functional service to
152
+ grow a class). It stays a human-judgment call that defers to the codebase's own
153
+ conventions — never a generic SOLID dogma imposed over a project that has chosen
154
+ differently.
155
+
156
+ ## Council review (2026-07-15)
157
+
158
+ Deep debate, 3 rounds, cross-vendor (`anthropic/claude-sonnet-4-5` +
159
+ `openai/gpt-4o`), $0.16. Split verdict; the load-bearing (anthropic) critique —
160
+ that an "OOP-supreme default" over-indexes on OOP for a multi-paradigm consumer
161
+ base and can conflict with `minimal-safe-diff` — was applied, bounded by this
162
+ standard's stated purpose (OOP *is* a deliberate high priority for the operator):
163
+
164
+ - **Paradigm-appropriate framing** — OOP is the high-priority default *within an
165
+ OO / class-based codebase*; detect and defer to a functional / pipeline /
166
+ actor paradigm; never impose classes on functional code (§ Paradigm-appropriate).
167
+ - **Explicit precedence** — `minimal-safe-diff` / YAGNI win on conflict; the
168
+ review lens flags only *already-present* duplication / complexity, never
169
+ preemptive (§ caveat, § How this is reviewed).
170
+
171
+ Divergence held: the frontend section stays (an intentional FE / backend
172
+ entry-point + carve-out index, per the operator's explicit "split by FE /
173
+ backend" ask) — against the anthropic "delete as redundant"; it is a cohesive
174
+ index of the existing FE surfaces, not a claim of novel guidance. Trace:
175
+ `agents/runtime/council/responses/component-oop-standard.json/` (gitignored, local-only).
176
+
177
+ ## See also
178
+
179
+ - [`architecture`](../../src/rules/architecture.md) — the structural home this layers onto.
180
+ - [`code-clarity`](code-clarity.md) — the cross-language clean-code baseline.
181
+ - [`minimal-safe-diff`](../../src/rules/minimal-safe-diff.md) · [`senior-engineering-discipline`](../../src/rules/senior-engineering-discipline.md) — the restraint anchors this standard is bounded by.
package/docs/proof.md CHANGED
@@ -27,7 +27,7 @@ evidence pointer, or `task check-claims` fails the build.
27
27
  | Claim | Kind | Evidence | Resolves |
28
28
  |---|---|---|---|
29
29
  | The release process is documented as an inheritable runbook + succession doc, and the project's bus-factor (trailing-90-day distinct human reviewers) is tracked and reported truthfully — currently 1, not implied to be more. | qual | `docs/succession.md#trailing 90 days` | ✅ |
30
- | 184 commands. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
30
+ | 189 commands. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
31
31
  | A MEASURED-BUT-NOT-SHIPPED experiment — the thin rule projection reduced eager rule load 78,513 → 13,881 GPT-tokens (whole always-loaded projection 98,529 → 33,897, ~65.6%), but FAILED the quality gate (thin win-rate 36.2% vs required 48%) and does not ship; it un-defers only behind `discipline_profile: essential`. Shipped behavior does NOT include this reduction. Method: `agent-config benchmark` over the pinned token baseline; the baseline is the honest "what the user pays if everything loads eagerly", NOT a synthetic full-corpus strawman (council Q4); quality gate per the Phase-0 paired judge run. | quant | `internal/bench/reports/token-baseline.json#eager_rule_load` | ✅ |
32
32
  | The first cross-vendor parity pass (5 orchestration-corpus tasks × 2 vendors × 3 repeats, identical prompts via the council transport, $0.16) measured real per-host finding-count differences — claude-sonnet-4-5 surfaced ~2× the findings of gpt-4o on the multi-file analysis task (median 11 vs 5) while both vendors were identical on the planted hollow-implementation task (2 vs 2) and perfectly silent on the clean-code negative control (0 vs 0, no spurious findings). The per-task `finding_floor` values are calibrated from the cross-host lower envelope and the gate is armed. | quant | `internal/bench/reports/parity-count.json#min over hosts of median` | ✅ |
33
33
  | On a weak host (claude-haiku-4-5) the package produces a significant, placebo-controlled discipline lift on scope/downstream traps; on a strong host the same measurement is a published null — the package transplants discipline a weak model lacks, not model intelligence. | quant | `docs/benchmark.md#weak-host-specific` | ✅ |
@@ -41,11 +41,11 @@ evidence pointer, or `task check-claims` fails the build.
41
41
  | The whole layer is compiled into host agents with zero runtime daemon. | qual | `docs/contracts/no-runtime-boundary.md#file-first, no-runtime suite` | ✅ |
42
42
  | On a 12-fixture option-decision corpus (3 arms × 2 providers, blind rubric judge claude-opus-4-8, pre-registered hypotheses), famous-figure identity framing added nothing beyond the underlying method text (method 5.04 vs figure 4.88, Δ=0.17, sign-test p=0.607), and provider diversity moved judged quality ~15× more than persona identity (provider Δ=2.58 vs identity Δ=0.17); the whole persona layer lifted only +0.08 over bare prompts. Honest null — persona panel-mode stays CUT, evidence-closed. | quant | `internal/bench/reports/persona-placebo.json#honest-null` | ✅ |
43
43
  | On the live end-to-end retrieval benchmark (9 tasks × 3 arms × 3 seeds on claude-haiku, fixture store with keyword-overlapping confusers), the memory retrieval substrate scored precision@5 = 100% (9/9) with 100% poisoned-entry rejection, and the retrieval-on arm passed 27/27 model-scored tasks vs 2/27 with retrieval off and 4/27 with a placebo injection. Known limit stays published: mean tie-set 4.1 means top-k ties break by store order, not relevance (the ADR-116/FTS5 signal). | quant | `internal/bench/reports/second-brain-retrieval.json#retrieval-on` | ✅ |
44
- | 104 governed rules. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
44
+ | 105 governed rules. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
45
45
  | On a deterministic multi-session recall corpus, the memory substrate produces a measured, placebo-controlled recall lift — memory-on 27/27 vs no-memory 10/27 and vs equal-byte placebo 9/27 (claude-haiku-4-5, n=9 tasks x 3 seeds, sign test p=0.031 for BOTH pairings). Scoped honestly: this is the context-value upper bound (perfect retrieval on a one-fact-per-task corpus), not retrieval precision under a large store. | quant | `internal/bench/reports/second-brain-delta.json` | ✅ |
46
46
  | Removing the perfect-retrieval assumption, the substrate's REAL keyword retrieval recalls the needed decision into the top-5 under keyword-overlapping confusers (precision@5 9/9) and the model disambiguates it from the co-injected confusers — retrieval-on 27/27 vs no-memory 5/27 and vs equal-count placebo 5/27 (claude-haiku-4-5, 9 tasks x 3 seeds, sign test p=0.008 both). Named limit: retrieval RECALLS but does not RANK (mean tie-set 3.3, ties broken by store order, not relevance) — the discrimination gap that motivates the SQLite-FTS5 activation path (ADR-116) at larger scale. | quant | `internal/bench/reports/second-brain-retrieval.json` | ✅ |
47
47
  | Every artifact the package ships — source AND the condensed projection that reaches consumers — is machine-scanned in CI for hidden-Unicode, mixed-script-confusable, and instruction-smuggling payloads (the rules-file-backdoor class); a finding blocks the release before `npm publish`, not just the merge. | qual | `.github/workflows/publish-npm.yml#lint_agent_security` | ✅ |
48
- | 275 skills. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
48
+ | 276 skills. | quant | `src/scripts/check_artefact_count_messaging.ts#Artefact-count messaging gate` | ✅ |
49
49
  | Removes only its own keys from a shared host config (matched by JSON-pointer + SHA-256), never a neighbour tool's entries. | qual | `docs/contracts/install-layout.md#JSON-pointer` | ✅ |
50
50
 
51
51
  **21 backed claim(s)** — all evidence pointers resolve in CI.
@@ -56,7 +56,7 @@ guidelines, personas) are **generated from source and CI-drift-checked**:
56
56
  fails the build on any count-shaped prose mention that drifts from the
57
57
  source count — or on two different numbers for the same artefact kind.
58
58
 
59
- We also publish our **debt**: 4 claim(s) are logged as
59
+ We also publish our **debt**: 5 claim(s) are logged as
60
60
  `unbacked` inventory in the ledger — not yet bound, and therefore not
61
61
  allowed to carry a marker in public prose. Hiding them would be the
62
62
  opposite of the point.
@@ -77,11 +77,11 @@ shipping theater; the full per-cell data is committed at
77
77
  `internal/bench/reports/persona-placebo.json`.
78
78
 
79
79
  **Behavioural-eval coverage — the honest baseline.** Skill *quality* is only
80
- as good as its measurement. Today **42 of 275** skills carry a behavioural
80
+ as good as its measurement. Today **42 of 276** skills carry a behavioural
81
81
  `evals.json`; the highest-traffic / highest-cost tiers (default-surface +
82
82
  `rich` + routers) are **fully covered (35 of 35)**, the long tail
83
- (7 of 240) is not. We publish that gap rather than imply
84
- "275 evaluated skills": coverage is measured per tier
83
+ (7 of 241) is not. We publish that gap rather than imply
84
+ "276 evaluated skills": coverage is measured per tier
85
85
  (`./scripts-run src/scripts/skill_eval_coverage`), **CI-ratcheted so it can
86
86
  only rise**, and the priority tiers carry a hard **tier floor**: every
87
87
  rich / default-surface / router skill MUST have a behavioural eval or an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event4u/agent-config",
3
- "version": "9.1.0",
3
+ "version": "9.3.0",
4
4
  "description": "Universal AI Agent OS — audited skills, governance rules, commands, and templates for AI coding tools (Claude Code, Cursor, Windsurf, Copilot).",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -70,7 +70,8 @@
70
70
  "lint:ts": "eslint 'src/**/*.ts'",
71
71
  "test:ts": "vitest run",
72
72
  "prepack": "npm run build && npm run build:discovery && npm run build:mcp-manifest && node src/scripts/prepack-check.mjs",
73
- "prepublishOnly": "./scripts-run src/scripts/check_release_includes_discovery"
73
+ "prepublishOnly": "./scripts-run src/scripts/check_release_includes_discovery",
74
+ "prepare": "[ -d .git ] && bash src/scripts/install-hooks.sh || true"
74
75
  },
75
76
  "publishConfig": {
76
77
  "access": "public",
@@ -518,6 +518,34 @@ design:
518
518
  # autonomy setting, roadmap, or standing instruction lifts it).
519
519
  fidelity_mode: strict
520
520
 
521
+ # --- Cross-source consistency ---
522
+ #
523
+ # When the agent plans, refines, roadmaps, or implements from multiple
524
+ # sources — ticket text, an attached image / mockup / screenshot, the spec,
525
+ # the codebase — it actively checks them AGAINST each other and STOPS to ask
526
+ # before proceeding on a detected discrepancy, instead of silently guessing
527
+ # (even a correct guess). Consumed by the `cross-source-consistency` rule.
528
+ # Catches: (a) ticket text vs an attached image/mockup, (b) a spec silent on
529
+ # a clearly-needed behavior (weekend/holiday shifting, empty/error states),
530
+ # (c) spec vs the codebase, (d) intra-ticket contradiction (AC vs description).
531
+ #
532
+ # The discipline is deliberately subordinate to `ask-when-uncertain` (it folds
533
+ # a detected discrepancy into the same turn's single question — never a second
534
+ # prompt) and defers to `scope-control` for the permission to expand scope.
535
+ consistency:
536
+ # on | auto | off (default: on)
537
+ #
538
+ # on = default. Detect discrepancies across sources and surface ONE
539
+ # numbered-options question before proceeding. A silent guess on a
540
+ # real contradiction is a rule violation, even when the guess is
541
+ # correct. An inferred-but-unspecified behavior is a scope expansion:
542
+ # ask before implementing it.
543
+ # auto = detect + surface only HIGH-confidence contradictions; low-confidence
544
+ # ones are stated as an assumption and proceed (noise control).
545
+ # off = no cross-source checking (legacy: the agent may proceed on its own
546
+ # reading of whichever source it happened to read).
547
+ cross_source: "on"
548
+
521
549
  code_style:
522
550
  # minimal | full (default: minimal)
523
551
  #
@@ -604,6 +632,20 @@ subagents:
604
632
  # Integer, default 3. Set to 1 to serialize. Hard cap enforced by runtime.
605
633
  max_parallel: 3
606
634
 
635
+ # Opt-in adversarial-verification-council (subagent-orchestration Mode 9,
636
+ # ADR-122): off | ask | on
637
+ #
638
+ # off (default) = never runs. ask = offer it on an explicit high-risk change.
639
+ # on = auto-run on high-risk changes (security, tenant, migration, public API).
640
+ #
641
+ # A panel of distinct-model skeptics red-teams a real, already-verified change
642
+ # for defect FINDING coverage (not a go/no-go decision) and returns an advisory
643
+ # findings-by-severity verdict. ADVISORY ONLY — it NEVER auto-gates the change
644
+ # (Hard Floor). The registered claim + high-risk tier use cross-vendor skeptics.
645
+ # Stays default-off until the adversarial-council-finding-coverage claim is
646
+ # backed by the two-stage residual-detection benchmark (prove-or-drop).
647
+ adversarial_council: off
648
+
607
649
  # --- Git worktrees ---
608
650
  #
609
651
  # Controls how the `using-git-worktrees` skill and `subagent-orchestration`