/mthines-agent-skills:tdd [after | provenance] [<feature-description> | <test files>]from mthines-agent-skills
Enforces strict RED-GREEN-REFACTOR test-driven development: one failing test at a time, minimal code to pass, then refactor with quality checks. Supports test-first, test-after, and provenance modes.
Ships in mthines-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Enforce strict RED-GREEN-REFACTOR discipline. One test at a time. Tests describe WHAT the system does, never HOW.
Lens-eligible for the pr-reviewer agent: lens.md auto-loads when a diff changes tests.
Check $ARGUMENTS for the feature or behavior description.
$ARGUMENTS contains a feature description, use it directly.$ARGUMENTS starts with provenance, run only the provenance check on the named or changed test files. See rules/test-provenance.md.$ARGUMENTS contains "after" (e.g., /tdd after), run in Test-After Mode — write tests for existing code. See rules/test-after.md.$ARGUMENTS is empty, ask the user what behavior they want to implement or test.Before writing any tests:
**/*.test.*, **/*.spec.*, **/*_test.*, **/test_*.*, **/tests/** to identify the test framework, naming conventions, and directory structure.package.json scripts, Makefile, pyproject.toml, Cargo.toml, go.mod, or similar for the test command.TEST_CMD for use throughout the cycle. If you can run a single test file or test case, prefer that over the full suite.If no tests exist yet, ask the user which framework to use before proceeding.
Before diving into implementation, identify what matters most:
Present the test list to the user for confirmation before starting the cycle.
For each item in the test list, execute one full cycle. Follow the rules strictly:
See rules/red.md
Write exactly ONE failing test. Run it. Confirm it fails with the expected error. Do NOT write implementation code.
See rules/green.md
Write the MINIMUM code to make the failing test pass. No more. Run the test. Confirm it passes. Run the full relevant test suite to check for regressions.
Even in this phase, apply the basic readability primitives while you write: meaningful names, guard clauses for the cases the test forces, no nesting beyond 2 levels. These cost almost nothing during authoring but are expensive to bolt on later. Don't optimize, abstract, or add unrequested features — REFACTOR will handle deeper improvements.
See rules/refactor.md
Evaluate whether refactoring is needed. If yes, refactor while keeping all tests green. If no, move to the next cycle.
Judge the GREEN output against the quality checklist in rules/refactor.md — readability, nesting, naming, duplication and reuse, and neighbour-pattern match — and apply one named move at a time (e.g., "Extract Guarded Function", "Consolidate Parallel Maps"). Name each move in commit messages so reviews are reproducible.
After each RED-GREEN-REFACTOR cycle:
After all items in the test list are complete:
setTimeout works, that React renders, or that Go's http.ListenAndServe starts. Test YOUR code.pr-reviewer lens, is lens.md.buildUser(overrides?) patterns instead of inline object literals scattered across tests.Follow the project's existing convention. If none exists, use:
should [expected behavior] when [condition]describe('createOrder') → it('should reject order when inventory is zero')Apply these primitives inline during GREEN; walk the full checklist in rules/refactor.md during REFACTOR.
GREEN-phase primitives (apply inline while writing the minimal implementation):
ifs — flat code is easier to read and easier to test.pendingOrders beats arr2.For REFACTOR, address each checklist finding as a separate refactoring move (one change at a time per the "Procedure" below), and name the move in the commit message.
| Anti-Pattern | Why It's Bad | What to Do Instead |
|---|---|---|
| Writing tests in bulk | Tests imagined behavior, not observed | One test per cycle |
| Testing and implementing together | Unconsciously designs tests around implementation | Strict phase separation |
| "Make sure tests pass" prompt | Encourages implementation-first thinking | "Write a FAILING test" |
| Changing test expectations to pass | Masks real bugs | Fix the source code |
| Testing private methods | Couples tests to implementation | Test through public API |
| Copy-pasting mock setup | Brittle, hard to maintain | Extract shared fixtures |
| Asserting a mock's return value | Passes whatever the code does | Assert what the code computed from it |
| Expected value computed with the code's own formula | Breaks in step with the bug | Write the expected value as a literal |
| Many tests on trivial code, none on the new error branch | Volume without coverage | One test per behaviour, branches first |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tdd, red-green-refactor, test-first, test-after, test-provenance
Generated from the plugin's indexed repository (mthines/agent-skills) — no native marketplace selected
npx claudepluginhub p/mthines-mthines-agent-skills54 skills in this plugin
/ai-engineeringReviews and guides LLM/AI application engineering — prompts, caching, RAG, agent loops and tools, resilience, model migration, evals, prompt-injection defence, and observability. Invoke with /ai-engineering for "review my prompt", "set up RAG", or "write evals".
/animationsAuthors performant CSS-first web animations and picks the right feedback for an interaction — transitions, View Transitions, scroll-driven motion, Motion for React, reduced motion, and perceived performance. Triggers on "animate this", "hover effect", "feel faster", "skeleton loader", "/animations".
/animations-nativeAuthors performant React Native / Expo animations and gestures with Reanimated and react-native-gesture-handler on the UI thread; web animations go to `animations`. Triggers on "reanimated", "react native animation", "gesture handler", "swipe gesture", "/animations-native".
/atelierTakes one change from request to merged PR by sequencing existing skills — aw builds the draft PR, prepare gets it green, a deterministic gate allows the squash-merge only when a user-visible diff that needs a rollout ships behind a deployment-verify flag contract, or a small one carries a classed no-flag marker (and, in a repo with a hosted service, every diff carries a contract or an opt-out) — then reads the default-branch pipeline, fixes a red one once, verifies a no-flag change on the deploy with deployment-verify, and says what a human does next. Resumable from a sticky PR comment; invoke with /atelier.
/attach-mediaUploads local screenshots and recordings to GitHub and embeds them in a PR or issue body or comment as inline-rendering user-attachments URLs, via `gh --attach` with a curl fallback; never writes placeholders. Triggers on "attach screenshots to the PR", "upload this recording to the PR", "/attach-media".
/autonomous-workflowThe phase machinery (0–7) behind the `aw` dispatcher: task intake through a tested draft PR in an isolated worktree, gated by the plan.md brief and the run-checks.mjs sentinel, with companions that never block. Not the entry point — natural-language requests for autonomous work go to the `aw` skill; invoke /autonomous-workflow only to run the phases directly.
Other plugins' skills for the same job