@softure-ai/skills 0.2.1 → 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 (50) hide show
  1. package/README.md +4 -0
  2. package/WORKFLOW.md +6 -2
  3. package/package.json +1 -1
  4. package/skills/softure-archive/SKILL.md +76 -24
  5. package/skills/softure-archive/references/example-archive.md +106 -0
  6. package/skills/softure-code-review/SKILL.md +68 -18
  7. package/skills/softure-code-review/references/example-review.md +108 -0
  8. package/skills/softure-frame/SKILL.md +129 -40
  9. package/skills/softure-frame/references/diagnostic-lens.md +85 -0
  10. package/skills/softure-frame/references/examples.md +111 -0
  11. package/skills/softure-frame/references/pushback.md +38 -0
  12. package/skills/softure-impl-review/SKILL.md +138 -76
  13. package/skills/softure-impl-review/references/example-review.md +127 -0
  14. package/skills/softure-impl-review/references/rubric.md +120 -0
  15. package/skills/softure-impl-review/references/triage.md +124 -0
  16. package/skills/softure-implement/SKILL.md +116 -49
  17. package/skills/softure-implement/references/phase-commit.md +214 -0
  18. package/skills/softure-implement/references/worked-example.md +201 -0
  19. package/skills/softure-init/SKILL.md +57 -41
  20. package/skills/softure-init/references/example.md +96 -0
  21. package/skills/softure-init/references/templates.md +73 -0
  22. package/skills/softure-lesson/SKILL.md +47 -19
  23. package/skills/softure-lesson/references/examples.md +65 -0
  24. package/skills/softure-new/SKILL.md +100 -43
  25. package/skills/softure-new/references/example-change.md +149 -0
  26. package/skills/softure-new/references/placement.md +60 -0
  27. package/skills/softure-plan/SKILL.md +182 -50
  28. package/skills/softure-plan/references/plan-example.md +206 -0
  29. package/skills/softure-plan/references/progress-format.md +56 -2
  30. package/skills/softure-plan/references/questioning.md +162 -0
  31. package/skills/softure-plan-review/SKILL.md +211 -83
  32. package/skills/softure-plan-review/references/lenses.md +121 -0
  33. package/skills/softure-plan-review/references/review-example.md +184 -0
  34. package/skills/softure-prd/SKILL.md +130 -71
  35. package/skills/softure-prd/references/example-prd.md +233 -0
  36. package/skills/softure-prd/references/leak-lint.md +43 -0
  37. package/skills/softure-prd/references/prd-template.md +219 -0
  38. package/skills/softure-research/SKILL.md +73 -33
  39. package/skills/softure-research/references/example-research.md +106 -0
  40. package/skills/softure-research/references/fan-out.md +61 -0
  41. package/skills/softure-roadmap/SKILL.md +211 -65
  42. package/skills/softure-roadmap/references/example-roadmap.md +203 -0
  43. package/skills/softure-roadmap/references/interview.md +132 -0
  44. package/skills/softure-roadmap/references/slicing.md +118 -0
  45. package/skills/softure-rule-review/SKILL.md +83 -19
  46. package/skills/softure-rule-review/references/example-report.md +73 -0
  47. package/skills/softure-rule-review/references/scorecard.md +129 -0
  48. package/skills/softure-shape/SKILL.md +163 -53
  49. package/skills/softure-shape/references/example-shape-notes.md +192 -0
  50. package/skills/softure-shape/references/question-bank.md +248 -0
@@ -2,10 +2,12 @@
2
2
  name: softure-research
3
3
  description: >
4
4
  Investigate the codebase for an open change and write context/changes/<id>/research.md:
