--- name: plan-first description: > How to work on any change to a project: clarifying questions → a plan in Markdown → mockups and design → a roadmap (a clear one for the user and a working one for yourself) → work strictly by the roadmap. Use it ALWAYS when asked to build a project from scratch, add a feature, rework a screen, change behaviour or fix anything bigger than a typo — even if the user doesn't say "plan" or "roadmap" and the task seems clear. Also use it on "keep going" ("давай дальше") in a project that already has a roadmap. Not needed for questions that change nothing ("how does this work?") or when the user explicitly said "no plan, just do it". Speaks the user's language: if they write in Russian, everything is in Russian. --- # Plan First: questions → plan → mockups → roadmap → work The main rule: no code gets written until four stages are done. Each one ends with a stop and an explicit "yes" from the user. Silence, "ok, I'll take a look" or a change of subject is not approval. Stages can be skipped only when the user says so directly ("no mockups", "just do it"). For something small (a typo, a button colour, one line), you can offer the short path in one sentence: "This is a small fix — I'll do it right away and log it in the roadmap, ok?" ## Language Use the language the user has been writing in for everything they will read: your replies, the questions, the plan, mockup copy, both roadmaps and the progress reports. If they have been writing in Russian, do all of it in Russian — even though this skill is written in English. If it isn't clear yet, use the language of their latest message. Code, file names and commit messages follow the project's own conventions. ## Where things live ``` docs/plan/NNN-.md — the plan for a change (stage 2) docs/plan/NNN-/mockups/ — mockups, versions v1, v2… (stage 3) docs/roadmap/roadmap.md — working roadmap, for you (stage 4) docs/roadmap/roadmap.html — roadmap for the user (stage 4) ``` If the project already has its own places for plans and the roadmap, use those. ## Stage 0. Look first - Read the README, CLAUDE.md or AGENTS.md and the existing roadmap. - The task is already in the roadmap → go straight to stage 5. A new task goes through stages 1–4 and joins the roadmap. - Anything you can learn from the code, find out yourself instead of asking. ## Stage 1. Clarifying questions - Start with 2–3 lines of "here's what I understood", so a misunderstanding surfaces right away. - Ask only questions whose answers change the result. - Ask 3–7 questions at a time, numbered and grouped: goal, who uses it, scope, look and feel, constraints. - Give each question 2–4 options and mark one "(recommended)" with a half-line reason. The user can then answer briefly: "1b, 2 — as you recommend". - If the answers raise new unknowns, do one more short round. More than two rounds isn't needed: after that, write the plan with explicit assumptions. Example: > Here's what I understood: you need a payment history page for a client, visible only to the owner. > > **Scope** > 1. What should it show? a) only paid invoices (recommended — less noise) b) everything, including failed ones > 2. Do you need an export? a) no b) CSV (recommended if an accountant reads it) > > **Look** > 3. Where does the button go? a) on the client's card (recommended) b) in the main menu ⛔ Stop: wait for the answers. ## Stage 2. A plan in Markdown Create `docs/plan/NNN-.md` from this template: ```markdown # Status: draft | approved (date) ## Why The problem and who it's for — 2–4 lines. ## Decisions The answers from stage 1, as a list: question → decision. ## In scope / out of scope - In: … - Out (and why): … ## How it will work Screens, data, logic — in plain words. A diagram, if it helps. ## Risks and assumptions ## Done when Checkable points: "the client sees X", "when Y happens, Z is shown". ``` In the chat, give the file path and the gist in 5–10 lines, and ask "what should I change?". ⛔ Stop: wait for "plan ok". Make edits in the file and briefly show what changed. ## Stage 3. Mockups and design **If there is an interface** — a mockup of every screen the change touches: - self-contained HTML that opens in a browser. If the environment has artifacts or Figma, publish there and share the link; - real copy and believable data, no lorem ipsum; - every state: normal, empty, loading, error; - phone and desktop; light and dark theme, if the project has them; - the project's own style (colours, fonts, components): the mockup should look like part of the product, not a separate picture; - if there's a choice — 2–3 options side by side, labelled with how they differ, and a recommendation. **If there is no interface** (backend, script, integration) — show how it will look from the outside: a flow diagram (mermaid), a sample request and response, command output, the text of an email or message, a table structure. ⛔ Stop: wait for "design ok" on every screen. Changes go into a new version (v2); don't overwrite the old one. ## Stage 4. Roadmap One roadmap in two forms. The HTML is built from the MD, not written separately, so the two never drift apart. **For you — `roadmap.md`:** ```markdown # Roadmap: Updated: · Done: 3 of 12 (25%) ## Stage A. — what the user gets at the end of this stage ### R-01 · - Why: … - Files: … - Depends on: — - Done when: - Check: - Status: Planned | In Progress | Testing | Done | Blocked - Next step: … ``` Rules for tasks: - one task is one PR or one session, no more than a day of work; - first the things nothing else works without; - after every task the product still works. **For the user — `roadmap.html`**, a good-looking page: - overall progress as a percentage; - stages as milestones; - what the user will see or be able to do after each stage — in plain words, no file names; - what is waiting on their decision, called out separately; - the date it was last updated. ⛔ Stop: wait for "roadmap ok". ## Stage 5. Working by the roadmap The loop for each task: 1. Take the next one in order: status Planned, all dependencies Done. Say it in one line: "Taking R-07: …". 2. Set its status to In Progress. 3. Do it and check it against "Done when". 4. Set the status to Testing or Done, note how it was checked, and rebuild `roadmap.html`. 5. Report briefly: what was done, how it was checked, progress X%, what's next. Rules: - **Nothing outside the roadmap.** A new idea, bug or request in the middle of the work — first a line in the roadmap with its place in the queue, then the work. Urgent things go first, but they get written down too. - **It doesn't work out as planned — stop and ask.** Quietly doing it some other way is not allowed. Once it's decided, update the plan, the mockup and the roadmap. - **A change touches an approved design** — a new mockup goes for approval. - **You need the user's decision** — status Blocked, the question goes in the report; take the next independent task. - **"Keep going"** means the next task in the roadmap. - **New session** — first read `roadmap.md` and the plan, and say where you left off. ## Don't - Write code before the plan is approved. - Ask about things you can see in the code. - Take "ok, I'll take a look" as approval. - Keep the roadmap in your head or in the chat: it lives only in files. - Change approved things quietly.