airi: Skill for Codex

.agents/skills/enforce-rules-for-vitest/SKILL.md

enforce-rules-for-vitest is a skill for Codex from moeru-ai/airi. It costs 74 tokens per session (624 once invoked), scanned A, original, MIT.

A set of rules for writing and debugging tests with Vitest, a JavaScript and TypeScript testing tool. It covers choosing the right test scope, reproducing bugs, and simulating external services safely.

In plain words
What is it for?
Use it when creating, reviewing, or debugging tests, reproducing reported bugs, changing Vitest settings, or mocking IPC, services, providers, platform APIs, and imports.
Why use it?
It helps tests check the smallest relevant part of the code while still reflecting real browser or application behavior. It also prevents tests from depending on real Electron services or other outside systems.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents).

This is moeru-ai/airi's own configuration. It tells Codex how to work on airi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything airi configures →

About the project

AIRI is a self-hosted virtual AI companion that gives an AI character a voice, visual presence, memory, and the ability to interact with games and coding activity. People use it as a personal digital companion on the web, macOS, or Windows, including for voice chat and gameplay. The catalogue add-ons provide workflows for working with the AIRI project.

moeru-ai/airi · 49,010 stars · on GitHub · airi.moeru.ai

Reuse

Borrowing it

Nothing to install: this file belongs to moeru-ai/airi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/moeru-ai/airi/main/.agents/skills/enforce-rules-for-vitest/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/moeru-ai/airi

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for enforce-rules-for-vitest

README.md
[![agentmods](https://agentmods.dev/badge/skills/moeru-ai/airi/enforce-rules-for-vitest/github.svg)](https://agentmods.dev/skills/moeru-ai/airi/enforce-rules-for-vitest)
Your own site
<a href="https://agentmods.dev/skills/moeru-ai/airi/enforce-rules-for-vitest"><img src="https://agentmods.dev/badge/skills/moeru-ai/airi/enforce-rules-for-vitest/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for enforce-rules-for-vitest

Your own site · 80×15
<a href="https://agentmods.dev/skills/moeru-ai/airi/enforce-rules-for-vitest"><img src="https://agentmods.dev/badge/skills/moeru-ai/airi/enforce-rules-for-vitest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 624 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.00624
Opus 5 $0.00037 $0.00312
Sonnet 5 $0.00015 $0.00125
Haiku 4.5 $0.00007 $0.00062

Measured 11d ago against content hash 14d8d3ffd20d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

enforce-rules-for-vitest 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 11d 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.

.agents/skills/enforce-rules-for-vitest/SKILL.md · 52 lines

How it starts

The opening of the file, as written. The whole thing — 52 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Enforce AIRI Vitest Rules

Apply these rules to every test change in AIRI.

Choose the Test Scope

  • Use the Vitest project that owns the affected code and 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.

Reproduce Bugs Before Fixing Them

  1. For an investigated bug or issue, try to add a test-only reproduction before changing 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 implementing the fix.

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 and, when feasible, integration-style tests guarded by environment variables, but do not mock Pinia, Vue components. Vitest import mocks are allowed for these boundaries.
  • Assert observable behavior, including mock calls and parameters, with explicit expect statements.
  • Prefer one assertion per line so failures remain readable.

Preserve Runtime Integrity

  • Do not test impossible runtime states. Avoid assertions against constants that cannot change or 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 or build a minimal CLI reproduction.
  • For DOM and Web Platform APIs, use Vitest browser mode instead of hard-mocking platform internals. Progressively refactor existing direct platform mocks when touched.

Read the full file on GitHub · 52 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 11d ago First seen · 52 lines · 74 tokens per session scan A 14d8d3ffd20d

Subscribe to this mod's changes

enforce-rules-for-vitest is a skill published in the GitHub repository moeru-ai/airi (49,010 stars, last pushed today), licensed MIT. It adds 74 tokens to every session and 624 once invoked, about $0.0004 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.