5
- how things work today, which files, tests and data the change touches, risks, which
6
- SOFTURE modules already cover the need, and answers to every unknown. Use after
7
- softure-new and before planning. Triggers: "research the change", "investigate <id>",
8
- "/softure-research", "investigate the code before planning".
5
+ how things work today, which files, tests and data the change touches, what earlier
6
+ changes decided, risks, which SOFTURE modules already cover the need, and answers to every
7
+ unknown. Fans out read-only subagents with distinct roles and keeps the synthesis itself.
8
+ Use after softure-new and before planning, and again for follow-up questions on the same
9
+ change. Triggers: "research the change", "investigate <id>", "/softure-research",
10
+ "investigate the code before planning", "how does X work today".
9
11
  argument-hint: "<change-id> [--depth quick|normal|deep] [--focus \"area\"] [--auto]"
10
12
  allowed-tools:
11
13
  - Read
@@ -29,40 +31,54 @@ command output), so a planner can trust it without re-reading the code.
29
31
  - `context/workflow.json`: if missing, run `softure-init` first. If it lists `research.sources`, read those too
30
32
  (docs, PRD, notes) before the codebase sweep, and cite them like code.
31
33
  - `context/changes/<id>/change.md` with `status: new` or `preparing`: if missing, run
32
- `softure-new` first. If the status is later than `preparing`, warn that research is being
33
- redone and continue only when the user confirms (in `--auto`: continue and record it).
34
+ `softure-new` first. If the folder sits under `context/archive/`, refuse: archived changes are
35
+ history; open a new change instead. If the status is later than `preparing`, warn that research
36
+ is being redone and continue only when the user confirms (in `--auto`: continue and record it).
34
37
  - If `roadmap_item` is set, read its block in `context/foundation/roadmap.md`. Its **Unknowns**
35
38
  are mandatory questions for this research.
36
39
  - `context/foundation/lessons.md`, when present. Note the lessons whose "Applies to" overlaps
37
- this change.
40
+ this change, and use them as priors: an accepted rule narrows what is worth re-investigating.
41
+ - Every file named in change.md or in the request (ticket, spec, JSON sample): read it **fully,
42
+ yourself, before** fanning out. Subagents get a better brief when you already know the input.
38
43
 
39
44
  ## Procedure
40
45
 
41
46
  1. **Frame the questions.** List what must be known to plan: the Intent, every roadmap
42
47
  Unknown, and the implicit questions (where is it implemented, who calls it, what data does it
43
- read and write, how is it tested, what breaks if it changes). Pick the depth:
48
+ read and write, how is it tested, what breaks if it changes, what did earlier changes decide
49
+ here). Pick the depth:
44
50
  - `quick`: one area, under about 10 files.
45
51
  - `normal`: the default.
46
52
  - `deep`: money, data migrations, auth, concurrency, or anything irreversible.
47
53
 
48
- 2. **Fan out for breadth.** For independent questions, launch parallel **read-only** subagents
49
- (Explore-type, or general-purpose told not to edit). Each subagent gets:
50
- - one question or area;
51
- - the instruction to cite `path:line` for every claim;
52
- - a word limit;
53
- - the instruction to report facts, not proposals.
54
-
55
- Keep the synthesis yourself. Do not delegate conclusions.
56
-
57
- 3. **Go deep where it matters.** Read the central files yourself. Trace one real request or
54
+ 2. **Settle scope when it is ambiguous** (interactive only; skip when change.md and the
55
+ Unknowns pin it). Ask **one question at a time**, at most two, each with 2 to 4 concrete
56
+ options, a one-line consequence each, recommendation first: *Depth* (map of entry points /
57
+ full flow with failure modes) and *Focus* (data and migrations / integration points / history
58
+ of earlier decisions / performance). `--auto`: no question; depth from the risk profile, focus
59
+ from the Intent and Unknowns, both recorded under `## Decisions (auto)`.
60
+
61
+ 3. **Fan out for breadth.** Split the questions into 2 to 4 independent areas (never more than
62
+ 5) and launch read-only subagents for them **in one message**, so they run in parallel. Give
63
+ each a distinct role: *locator* (where things live), *flow tracer* (one path end to end),
64
+ *history miner* (earlier changes, archive, git log on the hot files), *data and test scout*.
65
+ Each brief carries one area, the verbatim Intent, the `path:line` rule, a word limit and
66
+ "facts only, no proposals". Roles and a brief template: read `references/fan-out.md` **when
67
+ you launch subagents**. If the harness has a task list, add one task per area.
68
+
69
+ 4. **Synthesize yourself.** Wait for **all** subagents. Live code beats historical documents
70
+ (say so when they disagree); read disputed lines yourself; spot-check every surprise. Do not
71
+ delegate conclusions.
72
+
73
+ 5. **Go deep where it matters.** Read the central files yourself. Trace one real request or
58
74
  flow end to end, from entry point through logic and data to response or UI. When the change
