@event4u/agent-config 9.0.0 → 9.2.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 (93) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +22 -204
  3. package/MIGRATION.md +14 -0
  4. package/README.md +2 -2
  5. package/dist/agent-src/commands/explain-run.md +88 -0
  6. package/dist/agent-src/commands/implement-ticket.md +2 -0
  7. package/dist/agent-src/commands/pr/create/description-only.md +138 -8
  8. package/dist/agent-src/commands/pr/create.md +16 -5
  9. package/dist/agent-src/commands/review/changes.md +22 -0
  10. package/dist/agent-src/contexts/execution/subagent-modes-detail.md +41 -6
  11. package/dist/agent-src/contexts/execution/verify-budget.md +15 -0
  12. package/dist/agent-src/rules/cross-source-consistency.md +92 -0
  13. package/dist/agent-src/rules/delegation-policy.md +1 -1
  14. package/dist/agent-src/skills/estimate-ticket/SKILL.md +2 -0
  15. package/dist/agent-src/skills/feature-planning/SKILL.md +1 -1
  16. package/dist/agent-src/skills/llm-provider-knowledge/SKILL.md +146 -0
  17. package/dist/agent-src/skills/llm-provider-knowledge/evals/triggers.json +20 -0
  18. package/dist/agent-src/skills/po-discovery/SKILL.md +2 -0
  19. package/dist/agent-src/skills/refine-ticket/SKILL.md +7 -0
  20. package/dist/agent-src/skills/roadmap-writing/SKILL.md +14 -0
  21. package/dist/agent-src/skills/subagent-orchestration/SKILL.md +26 -5
  22. package/dist/agent-src/skills/subagent-orchestration/evals/evals.json +18 -0
  23. package/dist/agent-src/skills/subagent-orchestration/prompts/README.md +14 -2
  24. package/dist/agent-src/skills/subagent-orchestration/prompts/adversarial-verification-council.md +79 -0
  25. package/dist/agent-src/skills/subagent-orchestration/schemas/adversarial-findings.json +56 -0
  26. package/dist/agent-src/skills/token-optimizer/SKILL.md +10 -4
  27. package/dist/agent-src/templates/agent-settings.md +28 -0
  28. package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  29. package/dist/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +4 -1
  30. package/dist/discovery/deprecation-report.md +1 -1
  31. package/dist/discovery/discovery-manifest.json +105 -28
  32. package/dist/discovery/discovery-manifest.json.sha256 +1 -1
  33. package/dist/discovery/discovery-manifest.summary.md +5 -5
  34. package/dist/discovery/orphan-report.md +1 -1
  35. package/dist/discovery/packs.json +16 -12
  36. package/dist/discovery/trust-report.md +8 -8
  37. package/dist/discovery/workspaces.json +12 -8
  38. package/dist/install/install.mjs +47 -31
  39. package/dist/mcp/registry-manifest.json +3 -3
  40. package/dist/router.json +1 -1
  41. package/dist/scripts/_lib/agent_settings.js +4 -1
  42. package/dist/scripts/_lib/agent_settings.js.map +1 -1
  43. package/dist/server/schemas/settings.js +10 -0
  44. package/dist/server/schemas/settings.js.map +1 -1
  45. package/docs/CLAIMS.md +10 -3
  46. package/docs/MIGRATION.md +20 -0
  47. package/docs/architecture.md +4 -4
  48. package/docs/archive/CHANGELOG-pre-9.2.0.md +276 -0
  49. package/docs/benchmark.md +24 -0
  50. package/docs/command-flows.md +1 -1
  51. package/docs/contracts/agents-layout.md +1 -1
  52. package/docs/contracts/consumer-bridge.md +55 -63
  53. package/docs/contracts/install-layout.md +1 -1
  54. package/docs/contracts/migrate-command.md +1 -1
  55. package/docs/customization.md +22 -1
  56. package/docs/decisions/ADR-020-global-only-consumer-scope.md +34 -0
  57. package/docs/decisions/ADR-122-adversarial-verification-council.md +136 -0
  58. package/docs/decisions/INDEX.md +1 -0
  59. package/docs/design/adversarial-council-eval.md +106 -0
  60. package/docs/featured-skills.md +2 -2
  61. package/docs/getting-started-by-role.md +1 -1
  62. package/docs/getting-started.md +2 -2
  63. package/docs/governance-advantage.md +1 -1
  64. package/docs/guidelines/agent-infra/api-cost-levers.md +126 -0
  65. package/docs/guidelines/agent-infra/cross-source-consistency-mechanics.md +109 -0
  66. package/docs/installation.md +2 -1
  67. package/docs/maintainers/dev-mode.md +3 -2
  68. package/docs/proof.md +7 -7
  69. package/package.json +1 -1
  70. package/src/agent-src/templates/scripts/work_engine/_lib/agent_settings.ts +4 -1
  71. package/src/config/agent-settings.template.yml +81 -0
  72. package/src/config/gitignore-block.txt +16 -6
  73. package/src/scripts/_cli/cmd_conformance.ts +2 -2
  74. package/src/scripts/_cli/cmd_doctor.ts +162 -13
  75. package/src/scripts/_cli/cmd_refresh.ts +35 -118
  76. package/src/scripts/_lib/adversarial_council_gate.test.ts +112 -0
  77. package/src/scripts/_lib/adversarial_council_gate.ts +98 -0
  78. package/src/scripts/_lib/adversarial_reconcile.test.ts +197 -0
  79. package/src/scripts/_lib/adversarial_reconcile.ts +187 -0
  80. package/src/scripts/_lib/agent_settings.ts +4 -1
  81. package/src/scripts/_lib/verify_budget.ts +4 -1
  82. package/src/scripts/ai_council/clients.ts +68 -6
  83. package/src/scripts/ai_council/pricing.ts +62 -0
  84. package/src/scripts/council_cli.ts +19 -3
  85. package/src/scripts/install.ts +44 -45
  86. package/src/scripts/lint_agents_layout.ts +10 -4
  87. package/src/scripts/lint_breaking_changes_index.ts +303 -0
  88. package/src/scripts/mcp_server/tools.ts +1 -3
  89. package/src/scripts/schemas/agent-settings.schema.json +28 -0
  90. package/src/scripts/self_review_gate.test.ts +11 -0
  91. package/src/scripts/self_review_gate.ts +7 -1
  92. package/src/scripts/skill_eval_coverage.ts +4 -1
  93. package/src/server/schemas/settings.ts +24 -0
