@softure-ai/skills 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -2
  3. package/WORKFLOW.md +308 -0
  4. package/package.json +31 -4
  5. package/rules/AGENTS.md +78 -0
  6. package/scripts/install.mjs +151 -0
  7. package/scripts/uninstall.mjs +49 -0
  8. package/skills/softure-archive/SKILL.md +100 -0
  9. package/skills/softure-code-review/SKILL.md +124 -0
  10. package/skills/softure-frame/SKILL.md +113 -0
  11. package/skills/softure-impl-review/SKILL.md +150 -0
  12. package/skills/softure-implement/SKILL.md +141 -0
  13. package/skills/softure-init/SKILL.md +131 -0
  14. package/skills/softure-lesson/SKILL.md +99 -0
  15. package/skills/softure-new/SKILL.md +127 -0
  16. package/skills/softure-plan/SKILL.md +157 -0
  17. package/skills/softure-plan/references/progress-format.md +79 -0
  18. package/skills/softure-plan-review/SKILL.md +152 -0
  19. package/skills/softure-prd/SKILL.md +132 -0
  20. package/skills/softure-research/SKILL.md +165 -0
  21. package/skills/softure-roadmap/SKILL.md +128 -0
  22. package/skills/softure-rule-review/SKILL.md +121 -0
  23. package/skills/softure-shape/SKILL.md +128 -0
  24. package/skills/softure-worktree/SKILL.md +888 -0
  25. package/skills/softure-worktree/scripts/wt-integration.sh +59 -0
  26. package/skills/softure-worktree/scripts/wt-open.sh +57 -0
  27. package/skills/softure-worktree/scripts/wt-roadmap.py +301 -0
  28. package/skills/softure-worktree/scripts/wt-status.sh +70 -0
  29. package/skills/softure-worktree/scripts/wt_config.py +109 -0
  30. package/skills/softure-worktree-manager/SKILL.md +553 -0
  31. package/skills/softure-worktree-manager/scripts/wm-launch.sh +52 -0
  32. package/skills/softure-worktree-manager/scripts/wm-report.sh +45 -0
  33. package/skills/softure-worktree-manager/scripts/wm-resume.sh +132 -0
  34. package/skills/softure-worktree-manager/scripts/wm-watch.sh +49 -0
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: softure-init
3
+ description: >
4
+ Scaffold the SOFTURE workflow in a repository: create the `context/` tree and a
5
+ `context/workflow.json` filled in by detecting the stack (package manager, scripts,
6
+ default branch, migrations directory). Idempotent, never overwrites existing files.
7
+ Use once per repo before any other softure-* skill, or when a skill reports a missing
8
+ `context/workflow.json`. Triggers: "init the workflow", "set up context", "softure init",
9
+ "prepare the repo for the skills".
10
+ argument-hint: "[--language pl|en] [--dry-run] [--auto]"
11
+ allowed-tools:
12
+ - Read
13
+ - Glob
14
+ - Grep
15
+ - Write
16
+ - Bash
17
+ - AskUserQuestion
18
+ ---
19
+
20
+ # softure-init: scaffold the workflow in a repository
21
+
22
+ ## Purpose
23
+
24
+ Every other `softure-*` skill reads `context/workflow.json` and writes under `context/`.
25
+ This skill creates that ground once, with values detected from the repository rather than
26
+ guessed. Contract: `WORKFLOW.md` §2 and §3 of the `@softure-ai/skills` package.
27
+
28
+ ## Inputs
29
+
30
+ - A git repository (the working directory or the path given). If it is not a git repo, say
31
+ so and stop. Do not run `git init` on your own.
32
+ - Nothing else is required.
33
+
34
+ ## Procedure
35
+
36
+ 1. **Inventory what exists.** List `context/` recursively, if present. Record each file that
37
+ already exists. You will not touch these, apart from adding missing keys to
38
+ `workflow.json` (step 5).
39
+ 2. **Detect the stack.** Read these, and only these, to fill the config:
40
+ - `package.json` → `scripts`. Map the gates:
41
+ - typecheck: the script that runs `tsc`, otherwise `npx tsc --noEmit` when `tsconfig.json` exists.
42
+ - lint: `lint`.
43
+ - test: `test` (unit only, never the e2e script).
44
+ - integration: a script whose name contains `integration`, `e2e` or `playwright`, preferring one that brings up its own stack.
45
+ - Package manager, from the lockfile: `package-lock.json` → `npm ci`, `pnpm-lock.yaml` →
46
+ `pnpm install --frozen-lockfile`, `yarn.lock` → `yarn install --immutable`,
47
+ `bun.lockb`/`bun.lock` → `bun install --frozen-lockfile`.
48
+ - Non-JS stacks: `*.sln`/`*.csproj` → `dotnet build` / `dotnet test`; `pyproject.toml` →
49
+ `ruff check` / `pytest`; `go.mod` → `go vet ./...` / `go test ./...`. Use them only if the
50
+ tool's config is actually present.
51
+ - Main branch: `git symbolic-ref refs/remotes/origin/HEAD`, falling back to whichever of
52
+ `main`/`master` exists locally.
53
+ - Migrations: look for `drizzle/`, `migrations/`, `prisma/migrations/`, `db/migrate/` and
54
+ `supabase/migrations/`, and infer the file pattern from the existing names. For drizzle,
55
+ `regenerate` is the script that calls `drizzle-kit generate`.
56
+ - `.env` present → add `cp ../{repo}/.env .env` to `worktree.setup`.
57
+ 3. **Pick the language.** Use `--language` when given. Otherwise use the language of the
58
+ existing docs/README; if mixed, use the language the user is writing in. In `--auto`
59
+ without a signal, use `en`.
60
+ 4. **Show the plan.** Without `--auto`, print the proposed tree and the full `workflow.json`,
61
+ then ask one question: "Create this? (Recommended: yes)". Offer the options yes / edit a
62
+ value / cancel. In `--auto`, skip the question.
63
+ 5. **Write only what is missing:**
64
+ - `context/workflow.json`: new file, or only the missing keys merged into an existing one.
65
+ Never change an existing value.
66
+ - `context/foundation/` with an empty `lessons.md` (`# Lessons` + one sentence explaining
67
+ the format, WORKFLOW §7).
68
+ - `context/changes/README.md`, `context/archive/README.md`, `context/backlog/README.md`
69
+ (templates below).
70
+ - Do **not** create `shape-notes.md`, `prd.md` or `roadmap.md`. Their skills do that.
71
+ 6. **Verify.** Re-read `workflow.json` and check that it parses as JSON. For every gate
72
+ command, check that the referenced script exists in `package.json` (or that the binary is
73
+ on PATH). Mark any gate you could not resolve as `null`, never as a guess.
74
+ 7. **Report:** created, skipped (already existed) and unresolved values, plus the next step.
75
+
76
+ ## `workflow.json` template
77
+
78
+ ```json
79
+ {
80
+ "language": "en",
81
+ "mainBranch": "main",
82
+ "gates": { "typecheck": null, "lint": null, "test": null },
83
+ "integration": { "local": null, "remote": null },
84
+ "migrations": null,
85
+ "worktree": { "setup": [], "maxParallel": 4 },
86
+ "release": { "owner": true }
87
+ }
88
+ ```
89
+
90
+ `migrations` is either `null` or `{ "dir", "pattern", "regenerate" }`. Keep `release.owner: true`
91
+ unless the user explicitly says otherwise. Skills never release or deploy on their own.
92
+
93
+ ## README templates
94
+
95
+ `context/changes/README.md`:
96
+
97
+ ```markdown
98
+ # Changes in flight
99
+ One folder per change: `changes/<change-id>/`, identified by `change.md`.
100
+ Created by `softure-new`, closed by `softure-archive` (moved to `archive/`).
101
+ Execution state lives only in `plan.md` → `## Progress`.
102
+ ```
103
+
104
+ `context/archive/README.md`: one paragraph saying that folders are `<created-date>-<change-id>`
105
+ and are read-only history.
106
+
107
+ `context/backlog/README.md`: one paragraph saying that ideas not yet on the roadmap live here
108
+ as free-form notes, and `softure-roadmap` pulls them in.
109
+
110
+ ## `--auto`
111
+
112
+ Detect, write and report without asking. Record every value you inferred (rather than read
113
+ directly) in the report, e.g. `- mainBranch → master (origin/HEAD missing; local master exists)`.
114
+
115
+ ## Quality bar
116
+
117
+ - [ ] Running the skill twice changes nothing the second time.
118
+ - [ ] No existing file is overwritten. `workflow.json` only gains keys.
119
+ - [ ] Every gate in `workflow.json` points at something that exists, or is `null`.
120
+ - [ ] The report lists the unresolved values the owner should fill in.
121
+
122
+ ## Do not
123
+
124
+ - Do not invent commands. A wrong gate is worse than `null`.
125
+ - Do not write roadmap, PRD or change folders.
126
+ - Do not commit. Leave that to the user or to the calling orchestrator.
127
+
128
+ ## Handoff
129
+
130
+ New product or theme → `softure-shape`. An existing PRD that needs slicing → `softure-roadmap`.
131
+ A single concrete change → `softure-new`.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: softure-lesson
3
+ description: >
4
+ Turn a mistake that happened (or keeps happening) into a numbered, durable rule in
5
+ context/foundation/lessons.md, with the incident that justifies it and how to apply it.
6
+ Deduplicates against existing lessons and numbers safely across parallel worktrees. Use
7
+ when the user says "record a lesson", "remember this rule", "add to lessons", "make sure
8
+ this never happens again", "add a rule", or when a review finding is marked "record as lesson".
9
+ argument-hint: "[\"<one-line rule draft>\"] [--from <change-id>#<finding>] [--auto]"
10
+ allowed-tools:
11
+ - Read
12
+ - Glob
13
+ - Grep
14
+ - Edit
15
+ - Write
16
+ - Bash
17
+ - AskUserQuestion
18
+ ---
19
+
20
+ # softure-lesson: one incident, one rule, one number
21
+
22
+ Contract: `WORKFLOW.md` §7. The file is `context/foundation/lessons.md`. If it does not exist,
23
+ create it with the `# Lessons` header and one sentence saying what it is for.
24
+
25
+ ## What qualifies
26
+
27
+ A lesson is a rule that would have prevented a **concrete** mistake in this repo, and that a
28
+ future agent would plausibly repeat. It is not:
29
+ - general programming advice already in the conventions;
30
+ - a task or a TODO (those go to the roadmap or backlog);
31
+ - a fact about one file that the code itself makes obvious.
32
+
33
+ If the input fails this test, say why and stop. Writing nothing is a valid outcome.
34
+
35
+ ## Procedure
36
+
37
+ 1. **Collect the incident.** Interactive: ask at most three questions.
38
+ - What happened, concretely (file, command, symptom)?
39
+ - What did it cost (time, data, a wrong release)?
40
+ - When should the rule fire next time (paths, areas, kinds of work)?
41
+
42
+ With `--from <change-id>#F<n>`, read the finding in `reviews/impl-review.md` and skip the
43
+ questions it already answers.
44
+ 2. **Deduplicate.** Search existing lessons for the same mechanism, not the same words: grep
45
+ key terms, then read candidates. If one already covers it:
46
+ - same rule: add the new incident as a second line under **Why:** (`Also: <date>, <change-id>: …`).
47
+ Do not create a new number.
48
+ - broader rule: generalize the existing lesson's title, keep its number, and note the widening.
49
+ 3. **Pick the number.** Next number = max(`L-NNN` on the main branch, in the working tree, and in
50
+ every worktree) + 1:
51
+ ```bash
52
+ main=$(jq -r .mainBranch context/workflow.json 2>/dev/null || echo main)
53
+ { git show "$main:context/foundation/lessons.md" 2>/dev/null
54
+ for wt in $(git worktree list --porcelain | sed -n 's/^worktree //p'); do
55
+ cat "$wt/context/foundation/lessons.md" 2>/dev/null; done; } \
56
+ | grep -oE '^#+ *L-[0-9]+' | grep -oE '[0-9]+' | sort -n | tail -1
57
+ ```
58
+ Zero-pad to three digits. Numbers are never reused, even if a lesson is deleted.
59
+ 4. **Write it** at the end of the file:
60
+ ```markdown
61
+ ## L-042: <imperative rule in one line>
62
+ **Why:** <the incident: what happened, where, what it cost>.
63
+ **How to apply:** <the trigger and the concrete behaviour; include the check or command if there is one>.
64
+ **Applies to:** <paths, areas, skills>.
65
+ ```
66
+ The title must be testable. "Be careful with dates" is not a rule; "Compute day boundaries
67
+ in the configured time zone, never in UTC" is.
68
+ 5. **Enforce when possible.** If the rule can be a test, lint rule, database constraint or
69
+ architecture check, propose it, and add it inside a change when you have one. Mention the
70
+ enforcement in **How to apply**.
71
+ 6. **Commit** only when running inside a change or when asked:
72
+ `docs(lessons): L-042 <short title>`.
73
+
74
+ ## --auto
75
+
76
+ - No questions: take the facts from the review finding or the caller's draft.
77
+ - Skip writing when step "What qualifies" fails, and report the skip in one line.
78
+ - On a number collision found later (merge with another worktree), renumber the newer lesson,
79
+ then `grep -rn "L-<old>"` and fix every reference in the same commit.
80
+
81
+ ## Checklist
82
+
83
+ - [ ] Concrete incident in **Why**.
84
+ - [ ] Testable, imperative title.
85
+ - [ ] No duplicate of an existing lesson.
86
+ - [ ] Number = max across main and worktrees + 1.
87
+ - [ ] Enforcement proposed where possible.
88
+
89
+ ## Anti-patterns
90
+
91
+ - Lessons that restate the conventions block.
92
+ - Recording blame instead of mechanism.
93
+ - Ten lessons from one change. Merge them into the one rule that matters.
94
+ - Editing an old lesson's number or meaning silently.
95
+
96
+ ## Handoff
97
+
98
+ Back to the caller (softure-impl-review, softure-worktree), or to `softure-rule-review` if the new
99
+ rule contradicts an existing one.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: softure-new
3
+ description: >
4
+ Open a new change: create context/changes/<change-id>/change.md with a clear intent,
5
+ context and constraints, linked to a roadmap item when there is one. Use at the start of
6
+ every unit of delivery work, before research. Triggers: "new change", "open a change",
7
+ "start change <id>", "/softure-new",
8
+ "start the next roadmap item".
9
+ argument-hint: "<change-id> [roadmap-item-id] [--title \"...\"] [--auto]"
10
+ allowed-tools:
11
+ - Read
12
+ - Glob
13
+ - Grep
14
+ - Write
15
+ - Edit
16
+ - Bash
17
+ - AskUserQuestion
18
+ ---
19
+
20
+ # softure-new: open a change
21
+
22
+ A change is the unit of delivery: one outcome, one folder, one branch. This skill creates its
23
+ identity file, `change.md`. Every later step (research, plan, implement, review, archive) reads it
24
+ and moves its `status`. The contract lives in `WORKFLOW.md` §3–§4 of the SOFTURE skills package.
25
+
26
+ ## Required inputs
27
+
28
+ - `context/workflow.json`: if it is missing, say "run `softure-init` first" and stop.
29
+ - A change id, or enough description to derive one.
30
+ - Optional: a roadmap item ID (`[A-Z]+-\d+`) that exists in `context/foundation/roadmap.md`.
31
+
32
+ ## Procedure
33
+
34
+ 1. **Read the configuration.** Load `context/workflow.json` and take `language`. Everything you
35
+ write into `change.md` uses that language. Skill instructions stay in English.
36
+
37
+ 2. **Resolve the change id.**
38
+ - The id is kebab-case ASCII, at most 40 characters, and names the *outcome*
39
+ (`pending-states`, not `fix-button`).
40
+ - If the user gave a roadmap item, read its block in `roadmap.md`. Use its `Change ID` when one
41
+ is set. Otherwise propose one and write it back into the item block and the table row.
42
+ - **Uniqueness:** the id must not exist as `context/changes/<id>/` nor as
43
+ `context/archive/*-<id>/`. Check both with Glob. On a clash, propose a suffixed alternative
44
+ (`-v2` or a more precise noun). Never reuse an archived id.
45
+
46
+ 3. **Gather the content.** Fill these four sections. Ask only for what you cannot infer.
47
+ - **Intent:** what must be true when this change is done, and for whom. One short paragraph.
48
+ Phrase it as an observable outcome.
49
+ - **Context:** where the change comes from. Include the roadmap item (link, outcome,
50
+ prerequisites, unknowns), any feedback quoted **verbatim** in a blockquote with author and
51
+ date, and what is already known about the current state, with file paths when obvious.
52
+ Do not research here; that is the next skill's job.
53
+ - **Constraints:** files or areas this change owns exclusively, what it must not touch,
54
+ deadlines, and decisions already made by the owner.
55
+ - **Notes:** dependencies on other items. Leave this section empty when there are none.
56
+
57
+ 4. **Ask at most three questions** (interactive mode). Ask only when the intent is ambiguous,
58
+ when two readings would lead to different work, or when the scope boundary is unclear. Ask
59
+ them one at a time and put your recommended answer first.
60
+
61
+ 5. **Write `context/changes/<id>/change.md`** using the template below. Create the
62
+ `context/changes/` folder if it does not exist yet.
63
+
64
+ 6. **Update the roadmap** when the change is linked to an item:
65
+ - The item block gets `- **Change ID:** \`<id>\``.
66
+ - The table row's second cell is `` `<id>` ``.
67
+ - Leave the item status unchanged. The orchestrator or the owner sets `in_progress`.
68
+
69
+ 7. **Report.** Give the path, a one-line intent, and the next step (`softure-research <id>`).
70
+
71
+ ## Output template
72
+
73
+ ```markdown
74
+ ---
75
+ change_id: <id>
76
+ title: "<one sentence: the outcome, not the activity>"
77
+ status: new
78
+ roadmap_item: <ID or null>
79
+ created: <YYYY-MM-DD>
80
+ updated: <YYYY-MM-DD>
81
+ archived_at: null
82
+ ---
83
+
84
+ ## Intent
85
+ <what must be true when done, and for whom>
86
+
87
+ ## Context
88
+ <roadmap item link and its outcome/unknowns; feedback quoted verbatim; known current state>
89
+
90
+ ## Constraints
91
+ <exclusively owned files/areas; must-not-touch; deadlines; owner decisions>
92
+
93
+ ## Notes
94
+ ```
95
+
96
+ ## Status transitions
97
+
98
+ - Creates the change with `status: new`. Sets `created` and `updated` to today.
99
+
100
+ ## `--auto`
101
+
102
+ - Never ask. Derive the id from the roadmap item or the description.
103
+ - If the id clashes, append the first free numeric suffix (`-2`, `-3`, …) and record the choice
104
+ under `## Notes` as `- Decision (auto): id <x> taken → <y>`.
105
+ - If the intent cannot be derived at all (no roadmap item and no description), escalate. Do not
106
+ invent scope.
107
+
108
+ ## Quality checklist
109
+
110
+ - [ ] The id is unique across `changes/` and `archive/`, kebab-case and ≤ 40 characters.
111
+ - [ ] The title states an outcome a reviewer can verify.
112
+ - [ ] Feedback is quoted verbatim and attributed.
113
+ - [ ] Constraints name concrete paths when ownership matters for parallel work.
114
+ - [ ] The roadmap row and item block point to the same id.
115
+ - [ ] Nothing in the file is a plan or a solution. Those belong to later steps.
116
+
117
+ ## Anti-patterns
118
+
119
+ - Writing the solution into Intent ("add a spinner to Button"). Write the outcome instead
120
+ ("every operation longer than 300 ms shows it is working").
121
+ - Paraphrasing feedback. The original words carry information that a paraphrase loses.
122
+ - Opening two changes for one outcome, or one change for two unrelated outcomes.
123
+ - Starting research or editing code from this skill.
124
+
125
+ ## Handoff
126
+
127
+ Next: `softure-research <change-id>`.
@@ -0,0 +1,157 @@
1
+ ---
2
+ name: softure-plan
3
+ description: >
4
+ Turn research into an executable, phased plan: context/changes/<id>/plan.md with an
5
+ explicit approach, thin verifiable phases (each TDD or test-after, with files, steps
6
+ and done-when criteria) and a canonical ## Progress section. Use after softure-research
7
+ (or softure-frame) and before implementation. Triggers: "plan the change", "write the
8
+ plan", "/softure-plan", "break it into phases".
9
+ argument-hint: "<change-id> [--auto]"
10
+ allowed-tools:
11
+ - Read
12
+ - Glob
13
+ - Grep
14
+ - Bash
15
+ - Write
16
+ - Edit
17
+ - Agent
18
+ - AskUserQuestion
19
+ ---
20
+
21
+ # softure-plan: decide once, execute without guessing
22
+
23
+ A plan answers *how*. After this step, implementation is execution: no design decisions, no
24
+ open questions, no "figure it out later". If a phase cannot be described concretely, research
25
+ is not finished.
26
+
27
+ ## Required inputs
28
+
29
+ - `context/workflow.json`: if missing, run `softure-init` first.
30
+ - `context/changes/<id>/change.md` with `status: preparing`. If the status is `new`, run
31
+ `softure-research` first.
32
+ - `context/changes/<id>/research.md`: if missing, run `softure-research` first. If research has
33
+ an **escalated** open question that is still unanswered, stop and surface it.
34
+ - `frame.md`, when present. Its conclusions override change.md wording.
35
+ - `context/foundation/lessons.md`, when present.
36
+
37
+ ## Procedure
38
+
39
+ 1. **Assess complexity.** Base it on research: affected surface, data changes, risk.
40
+ State it as `small` (1 phase), `medium` (2–3) or `large` (4+). Large plans are a smell, so
41
+ consider splitting the change and say so. In interactive mode, confirm the assessment in one
42
+ question.
43
+
44
+ 2. **Probe the gaps.** Ask about ambiguities that change the plan. Ask **one question at a time**,
45
+ at most about 10, and stop as soon as answers stop changing the plan. Each question offers 2–4
46
+ options with the recommended one first, marked `(Recommended)`, and a one-line trade-off for
47
+ each. Never ask what the code or research already answers.
48
+
49
+ 3. **Choose the approach.** Write 2–3 viable options. For each give a one-line description, its
50
+ cost, its risk and its reversibility. Recommend one and say why.
51
+ - If a SOFTURE module covers the capability (research §SOFTURE modules), the module-based
52
+ option is the default.
53
+ - Re-implementing a covered capability needs an explicit reason.
54
+
55
+ 4. **Slice into phases.** Each phase is a **thin, independently verifiable increment** that
56
+ leaves the system working: green gates, deployable. Prefer vertical slices (data → logic →
57
+ UI for one behaviour) over horizontal layers. For each phase write:
58
+ - **Discipline:**
59
+ - `TDD` for logic with clear inputs and outputs (calculations, money, parsing, state
60
+ machines, migrations with invariants, security rules);
61
+ - `test-after` for UI wiring, copy and layout.
62
+ - **Files:** the paths to create or modify, taken from research.
63
+ - **Steps:** concrete and ordered. Name the functions, components, tables and commands.
64
+ - **Done when:** criteria phrased so that someone else could check them. Split them into
65
+ *Automated* (a command, a test, a query) and *Manual* (only a human can judge it, such as
66
+ visual quality or tone).
67
+ - The last automated criterion of every phase is "Gates green (typecheck, lint, test)", using
68
+ the gates from `workflow.json`.
69
+
70
+ 5. **Plan data safety.** For any schema or data change, include:
71
+ - the migration;
72
+ - its rollback path, or an explicit "forward-only, because…";
73
+ - a backfill when needed;
74
+ - a criterion that reads real rows. A rendered UI never proves data was written.
75
+
76
+ 6. **Write risks and rollback.** List what can fail in production and how to undo each phase.
77
+
78
+ 7. **Remove open questions.** Search your draft for "TBD", "maybe", "or", "?" and "decide later".
79
+ Resolve each one, or move it back to research as an escalation and stop.
80
+
81
+ 8. **Write the Progress section** exactly per `references/progress-format.md`: one
82
+ `### Phase N:` per `## Phase N:`, and every Done-when criterion as a numbered checkbox.
83
+
84
+ 9. **Write `plan.md`** in the `workflow.json` language, using the template below.
85
+
86
+ 10. **Update `change.md`.** Set `status: planned` and update `updated`.
87
+
88
+ 11. **Report** the approach in one line, the number of phases, the riskiest phase, and the next
89
+ step.
90
+
91
+ ## Output template
92
+
93
+ ```markdown
94
+ # Plan: <change-id>
95
+
96
+ Input: change.md, research.md[, frame.md]. Complexity: <small|medium|large>.
97
+
98
+ ## Goal
99
+ <the outcome from change.md, made measurable>
100
+
101
+ ## Approach
102
+ **Chosen:** <option> — <why>.
103
+ Rejected: <option> — <one line>; <option> — <one line>.
104
+
105
+ ## Phase 1: <title>
106
+ **Discipline:** TDD | test-after. **Files:** `a.ts`, `b.tsx`, `migrations/00NN_x.sql`
107
+ 1. <step>
108
+ 2. <step>
109
+ **Done when:** <criteria, automated then manual>
110
+
111
+ ## Phase 2: <title>
112
+ ...
113
+
114
+ ## Risks and rollback
115
+ <risk → mitigation; how to revert each phase>
116
+
117
+ ## Decisions (auto)
118
+ <only in --auto>
119
+
120
+ ## Progress
121
+ <per references/progress-format.md>
122
+ ```
123
+
124
+ ## Status transitions
125
+
126
+ - `preparing` → `planned`.
127
+
128
+ ## `--auto`
129
+
130
+ - Skip confirmations. Take the recommended option for every probing question and record it under
131
+ `## Decisions (auto)` as `- <question> → <choice> (<reason>)`.
132
+ - Prefer the smallest reversible approach. Prefer TDD whenever the discipline is in doubt.
133
+ - Stop and escalate when the only viable approach contradicts change.md Constraints, requires a
134
+ destructive data operation, or needs an owner-only decision.
135
+
136
+ ## Quality checklist
137
+
138
+ - [ ] Every phase leaves the system green and deployable.
139
+ - [ ] Every criterion is checkable by someone who did not write it.
140
+ - [ ] Every phase states its discipline and lists its files.
141
+ - [ ] Data changes have migration, rollback (or a justified forward-only) and a real-data check.
142
+ - [ ] The SOFTURE module verdict from research is honoured, or overridden with a reason.
143
+ - [ ] The plan contains no open questions.
144
+ - [ ] `## Progress` matches the phases one-to-one and follows the reference format.
145
+
146
+ ## Anti-patterns
147
+
148
+ - Horizontal phases ("Phase 1: all DB, Phase 2: all API, Phase 3: all UI"). Nothing works until
149
+ the end.
150
+ - Criteria like "works correctly" or "looks good". Say what is measured and how.
151
+ - A plan that re-decides what research already established, or ignores a relevant lesson.
152
+ - Hiding design work in a step ("figure out the caching strategy").
153
+ - More than about 6 phases without proposing to split the change.
154
+
155
+ ## Handoff
156
+
157
+ Next: `softure-plan-review <change-id>`.
@@ -0,0 +1,79 @@
1
+ # `## Progress`: canonical format
2
+
3
+ `## Progress` in `plan.md` is the **only** execution state of a change: no sidecar files, no
4
+ checklists elsewhere. `softure-implement` reads it to find where to resume. Orchestrators read it
5
+ to report progress. It must stay machine-friendly.
6
+
7
+ ## Shape
8
+
9
+ ```markdown
10
+ ## Progress
11
+
12
+ > `- [ ]` pending, `- [x]` done. A phase ends with ` — <commit sha>` on its done items. Never rename items.
13
+
14
+ ### Phase 1: <exact title of "## Phase 1:">
15
+
16
+ #### Automated
17
+ - [ ] 1.1 <criterion checkable by a command, test or query>
18
+ - [ ] 1.2 Gates green (typecheck, lint, test)
19
+
20
+ #### Manual
21
+ - [ ] 1.3 <criterion only a human can judge>
22
+
23
+ ### Phase 2: <exact title of "## Phase 2:">
24
+
25
+ #### Automated
26
+ - [ ] 2.1 ...
27
+ ```
28
+
29
+ ## Rules
30
+
31
+ 1. `## Progress` is the **last** section of `plan.md`.
32
+ 2. There is one `### Phase N: <title>` per `## Phase N: <title>`, in the same order and with
33
+ **identical** titles.
34
+ 3. Each phase has `#### Automated`, and `#### Manual` only when it has manual criteria. Automated
35
+ comes first.
36
+ 4. Items are numbered `N.M`, continuously within a phase across both groups (1.1, 1.2, 1.3…).
37
+ 5. One item is one checkable criterion. Write it as a statement of the end state, not as an
38
+ activity ("Unsubscribe link returns 303 to /unsubscribe", not "Implement unsubscribe link").
39
+ 6. The last automated item of every phase is `Gates green (typecheck, lint, test)`.
40
+ 7. Only `softure-implement` ticks boxes:
41
+ - `- [ ]` becomes `- [x]` only after the criterion was **actually checked**;
42
+ - after the phase commit, append ` — <short sha>` to every item ticked in that phase;
43
+ - a manual item verified by the agent itself (screenshot, DB read) gets
44
+ ` — <sha> (verified by agent: <how>)`;
45
+ - a manual item that only the owner can check stays `- [ ]`.
46
+ 8. The resume point is the **first `- [ ]` in an Automated group**. Manual items still open do
47
+ not block the next phase. They are listed for the owner at the end.
48
+ 9. Never delete or rename an item after implementation starts. When the plan changes
49
+ mid-flight, add new items with the next free number and mark obsolete ones
50
+ `- [x] ~~1.4 old text~~ — dropped: <reason>`.
51
+
52
+ ## Example (one phase done, one in flight)
53
+
54
+ ```markdown
55
+ ## Progress
56
+
57
+ > `- [ ]` pending, `- [x]` done. A phase ends with ` — <commit sha>` on its done items. Never rename items.
58
+
59
+ ### Phase 1: Pending state in the shared button
60
+
61
+ #### Automated
62
+ - [x] 1.1 `Button` with `isPending` renders a spinner and `aria-busy="true"` — 4f2a9c1
63
+ - [x] 1.2 Gates green (typecheck, lint, test) — 4f2a9c1
64
+
65
+ #### Manual
66
+ - [x] 1.3 Spinner visible in both themes at 390 px — 4f2a9c1 (verified by agent: screenshots in reviews/)
67
+
68
+ ### Phase 2: Every long action uses it
69
+
70
+ #### Automated
71
+ - [x] 2.1 All server-action forms pass `isPending` from `useFormStatus`
72
+ - [ ] 2.2 E2E: clicking "Recalculate" shows the pending state within 100 ms
73
+ - [ ] 2.3 Gates green (typecheck, lint, test)
74
+
75
+ #### Manual
76
+ - [ ] 2.4 Owner confirms the pending state feels responsive on a slow network
77
+ ```
78
+
79
+ Resume point here: item 2.2.