skilldrop-cli 0.16.17 → 0.16.18

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.
@@ -232,7 +232,7 @@
232
232
  },
233
233
  "guide-builder": {
234
234
  "tier": "standard",
235
- "rationale": "Shapes notes into a styled guide. Generation, not adversarial review."
235
+ "rationale": "Shapes notes into a guide without adding to them. Generation, not adversarial review."
236
236
  },
237
237
  "reverse-architecture": {
238
238
  "tier": "standard",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skilldrop-cli",
3
- "version": "0.16.17",
3
+ "version": "0.16.18",
4
4
  "description": "Portable AI-agent skills, measured against the agent without them. ADRs, PRDs, runbooks, decks and reviews, installable into Claude Code, Cursor, Kiro, and any IDE that takes custom instructions. One command per skill or per role-based pack.",
5
5
  "author": {
6
6
  "name": "Sanjay Ananthanarayan",
@@ -1,68 +1,65 @@
1
1
  ---
2
2
  name: guide-builder
3
- description: Turn raw notes, specs, or design material into an easy-to-follow guide, auto-styled to the content — a setup/quickstart, a design walkthrough, or an API/event-schema reference. Use when the user wants setup or getting-started instructions, an onboarding walkthrough of how a system works, or developer 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).
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
- You help the user turn rough material — notes, a spec, an architecture description, an endpoint list — into a guide a reader can follow top-to-bottom without you in the room. This skill picks one of three styles from the content; it is **not** the SRE operational runbook (`runbook-generator`) and **not** a design proposal for review (`design-doc`). It explains and instructs; it does not propose or page.
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
- **Four rules come before the steps and outrank them:**
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
- - **Answer what was asked, first.** Open with the answer, the decision or the artifact, in plain words. Scores, matrices, frameworks and tags come after it, and anything that doesn't change the answer is cut.
15
- - **Use only what you were given.** Don't add facts, names, numbers, incidents, history, steps or sections the input doesn't contain. What you need and don't have is left out of the artifact and listed once at the end under "To confirm".
16
- - **Deliver from what you have.** When the request gives you something to work on, state your assumptions in a line and produce the result. When it gives you nothing to work on, ask for it in one or two plain sentences and say what you will do once you have it.
17
- - **Write for someone who has never heard of this skill.** No skill names, no paths or scripts from this folder, no internal terms, and nothing about how the run was set up. A next step is one plain sentence at the end that describes the work.
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
- 1. **Detect the style first, and say which you picked.** Classify the input into exactly one of three styles using the table below. State the choice in one line with a one-clause why — *"Reading this as a **setup guide** (it's install + config steps); say the word if you wanted the design walkthrough."* — so the user can redirect before you draft.
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
- | Style | Pick when the content is… | Signals in the input |
23
- |---|---|---|
24
- | **Setup guide** → [`templates/setup-guide.md`](templates/setup-guide.md) | install / configure / run something, step by step | "install", "set up", "getting started", prerequisites, env vars, `.env`, CLI commands, `docker`, "clone the repo" |
25
- | **Design walkthrough** → [`templates/design-walkthrough.md`](templates/design-walkthrough.md) | explaining how an already-decided system works so someone can understand or build on it | components, data flow, "how X works", onboarding a new engineer, "why it's built this way" |
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
- 2. **Handle mixed content by picking the dominant style, not blending.** If the input spans two styles (e.g. setup steps *and* the API they expose), lead with the dominant one and append the secondary as a clearly-labelled section or link out to a second guide. Only ask the user which to lead with if it's a genuine 50/50.
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
- 3. **Gather only what the chosen style can't do without.** Don't run a generic intake. Cap at 2 questions, pick defaults for the rest:
31
- - **Setup guide** needs the *target end state* ("running locally" vs "deployed to staging") and the *prerequisites baseline*. Without an end state, a setup guide has no finish line.
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
- - **A reader who follows top-to-bottom reaches the stated end state without leaving the doc for missing info.** Unstated prerequisites are the #1 failure — hunt them down.
56
- - **Every command block has an expected result or a verification step.** A command with no "how do I know it worked" is incomplete.
57
- - **Placeholders are unmistakable and listed once up front.** `<YOUR_API_KEY>`, not a real-looking string the reader pastes verbatim and wonders why it fails.
58
- - **No forward references that break linear reading.** "See step 7" before step 7 means the order is wrong, or it needs a link.
59
- - **API reference: every field has type + required/optional + a one-line meaning; every endpoint has ≥1 full example request and response, including at least one error response.**
60
- - **The detected style is stated up front with a one-line why,** so the user can redirect in one message instead of getting the wrong artifact.
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 architecture description into an onboarding walkthrough for new engineers."
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
- - ❌ Compound steps. "Install deps, configure the DB, and run migrations" as one numbered step — split into three.
79
- - ❌ Commands with no expected output. The reader can't tell success from a silent failure.
80
- - ❌ Backstory before the first actionable step in a setup guide. Save the "why" for a walkthrough.
81
- - ❌ Documenting an API in prose ("it returns the user object") instead of a typed schema + example payload.
82
- - ❌ Blending two styles into one undifferentiated doc. Pick the dominant style; link or append the rest.
83
- - ❌ Optimistic examples that omit the error/failure responses an API consumer is required to handle.
84
- - ❌ Reinventing `runbook-generator` (incident playbooks, on-call) or `design-doc` (alternatives, approval) — stay in the explain-and-follow lane.
85
- - ❌ **Showing the machinery.** The reply and the artifact are for the person who asked. Don't mention this skill, its files, templates, caps or internal terms, or that the run is non-interactive. Name another skill once, at the end, as a suggested next step, never inside the artifact.
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.1.2",
4
- "description": "Turn raw notes, specs, or design material into an easy-to-follow guide, auto-styled to the content — a setup/quickstart, a design walkthrough, or an API/event-schema reference. Use when the user wants setup or getting-started instructions, an onboarding walkthrough of how a system works, or developer 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).",
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 styled guide. Generation, not adversarial review." }
10
+ "model": { "tier": "standard", "rationale": "Shapes notes into a guide without adding to them. Generation, not adversarial review." }
11
11
  }
