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.
- Author
- x-school-academy ↗
- Repository
- skill-pilot ↗
- Licence
- MIT
- Last repository change
- 07.06.2026
Assessment and security
- Files in this package
- 3
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 07.06.2026, without references to retired models or APIs.
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
- When to Use This Skill
- Your Roles in This Skill
- Role Communication
- Instructions
- Expected Output
- Key Principles
- Common Issues
- References
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
| Repository | Score | Licence |
|---|---|---|
| This page · x-school-academy/skill-pilot | 90 | MIT |
| onsi/biloba | 100 | MIT |
| runwield/runwield | 100 | MIT |
| dzhng/jevgrep | 100 | MIT |
| lukedj78/dev-flow | 100 | MIT |
| dzhng/skills | 100 | MIT |
| rowansci/rowan-python | 100 | MIT |
| yaohuangguan/agent-playbook | 100 | MIT |
| microsoft/semantic-link-labs | 100 | MIT |
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.