@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.
- package/README.md +4 -0
- package/WORKFLOW.md +6 -2
- package/package.json +1 -1
- package/scripts/install.mjs +5 -0
- package/skills/softure-archive/SKILL.md +76 -24
- package/skills/softure-archive/references/example-archive.md +106 -0
- package/skills/softure-code-review/SKILL.md +68 -18
- package/skills/softure-code-review/references/example-review.md +108 -0
- package/skills/softure-frame/SKILL.md +129 -40
- package/skills/softure-frame/references/diagnostic-lens.md +85 -0
- package/skills/softure-frame/references/examples.md +111 -0
- package/skills/softure-frame/references/pushback.md +38 -0
- package/skills/softure-impl-review/SKILL.md +138 -76
- package/skills/softure-impl-review/references/example-review.md +127 -0
- package/skills/softure-impl-review/references/rubric.md +120 -0
- package/skills/softure-impl-review/references/triage.md +124 -0
- package/skills/softure-implement/SKILL.md +116 -49
- package/skills/softure-implement/references/phase-commit.md +214 -0
- package/skills/softure-implement/references/worked-example.md +201 -0
- package/skills/softure-init/SKILL.md +57 -41
- package/skills/softure-init/references/example.md +96 -0
- package/skills/softure-init/references/templates.md +73 -0
- package/skills/softure-lesson/SKILL.md +47 -19
- package/skills/softure-lesson/references/examples.md +65 -0
- package/skills/softure-new/SKILL.md +100 -43
- package/skills/softure-new/references/example-change.md +149 -0
- package/skills/softure-new/references/placement.md +60 -0
- package/skills/softure-plan/SKILL.md +182 -50
- package/skills/softure-plan/references/plan-example.md +206 -0
- package/skills/softure-plan/references/progress-format.md +56 -2
- package/skills/softure-plan/references/questioning.md +162 -0
- package/skills/softure-plan-review/SKILL.md +211 -83
- package/skills/softure-plan-review/references/lenses.md +121 -0
- package/skills/softure-plan-review/references/review-example.md +184 -0
- package/skills/softure-prd/SKILL.md +130 -71
- package/skills/softure-prd/references/example-prd.md +233 -0
- package/skills/softure-prd/references/leak-lint.md +43 -0
- package/skills/softure-prd/references/prd-template.md +219 -0
- package/skills/softure-research/SKILL.md +73 -33
- package/skills/softure-research/references/example-research.md +106 -0
- package/skills/softure-research/references/fan-out.md +61 -0
- package/skills/softure-roadmap/SKILL.md +211 -65
- package/skills/softure-roadmap/references/example-roadmap.md +203 -0
- package/skills/softure-roadmap/references/interview.md +132 -0
- package/skills/softure-roadmap/references/slicing.md +118 -0
- package/skills/softure-rule-review/SKILL.md +83 -19
- package/skills/softure-rule-review/references/example-report.md +73 -0
- package/skills/softure-rule-review/references/scorecard.md +129 -0
- package/skills/softure-shape/SKILL.md +163 -53
- package/skills/softure-shape/references/example-shape-notes.md +192 -0
- package/skills/softure-shape/references/question-bank.md +248 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Worked examples: PRD
|
|
2
|
+
|
|
3
|
+
Read this before drafting `prd.md`. Four examples: a complete greenfield PRD (written from
|
|
4
|
+
the Kilnbook shape notes in `softure-shape/references/example-shape-notes.md`), the
|
|
5
|
+
brownfield parts for a change to an existing invoicing tool, a revision, and bad
|
|
6
|
+
requirements with their fixes.
|
|
7
|
+
|
|
8
|
+
## 1. Good: greenfield, complete
|
|
9
|
+
|
|
10
|
+
```markdown
|
|
11
|
+
---
|
|
12
|
+
project: "Kilnbook"
|
|
13
|
+
version: 1
|
|
14
|
+
status: accepted
|
|
15
|
+
context_type: greenfield
|
|
16
|
+
created: 2026-03-05
|
|
17
|
+
updated: 2026-03-06
|
|
18
|
+
source: shape-notes.md (session 1)
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# PRD v1: wheel booking for a members' pottery studio
|
|
22
|
+
|
|
23
|
+
## Summary
|
|
24
|
+
- Problem: the studio manager spends about four hours a week resolving double bookings of
|
|
25
|
+
six wheels, made through a shared spreadsheet (23 in January).
|
|
26
|
+
- Insight: the conflict is not the calendar, it is the pass: members book sessions they no
|
|
27
|
+
longer have, and nobody knows who is next when a slot frees up.
|
|
28
|
+
- Who: the studio manager; members on a monthly pass.
|
|
29
|
+
- Outcome: no double bookings, and a freed slot reaches the next waiting member without the
|
|
30
|
+
manager.
|
|
31
|
+
- Appetite: three weeks of part-time work; deadline: 15 April (second room opens).
|
|
32
|
+
- Product: phone-friendly web app; expected scale: dozens of users (40, growing to 60).
|
|
33
|
+
- Release boundary: wheel booking with passes and a waitlist; the kiln stays manual.
|
|
34
|
+
|
|
35
|
+
## Goals
|
|
36
|
+
- G-1: zero double bookings per week in the first month after release.
|
|
37
|
+
- G-2: the manager spends under 30 minutes a week on the schedule.
|
|
38
|
+
- G-3: at least half of waitlist offers are accepted.
|
|
39
|
+
|
|
40
|
+
## Non-goals
|
|
41
|
+
- Offline use — members book from the studio or from home, both online.
|
|
42
|
+
- Availability beyond studio needs — an hour of downtime at night is acceptable.
|
|
43
|
+
|
|
44
|
+
## Users
|
|
45
|
+
- Primary: the studio manager; she keeps the schedule fair, answers complaints and decides
|
|
46
|
+
whether the studio adopts a tool. She reaches for it every Sunday evening and whenever two
|
|
47
|
+
members claim one wheel.
|
|
48
|
+
- Secondary: members on a monthly pass of 8 sessions, booking from their phones.
|
|
49
|
+
- Not for: drop-in visitors (handled at the desk), other studios.
|
|
50
|
+
|
|
51
|
+
## Access control
|
|
52
|
+
Members sign in with their own account, created by the manager's invitation; there is no
|
|
53
|
+
open sign-up. One manager role can see and change every booking and set pass balances.
|
|
54
|
+
Members see other bookings only as initials and never see another member's balance. A
|
|
55
|
+
visitor who is not signed in sees only the sign-in page.
|
|
56
|
+
|
|
57
|
+
## Primary flow
|
|
58
|
+
1. A member signs in and sees this week's wheel slots, free and taken (FR-1, FR-2).
|
|
59
|
+
2. They book a free slot; one session is taken from their pass (FR-3).
|
|
60
|
+
3. With no free slot, they join the waitlist for it (FR-4).
|
|
61
|
+
4. When someone cancels, the first member on the waitlist is offered the slot (FR-5, FR-6).
|
|
62
|
+
|
|
63
|
+
## Business rules
|
|
64
|
+
A booking is confirmed only while the member has an unused session in this month's pass;
|
|
65
|
+
otherwise it joins the waitlist, and a freed slot is offered to the waitlist in order, each
|
|
66
|
+
offer held for 2 hours before it moves to the next member.
|
|
67
|
+
|
|
68
|
+
The inputs are the member's pass balance (set by the manager) and the order in which members
|
|
69
|
+
joined a slot's waitlist. The result is either a confirmed booking or a waitlist position.
|
|
70
|
+
Members meet the rule when booking (a full pass means waitlist only) and when an offer
|
|
71
|
+
arrives.
|
|
72
|
+
|
|
73
|
+
## Functional requirements
|
|
74
|
+
| ID | Requirement (observable behaviour) | Priority | Goal | Module |
|
|
75
|
+
|---|---|---|---|---|
|
|
76
|
+
| FR-1 | When invited by the manager, a person can create an account and sign in | must | G-1 | @softure-ai/auth |
|
|
77
|
+
| FR-2 | When signed in, a member sees this week's slots for every wheel as free or taken | must | G-1 | — |
|
|
78
|
+
| FR-3 | When a member with an unused session books a free slot, the slot is theirs and their balance drops by one | must | G-1 | — |
|
|
79
|
+
| FR-4 | When a slot is taken or the pass is used up, a member can join that slot's waitlist | must | G-3 | — |
|
|
80
|
+
| FR-5 | When a booking is cancelled, the first member on the waitlist receives an offer by mail | must | G-3 | @softure-ai/mail |
|
|
81
|
+
| FR-6 | When an offer is not accepted within 2 hours, it moves to the next member on the waitlist | must | G-3 | — |
|
|
82
|
+
| FR-7 | The manager sees one day's bookings for all wheels on one screen and can move or cancel any of them | must | G-2 | — |
|
|
83
|
+
| FR-8 | The manager can set each member's monthly pass balance | must | G-2 | — |
|
|
84
|
+
| FR-9 | A member can book the same weekly slot for the next four weeks in one step | could | G-2 | — |
|
|
85
|
+
|
|
86
|
+
### FR-3: Booking with a pass
|
|
87
|
+
Acceptance:
|
|
88
|
+
- Given a member with 3 unused sessions and a free slot, when they book it, then the slot
|
|
89
|
+
shows as taken for everyone and their balance shows 2.
|
|
90
|
+
- Given a member with 0 unused sessions, when they open a free slot, then they can only join
|
|
91
|
+
the waitlist, and the screen says why.
|
|
92
|
+
- Given two members booking the last free slot at the same moment, then exactly one gets it
|
|
93
|
+
and the other is offered the waitlist.
|
|
94
|
+
Notes: a cancelled booking returns the session to the pass (cancellation window: OQ-2).
|
|
95
|
+
Challenge: "Members will hoard slots as soon as the month opens" → kept; the pass limits
|
|
96
|
+
each member to 8 sessions, and the manager can see and cancel hoarded slots (FR-7).
|
|
97
|
+
|
|
98
|
+
### FR-6: Offer timeout
|
|
99
|
+
Acceptance:
|
|
100
|
+
- Given an offer sent at 10:00 and not accepted, when it is 12:00, then the next member on
|
|
101
|
+
the waitlist receives the offer and the first one can no longer accept it.
|
|
102
|
+
- Given an empty waitlist, when a slot is cancelled, then the slot simply shows as free.
|
|
103
|
+
Challenge: "Two hours is too long for a slot that starts in one hour" → changed: the offer
|
|
104
|
+
lasts 2 hours or until 30 minutes before the slot starts, whichever comes first.
|
|
105
|
+
|
|
106
|
+
## Non-functional requirements
|
|
107
|
+
- NFR-1: a member can book a free slot on a phone in under 60 seconds from opening the page.
|
|
108
|
+
- NFR-2: the weekly view shows within 1 s for a studio with 60 members.
|
|
109
|
+
- NFR-3: works on the two latest major versions of the common mobile and desktop browsers.
|
|
110
|
+
|
|
111
|
+
## Success metrics
|
|
112
|
+
| Metric | Baseline | Target | How measured | When checked |
|
|
113
|
+
|---|---|---|---|---|
|
|
114
|
+
| Double bookings per week | about 6 (January) | 0 | manager's weekly count | weekly, first month |
|
|
115
|
+
| Manager's schedule time | about 4 h/week | under 30 min/week | manager's own log | after 4 weeks |
|
|
116
|
+
| Waitlist offers accepted | none today | at least 50% | counted by the product (FR-5, FR-6) | after 4 weeks |
|
|
117
|
+
|
|
118
|
+
### Guardrails
|
|
119
|
+
- Booking stays as fast as the spreadsheet: under 60 seconds on a phone (NFR-1).
|
|
120
|
+
- No member sees another member's pass balance.
|
|
121
|
+
|
|
122
|
+
## Risks
|
|
123
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
124
|
+
|---|---|---|---|
|
|
125
|
+
| Members keep using the spreadsheet | medium | high | manager announces a switch date; the spreadsheet becomes read-only that day |
|
|
126
|
+
| Offer mails land in spam | medium | medium | members see open offers on the weekly view as well |
|
|
127
|
+
| Recurring booking (FR-9) eats the budget | medium | low | time-boxed to 2 days; dropped if it does not fit |
|
|
128
|
+
|
|
129
|
+
## Out of scope
|
|
130
|
+
- Kiln firing schedule — different rules; stays on the spreadsheet; later.
|
|
131
|
+
- Payments for passes — sold at the desk; later, maybe never.
|
|
132
|
+
- Native mobile app — a phone-friendly web page covers it; later if members ask.
|
|
133
|
+
- Support for other studios — never in this product line.
|
|
134
|
+
|
|
135
|
+
## Open questions
|
|
136
|
+
- OQ-1: Can a member hold two slots on the same day? → owner: studio manager → needed by:
|
|
137
|
+
plan of FR-3 → blocking: no (default: yes).
|
|
138
|
+
- OQ-2: How long before a slot can a member cancel and keep the session? → owner: studio
|
|
139
|
+
manager → needed by: plan of FR-3 → blocking: yes.
|
|
140
|
+
|
|
141
|
+
## Changelog
|
|
142
|
+
- v1 2026-03-05: first version from shape-notes session 1.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Why this is good:
|
|
146
|
+
- Every FR is something a person can observe; none names a table, a vendor or a mechanism.
|
|
147
|
+
The only product names are in the `Module` column, as reuse markers.
|
|
148
|
+
- The primary flow points at FRs, so a missing requirement would show as a step without one.
|
|
149
|
+
- The core rule is one sentence, and FR-3, FR-4 and FR-6 implement exactly that rule.
|
|
150
|
+
- Acceptance includes the empty case (empty waitlist), the failure case (no sessions left)
|
|
151
|
+
and the race (two members, one slot).
|
|
152
|
+
- The challenge on FR-6 changed the requirement; the challenge on FR-3 was answered and kept.
|
|
153
|
+
- An open question is marked blocking because it changes a `must` FR.
|
|
154
|
+
- Nothing was invented: the NFR numbers the shape notes left vague ("without a noticeable
|
|
155
|
+
wait" became NFR-2's 1 s, browser support became NFR-3) were proposed in step 3 with a
|
|
156
|
+
recommended value and confirmed by the owner before they were written.
|
|
157
|
+
|
|
158
|
+
## 2. Good: brownfield, the parts that differ
|
|
159
|
+
|
|
160
|
+
Billdesk, an invoicing tool for small agencies, adds recurring invoices (shape notes:
|
|
161
|
+
`softure-shape/references/example-shape-notes.md`, section 2).
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
## Current system
|
|
165
|
+
- Purpose: issue, export and send one-off invoices for small agencies.
|
|
166
|
+
- Shape: web app, public API for invoice creation, nightly mail digest.
|
|
167
|
+
- Stack: TypeScript web app on a relational database; PDF rendering service.
|
|
168
|
+
- Users today: about 300 agencies; 40 of them create invoices through the API.
|
|
169
|
+
- Today in this area: retainer invoices are made by copying last month's invoice by hand.
|
|
170
|
+
|
|
171
|
+
## Business rules
|
|
172
|
+
Today: an invoice gets the next free number of the year when it is issued.
|
|
173
|
+
Change: a schedule produces a draft on its due date; the draft gets a number only when a
|
|
174
|
+
person issues it, so drafts never use up numbers and the sequence stays gapless.
|
|
175
|
+
|
|
176
|
+
## Functional requirements
|
|
177
|
+
| ID | Requirement (observable behaviour) | Change | Priority | Goal | Module |
|
|
178
|
+
|---|---|---|---|---|---|
|
|
179
|
+
| FR-1 | When a user sets a schedule on an invoice (monthly, on day N), a draft copy appears on each due date | new | must | G-1 | — |
|
|
180
|
+
| FR-2 | When a scheduled draft is waiting, the user is reminded by mail on its due date | new | must | G-1 | @softure-ai/mail |
|
|
181
|
+
| FR-3 | The invoice list shows which invoices came from a schedule (was: no source shown) | modified | should | G-2 | — |
|
|
182
|
+
| FR-4 | Invoice numbers stay gapless per year, whether issued by hand or from a schedule | preserved | must | G-2 | — |
|
|
183
|
+
| FR-5 | Creating an invoice through the public API works exactly as before for existing integrations | preserved | must | G-2 | — |
|
|
184
|
+
| FR-6 | Customers who never set a schedule see no new step in creating an invoice | preserved | must | G-2 | — |
|
|
185
|
+
|
|
186
|
+
## Compatibility and preserved behaviour
|
|
187
|
+
- Contracts: the public invoice-creation API keeps its requests and responses unchanged;
|
|
188
|
+
PDF layout and numbering format are unchanged.
|
|
189
|
+
- Existing data: invoices issued before the change keep their numbers, PDFs and history.
|
|
190
|
+
- Rollout: schedules are offered to all customers at once; nothing changes until a customer
|
|
191
|
+
sets one, so there is no fallback path to keep.
|
|
192
|
+
|
|
193
|
+
## Success metrics
|
|
194
|
+
### Guardrails
|
|
195
|
+
- Zero gaps in invoice numbering across all customers (checked weekly for the first month).
|
|
196
|
+
- No change in API error rate for the 40 integrations in the first two weeks.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
What makes it brownfield: the current system is the baseline, the business rule shows today
|
|
200
|
+
before the change, and everything that must not break is a `preserved` FR with acceptance
|
|
201
|
+
criteria of its own, not a line in non-goals.
|
|
202
|
+
|
|
203
|
+
## 3. A revision (v1 → v2)
|
|
204
|
+
|
|
205
|
+
The studio decides the kiln cannot wait. The PRD is revised, not rewritten:
|
|
206
|
+
|
|
207
|
+
```markdown
|
|
208
|
+
| ~~FR-9~~ | ~~A member can book the same weekly slot for the next four weeks in one step~~ | could | G-2 | — |
|
|
209
|
+
| FR-10 | When signed in, a member can reserve a shelf in the next kiln firing | must | G-4 | — |
|
|
210
|
+
|
|
211
|
+
### ~~FR-9~~: dropped in v2
|
|
212
|
+
Reason: no member asked for it during the first month; budget moved to the kiln (FR-10).
|
|
213
|
+
|
|
214
|
+
## Changelog
|
|
215
|
+
- v2 2026-04-20: added G-4 and FR-10 (kiln shelves) after the owner moved the kiln into
|
|
216
|
+
scope; dropped FR-9 (no demand). Roadmap items citing FR-9: KB-6.
|
|
217
|
+
- v1 2026-03-05: first version from shape-notes session 1.
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
IDs are not renumbered: FR-9 stays, struck through, and the new requirement takes FR-10. The
|
|
221
|
+
previous accepted version was archived to `foundation/archive/2026-04-20-prd.md` first.
|
|
222
|
+
|
|
223
|
+
## 4. Bad requirements and their fixes
|
|
224
|
+
|
|
225
|
+
| Bad | What is wrong | Better |
|
|
226
|
+
|---|---|---|
|
|
227
|
+
| FR: The system should be user-friendly. | Not observable, not testable. | NFR: a new member books their first slot without help in under 2 minutes (checked with 3 members). |
|
|
228
|
+
| FR: Add a bookings table and an API endpoint for it. | Implementation, not behaviour. | FR: When a member books a free slot, it shows as taken for everyone. |
|
|
229
|
+
| FR: Members can manage bookings. | "Manage" hides four behaviours, each with its own rules. | Separate FRs for book, cancel, join the waitlist, accept an offer. |
|
|
230
|
+
| FR: Use AI to suggest the best slot. | Names a mechanism; the rule is missing. | Rule first: "a member is offered the earliest free slot on their usual weekday"; the FR states what they see. |
|
|
231
|
+
| Goal: Improve the booking experience. | No number, no yes/no check. | G-1: zero double bookings per week in the first month. |
|
|
232
|
+
| Out of scope: (empty) | Nothing excluded means the scope is not shaped. | Name what was cut in shaping: kiln, payments, native app. |
|
|
233
|
+
| Business rules: Users can create, edit and delete bookings. | Plain CRUD; no rule the product applies. | `TODO: core rule (OQ-3)` with a blocking question, until the owner states the rule. |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Leak lint: keeping implementation out of the PRD
|
|
2
|
+
|
|
3
|
+
Read this before the self-review step. A PRD that names how something is built has made a
|
|
4
|
+
design decision nobody reviewed, and it ties the roadmap and the plan to that decision.
|
|
5
|
+
Scan every section except brownfield `## Current system`, the `Module` column, and
|
|
6
|
+
verbatim quotes inside `## Open questions`.
|
|
7
|
+
|
|
8
|
+
## Categories
|
|
9
|
+
|
|
10
|
+
| Category | Typical tokens | Rewrite as |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Vendor or hosted service | any product or company name for payments, hosting, auth, AI, mail, analytics | the capability: "members can pay by card", "a sign-in link arrives by mail" |
|
|
13
|
+
| Framework, library, database | a framework, an ORM, a database, a queue | nothing in the PRD; to forward notes |
|
|
14
|
+
| Data model notation | table or column names, `(FK)`, `nullable`, `_id` or `_at` field lists, cascade, soft delete | the rule the user meets: "a deleted project stays restorable for 30 days" |
|
|
15
|
+
| Data operations | migration, backfill, schema change | the outcome for existing data: "invoices issued before the change keep their numbers" |
|
|
16
|
+
| Where it runs | client-side, server-side, at the edge, in a worker, in the cache | the observable property: "results appear within 1 s" |
|
|
17
|
+
| Enforcement mechanism | per IP, token bucket, rate limit per key, lock, retry with backoff | what an attacker or a user experiences: "a script guessing passwords is stopped; a person who mistypes three times is not" |
|
|
18
|
+
| UI affordance stated as a quality | spinner, progress bar, modal, toast, streaming | the quality: "any wait over 2 s shows visible progress" (an affordance is fine inside an FR's acceptance when it *is* the behaviour) |
|
|
19
|
+
| Transport or protocol | REST endpoint, GraphQL, WebSocket, webhook, SSE, gRPC | the information flow: "the manager's view updates without a reload when a member books" |
|
|
20
|
+
| Component as actor | "the model decides", "the cron job sends", "the database checks" | the rule with the product as actor: "a freed slot is offered to the next member on the waitlist" |
|
|
21
|
+
|
|
22
|
+
## Before and after
|
|
23
|
+
|
|
24
|
+
| Leaky | Outside-observable |
|
|
25
|
+
|---|---|
|
|
26
|
+
| FR: Store bookings in a `bookings` table with `member_id (FK)` and `slot_at`. | FR: When a member books a free slot, the slot shows as taken for everyone. |
|
|
27
|
+
| NFR: Cache the weekly grid server-side. | NFR: The weekly grid shows within 1 s for a studio with 60 members. |
|
|
28
|
+
| NFR: Rate-limit sign-in per IP to 5/min. | NFR: Automated password guessing is stopped before it can try 100 passwords against one account; a member who mistypes three times can still sign in. |
|
|
29
|
+
| FR: Send a webhook to the accounting tool on every invoice. | FR: When an invoice is issued, the customer's connected accounting tool shows it within 5 minutes. |
|
|
30
|
+
| Rule: The scheduler job creates drafts at midnight. | Rule: A schedule produces a draft on its due date; the draft gets a number only when issued. |
|
|
31
|
+
| Compatibility: Backfill `schedule_id` on old invoices. | Compatibility: Invoices issued before the change look and export exactly as before. |
|
|
32
|
+
|
|
33
|
+
## When the lint finds something
|
|
34
|
+
|
|
35
|
+
- Interactive: list each hit as `<section>: "<phrase>" — <category>`, propose the
|
|
36
|
+
outside-observable rewrite, and ask once for all of them (Recommended: accept the
|
|
37
|
+
rewrites). Never rewrite silently. The original wording goes to the handoff as a forward
|
|
38
|
+
note when it carries a real preference ("the team wants to keep the current database").
|
|
39
|
+
- `--auto`: apply the rewrites, move the original phrases to the handoff's forward notes,
|
|
40
|
+
and record each one under `## Decisions (auto)`.
|
|
41
|
+
- A hit you cannot rewrite without losing meaning is a sign the requirement is really a
|
|
42
|
+
design decision: move it to forward notes and, if a requirement is left behind, state what
|
|
43
|
+
the user observes.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# PRD templates and section rules
|
|
2
|
+
|
|
3
|
+
Read this when writing or revising `prd.md`. It holds both templates (greenfield and
|
|
4
|
+
brownfield), what each section must and must not contain, and the mapping from shape-notes
|
|
5
|
+
sections. Headings are fixed English; the prose is written in `workflow.json` → `language`.
|
|
6
|
+
|
|
7
|
+
## Frontmatter (both variants)
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
project: "<name>"
|
|
12
|
+
version: 1
|
|
13
|
+
status: draft | accepted
|
|
14
|
+
context_type: greenfield | brownfield
|
|
15
|
+
created: <YYYY-MM-DD>
|
|
16
|
+
updated: <YYYY-MM-DD>
|
|
17
|
+
source: shape-notes.md (session <n>) # or: <path> (unshaped notes)
|
|
18
|
+
---
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`context_type` comes from the shape-notes frontmatter. Without it (raw notes), detect it the
|
|
22
|
+
same way `softure-shape` does and confirm it.
|
|
23
|
+
|
|
24
|
+
## Greenfield template
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
# PRD v<version>: <theme>
|
|
28
|
+
|
|
29
|
+
## Summary
|
|
30
|
+
- Problem: <the specific pain: who, in what moment, at what cost>
|
|
31
|
+
- Insight: <what we understand that today's alternatives miss>
|
|
32
|
+
- Who: <primary person>
|
|
33
|
+
- Outcome: <what is true for them after the release>
|
|
34
|
+
- Appetite: <fixed budget>; deadline: <date or none>
|
|
35
|
+
- Product: <web app | API | CLI | mobile | desktop | library | data pipeline | other>;
|
|
36
|
+
expected scale: <a handful | dozens | thousands | more> of users
|
|
37
|
+
- Release boundary: <what this release includes, in one line>
|
|
38
|
+
|
|
39
|
+
## Goals
|
|
40
|
+
- G-1: <outcome with a number or a yes/no check>
|
|
41
|
+
|
|
42
|
+
## Non-goals
|
|
43
|
+
- <outcome or quality level we deliberately do not aim for> — <one-line reason>
|
|
44
|
+
|
|
45
|
+
## Users
|
|
46
|
+
- Primary: <role; context; the moment they reach for the product>
|
|
47
|
+
- Secondary: <short>
|
|
48
|
+
- Not for: <who, and why>
|
|
49
|
+
|
|
50
|
+
## Access control
|
|
51
|
+
<who can do what; roles; sign-up vs invitation; what an unauthenticated visitor sees>
|
|
52
|
+
|
|
53
|
+
## Primary flow
|
|
54
|
+
1. <step> (FR-1)
|
|
55
|
+
2. <step> (FR-2)
|
|
56
|
+
|
|
57
|
+
## Business rules
|
|
58
|
+
<Core rule: one declarative sentence.>
|
|
59
|
+
<Up to three short paragraphs: the inputs it uses (as the user supplies them), what it
|
|
60
|
+
produces, where the user meets it in the flow.>
|
|
61
|
+
|
|
62
|
+
## Functional requirements
|
|
63
|
+
| ID | Requirement (observable behaviour) | Priority | Goal | Module |
|
|
64
|
+
|---|---|---|---|---|
|
|
65
|
+
| FR-1 | When …, … can … | must | G-1 | @softure-ai/auth |
|
|
66
|
+
|
|
67
|
+
### FR-1: <short name>
|
|
68
|
+
Acceptance:
|
|
69
|
+
- Given …, when …, then …
|
|
70
|
+
Notes: edge cases, copy constraints, data rules.
|
|
71
|
+
Challenge: <strongest counter-argument> → <resolution>
|
|
72
|
+
|
|
73
|
+
## Non-functional requirements
|
|
74
|
+
- NFR-1: <property an outside observer can measure> — <target>
|
|
75
|
+
|
|
76
|
+
## Success metrics
|
|
77
|
+
| Metric | Baseline | Target | How measured | When checked |
|
|
78
|
+
|---|---|---|---|---|
|
|
79
|
+
|
|
80
|
+
### Guardrails
|
|
81
|
+
- <what must not get worse, with its current level>
|
|
82
|
+
|
|
83
|
+
## Risks
|
|
84
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
|
|
87
|
+
## Out of scope
|
|
88
|
+
- <capability not built in this release> — <reason; later | never>
|
|
89
|
+
|
|
90
|
+
## Open questions
|
|
91
|
+
- OQ-1: <question> → owner: <who> → needed by: <date or step> → blocking: yes | no
|
|
92
|
+
|
|
93
|
+
## Changelog
|
|
94
|
+
- v1 <YYYY-MM-DD>: first version from shape-notes session <n>.
|
|
95
|
+
|
|
96
|
+
## Decisions (auto) (only in --auto)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Brownfield template
|
|
100
|
+
|
|
101
|
+
Delta framing: every section describes **what changes** against the current system, not
|
|
102
|
+
the whole system. "Invoices can now be created from a schedule, alongside manual creation",
|
|
103
|
+
not "The system supports manual and scheduled invoices".
|
|
104
|
+
|
|
105
|
+
Differences from greenfield:
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Summary (as greenfield, plus: "Current system: <one line>")
|
|
109
|
+
|
|
110
|
+
## Current system
|
|
111
|
+
- Purpose: <one sentence>
|
|
112
|
+
- Shape: <how it is built, at the level of "web app + public API + nightly job">
|
|
113
|
+
- Stack: <languages, frameworks, main services> (the only section that may name them)
|
|
114
|
+
- Users today: <roles, rough scale>
|
|
115
|
+
- What it does today in the area of this change: <a few lines>
|
|
116
|
+
|
|
117
|
+
## Users (existing users whose experience changes; new users, if any)
|
|
118
|
+
|
|
119
|
+
## Access control (changes only; or "No change: current model preserved.")
|
|
120
|
+
|
|
121
|
+
## Primary flow (the changed flow; mark new steps "(new)")
|
|
122
|
+
|
|
123
|
+
## Business rules (today: <current rule> → change: <new rule>;
|
|
124
|
+
or "No domain rule change: this is technical work.")
|
|
125
|
+
|
|
126
|
+
## Functional requirements
|
|
127
|
+
| ID | Requirement (observable behaviour) | Change | Priority | Goal | Module |
|
|
128
|
+
|---|---|---|---|---|---|
|
|
129
|
+
| FR-1 | When …, … can … | new | must | G-1 | — |
|
|
130
|
+
| FR-2 | … (was: …) | modified | must | G-1 | — |
|
|
131
|
+
| FR-3 | … keeps working exactly as today | preserved | must | G-2 | — |
|
|
132
|
+
| FR-4 | … is no longer offered | removed | should | G-1 | — |
|
|
133
|
+
|
|
134
|
+
## Compatibility and preserved behaviour
|
|
135
|
+
- Contracts that must keep working: <public API, exports, URLs, file formats, integrations>
|
|
136
|
+
- Existing data: <what happens to it, stated as an outcome: "old invoices keep their numbers">
|
|
137
|
+
- Rollout: <who sees the change first; whether the old path stays as a fallback>
|
|
138
|
+
|
|
139
|
+
### Guardrails (under Success metrics: always includes the preserved FRs)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Brownfield order: Summary, Current system, Goals, Non-goals, Users, Access control, Primary
|
|
143
|
+
flow, Business rules, Functional requirements, Non-functional requirements, Compatibility and
|
|
144
|
+
preserved behaviour, Success metrics (with Guardrails), Risks, Out of scope, Open questions,
|
|
145
|
+
Changelog, Decisions (auto). All other sections are the same as greenfield.
|
|
146
|
+
|
|
147
|
+
## Section rules
|
|
148
|
+
|
|
149
|
+
- **Summary.** Facts, not marketing. No "we believe", "we envision", "revolutionary". If the
|
|
150
|
+
insight line cannot be filled, it is an open question, not a slogan.
|
|
151
|
+
- **Goals.** Each measurable (a number or a yes/no check). Every goal has at least one FR.
|
|
152
|
+
- **Non-goals vs Out of scope.** Non-goals are outcomes and quality levels we do not aim for
|
|
153
|
+
("no offline use", "no multi-region availability"). Out of scope lists capabilities not
|
|
154
|
+
built in this release, including deferred `could` FRs. Technology avoids ("no PHP") belong
|
|
155
|
+
in neither; they go to the handoff as forward notes. Scope avoids ("we will not build our
|
|
156
|
+
own scheduling algorithm") are non-goals.
|
|
157
|
+
- **Users.** One primary person, described by role, context and the moment they reach for
|
|
158
|
+
the product. The release serves the primary person first.
|
|
159
|
+
- **Access control.** Always present. For a single-user local tool, one line is enough:
|
|
160
|
+
"Single user; no sign-in; data stays on the device."
|
|
161
|
+
- **Primary flow.** The first flow from the shape notes, each step pointing to the FR that
|
|
162
|
+
makes it possible. A step without an FR is a missing requirement.
|
|
163
|
+
- **Business rules.** The core rule first, as one sentence. Do not name the component that
|
|
164
|
+
applies the rule ("the model decides", "the database checks"); state the rule as if the
|
|
165
|
+
implementation were unknown. No rule in the input → `TODO: core rule (OQ-n)` and a
|
|
166
|
+
**blocking** open question. Never invent one, and never infer one from the nouns in the
|
|
167
|
+
FRs.
|
|
168
|
+
- **Functional requirements.** One observable behaviour each: "When <trigger>, <actor>
|
|
169
|
+
can/sees <result>". IDs `FR-<n>`, never zero-padded, never reused. Group detail blocks
|
|
170
|
+
under `###` theme headings when there are more than about eight. Priorities: `must` (the
|
|
171
|
+
release fails without it), `should`, `could`; roughly 60% of effort or less is `must`.
|
|
172
|
+
Brownfield: every line of "preserved behaviour" from the shape notes becomes a `preserved`
|
|
173
|
+
FR, never a non-goal.
|
|
174
|
+
- **Acceptance criteria.** Given/when/then or a short list a tester could run without asking
|
|
175
|
+
the author. Include the empty case and the failure case where they exist.
|
|
176
|
+
- **Non-functional requirements.** Only where they matter, each with a target: prefer
|
|
177
|
+
`< N unit` or `≥ N unit`; a binary commitment ("no uploaded file is kept after the
|
|
178
|
+
request") also counts. State what is true at the product's outer boundary, never how it is
|
|
179
|
+
achieved (see `leak-lint.md`).
|
|
180
|
+
- **Success metrics.** Metric → baseline → target → how measured → when checked. A metric
|
|
181
|
+
that cannot be measured by something that exists or is planned in an FR is not a metric.
|
|
182
|
+
- **Open questions.** Numbered `OQ-<n>`, each with owner, needed-by and blocking flag. Mark
|
|
183
|
+
`blocking: yes` when the answer changes a `must` FR or the core rule.
|
|
184
|
+
|
|
185
|
+
## What a PRD never contains
|
|
186
|
+
|
|
187
|
+
- Data model sections, table or column lists, entity diagrams. Entities show up as nouns in
|
|
188
|
+
the FRs; their shape is decided in planning.
|
|
189
|
+
- Implementation decisions, architecture, testing strategy, deployment or CI plans.
|
|
190
|
+
- Technology choices, except in brownfield `## Current system` and in the `Module` column
|
|
191
|
+
(the `@softure-ai/*` reuse marker, WORKFLOW §10).
|
|
192
|
+
|
|
193
|
+
When the shape notes carry such content (usually under `## Forward notes`), do not copy it
|
|
194
|
+
in. List it in the handoff under "forward notes" so nothing is silently lost.
|
|
195
|
+
|
|
196
|
+
## Mapping from shape notes
|
|
197
|
+
|
|
198
|
+
| Shape notes | PRD |
|
|
199
|
+
|---|---|
|
|
200
|
+
| Problem, Why now, insight from the interview | Summary (problem, insight) |
|
|
201
|
+
| Who it is for | Users |
|
|
202
|
+
| Access | Access control |
|
|
203
|
+
| Appetite | Summary (appetite, deadline) |
|
|
204
|
+
| Solution sketch → first flow | Primary flow |
|
|
205
|
+
| Solution sketch → elements, modules | Functional requirements (Module column) |
|
|
206
|
+
| Core rule | Business rules |
|
|
207
|
+
| Rabbit holes | Risks, plus Out of scope where the decision was "cut" |
|
|
208
|
+
| Constraints and preserved behaviour | Compatibility and preserved behaviour, `preserved` FRs, Guardrails |
|
|
209
|
+
| No-gos | Non-goals and Out of scope |
|
|
210
|
+
| Success signals | Goals, Success metrics, Guardrails |
|
|
211
|
+
| Open questions, `UNKNOWN`, `(accepted gap)` | Open questions (carried over word for word) |
|
|
212
|
+
| Forward notes | not in the PRD; listed in the handoff |
|
|
213
|
+
|
|
214
|
+
## Gap markers
|
|
215
|
+
|
|
216
|
+
Where the input has nothing for a required part, write `TODO: <what is missing> (OQ-<n>)`
|
|
217
|
+
in place and add the matching open question. Partial content: write what is there, then the
|
|
218
|
+
`TODO` line. The marker is greppable (`grep -n "TODO:" prd.md`), so later steps and reviews
|
|
219
|
+
can count unresolved gaps; a PRD with a blocking `TODO` must not be accepted.
|