@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.
- package/README.md +4 -0
- package/WORKFLOW.md +6 -2
- package/package.json +1 -1
- 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
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
name: softure-frame
|
|
3
3
|
description: >
|
|
4
4
|
Challenge WHAT is being built before anyone plans HOW. Works on an idea (before the PRD)
|
|
5
|
-
or on a change after research
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
or on a change after research. Separates the observation from the stated cause and the
|
|
6
|
+
problem from the proposed solution, tests the competing explanations against evidence,
|
|
7
|
+
generates alternative framings, offers kill / shrink / reframe / reuse / proceed options,
|
|
8
|
+
and records one decision in `frame.md` of the change, or in a section of shape-notes.
|
|
9
|
+
"The framing was right" is a valid outcome. Use when the request smells like a solution in
|
|
10
|
+
search of a problem, when a bug report arrives with its fix attached, when research found a
|
|
11
|
+
cheaper path, or when scope keeps growing. Triggers: "is this the right thing to build",
|
|
12
|
+
"challenge this", "frame it", "does this even make sense", "can we do this cheaper",
|
|
13
|
+
"what is the root cause", "should we even".
|
|
11
14
|
argument-hint: "[change-id | idea] [--auto]"
|
|
12
15
|
allowed-tools:
|
|
13
16
|
- Read
|
|
14
17
|
- Glob
|
|
15
18
|
- Grep
|
|
19
|
+
- Bash
|
|
16
20
|
- Write
|
|
17
21
|
- Edit
|
|
22
|
+
- Agent
|
|
18
23
|
- AskUserQuestion
|
|
19
24
|
---
|
|
20
25
|
|
|
@@ -22,48 +27,108 @@ allowed-tools:
|
|
|
22
27
|
|
|
23
28
|
## Purpose
|
|
24
29
|
|
|
25
|
-
A good plan for the wrong thing is still waste. This skill spends a
|
|
26
|
-
make the work **smaller, different or unnecessary
|
|
27
|
-
with an explicit decision,
|
|
30
|
+
A good plan for the wrong thing is still waste. This skill spends a short, bounded effort
|
|
31
|
+
trying to make the work **smaller, different or unnecessary**, or to show that the stated
|
|
32
|
+
cause is not the real one, before planning locks it in. It ends with an explicit decision,
|
|
33
|
+
not a discussion. It never designs the implementation: that is `softure-plan`'s job.
|
|
34
|
+
|
|
35
|
+
## When to use, when to skip
|
|
36
|
+
|
|
37
|
+
Use it when the input has one of these shapes:
|
|
38
|
+
- **Bug shape:** "X is broken, let's do Y". An observation arrives welded to a cause and a fix.
|
|
39
|
+
- **Value shape:** "we need feature F". A solution arrives without the problem it solves.
|
|
40
|
+
- **Scope shape:** "split this in two", "is this even the right scope", or scope that keeps growing.
|
|
41
|
+
- **Assumption shape:** the plan rests on "users want…", "the slow part is…", unverified.
|
|
42
|
+
|
|
43
|
+
Skip it for mechanical work (rename, dependency bump), for a cause the user has already
|
|
44
|
+
verified ("I reproduced it, plan the fix"), or for a tightly scoped item with no premise to
|
|
45
|
+
test. When unsure, run it: on a solid request it costs two or three minutes and ends with
|
|
46
|
+
"framing confirmed".
|
|
28
47
|
|
|
29
48
|
## Inputs
|
|
30
49
|
|
|
31
50
|
One of two modes:
|
|
32
51
|
- **Change mode:** `context/changes/<change-id>/change.md` must exist, and should have
|
|
33
52
|
`research.md`. Without research, say that framing is weaker without it and offer to run
|
|
34
|
-
`softure-research` first (recommended), unless the user wants to frame now.
|
|
53
|
+
`softure-research` first (recommended), unless the user wants to frame now. An archived
|
|
54
|
+
change is never framed; open a new one.
|
|
35
55
|
- **Idea mode:** an idea or `context/foundation/shape-notes.md`.
|
|
36
56
|
|
|
37
|
-
Also read `context/foundation/prd.md` and `
|
|
38
|
-
respect
|
|
57
|
+
Also read `context/foundation/prd.md`, `roadmap.md` and `lessons.md` when present: the frame
|
|
58
|
+
must respect the PRD's goals, and lessons about earlier misframings are priors. Read every file
|
|
59
|
+
the user names, fully.
|
|
39
60
|
|
|
40
61
|
## Procedure
|
|
41
62
|
|
|
42
|
-
1. **
|
|
43
|
-
|
|
63
|
+
1. **Capture, separately.** Write three lines and keep them apart for the rest of the run:
|
|
64
|
+
- **Observation:** what is literally seen or asked (a symptom, a metric, a request as quoted).
|
|
65
|
+
- **Stated cause or premise:** what the requester believes explains it, or why they want it.
|
|
66
|
+
- **Proposed direction:** what they want to build or change.
|
|
67
|
+
|
|
68
|
+
Echo them back. The observation is fixed ground; the other two are hypotheses until
|
|
69
|
+
evidence supports them. If the user pushes ("just plan the fix"), keep the separation: it
|
|
70
|
+
is the whole point. If there is no stated cause ("something feels off"), say the frame is
|
|
71
|
+
observation-driven. If you cannot separate problem from solution at all, that is the first
|
|
72
|
+
finding.
|
|
73
|
+
|
|
44
74
|
2. **Test the premise.** Answer briefly, using evidence from research and the code:
|
|
45
75
|
- What happens if we do nothing for three months?
|
|
46
|
-
- Is the problem real and frequent, or a single anecdote?
|
|
76
|
+
- Is the problem real and frequent, or a single anecdote? (count it: logs, data, tickets)
|
|
47
77
|
- Does something in the codebase, a SOFTURE module (`@softure-ai/*`, WORKFLOW §10) or a
|
|
48
78
|
configuration change already solve most of it?
|
|
49
79
|
- What is the smallest change that would prove or disprove the value?
|
|
50
|
-
|
|
51
|
-
|
|
80
|
+
|
|
81
|
+
3. **Map where it could come from** (bug, scope and assumption shapes; skip for a clean value
|
|
82
|
+
shape). Build a short map of the places the observation could originate, from what you
|
|
83
|
+
read in *this* system: stages of a data flow, layers of a design, links in a chain of
|
|
84
|
+
assumptions. Mark the node where the stated cause sits. Only list nodes that could
|
|
85
|
+
plausibly produce this observation; two real candidates beat five padded ones.
|
|
86
|
+
|
|
87
|
+
4. **Test each hypothesis against expected evidence.** For each node ask: *if the problem
|
|
88
|
+
were here, what would we see, and do we see it?* Grade STRONG / WEAK / NONE with `path:line`
|
|
89
|
+
or data. When the surface is large, launch read-only subagents in parallel, one per
|
|
90
|
+
hypothesis, at most five; brief template in `references/diagnostic-lens.md`. Then
|
|
91
|
+
**pressure-test the leader**: a blind search that does not name it, prior occurrences in
|
|
92
|
+
`context/archive/` and git history, and the inverse check (what should be absent if it is
|
|
93
|
+
true). If the original framing still fits the evidence equally well, keep it.
|
|
94
|
+
|
|
95
|
+
5. **Narrow with questions** (interactive), only when evidence leaves two or more hypotheses
|
|
96
|
+
standing. Ask **one question at a time**. Each one must be able to rule a hypothesis in or
|
|
97
|
+
out; options describe what the user *sees or knows* (when it happens, for whom, since
|
|
98
|
+
when), never fixes. Diagnostic questions always include "I have not checked": false
|
|
99
|
+
certainty is the enemy here, and "not checked" tells you to verify instead of trusting.
|
|
100
|
+
Stop as soon as the ranking stops moving; five questions is the ceiling. If evidence is
|
|
101
|
+
already conclusive, say so and skip. `--auto`: no questions; answer them from data, logs
|
|
102
|
+
and code, and grade what stays unknown as WEAK.
|
|
103
|
+
|
|
104
|
+
6. **Generate 3 to 5 framings**, each as one line plus the cost difference:
|
|
105
|
+
- *Proceed* as asked (or *Confirmed*, when the stated cause held up).
|
|
52
106
|
- *Shrink*: the 20% that delivers 80%.
|
|
53
|
-
- *Reframe*: solve the underlying problem differently (
|
|
54
|
-
existing feature).
|
|
107
|
+
- *Reframe*: solve the underlying problem differently (the real cause from step 4, process,
|
|
108
|
+
copy, default value, existing feature).
|
|
55
109
|
- *Reuse*: adopt an existing module or library instead of building.
|
|
56
110
|
- *Kill or defer*, with the reason.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
111
|
+
|
|
112
|
+
7. **Recommend one, then push back where it is due.** Give the deciding argument and a
|
|
113
|
+
confidence (HIGH: strong evidence and a decisive signal; MEDIUM: evidence one way, signal
|
|
114
|
+
weaker; LOW: inconclusive, name the verification step needed before planning). Ask a single
|
|
115
|
+
decision question with the options, recommendation first. The decision question has no
|
|
116
|
+
"I'm not sure" option: if the user is unsure, the recommendation stands. Pushback patterns
|
|
117
|
+
and how to phrase them: `references/pushback.md`, read it **when the user's preferred option
|
|
118
|
+
differs from yours or the request is solution-first**. If the user objects with a fact you
|
|
119
|
+
did not have, re-test the affected hypothesis instead of defending the frame.
|
|
120
|
+
|
|
121
|
+
8. **Record** the decision (template below).
|
|
122
|
+
- Change mode: write `frame.md` in the change folder and update `change.md` -> `## Intent`
|
|
123
|
+
if the outcome changed. The status stays `preparing` (WORKFLOW §4); only `updated` changes.
|
|
124
|
+
- Idea mode: add or replace a `## Frame` section in shape-notes.md with the same headings
|
|
125
|
+
one level down.
|
|
126
|
+
|
|
127
|
+
9. **Route** (interactive: ask, recommendation first; `--auto`: take the route below):
|
|
128
|
+
- Proceed / confirmed / shrink / reuse / reframe -> `softure-plan` (change mode) or
|
|
129
|
+
`softure-prd` (idea mode).
|
|
130
|
+
- LOW confidence -> verify first (reproduce, measure, read the missing data), then plan.
|
|
131
|
+
- Kill / defer -> leave the change in `changes/` with a `## Notes` line "deferred by frame:
|
|
67
132
|
<reason>", and ask whether to archive it.
|
|
68
133
|
|
|
69
134
|
## Output: `frame.md`
|
|
@@ -72,41 +137,65 @@ respect their goals.
|
|
|
72
137
|
# Frame: <change-id>
|
|
73
138
|
|
|
74
139
|
## Request as stated
|
|
75
|
-
##
|
|
140
|
+
## Observation, premise, direction
|
|
141
|
+
- Observation: …
|
|
142
|
+
- Stated cause or premise: …
|
|
143
|
+
- Proposed direction: …
|
|
76
144
|
## Premise check
|
|
77
145
|
- Do nothing for 3 months: …
|
|
78
|
-
- Evidence: …
|
|
146
|
+
- Evidence (frequency, data): …
|
|
79
147
|
- Already solved elsewhere: …
|
|
80
148
|
- Smallest proof: …
|
|
149
|
+
## Hypotheses (bug / scope / assumption shapes; omit for a clean value shape)
|
|
150
|
+
| Where it could come from | Expected evidence | Found | Verdict |
|
|
151
|
+
|---|---|---|---|
|
|
152
|
+
Pressure test: blind search -> …; prior occurrences -> …; inverse check -> …
|
|
81
153
|
## Framings
|
|
82
154
|
| Option | What we build | Cost vs as-asked | Risk |
|
|
83
155
|
|---|---|---|---|
|
|
84
156
|
## Decision
|
|
85
|
-
<option>
|
|
157
|
+
<option> -- because <deciding argument>. Confidence: HIGH | MEDIUM | LOW.
|
|
158
|
+
Problem to plan around: <one sentence>. Scope now: … Out of scope now: …
|
|
159
|
+
What changes for the plan: <one or two sentences; for LOW, the verification step that comes first>
|
|
86
160
|
## Decisions (auto) (only in --auto)
|
|
87
161
|
```
|
|
88
162
|
|
|
89
|
-
Write in `workflow.json`
|
|
163
|
+
Keep it to one screen or two. Write in `workflow.json` -> `language`; headings stay English.
|
|
164
|
+
Two complete examples (a value-shape frame and a bug-shape frame) and a bad one with why:
|
|
165
|
+
read `references/examples.md` **before writing your first frame.md in a repo**.
|
|
90
166
|
|
|
91
167
|
## `--auto`
|
|
92
168
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
169
|
+
- No questions at any step. Narrowing questions are answered from evidence; the decision
|
|
170
|
+
question takes the recommendation. Record each under `## Decisions (auto)`.
|
|
171
|
+
- Choose the smallest option that still meets change.md's `## Intent`.
|
|
172
|
+
- Never choose *kill* in `--auto`: if killing is the best option, record it as the
|
|
173
|
+
recommendation, choose *shrink*, and add a `## Notes` line in change.md for the owner.
|
|
174
|
+
- LOW confidence: do not stop. Put the verification step into "What changes for the plan" as
|
|
175
|
+
the plan's first phase, and record the choice.
|
|
96
176
|
|
|
97
177
|
## Quality bar
|
|
98
178
|
|
|
179
|
+
- [ ] Observation, premise and direction are written separately and never merged.
|
|
180
|
+
- [ ] Every hypothesis verdict cites evidence from this repo or its data, not a hunch.
|
|
99
181
|
- [ ] At least one option is materially cheaper than the request.
|
|
100
182
|
- [ ] Each option names its cost difference, not just its features.
|
|
101
|
-
- [ ] The decision is a single option with one deciding argument.
|
|
183
|
+
- [ ] The decision is a single option with one deciding argument and a confidence.
|
|
102
184
|
- [ ] The scope after framing is explicit (in / out).
|
|
103
185
|
|
|
104
|
-
##
|
|
186
|
+
## Guardrails
|
|
105
187
|
|
|
106
|
-
-
|
|
188
|
+
- **"The framing was right" is a success.** Never manufacture a reframe the evidence does
|
|
189
|
+
not carry; a clever wrong reframe costs more than none.
|
|
190
|
+
- **Evidence before pattern-matching.** Recognising a familiar shape from other systems is a
|
|
191
|
+
source of hypotheses, never of verdicts.
|
|
192
|
+
- **No solution design.** Options are about *what* and *how much*, never phases, files or
|
|
193
|
+
technical approaches.
|
|
194
|
+
- **No hypothesis padding**, and a time box: two rounds of investigation and at most five
|
|
195
|
+
questions. Past that, the case needs reproduction or measurement, so recommend it and stop.
|
|
107
196
|
- Do not reopen decisions the PRD or roadmap made explicitly, unless research contradicts them.
|
|
108
197
|
In that case, say exactly which line is contradicted and why.
|
|
109
|
-
- Do not
|
|
198
|
+
- Do not touch code or data.
|
|
110
199
|
|
|
111
200
|
## Handoff
|
|
112
201
|
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Diagnostic lens: from observation to the real problem
|
|
2
|
+
|
|
3
|
+
Read this when steps 3 to 5 of softure-frame run on a bug, scope or assumption shape and the
|
|
4
|
+
surface is large enough to need subagents or careful narrowing.
|
|
5
|
+
|
|
6
|
+
## Building the map
|
|
7
|
+
|
|
8
|
+
The map is the set of places where the observation could originate. It comes from reading
|
|
9
|
+
this system, not from a generic checklist.
|
|
10
|
+
|
|
11
|
+
- **Trace the chain** from the stated cause to the observed effect. For runtime problems the
|
|
12
|
+
chain is the data flow: input, validation, transformation, storage, read, render, side
|
|
13
|
+
effects. For scope problems it is the layers of the decision: user need, product rule,
|
|
14
|
+
data model, UI. For assumption problems it is the chain of "because": we want X because
|
|
15
|
+
users do Y because Z.
|
|
16
|
+
- **Keep only plausible nodes.** A node belongs on the map if a fault there would produce
|
|
17
|
+
roughly this observation. A node you have no reason to suspect stays off.
|
|
18
|
+
- **Mark the stated cause** with `<- stated`. The rest of the map is the hypothesis space.
|
|
19
|
+
|
|
20
|
+
Present it as a short list before investigating:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
The observation could originate at:
|
|
24
|
+
1. Client form submits twice on slow networks <- stated
|
|
25
|
+
2. Server write has no uniqueness check
|
|
26
|
+
3. Calendar sync job re-imports bookings
|
|
27
|
+
Investigating each before deciding.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Expected-evidence brief (one subagent per hypothesis)
|
|
31
|
+
|
|
32
|
+
Launch all of them in one message so they run in parallel. Read-only.
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Observation (verbatim): "<observation>".
|
|
36
|
+
Hypothesis to test: the problem originates at <node>: <one line>.
|
|
37
|
+
Question: if this hypothesis were true, what would we expect to see in the code, data, logs or
|
|
38
|
+
history? Look for exactly that. Also look for what should be ABSENT if it were true.
|
|
39
|
+
Report: present / partial / absent, each with path:line, query result or log line.
|
|
40
|
+
Rules: read-only; no fixes or proposals; at most <N> words; say what you searched and did not find.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Use a fast search agent for "find where X is handled", a general-purpose read-only agent for
|
|
44
|
+
"trace this chain and tell me whether assumption Y holds".
|
|
45
|
+
|
|
46
|
+
## Grading
|
|
47
|
+
|
|
48
|
+
| Verdict | Meaning |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| STRONG | Expected evidence present, the inverse check holds, and it explains the observation's timing and frequency |
|
|
51
|
+
| WEAK | Some expected evidence, or it explains the observation only partly |
|
|
52
|
+
| NONE | Expected evidence absent, or the inverse check fails |
|
|
53
|
+
|
|
54
|
+
The candidate reframe is a STRONG hypothesis that is not the stated cause. Two STRONG
|
|
55
|
+
hypotheses usually mean two problems: say so instead of picking one.
|
|
56
|
+
|
|
57
|
+
## Pressure test
|
|
58
|
+
|
|
59
|
+
Before trusting the leader, try to break it from a different angle:
|
|
60
|
+
|
|
61
|
+
- **Blind search.** A fresh subagent gets only the observation, not your hypothesis: "What in
|
|
62
|
+
this system most likely produces this? Look without preconception." Agreement raises
|
|
63
|
+
confidence; a different answer is a signal to read carefully.
|
|
64
|
+
- **Prior occurrences.** Search `context/archive/*/`, `context/foundation/lessons.md`, commit
|
|
65
|
+
messages and issue history for the same symptom or the same scope argument.
|
|
66
|
+
- **Inverse check.** What else must be true if the leader is right? Verify one such
|
|
67
|
+
consequence. What must not be visible? Confirm it is absent.
|
|
68
|
+
- **Original framing once more.** If the stated cause fits the evidence just as well, keep it.
|
|
69
|
+
|
|
70
|
+
If the pressure test produces a credible alternative, put it on the map and run step 4 again
|
|
71
|
+
once. If the case is still open after that second round, the honest output is LOW confidence
|
|
72
|
+
and a verification step.
|
|
73
|
+
|
|
74
|
+
## Narrowing questions
|
|
75
|
+
|
|
76
|
+
Good narrowing questions are decisive: whatever the answer, at least one hypothesis moves.
|
|
77
|
+
|
|
78
|
+
| Weak question | Why weak | Decisive version |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| "Is it a frontend or backend issue?" | asks the user to diagnose | "Do the duplicates have the same creation second, or seconds apart?" (same second: double submit; apart: re-import) |
|
|
81
|
+
| "Should we add a lock?" | a solution, not an observation | "Have you seen duplicates on bookings made by staff in the admin panel, which has no double-click?" |
|
|
82
|
+
| "How important is this?" | does not split hypotheses | "Since when have you seen it: always, or since the calendar sync launched?" |
|
|
83
|
+
|
|
84
|
+
Every narrowing question offers "I have not checked". A "not checked" answer becomes a
|
|
85
|
+
verification task, not a guess.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Example frames
|
|
2
|
+
|
|
3
|
+
Two complete frames in fictional projects, then a bad one. Use them for depth and tone, not
|
|
4
|
+
content.
|
|
5
|
+
|
|
6
|
+
## 1. Value shape: team wiki search
|
|
7
|
+
|
|
8
|
+
Change `wiki-full-text-search`. change.md Intent: "Find any page by its content." The
|
|
9
|
+
request in the roadmap: "Add Elasticsearch-backed full-text search."
|
|
10
|
+
|
|
11
|
+
```markdown
|
|
12
|
+
# Frame: wiki-full-text-search
|
|
13
|
+
|
|
14
|
+
## Request as stated
|
|
15
|
+
"Add Elasticsearch-backed full-text search" (roadmap WK-7, quoting a team lead in the feedback thread).
|
|
16
|
+
|
|
17
|
+
## Observation, premise, direction
|
|
18
|
+
- Observation: people say they "cannot find pages"; 14 messages in the feedback thread since July.
|
|
19
|
+
- Stated cause or premise: search only matches titles, so content is invisible.
|
|
20
|
+
- Proposed direction: run an Elasticsearch cluster and index every page.
|
|
21
|
+
|
|
22
|
+
## Premise check
|
|
23
|
+
- Do nothing for 3 months: people keep asking in chat; no data loss, no revenue impact.
|
|
24
|
+
- Evidence: search log (research.md, Data) shows 2,310 searches in 30 days, 41% with zero results; sampling 50 zero-result queries, 34 are words that appear in page bodies. The premise holds.
|
|
25
|
+
- Already solved elsewhere: Postgres is already the store; `tsvector` full-text search is available with no new service. No SOFTURE module covers search.
|
|
26
|
+
- Smallest proof: a body-text index on the existing `pages` table and the zero-result rate measured a week later.
|
|
27
|
+
|
|
28
|
+
## Framings
|
|
29
|
+
| Option | What we build | Cost vs as-asked | Risk |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| Proceed | Elasticsearch cluster, indexer, sync on edit | baseline (about 2 weeks + a service to run) | sync drift, new infrastructure |
|
|
32
|
+
| Shrink | Postgres full-text index on title + body, same search box | about 2 days, no new service | ranking less tunable |
|
|
33
|
+
| Reframe | Better titles via a required summary field | about 1 day | does not fix old pages |
|
|
34
|
+
| Kill | nothing | 0 | the 41% stays |
|
|
35
|
+
|
|
36
|
+
## Decision
|
|
37
|
+
Shrink -- because 34 of 50 failing queries are plain words in page bodies, which Postgres full-text search finds; nothing in the evidence needs fuzzy matching or facets. Confidence: HIGH.
|
|
38
|
+
Problem to plan around: search ignores page bodies.
|
|
39
|
+
Scope now: body text in the existing search, ranking by title match first. Out of scope now: typo tolerance, attachments, a separate search service.
|
|
40
|
+
What changes for the plan: no new infrastructure; success measure is the zero-result rate falling below 15%.
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Why it is good: the premise is checked with numbers before options are drawn; the cheaper
|
|
44
|
+
option is not a hunch but follows from a sample; the out-of-scope list keeps the bigger ask
|
|
45
|
+
visible instead of silently dropping it.
|
|
46
|
+
|
|
47
|
+
## 2. Bug shape: double bookings
|
|
48
|
+
|
|
49
|
+
Change `prevent-double-bookings`, booking app for a physiotherapy clinic. Request: "Customers
|
|
50
|
+
double-click Book and we get two bookings. Disable the button after the first click."
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
# Frame: prevent-double-bookings
|
|
54
|
+
|
|
55
|
+
## Request as stated
|
|
56
|
+
"Customers double-click Book and we get two bookings. Disable the button after the first click."
|
|
57
|
+
|
|
58
|
+
## Observation, premise, direction
|
|
59
|
+
- Observation: the same slot sometimes holds two bookings (11 cases in September, research.md Data).
|
|
60
|
+
- Stated cause or premise: customers double-click the Book button.
|
|
61
|
+
- Proposed direction: disable the button after the first click.
|
|
62
|
+
|
|
63
|
+
## Premise check
|
|
64
|
+
- Do nothing for 3 months: about 30 more conflicts; each costs a phone call and one upset customer.
|
|
65
|
+
- Evidence: 11 conflicts in 30 days out of 2,900 bookings.
|
|
66
|
+
- Already solved elsewhere: nothing; no SOFTURE module applies.
|
|
67
|
+
- Smallest proof: a query showing whether conflicting pairs share a customer.
|
|
68
|
+
|
|
69
|
+
## Hypotheses
|
|
70
|
+
| Where it could come from | Expected evidence | Found | Verdict |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| Double submit from the client <- stated | pairs share customer and are created within 1 s | 2 of 11 pairs share a customer, 0.3 s apart | WEAK |
|
|
73
|
+
| Server accepts two writes for one slot | no unique constraint on (therapist_id, starts_at); check-then-insert outside a transaction | `bookings` has no such constraint (src/db/schema.ts:40-58); `createBooking` reads availability then inserts in two statements (src/bookings/actions.ts:31-47) | STRONG |
|
|
74
|
+
| Calendar sync re-imports bookings | duplicates carry `source = 'sync'` | 0 of 22 rows have `source = 'sync'` | NONE |
|
|
75
|
+
Pressure test: blind search (observation only) also landed on actions.ts:31-47; prior occurrences: none in archive; inverse check: 9 of 11 pairs are different customers booking the same slot within 2 s, which a disabled button cannot prevent.
|
|
76
|
+
|
|
77
|
+
## Framings
|
|
78
|
+
| Option | What we build | Cost vs as-asked | Risk |
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
| Proceed | disable the button | same (hours) | fixes 2 of 11 |
|
|
81
|
+
| Reframe | the server refuses a second booking for a taken slot, the customer sees "slot just taken" | about 1 day | existing duplicates must be resolved first |
|
|
82
|
+
| Reframe + proceed | both | about 1 day | none beyond the above |
|
|
83
|
+
| Kill | nothing | 0 | conflicts continue |
|
|
84
|
+
|
|
85
|
+
## Decision
|
|
86
|
+
Reframe + proceed -- because 9 of 11 conflicts are two customers racing for one slot, which only the database can stop; the button change is cheap and removes the other 2. Confidence: HIGH.
|
|
87
|
+
Problem to plan around: the server lets two bookings take one slot.
|
|
88
|
+
Scope now: server-side refusal of a taken slot, conflict message, button disable. Out of scope now: waitlist for taken slots.
|
|
89
|
+
What changes for the plan: the plan starts with resolving the 11 existing conflicts, because any database-level guarantee fails while they exist; how to enforce it is the plan's choice.
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Why it is good: the stated cause is kept and tested, not dismissed; it turns out partly right
|
|
93
|
+
(2 of 11), and the decision keeps it; the reframe rests on a query and two code locations; the
|
|
94
|
+
inverse check is what makes the confidence HIGH.
|
|
95
|
+
|
|
96
|
+
## Bad
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
# Frame: prevent-double-bookings
|
|
100
|
+
|
|
101
|
+
## Decision
|
|
102
|
+
The real problem is probably a race condition, as is common in booking systems. We should
|
|
103
|
+
use optimistic locking with a version column and retry logic in the API. Confidence: HIGH.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
What is wrong:
|
|
107
|
+
- Observation, premise and direction are not separated; the user's theory is discarded unread.
|
|
108
|
+
- "As is common in booking systems" is a prior, not evidence. No query, no `path:line`.
|
|
109
|
+
- It designs the solution (version column, retries); that is the plan's job.
|
|
110
|
+
- HIGH confidence without a single hypothesis tested or a pressure test.
|
|
111
|
+
- No options, no costs, no scope in / out.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Pushback patterns
|
|
2
|
+
|
|
3
|
+
Read this when the request is solution-first, or when the user's preferred option differs
|
|
4
|
+
from your recommendation. Pushback is a service, not a contest: say it once, clearly, with the
|
|
5
|
+
evidence and the cost, then respect the decision and record it.
|
|
6
|
+
|
|
7
|
+
## Shape of a good pushback
|
|
8
|
+
|
|
9
|
+
1. Name what you heard: "You want F."
|
|
10
|
+
2. Name the gap: "The evidence shows G" or "Nothing shows the problem F solves yet."
|
|
11
|
+
3. Offer the cheaper move with its cost: "H would take a day instead of two weeks and tells us
|
|
12
|
+
whether F is needed."
|
|
13
|
+
4. Recommend and ask once: "I recommend H. Go with H, or proceed with F?"
|
|
14
|
+
|
|
15
|
+
In `--auto` the same reasoning goes into the Decision paragraph and `## Decisions (auto)`;
|
|
16
|
+
nobody is asked.
|
|
17
|
+
|
|
18
|
+
## Patterns
|
|
19
|
+
|
|
20
|
+
| Signal in the request | Pushback | Usual cheaper framing |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| A fix arrives with the bug report ("users get logged out, extend the session to 30 days") | Separate the observation (logouts) from the fix (longer session). Ask what evidence ties them. | Find why sessions end early; the expiry may be fine |
|
|
23
|
+
| One anecdote ("a customer asked for CSV export") | How many asked? What did they do with the data? | Shrink: one fixed report, or reuse an existing export |
|
|
24
|
+
| "Everyone needs X" | Who exactly, how often, and what do they do today instead? | Shrink to the one segment with evidence |
|
|
25
|
+
| Building generic infrastructure for one case ("a rules engine for discounts") | One rule exists today. What is the second, and when? | Hard-code the one rule behind a function; revisit at the second |
|
|
26
|
+
| A capability a SOFTURE module covers (roles, mail, feature switches) | WORKFLOW §10: module first | Reuse, and file the gap upstream if it almost fits |
|
|
27
|
+
| Scope grew during research ("while we're there…") | Which part delivers the Intent in change.md? | Shrink to that part; the rest goes to the backlog |
|
|
28
|
+
| "Make it faster" with no number | Faster from what to what, measured where? | Measure first; frame again with the number |
|
|
29
|
+
| A deadline drives a big build | What is the minimum that meets the date? | Shrink, with the rest explicitly deferred |
|
|
30
|
+
| The PRD already decided it | Do not reopen it | Only if research contradicts a named PRD line |
|
|
31
|
+
|
|
32
|
+
## When to stop pushing
|
|
33
|
+
|
|
34
|
+
- The user brings a fact you did not have: re-test the hypothesis it touches, then update the
|
|
35
|
+
recommendation honestly, even if it flips.
|
|
36
|
+
- The user decides against your recommendation: record their choice and your recommendation
|
|
37
|
+
side by side in the Decision paragraph, and move on. One round, not a negotiation.
|
|
38
|
+
- The cheaper option fails the Intent in change.md: it is not an option. Drop it from the table.
|