testing
Skill113 starsChanged 6 months agoMITView on GitHub
How to write and run fast, deterministic, behavior-focused pytest tests that never touch real external systems. Use whenever adding or changing behavior, or fixing a bug.
123 other projects use a version of this.
Adopted by
Most recently taken up by
- timmo001/skillstheir own version, first seen Oct 5, 2026
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- gilsmt/skillstheir own version, first seen Oct 4, 2026
- andeeplus/aplustheir own version, first seen Oct 4, 2026
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- shinpr/codex-workflowstheir own version, first seen Oct 2, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 4 projects that use this
ffsshhttiikkSkillnetworking
Practical application and coding skills for Networking
Also in 3 projects that use this
JohnJBorenSkillci-cd
CI/CD pipeline design, GitHub Actions, testing automation, and deployment strategies
Also in 9 projects that use this
Cogni-AI-OUSkilldotfiles
Reference for repository dotfiles, including their purposes, standard configurations, and usage guidelines. You MUST load this skill when configuring, troubleshooting, or understanding repository dotfiles.
Also in 3 projects that use this
- +2 more from CES-Ltd
- +1 more from ffsshhttiikk
Other versions123 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 123
- lobehub/lobehub★ 83ksame name
- iOfficeAI/AionUi★ 33ksame name
- JetBrains/intellij-community★ 21ksame name
- kortix-ai/suna★ 20ksame name
- modelcontextprotocol/inspector★ 11ksame name
- microsoft/fast★ 9.7ksame name
- bytebase/dbhub★ 3.6ksame name
- theopenco/llmgateway★ 1.7ksame name
- BankrBot/skills★ 1.2ksame name
- microsoft/CCF★ 875same name
113 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architecture-reviewSkill
- code-reviewSkill
- documentationSkill
- git-workflowSkill
- mcp-toolsSkill
- project-architectureSkill
- prompt-renderingSkill
- refactoringSkill
- runtime-engineSkill
- senior-python-engineeringSkill
- sidecar-auth-contextSkill
- skill-authoringSkill
- yaml-schemaSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 105 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Do not edit this file directly.
- Distinctive: line 41
No real external systems in unit tests: never call real LLMs, real MCP servers, real databases, or third-party APIs.
- Distinctive: line 46
Regression tests for bugs: every fixed bug gets a test that fails before the fix.
“Common” is measured: kept by at least 6 in 10 of the 105 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
This file is generated by tools/skills.
Do not edit this file directly.
Edit .ai/skills/testing.md and run `make generate-ai`.
-->Skill: Testing
Purpose
Define how to write and run tests for this Python project so that every meaningful behavior is covered by fast, deterministic, behavior-focused tests that never touch real external systems.
When to Use This Skill
- Adding or changing any behavior (tests accompany behavior — almost always).
- Fixing a bug (add a regression test first).
- Working on the test suite or quality gate (task
0012). - Reviewing whether a change is adequately tested.
Files to Read First
AGENTS.mddocs/DEVELOPMENT_WORKFLOW.mdpyproject.toml([tool.pytest.ini_options])- The skill for the area under test (runtime, prompts, plugins, tools, etc.).
Core Principles
- Use
pytest. Tests live undertests/, mirroringsrc/agentplatform/. - Test behavior through public interfaces, not private implementation details (test internals only when there is no public seam).
- No real external systems in unit tests: never call real LLMs, real MCP servers, real databases, or third-party APIs. Mock/fake them.
- Integration tests only when explicitly requested, and still without real secrets or live third-party calls — use fakes/local stand-ins.
- Deterministic: control time, randomness, and ordering.
- Regression tests for bugs: every fixed bug gets a test that fails before the fix.
Process
- Pick the category (see below) for what you are testing.
- Arrange with fixtures for repeated setup (specs, compiled graphs, fake
resolver/access plugins, fake tools). Use
@pytest.mark.parametrizefor input variations. - Mock external boundaries (LLM/MCP/DB/HTTP) at the adapter seam, not deep inside.
- Write behavior assertions: given input, assert observable output/effects.
- Cover negatives and security: invalid YAML/validation errors, missing required prompt variables, denied protected-node access, plugin errors.
- Run
make test(andmake checkfor the full gate). Fix failures.
Testing categories (use the right one)
- Unit tests — a single function/class via its public interface.
- Integration tests — multiple layers together (e.g. validate → compile → run) with fakes; only when requested.
- Contract tests — verify plugin contracts and the YAML schema match
docs/; catch drift early. - Golden example tests — a known YAML config produces a known compiled graph / rendered prompt; update goldens deliberately.
- Negative tests — invalid specs, missing variables, denied access must fail clearly with the right error.
- Security tests — protected access fail-closed, secrets redacted, no request-state leakage.
Example pytest structure (illustrative, not product tests)
import pytest
@pytest.fixture
def valid_spec_dict() -> dict:
return {"version": "1.0", "app": {"name": "demo"}, "...": "..."}
@pytest.mark.parametrize("missing_key", ["version", "app", "runtime"])
def test_validation_reports_missing_top_level_key(valid_spec_dict, missing_key):
data = dict(valid_spec_dict)
del data[missing_key]
result = validate_spec(data) # public interface
assert not result.ok
assert any(missing_key in e.message for e in result.errors)Do not implement real product tests in this task. Only trivial repository smoke tests (e.g. import + version) belong here until task
0001+ create code.
Checklist Before Finishing
- New/changed behavior has tests; bugs have regression tests.
- Tests target public interfaces and assert behavior, not internals.
- External systems are mocked/faked; no real LLM/MCP/DB/API calls.
- Negative and security cases covered where relevant.
- Tests are deterministic (time/randomness/order controlled).
- Fixtures/parametrization used to keep tests readable and DRY.
make test(andmake check) pass, or you state why they can't run.
Common Mistakes to Avoid
- Calling real LLMs/MCP/DBs/APIs in unit tests.
- Asserting on private attributes/log strings instead of behavior.
- Flaky tests depending on real time, randomness, or ordering.
- Over-mocking until the test asserts nothing meaningful.
- Skipping negative/security tests because the happy path passes.
- Committing secrets or production endpoints in fixtures.
Expected Final Report
State: which test files/categories were added or changed; what behaviors and
edge/negative/security cases are now covered; mocks/fakes used for external
boundaries; the result of make test / make check; and any coverage gaps
intentionally left for a later task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