59
75
  touches data, look at the schema and migrations, and at real data shape if a safe read-only
60
76
  path exists (a dev DB, fixtures). Never write to a database during research.
61
77
 
62
- 4. **Map the tests.** Find which tests cover the affected code (unit, integration, e2e), how to
78
+ 6. **Map the tests.** Find which tests cover the affected code (unit, integration, e2e), how to
63
79
  run them, and where coverage is missing. Note flaky or slow suites.
64
80
 
65
- 5. **Check SOFTURE modules first** (WORKFLOW.md §10). If the change needs a generic capability,
81
+ 7. **Check SOFTURE modules first** (WORKFLOW.md §10). If the change needs a generic capability,
66
82
  check the `@softure-ai/*` catalog. Generic capabilities include auth, sessions, roles, feature
67
83
  switches, mail, unsubscribe, waitlist, MCP tokens, billing/trial, GDPR, consent, channel
68
84
  analytics, health and UI primitives. Record one of three outcomes:
@@ -70,32 +86,42 @@ command output), so a planner can trust it without re-reading the code.
70
86
  - **partially covered:** module plus the gap, to be filed as an issue in SOFTURE/AI;
71
87
  - **not applicable.**
72
88
 
73
- 6. **Assess risks.** Cover data loss, migrations and rollback, backwards compatibility,
89
+ 8. **Assess risks.** Cover data loss, migrations and rollback, backwards compatibility,
74
90
  performance, security (authz, input validation, secrets), concurrency, and other in-flight
75
91
  changes touching the same files (check `context/changes/*/change.md` Constraints).
76
92
 
77
- 7. **Resolve open questions.** Each question ends in one of three states:
93
+ 9. **Resolve open questions.** Each question ends in one of three states:
78
94
  - **answered**, with evidence;
79
95
  - **decided**, with the decision, the reason, and who decided (owner, or auto);
80
96
  - **escalated**, meaning it blocks planning, with the exact question and its options.
81
97
 
82
98
  A research document with unanswered questions and no escalation is unfinished.
83
99
 
84
- 8. **Write `research.md`** using the template below, in the `workflow.json` language.
100
+ 10. **Write `research.md`** using the template below, in the `workflow.json` language. Capture
101
+ the snapshot first (`git rev-parse --short HEAD`, current branch, date in
102
+ `workflow.json` → `timezone` when set). No placeholder values: a field you cannot fill is a
103
+ finding, not a blank.
104
+
105
+ 11. **Update `change.md`.** Set `status: preparing` and update `updated`.
106
+
107
+ 12. **Report** a five-line summary: key findings, risks, module verdict, escalations, next step.
85
108
 
86
- 9. **Update `change.md`.** Set `status: preparing` and update `updated`.
109
+ ## Follow-up questions
87
110
 
88
- 10. **Report** a five-line summary: key findings, risks, module verdict, escalations, next step.
111
+ Do not rewrite the document. Append `## Follow-up <YYYY-MM-DD>: <question>` with its own
112
+ evidence, fan out only for the new area, correct earlier sections only when the follow-up proved
113
+ them wrong (dated), and update `updated` in change.md.
89
114
 
90
115
  ## Output template
91
116
 
