@zyaiting/keelson 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +101 -0
  3. package/README_CN.md +101 -0
  4. package/bin/keelson.js +15 -0
  5. package/hooks/codebuddy-session.mjs +67 -0
  6. package/hooks/opencode-session.mjs +65 -0
  7. package/hooks/prompt-state.mjs +66 -0
  8. package/hooks/session-start.mjs +94 -0
  9. package/package.json +64 -0
  10. package/registry/models.json +118 -0
  11. package/registry/platforms.json +92 -0
  12. package/skills/keelson/SKILL.md +44 -0
  13. package/skills/keelson/references/build.md +61 -0
  14. package/skills/keelson/references/context.md +34 -0
  15. package/skills/keelson/references/debug.md +46 -0
  16. package/skills/keelson/references/design-lenses.md +78 -0
  17. package/skills/keelson/references/discover.md +70 -0
  18. package/skills/keelson/references/engineer.md +110 -0
  19. package/skills/keelson/references/frontend-delivery.md +38 -0
  20. package/skills/keelson/references/frontend-interaction.md +31 -0
  21. package/skills/keelson/references/frontend-review.md +33 -0
  22. package/skills/keelson/references/frontend-visual.md +31 -0
  23. package/skills/keelson/references/frontend.md +33 -0
  24. package/skills/keelson/references/handoff.md +43 -0
  25. package/skills/keelson/references/harness.md +54 -0
  26. package/skills/keelson/references/interview.md +120 -0
  27. package/skills/keelson/references/land.md +47 -0
  28. package/skills/keelson/references/model.md +29 -0
  29. package/skills/keelson/references/plan.md +106 -0
  30. package/skills/keelson/references/reconcile.md +61 -0
  31. package/skills/keelson/references/shape.md +86 -0
  32. package/skills/keelson/references/verify.md +64 -0
  33. package/skills/keelson/templates/GLOSSARY.md +5 -0
  34. package/skills/keelson/templates/INTENT.md +22 -0
  35. package/skills/keelson/templates/NOW.md +9 -0
  36. package/skills/keelson/templates/README.md +60 -0
  37. package/skills/keelson/templates/ROADMAP.md +12 -0
  38. package/skills/keelson/templates/change-quick.md +16 -0
  39. package/skills/keelson/templates/change.md +32 -0
  40. package/skills/keelson/templates/delta-spec.md +12 -0
  41. package/skills/keelson/templates/handoff.md +27 -0
  42. package/skills/keelson/templates/ledger.md +3 -0
  43. package/skills/keelson/templates/resident-block.md +7 -0
  44. package/skills/keelson/templates/rules-general.md +10 -0
  45. package/skills/keelson/templates/rules-index.md +5 -0
  46. package/skills/keelson/templates/spec.md +14 -0
  47. package/skills/keelson/templates/tasks.md +9 -0
  48. package/skills/keelson/templates/workflow.md +18 -0
  49. package/skills/zh/keelson/SKILL.md +46 -0
  50. package/skills/zh/keelson/references/build.md +61 -0
  51. package/skills/zh/keelson/references/context.md +34 -0
  52. package/skills/zh/keelson/references/debug.md +46 -0
  53. package/skills/zh/keelson/references/design-lenses.md +78 -0
  54. package/skills/zh/keelson/references/discover.md +70 -0
  55. package/skills/zh/keelson/references/engineer.md +110 -0
  56. package/skills/zh/keelson/references/frontend-delivery.md +38 -0
  57. package/skills/zh/keelson/references/frontend-interaction.md +31 -0
  58. package/skills/zh/keelson/references/frontend-review.md +33 -0
  59. package/skills/zh/keelson/references/frontend-visual.md +31 -0
  60. package/skills/zh/keelson/references/frontend.md +33 -0
  61. package/skills/zh/keelson/references/handoff.md +43 -0
  62. package/skills/zh/keelson/references/harness.md +54 -0
  63. package/skills/zh/keelson/references/interview.md +120 -0
  64. package/skills/zh/keelson/references/land.md +47 -0
  65. package/skills/zh/keelson/references/model.md +29 -0
  66. package/skills/zh/keelson/references/plan.md +106 -0
  67. package/skills/zh/keelson/references/reconcile.md +61 -0
  68. package/skills/zh/keelson/references/shape.md +86 -0
  69. package/skills/zh/keelson/references/verify.md +64 -0
  70. package/skills/zh/keelson/templates/GLOSSARY.md +5 -0
  71. package/skills/zh/keelson/templates/INTENT.md +22 -0
  72. package/skills/zh/keelson/templates/NOW.md +9 -0
  73. package/skills/zh/keelson/templates/README.md +60 -0
  74. package/skills/zh/keelson/templates/ROADMAP.md +12 -0
  75. package/skills/zh/keelson/templates/change-quick.md +16 -0
  76. package/skills/zh/keelson/templates/change.md +32 -0
  77. package/skills/zh/keelson/templates/delta-spec.md +12 -0
  78. package/skills/zh/keelson/templates/handoff.md +27 -0
  79. package/skills/zh/keelson/templates/ledger.md +3 -0
  80. package/skills/zh/keelson/templates/resident-block.md +7 -0
  81. package/skills/zh/keelson/templates/rules-general.md +10 -0
  82. package/skills/zh/keelson/templates/rules-index.md +5 -0
  83. package/skills/zh/keelson/templates/spec.md +14 -0
  84. package/skills/zh/keelson/templates/tasks.md +9 -0
  85. package/skills/zh/keelson/templates/workflow.md +18 -0
  86. package/src/cli.js +87 -0
  87. package/src/commands/ablate.js +96 -0
  88. package/src/commands/ask.js +64 -0
  89. package/src/commands/attest.js +71 -0
  90. package/src/commands/check.js +127 -0
  91. package/src/commands/context.js +95 -0
  92. package/src/commands/design.js +63 -0
  93. package/src/commands/doctor.js +157 -0
  94. package/src/commands/focus.js +84 -0
  95. package/src/commands/guide.js +59 -0
  96. package/src/commands/handoff.js +41 -0
  97. package/src/commands/hook.js +23 -0
  98. package/src/commands/impact.js +58 -0
  99. package/src/commands/init.js +289 -0
  100. package/src/commands/land.js +258 -0
  101. package/src/commands/models.js +62 -0
  102. package/src/commands/new.js +70 -0
  103. package/src/commands/platforms.js +39 -0
  104. package/src/commands/retro.js +114 -0
  105. package/src/commands/status.js +115 -0
  106. package/src/commands/uninstall.js +30 -0
  107. package/src/commands/validate.js +117 -0
  108. package/src/lib/args.js +30 -0
  109. package/src/lib/changes.js +114 -0
  110. package/src/lib/check-activity.js +29 -0
  111. package/src/lib/config.js +102 -0
  112. package/src/lib/decisions.js +59 -0
  113. package/src/lib/evidence.js +127 -0
  114. package/src/lib/fs.js +126 -0
  115. package/src/lib/git.js +353 -0
  116. package/src/lib/glob.js +54 -0
  117. package/src/lib/health.js +113 -0
  118. package/src/lib/lifecycle.js +120 -0
  119. package/src/lib/maintenance.js +66 -0
  120. package/src/lib/markdown.js +438 -0
  121. package/src/lib/models.js +195 -0
  122. package/src/lib/out.js +13 -0
  123. package/src/lib/paths.js +82 -0
  124. package/src/lib/rules.js +27 -0
  125. package/src/lib/runtime-path.js +22 -0
  126. package/src/lib/session.js +100 -0
  127. package/src/lib/specs.js +345 -0
  128. package/src/lib/transaction.js +93 -0
  129. package/src/platforms/index.js +3 -0
  130. package/src/platforms/integration.js +384 -0
  131. package/src/platforms/registry.js +46 -0
  132. package/src/platforms/runtime.js +249 -0
