agentleFS
crustacean-devcrustacean-dev/knowledge-skills/skills/implement/SKILL.md

implement

Skill0 starsChanged 8 months agoMITView on GitHub

Write code and tests for a single task from .knowledge/features/<feature>/tasks.md. Picks the next TODO task (or a specific TASK-N), reads its acceptance criteria, referenced user stories, plan, architecture, and conventions, then writes exactly the code and tests needed to satisfy the ACs. Updates task status to DONE when complete. Use this skill whenever the user wants to write code for a planned task — trigger phrases include "implement", "implement auth", "implement TASK-3", "build this", "code this task", "start building", "next task", "what's next to implement", "work on TASK-5", "implement the next task", or any variant asking to write code against a task breakdown. Also trigger for casual phrasing like "ok build it", "let's code the first task", "I finished planning, now write the code", or "pick up where we left off". This skill handles ONE task per invocation — it does NOT write specs (/spec), create plans (/plan), break down tasks (/tasks), review code (/review), challenge implementations (/challenge), do general refactoring, or add tests to existing code outside a task context. If the user asks to "add tests" or "refactor" without referencing a task from tasks.md, this skill should NOT trigger.

191 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-ts-deep-modules, ask-matt and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 43 projects that use this

  • GoogleSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 91 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 50 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 88 projects that use this

  • ryotaroh180105Skill

    claude-handoff

    Hand the current conversation off to a fresh background agent that picks up the work immediately.

    Also in 42 projects that use this

  • GoogleSkill

    to-spec

    Turn the current conversation into a spec and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.

    Also in 168 projects that use this

  • +3 more from google

The file

Show its rules and text

We split this skill into the rules it gives an agent

27 rules. 0 are common, 17 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 171 edited versions we read keep these.

  • 17

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If any are missing, STOP. Tell the user which to create first.

    line 21
  2. Distinctive:

    Read the selected task. Verify:

    line 43
  3. Very specific:

    Status is TODO: If DONE, ask "TASK-N is already done.

    line 45
  4. Distinctive:

    All dependencies are DONE: If not, tell the user exactly which tasks must be completed first: "Cannot implement TASK-5 — it depends on …

    line 46
  5. Very specific:

    If the task says "Create src/auth/token.ts", create that exact file in that exact path.

    line 69
  6. Distinctive:

    If you discover something missing from the spec or plan during implementation:

    line 73
  7. Very specific:

    Follow conventions.md for all code style decisions (naming, imports, error handling, file structure).

    line 80
  8. Very specific:

    Follow architecture.md for directory structure and module boundaries.

    line 81
  9. Very specific:

    Follow constitution.md for principles and interdits — if the implementation would violate an interdit, STOP and flag it.

    line 82
  10. Distinctive:

    Write tests as part of the task (unless tasks.md explicitly says otherwise).

    line 87
  11. Very specific:

    Follow the testing conventions in conventions.md (framework, file naming, mocking approach).

    line 89
  12. Very specific:

    Do NOT refactor existing code that isn't in the task's Files: list.

    line 94
  13. Distinctive:

    Do NOT update dependencies or install packages unless the task explicitly requires it.

    line 95
  14. Distinctive:

    Do NOT modify specs, plans, or other tasks.

    line 96
  15. Very specific:

    Do NOT implement the next task.

    line 97
  16. Distinctive:

    After writing the code:

    line 101
  17. Distinctive:

    Run tests: if possible (check conventions.md for the test command).

    line 103
  18. Distinctive:

    Run linting: if possible (check conventions.md for the lint command).

    line 104
  19. Distinctive:

    Use ✅ (the checkmark emoji), not dashes or other markers.

    line 126
  20. Distinctive:

    After the user confirms the implementation is acceptable:

    line 130
  21. Very specific:

    Update tasks.md — set the task's status from IN_PROGRESS to DONE.

    line 132
  22. Distinctive:

    Update the Progress table counts.

    line 133
  23. Distinctive:

    If this was the last task, note that all tasks for this feature are complete.

    line 134
  24. Distinctive:

    If the user wants changes, make them and re-verify before updating status.

    line 136
  25. Distinctive:

    If a constitution interdit would be violated, STOP.

    line 143
  26. Distinctive:

    If the plan's data model doesn't match the spec's expected output, flag the inconsistency.

    line 144
  27. Distinctive:

    If you can't satisfy an AC because of a major gap in the spec or plan, flag it as blocked and explain what's missing.

    line 146

