Skip to content
Skills Library
Programming · Testing

write-tests

/write-tests

Write tests for project code using either real code tests or mock-up tests. Use when creating or updating tests, default to real code tests unless the user explicitly asks for mock-up tests.

Repository
skill-pilot ↗
Licence
MIT
Last repository change
07.06.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write tests for project code using either real code tests or mock-up tests. Use when creating or updating tests, default to real code tests unless the user explicitly asks for mock-up tests.

Original author description

Write tests for project code using either real code tests or mock-up tests. Use when creating or updating tests, default to real code tests unless the user explicitly asks for mock-up tests.

How it works

  1. When to Use This Skill
  2. Your Roles in This Skill
  3. Role Communication
  4. Instructions
  5. Expected Output
  6. Key Principles
  7. Common Issues
  8. References
Original SKILL.md headings · 85 lines, 517 words
SKILL.md preview
---
name: write-tests
description: Write tests for project code using either real code tests or mock-up tests. Use when creating or updating tests, default to real code tests unless the user explicitly asks for mock-up tests.
---

# AI Builder - Write Tests

Write tests for project code using the correct test style for the task.

## When to Use This Skill

- The user asks to create or update tests
- A function, module, or feature should be validated
- The user wants a unit test or integration-style code test
- Existing tests should be rewritten to match project testing rules

## Your Roles in This Skill

- **QA Engineer**: Define what behavior should be validated and choose the right test type
- **Backend Developer**: Trace the actual code path and implement the test cleanly
- **Technical Writer**: Keep test names, output, and assertions readable

## Role Communication

As an expert in your assigned roles, you must announce your actions before performing them using the following format:

As a {Role} [and {Role}, ...], I will {action description}

This communication pattern ensures transparency and allows for human-in-the-loop oversight at key decision points.

## Instructions

Follow these steps in order.

### Step 1: Choose the test type

- If the user explicitly says `mock`, `mock up`, `mock-up`, `monkeypatch`, `stub`, or otherwise asks for fake/test-double-based testing, use **mock-up test**
- If the user does not explicitly ask for mock-up testing, default to **real code test**
- If the correct test type is unclear, choose **real code test**

### Step 2: For Python code, place tests in the standard location

- For Python code under `core/engine`, write pytest tests under `core/engine/tests`
- Use `pytest` for Python tests
- Name a function test as `test_function_name`

### Step 3: Follow the matching reference

- For **real code test**, refer to `references/real-code-test.md`
- For **mock-up test**, refer to `references/mock-up-test.md`

### Step 4: Verify and report clearly

- Run the relevant test target after editing
- Print raw output in the test when the function or flow returns useful runtime details
- Ensure the chosen test runner invocation does not hide stdout when raw output should be inspected
- If the task needs output files, write them under `.skillpilot/tests` at the project root
- Report what was verified and what still depends on live external systems

## Expected Output

- A new or updated test file using the correct test style
- Python tests under `core/engine/tests` when testing `core/engine`
- Clear test names such as `test_function_name`
- Raw output printed when it helps inspect real behavior
- Any generated test output files stored under `.skillpilot/tests`

## Key Principles

- Default to real code tests
- Only use mock-up tests when the user explicitly asks
- Use pytest for Python tests in `core/engine/tests`
- Keep test names simple and direct
- Print raw output when inspecting behavior is part of the test goal

## Common Issues

- Wrong default:
  if the user did not explicitly ask for mock-up testing, use real code tests
- Wrong location for Python tests:
  place `core/engine` Python tests under `core/engine/tests`
- Hidden stdout in pytest:
  use a runner mode that shows raw output when the user wants to inspect it

## References

- For real code tests, refer to `references/real-code-test.md`
- For mock-up tests, refer to `references/mock-up-test.md`
Files in this package (3)
  • SKILL.md 3 KB
  • references/mock-up-test.md 1 KB
  • references/real-code-test.md 2 KB

Versions

RepositoryScoreLicence
This page · x-school-academy/skill-pilot90MIT
onsi/biloba100MIT
runwield/runwield100MIT
dzhng/jevgrep100MIT
lukedj78/dev-flow100MIT
dzhng/skills100MIT
rowansci/rowan-python100MIT
yaohuangguan/agent-playbook100MIT
microsoft/semantic-link-labs100MIT

Database snapshot: 13.11.2026 · package version 5920fff81972 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100v1-write-tests
    Use when writing unit tests for code changes or new functionality. Triggers on "write tests", "add tests", "test this code".
  • 100mobiai-write-tests
    Use when the user asks to write tests for mobile code, or after applying a fix that needs regression tests.
  • 90write-rust-tests
    Write Rust tests to verify correctness of Rust code. Use this when you want to write Rust tests.
  • 100mock-audit
    Use when writing, reviewing, or fixing tests that use mocks, patches, stubs, spies, jest.mock, vi.mock, unittest.mock, or MagicMock, and whenever a test asserts only that a mock was called. Flags tests that mock the unit under test, assert only on mocks, or mock so much that no…
  • 90test-audit
    Explain what a project's tests actually prove and what they miss. Use before shipping AI-written code, when tests pass but the user does not trust them, or when the user asks what their tests cover. Flags tests with no meaningful assertions, mock-only tests, skipped tests, and…
  • 100openlore-write-tests
    Write and run real tests for a function or spec scenario after reading implementation and contract evidence. Use when asked to add, improve, or repair tests without stubs or placeholders.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.