grill-adversarial
Opt-in adversarial plan-challenging pass for the goal workflow (invoked by /goal:spec when functional gaps are suspected, or on explicit request). Composes the Pocock grill skills (grill-me, grill-with-docs) and goes much further, hunting the functional and technical holes that survive a normal grill — broken invariants and broken execution schemas — BEFORE the iterations are frozen, so the plan is coherent and executable exactly as specified. Highest value on a COMPLEX BEHAVIOUR, and equally on a SIMPLE CHANGE LANDING IN A DENSE ZONE — many invariants, many paths, many things to keep in sync — which is the case most often waved through, since a one-liner invites nobody to re-enumerate anything. ACTIVATE for 'grill adversarial', 'grille adversariale', 'challenge the plan', 'trous fonctionnels', 'incohérences', 'invariants', 'state machine', 'interaction coherence', 'front interactions', 'edge transitions', 'zone complexe', 'effets de bord'.
- License 许可
- MIT
- 最近更新
- 2026-10-13
- Stars
- ★ 9
- Forks
- 2
01 前言 Front Matter
- name
- grill-adversarial
- description
- Opt-in adversarial plan-challenging pass for the goal workflow (invoked by /goal:spec when functional gaps are suspected, or on explicit request). Composes the Pocock grill skills (grill-me, grill-with-docs) and goes much further, hunting the functional and technical holes that survive a normal grill — broken invariants and broken execution schemas — BEFORE the iterations are frozen, so the plan is coherent and executable exactly as specified. Highest value on a COMPLEX BEHAVIOUR, and equally on a SIMPLE CHANGE LANDING IN A DENSE ZONE — many invariants, many paths, many things to keep in sync — which is the case most often waved through, since a one-liner invites nobody to re-enumerate anything. ACTIVATE for 'grill adversarial', 'grille adversariale', 'challenge the plan', 'trous fonctionnels', 'incohérences', 'invariants', 'state machine', 'interaction coherence', 'front interactions', 'edge transitions', 'zone complexe', 'effets de bord'.
02 资源文件 1
- 参考文档STRATEGY.json518 B
03 SKILL.md 正文
Host
<root> is Claude Code's substituted ${CLAUDE_PLUGIN_ROOT}. A host that leaves it literal
(Copilot CLI) reads <root> as two levels above Base directory for this skill:.
A host that injects no base-directory line and reads SKILL.md itself (Codex CLI) takes <root> as two levels
above that file's directory.
$ARGUMENTS left literal is the text typed after the command (empty when none).
Use <root> wherever a command below says ${CLAUDE_PLUGIN_ROOT}.
When <root>/src/artifacts.ts or a shared file this skill names is missing, print
cannot locate the goal plugin scripts, the host, and the install commands, run nothing and write nothing:
copilot plugin marketplace add <repository> then
copilot plugin install goal@fabien-claude-marketplace under Copilot,
codex plugin marketplace add <repository> then
codex plugin add goal@fabien-claude-marketplace under Codex,
/plugin install goal@fabien-claude-marketplace under Claude Code.
Then read <root>/shared/host.md.
Adversarial grill — challenge the plan until no functional hole is left
A normal grill resolves the branches that are raised. This pass generates the branches nobody raised. It exists because interface incoherence and usage incoherence come from unmodelled invariants and unenumerated transitions, not from missing business rules — and those are invisible to a Socratic grill.
Take the whole plan and the domain docs. Nothing is out of bounds — including what was never defined, never discussed, and never questioned.
When to run / when to skip
Value is the product of two quantities, and neither of them is how interactive the feature looks:
- how dense the zone already is — how many invariants hold there, how many paths reach it, how many things must stay in sync, how many abnormal states it already names (degraded, expired, absent, disabled);
- how far the change reaches into it — whether it adds an actor, a copy, a path or a state, or only changes a value inside one path that already exists.
A complex behaviour scores high on both. A simple modification inside a dense zone scores high too — and that is the dangerous case, because its author sees a one-liner and nobody re-enumerates anything.
The test
Counting beats adjectives: every zone feels normal to whoever works in it, so "is this complex?" is answered yes far too rarely by the person best placed to answer it.
- Count what the zone already guarantees — invariants its contract states, rules its checks assert, states its docs name. If that count exceeds what can be recited from memory, the zone is dense.
- Name what the change adds to it: an actor, a copy, a path, a state. Each one multiplies the space rather than extending it — the same states, crossed with one more thing that can be in them.
- Run the pass unless both come back small.
Skip only when the zone holds few invariants AND the change adds nothing to them: a copy change, a rename with no new caller, a refactor whose tests already pin the behaviour.
Two traps
The size of the diff is not the signal. Neither is "it is only a rename / a second one of what already exists / one config line". Those describe the change; the holes come from the zone.
"The state space is inherited from the parent work" is not a reason to skip — it is a reason to run. An inherited space is a measured count for step 1, and anything the change adds crosses it. Observed: a pass argued against on exactly those grounds surfaced three holes anyway, one of which became a new business rule — a newly added invocation path silently bypassed a guard the old one honoured.
Front vs back is a matter of degree, not of kind. On back, actions are coarser and server-owned, so the matrix is smaller — not absent. Walk it anyway; a small matrix is cheap.
Method
0. Compose the base grills
If installed, load and run these first — they cover what is raised:
pocock:grill-with-docs— challenge the plan against the domain model, sharpen terminology, updateCONTEXT.md/ ADRs inline.pocock:grill-me— resolve every raised decision branch to shared understanding. Then apply the steps below, which generate what was never raised.
1. Enumerate the state space
List the finite states the feature can be in (front: list view, one item editing, one item adding, N items, empty, loading, error…). Name each one. A state you cannot name is a state you cannot reason about — and where incoherence hides.
2. Extract the invariants — what must hold in EVERY state
Write them explicitly as I1…In. On front, systematically check for:
- exactly one valid selection at all times — never zero, never on an incomplete/empty entity;
- no incomplete / unsaved entity occupying a selectable or committed slot;
- at most one editor open;
- mutual exclusion (single default, single selected…);
- no orphan / empty persisted item;
- reset / reload returns to a coherent state. For each invariant, name its OWNER. Front-only rule: if state is 100% front with no backend, the front owns every invariant a backend would normally guard — you may not defer them to a non-existent server ("validation delegated to backend" is a contradiction for a front-only feature).
3. Build the transition matrix (adversarial)
For every (state × action), in every order, ask: what is the resulting state, and which invariant could this transition break? Play the hostile user: out-of-order clicks, double actions, act-then-switch, cancel-an-add, delete-the-selected, submit-incomplete, reload-mid-edit. Every cell must resolve to allowed (and preserves all invariants) or explicitly blocked. An unresolved cell is a functional hole.
4. Hunt execution-schema breaks
Beyond single transitions, chase sequences that break the intended flow end-to-end: add A then edit B; validate with required fields empty; reset an add; delete while editing; two adds in parallel; selection landing on a pending item. Each break is a new rule.
5. Turn every hole into a testable rule
Each surfaced hole becomes a business rule / invariant with:
- an owner iteration (or marked transverse — re-verified at each iteration's DoD), and
- a sequence test: drive the series of actions, assert the invariant holds throughout — never a mere presence assertion ("a button exists").
6. Update the plan in place
Add / refresh in the spec:
## States, invariants & transitions
- **States:** S1…Sk
- **Invariants:** I1…In (each with its owner; front-only ⇒ front owns it)
- **Transition matrix:** (state × action) → resulting state / blocked / invariant preserved
Fold the new rules into Business rules (each → a sequence test in the DoD) and assign them to iterations or mark them transverse. Nothing is frozen until every cell is resolved and every invariant has an owner + a test.
Termination
Stop when every state is named, every invariant is written and owned, and a full pass over
the (state, action) matrix surfaces no new hole. Completeness is the target, not a fixed
cell count: once two consecutive passes add nothing, the matrix has converged and the
remaining cells are exercised at the DoD instead of hand-enumerated here. If a cell needs a
human decision, ASK — never guess an invariant into place.
Output
A challenged, updated plan the developer confirms — coherent and executable exactly
as specified, ready for /goal:plan to decompose (or refined in place if already
decomposed). Summarize: states found, invariants added, holes surfaced, and which
plan cells changed.
04 同仓库更多 Skills
vitest-test-conventions
ACTIVATE when writing Vitest tests, creating test files, using vi.fn()/vi.mock()/vi.spyOn(), or test factories. ACTIVATE for 'Vitest', 'it.each', 'NestJS testing module', 'supertest', 'vi.fn', 'vi.mock', 'spyOn'. Provides Vitest/NestJS-specific testing patterns; cross-language testing principles (DAMP, AAA, spy over mock, what NOT to test) live in craft:testing-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), TDD workflow/iterations (see vitest:vitest-tdd-workflow), PHP/PHPUnit tests (see phpunit:php-test-conventions).
vitest-tdd-workflow
ACTIVATE when building new features, endpoints, or user stories using TDD with Vitest in a TypeScript/NestJS context. ACTIVATE for '/feature-tdd-dev', 'TDD', 'red-green-refactor' in TS context. Provides Vitest/NestJS-specific TDD examples and commands; cross-language TDD workflow (cross-layer iterations, RED-GREEN-REFACTOR, working app, bug-fix-first-test, mocks-hiding-bugs) lives in craft:tdd-workflow-principles. DO NOT use for: node:test files (a file importing node:test) or a project whose tests run under node --test (see node-test:node-test-conventions), test writing conventions (see vitest:vitest-test-conventions), PHP TDD (see phpunit:php-tdd-workflow).
ts-refactoring
ACTIVATE when refactoring TypeScript code. ACTIVATE for 'refactor', 'extract', 'redesign', 'simplify', or 'clean up' in a TypeScript / Node / NestJS context. This skill provides TS-specific examples for the cross-language refactoring rules defined in craft:refactoring-principles. DO NOT use for: writing new features from scratch, general OOP patterns (see ts-oop).
ts-ports-adapters
ACTIVATE when a TypeScript codebase with no dependency-injection container has to declare a port and wire its adapter — a repository, a clock, an id generator, an event dispatcher the domain depends on. ACTIVATE for 'port', 'adapter', 'SPI', 'dependency inversion' or 'composition root' in a codebase that wires its dependencies by hand. Covers: the port as a type of functions in the domain layer, the adapter as an object literal annotated with it, the handler that takes its dependencies first and its data second, the composition root in the infrastructure layer, and the in-memory stub that substitutes for the adapter in a unit test. DO NOT use for: NestJS, or any container-based DI with decorators and tokens (see nest-ddd-conventions), aggregate operations and smart constructors (see ddd-ts-fp), the Result type itself (see ts-functional).
ts-oop
ACTIVATE when designing TypeScript classes, and the value objects or collections modelled as classes, or when the user asks about object design, encapsulation, Tell Don't Ask, or Symbol.iterator. Provides TS-specific examples for the cross-language OOP rules defined in craft:oop-principles, plus TS-specific patterns (Symbol.iterator, branded types for primitive identifiers). DO NOT use for: a value object or an aggregate modelled as an immutable record rather than a class (see ddd-ts-fp), refactoring methodology (see ts-refactoring).
ts-layer-boundaries
ACTIVATE when wiring a Worker entry point, a Router, a controller, or a domain event consumer in a TypeScript CQRS codebase, or when deciding where a port belongs. ACTIVATE for 'composition root', 'layer boundary', 'ESLint zones', 'domain must not import infrastructure'. Covers: the *Worker.ts composition root, the curried consumer, Router wiring of command endpoints, the five-gesture controller, the domain-to-infrastructure import boundary enforced by ESLint, infrastructure-only ports, in-memory doubles for every port, the read-can-reach-write asymmetry, and read endpoints going through a domain handler. DO NOT use for: the port's own shape and adapter binding (see ts-ports-adapters), the Result type (see ts-functional), domain event structure (see ts-ddd-events).