Playbook: Plan

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

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

Version: 0.5 (grouped test strategy, exceptions-only constitution check and spec-cited security table new in 0.5; say-once and short decision records used once; lightest-first used twice; tested on five projects)

Purpose: turn an approved spec into plan.md: how the feature will be built, with every technical decision recorded.

Prompt: /nodfirst-plan (or mention nodfirst/playbooks/plan.md) (and a feature number only if it is not the active one). Extra instructions go below.

Output: specs/NNN-feature-name/plan.md, status Draft.

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/), nodfirst/templates/plan-template.md, the active feature’s spec.md (and design.md if any), existing plans, docs/decisions/, and the code base if any.

Preconditions

  • The spec status is Approved and its “Open questions” are empty. Clarified is not enough: the human must approve the spec. If not, stop and say so (C2).
  • If the feature has a UI and the human wants a design phase, design.md should exist first; otherwise ask whether to skip it.

Instructions for the agent

You are designing, not coding. Follow nodfirst/constitution.md, especially C1, C2, C3, C4, C6, C8, C10.

  1. Build the handoff list. Before designing anything, show the human three groups:
    • A. Explicit deferrals: everything the spec defers to the plan (search for “in the plan” and its equivalent in the spec’s language, and read Security and privacy).
    • B. Implied mechanisms: go through every requirement and criterion and ask “which mechanism satisfies this, and is it already fixed by the spec or the constitution?”. Use the “Plan” checklist of every active module and the question “where can state live in the hosting environment?”. Include scaffolding, tools and runtimes the feature needs on the machine, and how each mechanism is tested locally and in CI with the same component as in production (a database, a driver or a service that differs between test and production is a decision to take, not a detail).
    • C. Profile and constitution: the open decisions of the profile (Section 11) this feature needs, and the constraints of the profile and the constitution, listed explicitly. Report spec inconsistencies as spec change requests, not plan decisions. Ask the human to confirm or correct the list.
  2. Resolve technical decisions one at a time. For each undecided choice:
    • Research current information (versions, maintenance, limits, pricing). Never rely on memory; cite sources and write “verified on ". Standard-library facts you rely on are verified too (for example a constant or a limit).
    • Release age: when a choice is not urgent and the version was published in the last 7 days, read its release notes and say what you found; prefer the previous stable release unless the new one is needed.
    • Present 2-3 options with pros and cons against the criteria in the profile’s open decisions (Section 11), and your recommendation. For foundational decisions check each option against the requirement IDs it touches; a requirement an option cannot satisfy is a spec change request.
    • Lightest first. The first option is the simplest that meets the spec and the quality gates (for a small static page: plain HTML, CSS and a script, or one build tool); a framework or extra tool needs a reason tied to a requirement.
    • Guided profile: group the choices the human cannot judge (language version, framework, test tools) into one proposal, one line of reason each, approved together; ask separately only for choices with a cost, an account, or an effect users will see.
    • Order decisions by dependency. Wait for the human’s decision. Never choose on their behalf (C3).
    • Record each decision as context, options, decision, consequences (C10) when it had real alternatives, a cost, an account or a lasting effect; any other choice takes one line (choice and reason). Give an example of use from the caller’s side when the decision shapes a public interface.
    • Pin container image tags and tool versions; never latest. Security checks for every mechanism: apply the active modules’ checklists (for web: client-controlled values, who can read and write each client-side mechanism, cookie lifetime and attributes, keyed hashes for low-entropy identifiers, library defaults, counters and windows).
    • Check every constitution rule; the plan lists only the rules with an exception or a feature-specific note, and closes with the template’s line for the others. Never write the approval status of the plan.
  3. Write plan.md from the template:
    • Map every handoff item to a mechanism or an open question.
    • Security and privacy: for each point of the spec, cited by ID, the mechanism and how it is tested, one line each; then threats from the module checklists that the spec does not name.
    • Test strategy: every criterion gets a level, grouped by level and cited by ID; the criterion’s example is the test input (C13, say each thing once). List a criterion on its own only when its test needs more than its example: an input that a weaker implementation would pass, a prepared state, a manual check. Name the test infrastructure (runner, fixtures, services) and where it comes from.
    • Interfaces: only those other code or other people call, citing requirement IDs; N/A when there are none. Dependencies are justified (C8).
    • User-facing texts the plan fixes (messages, labels) are proposed in a table and approved before the plan is approved.
    • Technical context lists the tools and runtimes needed on the machine, each with its verification command.
    • Include scaffolding as a described step (it becomes tasks). Do not run commands or create code.
    • Order the steps so each leaves the quality gate green. When the feature changes behaviour that existing tests cover, the step that updates those tests comes first and stays green before and after the change. The “planned steps” section is indicative: the tasks may split it.
    • Impact on other specs and plans: if the spec lists impact on existing specs, state which tests change and add a note “no change to plan NNN” or the change request needed.
  4. Do not change the spec. Gaps, contradictions or untestable items become a spec change request (what, why, suggested wording).
  5. Check your work:
    • Every R and AC appears in interfaces, security or test strategy.
    • Every deferral is resolved or an open question; no open question remains in a plan proposed for approval.
    • No decision without the human’s confirmation; no unverified fact stated as certain.
    • Machine identifiers are English; user-facing text follows the project language.
    • Nothing adds behaviour the spec does not describe (C1).
  6. Stop. Show “What you are approving” first; then decisions taken, decisions pending, assumptions, spec change requests, open questions and interpretations. Do not create tasks or code (C2).

Checklist for every project (core)

State where state lives; how failures surface to callers; what is logged; what the tests run against; tools and versions. Project-kind checklists (security mechanisms for web, text parsing and public APIs for libraries, and so on) are in the modules listed in the profile.

Revising an existing plan

Edit in place, keep a change log at the end, re-run the checks of step 5, and show two lists (changes and interpretations). Parts the change request does not mention stay identical (no “…” in tables). Compare with the previous version before showing it. When the spec changed, update every plan sentence that quotes a changed requirement or criterion (test strategy, security table, interfaces) in the same round, or list it as an open change request.

Do not

  • Choose technology without the human’s decision, invent versions, limits or prices, edit the spec, create tasks or code, or mark the plan Approved.

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.