@@ -140,6 +140,12 @@ completion is read from the checkbox counts.
140
140
  Run `/create-pr:description-only` Steps 1–4 to generate the PR title and body.
141
141
  This handles: Jira ticket extraction, diff analysis, commit messages, **PR template filling**.
142
142
 
143
+ The generation honors the cached content flags from step 1 (§4e):
144
+ `detail_level` sets the Description tier (default `min`), `api_examples`
145
+ adds a grounded JSON block for API-endpoint changes, and `screenshots`
146
+ (capability-gated) adds frontend screenshots. Critical-info callouts
147
+ (breaking changes / migrations / security / rollback) appear at every tier.
148
+
143
149
  **CRITICAL**: The PR body MUST use the project's PR template (`.github/pull_request_template.md`).
144
150
  Read the template file and fill in its sections. If the template does not exist, use the
145
151
  fallback structure defined in `/create-pr:description-only`. NEVER invent a custom body structure.
@@ -316,11 +322,16 @@ an actual Jira API call succeeded** — never announce "skipped".
316
322
 
317
323
  #### 4e. Settings short-circuit — single read per run
318
324
 
319
- `verbosity.routine_confirmations`, `verbosity.post_action_reports`, and
320
- `commands.create_pr.preview_description` are read **once** at the top
321
- of the run and cached for the whole `/create-pr` invocation. Do **not**
322
- re-read `.agent-settings.yml` in 4b / 4d — both branches resolve from
323
- the cached values from step 1.
325
+ `verbosity.routine_confirmations`, `verbosity.post_action_reports`,
326
+ `commands.create_pr.preview_description`, `commands.create_pr.detail_level`,
327
+ `commands.create_pr.api_examples`, `commands.create_pr.screenshots`,
328
+ `commands.create_pr.ui_paths`, and `commands.create_pr.api_paths` are read
329
+ **once** at the top of the run and cached for the whole `/create-pr`
330
+ invocation. Do **not** re-read `.agent-settings.yml` in Step 2 or 4b / 4d —
331
+ every branch resolves from the cached values from step 1. The content flags
332
+ (`detail_level`, `api_examples`, `screenshots`, `ui_paths`, `api_paths`) are
333
+ consumed by the `/create-pr:description-only` generation step (Step 2); the
334
+ confirmation/report flags by steps 3–4.
324
335
 
325
336
  When all three resolve to their silent defaults (`false` / `minimal` /
326
337
  `false`), steps 4b + 4d collapse to the single `→ #N opened: <url>` line
@@ -130,6 +130,28 @@ If picked **1**:
130
130
 
131
131
  If picked **2** → continue with internal judges only.
132
132
 
