@softure-ai/skills 0.2.1 → 0.4.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 (53) hide show
  1. package/README.md +4 -0
  2. package/WORKFLOW.md +30 -3
  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 +59 -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 +215 -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
  51. package/skills/softure-worktree/SKILL.md +11 -3
  52. package/skills/softure-worktree/scripts/wt-integration.sh +27 -3
  53. package/skills/softure-worktree-manager/SKILL.md +24 -4
@@ -0,0 +1,132 @@
1
+ # Framing interview: three anchors, each with a recommendation
2
+
3
+ Read this before step 4 of the procedure. The PRD says *what* to build. The order depends on
4
+ three calls the PRD rarely makes explicit. Ask them, one at a time, each with a recommendation
5
+ you can defend from the material. Everything else in the roadmap is derived.
6
+
7
+ Two ways this goes wrong:
8
+
9
+ - **Interrogation:** asking what the PRD, the shape notes or the code already answer, or asking
10
+ more than three questions. The owner's attention is the scarcest input.
11
+ - **False confidence:** deciding the framing silently. These three calls change the order of
12
+ everything; the owner must see them as choices.
13
+
14
+ ## The three anchors
15
+
16
+ ### 1. What this roadmap optimises for (goal)
17
+
18
+ | Value | Signals in the material | Effect on the order |
19
+ |---|---|---|
20
+ | `feedback` | "learn from real users", an unvalidated assumption named in the shape notes | ties go to the item that tests the riskiest assumption soonest |
21
+ | `quality` | NFRs that gate launch (privacy, correctness, uptime), regulated domain | foundations (observability, access control) are not pushed behind features |
22
+ | `simplicity` | small audience, single operator, appetite stated as small | ties go to the smallest viable item; defer aggressively |
23
+ | `speed` | a hard date in the PRD summary or shape notes | strict `must` path first; everything else is deferred, not sequenced late |
24
+ | `learning` | exploratory project, a stack the team has not shipped | ties go to items that exercise the unfamiliar part earliest |
25
+ | `other` | none of the above fits | owner states it in their words |
26
+
27
+ Adjacent values often fire together (`feedback` and `speed` when the PRD says "ship to learn").
28
+ Offer the adjacent one as the alternative, not an unrelated value.
29
+
30
+ ### 2. Which item proves the idea first (north star)
31
+
32
+ The smallest end-to-end flow that, once merged, shows the core promise of the PRD works for a
33
+ real user. It usually traces to the first `must` FR under the primary goal (`G-1`). Offer up to
34
+ three candidates by name (`<ID candidate>: <outcome>`), each with why it is a good first proof and
35
+ what it costs in prerequisites. The north star is placed as early as its prerequisites allow.
36
+
37
+ ### 3. What most likely stalls the work (main risk)
38
+
39
+ | Value | Fires when |
40
+ |---|---|
41
+ | `decisions` | three or more open PRD questions, or one open question that gates a `must` FR |
42
+ | `capacity` | scope is wide and the owner is the only reviewer; parallelism is the lever |
43
+ | `time` | scope versus the stated date does not fit |
44
+ | `skills` | a layer nobody on the project has shipped (payments, offline sync, a new runtime) |
45
+ | `external` | a vendor, an account, a legal text or a design asset that is not in hand |
46
+ | `none` | no signal fires; say so |
47
+
48
+ The answer shapes the roadmap: `decisions` → items gated by open questions become
49
+ `blocked (<question>)` and the questions go to `## Owner decisions and checks`; `capacity` →
50
+ compute parallel lanes generously; `external` → the dependency is a named prerequisite, and an
51
+ item that needs the owner's account gets `Mode: owner`.
52
+
53
+ ### Derived, never asked: where to invest depth
54
+
55
+ For each layer (UI, server, data, infrastructure) decide "invest" or "keep simple" from the goal
56
+ answer, launch-gating NFRs, baseline gaps under `must` FRs, and where the open questions cluster.
57
+ Name the signal for every "invest". State the result in the recap; the owner may override it in
58
+ one line.
59
+
60
+ ## How to ask
61
+
62
+ - One question per message, in the order goal → north star → main risk.
63
+ - Option 1 is the recommendation, labelled `(Recommended)`, with one line of evidence: a quoted
64
+ phrase or an ID from the PRD, the shape notes or the baseline, and why it matters *for this
65
+ question*. A quote that does not change the answer is noise; drop it.
66
+ - At most two alternatives, each with the condition under which it would be the right call and
67
+ what it would change in the order. An alternative without that condition is a strawman; remove it.
68
+ - Always a last option "something else: tell me".
69
+ - If the material supports only one reading, offer the recommendation plus the free-form option
70
+ and say "the material supports only one reading here; correct me if yours differs".
71
+ - Ask in `workflow.json` → `language`, in plain product words. Not "north star" but "the first
72
+ thing that shows the product works". If no question tool exists, ask in plain chat with
73
+ labelled options.
74
+
75
+ **Skip an anchor** only when the material states the value outright (a launch date plus "must be
76
+ live before the season" locks `speed`). Announce the skip with the quote. If any plausible
77
+ alternative exists, ask.
78
+
79
+ **Unusual product shape.** When the product is not a familiar pattern (dashboard, CRUD tool,
80
+ content site, marketplace, wrapper around a model), say before the first question that your
81
+ recommendations are weaker than usual and invite pushback. Phrase the evidence as "my best read".
82
+ You may add up to two free-form follow-up exchanges after the anchors. That is the only way to go
83
+ beyond three.
84
+
85
+ **Cap.** Three anchors (plus two follow-ups in the exception above). If an anchor is still open
86
+ after that, take the recommendation, record it with its reason under `## Order`, and continue.
87
+
88
+ ## Recap (no new question)
89
+
90
+ After the last answer, send one message that locks the framing:
91
+
92
+ ```
93
+ Locking in the framing:
94
+ - Optimising for: speed. You chose it; PRD summary: "live before the spring season".
95
+ - First proof: BK-2, a visitor books a free slot and gets a confirmation. It exercises G-1 end to end.
96
+ - Main risk: decisions. PRD has 3 open questions; the cancellation one gates FR-5.
97
+ - Depth: data (availability rules are the core; NFR-2 forbids double booking). The rest stays simple.
98
+
99
+ Say "go", or correct any line ("depth should be in UI, not data"). I will not re-ask the others.
100
+ ```
101
+
102
+ ## `--auto`
103
+
104
+ No questions. Take each recommendation; when two values are equally supported, choose the one
105
+ that orders risk earlier. Record every anchor under `## Decisions (auto)`:
106
+ `- Optimising for → speed (PRD summary: "live before the spring season")`.
107
+
108
+ ## Example: a good and a bad question
109
+
110
+ Good (booking app, anchor 2):
111
+
112
+ ```
113
+ Which item should prove the product works first?
114
+
115
+ 1. BK-2: a visitor books a free slot and gets a confirmation (Recommended)
116
+ It is FR-1 + FR-3, the core of G-1 "clients book without calling". Needs only the
117
+ availability model (BK-1).
118
+ 2. BK-4: staff see the day's bookings
119
+ Right if the clinic's first pain is the paper diary, not phone calls; it would move the staff
120
+ view ahead of public booking.
121
+ 3. Something else: tell me.
122
+ ```
123
+
124
+ Bad:
125
+
126
+ ```
127
+ What is the north star wedge? 1) Booking 2) Payments 3) Analytics 4) Notifications 5) Other
128
+ ```
129
+
130
+ Why it is bad: jargon the owner has to decode; five options with no evidence; "Analytics" is not in
131
+ the PRD (a strawman that also invents scope); no recommendation, so the owner does the analysis the
132
+ skill was supposed to do.
@@ -0,0 +1,118 @@
1
+ # Slicing, foundations, ordering and parallel lanes
2
+
3
+ Read this while doing steps 5 to 9 of the procedure, and whenever an item feels too big, too
4
+ small, or horizontal.
5
+
6
+ ## The vertical test
7
+
8
+ Ask of every item: **after this merges alone, can someone do something they could not do before,
9
+ or did a number we measure move?** If the honest answer is "no, but the next item can build on it",
10
+ the item is horizontal. Either fold it into the first item that needs it, or make it a foundation
11
+ with a named `Unlocks` (below).
12
+
13
+ An item is the right size when:
14
+
15
+ - one plan of 1 to 4 phases covers it, each phase verifiable on its own;
16
+ - it adds at most one migration;
17
+ - it has one primary surface (a screen, an endpoint family, a job), not three;
18
+ - it has at most three unknowns; more means research would be a project of its own;
19
+ - it can merge without a feature flag, or the flag is part of the item.
20
+
21
+ Size is expressed by these signals, never in hours, days, points or t-shirt sizes. Agent execution
22
+ is not linear in calendar time, and an estimate in the roadmap gets read as a promise.
23
+
24
+ ## When an item is too big: split patterns
25
+
26
+ | Pattern | Example (booking app) |
27
+ |---|---|
28
+ | by user path: happy path first, edge paths after | "book a slot" first; "reschedule" and "cancel" as their own items |
29
+ | by data subset | one service type with a fixed duration first; variable durations later |
30
+ | by role | the client's view before the staff view, or the reverse if that is the first proof |
31
+ | walking skeleton plus enhancements | a bare booking flow end to end, then reminders, then deposits |
32
+ | read before write | staff see bookings before they can edit them |
33
+ | manual before automated | the owner enters opening hours in a form before a calendar import exists |
34
+ | fixed before configurable | one hard-coded cancellation window, then a setting |
35
+
36
+ ## When an item is too small: fold it
37
+
38
+ A copy change, a single toggle, or a config value with no outcome of its own belongs inside the
39
+ item whose outcome it serves. A roadmap of twenty one-line items hides the order instead of
40
+ showing it.
41
+
42
+ ## Foundations: the only horizontal work allowed
43
+
44
+ A foundation has no user-visible outcome by itself. It earns a row only when its block names what
45
+ it **unlocks**: specific item IDs, a blocking unknown it resolves, or a verification path a later
46
+ item needs (a seeded test account, an email sandbox). Rules:
47
+
48
+ - mark the outcome `(foundation) …` so nobody mistakes it for a feature;
49
+ - never scaffold a layer the baseline reports as `present`; if the baseline is wrong, fix the
50
+ baseline first;
51
+ - no generic "data layer", "API layer" or "auth system" items; name the concrete capability
52
+ ("(foundation) staff shifts stored and queryable");
53
+ - if it unlocks a single small item, fold it into that item instead.
54
+
55
+ ## Every item traces to a source
56
+
57
+ Each item cites at least one PRD ID (`FR-n`, `NFR-n`, `G-n`) or, with `--from-feedback`, the
58
+ feedback point it answers. Something that surfaced in the interview but is in neither ("we should
59
+ also do offline mode") is **not** an item: it becomes an owner question under
60
+ `## Owner decisions and checks` if it is a real gap, or an entry in `context/backlog/<topic>.md`
61
+ if the owner chose to defer it. The roadmap orders what the PRD declares; it does not grow it.
62
+
63
+ ## Ordering
64
+
65
+ 1. Build the dependency graph: each item's prerequisites are other item IDs plus concrete external
66
+ state ("clinic's SMTP account verified", "seed list of services"), never vague ("backend ready").
67
+ 2. Sort topologically. No item may depend on one listed after it; no cycles.
68
+ 3. Place the north star as early as its prerequisites allow. Do not delay it for symmetry.
69
+ 4. Break the remaining ties by the goal from the interview:
70
+
71
+ | Goal | Tie-break |
72
+ |---|---|
73
+ | `feedback` | the item that exposes the riskiest assumption first, even if it demos worse |
74
+ | `quality` | foundations for observability and access control early, not after features |
75
+ | `simplicity` | the smallest viable item first; defer liberally |
76
+ | `speed` | strict `must` path; anything else is deferred, not queued at the end |
77
+ | `learning` | the item that touches the unfamiliar part first |
78
+
79
+ 5. If an open owner question decides the order ("clients first or staff first?"), do not pick an
80
+ order that prejudges it. The affected items are `blocked (<question>)` until it is answered.
81
+ 6. Put a "finish" item last when the theme needs a measurement or review across items (for
82
+ example, an end-to-end check of the whole booking flow on production data).
83
+
84
+ ## Unknowns and blockers
85
+
86
+ - **Unknowns** are questions research can answer or the owner must decide:
87
+ `- <question> (owner: research | <person>; blocks: yes | no)`. One with `blocks: yes` makes the
88
+ row `blocked (<the question, short>)`.
89
+ - **External blockers** (a vendor, an account, a legal text, a design asset) go into
90
+ Prerequisites as external state. If the team can resolve it alone, it is an unknown instead.
91
+ - Cross-cutting questions that gate several items go to `## Owner decisions and checks`, each
92
+ naming the IDs it gates.
93
+
94
+ ## Parallel lanes
95
+
96
+ A lane is one chain of prerequisites. Two items may run at the same time only if:
97
+
98
+ - their estimated file sets are disjoint (say "estimate": it comes from a quick search, not a plan);
99
+ - at most one of them adds a migration (`workflow.json` → `migrations`);
100
+ - neither changes a shared primitive (a layout, a design token file, an auth helper, a schema the
101
+ other reads).
102
+
103
+ Give each hot file exactly one owner and write that down. Under `## Order`, show the lanes as a
104
+ small table `| Lane | Chain | Owns | Note |` with chains written as `BK-1 → BK-2 → BK-3`. Two to five
105
+ lanes; fewer than two means the order already reads as one line and the table is noise; more than
106
+ five usually means the graph is over-split. Every item appears in exactly one lane. When the main
107
+ risk is `capacity`, look harder for parallel lanes: they are the owner's best lever.
108
+
109
+ ## Good and bad items
110
+
111
+ | Bad item | Why | Better |
112
+ |---|---|---|
113
+ | "Database schema for invoices" | horizontal; nothing observable after merge | "A freelancer creates an invoice and downloads it as PDF" (schema is inside) |
114
+ | "Invoicing module" | too big: create, send, remind, pay, export | split by path: create + PDF, then send by email, then reminders |
115
+ | "Change the button colour on the invoice page" | too small, no outcome | fold into the item whose screen it is |
116
+ | "Set up the API layer" | generic foundation, no `Unlocks` | "(foundation) invoice numbering is gap-free per year; unlocks IN-2, IN-4" |
117
+ | "Add analytics dashboard" (not in PRD) | invented scope | owner question or backlog entry |
118
+ | "Wiki search (2 days, M)" | estimate and size label | drop the estimate; split by data subset if it is big |
@@ -2,11 +2,13 @@
2
2
  name: softure-rule-review
3
3
  description: >
4
4
  Audit the instructions agents follow in this repo (AGENTS.md, CLAUDE.md, nested rule
5
- files, project skills under .claude/skills, context/foundation/lessons.md) for
6
- contradictions, stale paths and commands, duplication, vague or untestable rules and bloat.
7
- Produces a report with concrete edits and applies them on approval. Use when the user says
8
- "audit the rules", "review AGENTS.md", "are our instructions consistent", "clean up the
9
- rules", "audit AGENTS.md".
5
+ files, .cursor/rules, copilot instructions, project skills under .claude/skills,
6
+ context/foundation/lessons.md) for contradictions, stale paths and commands, duplication,
7
+ vague or untestable rules and bloat. Scores each rule file on a five-point scorecard
8
+ (length, inline snippets, precise language, redundant knowledge, rule ordering), proposes
9
+ concrete edits with path:line and applies them on approval. Use when the user says "audit
10
+ the rules", "review AGENTS.md", "check my CLAUDE.md", "score our agent instructions", "are
11
+ our instructions consistent", "clean up the rules".
10
12
  argument-hint: "[<path>...] [--apply] [--auto]"
11
13
  allowed-tools:
12
14
  - Read
@@ -20,21 +22,29 @@ allowed-tools:
20
22
 
21
23
  # softure-rule-review: instructions that agree with each other and with the repo
22
24
 
23
- Agents follow written rules literally. A stale command wastes a session, and two rules that
24
- contradict each other make behaviour random. This skill keeps the rule set small, true and
25
- consistent.
25
+ Agents follow written rules literally. A stale command wastes a session, two rules that
26
+ contradict each other make behaviour random, and a long file full of things the model already
27
+ knows buries the few rules that matter. This skill keeps the rule set small, true, consistent
28
+ and well ordered. It reviews the rule file as an artifact for agents, not the project's
29
+ architecture.
26
30
 
27
31
  ## Inputs
28
32
 
29
33
  Default set, when no paths are given:
30
- - `AGENTS.md`, `CLAUDE.md` (root and nested), `.cursor/rules/**`, `.github/copilot-instructions.md`;
34
+ - `AGENTS.md`, `CLAUDE.md` (root and nested), `.cursor/rules/**`, `.github/copilot-instructions.md`,
35
+ `.windsurfrules` and other rule files for agents;
31
36
  - `.claude/skills/*/SKILL.md` **owned by the project**. Skills installed by a package (listed in
32
37
  `.claude/softure-skills.json` or another manifest) are not edited here. Report issues with them
33
38
  upstream instead.
34
39
  - `context/foundation/lessons.md` and `context/workflow.json`.
35
40
 
41
+ With paths: a file is reviewed as given; a directory or glob expands to its rule files, each
42
+ scored separately (never merged into one score); a path that does not exist is reported and
43
+ skipped, never guessed at. Read every file fully, in chunks if it is long.
44
+
36
45
  The SOFTURE managed block (`<!-- softure-skills:begin … -->`) is read for contradictions but
37
- never edited. A conflict with it is resolved in the project's own text, or reported upstream.
46
+ never edited or scored. A conflict with it is resolved in the project's own text, or reported
47
+ upstream.
38
48
 
39
49
  ## Procedure
40
50
 
@@ -59,23 +69,64 @@ never edited. A conflict with it is resolved in the project's own text, or repor
59
69
  older rule with the same scope.
60
70
  4. **Find duplication.** The same rule stated in several places with drifting wording. Keep one
61
71
  canonical place and replace the rest with a pointer.
62
- 5. **Find vague rules.** A rule an agent cannot check ("write clean code", "be careful with X")
63
- is either sharpened into something testable or deleted.
72
+ 5. **Score each rule file** on the five checks below. Thresholds, the tests for redundancy, and
73
+ the grounded-replacement method: read `references/scorecard.md` **before scoring**.
74
+
75
+ | # | Check | What it catches |
76
+ |---|---|---|
77
+ | 1 | Length | files so long that rules in the middle lose attention |
78
+ | 2 | Inline snippets | copied code or config that will drift from the real file |
79
+ | 3 | Precise language | rules no diff can be checked against ("write clean code") |
80
+ | 4 | Redundant knowledge | framework defaults, definitions, tutorial text, copies of README |
81
+ | 5 | Rule ordering | critical rules buried in the middle, intro text at the top |
82
+
83
+ Each check gets OK / WARN / FAIL and a count. Vague rules (check 3) always get a concrete,
84
+ testable rewrite grounded in this project; label a rewrite **(assumed)** when the repo gives no
85
+ signal. Deleting a vague rule is right only when check 4 also flags it.
64
86
  6. **Find bloat.** Incident narratives, history, outdated rationale, and rules about code that
65
87
  no longer exists. Prefer moving the history to an archive file over deleting it, so the rule
66
- itself stays one or two lines.
88
+ itself stays one or two lines. A rule that looks generic but exists because of a real
89
+ incident stays; ask for a one-line pointer to the incident (a lesson number) so the next audit
90
+ does not delete it.
67
91
  7. **Find enforcement candidates.** Rules that a test, lint rule or database constraint could
68
92
  enforce. List them with the proposed mechanism.
69
- 8. **Report** (template below). Interactive: ask which groups to apply. With `--apply`, apply all
70
- non-controversial ones (see --auto).
93
+ 8. **Propose the order** (only when check 5 is WARN or FAIL). List the current headings with
94
+ line numbers, tag each section (CRITICAL, USEFUL, INTRO, REDUNDANT, VAGUE, REFERENCE), state
95
+ the structural problem in one paragraph, and propose a target order as moves (to top / kept /
96
+ to bottom / removed), never as a rewrite of rule text.
97
+ 9. **Report** (template below), with **Top 3 actions** ordered by leverage across all checks,
98
+ not by check number.
99
+ 10. **Apply on approval** (interactive). Ask one question per group, recommendation first:
100
+ - contradictions and stale references: apply all / pick / leave in the report;
101
+ - reorder (when proposed): reorder now / lift only the CRITICAL rules to the top / show the
102
+ reordered file first / leave in the report.
103
+
104
+ A reorder moves headings and their blocks only; every byte of rule text survives. Show
105
+ proposed edits as diffs before writing. With `--apply`, apply what `--auto` applies.
106
+ 11. **Remind** at the end of every run: change rules one structural edit at a time (reorder,
107
+ then split, then dedupe), and run one representative agent task after each. Rule edits change
108
+ behaviour only in the next session, and bundled edits make any shift impossible to attribute.
109
+
110
+ Edge cases (short files, reference-heavy files, `.mdc` frontmatter, generated stubs, root and
111
+ nested files that overlap): see the end of `references/scorecard.md`.
71
112
 
72
113
  ## Output
73
114
 
115
+ Written in `workflow.json` -> `language`; headings stay English.
116
+
74
117
  ```markdown
75
118
  # Rule review: <date>
76
119
 
77
120
  Files: N · Rules: M · Stale: a · Contradictions: b · Duplicates: c · Vague: d · Bloat: e
78
121
 
122
+ ## Scorecard
123
+ | File | Length | Snippets | Precise language | Redundant | Ordering |
124
+ |---|---|---|---|---|---|
125
+ | AGENTS.md | WARN (312 lines) | OK (0) | FAIL (5) | WARN (3) | FAIL (hard rules at line 240) |
126
+
127
+ ## Top 3 actions
128
+ 1. …
129
+
79
130
  ## Contradictions (fix first)
80
131
  1. AGENTS.md:40 "…" vs lessons.md L-017 "…". Same scope: <scope>. Winner: L-017 (newer, specific).
81
132
  Edit: replace AGENTS.md:40 with "…".
@@ -84,12 +135,19 @@ Files: N · Rules: M · Stale: a · Contradictions: b · Duplicates: c · Vague:
84
135
  1. AGENTS.md:88 `npm run db:fresh`: script does not exist. Edit: `npm run db:reset`.
85
136
 
86
137
  ## Duplicates
87
- ## Vague → sharpened or removed
138
+ ## Vague -> sharpened (path:line "phrase" -> "testable rewrite")
139
+ ## Redundant knowledge (path:line -> delete | pointer | keep with incident)
140
+ ## Inline snippets (path:line-range -> pointer to the real file)
141
+ ## Ordering (current order, tags, proposed moves)
88
142
  ## Bloat
89
143
  ## Could be enforced by tooling
90
144
  ## Proposed edits (unified diff per file)
91
145
  ```
92
146
 
147
+ A check that is OK gets one line in its section and nothing more. A complete example report
148
+ on a fictional repo: `references/example-report.md`, read it **before writing your first report
149
+ in a repo**.
150
+
93
151
  ## --auto
94
152
 
95
153
  Apply only edits that cannot change behaviour:
@@ -97,14 +155,17 @@ Apply only edits that cannot change behaviour:
97
155
  - removing exact duplicates and leaving a pointer;
98
156
  - trimming narrative history into an archive file.
99
157
 
100
- Contradictions and vague rules are reported, not applied, because they need the owner's
101
- intent. Commit applied edits as `docs(rules): rule review <date>` only when inside a change or
102
- when asked.
158
+ Contradictions, vague rules, redundant-knowledge deletions and reordering are reported, not
159
+ applied, because they need the owner's intent and a reorder changes what agents attend to.
160
+ Record each skipped group under `## Decisions (auto)` in the report. Commit applied edits as
161
+ `docs(rules): rule review <date>` only when inside a change or when asked.
103
162
 
104
163
  ## Checklist
105
164
 
106
165
  - [ ] Every referenced path, script and skill verified against the repo.
107
166
  - [ ] Every contradiction has a named winner and a concrete edit.
167
+ - [ ] Every rule file has a scorecard row; each vague phrase has a grounded rewrite.
168
+ - [ ] Top 3 actions ordered by leverage.
108
169
  - [ ] Package-managed blocks and skills untouched.
109
170
  - [ ] Proposed edits shown as diffs before applying (interactive).
110
171
 
@@ -112,8 +173,11 @@ when asked.
112
173
 
113
174
  - Adding new rules during an audit. This skill subtracts and sharpens.
114
175
  - Rewording everything into a new style. Only change what is wrong.
176
+ - "Just delete it" for a vague rule: the author meant something; translate it.
177
+ - Generic rewrites ("follow SOLID") that are as uncheckable as the original.
115
178
  - Deleting a lesson's history without keeping its rule and number.
116
179
  - Editing installed skills locally. The next install overwrites the edit.
180
+ - Several structural edits in one go, with no task run in between.
117
181
 
118
182
  ## Handoff
119
183
 
@@ -0,0 +1,73 @@
1
+ # Example rule review report
2
+
3
+ A fictional team wiki (Next.js, Postgres, pnpm). Root `AGENTS.md` (284 non-blank lines), a
4
+ nested `src/editor/AGENTS.md` (38 lines), `context/foundation/lessons.md` (12 lessons). Use it
5
+ for the level of detail, not the content.
6
+
7
+ ```markdown
8
+ # Rule review: 2026-10-02
9
+
10
+ Files: 3 · Rules: 61 · Stale: 2 · Contradictions: 1 · Duplicates: 2 · Vague: 5 · Bloat: 1
11
+
12
+ ## Scorecard
13
+ | File | Length | Snippets | Precise language | Redundant | Ordering |
14
+ |---|---|---|---|---|---|
15
+ | AGENTS.md | WARN (284 lines) | FAIL (3 blocks) | FAIL (4 phrases) | WARN (3) | FAIL (security rules at line 231) |
16
+ | src/editor/AGENTS.md | OK (38) | OK (0) | WARN (1) | OK (0) | OK |
17
+ | lessons.md | OK (96) | OK (0) | OK (0) | OK (0) | OK |
18
+
19
+ ## Top 3 actions
20
+ 1. Move "Permissions and private spaces" (AGENTS.md:231-248) to the top: it is the only CRITICAL section and sits after 230 lines of setup and style.
21
+ 2. Resolve the commit contradiction (AGENTS.md:57 vs L-009): agents currently get two answers.
22
+ 3. Replace the three copied config blocks (AGENTS.md:96-140) with pointers; they already differ from the real files.
23
+
24
+ ## Contradictions (fix first)
25
+ 1. AGENTS.md:57 "Commit only the files you changed" vs lessons.md L-009 "Commit the whole tree after each phase". Same scope: phase commits. Winner: L-009 (newer, specific, with incident). Edit: replace AGENTS.md:57 with "Phase commits include the whole tree (L-009)."
26
+
27
+ ## Stale references
28
+ 1. AGENTS.md:31 `pnpm db:fresh`: script does not exist in package.json. Edit: `pnpm db:reset`.
29
+ 2. src/editor/AGENTS.md:12 `src/editor/legacy/`: directory removed in 4e1a9c0. Edit: delete the line (the rule was about that directory only).
30
+
31
+ ## Duplicates
32
+ 1. "Run pnpm test before pushing" appears at AGENTS.md:44, AGENTS.md:202 and src/editor/AGENTS.md:5 with three wordings. Keep AGENTS.md:44; replace the others with nothing (the root file is always loaded).
33
+
34
+ ## Vague -> sharpened
35
+ 1. AGENTS.md:62 "Handle errors properly" -> "Server actions return `{ ok: false, error: { code, message } }` for expected failures (see src/pages/actions.ts:20)."
36
+ 2. AGENTS.md:63 "Write clean code" -> "Functions over 40 lines are split; no `any` without a comment saying why." (40 is **assumed**)
37
+ 3. AGENTS.md:71 "Be consistent with naming" -> "Reads go in `<entity>.queries.ts`, writes in `<entity>.actions.ts`, as in src/pages/."
38
+ 4. AGENTS.md:88 "Care about accessibility" -> "Every icon-only button has an `aria-label` from `messages/en.ts`; `pnpm lint` runs jsx-a11y."
39
+ 5. src/editor/AGENTS.md:20 "Keep the editor fast" -> "Typing latency stays under 16 ms per keystroke in the editor benchmark (`pnpm bench:editor`)."
40
+
41
+ ## Redundant knowledge
42
+ 1. AGENTS.md:9-24 explains what server components are -> delete.
43
+ 2. AGENTS.md:150-161 restates the folder layout from README.md -> pointer to README.md#layout.
44
+ 3. AGENTS.md:170 "TypeScript strict mode is on" -> delete; tsconfig.json enforces it.
45
+
46
+ ## Inline snippets
47
+ 1. AGENTS.md:96-112 copy of tsconfig.json (already differs: `noUncheckedIndexedAccess` missing) -> pointer.
48
+ 2. AGENTS.md:114-127 example page component -> pointer to src/app/pages/[slug]/page.tsx.
49
+ 3. AGENTS.md:129-140 sample migration -> pointer to drizzle/0007_page_versions.sql.
50
+
51
+ ## Ordering
52
+ Current: 1 Welcome (1) INTRO · 2 About the team (5) INTRO · 3 Setup (26) USEFUL · 4 Style (55) VAGUE · 5 Config examples (94) REDUNDANT · 6 Layout (148) REDUNDANT · 7 Testing (190) USEFUL · 8 Permissions and private spaces (231) CRITICAL · 9 Links (250) REFERENCE.
53
+ Problem: the only CRITICAL section is at line 231, after 25 lines of INTRO and two REDUNDANT blocks.
54
+ Proposed: Permissions (231) -> top · Testing (190) -> second · Setup (26) kept · Style (55) kept, after the rewrites · Config examples and Layout -> removed (pointers) · Welcome/Team -> one line under the title · Links kept at the bottom.
55
+
56
+ ## Bloat
57
+ 1. AGENTS.md:205-228 incident story about the March outage. Move to context/archive/notes/2026-03-outage.md; keep the rule "Never run migrations from a laptop against production" with a pointer.
58
+
59
+ ## Could be enforced by tooling
60
+ 1. "No `console.log` in src/" (AGENTS.md:80) -> ESLint `no-console`.
61
+ 2. "Page slugs are unique per space" (AGENTS.md:236) -> unique index on pages(space_id, slug); today it is checked only in code.
62
+
63
+ ## Proposed edits
64
+ <one unified diff per file>
65
+
66
+ ## Reminder
67
+ Apply one structural edit at a time (reorder first), run one real task with an agent, then the next.
68
+ ```
69
+
70
+ Why it is good: each file has its own scorecard row; every finding has `path:line` and an
71
+ edit; every vague phrase is rewritten from something in the repo, with assumed numbers marked;
72
+ the Top 3 are picked by leverage (the ordering fix first, although it is check 5); nothing new is
73
+ invented, only subtracted or sharpened.
@@ -0,0 +1,129 @@
1
+ # The five-point scorecard
2
+
3
+ Read before step 5 of softure-rule-review. Score each rule file separately. Score the file as it
4
+ is before any edit; a reorder or trim done later does not change the recorded verdict.
5
+
6
+ ## 1. Length
7
+
8
+ Count non-blank lines, excluding separator lines (`---`), frontmatter of `.mdc` files and the
9
+ SOFTURE managed block.
10
+
11
+ | Non-blank lines | Verdict |
12
+ |---|---|
13
+ | up to 200 | OK |
14
+ | 201 to 500 | WARN |
15
+ | over 500 | FAIL |
16
+
17
+ Why: every line is paid for in every session, and rules in the middle of a long context get the
18
+ least attention. For WARN or FAIL, propose one or more of: move area rules into nested files next
19
+ to their code (`src/billing/AGENTS.md`); replace copied documentation with a pointer to the
20
+ canonical file; drop rules not tied to a recurring agent mistake.
21
+
22
+ ## 2. Inline snippets
23
+
24
+ Flag fenced blocks and long inline code (more than about 3 lines) that copy something living
25
+ elsewhere: example components, endpoints, migrations, schemas, queries, tests, scripts, config
26
+ files (`tsconfig.json`, lint config, `package.json`), boilerplate templates.
27
+
28
+ Do not flag: short blocks that define an output *format* the agent must produce (a 2 to 4 line
29
+ error shape, a commit message pattern), command examples, diagrams.
30
+
31
+ | Flagged blocks | Verdict |
32
+ |---|---|
33
+ | 0 | OK |
34
+ | 1 to 2 | WARN |
35
+ | 3 or more | FAIL |
36
+
37
+ Fix: point at the real file (`see src/invoices/actions.ts for the action shape`). A copy is
38
+ wrong in two places after the next refactor; a pointer cannot drift.
39
+
40
+ ## 3. Precise language
41
+
42
+ Flag rules that no diff can be checked against: "write clean code", "follow best practices",
43
+ "keep it simple", "be consistent", "handle errors properly", "make it maintainable", "use modern
44
+ patterns", "care about performance".
45
+
46
+ Every flagged phrase gets a **grounded rewrite**: a rule a reviewer could check against a diff,
47
+ built from signals in this repo. Look for the signal in the same file (stack, stated naming,
48
+ hard rules elsewhere), around the phrase (what was the author about to say?), and in the repo
49
+ (`package.json`, lint and type config, sibling rule files, existing code). When the repo gives
50
+ no signal, propose a sensible default for the stack and mark it **(assumed)** so the owner
51
+ confirms it.
52
+
53
+ | Vague phrase | Signal found in the repo | Grounded rewrite |
54
+ |---|---|---|
55
+ | "Handle errors properly" | server actions return `{ ok: false, error }` in `src/bookings/actions.ts` | "Server actions return `{ ok: false, error: { code, message } }` on expected failures and never throw for them." |
56
+ | "Be consistent with naming" | existing files are `<entity>.queries.ts` | "Database reads live in `<entity>.queries.ts` next to the entity, not in components." |
57
+ | "Keep components small" | React + Tailwind, `cn()` helper in `src/ui/cn.ts` | "Split components over 150 lines; conditional classes go through `cn()`." (150 is **assumed**) |
58
+ | "Use modern patterns" | no date library in `package.json`, `Intl` used in `src/format/` | "Format dates with `Intl.DateTimeFormat` via `src/format/date.ts`; do not add a date library." |
59
+ | "Care about performance" | slow page logged in a lesson (L-008) | "List pages paginate at 50 rows; no unbounded `findMany`." |
60
+
61
+ | Vague phrases | Verdict |
62
+ |---|---|
63
+ | 0 | OK |
64
+ | 1 to 3 | WARN |
65
+ | 4 or more | FAIL |
66
+
67
+ ## 4. Redundant knowledge
68
+
69
+ Read the file as the agent that will receive it, and after each paragraph ask: *did I know this
70
+ already?* Tests:
71
+
72
+ - **No surprise:** could you have written this paragraph without seeing the project? Redundant.
73
+ - **Tool default:** does it restate what the framework, type checker, linter or test runner
74
+ already enforces ("use strict mode", "React keys must be unique")? Redundant: the tool catches it.
75
+ - **Definition:** does it explain a general term (what a migration is, what REST means)? Redundant.
76
+ - **Could be a pointer:** does it copy the README, the scripts list, the folder layout or lint
77
+ settings? Replace with a pointer.
78
+ - **Tutorial smell:** does it read like a framework's getting-started page? Redundant.
79
+
80
+ Not redundant, never flag:
81
+ - conventions that deliberately differ from the framework default;
82
+ - local traps you could not infer from the code ("the reports DB is a read replica; writes fail silently");
83
+ - internal naming, layout and workflow rules;
84
+ - rules that look generic but trace back to a real incident (ask for the lesson number inline).
85
+
86
+ For each flagged paragraph: **delete**, **replace with a pointer**, or **keep only with its
87
+ incident**.
88
+
89
+ | Redundant paragraphs | Verdict |
90
+ |---|---|
91
+ | 0 | OK |
92
+ | 1 to 3 | WARN |
93
+ | 4 or more | FAIL |
94
+
95
+ ## 5. Rule ordering
96
+
97
+ Models attend most to the beginning and the end of a long context. Critical rules in the
98
+ middle are followed less reliably.
99
+
100
+ 1. **List** the current headings (H1/H2, or H3 when there are no H2) with line numbers. A file
101
+ with no headings is noted as one undifferentiated block.
102
+ 2. **Tag** each section:
103
+ - CRITICAL: load-bearing (security, money, data loss, irreversible actions, project "never" rules);
104
+ - USEFUL: real project knowledge that is not a tripwire;
105
+ - INTRO: welcome, mission, team, history;
106
+ - REDUNDANT: flagged in check 4;
107
+ - VAGUE: flagged in check 3;
108
+ - REFERENCE: pointers to other files (cheap anywhere).
109
+ 3. **Diagnose** in one paragraph: where the CRITICAL sections sit, what fills the top.
110
+ 4. **Propose moves** only if there is a problem: to top / kept / to bottom / removed. No rule
111
+ text is rewritten by a reorder.
112
+
113
+ | Situation | Verdict |
114
+ |---|---|
115
+ | top is dense with CRITICAL and USEFUL, clear headings, no INTRO at the start | OK |
116
+ | mixed: some critical rules on top, others buried, or a noticeable INTRO at the start | WARN |
117
+ | a CRITICAL rule after line 200, no headings at all, or the first 30+ lines are INTRO | FAIL |
118
+
119
+ ## Edge cases
120
+
121
+ - **Short file (under 50 lines):** run all five checks anyway; short files fail checks 3 and 4 most.
122
+ - **Mostly pointers:** a good sign for checks 2 and 4; do not penalise.
123
+ - **`.mdc` with frontmatter (`globs`, `alwaysApply`):** count from after the frontmatter; check
124
+ that the globs match existing paths (a stale glob is a Stale finding).
125
+ - **Generated stub, never edited:** still review it; check 4 usually dominates, which is the
126
+ signal to trim it.
127
+ - **Root and nested files overlap:** score each separately, and report the duplication between
128
+ them under Duplicates, keeping the rule in the file closest to its code.
129
+ - **Installed skills and the managed block:** never scored or edited; issues go upstream.