Agent skill

Write Compartment Tests

by compartmentdev in compartmentdev/compartment

Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror…

Apache-2.0Auto-check passedDevelopment

Install Write Compartment Tests

skills CLI
$ npx skills add compartmentdev/compartment --skill write-compartment-tests -a claude-code

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

GitHub CLI
$ gh skill install compartmentdev/compartment write-compartment-tests --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/compartmentdev/compartment.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/write-compartment-tests .claude/skills/write-compartment-tests && 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
write-compartment-tests
GitHub stars
205
Token cost
~1.1k tokens
SKILL.md length
553 words
Files
2
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror…

  • Works in 5 steps: Identify the owning package, boundary,… → Launch the fast review subagent when… → Delete or collapse mirror tests before… → …
  • Tasks that involve Refactoring
  • Calls pnpm and git

What it does

Write Compartment Tests is an agent skill from compartmentdev/compartment. Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror tests.

Its SKILL.md is about 1.1k 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 Development, covering Refactoring. The repository describes itself as: Compartment is a self-hosted deployment system for small software on infrastructure your team controls. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/write-compartment-tests”

Workflow steps

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

  1. Identify the owning package, boundary, user-visible behavior, and the smallest meaningful coverage surface.
  2. Launch the fast review subagent when allowed and keep moving on ownership and harness prep in parallel; otherwise do the same review in…
  3. Delete or collapse mirror tests before adding replacements.
  4. Choose the thickest harness that still matches the change scope.
  5. Add or refactor only the tests that protect the real contract, not the current implementation shape.

What it can do on your machine

Read from SKILL.md and the folder at commit 15373e7. 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

    Shell commands in SKILL.md call:

    • pnpm
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use pnpm and git, which can reach the network depending on how they are called.

    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

Write Compartment Tests loads about 1.1k tokens when it runs. Until then it costs about 57 tokens; SKILL.md has 553 words of instructions outside code blocks.

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

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 compartmentdev/compartment at commit 15373e7, republished under its Apache-2.0 licence (© compartmentdev). 553 words, ~1,073 tokens.

Download SKILL.mdSave it as .claude/skills/write-compartment-tests/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
write-compartment-tests
description
Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror tests.

Review And Write Compartment Tests

Use this skill when adding, refactoring, deleting, or reviewing tests in this repo.

Read first:

  • AGENTS.md
  • docs/layers/test-support.md
  • the owning layer doc

Start with a review pass:

  • When tool policy and the user's request allow subagents, launch one dedicated fast test-review subagent.
  • Do not choose or name a model, reasoning effort, speed, latency, or quality mode in this skill.
  • Let the review subagent inherit the user's current session configuration. If the client requires explicit values, pass only the current user-selected values exposed by the client/runtime.
  • Prefer a subagent type that preserves the current user-selected configuration.
  • Give that subagent only the relevant diff, files, or planned test surface and ask it to check for implementation-mirror coverage, missing thicker behavior coverage, wrong harness ownership, test-only seams, and over-validation.
  • Keep the main agent as the integrator. While the review pass runs, the main agent may continue with ownership, harness selection, and fixture audit. Merge the findings before finalizing test edits.
  • If subagents are not allowed or not available, do the same review in the main agent before editing tests.

Hard bans:

  • mocked plumbing, call order, forwarded argument bags, ORM/query-builder shapes;
  • command or route shells that only prove already parsed input was passed through;
  • tests that only say "if I pass X and mock everything, I get mocked X back";
  • any case that forces test-only exports, dependency bags, or widened runtime APIs. If that is all the test does, delete it or replace it with thicker coverage.

Keep:

  • user-visible behavior;
  • business invariants;
  • boundary validation and output shaping;
  • cross-layer flows covered through integration or e2e. Prefer one thicker behavior test over several thin mirrors.

Workflow:

  1. Identify the owning package, boundary, user-visible behavior, and the smallest meaningful coverage surface.
  2. Launch the fast review subagent when allowed and keep moving on ownership and harness prep in parallel; otherwise do the same review in the main agent.
  3. Delete or collapse mirror tests before adding replacements.
  4. Choose the thickest harness that still matches the change scope.
  5. Add or refactor only the tests that protect the real contract, not the current implementation shape.
Show full SKILL.md (201 more words)Show less

Scope:

  • pure helper or service test for local invariant-only logic;
  • command or route test for boundary behavior;
  • package integration test for multi-step API behavior;
  • DB-backed or system/e2e test for deploy, runtime, and auth flows.

Ownership:

  • @compartment/test-support: DB lifecycle, env sandbox helpers, and free ports.
  • package test/: command, route, integration, and system-test harnesses.
  • *-test.fixtures.ts: repeated builders and fixtures.
  • *-test.harness.ts: repeated execution helpers.

Copy these patterns:

  • packages/cli/test/cli-test.harness.ts
  • packages/cli/test/cli-test.fixtures.ts
  • packages/api/test/api-route-test.harness.ts
  • packages/api/test/api-integration.harness.ts

Boundaries:

  • no new cross-package relative imports in tests;
  • no runtime exports only for tests;
  • if a cross-package dependency is unavoidable, declare it in the owning package package.json.

Validate:

  • run narrow pnpm lint, pnpm typecheck, pnpm test;
  • let git commit run the repo-wide hook checks, and keep manual validation here focused on the current test surface;
  • run pnpm test:db for DB-backed API integration or CLI smoke flows;
  • run the focused k3d e2e suite for deploy or runtime changes;
  • when browser-visible compartment coverage matters, and the current run is not already the delegated smoke pass, prefer delegating $compartment-smoke-test to a dedicated fast subagent that inherits the user's current session configuration once local checks are stable;
  • if subagents are not allowed or not available, run the smoke directly or state clearly that browser smoke remains unrun;

