agentleFS
konrad-wojkonrad-woj/skillset/feature-coder/SKILL.md

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".

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
  1. Very specific:

    Stub test: Test body with only pass or # TODO — not yet implemented, not counted as passing

    line 24
  2. Distinctive:

    Active test: Test with real assertions — the only kind that counts toward coverage

    line 25
  3. Very specific:

    Write test stubs with pass bodies that define the expected API through tests — executable specifications.

    line 50
  4. Very specific:

    Create skeletons of all modules, classes, and functions with complete signatures, docstrings, type hints, and raise NotImplementedError() …

    line 56
  5. Distinctive:

    Run full test suite, move all imports to module level, refactor globals, run typecheck and linting.

    line 76
  6. Distinctive:

    Use this instead of the 6-phase flow when the task is "clean up", "unify", or "DRY".

    line 91
  7. Very specific:

    Ask: "Proceed? (yes/no/modify)"

    line 107
  8. Distinctive:

    Only after "yes": apply, run tests, report results

    line 108
  9. Distinctive:

    Run full test suite and typecheck.

    line 113
  10. Distinctive:

    When starting any implementation, first propose test cases:

    line 119
  11. Distinctive:

    Use TodoWrite to track phase progress.

    line 138

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. 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.
  2. Tests before code — Propose test cases, get approval, then implement. Tests define the contract and prevent guessing at intent.
  3. Plan before coding — Write a plan in markdown first; iterate until the user gives explicit approval before touching code.
  4. Incremental — Implement one piece at a time. Show diffs for each change; get approval before applying.
  5. Data model first — Define types and models before using them. Read actual data structures; never assume.
  6. Context managers always — Use with/async with for all resources. Never manual .close().
  7. 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 pass or # 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:

  1. Show BEFORE block with file:lines
  2. Show AFTER block
  3. Explain IMPACT (what other code is affected)
  4. Ask: "Proceed? (yes/no/modify)"
  5. Only after "yes": apply, run tests, report results
  6. 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

FileWhen to read
references/planning.mdPhase 1 — interview and plan structure
references/models-and-config.mdPhase 2 — YAML config, Pydantic models
references/test-stubs.mdPhase 3 — writing test stubs
references/draft-implementation.mdPhase 4 — skeleton with NotImplementedError
references/tdd-implementation.mdPhase 5 — uncommenting and implementing
references/integration-validation.mdPhase 6 — final validation
references/best-practices.mdCodebase conventions: shared packages, caching, imports (defers to python-async-scaling for async patterns)
references/common-mistakes.md15 common mistakes with examples and fixes
references/examples.mdWorked examples of all three workflow modes

Related Skills

SkillInvoke alongside this one when
python-async-scalingThe 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.

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.