Agent skill

Enforce Rules For Vitest

by moeru-ai in moeru-ai/airi

Enforce AIRI's testing and Vitest practices in the AIRI monorepo.

MITAuto-check passedTesting & QA

Install Enforce Rules For Vitest

skills CLI
$ npx skills add moeru-ai/airi --skill enforce-rules-for-vitest -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install moeru-ai/airi enforce-rules-for-vitest --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/moeru-ai/airi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/enforce-rules-for-vitest .claude/skills/enforce-rules-for-vitest && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
enforce-rules-for-vitest
GitHub stars
50k
Token cost
~951 tokens
SKILL.md length
482 words
Files
2
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Enforce AIRI's testing and Vitest practices in the AIRI monorepo.

  • Works in 5 steps: For an investigated bug or issue, try to… → When reproduction is possible, include… → Put the actual report URL in a comment… → …
  • You reproduce a reported bug
  • SKILL.md covers Choose the Test Scope, Reproduce Bugs Before Fixing…, Mock Real Boundaries and Preserve Runtime Integrity, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Enforce Rules For Vitest is an agent skill from moeru-ai/airi. Enforce AIRI's testing and Vitest practices in the AIRI monorepo. Use when you create, edit, review, or debug tests. Also use when you reproduce a reported bug or issue, change Vitest configuration, or diagnose test import and runtime-boundary failures. Also use when you mock IPC, services, providers, platform APIs, or imports.

Its SKILL.md is about 950 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Testing & QA, covering Unit testing. It works with Vitest. The repository describes itself as: 💖🧸 Self hosted, you-owned Grok Companion, a container of souls of waifu, cyber livings to bring them into our worlds, wishing to achieve Neuro-sama's altitude. Capable of… The licence is MIT.

When your agent uses it

  • You reproduce a reported bug
  • Change Vitest configuration
  • Diagnose test import and runtime-boundary failures

Example prompts

  • “/enforce-rules-for-vitest”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. For an investigated bug or issue, try to add a test-only reproduction before you change production code.
  2. When reproduction is possible, include the tracker identifier in the test case name
  3. Put the actual report URL in a comment directly above the regression test. Use the GitHub issue URL, Discord message or thread URL, or…
  4. Confirm that the reproduction fails for the reported reason before you implement the fix.
  5. After the fix, add a comment below the report URL that explains the root cause and the fix. Use this format

What it can do on your machine

Read from SKILL.md and the folder at commit ec682e2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Enforce Rules For Vitest loads about 951 tokens when it runs. Until then it costs about 89 tokens; SKILL.md has 482 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~951

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from moeru-ai/airi at commit ec682e2, republished under its MIT licence (© moeru-ai). 482 words, ~951 tokens.

Download SKILL.mdSave it as .claude/skills/enforce-rules-for-vitest/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
enforce-rules-for-vitest
description
Enforce AIRI's testing and Vitest practices in the AIRI monorepo. Use when you create, edit, review, or debug tests. Also use when you reproduce a reported bug or issue, change Vitest configuration, or diagnose test import and runtime-boundary failures. Also use when you mock IPC, services, providers, platform APIs, or imports.

Enforce AIRI Vitest Rules

Apply these rules to every test change in AIRI.

Choose the Test Scope

  • Use Vitest to verify the behavior of each module that you implement.
  • Use the Vitest project that owns the affected code. Keep runs targeted for speed.
  • Grow component and end-to-end coverage progressively. Prefer Vitest browser mode when the behavior depends on DOM or Web Platform APIs.
  • Use the smallest automated test that faithfully exercises the behavior. Prefer a unit test, then the smallest suitable higher-level test.
  • Do not rely on smoke-only tests.

Reproduce Bugs Before Fixing Them

  1. For an investigated bug or issue, try to add a test-only reproduction before you change production code.

  2. When reproduction is possible, include the tracker identifier in the test case name:

    • Use Issue #<number> for a GitHub issue.
    • Use the Linear issue key for an internal Linear bug.
  3. Put the actual report URL in a comment directly above the regression test. Use the GitHub issue URL, Discord message or thread URL, or Linear issue URL as appropriate.

  4. Confirm that the reproduction fails for the reported reason before you implement the fix.

  5. After the fix, add a comment below the report URL that explains the root cause and the fix. Use this format:

    ts
    // ROOT CAUSE:
    //
    // If XXXX, some XXX case happens.
    // This happens because where line ...
    //
    // <before-patch behavior/code>
    //
    // We fixed this by XXX, XXX, XXX.
    // <after-patch behavior/code>

Mock Real Boundaries

  • Mock Electron IPC and Electron services with vi.fn or vi.mock. Never require a real Electron runtime.
  • For external providers and services, add mock-based tests. When feasible, also add integration-style tests guarded by environment variables. Vitest import mocks are allowed for these boundaries.
  • Do not mock Pinia or Vue components.
  • Test through stable public behavior. Do not create new exports, dependency bags, or wrapper services only to make private implementation details mockable.
  • Assert observable behavior, including mock calls and parameters, with explicit expect statements.
  • Prefer one assertion per line so that failures stay readable.
Show full SKILL.md (176 more words)Show less

Preserve Runtime Integrity

  • Do not test impossible runtime states. Do not assert against constants that cannot change. Do not assert against object mutations that can only occur inside the same test setup.
  • Do not replace globalThis properties or built-in modules with direct Object.defineProperty(...) mocks.
  • When behavior depends on a different Node global or built-in state, use node:worker_threads to load an isolated worker. You can also build a minimal CLI reproduction.
  • For DOM and Web Platform APIs, use Vitest browser mode instead of hard-mocking platform internals.
  • If a test that you change hard-mocks a platform API, move that test to browser mode in the same change.

