@softure-ai/skills 0.2.0 → 0.3.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 (51) hide show
  1. package/README.md +4 -0
  2. package/WORKFLOW.md +6 -2
  3. package/package.json +1 -1
  4. package/scripts/install.mjs +5 -0
  5. package/skills/softure-archive/SKILL.md +76 -24
  6. package/skills/softure-archive/references/example-archive.md +106 -0
  7. package/skills/softure-code-review/SKILL.md +68 -18
  8. package/skills/softure-code-review/references/example-review.md +108 -0
  9. package/skills/softure-frame/SKILL.md +129 -40
  10. package/skills/softure-frame/references/diagnostic-lens.md +85 -0
  11. package/skills/softure-frame/references/examples.md +111 -0
  12. package/skills/softure-frame/references/pushback.md +38 -0
  13. package/skills/softure-impl-review/SKILL.md +138 -76
  14. package/skills/softure-impl-review/references/example-review.md +127 -0
  15. package/skills/softure-impl-review/references/rubric.md +120 -0
  16. package/skills/softure-impl-review/references/triage.md +124 -0
  17. package/skills/softure-implement/SKILL.md +116 -49
  18. package/skills/softure-implement/references/phase-commit.md +214 -0
  19. package/skills/softure-implement/references/worked-example.md +201 -0
  20. package/skills/softure-init/SKILL.md +57 -41
  21. package/skills/softure-init/references/example.md +96 -0
  22. package/skills/softure-init/references/templates.md +73 -0
  23. package/skills/softure-lesson/SKILL.md +47 -19
  24. package/skills/softure-lesson/references/examples.md +65 -0
  25. package/skills/softure-new/SKILL.md +100 -43
  26. package/skills/softure-new/references/example-change.md +149 -0
  27. package/skills/softure-new/references/placement.md +60 -0
  28. package/skills/softure-plan/SKILL.md +182 -50
  29. package/skills/softure-plan/references/plan-example.md +206 -0
  30. package/skills/softure-plan/references/progress-format.md +56 -2
  31. package/skills/softure-plan/references/questioning.md +162 -0
  32. package/skills/softure-plan-review/SKILL.md +211 -83
  33. package/skills/softure-plan-review/references/lenses.md +121 -0
  34. package/skills/softure-plan-review/references/review-example.md +184 -0
  35. package/skills/softure-prd/SKILL.md +130 -71
  36. package/skills/softure-prd/references/example-prd.md +233 -0
  37. package/skills/softure-prd/references/leak-lint.md +43 -0
  38. package/skills/softure-prd/references/prd-template.md +219 -0
  39. package/skills/softure-research/SKILL.md +73 -33
  40. package/skills/softure-research/references/example-research.md +106 -0
  41. package/skills/softure-research/references/fan-out.md +61 -0
  42. package/skills/softure-roadmap/SKILL.md +211 -65
  43. package/skills/softure-roadmap/references/example-roadmap.md +203 -0
  44. package/skills/softure-roadmap/references/interview.md +132 -0
  45. package/skills/softure-roadmap/references/slicing.md +118 -0
  46. package/skills/softure-rule-review/SKILL.md +83 -19
  47. package/skills/softure-rule-review/references/example-report.md +73 -0
  48. package/skills/softure-rule-review/references/scorecard.md +129 -0
  49. package/skills/softure-shape/SKILL.md +163 -53
  50. package/skills/softure-shape/references/example-shape-notes.md +192 -0
  51. package/skills/softure-shape/references/question-bank.md +248 -0
