Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/vercel/next.js/gate-testsnpx skills add vercel/next.js --skill gate-testsgit clone --depth 1 https://github.com/vercel/next.jsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00131 | $0.02592 |
| Opus 5 | $0.00066 | $0.01296 |
| Sonnet 5 | $0.00026 | $0.00518 |
| Haiku 4.5 | $0.00013 | $0.00259 |
Grade A, and why
gate-tests scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Gating tests with @gate / @force-gate
Full reference: test/lib/gate/README.md.
This skill is the decision guide: which directive to reach for, the standard
conversion patterns, and how to verify.
Never write these — gate instead
| Anti-pattern | Replacement |
|---|---|
it.skip('...') for a known failure |
// @gate <cond> (or @gate FIXME if no condition explains it) |
if (isNextDev) { test('skipped in dev mode', () => {}); return } |
// @force-gate prefetching (or !dev) on the describe |
(flagEnabled ? describe.skip : describe)(...) keyed on process.env |
// @force-gate <cond> (lazy) on the describe |
| Duplicating a fixture directory per flag state | one fixture keyed on __NEXT_TEST_AXIS + a @gate/@force-gate |
Branching expectations on process.env.__NEXT_CACHE_COMPONENTS |
if (await gate((c) => c.cacheComponents)) (gate from next-test-utils) |
The skip patterns are fake-greens: nothing tells you when the bug they hide is
fixed. @gate still runs the body and fails the suite the day the "known
failure" starts passing, so stale workarounds get deleted instead of rotting.
Choosing the directive
Ask what kind of difference you're encoding:
- A behavior change — both states assert something meaningful. Don't
gate the test at all: fork inside the body with the runtime
gate()— same condition registry, no inversion — which pinpoints exactly what differs, and also coversit.each, where a pragma cannot attach:if (await gate((c) => c.cacheComponents)) { ... } else { ... }. It mirrors React'sgate(flags => ...); a pragma expression string works too (await gate('cacheComponents && !dev')). A suite-level pragma is too coarse here — it hides what is different between the states. - A flag that changes the behavior of existing surface
(
cacheComponents,optimisticRouting) and the suite is written for one state.// @gate <cond>on the test ordescribe. The body runs; a false condition inverts the expectation (failure absorbed, a pass fails as "stale gate"). The off state fails for a meaningful reason — the behavior differs — so a pass is real information: the gate is stale, delete it. - A new API — the off state proves nothing. Typically
// @force-gate <cond>(lazy) on thedescribe. An API that throws when its flag is off — or is inert, likeuseOffline(), which compiles to a hook that always reports online — can only fail vacuously (often slowly, by timing out), and browser e2e time is considerable, so skip the run (and the fixture build) instead of paying for it. Working example:test/e2e/app-dir/use-offline/. This is discretion, not a rule: when the flag changes behavior the suite can observe, the off state is meaningful and@gatebuys the staleness check. @force-gate <cond>also when running the body is impossible, not merely failing: prefetching is off in dev, deploy has no local build output, the fixture cannot even build under the condition.- Static condition (
!dev,bundler…) → real Jest○ skippedat collection. - Lazy condition on a
describe→ the fixture build is skipped when false; tests report passed-with-⚠ skipped by @force-gate(Jest cannot skip at runtime). Build-skipping coversstart/devsuites wherenextTestSetupowns the build — notskipStartsuites, not deploy.
- Static condition (
- Pragmas stack: a common pair is a static
// @force-gate prefetchingplus a lazy// @gate <flag>on the samedescribe.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 195 lines · 131 tokens per session scan A 8e451d3e3568
gate-tests is a skill published in the GitHub repository vercel/next.js (142,020 stars, last pushed 2d ago), licensed MIT. It adds 131 tokens to every session and 2,592 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
shadcn
Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json…
migrate-radix-to-base
Migrates React projects and components from Radix UI to Base UI. Use when asked to migrate from radix, move to base-ui, convert radix primitives, or switch a shadcn project's base library. Handles single components ("migrate accordion") and whole projects.
theme-component
Add complete theme support for one Recharts component. Invoke with the component name, for example theme-component XAxis.
typescript
Write strongly-typed TypeScript code in Recharts.
example
Create new example charts for Recharts documentation website.
investigate
Find root cause for a bug or an issue in Recharts and propose a solution.