@printpractical/cruze 0.0.8 → 0.0.10

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 (152) hide show
  1. package/README.md +17 -13
  2. package/dist/adapters/inbound/cli/cli_context.js +6 -0
  3. package/dist/adapters/inbound/cli/commands/code.js +2 -1
  4. package/dist/adapters/inbound/cli/commands/diff.js +23 -0
  5. package/dist/adapters/inbound/cli/commands/documents.js +1 -1
  6. package/dist/adapters/inbound/cli/commands/show.js +72 -3
  7. package/dist/adapters/inbound/cli/commands/status.js +7 -3
  8. package/dist/adapters/inbound/cli/commands.js +9 -3
  9. package/dist/adapters/inbound/cli/parse_command.js +8 -0
  10. package/dist/adapters/outbound/git_repository.js +49 -7
  11. package/dist/adapters/outbound/project_root.js +13 -0
  12. package/dist/app/ports/repository.js +4 -0
  13. package/dist/app/use_cases/approve_artifact.js +18 -10
  14. package/dist/app/use_cases/check_code.js +5 -3
  15. package/dist/app/use_cases/journal_events.js +6 -2
  16. package/dist/app/use_cases/new_project_doc.js +10 -2
  17. package/dist/app/use_cases/project_status.js +4 -1
  18. package/dist/app/use_cases/run_review.js +10 -2
  19. package/dist/app/use_cases/show_elements.js +18 -0
  20. package/dist/app/use_cases/show_notes.js +11 -0
  21. package/dist/app/use_cases/show_scope.js +17 -1
  22. package/dist/app/use_cases/upstream_diff.js +55 -0
  23. package/dist/domain/approvals/rebase.js +39 -0
  24. package/dist/domain/approvals/upstream_text.js +36 -0
  25. package/dist/domain/check/budget_text.js +43 -6
  26. package/dist/domain/check/check_source.js +20 -3
  27. package/dist/domain/check/decision_comments.js +38 -0
  28. package/dist/domain/config.js +12 -0
  29. package/dist/domain/decision_citations.js +62 -0
  30. package/dist/domain/edits/agents_file.js +15 -1
  31. package/dist/domain/ids.js +3 -1
  32. package/dist/domain/journal.js +16 -3
  33. package/dist/domain/land/merge_plan.js +7 -2
  34. package/dist/domain/line_diff.js +56 -0
  35. package/dist/domain/project/element_lookup.js +124 -0
  36. package/dist/domain/project/living_model.js +2 -1
  37. package/dist/domain/project/notes.js +74 -0
  38. package/dist/domain/project/scope_view.js +20 -4
  39. package/dist/domain/skill_budget.js +36 -0
  40. package/dist/domain/status/next_step.js +52 -7
  41. package/dist/domain/status/pending_rethink.js +22 -0
  42. package/dist/domain/status/verification.js +12 -0
  43. package/dist/domain/status/work_status.js +17 -2
  44. package/dist/domain/validation/decision_rules.js +76 -0
  45. package/dist/domain/validation/delta_rules.js +2 -0
  46. package/dist/domain/validation/future_rules.js +40 -0
  47. package/dist/domain/validation/living_rules.js +2 -0
  48. package/dist/domain/validation/plan_rules.js +1 -1
  49. package/dist/domain/validation/validate_project.js +4 -0
  50. package/dist/domain/validation/vision_rules.js +41 -0
  51. package/dist/domain/versions/rule_versions.js +3 -0
  52. package/dist/main.js +8 -4
  53. package/package.json +1 -1
  54. package/skills/architect/SKILL.md +6 -2
  55. package/skills/architect/feature.md +6 -4
  56. package/skills/architect/project.md +2 -2
  57. package/skills/behavioural-testing/SKILL.md +3 -2
  58. package/skills/behavioural-testing/fakes.md +3 -3
  59. package/skills/build/SKILL.md +3 -2
  60. package/skills/envision/SKILL.md +3 -2
  61. package/skills/envision/feature.md +3 -1
  62. package/skills/envision/intake.md +28 -0
  63. package/skills/envision/possibilities.md +13 -0
  64. package/skills/envision/project.md +5 -3
  65. package/skills/explore/SKILL.md +2 -2
  66. package/skills/formats/SKILL.md +13 -2
  67. package/skills/formats/reference/architecture.md +8 -4
  68. package/skills/formats/reference/config.md +9 -4
  69. package/skills/formats/reference/durable-docs.md +4 -1
  70. package/skills/formats/reference/work-items.md +1 -1
  71. package/skills/formats/templates/vision.md +12 -0
  72. package/skills/grilling/SKILL.md +10 -0
  73. package/skills/hexagonal-design/SKILL.md +2 -2
  74. package/skills/hexagonal-design/languages/rust.md +2 -1
  75. package/skills/hexagonal-design/runtime.md +1 -0
  76. package/skills/land/SKILL.md +6 -2
  77. package/skills/plan/SKILL.md +15 -5
  78. package/skills/plan/tasks.md +4 -4
  79. package/skills/realign/SKILL.md +5 -3
  80. package/skills/realign/notes/0.0.10.md +131 -0
  81. package/skills/realign/notes/0.0.2.md +1 -1
  82. package/skills/realign/notes/0.0.6.md +1 -1
  83. package/skills/realign/notes/0.0.8.md +2 -2
  84. package/skills/realign/notes/0.0.9.md +59 -0
  85. package/skills/realign/notes.md +2 -0
  86. package/skills/research/SKILL.md +3 -2
  87. package/skills/rethink/SKILL.md +6 -4
  88. package/skills/rethink/levels.md +8 -8
  89. package/skills/roadmap/SKILL.md +2 -1
  90. package/skills/roles/SKILL.md +4 -4
  91. package/skills/roles/auditor.md +1 -1
  92. package/skills/roles/code-reviewer.md +5 -4
  93. package/skills/roles/design-reviewer.md +5 -29
  94. package/skills/roles/design-rubric.md +40 -0
  95. package/skills/roles/plan-rubric.md +11 -0
  96. package/skills/roles/surveyor.md +3 -2
  97. package/skills/roles/verifier.md +2 -0
  98. package/skills/triage/SKILL.md +1 -1
  99. package/skills/verify/SKILL.md +3 -3
  100. package/src/adapters/inbound/cli/cli_context.ts +6 -0
  101. package/src/adapters/inbound/cli/commands/code.ts +2 -1
  102. package/src/adapters/inbound/cli/commands/diff.ts +23 -0
  103. package/src/adapters/inbound/cli/commands/documents.ts +1 -1
  104. package/src/adapters/inbound/cli/commands/show.ts +72 -3
  105. package/src/adapters/inbound/cli/commands/status.ts +7 -3
  106. package/src/adapters/inbound/cli/commands.ts +9 -3
  107. package/src/adapters/inbound/cli/parse_command.ts +8 -0
  108. package/src/adapters/outbound/git_repository.ts +49 -7
  109. package/src/adapters/outbound/project_root.ts +13 -0
  110. package/src/app/ports/repository.ts +4 -0
  111. package/src/app/use_cases/approve_artifact.ts +18 -10
  112. package/src/app/use_cases/check_code.ts +5 -3
  113. package/src/app/use_cases/journal_events.ts +6 -2
  114. package/src/app/use_cases/new_project_doc.ts +10 -2
  115. package/src/app/use_cases/project_status.ts +4 -1
  116. package/src/app/use_cases/run_review.ts +10 -2
  117. package/src/app/use_cases/show_elements.ts +18 -0
  118. package/src/app/use_cases/show_notes.ts +11 -0
  119. package/src/app/use_cases/show_scope.ts +17 -1
  120. package/src/app/use_cases/upstream_diff.ts +55 -0
  121. package/src/domain/approvals/rebase.ts +39 -0
  122. package/src/domain/approvals/upstream_text.ts +36 -0
  123. package/src/domain/check/budget_text.ts +43 -6
  124. package/src/domain/check/check_source.ts +20 -3
  125. package/src/domain/check/decision_comments.ts +38 -0
  126. package/src/domain/config.ts +12 -0
  127. package/src/domain/decision_citations.ts +62 -0
  128. package/src/domain/edits/agents_file.ts +15 -1
  129. package/src/domain/ids.ts +3 -1
  130. package/src/domain/journal.ts +16 -3
  131. package/src/domain/land/merge_plan.ts +7 -2
  132. package/src/domain/line_diff.ts +56 -0
  133. package/src/domain/project/element_lookup.ts +124 -0
  134. package/src/domain/project/living_model.ts +2 -1
  135. package/src/domain/project/notes.ts +74 -0
  136. package/src/domain/project/scope_view.ts +20 -4
  137. package/src/domain/skill_budget.ts +36 -0
  138. package/src/domain/status/next_step.ts +52 -7
  139. package/src/domain/status/pending_rethink.ts +22 -0
  140. package/src/domain/status/verification.ts +12 -0
  141. package/src/domain/status/work_status.ts +17 -2
  142. package/src/domain/validation/decision_rules.ts +76 -0
  143. package/src/domain/validation/delta_rules.ts +2 -0
  144. package/src/domain/validation/future_rules.ts +40 -0
  145. package/src/domain/validation/living_rules.ts +2 -0
  146. package/src/domain/validation/plan_rules.ts +1 -1
  147. package/src/domain/validation/validate_project.ts +4 -0
  148. package/src/domain/validation/vision_rules.ts +41 -0
  149. package/src/domain/versions/rule_versions.ts +3 -0
  150. package/src/main.ts +8 -4
  151. package/templates/init/AGENTS.md +1 -1
  152. package/templates/init/config.yaml +5 -4