92
117
  ```markdown
93
118
  # Research: <change-id>
94
119
 
95
- Input: change.md[, roadmap <ID>]. Depth: <quick|normal|deep>.
120
+ Input: change.md[, roadmap <ID>][, research.sources]. Depth: <quick|normal|deep>.
121
+ Snapshot: <short sha> on <branch>, <YYYY-MM-DD HH:MM zone>.
96
122
 
97
123
  ## Summary
98
- <5–8 lines a planner can act on>
124
+ <5-8 lines a planner can act on>
99
125
 
100
126
  ## Current state
101
127
  <how it works today, end to end, with path:line references>
@@ -105,13 +131,19 @@ Input: change.md[, roadmap <ID>]. Depth: <quick|normal|deep>.
105
131
  | --- | --- | --- |
106
132
 
107
133
  ## Data
108
- <tables, columns, migrations, real data shape, invariants — or "none">
134
+ <tables, columns, migrations, real data shape, invariants, or "none">
109
135
 
110
136
  ## Tests
111
137
  <what covers it, how to run, gaps>
112
138
 
139
+ ## Patterns to follow
140
+ <conventions the code already uses here that the plan must match, with an example path:line>
141
+
142
+ ## Prior work
143
+ <earlier changes, archived research or plans, commits that decided something here; path + one line each, or "none found">
144
+
113
145
  ## SOFTURE modules
114
- <covered / partially covered (gap → issue) / not applicable — with reasoning>
146
+ <covered / partially covered (gap -> issue) / not applicable, with reasoning>
115
147
 
116
148
  ## Risks
117
149
  <each: what can go wrong, likelihood, mitigation idea>
@@ -120,7 +152,7 @@ Input: change.md[, roadmap <ID>]. Depth: <quick|normal|deep>.
120
152
  <L-NNN: why it applies>
121
153
 
122
154
  ## Answers to unknowns
123
- <each roadmap unknown and implicit question → answer with evidence>
155
+ <each roadmap unknown and implicit question -> answer with evidence>
124
156
 
125
157
  ## Open questions
126
158
  <each: answered / decided (by whom, why) / escalated (exact question + options)>
@@ -129,14 +161,18 @@ Input: change.md[, roadmap <ID>]. Depth: <quick|normal|deep>.
129
161
  <only in --auto>
130
162
  ```
131
163
 
164
+ A complete realistic example, and a bad one with what is wrong with it: read
165
+ `references/example-research.md` **before writing your first research.md in a repo**, or when
166
+ unsure how much detail a section needs.
167
+
132
168
  ## Status transitions
133
169
 
134
- - `new` (or `preparing`) → `preparing`.
170
+ - `new` (or `preparing`) -> `preparing`.
135
171
 
136
172
  ## `--auto`
137
173
 
138
- - Choose the depth from the risk profile. Use `deep` whenever money, data migration, auth or
139
- deletion is involved.
174
+ - No scope question (step 2). Choose the depth from the risk profile. Use `deep` whenever money,
175
+ data migration, auth or deletion is involved.
140
176
  - Resolve questions by evidence first, then by the safer option. Record each choice under
141
177
  `## Decisions (auto)`.
142
178
  - Escalate (stop, do not plan) only when a question changes the scope of change.md or requires
@@ -148,13 +184,17 @@ Input: change.md[, roadmap <ID>]. Depth: <quick|normal|deep>.
148
184
  - [ ] Every roadmap Unknown is answered, decided or escalated.
149
185
  - [ ] Tests that will prove the change are identified, with the command to run them.
150
186
  - [ ] The SOFTURE module verdict is explicit.
187
+ - [ ] Prior work was searched (`context/changes/`, `context/archive/`, git log), even if nothing was found.
151
188
  - [ ] Collisions with other in-flight changes have been checked.
189
+ - [ ] The snapshot line names a real commit; no placeholders anywhere.
152
190
  - [ ] The document contains no implementation plan, only options and facts.
153
191
 
154
192
  ## Anti-patterns
155
193
 
