Skip to content
Skills Library
Programming · Building & coding

test-first-implementation

/test-first-implementation

Use when adding or changing behavior, fixing a bug whose cause is known, refactoring executable code, or implementing a feature, a tool, or a CLI option, even when the request never mentions tests or pastes the code inline.

Repository
megapowers ↗
Licence
MIT
Last repository change
25.10.2026

Assessment and security

100/ 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.
Content35 / 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
4
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 25.10.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

Use when adding or changing behavior, fixing a bug whose cause is known, refactoring executable code, or implementing a feature, a tool, or a CLI option, even when the request never mentions tests or pastes the code inline.

Original author description

Use when adding or changing behavior, fixing a bug whose cause is known, refactoring executable code, or implementing a feature, a tool, or a CLI option, even when the request never mentions tests or pastes the code inline.

How it works

  1. Red, green, refactor
  2. Code judgment
Original SKILL.md headings · 54 lines, 348 words
SKILL.md preview
---
name: test-first-implementation
description: Use when adding or changing behavior, fixing a bug whose cause is known, refactoring executable code, or implementing a feature, a tool, or a CLI option, even when the request never mentions tests or pastes the code inline.
when_to_use: "Trigger phrases: implement, add the feature, fix this bug, here is the function, change this so it never, make it return, add a flag or option, build a script or tool, refactor, make the tests pass, add tests for this."
metadata:
  short-description: Failing test first, then minimal implementation
---

# Test-First Implementation

Production code follows a failing test.

First inspect the entry point, callers, nearest convention, and coverage.
Use `systematic-debugging` for unknown causes.

## Red, green, refactor

Test real behavior at a stable observable boundary, not through mock assertions
or a side-channel query. Take expected values from the specification or a worked
example, never from a recomputation of the code. Confirm the test fails for the
missing behavior before writing production code; when you force red by mutating
code, diff against the pristine file to prove the mutation landed. Implement
only what satisfies that test without speculative options, abstractions, or
adjacent cleanup, run the focused test to confirm green, and refactor while
green before moving to the next behavior.

Understand dependencies before mocking. Do not add production APIs only for
tests. Run the broader suite at task or milestone completion, before claiming success.

## Code judgment

Before writing custom code, check existing code, the standard library, native
platform features, and installed dependencies. Require behavioral fit; justify
new dependencies by missing capability or maintenance benefit.

When simplifying changed code, preserve public contracts, trust-boundary
validation, data-loss error handling, security, accessibility, and required
tests. Do not sacrifice readability or correctness for line count. One caller
or implementation does not make a boundary unnecessary.

For a deliberate simplification with a known limit, comment its ceiling and
revisit condition using local conventions. Ordinary code needs no debt marker.

Validate untrusted data once at entry and make error ownership explicit:
expected, retryable, or terminal.

Load exactly one language reference when local code cannot settle a
language-specific engineering decision:

- Go: [references/go.md](references/go.md)
- Python: [references/python.md](references/python.md)
- TypeScript: [references/typescript.md](references/typescript.md)

For generated output, prototypes destined for deletion, or prose-only
configuration without executable behavior, use the nearest deterministic check.
A reversible, low-impact edit such as copy, styling, or a config value needs
the existing checks, not a new test; a test that restates the implementation
proves nothing. Never exempt product behavior. If a direct executable oracle beats a brittle
characterization test, record the exception. Confirm the pre-change deficiency
and run that oracle before and after the change.
Files in this package (4)
  • SKILL.md 3 KB
  • references/go.md 1 KB
  • references/python.md 1 KB
  • references/typescript.md 1 KB

Versions

RepositoryScoreLicence
This page · lawzava/megapowers100MIT
stark-ai-de/agent-skills90Apache-2.0

Database snapshot: 13.11.2026 · package version 8d9b403197e7 (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

  • 100test-first
    Use when implementing a feature, fixing a bug, refactoring, or changing behaviour in any codebase, before writing the production code that does it.
  • 100tdd
    Test-first implementation discipline. Use when adding a function or feature, fixing a bug, changing existing behavior, or when implementation code already exists with no test covering it.
  • 90test-first
    Write a failing test before the code that makes it pass. Use when adding a feature, fixing a bug, or changing behavior.
  • 100test-driven-development
    Use when implementing any feature, bug fix, refactor or behavior change, before writing implementation code. Write the failing test first, watch it fail, then write the minimal code to pass.
  • 96test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code
  • 100test-driven-development
    TDD red-green-refactor cycle, test structure, mocking patterns for Vitest/Jest. Use when starting a new feature, fixing a bug, or refactoring — write the test first, then the implementation.

Feedback and reports

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