opencode-skills-collection 4.1.2 → 4.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +9 -1
  2. package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +15 -1
  3. package/bundled-skills/deep-research-framework/SKILL.md +81 -0
  4. package/bundled-skills/five-axis-code-review/SKILL.md +78 -0
  5. package/bundled-skills/git-commit-message/SKILL.md +76 -0
  6. package/bundled-skills/idea-to-blueprint/LICENSE +21 -0
  7. package/bundled-skills/idea-to-blueprint/SKILL.md +260 -0
  8. package/bundled-skills/idea-to-blueprint/assets/AGENTS.md.template +38 -0
  9. package/bundled-skills/idea-to-blueprint/assets/CLAUDE.md.template +38 -0
  10. package/bundled-skills/idea-to-blueprint/assets/DECISIONS.md.template +14 -0
  11. package/bundled-skills/idea-to-blueprint/assets/PROGRESS.md.template +47 -0
  12. package/bundled-skills/idea-to-blueprint/assets/session-prompt.md +23 -0
  13. package/bundled-skills/idea-to-blueprint/references/architecture-decisions.md +202 -0
  14. package/bundled-skills/idea-to-blueprint/references/blueprint-template.md +259 -0
  15. package/bundled-skills/idea-to-blueprint/references/code-quality-and-review.md +216 -0
  16. package/bundled-skills/idea-to-blueprint/references/design-minimal.md +96 -0
  17. package/bundled-skills/idea-to-blueprint/references/edge-case-catalog.md +239 -0
  18. package/bundled-skills/idea-to-blueprint/references/intake-questions.md +105 -0
  19. package/bundled-skills/idea-to-blueprint/references/research-protocol.md +196 -0
  20. package/bundled-skills/idea-to-blueprint/references/session-protocol.md +133 -0
  21. package/bundled-skills/idea-to-blueprint/references/stories-ac-tests.md +194 -0
  22. package/bundled-skills/idea-to-blueprint/references/ux-writing-guide.md +128 -0
  23. package/bundled-skills/idea-to-blueprint/scripts/lint_blueprint.py +460 -0
  24. package/bundled-skills/liuguang-banlan-ui/SKILL.md +22 -18
  25. package/bundled-skills/liuguang-banlan-ui/assets/starter/launcher.css +2 -2
  26. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/index.html +5 -4
  27. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme-config.js +3 -10
  28. package/bundled-skills/liuguang-banlan-ui/assets/starter/obsidian/theme.css +48 -62
  29. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/index.html +5 -4
  30. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme-config.js +27 -35
  31. package/bundled-skills/liuguang-banlan-ui/assets/starter/opal/theme.css +48 -62
  32. package/bundled-skills/liuguang-banlan-ui/assets/starter/shared/spectral-field.js +135 -148
  33. package/bundled-skills/liuguang-banlan-ui/references/style-contract.md +26 -7
  34. package/bundled-skills/liuguang-banlan-ui/references/verification.md +19 -7
  35. package/bundled-skills/liuguang-banlan-ui/scripts/measure_preview.py +78 -47
  36. package/bundled-skills/liuguang-banlan-ui/scripts/serve_preview.py +35 -0
  37. package/bundled-skills/liuguang-banlan-ui/scripts/validate_manifest.py +34 -3
  38. package/bundled-skills/liuguang-banlan-ui/tests/test_measure_preview.py +119 -0
  39. package/bundled-skills/liuguang-banlan-ui/tests/test_serve_preview.py +38 -0
  40. package/bundled-skills/liuguang-banlan-ui/tests/test_validate_manifest.py +73 -0
  41. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +12 -12
  42. package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +1 -1
  43. package/bundled-skills/meeting-notes/SKILL.md +80 -0
  44. package/bundled-skills/repo-foundation/SKILL.md +166 -0
  45. package/bundled-skills/repo-foundation/references/LICENSE.md +21 -0
  46. package/bundled-skills/repo-foundation/references/bootstrap.md +63 -0
  47. package/bundled-skills/repo-foundation/references/companion.md +9 -0
  48. package/bundled-skills/repo-foundation/references/continuity.md +50 -0
  49. package/bundled-skills/repo-foundation/references/evolution.md +60 -0
  50. package/bundled-skills/repo-foundation/references/migration-examples.md +53 -0
  51. package/bundled-skills/repo-foundation/references/shared-contracts.md +48 -0
  52. package/bundled-skills/repo-foundation/references/verification.md +50 -0
  53. package/bundled-skills/repo-native-refactor/SKILL.md +225 -0
  54. package/bundled-skills/repo-native-refactor/references/LICENSE.md +21 -0
  55. package/bundled-skills/repo-native-refactor/references/deterministic-tooling.md +101 -0
  56. package/bundled-skills/repo-native-refactor/references/error-reliability.md +117 -0
  57. package/bundled-skills/repo-native-refactor/references/finding-taxonomy.md +181 -0
  58. package/bundled-skills/repo-native-refactor/references/refactor-examples.md +77 -0
  59. package/bundled-skills/repo-native-refactor/references/repository-prose.md +157 -0
  60. package/bundled-skills/repo-native-refactor/references/repository-rehabilitation.md +94 -0
  61. package/bundled-skills/repo-native-refactor/references/semantic-risk.md +187 -0
  62. package/bundled-skills/repo-native-refactor/references/shared-contracts.md +48 -0
  63. package/bundled-skills/repo-native-refactor/references/testing-integrity.md +103 -0
  64. package/bundled-skills/tech-writing-proofread/SKILL.md +78 -0
  65. package/bundled-skills/typescript-expert/scripts/ts_diagnostic.py +40 -19
  66. package/bundled-skills/youtube-summarizer/SKILL.md +3 -3
  67. package/package.json +1 -1
  68. package/skills_index.json +254 -0
