skilldrop-cli 0.16.17 → 0.16.19
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/agents/devils-advocate.md +34 -22
- package/model-routing.json +1 -1
- package/package.json +1 -1
- package/packs/dev-team/skills/devils-advocate/SKILL.md +65 -124
- package/packs/dev-team/skills/devils-advocate/evals/evals.json +27 -0
- package/packs/dev-team/skills/devils-advocate/evals/files/6/PR_DESCRIPTION.md +20 -0
- package/packs/dev-team/skills/devils-advocate/evals/files/6/redeem.py +102 -0
- package/packs/dev-team/skills/devils-advocate/evals/files/6/test_redeem.py +54 -0
- package/packs/dev-team/skills/devils-advocate/examples/rate-limiter-review.md +36 -16
- package/packs/dev-team/skills/devils-advocate/manifest.json +3 -3
- package/packs/stakeholder-comms/skills/guide-builder/SKILL.md +51 -52
- package/packs/stakeholder-comms/skills/guide-builder/evals/evals.json +27 -0
- package/packs/stakeholder-comms/skills/guide-builder/evals/files/6/setup-notes.md +11 -0
- package/packs/stakeholder-comms/skills/guide-builder/evals/files/6/thread.txt +13 -0
- package/packs/stakeholder-comms/skills/guide-builder/manifest.json +3 -3
- package/packs/dev-team/skills/devils-advocate/templates/challenge.md +0 -118
- package/packs/stakeholder-comms/skills/guide-builder/examples/local-setup-guide.md +0 -127
- package/packs/stakeholder-comms/skills/guide-builder/templates/api-reference.md +0 -120
- package/packs/stakeholder-comms/skills/guide-builder/templates/design-walkthrough.md +0 -72
- package/packs/stakeholder-comms/skills/guide-builder/templates/setup-guide.md +0 -109
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
# Worked example —
|
|
1
|
+
# Worked example — review of a rate limiter that "passes its tests"
|
|
2
2
|
|
|
3
|
-
Input → output oracle for `devils-advocate`. Shows the
|
|
4
|
-
|
|
5
|
-
generic "looks good, consider tests" pass.
|
|
3
|
+
Input → output oracle for `devils-advocate`. Shows the answer first, findings that survive a
|
|
4
|
+
trace through the code, and the cited tests judged for what they could and could not catch.
|
|
6
5
|
|
|
7
|
-
## Input
|
|
6
|
+
## Input
|
|
8
7
|
|
|
9
8
|
> "Implemented the per-user rate limiter, tests pass, ready for review."
|
|
10
9
|
|
|
@@ -23,24 +22,45 @@ def allow(user_id: str, rate: float, burst: float) -> bool:
|
|
|
23
22
|
return False
|
|
24
23
|
```
|
|
25
24
|
|
|
25
|
+
```python
|
|
26
|
+
# test_ratelimit.py
|
|
27
|
+
def test_burst_then_deny():
|
|
28
|
+
for _ in range(3):
|
|
29
|
+
assert allow("u1", rate=1, burst=3)
|
|
30
|
+
assert not allow("u1", rate=1, burst=3)
|
|
31
|
+
```
|
|
32
|
+
|
|
26
33
|
## Output (the review)
|
|
27
34
|
|
|
28
|
-
**
|
|
35
|
+
**Not ready to merge.** Under concurrent requests for one user it admits more than the limit,
|
|
36
|
+
and the test can't see that.
|
|
37
|
+
|
|
38
|
+
1. **Race on the shared dict** — `ratelimit.py:6-10`. Two requests for the same user both read
|
|
39
|
+
`tokens=1.0`, both pass, both write back `0.0`, so parallel bursts get through at up to
|
|
40
|
+
twice the intended rate. Fix: hold a per-user lock around the read-modify-write:
|
|
29
41
|
|
|
30
|
-
|
|
42
|
+
```python
|
|
43
|
+
_locks = collections.defaultdict(threading.Lock)
|
|
31
44
|
|
|
32
|
-
|
|
45
|
+
def allow(user_id, rate, burst):
|
|
46
|
+
with _locks[user_id]:
|
|
47
|
+
... # existing body unchanged
|
|
48
|
+
```
|
|
33
49
|
|
|
34
|
-
|
|
50
|
+
2. **Memory grows without bound** — `ratelimit.py:2`. Nothing ever leaves `_buckets`, so every
|
|
51
|
+
distinct `user_id` stays for the life of the process. Fix: a `cachetools.TTLCache` in place
|
|
52
|
+
of the dict, with a TTL longer than `burst / rate`.
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
**What the test proves.** `test_burst_then_deny` runs on one thread, so it passes with the
|
|
55
|
+
race in place. It also never waits, so refill is untested. Tests that would fail today:
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
- Eviction: memory stays bounded under 10k distinct ids.
|
|
42
|
-
- Boundary: `tokens` sitting at exactly `1.0` admits; at `0.999…` denies.
|
|
57
|
+
- Ten threads calling `allow("u1", rate=1, burst=3)` at once; assert at most three return
|
|
58
|
+
`True`.
|
|
59
|
+
- After draining the bucket, `allow` is false at 0.5 s and true at 1.0 s (with a patched clock).
|
|
43
60
|
|
|
44
61
|
## Why this passes the quality bar
|
|
45
62
|
|
|
46
|
-
|
|
63
|
+
The merge answer comes first. Each finding names the line, a concrete failure and a fix as
|
|
64
|
+
code. The cited test is judged for what it could catch, and the missing tests are scenarios.
|
|
65
|
+
The free first burst for a new user was left out: it is a product choice, not a bug in this
|
|
66
|
+
change.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devils-advocate",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Adversarial review of
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Adversarial review of a code change before it merges — the real bugs, most consequential first, each checked against the code before it is reported, with a fix that works. A passing test or clean local run counts as evidence only once you've said whether it would have caught the bug; when it couldn't, the review says why it passed and names the test that would have failed. Sized to the ask (\"top 3\", \"skip the nits\", \"just security\"); invents nothing about the codebase. Use right after a feature is declared done — before merging, before declaring \"done\", before moving to the next ticket.",
|
|
5
5
|
"entrypoint": "SKILL.md",
|
|
6
6
|
"deps": { "npm": [], "pip": [] },
|
|
7
7
|
"env": { "required": [], "optional": [] },
|
|
@@ -10,5 +10,5 @@
|
|
|
10
10
|
{ "event": "pre-commit-review", "action": "devils-advocate", "description": "adversarially review staged changes before they land" }
|
|
11
11
|
],
|
|
12
12
|
"tags": ["review", "code-review", "adversarial", "edge-cases", "future-proofing", "test-coverage", "dev-workflow"],
|
|
13
|
-
"model": { "tier": "heavy", "rationale": "Adversarial code review
|
|
13
|
+
"model": { "tier": "heavy", "rationale": "Adversarial code review that must trace each finding and judge what the tests prove. Cheaper models miss edge cases and report false positives. Never downgrade." }
|
|
14
14
|
}
|
|
@@ -1,68 +1,65 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: guide-builder
|
|
3
|
-
description: Turn raw notes,
|
|
3
|
+
description: Turn raw notes, a spec, a thread or a messy procedure into a guide someone else can follow — a setup guide, a how-to, an onboarding walkthrough, or a reference for developers — in the length and voice its reader needs. Holds only what the notes say, marks anything inferred where it appears, orders steps so nothing is used before it is set up, and keeps open questions out of the guide so it can be sent as it stands. Use when the user wants setup or getting-started instructions, a walkthrough of how something works, or reference docs for an API or event schema — and it is NOT an SRE operational runbook (use runbook-generator) or a design proposal for review (use design-doc).
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# guide-builder
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
**The rule: the guide holds only what the notes say.** A guide is followed literally. The
|
|
9
|
+
agent's habit is to make it feel complete: a confirmation message nobody mentioned ("you
|
|
10
|
+
should see *Connected*"), a menu path from a different version, "required" on every field, a
|
|
11
|
+
retry policy that sounds standard. Each invented detail is a step the reader will look for
|
|
12
|
+
and not find. So every fact comes from the material. An inference from it (a unit read off a
|
|
13
|
+
sample value, the likely meaning of a field) is marked as an inference where it appears:
|
|
14
|
+
✅ *"`ts` looks like seconds since 1970, judging by the sample; confirm before relying on
|
|
15
|
+
it."*
|
|
16
|
+
|
|
17
|
+
A second rule: **the guide can be sent as it stands.** Questions for the person who asked,
|
|
18
|
+
internal notes, "confirm with engineering" and to-do markers go in your reply, never in the
|
|
19
|
+
guide. Where the reader will need something the notes don't settle, the guide tells the
|
|
20
|
+
*reader* who to ask, if the notes say who: ✅ *"Your login for the booking system comes from
|
|
21
|
+
the office manager."*
|
|
9
22
|
|
|
10
23
|
## How to respond
|
|
11
24
|
|
|
12
|
-
**
|
|
25
|
+
1. **Write for the reader they named, at the size asked for.** A README section, a page for a
|
|
26
|
+
new starter, a sheet for volunteers, a reference for developers: that sets the voice,
|
|
27
|
+
length and shape. Short asks get short guides.
|
|
13
28
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **For this skill:** Turn the notes into the guide and stop. No endpoints, expected outputs, time estimates, troubleshooting rows or teardown steps that are not in the notes, and no warnings or to-do markers inside the guide.
|
|
29
|
+
2. **Order by dependency, not by the notes.** Nothing is used before the step that sets it
|
|
30
|
+
up: an account before signing in with it, a password store before the password goes in.
|
|
31
|
+
Notes are usually written in the order things were remembered; the guide follows the
|
|
32
|
+
order they have to be done.
|
|
19
33
|
|
|
20
|
-
|
|
34
|
+
3. **One action per step, with a way to tell it worked when the notes give one.** Number the
|
|
35
|
+
steps. Split compound ones. Add a success check only where the notes say what success
|
|
36
|
+
looks like; don't invent screens, messages or outputs.
|
|
21
37
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
| **API reference** → [`templates/api-reference.md`](templates/api-reference.md) | contracts other developers code against | endpoints, request/response shapes, OpenAPI, event names, payload schemas, status codes, webhooks, Kafka/SNS topics, JSON Schema |
|
|
38
|
+
4. **For developer references, the contract as given.** Each endpoint, event or field with
|
|
39
|
+
what the notes say about it: type, whether it's required, meaning, an example where the
|
|
40
|
+
notes have one. Where the notes don't say whether a field is required or what a value
|
|
41
|
+
means, the reference says that, rather than guessing. Error responses only as documented.
|
|
27
42
|
|
|
28
|
-
|
|
43
|
+
5. **What the notes don't cover stays out.** A feature people have asked about but the notes
|
|
44
|
+
don't describe, steps for a device or tool the notes never mention, a header name or host
|
|
45
|
+
nobody wrote down: leave them out of the guide, and name them once in your reply.
|
|
29
46
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- **Design walkthrough** needs *who it's for* (new hire vs adjacent team) and *what they should be able to do after reading*.
|
|
33
|
-
- **API reference** needs the *transport + auth model* and *versioning scheme*. Without auth, the examples are unrunnable.
|
|
34
|
-
|
|
35
|
-
If the source is genuinely too thin, say so once and draft with gaps flagged as `> ⚠️ NEEDS INPUT: …` — don't invent.
|
|
36
|
-
|
|
37
|
-
4. **Fill the matching template.** Each template is ordered the way a reader actually consumes it. Don't reorder sections to match the input's order; reorder the input to match the reader's path.
|
|
38
|
-
|
|
39
|
-
5. **Apply the universal easy-to-follow rules** (these are the spine of every style):
|
|
40
|
-
- **One action per step.** Number them. No compound step hiding three commands behind one number.
|
|
41
|
-
- **Every step ends in a check.** "You should see `Listening on :3000`." A step with no success signal can't tell the reader whether to continue or stop.
|
|
42
|
-
- **Commands are complete and paste-able.** Real flags, not pseudocode. Placeholders are unmistakable (`<YOUR_API_KEY>`, never `your-key-here` buried mid-line) and listed once up front.
|
|
43
|
-
- **Lead each section with the outcome, not the backstory.** "By the end of this section the service answers on localhost." The "why" belongs in a walkthrough, not a quickstart.
|
|
44
|
-
- **Front-load the happy path.** Push edge cases, troubleshooting, and teardown to the end.
|
|
45
|
-
|
|
46
|
-
## Useful references in this skill
|
|
47
|
-
|
|
48
|
-
- [`templates/setup-guide.md`](templates/setup-guide.md) — install/configure/run, prerequisites → verify → troubleshooting.
|
|
49
|
-
- [`templates/design-walkthrough.md`](templates/design-walkthrough.md) — mental model → components → flow → key decisions → where the code lives.
|
|
50
|
-
- [`templates/api-reference.md`](templates/api-reference.md) — conventions → per-endpoint/event contracts → error catalog → changelog.
|
|
51
|
-
- [`examples/local-setup-guide.md`](examples/local-setup-guide.md) — raw notes → a finished setup guide, showing the detection call and the verify-after-every-step discipline.
|
|
47
|
+
6. **Deliver from what you have.** With notes to work from, write the guide and state any
|
|
48
|
+
assumption about the reader in one line. Ask first only when there is nothing to work from.
|
|
52
49
|
|
|
53
50
|
## Quality bar
|
|
54
51
|
|
|
55
|
-
- **
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
52
|
+
- **Every fact in the guide is in the notes;** every inference is marked where it appears.
|
|
53
|
+
- **The guide can be sent as written:** no questions, internal notes or to-do markers in it.
|
|
54
|
+
- **A reader following top to bottom never uses something before it is set up.**
|
|
55
|
+
- **One action per step;** success checks only where the notes give them.
|
|
56
|
+
- **References say "not stated" rather than guessing types, required fields or meanings.**
|
|
57
|
+
- **Length and voice fit the reader asked for.**
|
|
61
58
|
|
|
62
59
|
## When to use this skill
|
|
63
60
|
|
|
64
61
|
- ✅ "Write setup instructions for getting our service running locally."
|
|
65
|
-
- ✅ "Turn this
|
|
62
|
+
- ✅ "Turn this description into an onboarding walkthrough for new staff."
|
|
66
63
|
- ✅ "Document these endpoints / this event schema for the developers who'll consume them."
|
|
67
64
|
- ✅ Converting messy notes or a spec into a doc someone can follow without you present.
|
|
68
65
|
|
|
@@ -75,11 +72,13 @@ You help the user turn rough material — notes, a spec, an architecture descrip
|
|
|
75
72
|
|
|
76
73
|
## Anti-patterns to avoid
|
|
77
74
|
|
|
78
|
-
- ❌
|
|
79
|
-
|
|
80
|
-
- ❌
|
|
81
|
-
- ❌
|
|
82
|
-
|
|
83
|
-
- ❌
|
|
84
|
-
-
|
|
85
|
-
- ❌ **
|
|
75
|
+
- ❌ **The plausible detail.** A success message, a default, a menu path or a retry count the
|
|
76
|
+
notes never mention.
|
|
77
|
+
- ❌ **Notes to the requester inside the guide.** "Internal: confirm with eng before sending."
|
|
78
|
+
- ❌ **Steps for what the notes don't cover,** written from general knowledge because the
|
|
79
|
+
reader will need them. Tell the reader who to ask instead.
|
|
80
|
+
- ❌ **Template sections on a small ask.** "Mental model", "Data & state", "Where it runs" for a
|
|
81
|
+
five-line description.
|
|
82
|
+
- ❌ **"Required: yes" on every field** because the column needed filling.
|
|
83
|
+
- ❌ **Compound steps.** Three commands behind one number.
|
|
84
|
+
- ❌ **Announcing your approach.** "Reading this as a setup guide…" — just write it.
|
|
@@ -72,6 +72,33 @@
|
|
|
72
72
|
"It does not invent a queue or topic name, how often events are sent, delivery guarantees, value ranges stated as fact, or fields that are not in the sample",
|
|
73
73
|
"The reference is about a page or less, with no sections on things that were not supplied such as authentication, retries or versioning"
|
|
74
74
|
]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": 6,
|
|
78
|
+
"held_out": "2026-10-17",
|
|
79
|
+
"prompt": "Can you turn setup-notes.md and thread.txt into a setup guide for Wren? She's a new analyst starting Monday and needs to get Larkspur running on her laptop on day one without pinging anyone. She's fine in a terminal but has never seen our stack. Something she can follow in one sitting, under 600 words.",
|
|
80
|
+
"assertions": [
|
|
81
|
+
"The steps run in an order that works: lark-analysts access is requested up front, `lark runtime start` comes before `lark db init`, the database is initialised before `lark seed`, and the config file is created before `lark login`, which comes before `lark sync`, even though the notes put seeding first",
|
|
82
|
+
"The local database port is given as 6543, the 2.4 default from the thread, and 5433 is not presented as the current port",
|
|
83
|
+
"`lark deploy --prod` does not appear as a step, and the lunch chat is left out",
|
|
84
|
+
"If the guide says the login can stop working and need `lark login` again, it is marked as one colleague's experience rather than stated as documented behaviour",
|
|
85
|
+
"It does not invent a region or workspace value, a VPN requirement either way, or any command, flag, file path, error message or timing not in the two files",
|
|
86
|
+
"The guide is delivered without stopping to ask first, and the unanswered questions (which region Wren should use, whether sync needs the VPN off-site) are raised to the requester outside the guide rather than answered by guesswork inside it",
|
|
87
|
+
"The guide is under 600 words"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": 7,
|
|
92
|
+
"held_out": "2026-10-17",
|
|
93
|
+
"prompt": "hi, I do the welcome stuff for Brackenhill Allotment Association. can you make this into a short welcome guide for new plot holders? half a page max, they're mostly retirees and young families, not techy at all.\n\nshed key is in the lockbox by the gate, code is on the welcome sheet. water troughs get turned on in april by whoever's on the rota. sign the tool book when you borrow anything. bonfires NOT allowed, council letter last yr. compost bays - green bin is for weeds, the wooden ones for everything else? not sure tbh ask Derek. new folk do their induction walk with a committee member before they get a key",
|
|
94
|
+
"assertions": [
|
|
95
|
+
"The induction walk with a committee member comes before getting the key or using the lockbox, even though the notes mention the key first",
|
|
96
|
+
"It does not invent the lockbox code, a date for the water going on, rota names, contact details for Derek or anyone else, rent, opening hours, penalties or any rule not in the notes",
|
|
97
|
+
"The compost-bay split is not stated as a settled rule in the guide, and the requester is told outside the guide that it needs confirming with Derek",
|
|
98
|
+
"The bonfire ban and signing the tool book are both included as clear rules",
|
|
99
|
+
"It is written in plain everyday language a non-technical newcomer can follow, with no jargon or committee shorthand left unexplained",
|
|
100
|
+
"The guide fits in about half a page (roughly 250 words or fewer) and is delivered without stopping to ask questions first"
|
|
101
|
+
]
|
|
75
102
|
}
|
|
76
103
|
]
|
|
77
104
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# larkspur local setup - rough notes (Tobin, not tidied)
|
|
2
|
+
|
|
3
|
+
- `lark seed --sample` loads the sample dataset so you have tables to query. do this first thing so there's something to look at
|
|
4
|
+
- install the CLI from the intranet: Fenmoor Hub > Tools > Larkspur CLI, run the installer. check with `lark --version`, should be 2.4 or later
|
|
5
|
+
- seed writes into your local db, so you need one: `lark db init` (creates it on port 5433)
|
|
6
|
+
- db init only works if the local runtime is up: `lark runtime start`
|
|
7
|
+
- config lives at ~/.lark/config.toml. clone the larkspur-starter repo, copy config.example.toml to ~/.lark/config.toml, fill in `workspace` and `region`
|
|
8
|
+
- `lark login` opens the browser for SSO. it reads workspace from the config file so the config has to exist first or it errors
|
|
9
|
+
- you must be in the lark-analysts group or login fails with "not authorised". Ines on the platform team adds people. can take up to a working day so ideally request before day one
|
|
10
|
+
- after login, `lark sync` pulls the shared dimension tables. first sync takes about 10 min, later ones are quick
|
|
11
|
+
- `lark status` shows runtime, db and login state if something looks off
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#data-onboarding (export)
|
|
2
|
+
|
|
3
|
+
Tobin: pinned my setup notes for whoever starts next. local db is on 5433 btw
|
|
4
|
+
Mara: heads up, since 2.4 `lark db init` defaults to 6543. 5433 kept clashing with other stuff on people's machines
|
|
5
|
+
Tobin: ah yes, my notes predate that. 6543 it is
|
|
6
|
+
Pell: what region do new people put in the config? I just copied mine from someone
|
|
7
|
+
Tobin: depends which team they land on. I'll check for Wren and get back to you
|
|
8
|
+
Pell: also does `lark sync` need the VPN on? I think it does when I'm off-site but not 100%
|
|
9
|
+
Mara: no idea, haven't worked from home in ages
|
|
10
|
+
Pell: fwiw my login stopped working after the long weekend, had to run `lark login` again
|
|
11
|
+
Mara: reminder for platform folks only: `lark deploy --prod` is still frozen until the migration is signed off, don't run it
|
|
12
|
+
Tobin: lunch at 12:30 anyone?
|
|
13
|
+
Mara: yes
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "guide-builder",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Turn raw notes,
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Turn raw notes, a spec, a thread or a messy procedure into a guide someone else can follow — a setup guide, a how-to, an onboarding walkthrough, or a reference for developers — in the length and voice its reader needs. Holds only what the notes say, marks anything inferred where it appears, orders steps so nothing is used before it is set up, and keeps open questions out of the guide so it can be sent as it stands. Use when the user wants setup or getting-started instructions, a walkthrough of how something works, or reference docs for an API or event schema — and it is NOT an SRE operational runbook (use runbook-generator) or a design proposal for review (use design-doc).",
|
|
5
5
|
"entrypoint": "SKILL.md",
|
|
6
6
|
"deps": { "npm": [], "pip": [] },
|
|
7
7
|
"env": { "required": [], "optional": [] },
|
|
8
8
|
"related": ["brief-intake", "design-doc", "exec-summary", "runbook-generator"],
|
|
9
9
|
"tags": ["guide", "setup", "documentation", "api-reference", "onboarding", "walkthrough"],
|
|
10
|
-
"model": { "tier": "standard", "rationale": "Shapes notes into a
|
|
10
|
+
"model": { "tier": "standard", "rationale": "Shapes notes into a guide without adding to them. Generation, not adversarial review." }
|
|
11
11
|
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
# Devil's advocate: {feature name or PR title}
|
|
2
|
-
|
|
3
|
-
_Scope: {N files, M lines changed in the diff under review}_
|
|
4
|
-
_Reviewed: {YYYY-MM-DD}_
|
|
5
|
-
_Code shape(s): {endpoint | async handler | migration | state machine | parser | CLI | UI | background job | library | config}_
|
|
6
|
-
|
|
7
|
-
## Verdict
|
|
8
|
-
**{SHIP IT | SHIP WITH FIXES | DO NOT MERGE | RECONSIDER APPROACH}** — {N} blocker · {N} major · {N} minor · {N} nit
|
|
9
|
-
|
|
10
|
-
{3-sentence summary. Lead with the worst finding. Name the lens(es) that surfaced the most issues. If the verdict is `RECONSIDER APPROACH`, say *why* — what's the structural problem the findings point to.}
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Findings by lens
|
|
15
|
-
|
|
16
|
-
### 1. 🔍 Edge cases the first pass missed
|
|
17
|
-
|
|
18
|
-
#### 🟥 Blockers
|
|
19
|
-
1. **Where:** `{file:line}` — *`{≤15 char quoted snippet}`*
|
|
20
|
-
**What:** {one sentence — which check from the edge-cases lens fired}
|
|
21
|
-
**Scenario:** {concrete reproducible case, e.g. "POST /checkout with `body = {}` → `applyDiscount(undefined)` → TypeError at line 47"}
|
|
22
|
-
**Fix:** {one or two sentences, concrete and paste-able where possible}
|
|
23
|
-
|
|
24
|
-
#### 🟧 Major
|
|
25
|
-
1. **Where:** `{file:line}` — *`{snippet}`*
|
|
26
|
-
**What:** {…}
|
|
27
|
-
**Scenario:** {…}
|
|
28
|
-
**Fix:** {…}
|
|
29
|
-
|
|
30
|
-
#### 🟨 Minor
|
|
31
|
-
1. {…}
|
|
32
|
-
|
|
33
|
-
#### ⚪ Nits
|
|
34
|
-
- {…}
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
### 2. 🔭 Future-proofing — assumptions baked in
|
|
39
|
-
|
|
40
|
-
#### 🟥 Blockers
|
|
41
|
-
1. **Where:** `{file:line}` — *`{snippet}`*
|
|
42
|
-
**What:** {assumption that will break — e.g. "Hard-coded 100ms timeout"}
|
|
43
|
-
**When it bites:** {realistic timeframe — e.g. "p99 latency from `payments-svc` already at 80ms; one more downstream hop and the deploy fails"}
|
|
44
|
-
**Fix:** {…}
|
|
45
|
-
|
|
46
|
-
#### 🟧 Major
|
|
47
|
-
1. {…}
|
|
48
|
-
|
|
49
|
-
#### 🟨 Minor
|
|
50
|
-
1. {…}
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
### 3. ⚔️ Adversarial — what a staff engineer would push back on
|
|
55
|
-
|
|
56
|
-
#### 🟥 Blockers
|
|
57
|
-
1. **Where:** `{file:line}` — *`{snippet}`*
|
|
58
|
-
**What:** {category — concurrency / error handling / security / observability / blast radius}
|
|
59
|
-
**Scenario:** {how it actually fails — "two callers run `incrementBalance` in parallel, both read balance=100, both write balance=101 → $10 lost"}
|
|
60
|
-
**Fix:** {…}
|
|
61
|
-
|
|
62
|
-
#### 🟧 Major
|
|
63
|
-
1. {…}
|
|
64
|
-
|
|
65
|
-
#### 🟨 Minor
|
|
66
|
-
1. {…}
|
|
67
|
-
|
|
68
|
-
#### ⚪ Nits
|
|
69
|
-
- {…}
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
### 4. 🧪 Test-coverage gaps
|
|
74
|
-
|
|
75
|
-
For each gap: scenario → suggested location → severity.
|
|
76
|
-
|
|
77
|
-
#### 🟥 Blockers
|
|
78
|
-
1. **Missing test:** {scenario, e.g. "POST /checkout with missing auth header — expect 401"}
|
|
79
|
-
**Suggested location:** `{path/to/test/file}`
|
|
80
|
-
**Why blocker:** {e.g. "auth check is the only thing between this endpoint and arbitrary user data; no test guards against future refactors removing it"}
|
|
81
|
-
|
|
82
|
-
#### 🟧 Major
|
|
83
|
-
1. **Missing test:** {scenario}
|
|
84
|
-
**Suggested location:** `{path}`
|
|
85
|
-
**Why major:** {…}
|
|
86
|
-
|
|
87
|
-
#### 🟨 Minor (additional cases worth adding)
|
|
88
|
-
- {one-liner per case}
|
|
89
|
-
|
|
90
|
-
#### Test smells (existing tests that don't earn their keep)
|
|
91
|
-
- **`{test file:line}`** — *`{snippet of the test}`* — {smell, e.g. "asserts nothing — calls `applyDiscount(10)` but doesn't check the return value"} — **Fix:** {what it should assert}
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## ✅ What's solid
|
|
96
|
-
|
|
97
|
-
Things the implementation got right — worth preserving in any rewrite, and worth re-using as patterns elsewhere in the change.
|
|
98
|
-
|
|
99
|
-
- **{Strength 1}** — `{file:line}` — {why this is a real strength, not flattery}
|
|
100
|
-
- **{Strength 2}** — `{file:line}` — {…}
|
|
101
|
-
- **{Strength 3}** — `{file:line}` — {…}
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## 🛠 Suggested order to address
|
|
106
|
-
|
|
107
|
-
1. **Fix blockers first.** {Specifically: {finding refs}}
|
|
108
|
-
2. **Add the missing tests in §4.** They double as regression catches for the fixes above.
|
|
109
|
-
3. **Major findings in priority order:** {finding refs, ordered by likelihood-of-biting × cost-to-fix-later}
|
|
110
|
-
4. **Minor + nits:** {batch into a follow-up commit or punt to a separate cleanup PR — don't gate the merge}
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 🚦 Re-review trigger
|
|
115
|
-
|
|
116
|
-
After fixes land, the changes most likely to *introduce new findings* are:
|
|
117
|
-
- {e.g. "The retry logic added to address Blocker #2 needs a fresh sweep of Lens 1 (edge cases) for retry storm + idempotency."}
|
|
118
|
-
- {e.g. "The new feature flag added per the 'blast radius' finding needs a Lens 2 check that the flag has an off-switch and an expiry."}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Example: raw notes → setup guide
|
|
2
|
-
|
|
3
|
-
Shows the two things that make this skill earn its keep: the **style-detection call up front**, and the **verify-after-every-step** discipline that turns notes into something a stranger can follow.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Input (what the user pasted)
|
|
8
|
-
|
|
9
|
-
> need a getting-started doc for `widget-api`. it's a Go service, needs Postgres 15. clone, copy the env file (need a STRIPE_KEY from the dashboard), `make deps`, bring up postgres with docker, `make migrate`, then `make run`. it serves on 8080. there's a `/healthz`. people keep forgetting to start postgres first and then complain migrate hangs.
|
|
10
|
-
|
|
11
|
-
## The skill's first line back (style detection)
|
|
12
|
-
|
|
13
|
-
> Reading this as a **setup guide** — it's clone → configure → run with a defined finish line (`/healthz` answering). Two things I'm filling with defaults; correct me if wrong: end state is **running locally** (not deployed), and the prerequisite baseline assumes Go and Docker are already installed. Drafting now.
|
|
14
|
-
|
|
15
|
-
## Output
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# widget-api — Setup guide
|
|
20
|
-
|
|
21
|
-
**Goal:** Run `widget-api` locally against a Dockerized Postgres and get a healthy response from `/healthz`.
|
|
22
|
-
**Time:** ~10 minutes
|
|
23
|
-
**You'll have at the end:** the API serving on `localhost:8080` with migrations applied.
|
|
24
|
-
|
|
25
|
-
## Placeholders used in this guide
|
|
26
|
-
|
|
27
|
-
| Placeholder | What to put | Where to get it |
|
|
28
|
-
|---|---|---|
|
|
29
|
-
| `<STRIPE_KEY>` | Stripe secret key for the test mode | Stripe Dashboard → Developers → API keys |
|
|
30
|
-
|
|
31
|
-
## Prerequisites
|
|
32
|
-
|
|
33
|
-
| Need | Version | Check it | If missing |
|
|
34
|
-
|---|---|---|---|
|
|
35
|
-
| Go | `>= 1.22` | `go version` | https://go.dev/dl |
|
|
36
|
-
| Docker | any recent | `docker --version` | https://docs.docker.com/get-docker |
|
|
37
|
-
| Postgres image | 15 | (pulled in step 3) | — |
|
|
38
|
-
|
|
39
|
-
## Steps
|
|
40
|
-
|
|
41
|
-
### 1. Clone the repo and enter it
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
git clone git@github.com:example/widget-api.git && cd widget-api
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**You should see:** a `Makefile` in the directory — `ls Makefile`.
|
|
48
|
-
|
|
49
|
-
### 2. Configure environment
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
cp .env.example .env
|
|
53
|
-
# then set in .env:
|
|
54
|
-
# STRIPE_KEY=<STRIPE_KEY>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**You should see:** no placeholders left — `grep '<' .env` returns nothing.
|
|
58
|
-
|
|
59
|
-
### 3. Start Postgres (do this before migrating)
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
docker compose up -d postgres
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**You should see:** `docker compose ps` lists `postgres` as `healthy`. Wait for `healthy` before the next step — migrating against a not-yet-ready Postgres is what makes `make migrate` appear to hang.
|
|
66
|
-
|
|
67
|
-
### 4. Install Go dependencies
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
make deps
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**You should see:** `go mod download` completes with no errors.
|
|
74
|
-
|
|
75
|
-
### 5. Run migrations
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
make migrate
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**You should see:** `migrations applied: N` and a return to the prompt within a few seconds.
|
|
82
|
-
|
|
83
|
-
### 6. Start the service
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
make run
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**You should see:** `widget-api listening on :8080`.
|
|
90
|
-
|
|
91
|
-
## Verify it works
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
curl -s localhost:8080/healthz
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
**Expected:** `{"status":"ok","db":"connected"}`
|
|
98
|
-
|
|
99
|
-
## Troubleshooting
|
|
100
|
-
|
|
101
|
-
| Symptom | Likely cause | Fix |
|
|
102
|
-
|---|---|---|
|
|
103
|
-
| `make migrate` hangs | Postgres not `healthy` yet | Re-check step 3; wait for `healthy`, then retry |
|
|
104
|
-
| `connection refused :5432` | Postgres container not up | `docker compose up -d postgres` |
|
|
105
|
-
| `/healthz` returns `db:"down"` | migrations not applied | run step 5 |
|
|
106
|
-
|
|
107
|
-
## Teardown
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
docker compose down -v
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Removes the Postgres container and its volume. Your `.env` is left intact.
|
|
114
|
-
|
|
115
|
-
## Next steps
|
|
116
|
-
|
|
117
|
-
- Run the tests: `make test`
|
|
118
|
-
- Reference for the endpoints this service exposes: generate one with `/guide-builder` in **API reference** style.
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### Why this passes the quality bar
|
|
123
|
-
|
|
124
|
-
- **Every step ends in a check** — the reader never guesses whether to continue.
|
|
125
|
-
- **The one gotcha from the notes** ("people forget to start postgres") became step 3's check *and* the first troubleshooting row, instead of buried prose.
|
|
126
|
-
- **The single placeholder is listed once up front**, not left as a surprise mid-command.
|
|
127
|
-
- **One end-to-end verify** (`/healthz`) proves the whole chain, not just the last command.
|