feature-coder
Skill1 starsChanged 4 months agoMITView on GitHub
Systematic feature development workflow for complex features and refactoring using planning-first TDD approach. Use when user asks to implement a feature, add functionality, refactor code, or build something complex that requires planning. Also trigger proactively when an implementation request has multiple steps, requires architectural decisions, or involves touching shared code. Triggers on "implement feature", "add functionality", "build this", "create this capability", "refactor", "refactoring", "clean up code", "unify code", "DRY".
In this repository5 other files it gives its agents.
- code-reviewerSkill
- designdoc-creatorSkill
- project-bootstrapperSkill
- python-async-scalingSkill
- python-tutorSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Stub test: Test body with only pass or # TODO — not yet implemented, not counted as passing
- Distinctive: line 25
Active test: Test with real assertions — the only kind that counts toward coverage
- Very specific: line 50
Write test stubs with pass bodies that define the expected API through tests — executable specifications.
- Very specific: line 56
Create skeletons of all modules, classes, and functions with complete signatures, docstrings, type hints, and raise NotImplementedError() …
- Distinctive: line 76
Run full test suite, move all imports to module level, refactor globals, run typecheck and linting.
- Distinctive: line 91
Use this instead of the 6-phase flow when the task is "clean up", "unify", or "DRY".
- Very specific: line 107
Ask: "Proceed? (yes/no/modify)"
- Distinctive: line 108
Only after "yes": apply, run tests, report results
- Distinctive: line 113
Run full test suite and typecheck.
- Distinctive: line 119
When starting any implementation, first propose test cases:
- Distinctive: line 138
Use TodoWrite to track phase progress.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Feature Coder
A disciplined workflow for implementing complex features and refactoring: plan first, test first, implement incrementally, validate continuously.
Core Principles
These principles exist because guessing wastes time — asking is always faster than fixing assumptions:
- Interactive first — Ask before acting. When requirements are ambiguous or multiple approaches are valid, present the options and wait. The user is the domain expert.
- Tests before code — Propose test cases, get approval, then implement. Tests define the contract and prevent guessing at intent.
- Plan before coding — Write a plan in markdown first; iterate until the user gives explicit approval before touching code.
- Incremental — Implement one piece at a time. Show diffs for each change; get approval before applying.
- Data model first — Define types and models before using them. Read actual data structures; never assume.
- Context managers always — Use
with/async withfor all resources. Never manual.close(). - Plain comments only — Use standard
#comments with normal ASCII characters. Never use decorative box-drawing or divider characters (e.g.═══════,───────,╔╗╚╝) to create visual section banners — these are a giveaway of AI-generated code, not something a human engineer writes.
Terminology
- Stub test: Test body with only
passor# TODO— not yet implemented, not counted as passing - Active test: Test with real assertions — the only kind that counts toward coverage
- Draft: Function skeleton with signature, docstring, and
raise NotImplementedError()
New Feature Workflow (6 Phases)
Phase 1: Planning (Documentation Only)
Interview the user about requirements, async/sync choice, caching opportunities, and constraints. Read existing code to understand patterns. Write {FEATURE_NAME}_PLAN.md and iterate until the user gives explicit approval ("looks good", "let's implement").
Key interview questions: async or sync? which asyncio patterns? what can be cached? what shared packages exist to reuse?
If the feature is async, FastAPI-based, a background worker/queue consumer, or will run across multiple instances/replicas, also invoke the python-async-scaling skill during planning and again during implementation (Phases 1 and 5) — it covers event-loop-blocking pitfalls, cross-instance concurrency limits, idempotency, and resilience patterns that this skill doesn't duplicate. Skip it for plainly synchronous, single-process work.
→ references/planning.md — Interview steps, plan structure, iteration patterns
Phase 2: Configuration & Data Models
Set up YAML configs in conf/ and define all Pydantic models/TypedDicts/dataclasses before writing any business logic.
→ references/models-and-config.md
Phase 3: Test Stubs
Write test stubs with pass bodies that define the expected API through tests — executable specifications. Show them to the user and get approval before proceeding.
→ references/test-stubs.md
Phase 4: Draft Implementation
Create skeletons of all modules, classes, and functions with complete signatures, docstrings, type hints, and raise NotImplementedError() bodies. Let the user review the API design. Wait for explicit approval before Phase 5.
→ references/draft-implementation.md
Phase 5: TDD Implementation
Uncomment tests one at a time; implement logic to make each pass. Before claiming any tests pass, verify no stubs remain:
# Primary — slash command
/check-inactive-tests tests/unit/test_*.py
# Fallback
grep -E "(^#.*def test_|^\s+pass\s*$)" tests/unit/test_*.py→ references/tdd-implementation.md
Phase 6: Integration & Validation
Run full test suite, move all imports to module level, refactor globals, run typecheck and linting.
uv run pytest tests/unit/test_{module}.py -v
uv run task typecheck
uv run task lint --fix --unsafe-fixes
uv run task save-api # after API changes→ references/integration-validation.md
Refactoring Workflow
Use this instead of the 6-phase flow when the task is "clean up", "unify", or "DRY".
R1: Discovery — Scan and present
Scan for the patterns mentioned. Present findings as a numbered list with file:line references. Ask which items to address (not assumed "all").
R2: Direction — Decide where code lives
For each duplication, present options: extract to shared package (data-utils, etc.), keep local, or consolidate to existing version A or B. Wait for explicit choice before proceeding.
R3: Incremental changes with diffs
For each change:
- Show BEFORE block with file:lines
- Show AFTER block
- Explain IMPACT (what other code is affected)
- Ask: "Proceed? (yes/no/modify)"
- Only after "yes": apply, run tests, report results
- Move to the next change — never batch
R4: Verification
Run full test suite and typecheck. Show a summary of all changes made. Ask if anything else needs refactoring.
Test-First Interaction Pattern
When starting any implementation, first propose test cases:
Before I implement this, let's define what "working" looks like.
I suggest:
1. test_basic_case — input X → expected output Y
2. test_edge_case_empty — empty input → returns None
3. test_error_handling — invalid input → raises ValueError
Does this cover your expectations? Add/remove/modify?Show each test's code and get approval before writing it. Run the tests expecting failure, then implement, then report: "✓ Test X passes."
Progress Tracking
Use TodoWrite to track phase progress. Mark tasks completed immediately after finishing, not in batches.
TodoWrite([
{"content": "Write and validate plan", "status": "completed", ...},
{"content": "Create data models", "status": "in_progress", ...},
...
])Reference Files
| File | When to read |
| references/planning.md | Phase 1 — interview and plan structure |
| references/models-and-config.md | Phase 2 — YAML config, Pydantic models |
| references/test-stubs.md | Phase 3 — writing test stubs |
| references/draft-implementation.md | Phase 4 — skeleton with NotImplementedError |
| references/tdd-implementation.md | Phase 5 — uncommenting and implementing |
| references/integration-validation.md | Phase 6 — final validation |
| references/best-practices.md | Codebase conventions: shared packages, caching, imports (defers to python-async-scaling for async patterns) |
| references/common-mistakes.md | 15 common mistakes with examples and fixes |
| references/examples.md | Worked examples of all three workflow modes |
Related Skills
| Skill | Invoke alongside this one when |
python-async-scaling | The feature/refactor is async, FastAPI-based, a background worker/queue consumer, or scales across multiple instances/replicas. Not needed for plainly synchronous, single-process work. |
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.