@@ -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.
@@ -1,120 +0,0 @@
1
- # {API / event stream name} — Developer reference
2
-
3
- **Base URL:** `{https://api.example.com/v1}`
4
- **Auth:** {e.g. "Bearer token in `Authorization` header; obtain via …"}
5
- **Versioning:** {e.g. "URL-path `/v1`; breaking changes ship a new path. See Changelog."}
6
- **Content type:** `application/json` unless stated.
7
-
8
- ## Conventions
9
-
10
- These apply to every endpoint/event below — read once, don't repeat per item.
11
-
12
- - **Errors** return this shape:
13
- ```json
14
- { "error": { "code": "string", "message": "human-readable", "details": {} } }
15
- ```
16
- - **Pagination:** {e.g. "cursor-based: pass `?cursor=`; response includes `next_cursor` (null on last page)"}
17
- - **Idempotency:** {e.g. "mutating calls accept an `Idempotency-Key` header; replays within 24h return the original result"}
18
- - **Rate limits:** {e.g. "600 req/min/token; `429` with `Retry-After` when exceeded"}
19
- - **Timestamps:** ISO 8601 UTC (`2026-05-26T14:30:00Z`).
20
-
21
- ---
22
-
23
- ## Endpoints
24
-
25
- ### `{METHOD} /{path}` — {one-line purpose}
26
-
27
- {One sentence on when a consumer calls this.}
28
-
29
- **Auth:** {required scope/role, or "none"}
30
-
31
- **Path / query params**
32
-
33
- | Param | In | Type | Required | Description |
34
- |---|---|---|---|---|
35
- | `{id}` | path | string | yes | {…} |
36
- | `{limit}` | query | integer | no | {default, max} |
37
-
38
- **Request body**
39
-
40
- | Field | Type | Required | Description |
41
- |---|---|---|---|
42
- | `{field}` | string | yes | {…} |
43
- | `{field}` | integer | no | {default} |
44
-
45
- ```json
46
- { "field": "value", "field2": 42 }
47
- ```
48
-
49
- **Response `200`**
50
-
51
- | Field | Type | Description |
52
- |---|---|---|
53
- | `{id}` | string | {…} |
54
- | `{status}` | enum(`a`,`b`) | {…} |
55
-
56
- ```json
57
- { "id": "abc_123", "status": "a", "created_at": "2026-05-26T14:30:00Z" }
58
- ```
59
-
60
- **Errors**
61
-
62
- | Status | `error.code` | When |
63
- |---|---|---|
64
- | `400` | `invalid_request` | {…} |
65
- | `404` | `not_found` | {…} |
66
- | `409` | `conflict` | {…} |
67
-
68
- ```json
69
- { "error": { "code": "not_found", "message": "No resource with id abc_123" } }
70
- ```
71
-
72
- ---
73
-
74
- ## Events / messages
75
-
76
- For each event a consumer subscribes to.
77
-
78
- ### `{event.name}` — {one-line: what happened}
79
-
80
- - **Emitted when:** {the trigger}
81
- - **Transport:** {e.g. "Kafka topic `orders.v1`" / "webhook POST to your callback URL" / "SNS topic ARN …"}
82
- - **Delivery:** {e.g. "at-least-once; consumers MUST be idempotent on `event_id`"}
83
- - **Ordering:** {e.g. "ordered per `partition_key = order_id`; no global order"}
84
-
85
- **Payload**
86
-
87
- | Field | Type | Required | Description |
88
- |---|---|---|---|
89
- | `event_id` | string (uuid) | yes | dedup key |
90
- | `occurred_at` | string (ISO 8601) | yes | when the fact happened (not when delivered) |
91
- | `data.{field}` | string | yes | {…} |
92
-
93
- ```json
94
- {
95
- "event_id": "evt_01HX...",
96
- "type": "{event.name}",
97
- "occurred_at": "2026-05-26T14:30:00Z",
98
- "data": { "order_id": "ord_123", "amount_cents": 4999 }
99
- }
100
- ```
101
-
102
- **Consumer notes:** {what a subscriber must handle — out-of-order arrival, schema evolution, poison messages}
103
-
104
- ---
105
-
106
- ## Error code catalog
107
-
108
- | `error.code` | Meaning | Consumer action |
109
- |---|---|---|
110
- | `invalid_request` | malformed input | fix and retry; don't blind-retry |
111
- | `rate_limited` | over quota | back off per `Retry-After` |
112
- | `conflict` | idempotency or state clash | inspect existing resource |
113
- | {…} | … | … |
114
-
115
- ## Changelog
116
-
117
- | Version / date | Change | Breaking? |
118
- |---|---|---|
119
- | `v1` — {YYYY-MM-DD} | initial | — |
120
- | {…} | … | yes/no |
@@ -1,72 +0,0 @@
1
- # {System / feature} — How it works
2
-
3
- **Who this is for:** {e.g. "an engineer joining the payments team" / "an adjacent team integrating with us"}
4
- **After reading, you'll be able to:** {concrete capability — "trace a checkout request end-to-end and know which service owns each step"}
5
- **Status:** describes the system as built on {YYYY-MM-DD}. For *why we chose this design*, see {link to ADRs / design-doc}.
6
-
7
- ## The mental model
8
-
9
- {One paragraph or one diagram. The single idea a reader must hold to understand everything below — e.g. "Every write goes through the command bus; reads come straight from a denormalized view. Nothing reads the write tables directly."}
10
-
11
- ```
12
- {Optional ASCII or Mermaid sketch — or link to an architecture-diagrams output. Keep it to the load-bearing boxes and arrows, not every box.}
13
- ```
14
-
15
- ## Components
16
-
17
- What each piece does and why it exists — not how to deploy it.
18
-
19
- | Component | Responsibility | Why it's separate |
20
- |---|---|---|
21
- | {name} | {one line — what it owns} | {what would break if it were merged into its neighbour} |
22
- | {…} | … | … |
23
-
24
- ## How a {request / event / job} flows through
25
-
26
- Trace one representative path step by step. This is the heart of the walkthrough.
27
-
28
- 1. **{Entry point}** — {what happens, which component, what data} → `{file or module:fn}`
29
- 2. **{Next hop}** — {…} → `{file:fn}`
30
- 3. **{…}** — {…}
31
- 4. **{Result}** — {what the caller gets back / what side effect lands}
32
-
33
- > Trace it yourself: {how to watch this flow live — a log query, a trace ID, a debug endpoint}.
34
-
35
- ## Key design decisions (and why)
36
-
37
- The non-obvious choices a reader will otherwise undo by accident.
38
-
39
- - **{Decision}** — {why; what was rejected}. {Link to the ADR if one exists.}
40
- - **{Decision}** — {…}
41
-
42
- ## Data & state
43
-
44
- - **Source of truth:** {where the canonical data lives}
45
- - **Derived / cached:** {what's a projection of it, and how it's kept in sync}
46
- - **What's NOT persisted:** {e.g. "session state is in memory; a restart drops it — by design"}
47
-
48
- ## Where the code lives
49
-
50
- | Concern | Path | Notes |
51
- |---|---|---|
52
- | {entry points / routes} | `{path}` | {…} |
53
- | {core logic} | `{path}` | start here when reading |
54
- | {data layer} | `{path}` | … |
55
- | {tests worth reading first} | `{path}` | the integration tests document the contract |
56
-
57
- ## Making common changes
58
-
59
- How to do the things a new contributor will need in week one.
60
-
61
- - **Add a {new endpoint / event / field}:** {the 2–4 places to touch, in order}
62
- - **Change {common thing}:** {…}
63
-
64
- ## Gotchas / sharp edges
65
-
66
- - ⚠️ {Non-obvious constraint that will bite — "the queue is at-least-once; handlers must be idempotent"}
67
- - ⚠️ {…}
68
-
69
- ## Glossary
70
-
71
- - **{Term}** — {definition in this system's context, not the generic one}
72
- - **{Term}** — {…}
@@ -1,109 +0,0 @@
1
- # {Project / component} — Setup guide
2
-
3
- **Goal:** {one sentence — the end state, e.g. "Run the API locally with a seeded database and answer a request on `localhost:3000`."}
4
- **Time:** ~{N} minutes
5
- **You'll have at the end:** {concrete artifact — "a running server, a seeded DB, and a passing health check"}
6
-
7
- ## Placeholders used in this guide
8
-
9
- Replace these everywhere they appear. Nothing else is a placeholder.
10
-
11
- | Placeholder | What to put | Where to get it |
12
- |---|---|---|
13
- | `<YOUR_API_KEY>` | {what it is} | {where to obtain it} |
14
- | `<DB_PASSWORD>` | {what it is} | {…} |
15
-
16
- ## Prerequisites
17
-
18
- Check each before starting — a failed setup is almost always a missing prerequisite.
19
-
20
- | Need | Version | Check it | If missing |
21
- |---|---|---|---|
22
- | {Node / Python / Docker / …} | `>= {x.y}` | `node --version` | {install link / command} |
23
- | {…} | … | `…` | … |
24
-
25
- ## Steps
26
-
27
- ### 1. {Imperative — e.g. "Clone the repo and enter it"}
28
-
29
- ```bash
30
- git clone {repo-url} && cd {repo-dir}
31
- ```
32
-
33
- **You should see:** {what success looks like — e.g. "a `package.json` in the directory: `ls package.json`"}
34
-
35
- ### 2. {Imperative — e.g. "Install dependencies"}
36
-
37
- ```bash
38
- {exact command — e.g. `npm ci`}
39
- ```
40
-
41
- **You should see:** {e.g. "`added 412 packages` with no errors"}
42
-
43
- ### 3. {Imperative — e.g. "Configure environment"}
44
-
45
- ```bash
46
- cp .env.example .env
47
- # then set:
48
- # API_KEY=<YOUR_API_KEY>
49
- # DB_PASSWORD=<DB_PASSWORD>
50
- ```
51
-
52
- **You should see:** {e.g. "`.env` exists and has no remaining `<…>` placeholders: `grep '<' .env` returns nothing"}
53
-
54
- ### 4. {Imperative — e.g. "Start dependencies"}
55
-
56
- ```bash
57
- {e.g. `docker compose up -d postgres`}
58
- ```
59
-
60
- **You should see:** {e.g. "`docker compose ps` shows postgres as `healthy`"}
61
-
62
- ### 5. {Imperative — e.g. "Run migrations and seed"}
63
-
64
- ```bash
65
- {e.g. `npm run db:migrate && npm run db:seed`}
66
- ```
67
-
68
- **You should see:** {e.g. "`Migrations complete (3 applied)` and `Seeded 12 rows`"}
69
-
70
- ### 6. {Imperative — e.g. "Start the service"}
71
-
72
- ```bash
73
- {e.g. `npm run dev`}
74
- ```
75
-
76
- **You should see:** {e.g. "`Listening on http://localhost:3000`"}
77
-
78
- ## Verify it works
79
-
80
- One end-to-end check that proves the whole setup, not just the last step.
81
-
82
- ```bash
83
- {e.g. `curl -s localhost:3000/health`}
84
- ```
85
-
86
- **Expected:** {e.g. `{"status":"ok","db":"connected"}`}
87
-
88
- If you get this, you're done.
89
-
90
- ## Troubleshooting
91
-
92
- | Symptom | Likely cause | Fix |
93
- |---|---|---|
94
- | {exact error text} | {what's actually wrong} | {command or step to fix} |
95
- | `ECONNREFUSED ...:5432` | Postgres not up yet | Re-run step 4; wait for `healthy` |
96
- | {…} | … | … |
97
-
98
- ## Teardown
99
-
100
- ```bash
101
- {e.g. `docker compose down -v`}
102
- ```
103
-
104
- Removes {what — "containers and the local volume; your `.env` is left intact"}.
105
-
106
- ## Next steps
107
-
108
- - {Where to go now — "Run the test suite: `npm test`"}
109
- - {Link to the design walkthrough or API reference for this project, if one exists}