156
194
  - Summarising file names without reading them ("`auth.ts` handles auth").
157
195
  - Copying subagent output unverified. Spot-check every surprising claim yourself.
196
+ - Subagents with overlapping roles, or synthesis started before all of them returned.
197
+ - Treating an archived plan as the current state. History explains, code decides.
158
198
  - Proposing the solution and calling it research.
159
199
  - Writing to the database or changing code "to check something".
160
200
  - Leaving an "Open questions" list with nothing marked as resolved or escalated.
@@ -0,0 +1,106 @@
1
+ # Example research.md
2
+
3
+ A fictional invoicing tool (Next.js, Postgres via drizzle, a nightly job runner). The change is
4
+ roadmap item **INV-4**: "Send a reminder e-mail when an invoice is 7 days overdue." Roadmap
5
+ Unknowns: *Do we already track when an invoice became overdue? Can we send mail today, and how?*
6
+
7
+ Use it for the level of detail, not for the content.
8
+
9
+ ## Good
10
+
11
+ ```markdown
12
+ # Research: overdue-invoice-reminders
13
+
14
+ Input: change.md, roadmap INV-4, research.sources (docs/billing.md). Depth: deep (customer-facing mail, money-adjacent).
15
+ Snapshot: 3f9c2e1 on main, 2026-10-02 10:14 Europe/Warsaw.
16
+
17
+ ## Summary
18
+ - "Overdue" is not stored; it is computed on read from `due_date < today` (src/invoices/status.ts:12-31). There is no timestamp of when an invoice became overdue.
19
+ - "7 days overdue" can be computed from `due_date + 7` without a new column, but "send once" needs a record of sent reminders. Nothing like it exists.
20
+ - Mail already goes out through `@softure-ai/mail` for receipts (src/mail/send-receipt.ts:8); its template and unsubscribe handling cover reminders. Module verdict: covered.
21
+ - The nightly runner (jobs/nightly.ts:20) runs at 02:00 server time and already iterates invoices for the ageing report, so a reminder step fits there.
22
+ - Main risk: double sends when the job is retried. The runner retries on failure (jobs/runner.ts:44) and has no idempotency key.
23
+ - One escalation: whether partially paid invoices get a reminder (business rule).
24
+
25
+ ## Current state
26
+ 1. An invoice is created in `createInvoice` (src/invoices/actions.ts:40-88) with `due_date` = issue date + `payment_terms_days` (default 14, src/invoices/defaults.ts:3).
27
+ 2. Status is derived, never stored: `getInvoiceStatus` returns `paid` when `paid_cents >= total_cents`, `overdue` when `due_date < today` and not paid, else `open` (src/invoices/status.ts:12-31). "today" is computed with `startOfDay(new Date())` in server time, not in the account's time zone (status.ts:14).
28
+ 3. The ageing report job calls `listUnpaidInvoices()` (src/invoices/queries.ts:55) once per night (jobs/nightly.ts:20-37).
29
+ 4. Receipts are sent with `sendMail({ template: "receipt", to, data })` from `@softure-ai/mail` (src/mail/send-receipt.ts:8-19); the unsubscribe link is added by the module.
30
+
31
+ ## Affected surface
32
+ | Area | Files | Why |
33
+ | --- | --- | --- |
34
+ | Job | jobs/nightly.ts, jobs/runner.ts | new step; retry behaviour matters |
35
+ | Query | src/invoices/queries.ts | needs "unpaid and due_date = today - 7" |
36
+ | Mail | src/mail/, messages/en.ts | new template and copy |
37
+ | Schema | src/db/schema.ts, drizzle/ | record of sent reminders |
38
+
39
+ ## Data
40
+ - `invoices`: `due_date date not null`, `total_cents int`, `paid_cents int default 0` (src/db/schema.ts:31-52). No status column.
41
+ - Dev DB, read-only query: 1,204 invoices, 87 unpaid past due, 9 with `paid_cents` between 1 and `total_cents - 1` (partially paid).
42
+ - No table records sent mail per invoice. `mail_log` exists but stores only template and recipient, no invoice id (schema.ts:90-98).
43
+
44
+ ## Tests
45
+ - `src/invoices/status.test.ts` covers paid/open/overdue, but not the day boundary or time zone.
46
+ - `jobs/nightly.test.ts` runs the ageing step against PGlite; run with `npm test -- jobs/`.
47
+ - No test covers runner retries. Gap.
48
+
49
+ ## Patterns to follow
50
+ - Jobs are plain async functions registered in `jobs/registry.ts:5-18`, each step wrapped in `withJobLog` (jobs/nightly.ts:22).
51
+ - Mail templates live in `src/mail/templates/<name>.tsx` with copy in `messages/en.ts` (example: receipt.tsx).
52
+
53
+ ## Prior work
54
+ - `context/archive/2026-08-14-payment-terms/plan.md`: chose to derive status instead of storing it, "to avoid a backfill"; still true in code.
55
+ - `git log --follow jobs/runner.ts`: retries added in a1b2c3d after a timeout incident; no idempotency was added then.
56
+ - No earlier change touched reminders.
57
+
58
+ ## SOFTURE modules
59
+ - Mail: **covered** by `@softure-ai/mail` (templates, unsubscribe, sending log). Configure a `reminder` template in `softure.config.ts`.
60
+ - Scheduling: not applicable (the project has its own runner).
61
+
62
+ ## Risks
63
+ - Double send on job retry: likely (retries exist, no idempotency). Mitigation idea: a unique `(invoice_id, kind)` row written in the same transaction as the send decision.
64
+ - Day boundary in server time instead of account time zone: medium; reminders a day early or late for accounts far from the server. See L-012.
65
+ - Volume: 87 overdue today; no throttling needed at this size.
66
+
67
+ ## Relevant lessons
68
+ - L-012 "Compute day boundaries in the account time zone": status.ts:14 violates it today; the reminder query would inherit the bug.
69
+
70
+ ## Answers to unknowns
71
+ - *Do we track when an invoice became overdue?* No. It is derived from `due_date` (status.ts:12-31); "7 days overdue" = `due_date = today - 7` in the account zone.
72
+ - *Can we send mail today, and how?* Yes, `@softure-ai/mail` (send-receipt.ts:8-19), unsubscribe included.
73
+
74
+ ## Open questions
75
+ - Should the reminder fire once or every 7 days? **Decided** by owner on 2026-10-02: once.
76
+ - Do partially paid invoices get a reminder? **Escalated**: business rule. Options: (a) yes, with the remaining amount; (b) no, only fully unpaid. 9 invoices today.
77
+ - Does the runner run exactly once per night? **Answered**: no, it retries up to 3 times (runner.ts:44).
78
+ ```
79
+
80
+ Why it works: the snapshot pins what was read; every claim has a location; the data section
81
+ uses a real read-only query; absence ("no test covers retries", "no earlier change") is stated;
82
+ the risk names a mechanism, not a worry; the escalation gives options and their size.
83
+
84
+ ## Bad
85
+
86
+ ```markdown
87
+ ## Summary
88
+ Invoices have statuses and there is a mail system. We should add a `reminded_at` column and a cron job.
89
+
90
+ ## Current state
91
+ `status.ts` handles statuses. `mail/` sends e-mails.
92
+
93
+ ## Risks
94
+ Possible edge cases with dates.
95
+
96
+ ## Open questions
97
+ - What about partial payments?
98
+ ```
99
+
100
+ What is wrong:
101
+ - It proposes a solution (`reminded_at`, a cron job) instead of describing what exists.
102
+ - "Has statuses" is false: status is derived, and the plan built on this would add a backfill.
103
+ - File names without line references or behaviour; nobody can verify them.
104
+ - "Edge cases with dates" names no mechanism; the real one (server-time day boundary, L-012) is missed.
105
+ - The open question has no state: not answered, decided or escalated.
106
+ - No module verdict, no tests, no prior work, no snapshot.
@@ -0,0 +1,61 @@
1
+ # Fanning out research to subagents
2
+
3
+ Read this when step 3 of softure-research launches subagents. The goal is breadth without
4
+ overlap: each subagent covers one area nobody else covers, and you keep the conclusions.
5
+
6
+ ## Roles
7
+
8
+ Pick 2 to 4 that fit the change. Never more than 5. A role that has nothing to find for this
9
+ change is not launched (no padding).
10
+
11
+ | Role | Agent type | Question it answers | Typical sources |
12
+ | --- | --- | --- | --- |
13
+ | **Locator** | fast search (Explore-type) | Where does X live? Which files define, call, test and configure it? | grep for symbols, routes, table names, message keys |
14
+ | **Flow tracer** | general-purpose, told read-only | What happens, step by step, when a real user does Y? Where does data enter, change, and leave? | entry point (route, action, job, CLI) through to the response, UI or side effect |
15
+ | **History miner** | fast search | What did earlier work decide here, and why? What broke before? | `context/changes/*/`, `context/archive/*/` (research, plan, reviews), `context/foundation/lessons.md`, `git log --follow` on the hot files, commit messages |
16
+ | **Data and test scout** | general-purpose, told read-only | What does the schema say, what invariants hold, what do the tests cover, how are they run? | schema files, migrations, fixtures, test files, `workflow.json` gates |
17
+ | **Sources reader** | fast search | What do the configured docs say about this area? | `workflow.json` -> `research.sources` |
18
+
19
+ For `quick` depth, one locator plus your own reading is usually enough. For `deep`, add the
20
+ history miner and the data and test scout even when they seem unlikely to find much: in money,
21
+ auth and migration work, the surprise is usually in the history or the data.
22
+
23
+ ## Brief template
24
+
25
+ Every brief is self-contained. The subagent has not seen the conversation.
26
+
27
+ ```text
28
+ Role: <locator | flow tracer | history miner | data and test scout | sources reader>.
29
+ Change: <change-id>. Intent (verbatim from change.md): "<Intent>".
30
+ Your area: <one area, one or two concrete questions>.
31
+ Out of your area: <what the other subagents cover, so you do not duplicate it>.
32
+
33
+ Rules:
34
+ - Read-only. Do not edit, create or delete files. Do not write to any database.
35
+ - Cite path:line (or doc path + heading) for every claim. A claim without a citation is dropped.
36
+ - Report facts, not proposals. "Function X writes column Y" is a fact; "we should add an index" is not.
37
+ - Report usage, not only definitions: who calls it, with what arguments, under what conditions.
38
+ - Say explicitly what you looked for and did not find.
39
+ - At most <N> words.
40
+
41
+ Answer format:
42
+ 1. Findings (bullets, each with a citation).
43
+ 2. Not found (what you searched for, where).
44
+ 3. Surprises (anything that contradicts the Intent or common sense).
45
+ ```
46
+
47
+ ## Synthesis rules
48
+
49
+ - **Wait for all.** Do not draft conclusions while a subagent is still running; a late answer
50
+ often reverses an early one.
51
+ - **Live code beats documents.** When an archived plan says one thing and the code does
52
+ another, the code is the current state; the plan explains how it got there. Record both.
53
+ - **Disagreement means reading.** When two subagents contradict each other, open the disputed
54
+ lines yourself and record which was right.
55
+ - **Surprises get verified.** Every item in a subagent's "Surprises" is checked by you before it
56
+ enters research.md.
57
+ - **Absence is a finding.** "No test covers the retry path" or "no earlier change touched this"
58
+ is worth a line; it saves the planner from searching again.
59
+ - **Connect, do not concatenate.** research.md is organised by the template sections, not by
60
+ subagent. A finding from the flow tracer and one from the history miner about the same function
61
+ belong in the same paragraph.