133
+ ### 4c. Optional adversarial verification council (opt-in, high-risk)
134
+
135
+ Read `subagents.adversarial_council` from `.agent-settings.yml` (default
136
+ `off`):
137
+
138
+ - `off` (default): skip silently.
139
+ - `ask`: when the diff is explicitly high-risk (security, tenant, migration,
140
+ public API), offer it (in the user's language):
141
+
142
+ > 1. Run the adversarial verification council on this high-risk diff? (distinct-model skeptics red-team for finding coverage)
143
+ > 2. Skip — the five internal judges are enough
144
+
145
+ - `on`: run it automatically on a high-risk diff.
146
+
147
+ When run, dispatch the
148
+ [`adversarial-verification-council`](../../skills/subagent-orchestration/SKILL.md)
149
+ mode (Mode 9): distinct-model skeptics red-team the diff for defect FINDING
150
+ coverage; the reconciled findings-by-severity envelope is folded into step 5 as
151
+ an **advisory** input, clearly marked. Like the external council it **never
152
+ auto-gates** — a human decides what is actionable. This is defect coverage, not
153
+ a go/no-go verdict.
154
+
133
155
  ### 5. Consolidate
134
156
 
135
157
  Consolidate via [`judge-synthesis`](../../skills/judge-synthesis/SKILL.md) — the
@@ -1,10 +1,11 @@
1
- # Subagent Modes — worktree + live-app-judge detail
1
+ # Subagent Modes — worktree + live-app-judge + adversarial-council detail
2
2
 
3
- Extended detail for the two heaviest [`subagent-orchestration`](../../skills/subagent-orchestration/SKILL.md)
4
- modes — `do-in-worktrees` (mode 7) and `do-with-live-app-judge` (mode 8).
5
- Split out of the skill body to keep it under the size budget; the mode list,
6
- selection rules, and the six common modes stay inline in the skill. Pull this
7
- when you actually dispatch one of these two modes.
3
+ Extended detail for the heaviest [`subagent-orchestration`](../../skills/subagent-orchestration/SKILL.md)
4
+ modes — `do-in-worktrees` (mode 7), `do-with-live-app-judge` (mode 8), and
5
+ `adversarial-verification-council` (mode 9). Split out of the skill body to keep
6
+ it under the size budget; the mode list, selection rules, and the six common
7
+ modes stay inline in the skill. Pull this when you actually dispatch one of these
8
+ modes.
8
9
 
9
10
  ## Mode 7 — do-in-worktrees
10
11
 
@@ -82,3 +83,37 @@ Rules:
82
83
  mechanism for this mode's judge once dependable screenshot tooling lands.
83
84
  Recorded from road-to-opt-design-polish; gate it behind the same
84
85
  `verdict_changed_outcome` adoption evidence above.
86
+
87
+ ## Mode 9 — adversarial-verification-council (gated — opt-in, advisory)
88
+
89
+ A panel of N (default 2) **distinct-model** skeptics red-teams a real,
90
+ already-verified change through the `judge-*` lenses. Each skeptic is prompted to
91
+ *break* the change, returns a structured findings array (+ optional refutations),
92
+ and the returns are reconciled by
93
+ [`_lib/adversarial_reconcile.ts`](../../../scripts/_lib/adversarial_reconcile.ts)
94
+ into one [`adversarial-findings.json`](../../../skills/subagent-orchestration/schemas/adversarial-findings.json)
95
+ envelope. Scope: defect **finding coverage**, not a go/no-go decision (that is
96
+ mode 6). Full contract: ADR-122; skeptic prompt:
97
+ [`prompts/adversarial-verification-council.md`](../../../skills/subagent-orchestration/prompts/adversarial-verification-council.md).
98
+
99
+ | When to use | When not | Model pairing |
100
+ |---|---|---|
101
+ | High-risk change (security, tenant, migration, public API) where finding coverage matters, opted-in | Default flow, routine change, `subagents.adversarial_council: off`, or a plain go/no-go (use mode 6) | skeptics = ≥2 distinct models; cross-*vendor* for the registered claim + high-risk tier; cross-model Iron Law across all |
102
+
103
+ Invariants:
104
+
105
+ - **Advisory only — never auto-gates the change (Hard Floor).** The reconciler
106
+ ranks and annotates findings; a human decides what is actionable.
107
+ - **Default-off.** `subagents.adversarial_council` (`off|ask|on`, default `off`).
108
+ Fires only on an explicit high-risk change under an opted-in setting.
109
+ - **Cross-model Iron Law** across all skeptics; the registered finding-coverage
110
+ claim and the high-risk tier require cross-*vendor* skeptics (the backed
111
+ `cross-vendor-parity` signal is provider-level).
112
+ - **Reconciliation is deterministic TS with tests** — dedup, severity-quorum
113
+ confidence, false-positive suppression (demote, never drop). Never
114
+ LLM-computed prose (ADR-122 anti-lesson).
115
+ - **N cap** from the verify budget; no daemon / no persistent runtime; each
116
+ skeptic return uses the `subagent-status.json` envelope before reconciliation.
117
+ - **Prove-or-drop.** The mode stays default-off until the
118
+ `adversarial-council-finding-coverage` claim is `backed` by the two-stage
119
+ residual-detection benchmark (roadmap Phase 4); honest-null keeps it inert.
@@ -30,6 +30,20 @@ verification recorded as `none`, or a non-trivial change verified only
30
30
  deterministically, is a **gap** that is surfaced to the user — it never passes
31
31
  silently. This is the audit-visible enforcement of the Iron Law.
32
32
 
33
+ ## Opt-in escalation — adversarial verification council (default-off)
34
+
35
+ For an explicitly high-risk change (security, tenant, migration, public API)
36
+ AND `subagents.adversarial_council != off`, the verify step MAY escalate from a
37
+ single cross-model judge to the **adversarial-verification-council** panel
38
+ (subagent-orchestration Mode 9, ADR-122) — recorded as `verify_mode: council`.
39
+
40
+ This escalation is **strictly opt-in and advisory**: it never fires when the
41
+ setting is `off` (the default), and the panel finds defects but **never
42
+ auto-gates the change** (Hard Floor). It replaces neither the deterministic
43
+ floor nor the standard judge — it adds finding-coverage on top for changes where
44
+ a single judge is too easy to fool. Stays default-off until the
45
+ `adversarial-council-finding-coverage` claim is `backed` (prove-or-drop).
46
+
33
47
  ## Why this does not weaken the floor
34
48
 
35
49
  `deterministic` is still verification — a real diff + dry-run + structural
@@ -48,3 +62,4 @@ small to carry risk, where the deterministic check is sufficient evidence.
48
62
  - [`verify-before-complete`](../../rules/verify-before-complete.md) — the Iron Law this preserves.
49
63
  - [`subagent-orchestration`](../../skills/subagent-orchestration/SKILL.md) — the cross-model judge law.
50
64
  - [`orchestration-telemetry`](orchestration-telemetry.md) — where `verify_mode` is recorded.
65
+ - [`subagent-response-contract`](subagent-response-contract.md) — a low-confidence mutating finding forces the full judge path (`forcesJudge`).
@@ -0,0 +1,92 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "Two sources disagree (ticket text vs mockup, spec silent on a needed behavior, spec vs code) → surface + ask before proceeding, never silently guess"
5
+ triggers:
6
+ - keyword: "ticket"
7
+ - keyword: "refine"
8
+ - keyword: "acceptance criteria"
9
+ - keyword: "AC"
10
+ - keyword: "mockup"
11
+ - keyword: "screenshot"
12
+ - keyword: "attachment"
13
+ - keyword: "roadmap"
14
+ - keyword: "estimate"
15
+ - phrase: "plan this ticket"
16
+ - phrase: "refine this ticket"
17
+ - phrase: "is this ticket clear"
18
+ - phrase: "implement the ticket"
19
+ applies_to_user_types:
20
+ - "developer"
21
+ - "founder"
22
+ - "consultant"
23
+ routes_to:
24
+ - "guideline:agent-infra/cross-source-consistency-mechanics"
25
+ workspaces: [engineering, product]
26
+ packs: [engineering-base, product-basic]
27
+ ---
28
+
29
+ # Cross-Source Consistency
30
+
31
+ When the agent works from **more than one source** — ticket text, an attached
32
+ image / mockup / screenshot, the spec, the codebase — those sources can
33
+ disagree. The failure this rule prevents: the agent notices (or should notice)
34
+ the disagreement, picks one reading, and proceeds silently — **even when its
35
+ pick is correct**. A good guess on a real contradiction still robs the user of
36
+ the decision that was theirs to make.
37
+
38
+ ## The Iron Law
39
+
40
+ ```
41
+ TWO PRESENT SOURCES DISAGREE → SURFACE THE DISCREPANCY AND ASK BEFORE PROCEEDING.
42
+ A SILENT GUESS ON A REAL CONTRADICTION IS A VIOLATION — EVEN IF THE GUESS IS RIGHT.
43
+ AN INFERRED-BUT-UNSPECIFIED BEHAVIOR IS A SCOPE EXPANSION: ASK, NEVER ADD IT SILENTLY.
44
+ OBVIOUS-TO-THE-AGENT ≠ IN-SCOPE.
45
+ ```
46
+
47
+ ## What counts as a discrepancy
48
+
49
+ - **(a) text ↔ image** — ticket text contradicts an attached mockup / screenshot / diagram (canonical case: text says "show birthdays **today**", the mockup shows a birthday from two days ago).
50
+ - **(b) silent-but-needed** — the spec is silent on a behavior that is clearly required (a weekend/holiday shift, an empty state, an error path). Surface it and ask **before** implementing — do not expand scope on a plausible inference (canonical case: the spec specifies weekend-shifting only; the agent also adds public-holiday shifting without asking).
51
+ - **(c) spec ↔ codebase/reality** — the spec contradicts what the code actually does or what a real source shows.
52
+ - **(d) intra-ticket** — the acceptance criteria, description, and comments contradict each other.
53
+
54
+ ## When it fires — and when NOT
55
+
56
+ **Fires** while planning, refining, estimating, roadmapping, or implementing from
57
+ a ticket/spec that carries a second source (an attachment, a code reality, or an
58
+ internal contradiction), gated by `consistency.cross_source` in
59
+ `.agent-settings.yml` (`on` default · `auto` = high-confidence only · `off` = inert).
60
+
61
+ **Does NOT fire** on a single clear source with no second source to compare
62
+ against (that is plain vagueness — it belongs to `ask-when-uncertain`), on
63
+ trivial edits, or when the user has already resolved the discrepancy this turn.
64
+
65
+ ## How to surface it (subordinate to the ask discipline)
66
+
67
+ - **Subordinate to [`ask-when-uncertain`](ask-when-uncertain.md).** Fold the
68
+ discrepancy into the SAME turn's single question — batch all discrepancies for
69
+ one artefact into ONE numbered-options block. Never emit a second question
70
+ block; one-question-per-turn holds.
71
+ - **Defer to [`scope-control`](scope-control.md)** as the permission authority
72
+ for the type-(b) silent-scope-expansion case.
73
+ - **Precedes [`design-fidelity`](design-fidelity.md).** This rule fires first,
74
+ at decision time ("text says X, the mockup says Y — which wins?"); once the
75
+ user resolves it, `design-fidelity` governs build-time 1:1 fidelity.
76
+ - **Pass the [`no-cheap-questions`](no-cheap-questions.md) Pre-Send Self-Check.**
77
+ Fire only on a genuine contradiction or silent-scope-expansion carrying a real
78
+ trade-off — never a content-free "are you sure?". Under an autonomous mandate a
79
+ detected discrepancy is a blocking decision and is NOT suppressed, but an
80
+ off-hand non-contradiction must not become a continuation prompt.
81
+
82
+ The taxonomy, the scan procedure, the confidence-tiered noise control, worked
83
+ examples, and the precedence table live in
84
+ [`cross-source-consistency-mechanics`](../docs/guidelines/agent-infra/cross-source-consistency-mechanics.md).
85
+
86
+ ## See also
87
+
88
+ - [`ask-when-uncertain`](ask-when-uncertain.md) — the one-question-per-turn ask discipline this folds into (missing info → ask; this adds conflicting present sources → ask).
89
+ - [`scope-control`](scope-control.md) — the permission authority for the silent-scope-expansion (type b) case.
90
+ - [`design-fidelity`](design-fidelity.md) — governs build-time fidelity once a text↔image conflict is resolved.
91
+ - [`active-remediation`](active-remediation.md) — the never-silently-ignore ladder this rule mirrors for source discrepancies.
92
+ - [`no-cheap-questions`](no-cheap-questions.md) — the floor the discrepancy ask must clear.
@@ -90,7 +90,7 @@ primitive → run in-session (clean no-op).
90
90
 
91
91
  ## See also
92
92
 
93
- - [`subagent-orchestration`](../skills/subagent-orchestration/SKILL.md) — the form gate + 8 modes this selects.
93
+ - [`subagent-orchestration`](../skills/subagent-orchestration/SKILL.md) — the form gate + 9 modes this selects.
94
94
  - [`subagent-boundary`](../docs/contracts/subagent-boundary.md) — what a subagent owns vs never owns (task-meaning, memory, pack-surface, safety-floor bypass).
95
95
  - [`auto-orchestration-activation`](../contexts/execution/auto-orchestration-activation.md) — the gate.
96
96
  - [`reasoning-orchestrator`](../skills/reasoning-orchestrator/SKILL.md) — RDP dispatch, now gated here.
@@ -77,6 +77,8 @@ If the ticket scores low on estimability (vague AC, no out-of-scope,
77
77
  no mention of deps), set `uncertainty = Underspecified` and
78
78
  emit a single-line redirect to `/refine-ticket` at the top of the output.
79
79
 
80
+ A **cross-source discrepancy** (per [`cross-source-consistency`](../../rules/cross-source-consistency.md), gated by `consistency.cross_source`) — ticket text contradicting an attached mockup, or a clearly-needed-but-unstated behavior (weekend/holiday shift) — is not estimable as-is: it hides an open scope decision. Raise `uncertainty` and name the discrepancy in the redirect rather than sizing over a contradiction.
81
+
80
82
  ### 3. Apply sizing heuristics
81
83
 
82
84
  Score across four axes; each axis contributes to the final size:
@@ -28,7 +28,7 @@ Do NOT use when:
28
28
 
29
29
  ## Procedure: Plan a feature
30
30
 
31
- 1. **Gather requirements** — What problem does this solve? Who benefits? What's the expected outcome?
31
+ 1. **Gather requirements** — What problem does this solve? Who benefits? What's the expected outcome? Run a **cross-source discrepancy scan** (per [`cross-source-consistency`](../../rules/cross-source-consistency.md), gated by `consistency.cross_source`): where the source ticket carries text + an attachment/mockup, or leaves a clearly-needed behavior unstated (weekend/holiday shift, empty/error state, timezone), surface the conflict/gap as an *Open question* before drafting phases — an inferred behavior is a scope expansion to confirm, not to bake in. See [`cross-source-consistency-mechanics`](../../../docs/guidelines/agent-infra/cross-source-consistency-mechanics.md).
32
32
  2. **Analyze scope** — Which modules, routes, models, services are affected?
33
33
  3. **Write the plan** — Create a feature plan document (see template below).
34
34
  4. **Verify** — Confirm all affected areas are identified, no missing dependencies.
@@ -0,0 +1,146 @@
1
+ ---
2
+ model_tier: inherit
3
+ name: llm-provider-knowledge
4
+ description: "Before stating any specific fact about an LLM provider's product — models, pricing, limits, context windows, SDK/API — for OpenAI, Gemini, Claude & others, verify against official docs, not memory."
5
+ source: package
6
+ domain: process
7
+ personas: []
8
+ workspaces:
9
+ - agent-config-maintainer
10
+ - engineering
11
+ - product
12
+ - founder
13
+ - small-business
14
+ - gtm
15
+ - ops
16
+ packs:
17
+ - meta
18
+ trust:
19
+ level: experimental
20
+ install:
21
+ removable: true
22
+ execution:
23
+ type: manual
24
+ ---
25
+
26
+ # llm-provider-knowledge
27
+
28
+ Verify LLM-provider product facts against **official documentation**, never
29
+ memory. This skill is the multi-provider sibling of Claude Code's bundled
30
+ `product-self-knowledge` — extended to OpenAI, Google Gemini, Anthropic,
31
+ Mistral, xAI, DeepSeek, Cohere, and Meta Llama, and portable to every host this
32
+ package projects to (not just Claude Code).
33
+
34
+ **This skill is a signpost, not a library.** It routes you to the authoritative
35
+ source and forces a source-cited answer. It does **not** cache model IDs,
36
+ context windows, prices, or rate limits — those churn constantly, and a cached
37
+ copy is exactly the stale "from memory" answer this skill exists to prevent.
38
+
39
+ ## When to use
40
+
41
+ - Your reply would state a specific fact about a provider's product: a model ID
42
+ or its context window, token pricing, a rate/quota limit, an SDK/API detail
43
+ (endpoint, parameter, auth, batch, streaming, function-calling shape), or a
44
+ consumer-app plan limit (ChatGPT/Gemini/Claude app tiers).
45
+ - Coding against a provider SDK where a wrong model name, parameter, or limit
46
+ would break at runtime.
47
+ - Content or comparisons that assert provider capabilities or pricing.
48
+ - Any time you would otherwise answer such a fact from training data — it may be
49
+ outdated or wrong.
50
+
51
+ ## When NOT to fire
52
+
53
+ - Ordinary SDK code that asserts **no** product fact (wiring a call whose model
54
+ and params the user already gave).
55
+ - The user already supplied the verified fact — use it; don't re-litigate.
56
+ - Writing provider-specific prompt grammar → `prompt-engineering-patterns`.
57
+ - Choosing which model to use for the host → `model-recommendation` (never
58
+ recommend another vendor's model over the host's; this skill only reports
59
+ facts, it does not steer model choice).
60
+ - Image-provider selection → `image-provider-routing`.
61
+
62
+ ## Core principles
63
+
64
+ 1. **Accuracy over guessing** — if unsure, route to the docs; never assert.
65
+ 2. **Distinguish products** — a provider's API, its developer platform, and its
66
+ consumer app are separate surfaces with separate facts and separate docs.
67
+ 3. **Source everything** — every product fact in the reply carries an official
68
+ URL. No URL → not verified → don't state it as fact.
69
+ 4. **Route, don't cache** — hand off to the live docs; do not transcribe
70
+ volatile specs into the reply as if durable.
71
+
72
+ ## Provider routing table
73
+
74
+ Route to the **stable root** and read live from there — do not deep-link to
75
+ pages that churn. Prefer a provider's machine-readable index where one exists.
76
+
77
+ | Provider | Docs root | API reference | Product / support |
78
+ |---|---|---|---|
79
+ | **OpenAI** (GPT) | `platform.openai.com/docs` | `platform.openai.com/docs/api-reference` | `help.openai.com` |
80
+ | **Google Gemini** | `ai.google.dev/gemini-api/docs` | `ai.google.dev/api` | `support.google.com` (Gemini app) |
81
+ | **Anthropic** (Claude) | `docs.claude.com/en/docs` (index: `/en/docs_site_map.md`) | `docs.claude.com/en/api/overview` | `support.claude.com` |
82
+ | **Mistral** | `docs.mistral.ai` | `docs.mistral.ai/api` | `help.mistral.ai` |
83
+ | **xAI** (Grok) | `docs.x.ai` | `docs.x.ai/developers` | `x.ai` |
84
+ | **DeepSeek** | `api-docs.deepseek.com` | `api-docs.deepseek.com/api` | `platform.deepseek.com` |
85
+ | **Cohere** | `docs.cohere.com` (index: `docs.cohere.com/llms.txt`) | `docs.cohere.com/reference` | `dashboard.cohere.com` |
86
+ | **Meta Llama** | `llama.com` (dev docs: `ai.developer.meta.com/docs`) | `ai.developer.meta.com/docs` | `llama.com` |
87
+
88
+ **Claude Code specifics** (install, Node.js requirement, MCP, config):
89
+ `docs.anthropic.com/en/docs/claude-code/claude_code_docs_map.md`.
90
+
91
+ **Hosted access** (not a distinct vendor): Azure OpenAI, AWS Bedrock, and
92
+ Google Vertex AI resell the underlying vendor's models. Route to BOTH the
93
+ underlying vendor's row above AND the cloud's own docs (`learn.microsoft.com`,
94
+ `docs.aws.amazon.com/bedrock`, `cloud.google.com/vertex-ai`) — model IDs,
95
+ quotas, and regions differ from the vendor's direct API.
96
+
97
+ ## Procedure
98
+
99
+ 1. **Identify the provider and the surface** — API / developer platform /
100
+ consumer app. A ChatGPT-Plus limit is not an OpenAI-API rate limit.
101
+ 2. **Pick the row + column** from the table; go to the stable root.
102
+ 3. **Read the live docs** for the exact fact (navigate from the root; follow
103
+ the provider's own index / `llms.txt` where present).
104
+ 4. **State the fact with its source URL.** If the docs can't be reached or are
105
+ ambiguous, say so and point the user at the root rather than guessing.
106
+ 5. **Never transcribe a volatile spec as durable** — frame it as "per <URL> as
107
+ of now"; the source is authoritative, the reply is a pointer.
108
+
109
+ ## Output format
110
+
111
+ Every reply that states a provider product fact MUST include:
112
+
113
+ 1. **The fact, scoped to the product surface** — name the provider AND which
114
+ surface (API / platform / consumer app) it applies to.
115
+ 2. **The official source URL** — the specific docs page the fact came from (or
116
+ the stable root when you're directing the user to read it themselves).
117
+ 3. **A freshness caveat when the fact is volatile** (pricing, limits, model
118
+ availability): "verify at <URL> — these change without notice."
119
+
120
+ ## Do NOT
121
+
122
+ - **Do NOT** state a model ID, context window, price, or rate limit from
123
+ memory — route to the docs and cite the URL, or say you're unsure.
124
+ - **Do NOT** transcribe a volatile spec (pricing, limits, model availability)
125
+ into the reply as if durable — frame it as "per <URL> as of now".
126
+ - **Do NOT** conflate a provider's API with its consumer app — they carry
127
+ different limits and different docs.
128
+ - **Do NOT** steer the user to another vendor's model over the host's — that is
129
+ `model-recommendation`; this skill reports facts neutrally.
130
+ - **Do NOT** cache a provider's docs into this skill. When a root URL moves,
131
+ fix the one table row; a mismatch a user reports is a signal to correct the
132
+ row, never to start transcribing pages here.
133
+
134
+ ## Gotcha
135
+
136
+ - **Provider docs URLs churn** (Meta's Llama dev-docs host redirected during
137
+ this skill's authoring). That is *why* the skill links to stable roots and
138
+ reads live — a deep-linked page memorised here would rot. If a root itself
139
+ moves, fix the one table row; never start caching pages to compensate.
140
+ - **Do not conflate surfaces.** "Gemini" the app and the Gemini API have
141
+ different limits and different docs; the same for ChatGPT vs the OpenAI API
142
+ and Claude.ai vs the Claude API.
143
+ - **Redundant with the harness on Claude Code.** Claude Code's own
144
+ `product-self-knowledge` also fires for Anthropic facts — both route to the
145
+ same Anthropic docs, so the overlap is harmless. On every other host this is
146
+ the only such skill.
@@ -0,0 +1,20 @@
1
+ {
2
+ "skill": "llm-provider-knowledge",
3
+ "last_eval": "2026-07-14",
4
+ "description": "7 should-trigger + 6 should-not-trigger. Should-trigger covers specific product-fact claims (context window, pricing, rate limit, API detail, model spec, consumer-app plan limit) across OpenAI, Google, Anthropic, Mistral, DeepSeek, Cohere. Should-not-trigger covers near-misses: SDK wiring with a user-supplied model, prompt authoring (prompt-engineering-patterns), model choice for the host (model-recommendation), image-provider selection (image-provider-routing), a user-supplied fact, and a plain SDK refactor.",
5
+ "queries": [
6
+ {"q": "what's the context window of GPT-5?", "trigger": true},
7
+ {"q": "how much does Gemini 2.5 Pro cost per million input tokens?", "trigger": true},
8
+ {"q": "what are the rate limits on the Anthropic API for tier 1?", "trigger": true},
9
+ {"q": "does the Mistral API support function calling, and what parameter enables it?", "trigger": true},
10
+ {"q": "what's the max output length for DeepSeek's chat model?", "trigger": true},
11
+ {"q": "how many messages does ChatGPT Plus allow in the app per window?", "trigger": true},
12
+ {"q": "what embedding dimension does Cohere's embed model return?", "trigger": true},
13
+ {"q": "wire up an openai chat completions call using the model id I already gave you", "trigger": false, "note": "SDK wiring; user supplied the model — no unverified product fact asserted"},
14
+ {"q": "write a good prompt to make Gemini summarize this document", "trigger": false, "note": "prompt authoring → prompt-engineering-patterns"},
15
+ {"q": "which model should I use for this task on my current host?", "trigger": false, "note": "model choice → model-recommendation (never steer to another vendor)"},
16
+ {"q": "route this logo-with-text image to the right generation provider", "trigger": false, "note": "image-provider selection → image-provider-routing"},
17
+ {"q": "I already know Claude Sonnet has a 200k context window — just use that number", "trigger": false, "note": "user supplied the verified fact; use it, do not re-litigate"},
18
+ {"q": "refactor this function that calls the Anthropic SDK to add retries", "trigger": false, "note": "plain code refactor; asserts no product fact"}
19
+ ]
20
+ }
@@ -81,6 +81,8 @@ not name an implementation**. Use Given / When / Then or a numbered
81
81
  list. Reject ACs that hide assumptions ("works correctly", "is fast
82
82
  enough") — replace with measurable thresholds or strike them.
83
83
 
84
+ **Cross-source discrepancy scan** (per [`cross-source-consistency`](../../rules/cross-source-consistency.md), gated by `consistency.cross_source`): when the raw input includes a screenshot / mockup alongside the story text, check the sources against each other and surface any conflict as a `gap` / open question — never resolve it silently. Watch for: story text contradicting an attached screenshot; the AC contradicting the description; a clearly-needed behavior the input never states (weekend/holiday shift, empty/error state). Batch them into one clarifying question. Taxonomy: [`cross-source-consistency-mechanics`](../../../docs/guidelines/agent-infra/cross-source-consistency-mechanics.md).
85
+
84
86
  ### 5. Surface non-functional gaps
85
87
 
86
88
  Flag anything missing that downstream skills will need: success
@@ -138,6 +138,13 @@ Check the loaded ticket for clarity signals before orchestrating:
138
138
  - Is the scope one feature, or multiple tangled together?
139
139
  - Any sentence that references an existing module name, feature flag, or domain concept?
140
140
 
141
+ **Cross-source discrepancy scan** (per [`cross-source-consistency`](../../rules/cross-source-consistency.md), gated by `consistency.cross_source`): the ticket is rarely a single source. Compare every source against the others and surface any conflict as an *Open question* — never resolve it silently:
142
+ - **text ↔ attachment** — does the ticket text agree with every attached mockup / screenshot / diagram? (Canonical miss: text says "birthdays **today**", the mockup shows a birthday from two days ago.) If an attachment cannot be read, say so — do not assume it agrees.
143
+ - **silent-but-needed** — is the spec silent on a clearly-needed behavior (weekend/holiday shift, empty state, error path, timezone, permissions)? Surface it and ask before it becomes an implementation assumption — an inferred behavior is a scope expansion, not a given.
144
+ - **intra-ticket** — do the AC, description, and comments contradict each other?
145
+
146
+ Fold every discrepancy into the refined output's *Open questions* section (one batched list), never a second prompt. Full taxonomy + scan procedure: [`cross-source-consistency-mechanics`](../../../docs/guidelines/agent-infra/cross-source-consistency-mechanics.md).
147
+
141
148
  Then run the deterministic detection helper — do **not** re-derive trigger
142
149
  logic in prose:
143
150
 
@@ -82,6 +82,20 @@ Vague goals ("improve roadmaps") force every reader to re-derive
82
82
  intent. If the goal needs three sentences, the roadmap is two
83
83
  roadmaps.
84
84
 
85
+ ### 3b. Scan sources for discrepancies before drafting phases
86
+
87
+ When the roadmap originates from a ticket/spec that carries a second
88
+ source — an attached mockup/screenshot, a code reality, or an internal
89
+ contradiction — run the **cross-source discrepancy scan** (per
90
+ [`cross-source-consistency`](../../rules/cross-source-consistency.md),
91
+ gated by `consistency.cross_source`) before writing phases. A phase plan
92
+ built over a text↔image contradiction or a silent-but-needed behavior
93
+ (weekend/holiday shift, empty/error state) bakes the wrong assumption into
94
+ every downstream step. Surface each discrepancy as one batched open
95
+ question first; an inferred behavior is a scope expansion to confirm, not
96
+ to plan silently. Taxonomy + procedure:
97
+ [`cross-source-consistency-mechanics`](../../../docs/guidelines/agent-infra/cross-source-consistency-mechanics.md).
98
+
85
99
  ### 4. Phase blocks carry checkboxes
86
100
 
87
101
  Every non-intro phase contains at least one `- [ ]`. Decision tables
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  model_tier: inherit
3
3
  name: subagent-orchestration
4
- description: "Use when orchestrating implementer/judge subagents — form gate + eight modes (do-and-judge ±two-stage, steps/parallel/worktrees, competitively, debate, live-app-judge)."
4
+ description: "Use when orchestrating implementer/judge subagents — form gate + nine modes (do-and-judge ±two-stage, steps/parallel/worktrees, competitively, debate, live-app-judge, adversarial-council)."
5
5
  domain: process
6
6
  workspaces:
7
7
  - agent-config-maintainer
@@ -108,6 +108,7 @@ no learned routing, no self-modifying selector (rejected, stays rejected).
108
108
  | Multi-step cross-wing chain needing filesystem isolation | worktrees | `do-in-worktrees` |
109
109
  | Ordered steps with declared dependencies | steps | `do-in-steps` |
110
110
  | Single change with non-trivial risk / contested spec / decision | judge | `do-and-judge`, `do-and-judge-two-stage`, `judge-with-debate`, `do-with-live-app-judge` |
111
+ | High-risk change needing defect-FINDING coverage (opt-in, advisory) | verify-council | `adversarial-verification-council` (default-off; `subagents.adversarial_council`) |
111
112
  | Single slice below the delegability floor, unstructured, or frontier-priced | none | no dispatch — run in-session |
112
113
 
113
114
  Rules:
@@ -121,7 +122,7 @@ Rules:
121
122
  or `none`) so the gate's value is measurable inside the ADR-117
122
123
  prove-or-drop window.
123
124
 
124
- ## The eight modes
125
+ ## The nine modes
125
126
 
126
127
  Each mode has a decision row: when to use, when not, and the expected
127
128
  model pairing. Defaults come from
@@ -211,6 +212,9 @@ migration, public API) where a single judge is too easy to fool.
211
212
  |---|---|---|
212
213
  | Security, data integrity, public API change | Routine internal refactor | judges = same tier (2x); meta-judge = one tier up |
213
214
 
215
+ Mode 6 = **go/no-go** (strict-er verdict wins); for defect-FINDING coverage (the
216
+ *union* of what diverse models catch) use Mode 9.
217
+
214
218
  ### 7. do-in-worktrees
215
219
 
216
220
  Cross-wing or cross-skill chain executed across isolated git worktrees —
@@ -231,6 +235,22 @@ Experimental until `verdict_changed_outcome` telemetry proves it. Rubric,
231
235
  adoption gate, and the async-verifier future candidate →
232
236
  [`subagent-modes-detail`](../../agent-src/contexts/execution/subagent-modes-detail.md) § Mode 8.
233
237
 
238
+ ### 9. adversarial-verification-council (gated — opt-in, advisory)
239
+
240
+ A panel of N (default 2) **distinct-model** skeptics red-teams a real,
241
+ already-verified change through the `judge-*` lenses — each prompted to *break*
242
+ it. Returns reconcile deterministically
243
+ ([`_lib/adversarial_reconcile.ts`](../../scripts/_lib/adversarial_reconcile.ts))
244
+ into one findings-by-severity envelope with provenance + cross-model confidence
245
+ ([`schemas/adversarial-findings.json`](schemas/adversarial-findings.json)). Unlike
246
+ Mode 6 it emits a **findings-union**, not a go/no-go verdict. **Advisory only —
247
+ never auto-gates (Hard Floor).** Default-off (`subagents.adversarial_council`);
248
+ opt-in high-risk changes only; registered claim + high-risk tier need
249
+ cross-*vendor* skeptics. Invariants, skeptic prompt, reconciliation, prove-or-drop
250
+ gate → [`subagent-modes-detail`](../../agent-src/contexts/execution/subagent-modes-detail.md) § Mode 9
251
+ + [`prompts/adversarial-verification-council.md`](prompts/adversarial-verification-council.md)
252
+ (ADR-122).
253
+
234
254
  ## Status taxonomy — every subagent return uses one envelope
235
255
 
236
256
  Every implementer or judge return must conform to
@@ -265,7 +285,7 @@ Each mode's literal dispatch template lives under
265
285
  matching prompt at dispatch time and substitutes `{{placeholders}}`.
266
286
  Edits to a prompt do not bloat this skill against the 400-line sunset
267
287
  trigger; `tests/test_subagent_prompt_loading.py` confirms each of the
268
- eight modes resolves to a loadable prompt that cites all four taxonomy
288
+ nine modes resolves to a loadable prompt that cites all four taxonomy
269
289
  statuses.
270
290
 
271
291
  ## Procedure
@@ -294,7 +314,7 @@ same context, **stop** and report. Do not improvise.
294
314
 
295
315
  ### 3. Pick the mode
296
316
 
297
- Run the form gate first, then match task shape to one of the eight modes. When two modes could fit,
317
+ Run the form gate first, then match task shape to one of the nine modes. When two modes could fit,
298
318
  prefer the cheaper one (`do-and-judge` < `do-and-judge-two-stage` <
299
319
  `do-in-steps` < `do-in-parallel` < `do-competitively` <
300
320
  `judge-with-debate` < `do-in-worktrees`).
@@ -320,6 +340,7 @@ Describe each dispatch step explicitly in chat so the user can follow it.
320
340
  * `do-competitively` → [`prompts/do-competitively.md`](prompts/do-competitively.md)
321
341
  * `judge-with-debate` → [`prompts/judge-with-debate.md`](prompts/judge-with-debate.md)
322
342
  * `do-in-worktrees` → [`prompts/do-in-worktrees.md`](prompts/do-in-worktrees.md)
343
+ * `adversarial-verification-council` → [`prompts/adversarial-verification-council.md`](prompts/adversarial-verification-council.md)
323
344
  * Standalone judge → judge prompt in [`prompts/do-and-judge.md`](prompts/do-and-judge.md)
324
345
 
325
346
  ### 5. Report
@@ -360,7 +381,7 @@ Skip emit when `subagents.enabled: false` or `spawn_count == 0` (in-session run)
360
381
 
361
382
  ## Output format
362
383
 
363
- 1. **Mode chosen** — one of the seven, with the one-line reason
384
+ 1. **Mode chosen** — one of the nine, with the one-line reason
364
385
  2. **Model pairing** — implementer model / judge model (resolved)
365
386
  3. **Verdict** — applied / revised / handed back
366
387
  4. **Evidence** — diff summary, test output, or judge transcript
@@ -37,6 +37,24 @@
37
37
  "criterion": "Negative control: the clean return is verified and adopted WITHOUT rework or escalation — telemetry records first_pass_success=true and escalated=false. No spurious findings are invented to justify a re-dispatch."
38
38
  }
39
39
  ]
40
+ },
41
+ {
42
+ "id": "sao-adversarial-council-advisory-no-gate",
43
+ "prompt": "`subagents.adversarial_council: on`. You are orchestrating an adversarial-verification-council (Mode 9) over a high-risk, already-verified change to an auth endpoint. Two distinct-model skeptics return findings: skeptic A raises a critical missing tenant-scope check at `src/http/orders.ts:42` (category security) and a low naming nit; skeptic B independently raises the same tenant-scope issue and refutes the naming nit. Reconcile and report the council result.",
44
+ "assertions": [
45
+ {
46
+ "kind": "contains",
47
+ "value": "advisory"
48
+ },
49
+ {
50
+ "kind": "rubric",
51
+ "criterion": "The reconciled output is a findings-by-severity envelope (findings-union), NOT a single go/no-go verdict: the tenant-scope finding is corroborated (raised_by both skeptics → high confidence), and the naming nit raised by only A and refuted by B is demoted to false_positives_suppressed (not silently dropped)."
52
+ },
53
+ {
54
+ "kind": "rubric",
55
+ "criterion": "The council is treated as ADVISORY and NEVER auto-gates the change (Hard Floor): the orchestrator surfaces the findings for a human decision and does not itself accept/reject/merge or block the change based on the panel verdict."
56
+ }
57
+ ]
40
58
  }
41
59
  ]
42
60
  }