@@ -0,0 +1,201 @@
1
+ # Worked example: a two-phase run
2
+
3
+ A booking app for a climbing gym. Change `cancellation-window`: customers may cancel a class
4
+ booking until 24 hours before it starts; after that the button is disabled and says why.
5
+ `context/workflow.json` defines three gates (`typecheck`, `lint`, `test`); the run uses them by
6
+ name and never assumes their commands.
7
+
8
+ ## Start
9
+
10
+ The user runs `softure-implement cancellation-window`. change.md says `plan_reviewed`, the tree
11
+ is clean. Progress at the start:
12
+
13
+ ```markdown
14
+ ### Phase 1: Cancellation rule on the server
15
+
16
+ #### Automated
17
+ - [ ] 1.1 `cancelBooking` returns `{ kind: "cancelled" }` when the class starts in more than 24 h
18
+ - [ ] 1.2 `cancelBooking` returns `{ kind: "too_late", startsAt }` at 24 h or less, and changes no row
19
+ - [ ] 1.3 Gates green (typecheck, lint, test)
20
+
21
+ #### Manual
22
+ - [ ] 1.4 Front desk confirms the 24 h rule also applies to private lessons
23
+
24
+ ### Phase 2: Cancel button shows the window
25
+
26
+ #### Automated
27
+ - [ ] 2.1 Button is enabled with "Cancel (until Tue 18:00)" inside the window
28
+ - [ ] 2.2 Button is disabled with the reason text outside the window (component test)
29
+ - [ ] 2.3 Gates green (typecheck, lint, test)
30
+
31
+ #### Manual
32
+ - [ ] 2.4 Disabled state is visibly disabled in light and dark themes at 390 px
33
+ - [ ] 2.5 The reason text is clear to a customer
34
+ ```
35
+
36
+ The skill sets `status: implementing`, starts the touched-file set with the change folder's
37
+ uncommitted artifacts plus `plan.md`, and reads lessons. L-007 ("a write that depends on a read
38
+ uses a conditional UPDATE") applies to `bookings/`, so it shapes phase 1.
39
+
40
+ ## Phase 1: reconcile, then TDD
41
+
42
+ Reconciling finds a difference:
43
+
44
+ ```
45
+ Mismatch in phase 1, step 2
46
+ Plan says: set bookings.status to 'cancelled'
47
+ Code has: no status column; a booking is cancelled when canceled_at is set
48
+ (db/schema/bookings.ts:31, read by bookings/queries.ts:12)
49
+ Why it matters: writing a status column fails the migration check and nothing reads it
50
+ Recommendation: adapt (set canceled_at = now()), because the meaning is identical and
51
+ every reader already uses canceled_at
52
+ ```
53
+
54
+ Asked with "Adapt and continue" (recommended), "Drop this step" and "Stop and re-plan", the user
55
+ picks the first. A note goes under Phase 1 in plan.md and into the commit body.
56
+
57
+ The test for 1.2 is written first and run:
58
+
59
+ ```
60
+ FAIL bookings/cancel-booking.test.ts > returns too_late at exactly 24 hours
61
+ expected { kind: 'too_late', startsAt: 2026-03-03T18:00:00.000Z }
62
+ received { kind: 'cancelled' }
63
+ ```
64
+
65
+ Red for the right reason (the rule is missing, not an import error). The implementation uses
66
+ `UPDATE bookings SET canceled_at = now() WHERE id = $1 AND canceled_at IS NULL AND starts_at > now() + interval '24 hours'`,
67
+ so a double click cannot cancel twice (L-007). Tests go green, all three gates pass, 1.1 to 1.3
68
+ are ticked. Item 1.4 needs a person at the front desk, so it stays open; it does not hold up the
69
+ commit, and there is no gate message because nobody can check it right now.
70
+
71
+ Staging: the set is `bookings/cancel-booking.ts`, its test, `bookings/actions.ts`, and the
72
+ change folder files. `git status --porcelain` shows nothing else. The proposed message:
73
+
74
+ ```
75
+ feat(cancellation-window): Cancellation rule on the server (p1)
76
+
77
+ cancelBooking refuses at 24 h or less and returns the start time so the
78
+ UI can explain. The plan said to write bookings.status; the schema marks
79
+ cancellation with canceled_at, so the action sets that (noted in plan.md).
80
+ The UPDATE is conditional, so a repeated request cannot cancel twice.
81
+
82
+ Files: bookings/cancel-booking.ts, bookings/cancel-booking.test.ts,
83
+ bookings/actions.ts, context/changes/cancellation-window/*
84
+ ```
85
+
86
+ The user approves. `git log -1 --format='%h %s'` shows `3b9d2f4 feat(cancellation-window):
87
+ Cancellation rule on the server (p1)`, so the SHA is written:
88
+
89
+ ```markdown
90
+ - [x] 1.1 `cancelBooking` returns `{ kind: "cancelled" }` when the class starts in more than 24 h — 3b9d2f4
91
+ - [x] 1.2 `cancelBooking` returns `{ kind: "too_late", startsAt }` at 24 h or less, and changes no row — 3b9d2f4
92
+ - [x] 1.3 Gates green (typecheck, lint, test) — 3b9d2f4
93
+ ```
94
+
95
+ That edit stays uncommitted. The skill reports and asks:
96
+
97
+ ```
98
+ Phase 1 of 2 committed (3b9d2f4). Progress 3/8.
99
+ Open for the owner: 1.4 Front desk confirms the 24 h rule also applies to private lessons.
100
+ ```
101
+
102
+ Options: "Continue to phase 2" (recommended), "Stop here, resume later", "Review this phase
103
+ first". The user continues.
104
+
105
+ ## Phase 2: the manual gate and a hook failure
106
+
107
+ Test-after: the button and its component tests first, then 2.1 and 2.2 pass and the gates are
108
+ green. For 2.4 the skill starts the dev server, opens a booking 20 hours out at 390 px in both
109
+ themes, takes two screenshots into `reviews/`, and looks at them: the button is greyed out and
110
+ the cursor is not a pointer. 2.4 is ticked `(verified by agent: screenshots in reviews/p2-*.png)`.
111
+ 2.5 is a judgement about wording, so the gate opens:
112
+
113
+ ```
114
+ Phase 2 of 2 is ready to commit: Cancel button shows the window
115
+
116
+ Passed automatically:
117
+ - 2.1 enabled with "Cancel (until Tue 18:00)" inside the window (test "shows the deadline")
118
+ - 2.2 disabled with the reason outside the window (test "explains why it is disabled")
119
+ - 2.3 Gates green: typecheck, lint, test (236 tests)
120
+
121
+ Verified by me:
122
+ - 2.4 visibly disabled in light and dark at 390 px (reviews/p2-light.png, reviews/p2-dark.png)
123
+
124
+ Please check:
125
+ - 2.5 the reason text is clear to a customer (open any booking within 24 h on /bookings)
126
+
127
+ Still waiting from earlier phases:
128
+ - 1.4 Front desk confirms the 24 h rule also applies to private lessons
129
+ ```
130
+
131
+ Recommended: "Commit now, check later" (no later phase builds on the wording). The user picks
132
+ "Found a problem": with 1 hour left the text reads "Cancellation closed 1 hours before class".
133
+ The skill fixes the plural through the message layer, adds a test for the one-hour case, re-runs
134
+ the gates and shows the gate again. This time the user answers "Checked, all good", and 2.5 is
135
+ ticked without a note.
136
+
137
+ The commit is refused by the lint hook (an unused import left by the fix). HEAD is still
138
+ `3b9d2f4`, so amending would rewrite phase 1. The skill removes the import, re-runs `lint`,
139
+ re-stages the file, and commits again as a new commit:
140
+
141
+ ```
142
+ feat(cancellation-window): Cancel button shows the window (p2)
143
+
144
+ The button shows the deadline inside the window and the reason outside it;
145
+ plural forms come from the message layer. Carries the phase 1 Progress SHA.
146
+
147
+ Files: bookings/CancelButton.tsx, bookings/CancelButton.test.tsx,
148
+ messages/en.ts, context/changes/cancellation-window/plan.md, reviews/p2-*.png
149
+ ```
150
+
151
+ HEAD now reads `a61c07e feat(cancellation-window): Cancel button shows the window (p2)`.
152
+
153
+ ## Finish
154
+
155
+ Re-scan: no open Automated item; open Manual item 1.4. The skill writes `a61c07e` into 2.1 to
156
+ 2.5, sets `status: implemented`, and commits plan.md and change.md as
157
+ `docs(cancellation-window): progress p2`. Final Progress:
158
+
159
+ ```markdown
160
+ ### Phase 1: Cancellation rule on the server
161
+
162
+ #### Automated
163
+ - [x] 1.1 `cancelBooking` returns `{ kind: "cancelled" }` when the class starts in more than 24 h — 3b9d2f4
164
+ - [x] 1.2 `cancelBooking` returns `{ kind: "too_late", startsAt }` at 24 h or less, and changes no row — 3b9d2f4
165
+ - [x] 1.3 Gates green (typecheck, lint, test) — 3b9d2f4
166
+
167
+ #### Manual
168
+ - [ ] 1.4 Front desk confirms the 24 h rule also applies to private lessons
169
+
170
+ ### Phase 2: Cancel button shows the window
171
+
172
+ #### Automated
173
+ - [x] 2.1 Button is enabled with "Cancel (until Tue 18:00)" inside the window — a61c07e
174
+ - [x] 2.2 Button is disabled with the reason text outside the window (component test) — a61c07e
175
+ - [x] 2.3 Gates green (typecheck, lint, test) — a61c07e
176
+
177
+ #### Manual
178
+ - [x] 2.4 Disabled state is visibly disabled in light and dark themes at 390 px — a61c07e (verified by agent: screenshots in reviews/p2-*.png)
179
+ - [x] 2.5 The reason text is clear to a customer — a61c07e
180
+ ```
181
+
182
+ Completion summary:
183
+
184
+ ```
185
+ cancellation-window implemented: 2 phases (p1 3b9d2f4, p2 a61c07e), progress 7/8.
186
+ Key files: bookings/cancel-booking.ts, bookings/actions.ts, bookings/CancelButton.tsx, messages/en.ts
187
+ Decisions: phase 1 writes canceled_at instead of a status column (plan.md, phase 1 note)
188
+ Open for the owner: 1.4 Front desk confirms the 24 h rule also applies to private lessons
189
+ Next: softure-impl-review cancellation-window
190
+ ```
191
+
192
+ Asked "Run the implementation review now?", the user can take it (recommended) or leave it.
193
+
194
+ ## The same run with `--auto`
195
+
196
+ - The mismatch is adapted without a question and recorded under `## Decisions (auto)`:
197
+ `- plan writes bookings.status, schema uses canceled_at → set canceled_at (same meaning, every reader uses it)`.
198
+ - No question between phases, no gate. 2.4 is still verified by screenshots; 2.5 stays `- [ ]`
199
+ and joins 1.4 in the summary for the owner.
200
+ - The hook failure is fixed the same way. Had the hook failed on a file outside the change, the
201
+ run would stop and report instead.
@@ -1,10 +1,11 @@
1
1
  ---
2
2
  name: softure-init
3
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
4
+ Scaffold the SOFTURE workflow in a repository: create the `context/` tree with its
5
+ README conventions and a `context/workflow.json` filled in by detecting the stack (package
6
+ manager, scripts, default branch, migrations directory, docs to consult). Idempotent, never
7
+ overwrites existing files; on a repo that is already set up it only reports and adds missing
8
+ keys. Use once per repo before any other softure-* skill, or when a skill reports a missing
8
9
  `context/workflow.json`. Triggers: "init the workflow", "set up context", "softure init",
9
10
  "prepare the repo for the skills".
10
11
  argument-hint: "[--language pl|en] [--dry-run] [--auto]"
@@ -23,7 +24,8 @@ allowed-tools:
23
24
 
24
25
  Every other `softure-*` skill reads `context/workflow.json` and writes under `context/`.
25
26
  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
+ guessed. Contract: `WORKFLOW.md` §2 and §3 of the `@softure-ai/skills` package. It does not
28
+ start any work: no change, PRD or roadmap is created here.
27
29
 
28
30
  ## Inputs
29
31
 
@@ -35,45 +37,58 @@ guessed. Contract: `WORKFLOW.md` §2 and §3 of the `@softure-ai/skills` package
35
37
 
36
38
  1. **Inventory what exists.** List `context/` recursively, if present. Record each file that
37
39
  already exists. You will not touch these, apart from adding missing keys to
38
- `workflow.json` (step 5).
40
+ `workflow.json` (step 5). Unknown keys in an existing `workflow.json` are kept as they are.
39
41
  2. **Detect the stack.** Read these, and only these, to fill the config:
40
- - `package.json` → `scripts`. Map the gates:
42
+ - `package.json` -> `scripts`. Map the gates:
41
43
  - typecheck: the script that runs `tsc`, otherwise `npx tsc --noEmit` when `tsconfig.json` exists.
42
44
  - lint: `lint`.
43
45
  - test: `test` (unit only, never the e2e script).
44
46
  - 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
47
+ - Package manager, from the lockfile: `package-lock.json` -> `npm ci`, `pnpm-lock.yaml` ->
48
+ `pnpm install --frozen-lockfile`, `yarn.lock` -> `yarn install --immutable`,
49
+ `bun.lockb`/`bun.lock` -> `bun install --frozen-lockfile`. Gate commands use the same
50
+ manager (`pnpm lint`, not `npm run lint`, in a pnpm repo).
51
+ - Workspaces (`pnpm-workspace.yaml`, `workspaces`, `turbo.json`, `nx.json`): root scripts
52
+ first, else the orchestrator's command (`pnpm -r test`, `turbo run test`), marked inferred.
53
+ - Non-JS stacks: `*.sln`/`*.csproj` -> `dotnet build` / `dotnet test`; `pyproject.toml` ->
54
+ `ruff check` / `pytest`; `go.mod` -> `go vet ./...` / `go test ./...`. Use them only if the
50
55
  tool's config is actually present.
51
56
  - Main branch: `git symbolic-ref refs/remotes/origin/HEAD`, falling back to whichever of
52
57
  `main`/`master` exists locally.
53
58
  - Migrations: look for `drizzle/`, `migrations/`, `prisma/migrations/`, `db/migrate/` and
54
59
  `supabase/migrations/`, and infer the file pattern from the existing names. For drizzle,
55
60
  `regenerate` is the script that calls `drizzle-kit generate`.
56
- - `.env` present → add `cp ../{repo}/.env .env` to `worktree.setup`.
61
+ - `.env` present -> add `cp ../{repo}/.env .env` to `worktree.setup`, after the install command.
62
+ - Knowledge sources: `docs/`, `adr/` or `docs/adr/`, an existing `context/foundation/prd.md`
63
+ -> candidates for `research.sources`.
57
64
  3. **Pick the language.** Use `--language` when given. Otherwise use the language of the
58
65
  existing docs/README; if mixed, use the language the user is writing in. In `--auto`
59
66
  without a signal, use `en`.
60
67
  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.
68
+ marking each value as *read* (found literally) or *inferred* (derived), then ask one
69
+ question: "Create this? (Recommended: yes)". Offer the options yes / edit a value / cancel.
70
+ Name applicable optional keys (below) in one line, without asking about each. `--auto`
71
+ skips the question; `--dry-run` stops here in both modes.
63
72
  5. **Write only what is missing:**
64
73
  - `context/workflow.json`: new file, or only the missing keys merged into an existing one.
65
74
  Never change an existing value.
66
- - `context/foundation/` with an empty `lessons.md` (`# Lessons` + one sentence explaining
67
- the format, WORKFLOW §7).
75
+ - `context/foundation/README.md` and an empty `context/foundation/lessons.md` (`# Lessons` +
76
+ one sentence explaining the format, WORKFLOW §7).
68
77
  - `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.
78
+ (templates in `references/templates.md`).
79
+ - Do **not** create `shape-notes.md`, `prd.md`, `roadmap.md`, `roadmaps/`, change folders
80
+ or empty directories. Their skills create them on first use.
71
81
  6. **Verify.** Re-read `workflow.json` and check that it parses as JSON. For every gate
72
82
  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.
83
+ on PATH). Mark any gate you could not resolve as `null`, never as a guess. Re-running the
84
+ detection must now produce no new writes.
85
+ 7. **Report** a status block, one line per artifact (`created`, `present` or `merged: <keys>`),
86
+ then the unresolved values the owner should fill in, every inferred value with its reason,
87
+ and the next step. Then stop: do not chain into other skills.
75
88
 
76
- ## `workflow.json` template
89
+ ## `workflow.json`
90
+
91
+ Required keys and the ones init writes by default:
77
92
 
78
93
  ```json
79
94
  {
@@ -90,42 +105,43 @@ guessed. Contract: `WORKFLOW.md` §2 and §3 of the `@softure-ai/skills` package
90
105
  `migrations` is either `null` or `{ "dir", "pattern", "regenerate" }`. Keep `release.owner: true`
91
106
  unless the user explicitly says otherwise. Skills never release or deploy on their own.
92
107
 
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
- ```
108
+ **Optional keys** (WORKFLOW §2). A missing key means the default behaviour, so init writes one
109
+ only when it was detected or the user asked for it:
103
110
 
104
- `context/archive/README.md`: one paragraph saying that folders are `<created-date>-<change-id>`
105
- and are read-only history.
111
+ | Key | Default when absent | Init writes it when |
112
+ |---|---|---|
113
+ | `timezone` | the machine's zone | the user names a zone |
114
+ | `integration.cadence` | `"change"` (every change runs the suite before archive) | the user wants one run per roadmap (`"roadmap"`) |
115
+ | `worktree.cloudState` | `"main"` | the user runs cloud sessions that must keep state on the branch (`"branch"`) |
116
+ | `research.sources` | none | step 2 found docs, ADRs or a PRD (interactive: listed in the plan; `--auto`: only paths that exist) |
117
+ | `install` | gitignore the skills, inject all rule sections | the user wants committed skills or fewer rule sections |
106
118
 
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.
119
+ Content of the README files, and a complete worked example (detection, plan, report) for a
120
+ fictional repo: read `references/templates.md` **when writing the READMEs** and
121
+ `references/example.md` **when unsure what a report should look like**.
109
122
 
110
123
  ## `--auto`
111
124
 
112
125
  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)`.
126
+ directly) in the report, e.g. `- mainBranch -> master (origin/HEAD missing; local master exists)`.
127
+ Optional keys other than `research.sources` are never written in `--auto`.
114
128
 
115
129
  ## Quality bar
116
130
 
117
131
  - [ ] Running the skill twice changes nothing the second time.
118
132
  - [ ] No existing file is overwritten. `workflow.json` only gains keys.
119
133
  - [ ] 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.
134
+ - [ ] Gate commands use the repo's package manager.
135
+ - [ ] The report lists the unresolved values the owner should fill in, and every inferred value.
121
136
 
122
137
  ## Do not
123
138
 
124
139
  - Do not invent commands. A wrong gate is worse than `null`.
125
- - Do not write roadmap, PRD or change folders.
140
+ - Do not write optional keys nobody asked for and nothing detected.
126
141
  - Do not commit. Leave that to the user or to the calling orchestrator.
127
142
 
128
143
  ## Handoff
129
144
 
130
- New product or theme → `softure-shape`. An existing PRD that needs slicing → `softure-roadmap`.
131
- A single concrete change → `softure-new`.
145
+ New product or theme -> `softure-shape`. An existing PRD that needs slicing -> `softure-roadmap`.
146
+ A single concrete change -> `softure-new`. Existing rule files in the repo -> consider
147
+ `softure-rule-review` once, so old instructions do not contradict the workflow.
@@ -0,0 +1,96 @@
1
+ # Example run: a booking app
2
+
3
+ A fictional repo, first run, interactive. Use it for the shape of the plan and the report.
4
+
5
+ ## What detection read
6
+
7
+ - `pnpm-lock.yaml` -> install `pnpm install --frozen-lockfile`.
8
+ - `package.json` scripts: `typecheck: "tsc --noEmit"`, `lint: "eslint ."`, `test: "vitest run"`,
9
+ `test:e2e: "playwright test"`, `stack:test: "docker compose -f docker/test.yml up -d && playwright test; docker compose -f docker/test.yml down"`,
10
+ `db:generate: "drizzle-kit generate"`.
11
+ - `origin/HEAD` -> `origin/main`.
12
+ - `drizzle/` with `0000_init.sql` ... `0014_slots_index.sql`.
13
+ - `.env` present.
14
+ - `docs/` with `architecture.md` and `docs/adr/` with 6 ADRs. No PRD.
15
+ - `context/` does not exist.
16
+
17
+ ## Plan shown before writing
18
+
19
+ ```text
20
+ context/
21
+ workflow.json create
22
+ foundation/README.md create
23
+ foundation/lessons.md create
24
+ changes/README.md create
25
+ archive/README.md create
26
+ backlog/README.md create
27
+ ```
28
+
29
+ ```json
30
+ {
31
+ "language": "en",
32
+ "mainBranch": "main",
33
+ "gates": {
34
+ "typecheck": "pnpm typecheck",
35
+ "lint": "pnpm lint",
36
+ "test": "pnpm test"
37
+ },
38
+ "integration": { "local": "pnpm stack:test", "remote": null },
39
+ "migrations": {
40
+ "dir": "drizzle",
41
+ "pattern": "^[0-9]{4}_.*\\.sql$",
42
+ "regenerate": "pnpm db:generate"
43
+ },
44
+ "worktree": {
45
+ "setup": ["pnpm install --frozen-lockfile", "cp ../{repo}/.env .env"],
46
+ "maxParallel": 4
47
+ },
48
+ "release": { "owner": true },
49
+ "research": { "sources": ["docs/architecture.md", "docs/adr/"] }
50
+ }
51
+ ```
52
+
53
+ ```text
54
+ read: gates.*, migrations.dir, mainBranch (origin/HEAD)
55
+ inferred: integration.local -> stack:test (brings up its own stack; test:e2e expects a running app)
56
+ migrations.pattern -> from 15 existing file names
57
+ Optional keys you may want: timezone, integration.cadence, worktree.cloudState, install.
58
+
59
+ Create this? (Recommended: yes) [yes / edit a value / cancel]
60
+ ```
61
+
62
+ ## Report after writing
63
+
64
+ ```text
65
+ context/workflow.json created
66
+ context/foundation/README.md created
67
+ context/foundation/lessons.md created
68
+ context/changes/README.md created
69
+ context/archive/README.md created
70
+ context/backlog/README.md created
71
+
72
+ Unresolved: integration.remote (no CI script found; set it if the suite runs on CI).
73
+ Inferred:
74
+ - integration.local -> pnpm stack:test (starts and stops its own stack; test:e2e needs a running app)
75
+ - migrations.pattern -> ^[0-9]{4}_.*\.sql$ (all 15 files in drizzle/ match)
76
+
77
+ Next: softure-shape for a new product or theme, or softure-new <change-id> for one concrete change.
78
+ ```
79
+
80
+ ## Second run, same repo
81
+
82
+ ```text
83
+ context/workflow.json present
84
+ context/foundation/README.md present
85
+ ...
86
+ Nothing to do.
87
+ ```
88
+
89
+ ## Second run after someone deleted `research` from workflow.json
90
+
91
+ ```text
92
+ context/workflow.json merged: research.sources
93
+ ```
94
+
95
+ Only the missing key is added; `gates`, `integration` and every other existing value stay
96
+ exactly as the owner left them, including any key init does not know.
@@ -0,0 +1,73 @@
1
+ # README templates written by softure-init
2
+
3
+ Each file is written only when absent. Write them in English or in `workflow.json` ->
4
+ `language`; the skill names, paths and headings stay as shown.
5
+
6
+ ## `context/foundation/README.md`
7
+
8
+ ```markdown
9
+ # Foundation
10
+
11
+ Documents that outlive any single change: shape notes, PRD, the active roadmap, queued roadmaps
12
+ and lessons. Each file is owned by the skill that writes it (softure-shape, softure-prd,
13
+ softure-roadmap, softure-lesson); edit them through those skills when possible.
14
+
15
+ - `roadmap.md` is the one active roadmap. Queued thematic roadmaps live in `roadmaps/roadmap-<slug>.md`.
16
+ - `lessons.md` holds numbered rules from real incidents (`L-NNN`). Numbers are never reused.
17
+
18
+ ## Updating
19
+ Edit in place. A refined goal, a new requirement or a shifted milestone changes the existing
20
+ file (the PRD bumps its version); no dated copies next to it.
21
+
22
+ ## Archiving
23
+ When a document is replaced rather than refined (a finished roadmap, a superseded PRD), move it
24
+ to `archive/<YYYY-MM-DD>-<name>.md` and write the successor at the original path. Same-day
25
+ collisions get `-2`, `-3`. Nothing reads the archive routinely.
26
+
27
+ ## Not here
28
+ Anything tied to one change (its research, frame, plan, reviews) belongs in
29
+ `context/changes/<change-id>/`.
30
+ ```
31
+
32
+ ## `context/changes/README.md`
33
+
34
+ ```markdown
35
+ # Changes in flight
36
+ One folder per change: `changes/<change-id>/`, identified by `change.md`.
37
+ Created by `softure-new`, closed by `softure-archive` (moved to `archive/`).
38
+ Holds research.md, frame.md, plan.md and reviews/ for that change.
39
+ Execution state lives only in `plan.md` -> `## Progress`.
40
+ ```
41
+
42
+ ## `context/archive/README.md`
43
+
44
+ ```markdown
45
+ # Archive
46
+ Finished changes, moved here by `softure-archive` as `<YYYY-MM-DD>-<change-id>/`, where the date
47
+ is the change's `created` date. Read-only history: skills read it for prior decisions and never
48
+ write into it. To continue archived work, open a new change.
49
+ ```
50
+
51
+ ## `context/backlog/README.md`
52
+
53
+ ```markdown
54
+ # Backlog
55
+ Planned for later, never what is in flight. A topic lives in exactly one place: `backlog/`,
56
+ `changes/` or `archive/`.
57
+
58
+ - `roadmap-<slug>/`: entries of a queued roadmap (`foundation/roadmaps/roadmap-<slug>.md`):
59
+ a README table and one `<change-id>/change.md` per entry with `status: backlog`.
60
+ Taking an entry moves it into `changes/`; it is never copied.
61
+ - `<topic>.md`: deferred review findings and loose ideas, one line each:
62
+ `- [ ] <YYYY-MM-DD> <source change-id or review>: <finding> (<severity>) <evidence path>`.
63
+ `softure-roadmap` turns them into roadmap items.
64
+ ```
65
+
66
+ ## `context/foundation/lessons.md`
67
+
68
+ ```markdown
69
+ # Lessons
70
+
71
+ Numbered rules from real incidents in this repo (`## L-NNN: <rule>` with **Why**, **How to apply**
72
+ and **Applies to**). Written by softure-lesson; read by research, frame, plan, implement and the reviews.
73
+ ```