test-first-executor
Skill9 starsChanged 3 months agoMITView on GitHub
Write or update tests before (or alongside) implementation. Ensures every code change is verifiably correct before merging.
In this repository109 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/agents.mdAGENTS.md
- agent/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- router/CLAUDE.mdCLAUDE.md
- .agents/skills/llms.txtllms.txt
- agent-harnessSkill
- auto-fixSkill
- brain-dumpSkill
- industrial-brutalist-uiSkill
- changelog-enforcerSkill
- checkpoint-strategySkill
- context-primeSkill
- cooldown-resumeSkill
- council-reviewSkill
- data-quality-auditSkill
- debug-tracerSkill
- dependency-auditSkill
- deslopSkill
- docs-syncSkill
- duplicate-threadSkill
- email-triageSkill
- fabric-patternsSkill
- feature-flagSkill
- git-hygieneSkill
- graphifySkill
- implementation-plannerSkill
- insightsSkill
- issue-resolverSkill
- learn-ruleSkill
- local-ai-querySkill
- lr-schedule-advisorSkill
- minimalist-uiSkill
- modularity-reviewSkill
- full-output-enforcementSkill
- parallel-agentsSkill
- parallel-worktreesSkill
- prompt-librarySkill
- prompt-transparencySkill
- pro-workflowSkill
- redesign-existing-projectsSkill
- release-readinessSkill
- replay-learningsSkill
- repo-memory-updaterSkill
- repowise-intelligenceSkill
- researchSkill
- resource-panelSkill
- risky-module-reviewSkill
- sandboxed-execSkill
- scope-guardSkill
- self-improveSkill
- session-handoffSkill
- skill-composerSkill
- smart-commitSkill
- high-end-visual-designSkill
- stitch-design-tasteSkill
- system-prompt-auditSkill
- task-alive-updatesSkill
- task-scoperSkill
- design-taste-frontendSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Use this skill whenever:
- Distinctive: line 87
All pre-existing tests must still pass.
- Distinctive: line 92
Write a test that specifically exercises the security boundary.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: test-first-executor
When to Use
Use this skill whenever:
- Adding a new function, class, or FastAPI endpoint
- Fixing a bug (regression test required)
- Adding a new agent tool or router capability
- A reviewer asks "where are the tests?"
Instructions
Step 1 — Identify what needs testing
- What is the expected input/output?
- What are the failure modes?
- Is there a risky edge case (empty input, auth bypass, model unavailability)?
Step 2 — Write the test first
For this repo, tests live in tests/. Match the pattern:
tests/test_<module>.py # mirrors src module nameTest structure template:
"""Tests for <module>.<Class>."""
from __future__ import annotations
import pytest
# imports
# ── Fixtures ──────────────────────────────────────────────────────────────────
@pytest.fixture
def some_fixture():
...
# ── Happy path ────────────────────────────────────────────────────────────────
def test_<function>_<expected_outcome>():
...
# ── Edge cases ────────────────────────────────────────────────────────────────
def test_<function>_raises_on_<bad_input>():
with pytest.raises(SomeError):
...
# ── Regression ────────────────────────────────────────────────────────────────
def test_regression_<issue_description>():
# Previously this caused <symptom>. Fixed in <commit/version>.
...Step 3 — Confirm the test FAILS before implementation
Run pytest -x tests/test_<module>.py::test_<name>.
A test that passes immediately (before implementation) is not testing the right thing.
Step 4 — Implement until the test passes
Step 5 — Run the full suite
pytest -xAll pre-existing tests must still pass.
Step 6 — Check coverage of risky paths
For any change to admin_auth.py, key_store.py, agent/tools.py:
- Write a test that specifically exercises the security boundary.
- Confirm the test would catch a regression if the boundary were removed.
Acceptance Checks
- Test file exists for the changed module
- New test covers the new behaviour
- Test was run and passed
- No pre-existing test was broken
- Regression test added for any bug fix
pytest -xexits 0
Test File Map
| Module | Test file |
proxy.py | tests/test_agent_api.py |
agent/loop.py | tests/test_agent_runner.py |
agent/tools.py | tests/test_agent_tools.py |
router/ | tests/test_model_router.py |
| new modules | tests/test_<module_name>.py |
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.

