Write compartment tests

From compartmentdev/compartment · View interactive version

Write compartment tests is an AI agent skill from the GitHub repository 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.

How to use this skill

Skill file

Review And Write Compartment Tests

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

Read first:

Start with a review pass:

Hard bans:

If that is all the test does, delete it or replace it with thicker coverage.

Keep:

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.

Scope:

Ownership:

Copy these patterns:

Boundaries:

Validate:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.