“Common” is measured: kept by at least 6 in 10 of the 171 edited versions of this file we could read. “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

Implement

You execute a single task from .knowledge/features/<feature>/tasks.md. Your scope is the task's acceptance criteria — nothing more, nothing less. You are a disciplined implementer, not a creative architect.

Prerequisites

All must exist:

  • .knowledge/constitution.md — principles and interdits
  • .knowledge/architecture.md — project structure and conventions
  • .knowledge/conventions.md — code style and testing rules
  • .knowledge/features/<feature>/spec.md — what the feature does
  • .knowledge/features/<feature>/plan.md — how to build it
  • .knowledge/features/<feature>/tasks.md — task breakdown

If any are missing, STOP. Tell the user which to create first. Be specific — if tasks.md is missing, suggest /tasks <feature>. If spec.md is missing, suggest /spec <feature>.

Phase 0: Resolve feature and select task

Step 1: Resolve the feature

The user's input may refer to a feature in various ways. Resolve it to a .knowledge/features/<feature>/ directory:

  • Explicit feature name ("implement auth", "implement the authentication feature") → Map to .knowledge/features/auth/.
  • Explicit task ID ("implement TASK-3", "work on TASK-5") → The feature must be inferred. If only one feature directory has a tasks.md, use it. If multiple exist, ask: "Which feature is TASK-3 from? I see tasks for: auth, compiler, router."
  • No feature specified ("next task", "what's next to implement") → Scan .knowledge/features/*/tasks.md for features with TODO tasks. If exactly one feature has TODO tasks, use it. If multiple features have TODO tasks, ask: "Multiple features have pending tasks. Which one? [list them with TODO counts]." If no features have TODO tasks, tell the user everything is complete.

Step 2: Select the task

Once the feature is resolved:

  • User specifies a task ("implement TASK-3", "work on TASK-3") → Use that task.
  • User specifies only a feature ("implement auth") or says "next task" → Read tasks.md, find the first TODO task whose dependencies are all DONE. If no TODO task has satisfied dependencies, tell the user which tasks are blocked and why.
  • All tasks are DONE → Tell the user: "All N tasks for <feature> are complete. Nothing to implement."

Step 3: Validate the selected task

Read the selected task. Verify:

  1. Status is TODO. If DONE, ask "TASK-N is already done. Do you want to redo it?" If IN_PROGRESS, ask "TASK-N is marked as in progress. Do you want to continue or restart it?"
  2. All dependencies are DONE. If not, tell the user exactly which tasks must be completed first: "Cannot implement TASK-5 — it depends on TASK-4, which is still TODO."

Phase 1: Context loading

Load ONLY what this task needs. Do not read the entire codebase.

  1. Task definition — the full TASK-N block from tasks.md
  2. Referenced user stories — read only the US-N sections listed in **Implements:**
  3. Plan.md — read the sections relevant to this task (approach, data model, integration, API surface, decisions)
  4. API contracts — read api/*.d.ts files if the task involves a public API
  5. Conventions — read conventions.md for code style, testing, naming
  6. Architecture — read architecture.md for directory structure and module boundaries
  7. Existing code — read only the files listed in the task's **Files:** section that already exist (to modify)

Phase 2: Implement

First, update tasks.md — set the task's status from TODO to IN_PROGRESS and update the Progress table counts. This signals that work has started.

Then write the code. Follow these rules strictly:

Scope discipline

  • Implement ONLY what the acceptance criteria require. Do not add features, optimizations, or "nice to have" code.
  • If the task says "Create src/auth/token.ts", create that exact file in that exact path. Do not rename, relocate, or reorganize.

Gaps in spec or plan

If you discover something missing from the spec or plan during implementation:

  • Minor gap (e.g., a missing error message string, an unspecified default value) — make a reasonable choice, document it in the summary Notes section, and continue. Do not block the task for trivia.
  • Major gap (e.g., a missing data model field that changes the API contract, an unresolved question ouverte that affects behavior) — flag it as blocked. Do NOT invent behavior. Add a note explaining what's missing and what decision is needed.

Code rules

  • Follow conventions.md for all code style decisions (naming, imports, error handling, file structure).
  • Follow architecture.md for directory structure and module boundaries.
  • Follow constitution.md for principles and interdits — if the implementation would violate an interdit, STOP and flag it.
  • Match the types in api/*.d.ts contracts exactly. If the contract says string | null, do not return string | undefined.

Tests

  • Write tests as part of the task (unless tasks.md explicitly says otherwise).
  • Each acceptance criterion maps to at least one test assertion. If a task has more than 3 AC (which can happen for tasks created before the max-3 rule), cover them all — don't skip ACs just because there are many.
  • Follow the testing conventions in conventions.md (framework, file naming, mocking approach).
  • Tests must pass. If a test fails, fix the implementation — not the test (unless the test is wrong, in which case flag it).

What NOT to do

  • Do NOT refactor existing code that isn't in the task's **Files:** list. Exception: updating the package's index.ts barrel export to re-export newly created modules is allowed — it's part of making the new code usable.
  • Do NOT update dependencies or install packages unless the task explicitly requires it.
  • Do NOT modify specs, plans, or other tasks. If something needs to change, tell the user.
  • Do NOT implement the next task. One task per /implement invocation.

Phase 3: Verify

After writing the code:

  1. Run tests if possible (check conventions.md for the test command).
  2. Run linting if possible (check conventions.md for the lint command).
  3. Check each acceptance criterion — for each one, confirm it's satisfied and point to the code/test that satisfies it.

Present a summary using this exact format — the ✅ checkmarks and file:line references matter because downstream skills parse this output:

## TASK-N: <Title> — Implementation complete

### Acceptance criteria
- ✅ <Criterion 1> — `src/auth/token.ts:42`, test: `token.spec.ts:15`
- ✅ <Criterion 2> — `src/auth/token.ts:67`, test: `token.spec.ts:38`
- ✅ <Criterion 3> — tests pass (3/3)

### Files created/modified
- Created `src/auth/token.ts`
- Created `src/auth/__tests__/token.spec.ts`
- Modified `src/auth/index.ts` — added export

### Notes
- <Any observations, discovered issues, or suggestions for future tasks>

Use ✅ (the checkmark emoji), not dashes or other markers. Each criterion must reference the source file and line number where it's satisfied, and the test file and line where it's tested.

Phase 4: Update status

After the user confirms the implementation is acceptable:

  1. Update tasks.md — set the task's status from IN_PROGRESS to DONE.
  2. Update the Progress table counts.
  3. If this was the last task, note that all tasks for this feature are complete.

If the user wants changes, make them and re-verify before updating status.

Rules

  • ONE task per invocation. Never implement multiple tasks in a single session.
  • Scope is the acceptance criteria. Not more, not less. If an AC says "returns null for expired tokens", implement exactly that — don't add logging, metrics, or retry logic.
  • Files listed in the task are the ONLY files you may create or modify (plus their test files). Touching other files is a scope violation.
  • If a constitution interdit would be violated, STOP. Do not implement a workaround — flag it.
  • If the plan's data model doesn't match the spec's expected output, flag the inconsistency. Do not guess which one is right.
  • Tests are mandatory. A task is not DONE without passing tests.
  • If you can't satisfy an AC because of a major gap in the spec or plan, flag it as blocked and explain what's missing. Do not invent behavior.

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.