Write unit tests

From fieldsphere/cursor-team-marketplace-template · View interactive version

Write unit tests is an AI agent skill from the GitHub repository fieldsphere/cursor-team-marketplace-template. Write focused unit tests that match the repository's existing test stack and conventions. Use when the user asks for unit tests, logic coverage, regression coverage for functions or modules, or fast isolated test cases.

How to use this skill

Skill file

Write Unit Tests

Add or update unit tests that exercise logic, branching, edge cases, and failure modes without pulling in unnecessary end-to-end coverage.

Workflow

  1. Discover the existing unit-test framework, helpers, and file layout.
  2. Identify the exact functions, modules, or boundaries that changed.
  3. Cover the most important success paths, edge cases, and error behavior.
  4. Mock external I/O only at the boundaries already used by the repo.
  5. Run the narrowest relevant test command when possible.

Principles

Output

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.