Playbook: Implement

This page is written for the agent. For a plain explanation, see the manual: The cycle of a feature.

Command: /nodfirst-implement (in Codex: $nodfirst-implement). Without commands, tell your agent: follow nodfirst/playbooks/implement.md.

Version: 0.6 (analysis required and class-of-input fixes new in 0.6; short reports, change requests and the Guided stop rule used on one feature; tested on five features, seventy-seven tasks)

Purpose: carry out one task of an approved task list: tests first, minimal code, quality gates, honest report.

Prompt: /nodfirst-implement (or mention nodfirst/playbooks/implement.md) (next task) or add T5 (a named task).

Output: the code and tests of the task, and tasks.md updated.

Context to read (do not ask the human to attach it)

AGENTS.md, nodfirst/constitution.md, project/profile.md, the modules it lists (nodfirst/modules/), and for the active feature spec.md, plan.md, tasks.md, and design.md when the task touches screens or user-facing text.

Preconditions

  • Spec, plan and tasks are Approved, and analysis.md exists, is newer than the last change to them, and has no Critical or High left (or the human accepted them). If not, stop and suggest /nodfirst-analyze (full track; a light fix has no analysis).
  • The task’s dependencies are done.
  • The tools and runtimes the task needs are installed (components of a pinned dependency excepted: constitution, Section 4). If one is missing, mark the task [!], say what the human must do, and stop. Never lower a version or relax a constraint to continue.

Instructions for the agent

Follow AGENTS.md, nodfirst/constitution.md and project/profile.md, especially C1, C2, C3, C5, C6, C8 and C9.

  1. Restate the task: ID, requirement and criterion IDs, files or areas, “done when”. If anything is unclear or conflicts with the plan or spec, stop and ask (C3).
  2. Tests first. Write or extend the tests the task lists. Run them and show that they fail for the right reason, unless the task is pure setup. If the task’s test runner is installed by a later task, say which command you used meanwhile.
  3. Implement the minimum that passes the tests and satisfies “done when”. When the task fixes a check on input (a verification finding or a bug), the fix and its test cover the class of inputs (for example every character that shows nothing), not only the reported example. No extra features, no refactoring outside the task, no dependency, licence, metadata or configuration that the plan or tasks do not name (C8, C3). A tool warning alone is not a reason to add one.
  4. Run the quality gates with the commands in project/profile.md, Section 5 (read the project files if it says TBD). Fix failures. Never weaken, skip or delete a test to make a gate pass. If you must change an earlier task’s test because the behaviour legitimately changed (for example a stub is replaced), say so and keep what the test verified.
  5. Update the records: mark the task [x] in tasks.md, with at most one note line (Note: …); put the details in the task’s commit message, or in the report without git. If the scaffolding task created the project, fill Section 5 (Commands) of project/profile.md. If the work shows that the spec or plan is wrong or incomplete, or the human changes their mind about an approved document, stop and propose a change request (constitution, Section 4); do not edit the approved files before the human accepts it, and do not work around them.
  6. Report in at most five lines (C13): what works now that did not before; the gates, passed or not, with the number of tests; anything the human must do or decide; deviations, interpretations and anything left undone (or “none”). In the Guided profile, everyday words: no file paths, tool names or IDs unless they help the human decide. The details go in the task’s commit message (or below the report without git), and into the conversation only when the human asks: Before (which tests failed and why; required unless the task is setup), tests added, files created or changed, each gate command and its result.
  7. Stop. Do not start the next task unless the human said “continue until T" and the working profile allows it (Solo, Team) (C2). **In the Guided profile, a request for several tasks does not change this:** do the next task only, say in one line that running several tasks in a row needs the Solo profile, and offer to change Section 2 of `project/profile.md` if the human wants it. When the human accepts the task and the profile uses git checkpoints, commit the task's files with the message `T done (feature NNN)` (constitution, Section 4).

Final verification (the last task of the feature)

The report of the last task is incomplete without all four items:

  1. The single quality command run from a fresh environment (remove installed dependencies and build outputs, reinstall, rebuild, run; for example a recreated virtual environment, or a deleted node_modules folder), with its result.
  2. A table of every criterion of the feature and the test that verifies it.
  3. A search for TBD in the docs and project/profile.md, with the result.
  4. A list of files that do not belong to the project (leftovers, notes of other projects, editor files).

Then suggest the next step: run /nodfirst-verify in a new chat, ideally with another model or agent (C14). The feature is finished only when the human closes it after the verification (verify, “Closing the feature”).

Safety

  • Never run destructive commands (data deletion, force push, dropping tables, mass file removal) without explicit approval.
  • Do not touch files outside the task’s scope.

Extra instructions


Back to top

NodFirst is released under the MIT licence. These pages are generated from the files in the repository.

This site uses Just the Docs, a documentation theme for Jekyll.