© compartmentdev, Apache-2.0. 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 .codex/skills/write-compartment-tests of compartmentdev/compartment.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit 15373e7

Compare with similar skills

Write Compartment Tests 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.

Write Compartment Tests compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Write Compartment Tests this skillcompartmentdev/compartment205—~1.1kAutomated safety check: PassApache-2.0
Bootui Java Developmentjdubois/boot-ui307—~1.3kAutomated safety check: PassApache-2.0
Atomui Control OptimizationAtomUI/AtomUI842—~3.4kAutomated safety check: PassLGPL-3.0
Go Standardsasymmetric-research/solana-exporter133—~1.6kAutomated safety check: PassApache-2.0
Crowdin API Clientcrowdin/crowdin-cli320—~1.1kAutomated safety check: PassMIT
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT

Similar skills

  • A skill your agent uses when implementing, debugging, refactoring, or testing existing BootUI Java code, including framework-neutral engine logic, Spring MVC and WebFlux adapters, Quarkus runtime…

    307 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • A skill your agent uses when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…

    842 GitHub stars~3.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Go Standards

    asymmetric-research/solana-exporter

    Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.

    133 GitHub stars~1.6k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Crowdin API Client

    crowdin/crowdin-cli

    A skill your agent uses when implementing, refactoring, or reviewing @crowdin/crowdin-api-client usage in any JavaScript or TypeScript project, especially for endpoint selection, request/response…

    320 GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Pre PR Ablation

    PopupMaker/Popup-Maker

    Use before finalizing or opening/updating a PR for non-trivial code changes, especially third-party integrations, compatibility layers, hooks and filters, lifecycle code, providers, abstractions…

    110 GitHub stars~2.5k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from compartmentdev/compartment

All 12 skills in this repo
  • Audit Type Ownership

    compartmentdev/compartment

    Audit type ownership and boundary placement in the compartment repo: misplaced or duplicated types, query/service leaks, root export surface, and phased move plans.

    205 GitHub stars~745 tokensUpdated 1 mo ago
    Auto-check passed
  • Open PR And Monitor

    compartmentdev/compartment

    Open or reuse a repo PR and monitor it with a five-minute Codex heartbeat until it is ready, terminal, or blocked.

    205 GitHub stars~470 tokensUpdated 1 mo ago
    Auto-check passed
  • Review A Change

    compartmentdev/compartment

    A skill your agent uses when the user invokes $review-a-change or asks for a compartment repo code review; always use the delegated subagent review path by splitting review into separate parallel…

    205 GitHub stars~1.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Review Reuse And Dedup

    compartmentdev/compartment

    A skill your agent uses when reviewing compartment repo changes for existing helper reuse, extractable pure utilities, duplicated logic, repeated constants, hardcoded values, or repeated variable…

    205 GitHub stars~753 tokensUpdated 1 mo ago
    Auto-check passed
  • Compartment Smoke Test

    compartmentdev/compartment

    Run or delegate a browser-first smoke test of the local compartment through browser-use as a real user: boot or reuse the local stack, install or log in, deploy the repo smoke fixtures, verify CLI…

    205 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check: notes
  • Develop A Feature

    compartmentdev/compartment

    Implement repo changes by starting with preflight feature review, then editing the smallest owning surface on one canonical path and running only diff-triggered checks.

    205 GitHub stars~554 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Write Compartment Tests

What does Write Compartment Tests do?

Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror…. Write Compartment Tests is an agent skill from compartmentdev/compartment. Review, write, or refactor compartment repo tests by starting with a fast independent test-review pass, protecting behavior, using the right package-owned harness, and refusing implementation-mirror tests.

When should I use Write Compartment Tests?

Write Compartment Tests fits situations like: tasks that involve Refactoring.

How do I install Write Compartment Tests in Claude Code?

Run `npx skills add compartmentdev/compartment --skill write-compartment-tests -a claude-code`. Or copy the skill folder (.codex/skills/write-compartment-tests in compartmentdev/compartment) into .claude/skills/write-compartment-tests in your project. Claude Code loads it when a task matches its description.

How do I install Write Compartment Tests in Codex?

Run `npx skills add compartmentdev/compartment --skill write-compartment-tests -a codex`. Or copy the skill folder (.codex/skills/write-compartment-tests in compartmentdev/compartment) into .agents/skills/write-compartment-tests in your project. Codex loads it when a task matches its description.

Can I use Write Compartment Tests 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 compartmentdev/compartment --skill write-compartment-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/write-compartment-tests, .gemini/skills/write-compartment-tests, .github/skills/write-compartment-tests and .opencode/skills/write-compartment-tests in your project.

What does Write Compartment Tests need to run?

Going by SKILL.md and its folder, Write Compartment Tests needs the command-line tools its instructions call (pnpm and git).

Does Write Compartment Tests access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Write Compartment Tests 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 Write Compartment Tests use?

Write Compartment Tests is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Write Compartment Tests use?

About 1.1k tokens (SKILL.md is roughly 4.3k 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 Write Compartment Tests?

Skills that share tags, products or a category with Write Compartment Tests: Bootui Java Development (jdubois/boot-ui, 307 stars), Atomui Control Optimization (AtomUI/AtomUI, 842 stars), Go Standards (asymmetric-research/solana-exporter, 133 stars) and Crowdin API Client (crowdin/crowdin-cli, 320 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Write Compartment Tests?

compartmentdev (a GitHub organization) maintains it in compartmentdev/compartment, which has 205 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on August 20, 2026.

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