@@ -21,7 +21,7 @@ Every Cruze document is Markdown that people read and the `cruze` CLI parses. Wr
21
21
  | `.cruze/features/<id>/changes/<NN-slug>/change.md` | One change of a feature: scope, test plan, tasks | plan |
22
22
  | `.cruze/changes/<id>/change.md` | A standalone change, carrying its own deltas | architect (tweak scope) |
23
23
  | `.cruze/config.yaml` | Project configuration | `cruze init`, architect |
24
- | `.cruze/notes/<date>-<slug>.md` | A captured explore note, or research evidence behind an adopt-or-build decision, free-form | explore, research |
24
+ | `.cruze/notes/<date>-<slug>.md` | The user's input, envision's intake and its hand-off, an explore note, or research evidence. Free-form under a title and `- Kind:` (`input`, `intake`, `explore` or `research`) and `- About:` lines, which say the work it informs: `project`, feature slugs, or contexts | the user, envision, explore, research |
25
25
 
26
26
  Only the CLI writes `approvals.json`, `journal.jsonl` and anything under `.cruze/archive/`.
27
27
 
@@ -37,6 +37,8 @@ An ID names one element for its whole life. Other documents cite it, tests carry
37
37
  | Kind | Element | Lives in | Scope |
38
38
  | --- | --- | --- | --- |
39
39
  | `GOAL` | A goal of the product | vision | none |
40
+ | `PRINCIPLE` | A rule every design follows | vision | none |
41
+ | `LATER` | A capability that must stay possible after this release | vision | none |
40
42
  | `CTX` | Bounded context | architecture | none |
41
43
  | `ENT` | Domain concept: aggregate, entity, value object, domain service, policy or domain event | architecture | context |
