agentleFS
standardbeaglestandardbeagle/mcp-tui/.claude/skills/implement-slice/SKILL.md

implement-slice

Skill15 starsChanged 6 days agoMITView on GitHub

This skill should be used when the user asks to "implement a feature", "add a feature", "build a feature", "create a new feature", or mentions "vertical slice", "TDD implementation", "red green", or "implement with tests". Guides strict RED/GREEN/REFACTOR implementation through vertical slices.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. Koroqe/claude-code-sdlc★ 52same name
    2. kpblcaoo/agent-skills★ 1same name

    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 repository5 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 18 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing any code:

    line 13
  2. Very specific:

    Read .claude/rules/architecture.md for active patterns and constraints

    line 16
  3. Very specific:

    Read .claude/rules/tdd.md for TDD discipline rules

    line 17
  4. Distinctive:

    Verify the feature is small enough for one vertical slice (if not, split first)

    line 19
  5. Distinctive:

    Write one end-to-end smoke test for the core user journey at HIGHEST fidelity.

    line 23
  6. Distinctive:

    NO mocks, stubs, or simulations

    line 28
  7. Distinctive:

    Test the complete user journey from entry to exit

    line 29
  8. Distinctive:

    Run it — it MUST FAIL (RED) because the feature doesn't exist yet

    line 30
  9. Distinctive:

    Write the simplest test that describes the next behavior.

    line 71
  10. Distinctive:

    Test at the RIGHT level — don't use e2e for logic testing

    line 76
  11. Distinctive:

    Write the MINIMUM code to make this ONE test pass.

    line 82
  12. Distinctive:

    No error handling unless a RED test demands it

    line 84
  13. Distinctive:

    No abstractions unless a RED test demands them

    line 85
  14. Distinctive:

    If you feel the urge to write more, write a RED test for it first

    line 87
  15. Distinctive:

    All tests are GREEN. Now clean up:

    line 93
  16. Distinctive:

    Run tests after EVERY change — any RED means undo immediately

    line 98
  17. Distinctive:

    Write a RED test for the missing behavior

    line 111
  18. Distinctive:

    Add tests for edge cases and error paths.

    line 119
  19. Distinctive:

    If distribution is off, add tests for the underrepresented tier.

    line 149
  20. Distinctive:

    Before considering the slice complete:

    line 153

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- Generated by dev-standards plugin. Customize as needed. -->

Implement Vertical Slice (TDD)

Implement a feature as a complete vertical slice using strict RED/GREEN/REFACTOR discipline. Each slice delivers working functionality through all layers — not a horizontal layer across features.

Pre-Flight Checks

Before writing any code:

  1. Confirm the feature scope and acceptance criteria with the user
  2. Read .claude/rules/architecture.md for active patterns and constraints
  3. Read .claude/rules/tdd.md for TDD discipline rules
  4. Identify which layers this slice touches (validation, logic, data, API, UI)
  5. Verify the feature is small enough for one vertical slice (if not, split first)

Step 1 -- Write the Smoke Test (RED)

Write one end-to-end smoke test for the core user journey at HIGHEST fidelity.

Smoke Test Rules

  • Full e2e — real UI (if applicable), real backend, real database
  • NO mocks, stubs, or simulations
  • Test the complete user journey from entry to exit
  • Run it — it MUST FAIL (RED) because the feature doesn't exist yet
# Example: "User can create a post"
test("user creates a post and sees it in the list"):
  navigate to /posts/new
  fill in title and body
  click submit
  assert redirected to /posts
  assert new post appears in list

Run with: go test (CLI subprocess + live MCP servers: npx server-everything, test-servers/*.js)

Commit: RED: Smoke test for [feature]

Step 2 -- Identify the Thinnest Slice

Break the feature into the smallest possible behavior increments. Each increment is ONE RED/GREEN/REFACTOR cycle.

Slice Planning

List the behaviors in implementation order (dependencies first):

Example for "User can create a post":
  1. Post validation rejects empty title (pure logic)
  2. Post can be persisted to database (data layer)
  3. API endpoint accepts POST /posts (API layer)
  4. UI form submits to API (presentation layer)
  5. Success redirects to post list (navigation)

Each behavior becomes one TDD cycle. Order matters — build from the inside out, but always as a vertical slice (not all validation first, then all data, then all API).

Step 3 -- RED/GREEN/REFACTOR Each Behavior

For EACH behavior in the slice:

3a. RED — Write ONE Failing Test

Write the simplest test that describes the next behavior. Run it. Confirm RED.

  • Unit test for pure logic (validation, transformation, calculation)
  • Integration test for data layer (real database, no mocks)
  • API test for endpoint (HTTP request/response)
  • Test at the RIGHT level — don't use e2e for logic testing

Commit: RED: Test for [behavior]

3b. GREEN — Minimum Implementation

Write the MINIMUM code to make this ONE test pass. Nothing more.

  • No error handling unless a RED test demands it
  • No abstractions unless a RED test demands them
  • No "while I'm here" additions
  • If you feel the urge to write more, write a RED test for it first

Commit: GREEN: [behavior] implemented

3c. REFACTOR — Clean Up Under GREEN

All tests are GREEN. Now clean up:

  • Extract duplicated code
  • Rename for clarity
  • Simplify structure
  • Run tests after EVERY change — any RED means undo immediately

Commit: REFACTOR: [what changed]

Repeat

Move to the next behavior. Continue until all behaviors are GREEN.

Step 4 -- Verify the Smoke Test (GREEN)

The smoke test from Step 1 should now pass. If not:

  1. Identify what's missing (the smoke test tells you)
  2. Write a RED test for the missing behavior
  3. Implement GREEN
  4. Repeat until the smoke test is GREEN

Commit: GREEN: Smoke test passes — [feature] complete

Step 5 -- Edge Cases and Error Paths

Add tests for edge cases and error paths. Each follows the RED/GREEN cycle:

Edge Cases to Cover

  • Empty/null/whitespace inputs
  • Boundary values (0, -1, max, min)
  • Duplicate operations (submit twice)
  • Concurrent access (two users at once)
  • Large inputs (10K characters, 10K items)

Error Paths to Cover

  • Validation failures (each field, each rule)
  • Authorization failures (wrong role, expired session)
  • External service failures (if applicable)
  • Database constraint violations

Each edge case: RED test -> GREEN implementation -> commit.

Step 6 -- Verify Test Distribution

Count your tests and verify distribution:

Target:
  Happy path: 50-60%
  Edge cases: 25-30%
  Adversarial: 10-15%

If distribution is off, add tests for the underrepresented tier.

Step 7 -- Final Verification

Before considering the slice complete:

  • Smoke test passes at full e2e fidelity
  • Every test was seen RED before GREEN
  • All tests pass (unit + integration + e2e)
  • Test distribution is on target
  • No TODO/FIXME markers in new code
  • No debug statements
  • Code follows existing codebase patterns
  • No scope creep beyond acceptance criteria
  • No abstractions with single implementations
  • Linting passes with zero errors

Anti-Patterns to Reject

  • Writing all tests first, then all implementation (batch TDD is not TDD)
  • Building all database models, then all APIs, then all UI (horizontal layers)
  • Skipping RED verification ("I know the test will fail")
  • Writing more than minimum GREEN ("while I'm here...")
  • Refactoring while RED ("I'll fix it after this test passes")
  • Mocking internal code instead of testing through it

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.