skills/implement/SKILL.md
Use when the user asks to implement a feature, add a class or method, fix a bug, refactor code, add test coverage, or run autonomously to drive work forward. Supports explicit phase selection via the first argument (red | green | refactor | forever) and infers the phase from conversation and test state when no phase is given. With no arguments at all, defaults to forever (autonomous loop). Do NOT use for code review, CI/CD setup, testing questions, infrastructure, or documentation tasks.
npx skillsauth add mbarbieri/my-claude implementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enforces the Red-Green-Refactor cycle and the autonomous forever driver from a single entry point. Apply the Shared Rules section plus exactly one Phase section per invocation — do not read the other phase sections.
Read $ARGUMENTS (the user's input after the skill name).
No arguments at all → PHASE = forever. The user invoked /implement bare; they want the autonomous driver to find and execute work. This matches the intent of the old /forever.
First token matches {red, green, refactor, forever} (case-insensitive) → PHASE = that token. The remainder of $ARGUMENTS is CONTEXT (test name, implementation description, refactoring goal, or loop seed).
Arguments present but the first token is not a phase word → infer PHASE from the conversation and current test state:
redgreenrefactorforeverred (safest default; starts a fresh cycle)Before acting, state the chosen phase in one short line so the user can correct it:
Entering <PHASE> phase.
Then apply Shared Rules plus the matching Phase: <PHASE> section below. Do NOT apply rules from other phase sections — each phase has its own strictness contract and mixing them weakens enforcement.
NEVER create, read, or update plan.md files. Claude Code's internal planning files are disabled for this project. Use other methods to track implementation progress (e.g., comments, todo lists, or external tools).
If no CONTEXT was given and you need something to work on:
bd ready to see what to work on nextThe foundation is the Red-Green-Refactor cycle:
Red Phase: Write ONE failing test that describes desired behavior
Green Phase: Write MINIMAL code to make the test pass
Refactor Phase: Improve code structure while keeping tests green
Multiple Test Addition
Over-Implementation
Premature Implementation
Each step should address ONE specific issue:
In rare cases where the problem space, interface, or expected behavior is unclear, a Spike Phase may be used before the Red Phase. This is not part of the regular TDD workflow and must only be applied under exceptional circumstances.
Apply this section only if PHASE == red. If PHASE is anything else, skip this section entirely.
*.stories.tsx), group multiple assertions within a single test block to avoid redundant setup — but only when adding assertions to an existing interaction flow. If new user interactions are required, still create a new test. Split files by category if they exceed ~1000 lines.data-testid attributes to select elements rather than CSS classes, tag names, or text content.sleep() or timeout: 5000. Use proper async patterns (waitFor, findBy*, event-based sync) instead and rely on global test configs for timeout settings.Structure each test with clear phases:
Apply this section only if PHASE == green. If PHASE is anything else, skip this section entirely.
red for the next test.refactor afterwards.Apply this section only if PHASE == refactor. If PHASE is anything else, skip this section entirely.
green).Look for these refactoring opportunities:
When refactoring implementation, watch for Peeping Tom tests that:
If tests fail after a pure refactoring (no behavior change), consider whether the tests are testing implementation rather than behavior.
Look for inconsistent patterns, naming conventions, or structure across the codebase and align them while tests stay green.
Apply this section only if PHASE == forever. If PHASE is anything else, skip this section entirely.
Run autonomously, finding and completing work until interrupted or truly stuck.
Execute this cycle continuously:
Check in order until something is found:
bd ready for the next issueAfter completing a unit of work:
Do not stop unless:
| Situation | Action | |-----------|--------| | Test failures | Switch to GREEN sub-phase; make the failing tests pass | | Unclear requirements | Make a reasonable assumption, document it, proceed | | Build errors | Fix incrementally, commit fixes | | Context confusion | Re-read recent commits and task tracker to reorient | | Repeated failures | Try a different approach, or move to a different task |
When thinking about what to do:
Every few completed tasks:
This ensures work survives context limits.
development
Use when writing or refactoring Spock tests in Java projects - enforces data-driven testing with where blocks, proper mock/stub placement, and descriptive test names following Spock best practices
tools
Use when user provides Jira issue URLs or mentions Jira tickets - fetches issue details and comments from Jira Cloud using local jira tool, outputs AI-optimized markdown for context gathering
development
Use when writing, modifying, or reviewing Java code - applies SOLID principles, clean code practices, minimal documentation, and pragmatic abstraction to create maintainable Java applications
testing
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".