@@ -0,0 +1,106 @@
1
+ # Planning
2
+
3
+ `keelson new <name> --tier quick|spec [--capability a,b] [--touches globs] [--depends other]` scaffolds the change directory and records the owner, branch, and the base of every delta spec. You fill in the artifacts. Plans exist so work survives a session boundary and so a reviewer can reject a slice on its own; they are not a script.
4
+
5
+ ## Where a change sits
6
+ <!-- keelson: id=plan.hierarchy | without: either every task is re-planned from scratch or a three-month file-by-file plan is written that is wrong by week two | sunset: never -->
7
+
8
+ Project goal (`INTENT.md`) → current milestone (`ROADMAP.md → Now`, or the tracker) → a change with a clear boundary (`changes/<name>`) → slices that can be accepted independently (`tasks.md`). Only the last two are files Keelson creates. Near-term work is concrete; later work is a direction and its dependencies, under `ROADMAP.md → Next`. Do not turn an unexplored question into a task with made-up steps.
9
+
10
+ If the project has an issue tracker (`config.yaml → refs.tasks`), it stays the authority for what is wanted and in what order. `change.md` links the issue and holds only what the tracker does not: the decisions, the acceptance mapping, and the continuation state.
11
+
12
+ ## change.md
13
+ <!-- keelson: id=plan.change-md | without: the reasons for a change and its rejected alternatives live only in chat and are lost | sunset: never -->
14
+
15
+ Sections, in order. Quick changes need only **Why**, **What**, and **Acceptance**.
16
+
17
+ - **Why** — the problem or opportunity in 1–3 sentences. Should stand on its own without the solution.
18
+ - **What** — bullet list of changes. A bullet that starts with **BREAKING** marks a breaking change; it needs a **Rollout** section (compatibility window, migration, rollback), and `keelson land` checks for it.
19
+ - **How** — technical approach, the parts a reviewer would want to know. Not a task list.
20
+ - **Alternatives** — only when a material fork actually exists. Record the strongest credible alternative and why it loses. If the project already has a clear precedent and no real fork exists, say `follows <existing pattern>` instead of inventing options to satisfy a template.
21
+ - **Impact** — what you found by reading, not the diff file list. See `context.md`.
22
+ - **Acceptance** — one checkbox per criterion, each with how it is checked: `— test: name`, `— check: \`cmd\``, `— manual: how`, or `— review: what`. This is the map from request to evidence. Any triggered `design-lenses.md` risk that matters to correctness becomes an acceptance/evidence case, not extra prose.
23
+ - **Open questions** — `- question — blocks: <slice>`. Landing refuses while any remain; a question that blocks nothing is a note, not an open question.
24
+ - **Rollout** — only for breaking changes, migrations, or production steps.
25
+ - **Decisions** — capability-local current rationale, present tense. Working assumptions are `- (assumed) capability: …`. A surprising or expensive-to-reverse cross-cutting architecture decision belongs in the project's `refs.decisions` ADR system when present; keep ADRs short and immutable, and supersede rather than rewrite them.
26
+
27
+ ## Route the audit into existing artifacts
28
+ <!-- keelson: id=plan.assumption-routing | without: clarification creates a new diary document, or critical assumptions stay only in chat and disappear across sessions | sunset: never -->
29
+
30
+ The assumption audit is conversational scratch, not another permanent document. Persist only what changes future work:
31
+
32
+ - an explicit outcome or non-goal → `change.md → What`;
33
+ - a working assumption needed to proceed → `change.md → Decisions` as `(assumed)`;
34
+ - a user-owned load-bearing gap that is still unanswered → `change.md → Open questions` with what it blocks;
35
+ - a confirmed observable behaviour → `Acceptance` and, for spec-tier behaviour, the delta spec;
36
+ - a stable term or engineering invariant discovered along the way → `GLOSSARY.md`, a scoped rule, or a fitness check.
37
+
38
+ After landing, temporary questioning disappears with the change scaffolding. Only the current behaviour, durable decisions, rules, vocabulary, and evidence-bearing checks survive.
39
+
40
+ ## Delta specs (spec tier)
41
+ <!-- keelson: id=plan.delta | without: behaviour contracts drift from code because nobody rewrites whole specs | sunset: never -->
42
+
43
+ One file per affected capability at `changes/<name>/specs/<capability>/spec.md`, same capability path as the main specs. `keelson new --capability` creates it with a `base:` stamp; if the main spec changes under you, landing asks you to re-read before `--accept-drift`. Write only the delta:
44
+
45
+ ```markdown
46
+ ## ADDED Requirements
47
+ ### Requirement: Page size limit
48
+ The API SHALL reject `size` above 200 with HTTP 400.
49
+ #### Scenario: Oversized page
50
+ - WHEN a client requests `size=500`
51
+ - THEN the response is 400 with code `size_too_large`
52
+
53
+ ## MODIFIED Requirements
54
+ ### Requirement: Order listing
55
+ (full replacement text of the requirement)
56
+
57
+ ## REMOVED Requirements
58
+ ### Requirement: Legacy CSV export
59
+ ```
60
+
61
+ A capability is logically one behaviour contract, but it does not have to stay one physical file. When the merged contract crosses the configured spec budget, `keelson land` automatically rewrites it as a small `spec.md` index plus `requirements/*.md` and `decisions/*.md` as needed; future deltas still target the capability as one logical spec, and base hashes cover the whole logical contract. Do not manually recombine shards.
62
+
63
+ A spec is a behaviour contract: observable behaviour, inputs, outputs, error conditions, external constraints. If implementation can change without changing what a client sees, it does not belong here. Architecture invariants belong in `rules/` or executable checks. Cross-cutting architecture history belongs in `refs.decisions` ADRs when present; capability-local current rationale may stay in spec decision shards. Link instead of duplicating the same explanation.
64
+
65
+ ## tasks.md and slices
66
+ <!-- keelson: id=plan.tasks | without: work is executed from memory; progress, slices, and effort routing are invisible across sessions | sunset: never -->
67
+
68
+ `tasks.md` is a **mutable execution plan**, not a second acceptance contract. Its checkboxes communicate progress across sessions and help route effort, but `ready` and `land` are decided by acceptance, blockers/assumptions, rollout/compatibility, and fresh verification. If implementation takes a better path, update or delete stale tasks instead of keeping the lifecycle open to satisfy an obsolete plan.
69
+
70
+ Group tasks under `## Slice: <name>` with a `Delivers:` line stating what someone can observe when the slice is done. A quick change usually has one slice and can omit the heading. Each task carries an effort tier and, where possible, a verification command:
71
+
72
+ ```markdown
73
+ ## Slice: Create and access
74
+ Delivers: a link can be created and opens the shared item
75
+ - [ ] 1. Add `POST /shares` (effort: standard) — verify: `npm test -- shares.create`
76
+ - [ ] 2. Render the share page (effort: light) — verify: `npm test -- shares.page`
77
+
78
+ ## Slice: Revoke and expiry
79
+ Delivers: every access path refuses a revoked or expired link
80
+ - [ ] 3. Decide expiry semantics and update `specs/sharing` (effort: deep)
81
+ ```
82
+
83
+ Right-size: a task is the smallest unit a reviewer could reject on its own. Split where a reviewer could accept one half and reject the other. A slice is the smallest unit the owner could accept on its own.
84
+
85
+ ### Slices are vertical
86
+ <!-- keelson: id=plan.tracer-bullet | without: the schema, then the backend, then the frontend are each finished before anything runs end to end, and the mismatch between them is found last | sunset: never -->
87
+
88
+ A slice is one real user action carried through every layer it touches (interface, API, domain, storage, response, test), thin but complete, before the next action is started. The first slice of a feature is the narrowest path that proves the layers fit: for "create issue", the form, the endpoint, validation, the domain object, the row, the response, the rendered result, and one test. Update, delete, and comment come after it runs. `keelson validate` warns when a slice is named after a layer ("database", "backend", "UI"). A layer-shaped task inside a vertical slice is fine; a layer-shaped slice is not.
89
+
90
+ ### Effort tiers
91
+ <!-- keelson: id=plan.effort | without: every task runs on the most expensive model, or the cheapest one handles design decisions | sunset: when retro shows light-tier first-pass rate above 90% for 100 dispatches, relax the light criteria -->
92
+
93
+ - **light** — mechanical, clear boundary, verification is a command: follow an existing pattern, config, renames, running and reporting tests, formatting.
94
+ - **standard** — needs context but the path is clear: most feature code, ordinary bug fixes, per-task review.
95
+ - **deep** — ambiguity, cross-layer effects, design trade-offs, security, unknown root cause: drafting change.md and delta specs, architectural rulings, hard debugging, the final fresh-reader review.
96
+
97
+ Floors from `config.yaml → effort`: reviewers are never below `standard`; planning, final verification, and any ruling are never below `deep`. A reviewer is never a lower tier than the implementer it reviews.
98
+
99
+ ## When requirements change mid-way
100
+ <!-- keelson: id=plan.requirement-change | without: "ok" in chat is the only record; the plan, acceptance, and decisions still describe the old requirement | sunset: never -->
101
+
102
+ Update `change.md` (What, Acceptance, Decisions), the delta spec, and the affected slice in the same turn the owner changes their mind. If the change is now a different change, `keelson cancel` the old one with a reason and start fresh.
103
+
104
+ ## ledger.md
105
+
106
+ Start it with a one-line header. Everything else is appended during build and verify. Entries are `###` headings: `Ruling:`, `Root cause:`, `Verify:`, `Dispatch:`, `Escalate:`, `Note:`. `keelson check --record` writes `Verify:` entries for you, with the worktree fingerprint that makes staleness detectable.
@@ -0,0 +1,61 @@
1
+ # Reconcile and compact
2
+
3
+ Landing a change is not the end of it. Two passes keep the project's knowledge true and small: reconcile writes new stable facts back into current truth, and compact removes what no longer belongs there. These are normal internal Agent duties during RECONCILE, not housekeeping the owner has to request; `keelson doctor` remains a diagnostic view.
4
+
5
+ ## Reconcile: where does each new fact go?
6
+ <!-- keelson: id=reconcile.route | without: the change's facts stay in change.md and chat; the specs, rules, and glossary describe last quarter's system | sunset: never -->
7
+
8
+ Before `keelson land`, and again when reviewing its output, ask for each thing you learned:
9
+
10
+ | The change produced | It goes to |
11
+ |---|---|
12
+ | A new or changed stable behaviour | the capability spec, via the delta (`land` merges it) |
13
+ | A reason that will matter to a future maintainer | the spec's `Decisions` (`land` folds them) |
14
+ | A new term, or a term that now means something specific | `GLOSSARY.md` |
15
+ | A responsibility moved between modules, or a new boundary | the rules scoped to those paths; `refs.architecture` if the project keeps one |
16
+ | A quality target with a number | the spec, as a requirement with a scenario |
17
+ | A constraint that a command can check | `config.yaml → check` (a fitness check); then the prose rule can shrink |
18
+ | A defect that reached verification | a regression test, plus a `Root cause:` in the ledger |
19
+ | Work that is known but not done | the tracker, or `ROADMAP.md → Next`, with an owner |
20
+ | Anything that only mattered during the change | nowhere; it stays in git history with the change directory |
21
+
22
+ Every line above is present tense in its destination. The change directory is scaffolding and is removed; the truth files are what remain.
23
+
24
+ ## Current truth is rewritten, never appended
25
+ <!-- keelson: id=reconcile.rewrite | without: specs become a chronological diary; the reader cannot tell which paragraph describes the system today | sunset: never -->
26
+
27
+ A spec, a rule, or a glossary line says how the system works now. When behaviour changes, the sentence that described the old behaviour is replaced, not followed by "as of September this is now…". The sequence of changes is in git, in the archived or folded change, and in the decision line that names the rejected option. `keelson doctor` flags requirement text that reads like history.
28
+
29
+ ## Compact: keep what is read small
30
+ <!-- keelson: id=reconcile.compact | without: documents grow without bound; the always-on set inflates every session and stale text is read as current | sunset: never -->
31
+
32
+ `config.yaml → budgets` gives each document type a line budget (INTENT, ROADMAP, NOW, GLOSSARY, spec, rule, change, handoff, and the always-on rules as a set). The budget is a **soft compaction threshold**. Keelson automatically reorganizes structure before hot files grow without bound: large specs become a small index plus requirement/decision shards, and runtime caches are pruned. When a single semantic unit is itself too large, the Agent automatically rewrites or decomposes it during RECONCILE and re-verifies the result. Active change/handoff files are temporary scaffolding, so they stay lightweight but do not become durable knowledge stores. The owner is involved only when compaction would change product semantics, authorization, compatibility, or another owner decision.
33
+
34
+ When the soft budget is crossed, run a compaction pass on that document, choosing per paragraph:
35
+
36
+ - **Rewrite** it shorter, present tense.
37
+ - **Split** by capability, scope, or bounded context, when the requirements no longer share a purpose.
38
+ - **Delete** history that git already keeps, and facts nothing depends on.
39
+ - **Move** a constraint to the rule scoped to its paths, or a plan item to the tracker.
40
+ - **Automate** a checkable rule into `config.yaml → check` and shorten the prose to a pointer.
41
+ - **Archive** a change that has stalled (`keelson cancel` with a reason) rather than leaving it half-open.
42
+
43
+ `keelson doctor` also detects duplicated requirements across capabilities, idle/oversized changes, overgrown always-on rules, and stale generated docs. The Agent consumes those signals opportunistically and folds safe cleanup into the current engineering pass; it does not create owner-visible maintenance work unless semantics would change.
44
+
45
+ ## Automatic maintenance is invisible
46
+ <!-- keelson: id=reconcile.automatic | without: the owner is asked to run housekeeping commands, specs become giant monoliths, or cleanup is postponed until it becomes a separate project | sunset: never -->
47
+
48
+ Treat knowledge shape as infrastructure, not user work. When `keelson context` exposes internal maintenance findings, resolve them in the same engineering pass without asking the owner:
49
+
50
+ - **Large specs** — do not summarize away requirements. `keelson land` automatically changes a large capability from one `spec.md` into a bounded index plus `requirements/*.md` and `decisions/*.md`. Total knowledge may grow; each frequently-read file stays small.
51
+ - **Rules** — split by actual path/scope and update `rules/index.md`; merge duplicate rules and replace prose with a fitness check when deterministic. If a single rule remains too broad, rewrite it automatically into the smallest invariant that preserves meaning.
52
+ - **NOW / INTENT** — never shard. Rewrite them automatically as short current-state views; history stays in git.
53
+ - **ADRs / decisions** — one durable decision per ADR when the project uses `refs.decisions`; the directory may grow, but do not inject every ADR into every session. Capability-local decisions are automatically sharded into `decisions/*.md`.
54
+ - **Runtime** — session pointers and evidence logs are caches. Keelson garbage-collects old entries opportunistically from normal commands.
55
+
56
+ Only involve the owner when compaction would change product semantics, authorization, compatibility, or another decision they actually own. File movement, indexing, deduplication, history removal, and cache cleanup are maintenance and happen silently.
57
+
58
+ ## Gardening cadence
59
+ <!-- keelson: id=reconcile.cadence | without: knowledge health is only looked at when it hurts, by which time the cleanup is a project of its own | sunset: never -->
60
+
61
+ The Agent re-evaluates knowledge health during normal context/reconcile cycles and after meaningful landings. Maintenance is incremental and silent: keep each hot document readable continuously instead of scheduling cleanup days or asking the owner to manage the control plane.
@@ -0,0 +1,86 @@
1
+ # Shaping
2
+
3
+ Turn a request or an idea into a shared understanding before artifacts exist. Facts first, then questions, then a write-back. Three layers need to be clear, and not all at once: the project (who it serves, what it will never do, in `INTENT.md`), the current goal (this milestone, in `ROADMAP.md` or the tracker), and this change (what behaviour changes and how anyone will know it is done).
4
+
5
+
6
+ For interface work, load `frontend.md`; visual and interaction acceptance follow `frontend-review.md` and `frontend-delivery.md`.
7
+
8
+ ## Explore first
9
+ <!-- keelson: id=shape.explore-first | without: agent asks the user for facts it could read, wasting their time and training them to skip questions | sunset: never -->
10
+
11
+ Read what answers the question: the code, tests, `INTENT.md`, `ROADMAP.md`, the specs, the matched `rules/`, and the documents listed under `refs` in `config.yaml`. A decision already recorded in a spec's `Decisions` section or in `INTENT.md` is settled; do not ask it again. Only questions about intent, priorities, and trade-offs belong to the user.
12
+
13
+ ## Assumption audit before questions
14
+ <!-- keelson: id=shape.assumption-audit | without: the agent solves a plausible but wrong problem, attributes invented beliefs to the owner, or asks a questionnaire before reading the repository | sunset: never -->
15
+
16
+ When quick work is materially ambiguous, and for every spec change, do a compact audit after reading the repository and before implementation. Do not narrate private chain-of-thought; report only decision-relevant results:
17
+
18
+ 1. **Established** — facts the owner or repository actually states.
19
+ 2. **Required assumptions** — what the proposed path would need to be true but nobody has confirmed. Phrase it as "this plan would require X", never "you assume X".
20
+ 3. **Missing** — information that cannot be learned from the repository; rank it by how much the answer could change the outcome, boundary, acceptance, or an expensive-to-reverse choice.
21
+ 4. **Failure if wrong** — name one likely failure pattern for this class of work: wrong problem, scope creep, compatibility break, unmeasured optimisation, unsafe migration, or another concrete risk.
22
+
23
+ Keep the audit internal except for the facts/assumptions needed in the short write-back. If no missing item is load-bearing, proceed under project authorizations/defaults. If one is load-bearing and user-owned, route it through `interview.md`, ask the single highest-value question, update the write-back, then reassess. Do not expose an audit checklist to the owner.
24
+
25
+ ## Write back your understanding
26
+ <!-- keelson: id=shape.write-back | without: agent builds its own interpretation; mismatches surface after code exists | sunset: never -->
27
+
28
+ For every non-trivial change, before creating anything, state in 3–6 lines: the outcome, the boundaries (what is explicitly out), the constraints you found, and the success check. Separate what the user said from what you assumed. Proceed after the write-back unless the matching `confirm.quick|spec` setting is `wait` or a real owner-owned decision remains unresolved. High-risk actions still follow `INTENT.md → Authorizations`.
29
+
30
+ > Understood as: add offset pagination to `/orders` (`page`, `size`, default 20) using the shared response envelope from `rules/api.md`; table gets a pager, no infinite scroll. Assumed: sort stays by `created_at desc`. Done when `npm test -- orders` passes and the pager renders.
31
+
32
+ ## Four states for what you know
33
+ <!-- keelson: id=shape.decision-states | without: a recommendation the agent made is later treated as something the owner chose, and nobody can tell which | sunset: never -->
34
+
35
+ Keep these apart, in the conversation and in `change.md`:
36
+
37
+ - **Suggestion** — what you recommend, with its consequences. Not in effect until the owner picks it.
38
+ - **Confirmed** — what the owner chose. A plain line under `## Decisions`.
39
+ - **Authorized** — what `INTENT.md → Authorizations` lets you decide alone. Decide, record it as confirmed, move on.
40
+ - **Open** — what still needs an answer. A line under `## Open questions` with `— blocks: <slice>`.
41
+
42
+ When you must proceed without an answer, write the working assumption as `- (assumed) capability: …` under `## Decisions`. `keelson land` refuses to fold assumed lines until the owner passes `--confirm-assumptions`.
43
+
44
+ ## Stop asking when the next slice is deliverable
45
+ <!-- keelson: id=shape.stop-rule | without: agent either exhausts the owner with questions about later slices, or starts building on a slice whose acceptance is undefined | sunset: never -->
46
+
47
+ The bar is not "no unknowns in the project". It is: the next slice has a clear outcome, a boundary, and an acceptance check. Unresolved questions about later slices go under `## Open questions` with what they block, and the work they do not block continues. Example: download permissions undecided, link management list can be built, public download must not be defaulted on.
48
+
49
+ ## Interview (only when the decision frontier requires it)
50
+ <!-- keelson: id=shape.interview | without: architectural ambiguity is silently guessed, or every spec change turns into a mandatory questionnaire | sunset: never -->
51
+
52
+ Use `interview.md` for the interaction protocol. A spec-sized change does **not** automatically require user questions: first resolve repository-owned facts and reversible engineering choices yourself. If the work touches data, security, concurrency, compatibility, error handling/resource lifetime, operations, performance, UI/accessibility, or AI behavior, inspect only the triggered rows in `design-lenses.md` and turn them into decisions or evidence obligations. For failure-path changes, follow its pre-implementation regression step.
53
+
54
+ Run the assumption check internally. Do not open with an abstract "what are we assuming?" question unless the owner truly owns that uncertainty; translate it into the concrete user-visible or risk consequence instead. Explicit "stress-test this" requests continue through the relevant decision tree; ordinary work stops as soon as the next safe slice is ready.
55
+
56
+ ## Authorization
57
+ <!-- keelson: id=shape.authorization | without: either every step waits for approval or the agent decides product questions and production actions by itself | sunset: never -->
58
+
59
+ | Situation | Default |
60
+ |---|---|
61
+ | Local implementation choice inside a confirmed scope, following project conventions | Decide, verify, move on |
62
+ | Intent still vague; the choice changes experience, scope, or a long-term commitment | Recommend with consequences; the owner chooses |
63
+ | Irreversible data operation, production change, permission widening, breaking compatibility | Confirm explicitly, per `INTENT.md → Authorizations` |
64
+ | Unrelated optimisation, extra feature, broad refactor | Suggest; do not widen the change |
65
+ | Environment missing, key acceptance cannot run | Mark blocked or partially verified; never fake a pass |
66
+
67
+ Stronger models widen the first row, never the third.
68
+
69
+ ## When nobody can answer
70
+ <!-- keelson: id=shape.unattended | without: an unattended session either blocks forever on a question or silently lands a change nobody approved | sunset: never -->
71
+
72
+ In a scripted or unattended session there is no one to confirm a write-back or approve a plan. Do not stall, and do not skip the artifacts: write the understanding and the plan, mark assumptions `(assumed)`, build and verify under them, and stop before landing. Say in `NOW.md` that the change awaits review. The reviewer then sees the plan and the diff together and lands with `--confirm-assumptions` or rejects.
73
+
74
+ ## Exploring (the user is thinking, not asking)
75
+ <!-- keelson: id=shape.explore-stance | without: agent forces a proposal on someone who wanted a thinking partner | sunset: never -->
76
+
77
+ If the user is weighing options rather than requesting work, take the thinking-partner stance: read-only, surface multiple directions, sketch trade-offs, offer a grounded recommendation, and let them pick. Keep decisions in the conversation; do not create a change until they say so.
78
+
79
+ ## Sizing rules of thumb
80
+ <!-- keelson: id=shape.sizing | without: agent runs ceremony on trivia or skips planning on contract changes | sunset: when 50 consecutive changes needed no tier override from the user -->
81
+
82
+ - Would the owner want to read a plan before code exists? → spec.
83
+ - Does any `Requirement:` in the specs change, appear, or disappear? → spec.
84
+ - Migration, external dependency, or work that will cross sessions? → spec.
85
+ - Are you abandoning the obvious approach for a hidden constraint? → spec, and record the alternative.
86
+ - Otherwise several files with clear intent → quick. One file, no behaviour change → trivial.
@@ -0,0 +1,64 @@
1
+ # Verifying
2
+
3
+ Readiness/completion is a lifecycle state backed by evidence, and evidence has two properties that fail independently: the record can be invalid (never ran, ran on older code, ran partially) and the content can be invalid (ran, passed, and still did not check what the owner asked for). This reference covers both. It does not get thinner as models improve, because it is about the world, not about judgment.
4
+
5
+
6
+ For interface work, load `frontend.md`; visual and interaction acceptance follow `frontend-review.md` and `frontend-delivery.md`.
7
+
8
+ ## Record validity: `keelson check --record`
9
+ <!-- keelson: id=verify.fresh | without: "should pass" and "looks right" replace running the command; evidence from before the last edit is presented as current | sunset: never -->
10
+
11
+ Before claiming completion, review the configured commands and run `keelson check --trust --record "<claim>"` on first execution. Later identical commands need no new trust flag. The CLI writes signed `ledger.jsonl` envelopes and `evidence/<digest>.log` under the active change. `ledger.md` is a readable summary only; hand-written `Verify:` text cannot authorize landing.
12
+
13
+ The record binds both the full worktree and contracts, including acceptance and decisions. `status` and `land` reject stale, failed, incomplete or untrusted records. A command supplied explicitly is partial unless it exactly covers the configured suite. Complete acceptance before the final check; editing it afterwards invalidates the evidence. If all gates pass, land within the existing authorization. Local signatures do not protect against a process with access to the same user account or prove model attribution.
14
+
15
+ If a check cannot run (environment missing, service down), say so in the ledger as a `Note:` and in `NOW.md → Blocked / uncertain`. Partial verification is reported as partial; it is never rounded up.
16
+
17
+ Checks in `config.yaml → check` may be plain strings or `{name, command, kind}` entries; `kind` is one of `test`, `lint`, `typecheck`, `build`, `fitness`, or `check`. A `fitness` check is an architecture or quality constraint turned into a command (dependency direction, interface compatibility, a latency budget). Mechanical evidence is this whole set passing on the current tree. It is necessary and never sufficient.
18
+
19
+ ## Content validity: does the evidence cover the request?
20
+ <!-- keelson: id=verify.content | without: tests pass and the requirement is still unmet; the implementer's summary is reviewed instead of the owner's request | sunset: never -->
21
+
22
+ Go back to `change.md → Acceptance` and to the original request, not to your own summary of it. For each acceptance item, name the test, command, manual check, or review that covers it, and tick it only when that check has actually run. For each requirement or scenario in the delta spec, name the covering check. Anything uncovered is either checked now or written down as a gap under `NOW.md → Blocked / uncertain`. Then read the diff against the matched rules and the affected specs; a rule violation is a defect even when every test is green.
23
+
24
+ For a bug fix, keep the negative check: with the fix reverted, the regression test must fail. A test that passes both ways proves nothing.
25
+
26
+ For each risk lens that actually triggered during shaping, verify the corresponding obligation rather than re-running a generic checklist: security needs the relevant negative/abuse case, concurrency needs duplicate/order/failure behavior, compatibility needs old-consumer or migration coverage, accessibility needs the affected interaction check, and performance needs a measured target/baseline. If the repository already proves it, reuse that evidence; do not duplicate it.
27
+
28
+ For changes to error handling, cleanup or resource lifecycles, trace the complete entry-to-return path, including finalizers and notifications after cleanup. Inject failures at more than one phase together: an early error must not hide a later required action, and a late error must not silently replace earlier failures. Check which actions ran, which errors escaped, and the state visible both to final observers and to the caller, including pre-existing outer state. Assert error identity/count and any ordering the contract requires; a callback count alone does not establish correct propagation or restoration. Keep additional robustness probes distinct from the owner's stated acceptance criteria.
29
+
30
+ ## Counterfactual evidence for mechanisms that claim a benefit
31
+ <!-- keelson: id=verify.counterfactual | without: the selected design passes its tests, but nobody verifies that the new cache, queue, retry layer, abstraction, model stage, or reviewer actually causes the benefit used to justify its complexity | sunset: never -->
32
+
33
+ Routine product behavior does not need an ablation. Use this only when the rationale for a mechanism is empirical: performance, reliability, cost, quality, safety margin, or another measurable response.
34
+
35
+ Verify the claim against the baseline from `engineer.md`: same representative workload/environment, candidate enabled, candidate disabled or simplified, and the predeclared response/threshold. For reliability mechanisms, inject the failure they claim to handle; for AI/Agent stages, compare the same eval cases with and without the stage.
36
+
37
+ If removing the mechanism does not materially worsen the target, its necessity is unsupported: remove it or record the result as inconclusive rather than preserving complexity because “everything is green.” If two mechanisms may interact, test the smallest useful combinations instead of trusting one-at-a-time removal.
38
+
39
+ Promote stable response thresholds to a fitness check when practical; keep noisy exploratory runs as evidence/ledger notes rather than permanent gates.
40
+
41
+ ## Tests may change; they may not be quietly weakened
42
+ <!-- keelson: id=verify.no-silent-weakening | without: "all green" is achieved by deleting an assertion or skipping a case, and the weakening is invisible in the completion report | sunset: never -->
43
+
44
+ Editing a test is normal when the requirement changed. Deleting an assertion, skipping a case, widening a tolerance, or replacing a real check with a mock is a change to the acceptance criteria: it needs the owner's decision (or an explicit authorization), and it goes into the ledger as a `Ruling:` that names what was weakened and why. A completion report that hides it is wrong.
45
+
46
+ ## Fresh-reader review (spec tier)
47
+ <!-- keelson: id=verify.fresh-reader | without: the author reviews their own work; the same blind spot passes twice | sunset: when 50 consecutive fresh-reader reviews found nothing the per-task reviews missed -->
48
+
49
+ Dispatch a reviewer that has not seen the conversation (tier ≥ `deep` for spec changes), with the original request, `change.md`, the delta specs, and the diff. Ask for: acceptance items without real coverage, requirement gaps, rule violations, risky assumptions, anything a maintainer would object to. Address or ledger each finding. Agreement from a second agent is a signal, not a proof; the acceptance list is what is checked.
50
+
51
+ ## Completion report
52
+
53
+ Tell the user what was done, what the evidence is, and what is left. Shape:
54
+
55
+ ```
56
+ Done: offset pagination on /orders, pager in the table.
57
+ Evidence: `npm test -- orders` exit 0 (14 passed); `npm run lint` exit 0 · tree 5bcb829dae. Acceptance 3/3.
58
+ Open: none. `keelson land add-pagination` succeeded; durable behavior/decisions were folded.
59
+ ```
60
+
61
+ <!-- guided -->
62
+ ## Words that mean you have not verified
63
+ "should", "probably", "seems to", "I believe it works". If you are about to write one of these about a status, run the command instead.
64
+ <!-- /guided -->
@@ -0,0 +1,5 @@
1
+ # Glossary
2
+
3
+ Shared vocabulary for this project: one line per term, the meaning that code, specs, and conversation all use. Add a term when two words start meaning the same thing, or one word starts meaning two things. When a term means something different in another part of the system, name that part and keep both definitions.
4
+
5
+ - … — …
@@ -0,0 +1,22 @@
1
+ # {{project}}
2
+
3
+ ## Why this exists
4
+ One paragraph. The problem this project solves and for whom. If this paragraph is wrong, everything built on it is wrong.
5
+
6
+ ## Boundaries
7
+ - In scope: …
8
+ - Explicitly not: … (write the tempting things you have decided not to do)
9
+
10
+ ## Hard constraints
11
+ - … (runtime, compatibility, performance, security, licensing)
12
+
13
+ ## Authorizations
14
+ What the agent may decide alone, and what it must bring back with a recommendation.
15
+ - Decides alone: local implementation choices inside a confirmed scope; test structure; naming that follows existing patterns.
16
+ - Recommends, owner decides: anything that changes user-visible behaviour, scope, or a long-term commitment; new dependencies; public interface changes.
17
+ - Always confirms: irreversible data operations, production changes, permission widening, breaking compatibility.
18
+
19
+ ## Working defaults
20
+ - Change sizing: auto (the agent decides; override per request with "treat as spec" / "just do it")
21
+ - Quick changes: proceed after write-back
22
+ - Spec changes: wait for approval
@@ -0,0 +1,9 @@
1
+ # Now
2
+
3
+ Nothing in flight.
4
+
5
+ ## Blocked / uncertain
6
+ None.
7
+
8
+ ## Next
9
+
@@ -0,0 +1,60 @@
1
+ <!-- Generated by Keelson; refreshed by `keelson update`. Keep project facts in their owning files, not in this map. -->
2
+ # Keelson project map — {{project}}
3
+
4
+ `.keelson/` holds project facts, contracts, decisions, and change evidence. It grows only when the project has information worth keeping. Agent guidance comes from the installed Keelson package.
5
+
6
+ ## Start here
7
+
8
+ People normally need only two files:
9
+ - **What is happening now?** → `NOW.md`
10
+ - **Why does this project exist / what are its boundaries?** → `INTENT.md`
11
+
12
+ Agents start with `keelson guide workflow` and `keelson guide`, then load individual references as needed. Everything else is maintained on demand; nobody needs to manage Keelson folders as part of normal development.
13
+
14
+ ## Always present after init
15
+
16
+ | Path | Purpose |
17
+ |---|---|
18
+ | `README.md` | This map |
19
+ | `INTENT.md` | Project purpose, boundaries, hard constraints, agent authority |
20
+ | `NOW.md` | Current state, blockers, next concrete step |
21
+ | `config.yaml` | User-controlled Keelson configuration |
22
+ | `manifest.json` | Package-owned install manifest: generated host surfaces Keelson owns |
23
+
24
+ ## Appears only when useful
25
+
26
+ | Path | Created when |
27
+ |---|---|
28
+ | `ROADMAP.md` | The project has a milestone/direction that is not already clear from its tracker |
29
+ | `GLOSSARY.md` | Shared vocabulary becomes load-bearing or ambiguous |
30
+ | `specs/<capability>/spec.md` | A capability has observable behavior worth treating as a contract; it stays a small index when the contract auto-shards |
31
+ | `specs/<capability>/requirements/*.md` | Automatically appears when one capability contract outgrows a single readable file |
32
+ | `specs/<capability>/decisions/*.md` | Automatically appears when capability-local durable decisions grow; one small durable decision file per item |
33
+ | `rules/index.md` + `rules/*.md` | A stable engineering invariant applies to a path and is not better expressed as a check |
34
+ | `changes/<name>/change.md` | Non-trivial work needs a reviewable boundary |
35
+ | `changes/<name>/tasks.md` | The work needs an explicit multi-step / multi-slice plan |
36
+ | `changes/<name>/ledger.md` | A ruling, failure cause, dispatch, or verification event actually happened |
37
+ | `changes/<name>/handoff.md` | Work ownership moves across people/machines or needs an explicit transfer package |
38
+ | `changes/<name>/specs/**` | A spec-sized change modifies behavior contracts |
39
+ | `changes/<name>/decisions.json` | Structured choices and their resolution history are needed |
40
+ | `changes/<name>/ledger.jsonl` + `evidence/` | Signed check records, public signing keys, and content-addressed output are created |
41
+ | `workflow.md` + `skill/` | The owner explicitly selects `--vendor` to copy package guidance |
42
+
43
+ Private keys, command trust, locks, and session focus live outside this directory: in Git's private `keelson-runtime` directory, or a user cache for non-Git projects. Hooks execute from the installed package. Initialization does not edit `.gitignore`; review check logs before sharing them.
44
+
45
+ ## What survives a completed change
46
+
47
+ A completed change should leave **less scaffolding and more truth**:
48
+
49
+ - observable behavior → main specs;
50
+ - durable constraints → scoped rules or executable checks;
51
+ - durable vocabulary → glossary;
52
+ - ordinary session continuation → durable change state + local session focus;
53
+ - explicit ownership transfer → handoff;
54
+ - chronology → git history.
55
+
56
+ Temporary change files fold or archive when work lands. Empty optional artifacts should be deleted rather than kept “just in case”.
57
+
58
+ ## Human reading rule
59
+
60
+ Prefer present-tense current truth. Keelson keeps high-frequency files bounded, auto-shards large specs, and routes internal compaction work to the agent. A person should not need to run housekeeping commands or understand the storage layout to keep working.
@@ -0,0 +1,12 @@
1
+ # Roadmap
2
+
3
+ The current milestone and the direction after it. Near-term work is concrete; later work is direction and dependencies only. If the project has an issue tracker, link it here and keep the authoritative list there.
4
+
5
+ ## Now
6
+ - … (the milestone in progress and what "done" looks like)
7
+
8
+ ## Next
9
+ - … (direction and known dependencies, not tasks)
10
+
11
+ ## Later
12
+ - …
@@ -0,0 +1,16 @@
1
+ ---
2
+ tier: quick
3
+ created: {{date}}
4
+ status: in-progress
5
+ ---
6
+
7
+ # {{title}}
8
+
9
+ ## Why
10
+
11
+
12
+ ## What
13
+ - …
14
+
15
+ ## Acceptance
16
+ - [ ] … — check: `…`
@@ -0,0 +1,32 @@
1
+ ---
2
+ tier: {{tier}}
3
+ created: {{date}}
4
+ status: clarifying
5
+ ---
6
+
7
+ # {{title}}
8
+
9
+ ## Why
10
+
11
+
12
+ ## What
13
+ - Outcome: …
14
+ - Non-goal: …
15
+ - … (a bullet that starts with the word BREAKING in bold marks a breaking change and needs a Rollout section)
16
+
17
+ ## How
18
+
19
+
20
+ ## Impact
21
+ - … (callers, other entry points, data, permissions, compatibility; `keelson impact <files>` gives hints, reading gives the answer)
22
+
23
+ ## Acceptance
24
+ - [ ] … — test: `…`
25
+ - [ ] … — manual: …
26
+
27
+ ## Open questions
28
+ - … — blocks: <slice or task it blocks>
29
+
30
+ ## Decisions
31
+ - {{capability}}: … (present tense; durable rationale only when it will matter later)
32
+ - (assumed) {{capability}}: … (your working assumption; the owner confirms it before landing)
@@ -0,0 +1,12 @@
1
+ # {{capability}} — delta
2
+
3
+ ## ADDED Requirements
4
+ ### Requirement: …
5
+ The system SHALL …
6
+ #### Scenario: …
7
+ - WHEN …
8
+ - THEN …
9
+
10
+ ## MODIFIED Requirements
11
+
12
+ ## REMOVED Requirements
@@ -0,0 +1,27 @@
1
+ ---
2
+ at: {{sha}}
3
+ updated: {{date}}
4
+ by: {{by}}
5
+ ---
6
+
7
+ # Handoff — {{name}}
8
+
9
+ A current-state summary for whoever continues, human or agent. Overwrite it; do not append a diary.
10
+
11
+ ## Goal and confirmed decisions
12
+
13
+
14
+ ## Done
15
+ - … (slices or tasks that are complete and verified)
16
+
17
+ ## Open and blocked
18
+ - … (what is unresolved, and which slice it blocks)
19
+
20
+ ## Ruled out
21
+ - … (assumptions or approaches rejected, with the evidence)
22
+
23
+ ## Next step
24
+
25
+
26
+ ## Verification
27
+ - last `Verify:` … (command, exit code, tree); what has not been checked yet
@@ -0,0 +1,3 @@
1
+ # Ledger — {{name}}
2
+
3
+ Append-only. Entries are `###` headings: `Ruling:`, `Root cause:`, `Verify:`, `Dispatch:`, `Escalate:`, `Note:`. A `Dispatch:` body starts with `Result: pass|fail`; a `Verify:` body names a `command` and `exit N`.
@@ -0,0 +1,7 @@
1
+ <!-- keelson:start -->
2
+ ## Keelson
3
+
4
+ This project is managed by Keelson. Before non-trivial work, run `keelson guide` and follow it.
5
+ For a routed topic, run `keelson guide <reference>`. Use `keelson init --vendor` only when the project needs a checked-in guidance copy.
6
+ Files outside `.keelson/` are discovery adapters only; do not duplicate Keelson guidance here.
7
+ <!-- keelson:end -->
@@ -0,0 +1,10 @@
1
+ # General conventions
2
+
3
+ Rules are feedforward controls. Keep each one or two lines, scoped, and checkable. State what must remain true, not a preferred implementation recipe. If a command can enforce the invariant, put it in `config.yaml → check` and keep the prose as a pointer.
4
+
5
+ ## Before editing
6
+ - Match the surrounding style; do not reformat files you are not otherwise changing.
7
+ - Keep unrelated cleanup out of the current change; record it separately unless it blocks the requested work.
8
+
9
+ ## Checks
10
+ - Run the cheapest relevant check while editing; before completion or landing, `keelson check --record` must pass on the current tree.
@@ -0,0 +1,5 @@
1
+ # Rules index
2
+
3
+ One line per scope: a path glob, an arrow, and the rule file in this directory. The agent reads only the rules whose glob matches the files it is about to touch. Use `**` for rules that always apply.
4
+
5
+ - `**` → general.md — applies to every change
@@ -0,0 +1,14 @@
1
+ # {{capability}}
2
+
3
+ ## Purpose
4
+ What this capability is for, in one or two sentences.
5
+
6
+ ## Requirement: {{name}}
7
+ The system SHALL …
8
+
9
+ ### Scenario: {{scenario}}
10
+ - WHEN …
11
+ - THEN …
12
+
13
+ ## Decisions
14
+ - {{capability}}: … (one line per durable decision, present tense, naming the rejected alternative)
@@ -0,0 +1,9 @@
1
+ # Tasks
2
+
3
+ One checkbox per task, each with an effort tier and, where possible, a verification command. This file is a mutable execution plan: checkboxes communicate progress, but they do not determine whether the change is complete or landable. Group into slices when the work has more than one independently deliverable part; each slice states what someone can observe when it is done.
4
+
5
+ ## Slice: …
6
+ Delivers: …
7
+
8
+ - [ ] 1. … (effort: light) — verify: `…`
9
+ - [ ] 2. … (effort: standard) — verify: `…`
@@ -0,0 +1,18 @@
1
+ # Keelson workflow
2
+
3
+ Project truth and durable work live under `.keelson/`. Machine-local focus, trust and keys live in Git’s private runtime directory; durable signed records and logs stay with each change. A **session is not a task**: it only points at the work item this conversation is currently about.
4
+
5
+ Every non-trivial modifying request follows **ORIENT → BOUND → BUILD → SENSE → RECONCILE**.
6
+
7
+ - **ORIENT** — inspect the worktree and current session focus. Same-goal follow-ups keep the focused change. For “continue”, run `keelson focus --auto`; never bind an ambiguous session silently.
8
+ - **BOUND** — read before asking. Resolve repository facts and reversible engineering choices yourself; ask up to three independent, ready owner decisions at the decision frontier, only when they materially affect the result. Trivial: edit directly; quick: smallest useful change; spec: acceptance + behavior delta + plan. Inspect only risk lenses actually triggered by the work.
9
+ - **BUILD** — one vertical slice at a time. A new independent requested outcome gets a new change; continuing questions about the same outcome do not.
10
+ - **SENSE** — cheap checks early; completion requires fresh `keelson check --record` evidence on the current tree. Task checkboxes describe the current plan; they never decide completion.
11
+ - **RECONCILE** — evaluate lifecycle after each modifying pass from acceptance, blockers, rollout/compatibility, and fresh verification. Before landing, silently perform any internal knowledge maintenance surfaced by context: rewrite singleton current-state docs, split/dedupe rules, and let `land` auto-shard large specs. If gates are satisfied, status becomes `ready` and the agent lands automatically; do not wait for the user to say “done” or expose maintenance ceremony.
12
+ - Ending a session, going idle, compaction, or closing the window changes only session runtime state. It never completes, cancels, or lands durable work.
13
+ - `handoff.md` is reserved for real transfer across people/machines or deliberate ownership change. Normal new sessions reconstruct from change/task/ledger state and optional session focus.
14
+ - Create artifacts lazily. Empty documents are not progress.
15
+ - Repeated failure classes become scoped rules or executable fitness checks; shrink prose after automation carries the invariant.
16
+ - First contact derives `INTENT.md` from repository evidence; ask the owner only if an unresolved project boundary is load-bearing for current work. Specs/rules grow only when real work exposes durable truth.
17
+
18
+ The package router is `keelson guide`. It classifies conversation intent; lifecycle transitions are derived from work state, not user phrasing. A project may vendor it only with `keelson init --vendor`.