@@ -0,0 +1,38 @@
1
+ # {{PRODUCT_NAME}} — agent instructions
2
+
3
+ You are building this product one epic per fresh session. Nothing is remembered between sessions; the repo is the memory.
4
+
5
+ ## Read in this order, every session
6
+ 1. `docs/PROGRESS.md` — where we are, evidence, deviations, preconditions
7
+ 2. `docs/BLUEPRINT.md` — sections 12–16 (architecture, stack, conventions, quality, edge cases, delivery plan), 18 (session protocol), 21 (glossary), and the epic you were asked to build in section 17 plus every flow/screen/copy ID it references
8
+ 3. `docs/DECISIONS.md` — why things are the way they are
9
+ 4. `docs/REVIEW-CHECKLIST.md` — the standard every story is reviewed against before it is DONE
10
+
11
+ ## Rules
12
+ - Follow `docs/BLUEPRINT.md` §18 (session protocol) exactly: orient → verify preconditions → plan → build story by story with tests first → verify gates → update PROGRESS/DECISIONS → print handoff.
13
+ - Quality gate: `{{CHECK_COMMAND}}` must be green before every commit and at handoff. It runs format, lint, typecheck, tests and the architecture fitness functions; it must exit non-zero on any failure. **Never weaken, skip or bypass a gate rule to make a change pass** — if it must change, that is a DR entry plus a follow-up story.
14
+ - Self-review before handoff: walk the review checklist in `docs/REVIEW-CHECKLIST.md` (BLUEPRINT §14.4) over your own diff, story by story, reading the diff rather than your memory of writing it. Fix what fails. Report `reviewed: n items, n fixed, n accepted with reason` in the handoff — never a bare tick.
15
+ - Search the repo for an existing implementation before writing a new helper, mapper or utility. Duplicated logic is the most common defect in agent-written code, and you cannot see what you did not read.
16
+ - Every external symbol you use must trace to a pinned dependency in BLUEPRINT §13.1. If you are not certain a function, parameter or config key exists in the pinned version, check the docs — do not write it from memory.
17
+ - Tests assert concrete expected values and observable behaviour, never internal call sequences. A test that only checks a type, a length or that nothing threw is not a test. Each one must be seen failing before the implementation.
18
+ - Keep each story's diff within {{DIFF_LIMIT_LINES}} changed lines. If it will not fit, say so in the plan — the story is mis-sized and needs an amendment, not a bigger diff.
19
+ - Copy strings come from the copy tables (`CP-*` IDs) in the blueprint. Never improvise user-facing text.
20
+ - Acceptance criteria are the spec. If an AC is wrong, impossible or ambiguous: do not silently deviate — record an Amendment (BLUEPRINT §18) and, for user-visible/money/data/security changes, ask first.
21
+ - Anything not in the blueprint or PROGRESS.md is a decision → `docs/DECISIONS.md` (DR-nn) in the same commit. New dependency = DR entry.
22
+ - Stay inside the epic's scope. Ideas for later go to PROGRESS.md "Parking lot".
23
+ - Re-check every `[VERIFY-AT-BUILD]` item your epic depends on before relying on it; record the result.
24
+ - Commit format: `type(scope): message [E03-S02]`. Branch: `epic/E03` (or trunk if the blueprint says so).
25
+ - Never mark a story or epic DONE without an evidence line per AC in PROGRESS.md.
26
+
27
+ ## Commands
28
+ - Quality gate: `{{CHECK_COMMAND}}`
29
+ - Tests only: `{{TEST_COMMAND}}`
30
+ - Dev server: `{{DEV_COMMAND}}`
31
+ - Migrate: `{{MIGRATE_COMMAND}}`
32
+ - Deploy staging: `{{DEPLOY_STAGING_COMMAND}}` (see BLUEPRINT §13.8)
33
+
34
+ ## Conventions (summary — full text in BLUEPRINT §13)
35
+ - Language/runtime: {{RUNTIME_AND_VERSION}} · Framework: {{FRAMEWORK_AND_VERSION}} · DB: {{DB_AND_VERSION}}
36
+ - Strict typing on; no untyped escapes; typed errors; no swallowed exceptions; structured logs without PII.
37
+ - Tests: unit next to code / integration in `{{INTEGRATION_TEST_DIR}}` / e2e in `{{E2E_DIR}}`; factories in `{{FACTORIES_DIR}}`.
38
+ - Locale: {{LOCALE_RULES_ONE_LINE, e.g. "RTL, Persian digits in UI, Jalali dates in UI, UTC in storage, Toman with unit label"}}
@@ -0,0 +1,38 @@
1
+ # {{PRODUCT_NAME}} — agent instructions
2
+
3
+ You are building this product one epic per fresh session. Nothing is remembered between sessions; the repo is the memory.
4
+
5
+ ## Read in this order, every session
6
+ 1. `docs/PROGRESS.md` — where we are, evidence, deviations, preconditions
7
+ 2. `docs/BLUEPRINT.md` — sections 12–16 (architecture, stack, conventions, quality, edge cases, delivery plan), 18 (session protocol), 21 (glossary), and the epic you were asked to build in section 17 plus every flow/screen/copy ID it references
8
+ 3. `docs/DECISIONS.md` — why things are the way they are
9
+ 4. `docs/REVIEW-CHECKLIST.md` — the standard every story is reviewed against before it is DONE
10
+
11
+ ## Rules
12
+ - Follow `docs/BLUEPRINT.md` §18 (session protocol) exactly: orient → verify preconditions → plan → build story by story with tests first → verify gates → update PROGRESS/DECISIONS → print handoff.
13
+ - Quality gate: `{{CHECK_COMMAND}}` must be green before every commit and at handoff. It runs format, lint, typecheck, tests and the architecture fitness functions; it must exit non-zero on any failure. **Never weaken, skip or bypass a gate rule to make a change pass** — if it must change, that is a DR entry plus a follow-up story.
14
+ - Self-review before handoff: walk the review checklist in `docs/REVIEW-CHECKLIST.md` (BLUEPRINT §14.4) over your own diff, story by story, reading the diff rather than your memory of writing it. Fix what fails. Report `reviewed: n items, n fixed, n accepted with reason` in the handoff — never a bare tick.
15
+ - Search the repo for an existing implementation before writing a new helper, mapper or utility. Duplicated logic is the most common defect in agent-written code, and you cannot see what you did not read.
16
+ - Every external symbol you use must trace to a pinned dependency in BLUEPRINT §13.1. If you are not certain a function, parameter or config key exists in the pinned version, check the docs — do not write it from memory.
17
+ - Tests assert concrete expected values and observable behaviour, never internal call sequences. A test that only checks a type, a length or that nothing threw is not a test. Each one must be seen failing before the implementation.
18
+ - Keep each story's diff within {{DIFF_LIMIT_LINES}} changed lines. If it will not fit, say so in the plan — the story is mis-sized and needs an amendment, not a bigger diff.
19
+ - Copy strings come from the copy tables (`CP-*` IDs) in the blueprint. Never improvise user-facing text.
20
+ - Acceptance criteria are the spec. If an AC is wrong, impossible or ambiguous: do not silently deviate — record an Amendment (BLUEPRINT §18) and, for user-visible/money/data/security changes, ask first.
21
+ - Anything not in the blueprint or PROGRESS.md is a decision → `docs/DECISIONS.md` (DR-nn) in the same commit. New dependency = DR entry.
22
+ - Stay inside the epic's scope. Ideas for later go to PROGRESS.md "Parking lot".
23
+ - Re-check every `[VERIFY-AT-BUILD]` item your epic depends on before relying on it; record the result.
24
+ - Commit format: `type(scope): message [E03-S02]`. Branch: `epic/E03` (or trunk if the blueprint says so).
25
+ - Never mark a story or epic DONE without an evidence line per AC in PROGRESS.md.
26
+
27
+ ## Commands
28
+ - Quality gate: `{{CHECK_COMMAND}}`
29
+ - Tests only: `{{TEST_COMMAND}}`
30
+ - Dev server: `{{DEV_COMMAND}}`
31
+ - Migrate: `{{MIGRATE_COMMAND}}`
32
+ - Deploy staging: `{{DEPLOY_STAGING_COMMAND}}` (see BLUEPRINT §13.8)
33
+
34
+ ## Conventions (summary — full text in BLUEPRINT §13)
35
+ - Language/runtime: {{RUNTIME_AND_VERSION}} · Framework: {{FRAMEWORK_AND_VERSION}} · DB: {{DB_AND_VERSION}}
36
+ - Strict typing on; no untyped escapes; typed errors; no swallowed exceptions; structured logs without PII.
37
+ - Tests: unit next to code / integration in `{{INTEGRATION_TEST_DIR}}` / e2e in `{{E2E_DIR}}`; factories in `{{FACTORIES_DIR}}`.
38
+ - Locale: {{LOCALE_RULES_ONE_LINE, e.g. "RTL, Persian digits in UI, Jalali dates in UI, UTC in storage, Toman with unit label"}}
@@ -0,0 +1,14 @@
1
+ # DECISIONS — {{PRODUCT_NAME}}
2
+
3
+ > One entry per decision, newest last. Blueprint decision records are copied here in E00 so this is the single place to look.
4
+ > Format: context → options → decision → consequences. Keep each under 15 lines.
5
+
6
+ ## DR-01 — {{Title, e.g. "Stack: <language/framework>"}}
7
+ - Date: {{YYYY-MM-DD}} · Epic: E00 · Source: BLUEPRINT §4 / §13
8
+ - Context:
9
+ - Options considered:
10
+ - Decision:
11
+ - Consequences / follow-ups:
12
+ - Evidence: [VERIFIED — S-nn, date]
13
+
14
+ ## DR-02 —
@@ -0,0 +1,47 @@
1
+ # PROGRESS — {{PRODUCT_NAME}}
2
+
3
+ > State file, not a diary. The agent reads this first in every session and updates it before handoff.
4
+ > Source of truth for *what* to build: `docs/BLUEPRINT.md`. For *why*: `docs/DECISIONS.md`.
5
+
6
+ ## Current position
7
+ - Active epic: E00 — Foundation
8
+ - Last green `check` commit: (none yet)
9
+ - Staging URL: (set in E00)
10
+ - Blockers: none
11
+
12
+ ## Epic status
13
+ | Epic | Title | Status | Started | Done | Notes |
14
+ |---|---|---|---|---|---|
15
+ | E00 | Foundation | NOT STARTED | | | |
16
+ | E01 | {{EPIC_01_TITLE}} | NOT STARTED | | | |
17
+ <!-- one row per epic from BLUEPRINT §16. Status values: NOT STARTED · IN PROGRESS · DONE · BLOCKED -->
18
+
19
+ ## Story status and AC evidence
20
+ <!-- For each story: status + one evidence line per AC. Evidence = passing test name in `check`, or manual check with date and observation. -->
21
+ ### E00
22
+ - E00-S01 — NOT STARTED
23
+ - AC-1: —
24
+ - AC-2: —
25
+
26
+ ## VERIFY-AT-BUILD results
27
+ | Item | Needed by | Checked (date) | Result | Notes |
28
+ |---|---|---|---|---|
29
+ | {{e.g. INT-sms sandbox reachable}} | E02 | | | |
30
+
31
+ ## Deviations and amendments
32
+ | # | Date | Epic/Story | What changed | Why | Amendment ID (BLUEPRINT §18) |
33
+ |---|---|---|---|---|---|
34
+
35
+ ## Accepted risks (skipped edge cases / tests) — each needs an owner and a revisit trigger
36
+ | # | Story | Edge case / test | Reason | Owner | Revisit when |
37
+ |---|---|---|---|---|---|
38
+
39
+ ## Parking lot (ideas out of scope — do NOT build)
40
+ -
41
+
42
+ ## Preconditions for the next epic
43
+ - (filled by the agent at handoff: env vars, accounts, credentials, manual steps the user must do)
44
+
45
+ ## Session log (one line per session)
46
+ | Date | Epic | Outcome | Final commit |
47
+ |---|---|---|---|
@@ -0,0 +1,23 @@
1
+ # Session prompt template (one per epic — Appendix A of the blueprint)
2
+
3
+ Fill the placeholders per epic and paste as the FIRST message of a fresh Claude Code / Codex session opened in the repo root.
4
+
5
+ ---
6
+
7
+ You are starting **Epic {{EPIC_ID}} — {{EPIC_TITLE}}** of {{PRODUCT_NAME}}. This is a fresh session: you remember nothing from previous sessions. The repo is the memory.
8
+
9
+ Read, in order: `AGENTS.md` (or `CLAUDE.md`), `docs/PROGRESS.md` (all of it), then `docs/BLUEPRINT.md` sections 12, 13, 14, 15, 16, 18, 21 and **Epic {{EPIC_ID}}** in section 17, plus every flow (F-*), screen (SCR-*), copy (CP-*), entity (ENT-*), API (API-*), integration (INT-*) and edge case (EC-*) ID that epic references, and `docs/REVIEW-CHECKLIST.md`.
10
+
11
+ Then follow the session protocol in BLUEPRINT §18 exactly:
12
+
13
+ 1. **Orient** — confirm preconditions: previous epics DONE in PROGRESS.md; clean `git status` on main; `{{CHECK_COMMAND}}` green; required env vars present; every `[VERIFY-AT-BUILD]` item this epic depends on re-checked and recorded. If anything fails, stop and report — do not build.
14
+ 2. **Plan** — restate the goal and stories in ≤ 15 lines; list the tests you will write per story and the tasks; flag any AC that is ambiguous or references a missing ID (treat as a blueprint defect, do not guess). {{APPROVAL_MODE: "Wait for my 'go' before building." | "Do not wait — plan, then build without stopping unless a precondition fails or an amendment needs my approval."}}
15
+ 3. **Build** — story by story in order: tests first (they must fail), implement, keep `{{CHECK_COMMAND}}` green, copy only from CP-* IDs, one commit per story with `[E{{EPIC_ID}}-Snn]` in the message, PROGRESS.md evidence line per AC, DR-nn in DECISIONS.md for every decision the blueprint does not make.
16
+ 4. **Verify** — full `check`, epic-level flow tests, regression of all previous epics, CI green, staging deploy + smoke if the DoD requires it. Then **self-review**: walk `docs/REVIEW-CHECKLIST.md` (BLUEPRINT §14.4) over the epic's diff, story by story, reading the diff rather than recalling what you wrote — check correctness against each AC, module boundaries, failure paths, test meaning (would a test fail if the logic were wrong?), authorization per object, behaviour at 100x data, observability, copy IDs, and diff size. Fix what fails; do not batch it. Walk the epic's Definition of Done line by line with evidence.
17
+ 5. **Handoff** — update PROGRESS.md (status, evidence, deviations, accepted risks, VERIFY-AT-BUILD results, next epic preconditions, session log line), DECISIONS.md, and the Amendments log if anything changed; final commit; then print the ≤ 20-line handoff summary from BLUEPRINT §18 and tell me it is safe to terminate.
18
+
19
+ Rules that override everything: never mark DONE without evidence; never improvise user-facing text; never silently change an AC; never touch scope outside this epic; never weaken the quality gate to get to green; never use an API you have not verified exists in the pinned version; when in doubt, record and ask.
20
+
21
+ ---
22
+
23
+ Notes for the human: set the model to the strongest available and the effort/thinking level to maximum if the tool exposes it. Terminate the session after the handoff summary, then open a new one for the next epic.
@@ -0,0 +1,202 @@
1
+ # Architecture and technology decisions
2
+
3
+ Contents: 1 Why this is a separate track · 2 Step 1 drivers · 3 Step 2 candidate styles · 4 Step 3 the default and its exit triggers · 5 Step 4 boundaries · 6 Step 5 fitness functions · 7 Step 6 the cross-cutting decision list · 8 Step 7 technology selection · 9 Decision record format · 10 What to research and cite · 11 Anti-patterns · 12 Output into the blueprint
4
+
5
+ ## 1. Why this is a separate track
6
+
7
+ A stack table answers "what will we use". It does not answer the two questions a fresh build session actually needs: **what shape is this system** and **why is it that shape rather than the obvious alternative**. Without the second answer, the first agent that hits friction re-decides — and now the codebase has two architectures.
8
+
9
+ Architecture here means the decisions that are expensive to reverse: the module boundaries, what talks to what and how, where state lives, how the system fails. Everything else is code, and code is cheap. So the ordering rule for the whole track is: **derive the drivers from the product, choose the shape from the drivers, choose the technology from the shape** — never the reverse. Picking a framework first and reverse-engineering a justification is the most common way a blueprint goes wrong, and it is invisible in the finished document unless you look for it.
10
+
11
+ ## 2. Step 1 — Derive the architecture drivers
12
+
13
+ Before naming any technology, write the drivers: the quality attributes that this specific product must have, ranked, each with a *measurable* target. Vague drivers ("scalable", "secure", "fast") produce vague architectures.
14
+
15
+ Derive them from what you already know, not from a generic list:
16
+
17
+ | Source | Yields |
18
+ |---|---|
19
+ | Personas' context (device, network, patience) | latency and offline targets, payload budgets |
20
+ | Scale ceiling of v1 (stated in Scope, in numbers) | concurrency, data volume, throughput targets |
21
+ | The core loop and its failure cost | availability target, consistency requirements, recovery time |
22
+ | Money, identity, health, minors, personal data in scope | security and auditability requirements, data-residency questions |
23
+ | Market and hosting reality | deployability constraints, dependency on reachable services |
24
+ | Team shape (solo + agents, or a real team) | operability ceiling — how much system one person can run at 3am |
25
+ | Regulatory flags from research | audit trail, retention, consent, export/delete |
26
+ | The business's likely next 12 months | which axes must stay open (new channel, new market, new tenant model) |
27
+
28
+ Write 5–8 drivers, ranked, in this form:
29
+
30
+ ```
31
+ AD-1 Operability by one maintainer — target: full local run with one command; one deploy unit; any
32
+ production issue diagnosable from logs + error tracking without attaching a debugger. Rank 1
33
+ because [solo builder with agent sessions; nobody is on call].
34
+ AD-2 Correctness of money handling — target: no partial writes; every payment state transition
35
+ idempotent and auditable; reconciliation possible from stored events alone.
36
+ AD-3 p95 under 400 ms on the core read path at [stated ceiling] rows, on mid-range Android over 3G.
37
+ ...
38
+ ```
39
+
40
+ Then state the **explicit non-drivers** — the attributes you are deliberately not optimising for, each with a reason. "Not multi-region. Not sub-100ms. Not 1000 concurrent writers. Not multi-tenant." This is what keeps the architecture from growing to meet imaginary requirements, and it is the section future sessions will thank you for.
41
+
42
+ Ranked drivers with targets and named non-drivers are the contract the rest of this track is scored against.
43
+
44
+ ## 3. Step 2 — Candidate architecture styles
45
+
46
+ List 2–3 realistic candidates for the shape of the system and score them against the ranked drivers. Realistic means: appropriate to the scale ceiling and buildable by the team that exists. Candidates typically come from — modular monolith; layered monolith; monolith plus a small number of extracted workers; serverless functions; service-oriented split; client-heavy with a thin backend (BaaS); bot/worker plus queue; CLI/local-first with sync.
47
+
48
+ Score explicitly:
49
+
50
+ ```
51
+ | Driver (rank) | Modular monolith | Monolith + worker | Services |
52
+ |---|---|---|---|
53
+ | AD-1 operability (1) | 3 | 3 | 1 |
54
+ | AD-2 correctness (2) | 3 | 3 | 1 — needs sagas |
55
+ | ... | | | |
56
+ | Total (weighted) | 27 | 25 | 14 |
57
+ ```
58
+
59
+ Then write the decision as a DR, including what the loser would have bought you and at what price. A candidate that scores lower can still be chosen if a driver demands it — say so explicitly rather than letting the table decide silently.
60
+
61
+ ## 4. Step 3 — The default, and the triggers that would change it
62
+
63
+ For nearly everything this skill produces — a v1 built by an agent, one deploy target, a scale ceiling in the thousands not millions — the answer is a **modular monolith**: one deployable unit, strict internal module boundaries, one database, one `check`, one deploy. The current industry discussion has converged on this as the sane starting point, with distributed architectures justified by *organisational* scale far more often than by traffic, and a visible movement of teams consolidating back after paying for complexity they did not need. Verify the current state of that discussion rather than asserting it.
64
+
65
+ The reason it is the default here is narrower than the general argument: a fresh-session agent is far more reliable inside one repo with one command and local function calls than across a distributed system where a failure could be in any of four places and the reproduction requires orchestration.
66
+
67
+ But "default" is not "always", and a blueprint that says only "we chose a modular monolith" has not done the work. Write the **exit triggers**: the specific, observable conditions under which this decision should be revisited, so a future session knows whether it is allowed to change the shape.
68
+
69
+ ```
70
+ This decision holds until one of:
71
+ - a module needs independent scaling with a measured >5x load difference on the core path
72
+ - a module needs a different runtime/language for a capability the main stack cannot provide
73
+ - more than [n] people work on the codebase and merge contention is measured, not felt
74
+ - an availability requirement appears that one deploy unit cannot meet
75
+ Until then, extraction is out of scope, and the module boundaries in §5 are what make extraction
76
+ cheap if it ever becomes necessary.
77
+ ```
78
+
79
+ The corollary: because extraction is not planned, boundaries are enforced *now* (§5, §6). A modular monolith without enforced boundaries is just a monolith, and it degrades into one within a few sessions.
80
+
81
+ ## 5. Step 4 — Module boundaries
82
+
83
+ This is the part that most affects what an agent produces, because it decides where new code goes. Specify:
84
+
85
+ 1. **The modules**, each with: the business capability it owns, the entities it owns, its public interface (the functions/types other modules may call), and one sentence on what it must never know about.
86
+ 2. **The dependency rule**, stated as a direction, e.g. "feature modules may depend on `core` and `shared`; `core` depends on nothing internal; no feature module imports another feature module's internals — only its public interface"; and where the composition happens.
87
+ 3. **Data ownership** — one module owns each table; cross-module reads go through the owner's interface, not through a join into someone else's tables. Where that rule is relaxed (reporting, admin), say so explicitly.
88
+ 4. **The seams that matter later** — which boundaries are the plausible extraction points, and what makes them cheap (no shared transaction, no direct table access, an interface that could become an HTTP call).
89
+ 5. **Where new code goes by default**, in one sentence per common case, so an agent does not have to decide: "a new endpoint goes in the feature module that owns the entity; a helper used by two features goes in `shared` only after the second use, never on the first."
90
+
91
+ Derive the modules from the domain (bounded contexts from the research and flows), not from technical layers. Modules named `controllers`, `services`, `utils` are layers, and they let anything depend on anything.
92
+
93
+ ## 6. Step 5 — Fitness functions
94
+
95
+ A decision written down and never enforced is documentation, and it decays. For each architectural rule that can be checked mechanically, specify the automated check that enforces it — an architecture test in `check`, failing CI when violated. This is what makes the boundary real across many sessions.
96
+
97
+ Typical set:
98
+
99
+ - Dependency direction: no import from `core` into a feature module; no feature-to-feature internal imports.
100
+ - Layer rules: no database access outside the data layer of the owning module; no HTTP framework types in domain code.
101
+ - Public interface: only the module's index/public file is importable from outside.
102
+ - Entity ownership: no query against a table your module does not own.
103
+ - Contract: API responses match the OpenAPI/schema file; a breaking change without a version bump fails.
104
+ - Whatever else the DRs decided: "every state change emits an event", "no synchronous call to a third party inside a request handler".
105
+
106
+ Name the library or technique per language and verify it exists and is maintained (§10). Where no tool exists, write the rule as a test using the language's own module system, or as a lint rule with an explicit path pattern, and say which.
107
+
108
+ Every ADR that can be enforced carries a **Compliance** line saying how — this is the practice from Richards & Ford's addition to Nygard's original format, and it is the difference between an architecture and a wish.
109
+
110
+ ## 7. Step 6 — The cross-cutting decisions list
111
+
112
+ Walk this list explicitly. Each item is either a DR or one line saying "not applicable, because…". Silence on any of them is a decision the first agent will make for you, differently each time.
113
+
114
+ **Data** — relational vs other, and why; the ownership model; identifiers (sequential vs UUID/ULID, and whether IDs are exposed); soft delete vs hard delete and the audit trail; timestamps and time zone storage rule; money representation (integer minor units, never floats) and currency; migration policy (forward-only, reviewed, reversible how); seed and fixture strategy; retention and deletion (a real requirement when personal data is in scope).
115
+
116
+ **Time and correctness** — synchronous vs queued work and where the boundary is; idempotency strategy for anything externally triggered (payment callbacks, webhooks, retries) and the key it uses; transaction boundaries; what is allowed to be eventually consistent and what is not; concurrency control (optimistic version column vs locking) on contended records; scheduled jobs and how a missed run is handled.
117
+
118
+ **Interfaces** — API style and the contract file as source of truth; versioning policy and what counts as breaking; error shape (a single documented error envelope with codes, not ad-hoc strings); pagination convention; validation location; whether the client is thin or holds state.
119
+
120
+ **Identity and access** — authentication mechanism and session/token lifetime, refresh, and revocation; the role × permission matrix; the object-level authorization rule; how the admin surface is separated; how a session ends everywhere.
121
+
122
+ **Failure** — timeout, retry and backoff policy per external dependency; circuit-breaking or its explicit absence; what degrades vs what blocks; the fallback per integration; what is queued for later vs dropped; how a partial failure of a multi-step operation is recovered.
123
+
124
+ **Operations** — environments and how they differ; configuration and secret loading with fail-fast validation at startup; logging format and levels and the PII redaction rule; metrics and health endpoints; error tracking; backup and restore (including a stated, tested restore procedure — an untested backup is not a backup); deploy and rollback steps; where state lives that is not in the database (uploads, caches) and its durability.
125
+
126
+ **Frontend, when there is one** — rendering strategy (server-rendered / SPA / hybrid) and why, tied to the personas' devices and network; state management approach; data fetching and caching; form/validation approach shared with the backend contract; asset and font loading (a real decision when a locale needs a specific font and a CDN may be unreachable); offline behaviour.
127
+
128
+ ## 8. Step 7 — Technology selection, and how to justify it
129
+
130
+ Only now name technologies. Each choice is scored against the criteria in `research-protocol.md` §6 (weighted for a coding agent as the primary author) **plus** the architecture drivers from §2 — a stack that scores well generically but cannot meet AD-2 loses.
131
+
132
+ Every row of the stack table answers four things, and a row missing any of them is not finished:
133
+
134
+ 1. **What** — the exact package/runtime, with a pinned version, verified this session.
135
+ 2. **Why** — the *deciding* reason, tied to a driver or an agent criterion. Not "popular", not "modern". "Chosen for AD-1: single binary deploy, no runtime to manage" is a reason; "great developer experience" is not.
136
+ 3. **What lost, and what it would have bought** — the runner-up in one clause, and the thing you gave up. This is what stops a future session re-litigating it, and it is the honest part: every choice costs something.
137
+ 4. **Evidence** — `[VERIFIED — S-nn, date]` for the version, maintenance status, license, and any capability claim ("supports RTL", "has a maintained Jalali library", "sandbox available").
138
+
139
+ Also write, because they are the parts that actually prevent hallucination:
140
+
141
+ - **Forbidden choices** — packages and services explicitly not to use, with the reason (archived, unmaintained, license, unreachable from the target market, superseded API). An agent that knows what is banned is much safer than one that only knows what is blessed.
142
+ - **The dependency policy** — adding a package requires a DR entry; the bar for what justifies one; where the boundary is between "use a library" and "write 30 lines".
143
+ - **Version drift rule** — the pinned versions are what the blueprint was verified against; a session that finds a version has moved records it and re-verifies rather than silently upgrading.
144
+
145
+ ## 9. Decision record format
146
+
147
+ One record per decision, in the blueprint's section 4 for cross-cutting decisions and inline in section 12 for architectural ones. Short — a record nobody reads is worse than none. Based on the widely used Nygard/MADR shape plus the compliance line:
148
+
149
+ ```
150
+ ### DR-07 — Idempotency keys on all payment callbacks
151
+ **Status** Accepted — 2026-09-06 · Supersedes: none
152
+ **Drivers** AD-2 (correctness of money handling), AD-5 (recoverability)
153
+ **Context** The gateway may deliver a callback more than once and does not guarantee ordering
154
+ [VERIFIED — S-12, 2026-09-06]. Duplicate processing would double-credit an order.
155
+ **Options** (a) dedupe on gateway transaction ID at the DB level; (b) application-level lock;
156
+ (c) accept duplicates and reconcile nightly.
157
+ **Decision** (a). A unique constraint on `payment.gateway_txn_id` plus an upsert; the handler is
158
+ a pure function of the callback payload.
159
+ **Consequences** Callback handling becomes safe to retry, and replays are free. Cost: the gateway
160
+ transaction ID becomes part of our schema and a gateway change would require a migration.
161
+ Rejected (c) because reconciliation needs a human and this product has none.
162
+ **Compliance** Integration test `payments/callback_replay_test` sends the same callback 3x and
163
+ asserts one payment row and one ledger entry. Runs in `check`.
164
+ **Reversibility** Medium — one-way once production rows exist; migration path noted.
165
+ ```
166
+
167
+ Rules: one decision per record; IDs never reused; a superseded record stays in the document with its status changed and a pointer to the new one, because the record of *why we changed our mind* is often more valuable than the current answer.
168
+
169
+ ## 10. What to research and cite
170
+
171
+ Nothing in this file is a fact about the world; it is a procedure. The facts come from this session's searches, each tagged and logged:
172
+
173
+ 1. **Version, maintenance and license** of every component named — and whether the project is archived, in maintenance mode, or has a deprecation notice on the exact feature you plan to use. Read the page; snippets lie about archived projects.
174
+ 2. **Capability claims** — the specific one you are relying on, from the official docs: RTL support, the locale/calendar library, the driver for your database, the ORM's support for the relation shape your data model needs, the framework's support for the rendering strategy you chose.
175
+ 3. **Framework's recommended architecture** — the official "how to structure a project" guidance for the framework, because the blessed path is where the documentation and the agent's reliability are. Deviating from it is itself a DR.
176
+ 4. **Fitness-function tooling** for the language — a maintained architecture-testing library, or the lint mechanism that will stand in for one.
177
+ 5. **Hosting and runtime reality** — supported runtime versions on the chosen host, build and start commands, database and object-storage options, region reachability from the target market, and what the plan the user can actually buy includes.
178
+ 6. **The current state of the architecture-style discussion** if the blueprint asserts anything about it (the modular-monolith default in §4, service-decomposition thresholds, any "most teams" claim). Cite the year, or drop the claim.
179
+ 7. **Category-specific architectural requirements** — payments (callbacks, reconciliation, PCI-adjacent constraints), messaging platforms (bot API limits, webhook vs polling), mobile stores, anything with an audit requirement.
180
+
181
+ Where a claim cannot be verified, it is `[ASSUMED — reason]` or `[UNKNOWN → OQ-nn]` with a proposed default. Never an unmarked assertion — an unmarked wrong version number in a stack table produces an entire session of code against an API that does not exist.
182
+
183
+ ## 11. Anti-patterns to avoid in the document
184
+
185
+ - **Technology-first justification.** The stack chosen before the drivers, then rationalised. Detect it by asking whether any driver in §2 could have changed the answer; if not, the drivers are decoration.
186
+ - **Resume architecture.** Complexity that serves the builder's interest rather than the product's — a queue with one job, a cache with no measured hot path, services for a single-person team.
187
+ - **"Scalable" as a driver.** Unquantified, so unfalsifiable, so it justifies anything. Replace with numbers from the scale ceiling.
188
+ - **Boundaries with no enforcement.** Modules described in prose and violated in week two.
189
+ - **Deferred decisions.** "We'll decide the auth model when we get there" hands the decision to whichever agent gets there first. Decide, record reversibility, move on.
190
+ - **Both-options prose.** "We could use X or Y" is not a decision. If the choice genuinely depends on an unknown, it is an OQ with a proposed default, not an open sentence.
191
+ - **Copying a reference architecture wholesale** from a blog post for a system three orders of magnitude larger than this one.
192
+
193
+ ## 12. Output into the blueprint
194
+
195
+ - **Section 12.0** — Architecture drivers `AD-n` with targets and ranks, plus the explicit non-drivers.
196
+ - **Section 12.1** — Style decision: candidates, the scoring table, the decision, the exit triggers.
197
+ - **Section 12.2** — Module map, boundaries, dependency rule, data ownership, where-new-code-goes.
198
+ - **Section 12.3–12.9** — Component diagram, data model, API contracts, auth model, integrations, environments/config/secrets, observability, security baseline, performance budgets (as in the template).
199
+ - **Section 12.10** — Fitness functions: the rule, the check, where it runs.
200
+ - **Section 4.2 and inline** — DRs in the §9 format, each naming drivers, losers, consequences, compliance and reversibility.
201
+ - **Section 13** — The stack table where every row carries what/why/loser/evidence, plus forbidden choices and the dependency policy.
202
+ - **Epic 00** — Stories that create the module skeleton and the fitness functions, so the boundaries exist before there is any code to violate them.