Fix Import Boundaries, Not Tests

Never use Vitest mocks, hoisting, dynamic imports, as unknown as, or test-only alternate import paths to conceal a real import failure.

If a test cannot import a module, investigate and fix the production boundary:

  • package exports and declarations
  • import-time side effects
  • mixed Node and browser type dependencies
  • circular imports
  • an incorrect public module shape

Keep the test importing the same supported boundary that production consumers use.

© moeru-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/enforce-rules-for-vitest of moeru-ai/airi.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit ec682e2

Compare with similar skills

Enforce Rules For Vitest next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Enforce Rules For Vitest compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Enforce Rules For Vitest this skillmoeru-ai/airi50k—~951Automated safety check: PassMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0
Test GuardamElnagdy/guard-skills1.3k2 repos~2.1kAutomated safety check: PassMIT
Adding LLM MCP ToolsTriliumNext/Trilium38k—~2.5kAutomated safety check: PassAGPL-3.0
Concept Page Test Writerleonardomso/33-js-concepts67k—~5.5kAutomated safety check: PassMIT

Similar skills

  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed
  • Adding LLM MCP Tools

    TriliumNext/Trilium

    A skill your agent uses when adding, changing, or reviewing an LLM/MCP tool in Trilium (the defineTools definitions under packages/trilium-core/src/services/llm/tools/ —…

    38k GitHub stars~2.5k tokensUpdated today
    Testing & QAAuto-check passed
  • Concept Page Test Writer

    leonardomso/33-js-concepts

    Generates Vitest tests for every runnable code example on a JavaScript concept documentation page, following a four-phase extraction and conversion process.

    67k GitHub stars~5.5k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Archestra Dev Testing

    archestra-ai/archestra

    A skill your agent uses for test selection and quality across backend, frontend, and e2e; load its backend reference for Vitest projects, mocking, DB fixtures, and performance.

    4.4k GitHub stars~3.2k tokensUpdated today
    Testing & QAAuto-check passed

More from moeru-ai/airi

All 24 skills in this repo
  • Simple English

    moeru-ai/airi

    Write or rewrite technical text with the rules of ASD-STE100 Simplified Technical English so it is clear, unambiguous, and free of AI slop.

    50k GitHub starsUsed in 2 repos~4.6k tokens
    Auto-check passed
  • Review pending AIRI translations on Crowdin in a batch, then sync them into the repository.

    50k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Upload a local image or file to GitHub's user-attachments storage and return a URL suitable for issue, pull request, discussion, or comment Markdown.

    50k GitHub stars~554 tokensUpdated today
    Auto-check passed
  • Create PR

    moeru-ai/airi

    Prepare and create an AIRI pull request with verifiable change context, architecture evidence, and required visual evidence.

    50k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Test AIRI display-model imports with agent-browser across stage-tamagotchi Electron, stage-web, and stage-pocket mobile web layouts.

    50k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when Codex needs to inspect, debug, or automate an Electron app through agent-browser and Chrome DevTools Protocol, especially when the app has multiple BrowserWindow…

    50k GitHub stars~3.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Enforce Rules For Vitest

What does Enforce Rules For Vitest do?

Enforce AIRI's testing and Vitest practices in the AIRI monorepo. Enforce Rules For Vitest is an agent skill from moeru-ai/airi. Enforce AIRI's testing and Vitest practices in the AIRI monorepo.

When should I use Enforce Rules For Vitest?

Enforce Rules For Vitest fits situations like: you reproduce a reported bug; change Vitest configuration; diagnose test import and runtime-boundary failures.

How do I install Enforce Rules For Vitest in Claude Code?

Run `npx skills add moeru-ai/airi --skill enforce-rules-for-vitest -a claude-code`. Or copy the skill folder (.agents/skills/enforce-rules-for-vitest in moeru-ai/airi) into .claude/skills/enforce-rules-for-vitest in your project. Claude Code loads it when a task matches its description.

How do I install Enforce Rules For Vitest in Codex?

Run `npx skills add moeru-ai/airi --skill enforce-rules-for-vitest -a codex`. Or copy the skill folder (.agents/skills/enforce-rules-for-vitest in moeru-ai/airi) into .agents/skills/enforce-rules-for-vitest in your project. Codex loads it when a task matches its description.

Can I use Enforce Rules For Vitest in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add moeru-ai/airi --skill enforce-rules-for-vitest -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/enforce-rules-for-vitest, .gemini/skills/enforce-rules-for-vitest, .github/skills/enforce-rules-for-vitest and .opencode/skills/enforce-rules-for-vitest in your project.

What does Enforce Rules For Vitest need to run?

SKILL.md names no scripts, command-line tools or credentials: Enforce Rules For Vitest is instructions for the agent only.

Does Enforce Rules For Vitest access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Enforce Rules For Vitest safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Enforce Rules For Vitest use?

Enforce Rules For Vitest is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Enforce Rules For Vitest use?

About 951 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Enforce Rules For Vitest?

Skills that share tags, products or a category with Enforce Rules For Vitest: Test Writing Workflow (iOfficeAI/AionUi, 33k stars), Vitest (supabase/supabase, 111k stars), Test Guard (amElnagdy/guard-skills, 1.3k stars) and Adding LLM MCP Tools (TriliumNext/Trilium, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Enforce Rules For Vitest?

moeru-ai (a GitHub organization) maintains it in moeru-ai/airi, which has 50,267 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 11, 2026.

Source: moeru-ai/airi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.