42
44
  | `UC` | Use case (the application's driving API) | architecture | context |
@@ -54,11 +56,20 @@ An ID names one element for its whole life. Other documents cite it, tests carry
54
56
  ## Elements
55
57
 
56
58
  - A **heading element** is a heading whose text is exactly `<ID>: <Title>`. It extends to the next heading of the same or a higher level.
57
- - A **row element** is a table row whose first cell is exactly an ID. Only goals use rows.
59
+ - A **row element** is a table row whose first cell is exactly an ID. Only the vision's goals, principles and must-stay-possible capabilities use rows.
58
60
  - Element facts are list items of the form `- Key: value`, directly in the element's body. Sub-items hold lists of values.
59
61
  - An element cites another by writing its ID anywhere in its body. Every ID a document mentions counts as cited.
60
62
  - A cited ID must exist, either in the living docs or in a delta of the same feature or change. Design at project scope cites only what it defines; the feature that adds scenarios links them to flows and use cases through `MODIFIED` operations.
61
63
 
64
+ ## Decisions
65
+
66
+ A settled decision is a bullet `D<n>: <decision> (<reason>)` in the architecture's `## Decisions`, a feature or a change. Each document numbers its own from D1, and a feature or change is archived when it finishes, so a number means something only inside the document that records it.
67
+
68
+ - Cite a decision by number only inside that document. The architecture cites its own. A feature cites its own, and a change cites its own and its feature's.
69
+ - A delta's elements merge into the living docs, so they cite only a project decision that the work's own `## Settled decisions` doesn't also number. Write what any other decision settled into the element, or record it as an ADR and cite the ADR.
70
+ - Code comments cite no decision by number. Say what was decided, or cite the element or ADR that holds it.
71
+ - `cruze validate` and `cruze check` report a citation that breaks these rules as `decision-citation`, and `cruze approve` refuses a feature or standalone change whose delta has one (`decision-cited`).
72
+
62
73
  ## Managed content
63
74
 
64
75
  The CLI owns some content so that routine bookkeeping never changes a design:
@@ -4,6 +4,10 @@
4
4
 
5
5
  Template: [../templates/architecture.md](../templates/architecture.md).
6
6
 
7
+ ## Reading it
8
+
9
+ Read the prose sections whole: the Overview, Bounded contexts, Dependency rules, Cross-cutting concerns and Decisions. Reach elements through the CLI. `cruze show --index` lists every element of the architecture and specs on one line, with its status, its module and the work in flight that changes it, and `cruze show --index <context>` lists one context or capability with its scenarios. `cruze show <ID>...` prints the chosen elements' bodies, with each in-flight delta's version beside the living one. The index also gives the architecture's size: under 6,000 words, read it whole instead. One project's architecture held 52k words, and an architect run read all of it to find the few elements it would extend.
10
+
7
11
  ## Sections
8
12
 
9
13
  The document has these `##` sections, in this order. Each holds elements of one kind as `###` heading elements, plus any `VIEW` diagrams that summarize them. A section with no elements yet keeps its heading and a one-line note.
@@ -32,10 +36,10 @@ Facts are `- Key: value` items. Keys marked required must be present; the others
32
36
  | `CTX` | `Purpose` | `Depends on` (context IDs, with what is used) |
33
37
  | `ENT` | `Kind` (`aggregate`, `entity`, `value`, `service`, `policy` or `event`), `Module`, `File` | `Invariants`, `Relationships`, `States` (for state machines) |
34
38
  | `UC` | `Input`, `Output`, `Errors`, `Uses`, `Module`, `File` | `Serves` (REQ IDs) |
35
- | `PORT` | `Direction` (`driven` or `driving`), `Operations`, `Module`, `File` | `Implemented by`, `Future` |
39
+ | `PORT` | `Direction` (`driven` or `driving`), `Operations`, `Module`, `File` | `Implemented by` |
36
40
  | `ADP` | `Implements` (a driven port) or `Drives` (use cases), `Technology`, `Module`, `File` | `Adopts` (library and adopt-or-build reason), `Format` (the stored or wire format it owns, or where its schema lives) |
37
41
  | `FLOW` | `Elements`, a Mermaid `sequenceDiagram` | `Serves` (SCN IDs, once they exist), `Failure paths` |
38
- | `MOD` | `Path` (a directory ending in `/`, or one file; list several in backticks, never a glob), `Layer` (`core`, `domain`, `application`, `adapter` or `composition`) | |
42
+ | `MOD` | `Path` (a directory ending in `/`, or one file; list several in backticks, never a glob, including every file the module owns outside its directory, such as a build script), `Layer` (`core`, `domain`, `application`, `adapter` or `composition`) | |
39
43
  | `RULE` | one or two sentences of rule | `Enforced by` (config layer names) |
40
44
  | `XC` | prose | |
41
45
 
@@ -45,7 +49,7 @@ Rules for facts:
45
49
  - `File` names the real source path, one per element, with sub-items when an element spans files. Every element with code has one: an element without a file cannot be built, checked or reviewed.
46
50
  - `Operations` lists each operation as a sub-item with its signature in the project's language, then its contract: what it guarantees, its failure cases and who owns cleanup.
47
51
  - `Relationships` sub-items read `<verb> <ID> (<cardinality>)`, for example `- has one ENT-inventory.console-path (1)`.
48
- - `Future` records a seam kept open for a later release and the element it will need, so later features extend the design rather than rework it.
52
+ - `Future`, on any element, records a seam kept open for later and what it will need, so later features extend the design rather than rework it. It names the need it serves: the vision's `LATER` capability, by ID, so a change to that capability makes the design stale, or the feature on the map or the roadmap, by slug. `cruze validate` warns `future-unanchored` when it names neither.
49
53
  - Add another fact when it helps a reader, such as `Failure attribution` on an adapter. The CLI checks the listed facts and ignores the others.
50
54
  - An element that grows over several features, such as the CLI adapter gaining a command per feature, gets a `MODIFIED` operation in each feature that extends it. Its status goes back to `planned` when that feature's first change lands, and to `built` when the change that builds the new text lands.
51
55
  - The CLI adds `- Status: planned` to a new element and flips it to `built` when a landed change builds it. Leave it out of what you write.
@@ -73,7 +77,7 @@ A feature, or a standalone change, proposes architecture edits in its `## Archit
73
77
  - Reason: telnet support was dropped from the release scope
74
78
  ```
75
79
 
76
- - `ADDED` introduces an ID that doesn't exist yet. `MODIFIED` replaces an existing element's whole body. `REMOVED` retires an ID and needs a `Reason`.
80
+ - `ADDED` introduces an ID that doesn't exist yet. `MODIFIED` replaces an existing element's whole body. `REMOVED` retires an ID and needs a `Reason`. Once it merges, no living doc may cite the ID, so modify each element that cites it to describe it in words.
77
81
  - The element kind decides its section. `land` appends an added element to the end of its section.
78
82
  - A delta never touches `Status`. A change's `Builds` scope decides what becomes built.
79
83
  - A delta with no operations says `None.` under its heading.
@@ -13,8 +13,8 @@ source: ["src/**/*.rs"]
13
13
  tests: ["src/**/*.rs", "tests/**/*.rs"]
14
14
 
15
15
  check:
16
- max_lines: 250
17
- max_types: 5
16
+ max_lines: 600
17
+ max_types: 12
18
18
  exceptions:
19
19
  - path: src/cli/args.rs
20
20
  reason: the clap derive struct lists every flag in one place
@@ -37,6 +37,10 @@ changes:
37
37
  - item: 2026-09-25-open-console/02-ssh-hops
38
38
  reason: every scenario runs through one reconcile, which can't be split without building it twice
39
39
 
40
+ references:
41
+ - path: third_party/rfc4254.txt
42
+ use: the SSH connection protocol every hop speaks; channels and their failures must follow it
43
+
40
44
  layers:
41
45
  - name: inventory-domain
42
46
  paths: ["src/inventory/domain/**"]
@@ -55,9 +59,10 @@ layers:
55
59
  | `tracker` | Where work items live. `markdown` is the only value in V1. |
56
60
  | `source` | Globs of the source files `cruze check` inspects. |
57
61
  | `tests` | Globs of the files `cruze trace` searches for scenario IDs. |
58
- | `check.max_lines` | Line budget per source file. Test files outside `source` have no budget, and a Rust file's `#[cfg(test)]` modules don't count. |
59
- | `check.max_types` | Budget of top-level types per source file. |
62
+ | `check.max_lines` | Line budget per source file, a backstop against a file that has outgrown one responsibility. `cruze init` sets `600`. Test files outside `source` have no budget, and a Rust file's `#[cfg(test)]` modules don't count. |
63
+ | `check.max_types` | Budget of top-level types per source file. `cruze init` sets `12`. |
60
64
  | `check.exceptions` | Files allowed past a budget, or Rust test files allowed under `src/` (`test-placement`), each with a `path` and a `reason`. `realign` adds entries whose reason ends `scheduled in <ref>`, and landing that change removes them. |
65
+ | `references` | External documents the design must comply with, such as a protocol specification or a standard, each with its `path` in the repository and its `use`: what it governs. Optional. `cruze show` lists them, and architect, plan, build and the reviewers read the parts their scope relies on and cite them, such as `RFC 4254 §5.2`, in the design. |
61
66
  | `layers` | Each layer has a `name`, the `paths` it covers, and `may_import`, the layers it may depend on. |
62
67
  | `commands` | The project's commands by name, such as `test` or `run`. The walking-skeleton change fills them in, and `cruze land` copies them into the Commands section of `AGENTS.md`. When the suite has a slow tier, such as UI, device or end-to-end tests, `test` runs only the fast tier and `test_full` runs everything. The full suite is `test_full` when it is set, and `test` otherwise. |
63
68
  | `review.command` | The program and arguments `cruze review` runs to start an agent in a fresh context, with the prompt on standard input. Optional. `cruze init` sets it for Claude Code to run in print mode, allowed to read the project and run `git diff`, `git log`, `git show` and `cruze`. The verifier runs the system, so add the project's build and run commands. When it is unset, or its program isn't installed, `cruze review` hands the role's prompt back to the calling agent to run in a helper. |
@@ -4,7 +4,7 @@ Templates: [../templates/vision.md](../templates/vision.md), [../templates/gloss
4
4
 
5
5
  ## docs/vision.md
6
6
 
7
- What the product is for. At most one page, excluding the feature map.
7
+ What the product is for, and the intent every design answers to, for the product's whole life. Problem through Constraints fit on one page. The Principles and Must stay possible tables don't count against it: each row holds as much as its intent needs, and `Leave room for` keeps every need, one clause each, so no step has to guess what was meant.
8
8
 
9
9
  | Section | Holds |
10
10
  | --- | --- |
@@ -13,8 +13,11 @@ What the product is for. At most one page, excluding the feature map.
13
13
  | `## Goals` | Table of ID, Goal and Measure. Each goal is a row element with a `GOAL-<name>` ID, and its measure says how you would know it's met |
14
14
  | `## Non-goals` | What the product deliberately doesn't do, one bullet each with the reason |
15
15
  | `## Constraints` | Platforms, languages, dependencies, performance, security and legal limits, one bullet each |
16
+ | `## Principles` | Table of ID, Principle and Why. Each is a row element with a `PRINCIPLE-<name>` ID: a rule every design follows, such as "state is the truth; events are hints". A design that departs from one amends it here first |
17
+ | `## Must stay possible` | Table of ID, Capability, Likelihood, Why and Leave room for. Each is a row element with a `LATER-<name>` ID: a capability the product may need after this release. Likelihood is `likely` or `possible`. Leave room for says what no design may close off, never how to build it. A design that keeps a seam open for one cites it in a `Future` fact |
16
18
  | `## Feature map` | Managed. `### Implemented` is a table of Feature, Release and Summary. `### Future` is a table of Feature, Summary and Goals |
17
19
 
20
+ - Principles and capabilities that must stay possible live here, not in a feature's settled decisions, which are archived when the feature lands. A project with none writes `None.` under the heading.
18
21
  - Feature-map entries are named by slug, such as `jump-hosts`. A future entry gets a folder ID only when its feature starts.
19
22
  - Only the CLI writes the feature map. `cruze features add` puts an entry on the future list, `cruze features update` corrects an entry's summary on either list, `cruze features drop` removes one from the future list, and `land` moves a finished feature to implemented, tagged with the release in progress.
20
23
 
@@ -48,7 +48,7 @@ These rules close the gap between a design and what gets built. `cruze validate`
48
48
  - The first change of a feature to land merges the feature's whole delta, so the living docs never cite something a later change hasn't merged yet. What this change delivers or builds becomes `built`. Everything else arrives as `planned`, including a `MODIFIED` element whose new text isn't built yet. Each later change flips what it builds to `built`.
49
49
  - A `REMOVED` operation applies when the change whose scope lists it under `Removes` lands.
50
50
  - Under a `MODIFIED` requirement, a scenario must be in some change's scope when it is new or its text changed. An unchanged scenario the requirement keeps needs no change.
51
- - If someone else edits an element after this feature merged it, the next land refuses with a conflict instead of overwriting their edit. Resolve it with `rethink`.
51
+ - If someone else edits an element after this feature merged it, their edit stands: while the feature's delta entry for that element is unchanged, later lands keep the living text, and approving the feature needs no rebase. When the feature's delta changes that element again, `cruze approve` refuses with `rebase-required` and `cruze land` with a conflict, rather than overwrite the edit. Resolve it with `rethink`.
52
52
  - The `Changes` table and each change's `Scope` agree. `plan` copies the row into the change and refines it; a disagreement is a validation error.
53
53
 
54
54
  ## Test plan
@@ -22,6 +22,18 @@
22
22
 
23
23
  - <Platform, language, dependency, performance, security or legal limit.>
24
24
 
25
+ ## Principles
26
+
27
+ | ID | Principle | Why |
28
+ | --- | --- | --- |
29
+ | PRINCIPLE-<name> | <A rule every design follows, such as "state is the truth; events are hints".> | <Why it holds, in the user's words.> |
30
+
31
+ ## Must stay possible
32
+
33
+ | ID | Capability | Likelihood | Why | Leave room for |
34
+ | --- | --- | --- | --- | --- |
35
+ | LATER-<name> | <A capability the product may need after this release.> | <likely or possible> | <Why the user may want it.> | <What no design may close off. Never how to build it.> |
36
+
25
37
  <!-- cruze:managed -->
26
38
  ## Feature map
27
39
 
@@ -71,8 +71,18 @@ When the user steers toward something that breaks a principle, an accepted ADR o
71
71
 
72
72
  Be direct and precise, peer to peer. Challenge only with a specific reason, and never agree without thinking.
73
73
 
74
+ ## Long-term intent
75
+
76
+ The vision's `## Principles` and `## Must stay possible` hold what the product answers to beyond the work in hand. A step's own decisions are archived with its work, so long-term intent recorded there is lost. One project's "eventually" answers all went into feature decisions, and were archived with them.
77
+
78
+ - **The user names something the product may need later,** in an answer or an aside, with words such as "eventually", "in the future" or "one day": propose a `LATER` row for it, with its likelihood, why, and what no design may close off. Ask it in the round.
79
+ - **A decision touches a capability area:** once per area, ask about what it may grow into, as `.agents/skills/cruze-envision/possibilities.md` describes, unless the vision already records it.
80
+ - **A decision departs from a `PRINCIPLE`:** name the principle, and ask whether it changes for the whole project. When it does, amend its row, with the new reason, before you record the decision. When it doesn't, the decision changes. Never record a decision that contradicts a principle the vision still states.
81
+ - **Record it in the vision.** Edit `docs/vision.md` as the answers settle, show the user the rows that changed, and once they confirm, they approve it with `cruze approve vision`. A design that cites a row goes stale when it changes, and its next step re-checks it.
82
+
74
83
  ## Recording
75
84
 
76
85
  - Record each decision as soon as it settles, not at the end.
86
+ - Principles and capabilities that must stay possible go in the vision, as "Long-term intent" says, whatever step you are in.
77
87
  - The workflow step names the document. Features and changes keep decisions in `## Settled decisions` as `D<n>: <decision> (<reason>)`. At project scope, the vision keeps goals, non-goals and constraints in their own sections, and other project decisions go in the architecture's `## Decisions` as `D<n>` lines. A decision that passes the ADR test becomes an ADR.
78
88
  - Put a term in the glossary the moment it settles, following `.agents/skills/cruze-domain-language/SKILL.md`.
@@ -89,8 +89,8 @@ Layers are dependency boundaries, not runtime hops. A port can be a plain functi
89
89
  ## Many small modules
90
90
 
91
91
  - Give each responsibility its own module, grouped by domain concept, with the hexagonal roles inside. A context's core is usually one module, with each port beside the use cases that define it, and grows submodules by concept, not by layer. A file may hold a few closely related types.
92
- - When a file passes its budget (`check:` in `.cruze/config.yaml`, enforced by `cruze check`) or gains a second responsibility, split it into a submodule named for what it owns.
93
- - A budget is a prompt to look for a second responsibility, never a shape to write code to. Write the code as you would with no budget: no type alias, string where an error type belongs, merged types or function moved away from its owner to stay under a limit. When a file over budget holds one responsibility, such as the related types of one grammar, list it under `check.exceptions` with that reason.
92
+ - When a file gains a second responsibility, split it into a submodule named for what it owns. Never split a file by length: one that grows with its one responsibility stays whole.
93
+ - The budgets (`check:` in `.cruze/config.yaml`, enforced by `cruze check`) are a backstop against a file that has outgrown one responsibility, never a shape to write code to. Write the code as you would with no budget: no type alias, string where an error type belongs, merged types or function moved away from its owner to stay under a limit. When a file over budget holds one responsibility, such as the related types of one grammar, list it under `check.exceptions` with that reason.
94
94
  - Entry-point and namespace files, such as `main`, `lib.rs`, `mod.rs` and `index.ts`, hold only wiring and declarations.
95
95
  - Don't create generic modules such as `utils`, `helpers`, `common`, `services`, `models`, `types` or `manager`. Shared behaviour belongs with the concept that owns it.
96
96
  - Duplication is semantic. Two implementations of one rule are duplication even when the text differs, so consolidate them in the owner, not in a helper.
@@ -25,12 +25,13 @@ These add to the hexagonal design rules for Rust projects. The module map decide
25
25
  - Put what differs between similar failures in fields, such as `TooLarge { subject: Subject, size: usize, limit: usize }`, rather than `BatchTooLarge`, `MutationTooLarge` and `SetTooLarge`.
26
26
  - A match arm that can only be `unreachable!`, or an `expect` on an error the caller has ruled out, means the callee returns too wide a type: narrow it.
27
27
  - `anyhow` belongs only in the composition root and binaries, where no caller inspects the error. Never return it from a port or a domain function.
28
- - No `unwrap`, `expect` or `panic!` for conditions that can happen in production. Tests may use them.
28
+ - No `unwrap`, `expect` or `panic!` for conditions that can happen in production, including those a caller, the clock or a concurrent call can reach, such as an overflow from a huge timeout or a call racing `shutdown`. For each `expect`, be able to name what rules its case out. Tests may use them.
29
29
 
30
30
  ## Async and concurrency
31
31
 
32
32
  - Use Tokio when the project needs async. Keep the domain synchronous.
33
33
  - Call async functions directly. Spawn a task only when it owns a resource, runs concurrently, handles events or isolates failure, and give every long-lived task an explicit shutdown.
34
+ - Run a test of a race on `#[tokio::test(flavor = "multi_thread")]` with the racing work spawned, since the default runtime runs one task at a time.
34
35
  - Prefer ownership and borrowing over shared synchronization. Use a channel when one task owning the state makes things simpler, and a `Mutex` when shared state is simpler. Don't build an actor only to avoid a lock.
35
36
 
36
37
  ## Dependencies and tooling
@@ -29,6 +29,7 @@ Every long-lived, mutable, stateful or exclusive resource has one named owner. T
29
29
  - Technical retry and backoff live in an outbound adapter. Whether an operation is safe to repeat, and the use case's deadline, are part of the core contract.
30
30
  - Never retry non-idempotent work blindly, and never stack retries at several layers.
31
31
  - Stopping a wait, dropping a future, requesting cancellation, ending a task and cancelling remotely are different events. Say which one an operation promises, what effects may remain, and how completion is observed.
32
+ - In a use case that writes to storage, update the in-memory state right after the durable step and before any later await, so a cancelled call leaves the old state or the new one whole.
32
33
  - When a caller needs a guaranteed or fallible finish, give it an explicit `close` or `shutdown` operation. Destruction alone can't report failure.
33
34
 
34
35
  ## Cross-cutting infrastructure
@@ -15,7 +15,7 @@ Land makes finished work part of the living model. `cruze land` merges the chang
15
15
  - When an `approvals.json` conflicts, take main's version of it. Then run `cruze status`, and re-approve what it shows stale, as step 3 describes.
16
16
  - Resolve code conflicts as usual, then run the full suite. When main came in without code conflicts, leave the full suite to CI.
17
17
  3. **Run `cruze status`.** When the change or its feature shows `upstream changed`, another branch landed changes to elements it cites. Then:
18
- - Show the user the diff of each changed element, and check that the change's code and tests still hold against it.
18
+ - Run `cruze diff <ref>` for each, show the user the diff of each changed element, and check that the change's code and tests still hold against it.
19
19
  - When they still hold, re-approve the stale documents: the feature first, then the change. The change's verification carries over when its own design didn't change.
20
20
  - When they don't hold, stop and offer `rethink`.
21
21
  4. **Run `cruze land`** and quote its report: what it merged, what is now built, and whether the work finished and was archived.
@@ -24,7 +24,11 @@ Land makes finished work part of the living model. `cruze land` merges the chang
24
24
  - A `merge-invalid` means the merged docs, or the feature and changes being landed, wouldn't validate, such as a decision citing an ID the change removes. Nothing was written. Stop and run `rethink`.
25
25
  5. **Update the changelog.** Under `## [Unreleased]` in `CHANGELOG.md`, add one line per user-visible behaviour the change delivers, in the user's words, under `### Added`, `### Changed` or `### Removed`. Name the behaviour, not the code, including any rule a user can now run into that no scenario covers yet.
26
26
  6. **Update the README** when the change altered how someone installs, runs or uses the product. Run every command you add, to check it works.
27
- 7. **Check the pitfalls.** Run `cruze journal list --event disposition --all --text | grep -i "<rubric item>"` for each rubric item this change's findings named, and `cruze journal list --event rethink --all` and `cruze journal list --event bug --all`; `--all` includes landed work, which the default leaves out. When findings under the same rubric item with the same root cause, or two defects with the same cause, have now happened twice, add one line under `## Known pitfalls` in `AGENTS.md` saying what to do instead. Keep `AGENTS.md` under one page. When the pitfalls outgrow it, propose to the user a `cruze check` rule or a knowledge-skill change for the oldest ones.
27
+ 7. **Check the pitfalls.** Run `cruze journal list --event disposition --all --text | grep -i "<rubric item>"` for each rubric item this change's findings named, and `cruze journal list --event rethink --all` and `cruze journal list --event bug --all`; `--all` includes landed work, which the default leaves out. When findings under the same rubric item with the same root cause, or two defects with the same cause, have now happened twice, sort the lesson by what it is about:
28
+ - **This product:** its domain, its code's own conventions, or a tool or service only it uses, such as "an `ApiError` prints `<Code>: <message>`". Add one line under `## Known pitfalls` in `AGENTS.md` saying what to do instead.
29
+ - **Cruze's workflow, or practice that holds in any project:** how a delta, plan, task, test plan or review is written, or a rule of the language or its tooling, such as "a task lists the file that declares each new file". Record it with `cruze journal add lesson --set summary="<what happened twice>" --set instead="<what to do instead>" --set step=<the step that should have prevented it>`, and leave `AGENTS.md` alone: every session reads it, and `cruze feedback export` takes the lesson to Cruze, where the step itself gets fixed.
30
+
31
+ Keep `AGENTS.md` under one page. When the pitfalls outgrow it, propose to the user a `cruze check` rule or a knowledge-skill change for the oldest ones.
28
32
  8. **Commit** the land with a message such as `docs: land <change>`. `cruze land` keeps the Commands and Layout sections of `AGENTS.md` current, from `commands:` in `.cruze/config.yaml` and the built modules; when `commands:` is empty, the Commands section stays as it was.
29
33
  9. **Get it onto main.** Follow the project's convention in `AGENTS.md`. When it has none, ask the user whether they want pull requests or direct merges, and add their answer under `## Conventions`, such as "Changes land through pull requests." Open the pull request, or merge. CI must pass before the merge; when the project has no CI runner, run its steps locally with the project's commands.
30
34
 
@@ -19,14 +19,14 @@ Plan turns one designed change into work an implementer can do without guessing:
19
19
  - `.agents/skills/cruze-behavioural-testing/SKILL.md`
20
20
  - `.agents/skills/cruze-hexagonal-design/SKILL.md`, and its language file when one exists for the project's language
21
21
  - `.agents/skills/cruze-formats/reference/work-items.md`
22
- 6. **Read the design it builds.** Run `cruze show <ref>` and read its output: the full body of every element in the scope, every scenario it delivers, the settled decisions and the ledger. Read an element it lists as cited only when a task will call it, from the place it names. Don't read `docs/architecture.md` or `feature.md` whole: two projects read a 40k-word architecture about 150 times each.
22
+ 6. **Read the design it builds.** Run `cruze show <ref>` and read its output: the full body of every element in the scope, every scenario it delivers, the settled decisions, the ledger and the references. Read an element it lists as cited only when a task will call it, with `cruze show <ID>`. Don't read `docs/architecture.md` or `feature.md` whole: two projects read a 40k-word architecture about 150 times each.
23
23
  7. **Check for overlap.** Run `cruze status --overlap --change <ref>`. For each change on another branch that touches the same elements, tell the user which elements are shared and which change should land first. Record the answer under `## Risks`.
24
24
  8. **Write the test plan.** Follow [test-plan.md](test-plan.md). Done when every delivered scenario has a `behaviour` row and every port a built adapter implements has a `contract` row.
25
25
  9. **Write the tasks.** Follow [tasks.md](tasks.md). Done when every scope ID is proved by a task and every task line matches the grammar.
26
- 10. **Record decisions and risks.** Put task-level choices you made under `## Settled decisions`. Under `## Risks`, name the riskiest task and how its test catches the failure. Remove every template guide.
26
+ 10. **Record decisions and risks.** Put task-level choices you made under `## Settled decisions`. Under `## Risks`, name the riskiest task and how its test catches the failure. Open each check you name and confirm it reaches the failure: the test asserts the value at risk rather than one a clamp or default hides, the lint is enabled, and the command prints what you say it shows. When no check does, name a review of the diff. Remove every template guide.
27
27
  11. **Validate.** Run `cruze validate`. Done when it reports no errors for the change.
28
- 12. **Review the plan.** Commit the plan, then run the review in `.agents/skills/cruze-roles/SKILL.md` with the design reviewer and its plan rubric, `review=plan`, and `--item <ref>`.
29
- 13. **Approve.** Run `cruze approve <ref> --by-agent` on this branch and quote its result. The plan carries no design of its own, so once its review has closed, with no blocker open and a disposition for every finding, you approve it for the user. The approval binds the change to the branch. When it refuses with `plan-review-open`, do what it names. When it refuses with `size-unaccepted`, the plan has more tasks than `changes.max_tasks`: split the change through `rethink` at feature level, or, when the user accepts the size, list the change under `changes.exceptions` in `.cruze/config.yaml` with their reason and approve again. A blocker still open after round 2 goes to the user, and once they decide it, they approve the plan themselves with `cruze approve <ref>`.
28
+ 12. **Review the plan.** Commit the plan, then run the review in `.agents/skills/cruze-roles/SKILL.md` with the design reviewer and its plan rubric, `.agents/skills/cruze-roles/plan-rubric.md`, `review=plan`, and `--item <ref>`.
29
+ 13. **Approve.** For a feature's change, run `cruze approve <ref> --by-agent` on this branch and quote its result. The plan carries no design of its own, so once its review has closed, with no blocker open and a disposition for every finding, you approve it for the user. A standalone change, such as the walking skeleton or a prefactor, carries its own design, so show the user the plan and ask them to approve it with `cruze approve <ref>`. The approval binds the change to the branch. When it refuses with `plan-review-open`, do what it names. When it refuses with `size-unaccepted`, the plan has more tasks than `changes.max_tasks`: split the change through `rethink` at feature level, or, when the user accepts the size, list the change under `changes.exceptions` in `.cruze/config.yaml` with their reason and approve again. A blocker still open after round 2 goes to the user, and once they decide it, they approve the plan themselves with `cruze approve <ref>`.
30
30
  14. **Commit** with a message such as `docs: plan <change>`.
31
31
 
32
32
  ## When the plan needs design
@@ -40,6 +40,16 @@ Stop planning when you find you need any of these:
40
40
 
41
41
  Say what is missing and why, then send the change to `rethink` at feature level. For a standalone change, that means its own deltas. Never add design to `change.md`.
42
42
 
43
+ ## A prefactor
44
+
45
+ A prefactor changes structure, not behaviour, so it delivers no scenarios and its tasks have no red step. The tests that already reach what it rebuilds are its safety net. Its plan differs in three places:
46
+
47
+ - **Test plan:** no `behaviour` row. Keep the `contract` row of each port a rebuilt adapter implements, naming its existing test file.
48
+ - **Risks:** list the existing test files that reach each element it rebuilds, and the command that runs them. They pass before the first task and after every task, and no task edits them. When nothing reaches an element, the first task pins its current behaviour with a test that passes from the start.
49
+ - **Tasks:** each task moves one owner and leaves those tests green. Each item keeps the visibility it had, widened only as far as its new callers need: one prefactor's only review finding was visibility left wider than it had to be.
50
+
51
+ The plan review checks these with the plan rubric's Prefactor item.
52
+
43
53
  ## The walking skeleton
44
54
 
45
55
  The walking-skeleton change also makes CI and the project's tooling real. Its plan adds:
@@ -49,4 +59,4 @@ The walking-skeleton change also makes CI and the project's tooling real. Its pl
49
59
 
50
60
  ## Next step
51
61
 
52
- Show the user the test plan table, the tasks in order and the risks, and say the plan is approved. They can object, and you amend the plan, run its review on the diff, and approve again. Otherwise the next step is `build`, on this branch, in a new session so its context starts empty.
62
+ Show the user the test plan table, the tasks in order and the risks, and say the plan is approved, or, for a standalone change, ask them to approve it. They can object, and you amend the plan, run its review on the diff, and approve again. Otherwise the next step is `build`, on this branch, in a new session so its context starts empty.
@@ -11,7 +11,7 @@ A task is one owner, the files it writes, and the IDs it proves. Build does them
11
11
  - Each task's test can fail first and then pass, using only what earlier tasks built.
12
12
  - Put each test in the task that builds the behaviour it checks. When an earlier task's code would already pass a later task's test, such as a failure path the earlier task had to handle, move the test into the earlier task.
13
13
  - A test that expects a default or empty result, such as no prompt, an empty list, `nil` or `0`, passes against a stub that returns it. Name in the task the break it is first seen failing against, as the wrong behaviour rather than an edit to the code, such as "fails against a model that always shows the prompt". Build may use any break that compiles and turns the same assertion red.
14
- - When the project's lint rejects unused code, such as `cargo clippy -- -D warnings`, put each new item in the task of its first user, or in a task whose own test uses it. Each task then commits green on its own.
14
+ - When the project's lint rejects unused code, such as `cargo clippy -- -D warnings`, put each new item, private and crate-visible ones included, in the task of its first production caller. A test doesn't count as a caller: built earlier, the item fails the lint, and built later, its caller's task can't compile. Each task then commits green on its own.
15
15
  - An accessor, variant or type arrives in the task whose code first handles, matches or constructs it, never in the task that only tests it. When a later task's `match` would pull in a variant, the variant belongs to that task. Two projects built 13 items in a task other than the planned one.
16
16
  3. **Write one line per task:**
17
17
 
@@ -21,13 +21,13 @@ A task is one owner, the files it writes, and the IDs it proves. Build does them
21
21
  ```
22
22
 
23
23
  - Owner and paths in backticks. Every path is a file the architecture assigns to that owner, or a test or support file. List the test support files the task extends, such as a shared harness or fixture, so its tests reuse them.
24
- - When a task adds a module, a file or a dependency, list the file that declares it, such as the crate root or `mod.rs`, the package manifest, or the Xcode project.
24
+ - When a task adds a module, a file or a dependency, list the file that declares it, such as the crate root or `mod.rs`, the package manifest, or the Xcode project. A task that adds a dependency or a feature of one also lists the lockfile, and names the `## Adopt or build` row that approves it.
25
25
  - A task proves the elements it builds, and each scenario whose test goes green in it.
26
26
  - A task that only sets up tooling proves the flow or scenario its checks run.
27
27
  4. **Find the owners.** For each rule, text, format or conversion a task's element applies, such as a message, a path format, a rounding or a name check, search the code and the other tasks for every place that applies it. Give it one owner: when an earlier task's owner already holds it, the later task's line names that file as a callee rather than building the rule again. Done when no rule is written in two places. Two projects wrote 20 rules twice and moved them at code review.
28
- 5. **Find the callers.** For each signature, default or setting a task changes, search the code for every use of it, including tests that start the real binary or read the setting. Add each file that must change to the task. Done when no task will need a file it doesn't list.
28
+ 5. **Find the callers.** For each signature, default or setting a task changes, search the code for every use of it, including tests that start the real binary or read the setting. A new field breaks every literal of its type that names all the fields, so search for `<Type> {` too. Add each file that must change to the task. Done when no task will need a file it doesn't list.
29
29
  6. **Size each task.** A task writes one owner, with its tests, in one sitting. When an owner would take several steps, such as a use case with many scenarios, split it into tasks that each prove a subset of the scenarios.
30
- - Run `cruze check` on each existing file a task extends. When the task would take the file past `check.max_lines` or `check.max_types`, name the new file in the task, split along a responsibility the owner already has. When the owner has one responsibility, plan a `check.exceptions` entry with that reason instead of a split, following the budget rule in `.agents/skills/cruze-hexagonal-design/SKILL.md`.
30
+ - When a task would give an existing file a second responsibility, name the new file in the task, named for what it owns. Never plan a split by line or type count: a file that grows with its one responsibility stays whole, and when it passes a budget, build lists it under `check.exceptions` as the budget rule in `.agents/skills/cruze-hexagonal-design/SKILL.md` says.
31
31
  - The budgets apply to source files, not tests. Split a test file by the behaviour it covers, one use case or port per file, never to meet a budget. Tests that leave a source file go where the hexagonal-design language file you loaded says.
32
32
  7. **Check coverage.**
33
33
  - Every `Builds` ID is proved by a task, except a module, which is proved by any task that writes inside its `Path`.
@@ -15,17 +15,19 @@ Each Cruze release can expect more of a project's code and documents than the la
15
15
  - `.agents/skills/cruze-hexagonal-design/SKILL.md`, and its language file when one exists for the project's language
16
16
  - `.agents/skills/cruze-behavioural-testing/SKILL.md`
17
17
  - `.agents/skills/cruze-formats/reference/architecture.md`
18
- 4. **Audit.** Run the auditor role from `.agents/skills/cruze-roles/SKILL.md` on every note with an `Ask`. In a full audit, give it the standards instead, and run one auditor per module in the module map. Check its evidence against the files. Done when every note with an `Ask` has an answer with evidence, and every note with a `Detect` has its findings from the status report.
18
+ 4. **Audit.** Run the auditor role from `.agents/skills/cruze-roles/SKILL.md` on every note with an `Ask`. A note whose `Rule` is an item of `.agents/skills/cruze-roles/design-rubric.md` is about designs, not code: run the design reviewer instead, on each feature in flight, with that item only, since those designs were reviewed before the item existed. In a full audit, give it the standards instead, and run one auditor per module in the module map. Check its evidence against the files. Done when every note with an `Ask` has an answer with evidence, and every note with a `Detect` has its findings from the status report.
19
19
  5. **Decide each finding** with the user, a group at a time, with your recommendation:
20
20
  - `fixed`: a prefactor change will fix it.
21
21
  - `waived`: the project keeps its own convention, with the reason. For a `check:` finding, list the file under `check.exceptions` with that reason, which keeps CI green. For the rest, the journal holds the waiver.
22
22
  - `deferred`: it waits for later work, recorded with `cruze features add` or on the roadmap.
23
+ - `rethink`: a design reviewer's finding on a feature in flight, which a feature-level rethink of its design fixes. A prefactor can't fix a design, so never record one of these as `fixed`.
23
24
 
24
- Record each with `cruze journal add disposition --set review=realign --set finding="<note id>: <path or summary>" --set disposition=<fixed|waived|deferred> --set reason="<reason>"`. For a finding from a `Detect` rule, write the finding as exactly `<note id>: <path>`, so `cruze realign status` knows it next time. A recorded waiver is never raised again.
25
+ Record each with `cruze journal add disposition --set review=realign --set finding="<note id>: <path or summary>" --set disposition=<fixed|waived|deferred|rethink> --set reason="<reason>"`, adding `--item <feature>` for a `rethink`. Until a rethink is recorded for that feature, `cruze next` names it, `cruze status` counts its findings, and the build gate holds its changes. One project recorded seven such findings as `fixed`, and nothing showed them. For a finding from a `Detect` rule, write the finding as exactly `<note id>: <path>`, so `cruze realign status` knows it next time. A recorded waiver is never raised again.
25
26
  6. **Schedule the fixes.** Group the `fixed` findings into prefactor changes, each small enough to plan (about 12 tasks), one module or concern per change.
26
27
  - When a fix changes what `docs/architecture.md` says, such as an error element, a use case's `Errors` or a port's `Operations`, run `rethink` at architecture level first. It replans the built elements the prefactor rebuilds.
27
28
  - Create each prefactor as "A prefactor" in `.agents/skills/cruze-architect/tweak.md` describes. The behaviour tests are its safety net: wire formats, messages and exit codes stay as they are unless the user decides otherwise.
28
- - Put each on the roadmap, following `.agents/skills/cruze-roadmap/SKILL.md`. Run `cruze status --overlap --change <ref>`, and block it on every in-flight item it overlaps.
29
+ - Put each on the roadmap, following `.agents/skills/cruze-roadmap/SKILL.md`, which says where a prefactor goes. Run `cruze status --overlap --change <ref>`, and ask the user the order for each item it overlaps, with your recommendation.
30
+ - Run `cruze next`. When it names a feature in flight because an amendment moved an element it cites, settle it now, with `cruze diff <feature>`: re-stamp it, or rebase its delta as `.agents/skills/cruze-rethink/levels.md` describes. Leave no feature stale for the next session to find.
29
31
  7. **Record it.** Run `cruze realign done`, adding `--change <ref>` for the prefactor that fixes the `Detect` findings still open. It moves `standards:` up, and lists those files under `check.exceptions` until that change lands, when `cruze land` removes them. Quote its result, and commit with a message such as `chore: realign to Cruze <version>`.
30
32
 
31
33
  Done when `cruze realign status` reports the code meeting the installed version, and every finding has a journaled disposition.
@@ -0,0 +1,131 @@
1
+ # Realign notes: 0.0.10
2
+
3
+ ## Existing code
4
+
5
+ ### decision-citations-docs: Living docs and deltas cite a decision by number only where it is recorded
6
+ - Applies to: existing code
7
+ - Rule: `.agents/skills/cruze-formats/SKILL.md`, "Decisions"
8
+ - Detect: validate:decision-citation
9
+ - Migrate: in a prefactor, rewrite each citation the rule reports in `docs/`: write what the decision settled into the element or sentence, reading it from the archived feature's `## Settled decisions` under `.cruze/archive/`, or cite the ADR that records it. A feature in flight fixes its own delta through `rethink` before its next approval, since `cruze approve` refuses a delta that cites one.
10
+
11
+ ### decision-citations-code: Code comments cite no decision by number
12
+ - Applies to: existing code
13
+ - Rule: `.agents/skills/cruze-formats/SKILL.md`, "Decisions"
14
+ - Detect: check:decision-citation
15
+ - Migrate: in a prefactor, replace each citation `cruze check` reports with what was decided, in a few words, or with the element or ADR ID that holds it. Delete one that adds nothing to what the code already says.
16
+
17
+ ### pitfalls-to-cruze: Known pitfalls hold only lessons about the project
18
+ - Applies to: existing code
19
+ - Rule: `.agents/skills/cruze-land/SKILL.md`, "Landing a change", step 7
20
+ - Ask: which lines under `## Known pitfalls` in `AGENTS.md` are about how Cruze's deltas, plans, tasks, test plans or reviews are written, or about practice that holds in any project in the language, rather than this product's domain or code?
21
+ - Migrate: record each such line with `cruze journal add lesson --set summary=<text> --set instead=<text> --set step=<step>`, so `cruze feedback export` carries it to Cruze, then remove it from `AGENTS.md`.
22
+
23
+ ### vision-intent: The vision holds the principles every design follows and what must stay possible
24
+ - Applies to: existing code
25
+ - Rule: `.agents/skills/cruze-formats/reference/durable-docs.md`, "docs/vision.md"
26
+ - Ask: does `docs/vision.md` lack `## Principles` or `## Must stay possible`, while the notes in `.cruze/notes/`, the ADRs, the architecture's `## Decisions` or the settled decisions of features, archived ones included, state a rule every design follows, or a capability the user expects later, such as one introduced with "eventually"?
27
+ - Migrate: run envision at project scope to rework the vision. Add the two sections from those sources, with the user, ask about what may come later as `.agents/skills/cruze-envision/possibilities.md` describes, and approve the vision again. A principle the design already departs from is settled with the user: amend the principle, or rethink the design.
28
+
29
+ ### intent-review: A design follows the vision's principles and leaves room for what must stay possible
30
+ - Applies to: existing code
31
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric", item 12
32
+ - Ask: for each feature in flight, does its design depart from a `PRINCIPLE` the vision states, or close off a `LATER` capability it touches?
33
+ - Migrate: settle each through `rethink` at feature level before the feature's next change is planned, or amend the vision's row when the user decides the principle or capability changes.
34
+
35
+ ### future-unanchored: A Future fact names the need it keeps room for
36
+ - Applies to: existing code
37
+ - Rule: `.agents/skills/cruze-formats/reference/architecture.md`, "Rules for facts"
38
+ - Detect: validate:future-unanchored
39
+ - Migrate: for each `Future` fact `cruze validate` reports, cite the vision's `LATER` capability or the feature on the map or roadmap it serves, adding the capability to the vision with the user when it isn't there yet. A seam nobody needs goes, through `rethink` at architecture level.
40
+
41
+ ### notes-say-what-they-are: Every note says its kind and what it is about
42
+ - Applies to: existing code
43
+ - Rule: `.agents/skills/cruze-formats/SKILL.md`, "Where documents live"
44
+ - Ask: which notes in `.cruze/notes/` have no `- Kind:` and `- About:` lines under their title, and which of them hold the user's input, such as a seed, a PRD or a design write-up, whose parts no step has taken up?
45
+ - Migrate: add `- Kind:` and `- About:` to each, as `cruze show --notes` lists them. For a note of the user's input, run the intake in `.agents/skills/cruze-envision/intake.md` on it, so its parts are handed to the steps that take them up.
46
+
47
+ ## New work only
48
+
49
+ ### plan-task-files: Items wait for a production caller, and tasks list lockfiles and every literal a new field breaks
50
+ - Applies to: new work only
51
+ - Rule: `.agents/skills/cruze-plan/tasks.md`, steps 2, 3 and 5
52
+
53
+ ### plan-risks-reach: A check named under Risks is confirmed to reach the failure
54
+ - Applies to: new work only
55
+ - Rule: `.agents/skills/cruze-plan/SKILL.md`, "Steps", step 10
56
+
57
+ ### design-review-ports-and-quotes: The design reviewer checks each use case against every refusal it can meet, and quoted output against the code
58
+ - Applies to: new work only
59
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric", item 8
60
+
61
+ ### architect-retired-rules: A delta rewords every statement of a rule it retires, and modifies a port it gives a new use
62
+ - Applies to: new work only
63
+ - Rule: `.agents/skills/cruze-architect/feature.md`, step 4
64
+
65
+ ### fakes-partial-failure: Fakes stall and fail partway, and end the way the real adapter does
66
+ - Applies to: new work only
67
+ - Rule: `.agents/skills/cruze-behavioural-testing/fakes.md`, "Writing a fake"
68
+
69
+ ### tests-races-and-callers: Race tests are seen failing, and a test is never a reason for production code
70
+ - Applies to: new work only
71
+ - Rule: `.agents/skills/cruze-behavioural-testing/SKILL.md`, "Writing tests for a task" and "Expected values"
72
+
73
+ ### cancel-safe-writes: Memory follows storage before the next await
74
+ - Applies to: new work only
75
+ - Rule: `.agents/skills/cruze-hexagonal-design/runtime.md`, "Failures, retries and cancellation"
76
+
77
+ ### rust-reachable-panics: No expect on a case a caller, the clock or a race can reach
78
+ - Applies to: new work only
79
+ - Rule: `.agents/skills/cruze-hexagonal-design/languages/rust.md`, "Errors"
80
+
81
+ ### research-own-call-shapes: New call shapes and test images are verified by running them
82
+ - Applies to: new work only
83
+ - Rule: `.agents/skills/cruze-research/SKILL.md`, "Adopt or build", step 7
84
+
85
+ ### rethink-dispositions: A finding a later rethink fixes is recorded as rethink, and holds its work
86
+ - Applies to: new work only
87
+ - Rule: `.agents/skills/cruze-realign/SKILL.md`, "Steps", step 5
88
+
89
+ ### prefactor-order: A prefactor goes before the items it overlaps, unless one is building
90
+ - Applies to: new work only
91
+ - Rule: `.agents/skills/cruze-roadmap/SKILL.md`, "Adding an item"
92
+
93
+ ### prefactor-plans: A prefactor's plan names its safety net and keeps visibility as it was
94
+ - Applies to: new work only
95
+ - Rule: `.agents/skills/cruze-plan/SKILL.md`, "A prefactor"
96
+
97
+ ### merged-deltas: An element a feature merged keeps its living text, and needs no rebase
98
+ - Applies to: new work only
99
+ - Rule: `.agents/skills/cruze-rethink/levels.md`, "A conflict with living text"
100
+
101
+ ### envision-possibilities: Envision asks about the capabilities the product may grow into
102
+ - Applies to: new work only
103
+ - Rule: `.agents/skills/cruze-envision/possibilities.md`, "Exploring what may come later"
104
+
105
+ ### grilling-long-term-intent: Long-term intent goes to the vision, from any step
106
+ - Applies to: new work only
107
+ - Rule: `.agents/skills/cruze-grilling/SKILL.md`, "Long-term intent"
108
+
109
+ ### envision-confirms-agreed: A proposal the user never decided is asked, not carried as settled
110
+ - Applies to: new work only
111
+ - Rule: `.agents/skills/cruze-envision/project.md`, step 2
112
+
113
+ ### reviewer-rubrics: A review reads only the rubric for what it reviews
114
+ - Applies to: new work only
115
+ - Rule: `.agents/skills/cruze-roles/design-reviewer.md`, "Rubric"
116
+
117
+ ### element-lookup: Steps read a large architecture's elements through the index
118
+ - Applies to: new work only
119
+ - Rule: `.agents/skills/cruze-formats/reference/architecture.md`, "Reading it"
120
+
121
+ ### intake-handoff: Envision takes in any input and hands each part to the step that takes it up
122
+ - Applies to: new work only
123
+ - Rule: `.agents/skills/cruze-envision/intake.md`, "Taking in the user's input"
124
+
125
+ ### every-later-row: Every design is checked against every capability that must stay possible
126
+ - Applies to: new work only
127
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric", item 12
128
+
129
+ ### vision-intent-length: A principle or capability keeps every need it names
130
+ - Applies to: new work only
131
+ - Rule: `.agents/skills/cruze-formats/reference/durable-docs.md`, "docs/vision.md"
@@ -42,7 +42,7 @@
42
42
 
43
43
  ### design-review-rubric: Contradictions are blockers, and slices build whole elements
44
44
  - Applies to: new work only
45
- - Rule: `.agents/skills/cruze-roles/design-reviewer.md`, "Rubric"
45
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric"
46
46
 
47
47
  ### verified-claims: Research runs every claim the design relies on
48
48
  - Applies to: new work only
@@ -33,7 +33,7 @@
33
33
 
34
34
  ### cross-section-consistency: The design reviewer checks cross-cutting rules, interleavings and stale prose
35
35
  - Applies to: new work only
36
- - Rule: `.agents/skills/cruze-roles/design-reviewer.md`, "Rubric", item 8
36
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric", item 8
37
37
 
38
38
  ### one-message-walkthrough: The design walkthrough is one overview, then the documents in full
39
39
  - Applies to: new work only
@@ -18,7 +18,7 @@
18
18
  - Applies to: existing code
19
19
  - Rule: `.agents/skills/cruze-dependency-approval/SKILL.md`, "Weighing"
20
20
  - Ask: does any code hand-write, shell out for, or use a less idiomatic construct for something a dependency or a feature of an approved dependency does cleanly, where the design or a deviation gives avoiding the dependency as the reason?
21
- - Migrate: ask the user for the dependency as the dependency-approval skill says, then replace the workaround through `rethink` at feature level.
21
+ - Migrate: ask the user for the dependency as the dependency-approval skill says, then replace the workaround through `rethink`: at architecture level when the workaround is in an `XC` rule or an import allowlist, at feature level otherwise.
22
22
 
23
23
  ### size-exceptions: An accepted size warning is recorded under changes.exceptions
24
24
  - Applies to: existing code
@@ -50,7 +50,7 @@
50
50
 
51
51
  ### design-gives-every-value: The design gives every error, limit, timeout, transition and message owner
52
52
  - Applies to: new work only
53
- - Rule: `.agents/skills/cruze-roles/design-reviewer.md`, "Rubric", item 6
53
+ - Rule: `.agents/skills/cruze-roles/design-rubric.md`, "Design rubric", item 6
54
54
 
55
55
  ### one-owner-per-rule: Plan gives each rule one owner, and each item to its first handler's task
56
56
  - Applies to: new work only