@printpractical/cruze 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -13
- package/dist/adapters/inbound/cli/cli_context.js +4 -0
- package/dist/adapters/inbound/cli/commands/diff.js +23 -0
- package/dist/adapters/inbound/cli/commands/documents.js +1 -1
- package/dist/adapters/inbound/cli/commands/show.js +66 -2
- package/dist/adapters/inbound/cli/commands/status.js +7 -3
- package/dist/adapters/inbound/cli/commands.js +9 -3
- package/dist/adapters/inbound/cli/parse_command.js +8 -0
- package/dist/adapters/outbound/git_repository.js +9 -0
- package/dist/app/ports/repository.js +4 -0
- package/dist/app/use_cases/approve_artifact.js +18 -10
- package/dist/app/use_cases/check_code.js +5 -3
- package/dist/app/use_cases/journal_events.js +6 -2
- package/dist/app/use_cases/new_project_doc.js +10 -2
- package/dist/app/use_cases/run_review.js +10 -2
- package/dist/app/use_cases/show_elements.js +18 -0
- package/dist/app/use_cases/show_notes.js +11 -0
- package/dist/app/use_cases/show_scope.js +15 -1
- package/dist/app/use_cases/upstream_diff.js +55 -0
- package/dist/domain/approvals/rebase.js +39 -0
- package/dist/domain/approvals/upstream_text.js +36 -0
- package/dist/domain/check/check_source.js +18 -1
- package/dist/domain/check/decision_comments.js +38 -0
- package/dist/domain/decision_citations.js +62 -0
- package/dist/domain/edits/agents_file.js +9 -0
- package/dist/domain/ids.js +3 -1
- package/dist/domain/journal.js +6 -4
- package/dist/domain/land/merge_plan.js +7 -2
- package/dist/domain/line_diff.js +56 -0
- package/dist/domain/project/element_lookup.js +124 -0
- package/dist/domain/project/living_model.js +2 -1
- package/dist/domain/project/notes.js +74 -0
- package/dist/domain/skill_budget.js +36 -0
- package/dist/domain/status/next_step.js +27 -5
- package/dist/domain/status/pending_rethink.js +22 -0
- package/dist/domain/status/work_status.js +17 -2
- package/dist/domain/validation/decision_rules.js +76 -0
- package/dist/domain/validation/delta_rules.js +2 -0
- package/dist/domain/validation/future_rules.js +40 -0
- package/dist/domain/validation/living_rules.js +2 -0
- package/dist/domain/validation/validate_project.js +4 -0
- package/dist/domain/validation/vision_rules.js +41 -0
- package/dist/domain/versions/rule_versions.js +3 -0
- package/package.json +1 -1
- package/skills/architect/SKILL.md +2 -1
- package/skills/architect/feature.md +6 -4
- package/skills/architect/project.md +2 -2
- package/skills/behavioural-testing/SKILL.md +3 -2
- package/skills/behavioural-testing/fakes.md +3 -3
- package/skills/build/SKILL.md +6 -6
- package/skills/envision/SKILL.md +3 -2
- package/skills/envision/feature.md +3 -1
- package/skills/envision/intake.md +28 -0
- package/skills/envision/possibilities.md +13 -0
- package/skills/envision/project.md +5 -3
- package/skills/explore/SKILL.md +2 -2
- package/skills/formats/SKILL.md +13 -2
- package/skills/formats/reference/architecture.md +7 -3
- package/skills/formats/reference/durable-docs.md +4 -1
- package/skills/formats/reference/work-items.md +1 -1
- package/skills/formats/templates/vision.md +12 -0
- package/skills/grilling/SKILL.md +10 -0
- package/skills/hexagonal-design/languages/rust.md +2 -1
- package/skills/hexagonal-design/runtime.md +1 -0
- package/skills/land/SKILL.md +6 -2
- package/skills/plan/SKILL.md +13 -3
- package/skills/plan/tasks.md +3 -3
- package/skills/realign/SKILL.md +5 -3
- package/skills/realign/notes/0.0.10.md +131 -0
- package/skills/realign/notes/0.0.11.md +15 -0
- package/skills/realign/notes/0.0.2.md +1 -1
- package/skills/realign/notes/0.0.6.md +1 -1
- package/skills/realign/notes/0.0.8.md +1 -1
- package/skills/realign/notes/0.0.9.md +2 -2
- package/skills/realign/notes.md +2 -0
- package/skills/research/SKILL.md +3 -2
- package/skills/rethink/SKILL.md +7 -4
- package/skills/rethink/levels.md +15 -6
- package/skills/roadmap/SKILL.md +2 -1
- package/skills/roles/SKILL.md +4 -4
- package/skills/roles/auditor.md +1 -1
- package/skills/roles/code-reviewer.md +6 -5
- package/skills/roles/design-reviewer.md +4 -40
- package/skills/roles/design-rubric.md +40 -0
- package/skills/roles/plan-rubric.md +11 -0
- package/skills/roles/surveyor.md +3 -2
- package/skills/triage/SKILL.md +1 -1
- package/skills/verify/SKILL.md +6 -6
- package/src/adapters/inbound/cli/cli_context.ts +4 -0
- package/src/adapters/inbound/cli/commands/diff.ts +23 -0
- package/src/adapters/inbound/cli/commands/documents.ts +1 -1
- package/src/adapters/inbound/cli/commands/show.ts +66 -2
- package/src/adapters/inbound/cli/commands/status.ts +7 -3
- package/src/adapters/inbound/cli/commands.ts +9 -3
- package/src/adapters/inbound/cli/parse_command.ts +8 -0
- package/src/adapters/outbound/git_repository.ts +9 -0
- package/src/app/ports/repository.ts +4 -0
- package/src/app/use_cases/approve_artifact.ts +18 -10
- package/src/app/use_cases/check_code.ts +5 -3
- package/src/app/use_cases/journal_events.ts +6 -2
- package/src/app/use_cases/new_project_doc.ts +10 -2
- package/src/app/use_cases/run_review.ts +10 -2
- package/src/app/use_cases/show_elements.ts +18 -0
- package/src/app/use_cases/show_notes.ts +11 -0
- package/src/app/use_cases/show_scope.ts +15 -1
- package/src/app/use_cases/upstream_diff.ts +55 -0
- package/src/domain/approvals/rebase.ts +39 -0
- package/src/domain/approvals/upstream_text.ts +36 -0
- package/src/domain/check/check_source.ts +18 -1
- package/src/domain/check/decision_comments.ts +38 -0
- package/src/domain/decision_citations.ts +62 -0
- package/src/domain/edits/agents_file.ts +9 -0
- package/src/domain/ids.ts +3 -1
- package/src/domain/journal.ts +6 -4
- package/src/domain/land/merge_plan.ts +7 -2
- package/src/domain/line_diff.ts +56 -0
- package/src/domain/project/element_lookup.ts +124 -0
- package/src/domain/project/living_model.ts +2 -1
- package/src/domain/project/notes.ts +74 -0
- package/src/domain/skill_budget.ts +36 -0
- package/src/domain/status/next_step.ts +27 -5
- package/src/domain/status/pending_rethink.ts +22 -0
- package/src/domain/status/work_status.ts +17 -2
- package/src/domain/validation/decision_rules.ts +76 -0
- package/src/domain/validation/delta_rules.ts +2 -0
- package/src/domain/validation/future_rules.ts +40 -0
- package/src/domain/validation/living_rules.ts +2 -0
- package/src/domain/validation/validate_project.ts +4 -0
- package/src/domain/validation/vision_rules.ts +41 -0
- package/src/domain/versions/rule_versions.ts +3 -0
- package/templates/init/AGENTS.md +1 -1
package/skills/build/SKILL.md
CHANGED
|
@@ -16,7 +16,7 @@ Build turns an approved plan into code, one task at a time. Each task starts wit
|
|
|
16
16
|
- `.agents/skills/cruze-behavioural-testing/SKILL.md`
|
|
17
17
|
- `.agents/skills/cruze-hexagonal-design/SKILL.md`, and its language file when one exists for the project's language
|
|
18
18
|
- `.agents/skills/cruze-dependency-approval/SKILL.md`
|
|
19
|
-
3. **Read the plan and the design.** Read the change's `change.md`. Run `cruze show <ref>` and read its output: the full body of every element the change builds, every scenario it delivers, and the settled decisions. Read an element it lists as cited only when the task calls it,
|
|
19
|
+
3. **Read the plan and the design.** Read the change's `change.md`. Run `cruze show <ref>` and read its output: the full body of every element the change builds, every scenario it delivers, and the settled decisions. Read an element it lists as cited only when the task calls it, with `cruze show <ID>`, never `feature.md` or `docs/architecture.md` whole. Read a reference it lists at the sections the change's elements cite. Read `commands:` in `.cruze/config.yaml`.
|
|
20
20
|
4. **Build each open task in order,** following the task loop below. Skip the tasks already ticked in `## Progress`.
|
|
21
21
|
5. **Finish.** When every task is ticked:
|
|
22
22
|
- Run the format, lint and build commands and the full suite, as `.agents/skills/cruze-formats/reference/config.md` defines it under `commands`.
|
|
@@ -36,7 +36,7 @@ For task `T<n>`:
|
|
|
36
36
|
5. **Commit** with a Conventional Commit message naming the task, such as `feat(access): console session state machine (T2)`.
|
|
37
37
|
6. **Tick it.** Run `cruze task done T<n>`, which records the commit. Its progress edit rides along in the next commit.
|
|
38
38
|
|
|
39
|
-
A task with no behaviour of its own, such as a package manifest or a plain data type, has no red step. Build it, check it, commit it and tick it, and the first task whose test uses it covers it.
|
|
39
|
+
A task with no behaviour of its own, such as a package manifest or a plain data type, has no red step. Build it, check it, commit it and tick it, and the first task whose test uses it covers it. Neither has a prefactor's task: run the tests its plan names under `## Risks` before the first task, and after each task, and they pass unchanged.
|
|
40
40
|
|
|
41
41
|
Done for a task when its tests pass, `cruze check --ci` passes for its files, the commit exists and the task is ticked.
|
|
42
42
|
|
|
@@ -49,12 +49,12 @@ The plan is design. Within a task you decide only what is local and reversible.
|
|
|
49
49
|
- a new element, port operation or scenario;
|
|
50
50
|
- a file outside the owner's module, other than the test support module;
|
|
51
51
|
- a change to an approved scenario's behaviour, or to its test;
|
|
52
|
-
- a dependency, or a feature of an approved dependency, that the design doesn't name. Ask for it as `.agents/skills/cruze-dependency-approval/SKILL.md` says, and never write around it with hand-written code or a shell command
|
|
53
|
-
- a limit, timeout, buffer size, message or error case the design doesn't give. Picking one in code hides a gap in the design: the user decides it, at feature level. Two projects settled 35 of them as deviations.
|
|
52
|
+
- a dependency, or a feature of an approved dependency, that the design doesn't name. Ask for it as `.agents/skills/cruze-dependency-approval/SKILL.md` says, and never write around it with hand-written code or a shell command.
|
|
54
53
|
|
|
55
54
|
Explain what you found, with the evidence, and don't work around it. Completed tasks keep their commits.
|
|
56
|
-
- **
|
|
57
|
-
-
|
|
55
|
+
- **Settle a detail with the user,** as "Detail" in `.agents/skills/cruze-rethink/levels.md` says, when the code needs a limit, timeout, buffer size, message or error case the design doesn't give. Never offer a deviation instead: two projects settled 35 details as deviations.
|
|
56
|
+
- **Read a deviation back before you record it.** One naming a value, text, error or outcome the design doesn't give is a detail; one saying the code can't keep a promise a port or use case makes is a rethink.
|
|
57
|
+
- Never edit `feature.md`, `docs/architecture.md` or `docs/specs/` during build. Design changes go through `rethink`, a detail included.
|
|
58
58
|
|
|
59
59
|
## Protecting the check
|
|
60
60
|
|
package/skills/envision/SKILL.md
CHANGED
|
@@ -10,7 +10,7 @@ Envision decides the what: the problem, who has it, and the behaviour that solve
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
12
|
1. **Pick the scope.** It is project scope when `docs/vision.md` doesn't exist yet, or when the user asks to rework the project's goals. It is feature scope when the user names a feature. When unsure, ask. Done when you can say which.
|
|
13
|
-
2. **Gather the input.** Read what the user gave you: pasted drafts, files they point to, and notes
|
|
13
|
+
2. **Gather the input.** Read what the user gave you: pasted drafts, files they point to, and the notes `cruze show --notes` lists. Read whichever of `docs/vision.md`, `docs/glossary.md`, `docs/roadmap.md` and `docs/architecture.md` exist, and run `cruze status`.
|
|
14
14
|
3. **Load the standards.** Read `.agents/skills/cruze-grilling/SKILL.md` and `.agents/skills/cruze-domain-language/SKILL.md`, and follow them for the rest of this step.
|
|
15
15
|
4. **Follow the scope's procedure.** For project scope, follow [project.md](project.md). For feature scope, follow [feature.md](feature.md). Each one ends with the user's confirmation.
|
|
16
16
|
5. **Check the documents.** Run `cruze validate`. Done when it reports no errors in the documents this step wrote. At feature scope, expect one `not-designed` warning for the feature, which `architect` clears.
|
|
@@ -20,7 +20,8 @@ Envision decides the what: the problem, who has it, and the behaviour that solve
|
|
|
20
20
|
- Write in the user's terms and the glossary's words. Behaviour is described from outside the system: what a user does and what they observe.
|
|
21
21
|
- Requirements and scenarios follow `.agents/skills/cruze-formats/reference/specs.md`. Every scenario uses concrete values: real names, real inputs, exact output. The scenarios become the tests, so their values are the expected results.
|
|
22
22
|
- Keep implementation out: no modules, types, libraries or file formats unless the user names one as a constraint. When the user raises one, record it as a constraint or a settled decision and move on.
|
|
23
|
-
-
|
|
23
|
+
- Problem through Constraints stay within one page. A principle or a capability that must stay possible takes as much as its intent needs: never shorten one to fit.
|
|
24
|
+
- The product's long-term intent lives in the vision, in its Principles and Must stay possible tables, at either scope. Designs answer to it for the product's whole life, long after the conversation that settled it.
|
|
24
25
|
- Only the CLI writes the feature map. Use `cruze features add`, `cruze features update` and `cruze features drop`.
|
|
25
26
|
|
|
26
27
|
## Next step
|
|
@@ -7,13 +7,15 @@ The result is a feature folder whose `feature.md` holds the intent, the settled
|
|
|
7
7
|
- When it isn't in the roadmap's phases, ask the user whether it belongs in this release. If it does, add it by following "Adding an item" in `.agents/skills/cruze-roadmap/SKILL.md`, and re-approve the roadmap. If it doesn't, put it on the future list with `cruze features add` and stop here.
|
|
8
8
|
- When its `Blocked by` items haven't landed (see the roadmap's `## Status`), tell the user. Continue only if they want to design ahead, and record that as a settled decision.
|
|
9
9
|
3. **Create the folder.** When the feature has no folder yet, run `cruze new feature <slug> --title "<title>" --roadmap <slug>`, using its roadmap slug. When a folder exists, edit its `feature.md`.
|
|
10
|
-
4. **Read the behaviour it touches.** Read the specs in `docs/specs/` for every capability the feature changes, so you know each requirement and scenario it builds on.
|
|
10
|
+
4. **Read the behaviour it touches.** Read the specs in `docs/specs/` for every capability the feature changes, so you know each requirement and scenario it builds on. Run `cruze show --notes <slug>`, and take up the notes about this feature and the parts of the user's input handed to it, open questions included, as "Taking up a hand-off later" in [intake.md](intake.md) describes.
|
|
11
11
|
5. **List the open decisions:**
|
|
12
12
|
- **Intent:** the problem and outcome in the user's words, who it is for, the constraints, and what is out of scope.
|
|
13
13
|
- **Requirements:** each behaviour the feature adds, changes or removes, and the capability it belongs to. It goes in an existing capability when the behaviour fits one; otherwise it starts a new capability.
|
|
14
14
|
- **Scenarios:** for each requirement, the main case, each edge and failure case a user will meet, and what they observe in each. Invent concrete edge cases to test the boundaries.
|
|
15
|
+
- **Later:** the vision's `PRINCIPLE` and `LATER` rows this feature touches, and the capabilities it may grow into, asked about as [possibilities.md](possibilities.md) describes. A feature that adds sign-in asks about single sign-on and multi-factor authentication, for example.
|
|
15
16
|
6. **Grill in rounds** until every open decision is settled. Record decisions under `## Settled decisions` and terms in the glossary as they settle.
|
|
16
17
|
- When a decision changes something the feature's summary on the feature map promises, such as a policy it names, correct the summary with `cruze features update <slug> --summary <text>`.
|
|
18
|
+
- When an answer names something the product may need later, or a decision departs from a principle, the vision changes, as "Long-term intent" in the grilling skill describes. A settled decision of this feature is archived when it lands, so it can't hold either.
|
|
17
19
|
7. **Write the spec delta.** Use `ADDED` for new requirements, `MODIFIED` for a requirement whose text or scenarios change (writing its full new body with every scenario it keeps), `REMOVED` with a `Reason` and `Migration` for retired behaviour, and `ADDED CAPABILITY` for a new capability.
|
|
18
20
|
- Name every ID with glossary terms. An ID is never reused.
|
|
19
21
|
- Done when every requirement has a scenario for its main case and one for each failure a user can meet.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Taking in the user's input
|
|
2
|
+
|
|
3
|
+
The user may bring anything: a seed, a PRD, a TRD, a design write-up, an old project's notes, a pasted paragraph or a link. Everything in it is open for discussion, and every part of it reaches the step that takes it up. One project's 9,500-word seed held design that no step was told to read, and intent the vision had no room for.
|
|
4
|
+
|
|
5
|
+
1. **Gather it.** Read every source the user names or pastes, and each note `cruze show --notes` lists with kind `input`. Run `cruze new note intake --title "Intake: <what the input is>" --kind intake --about project`. Under `## Sources`, cite each file in the repository by path, and copy in, verbatim, what would otherwise be lost: pasted text, and a document outside the repository, such as a link or a PDF.
|
|
6
|
+
2. **Sort every part** by the step that takes it up. Name each part by its heading, or by a short quote where the input has none:
|
|
7
|
+
- `vision`: the problem, users, goals, non-goals, constraints, principles, and what must stay possible.
|
|
8
|
+
- `architect`: design choices, such as structure, protocols, technologies and data formats.
|
|
9
|
+
- `roadmap`: delivery order and phases.
|
|
10
|
+
- a feature's slug: one feature's behaviour, rules, limits and examples. Use the slug the feature map gives it.
|
|
11
|
+
- `user`: preferences about the process itself, which the user may add to `AGENTS.md`.
|
|
12
|
+
|
|
13
|
+
An open question goes to the step that settles it. Done when every part of every source has a place.
|
|
14
|
+
3. **Read its stance.** Note how settled the input says each part is, from its own legend when it has one, or from its wording: "we decided" and "must" are firmer than "maybe", "TBD" or a question. Nothing is settled by being written down. The stance sets only your recommendation: keep what the input settled, with its reason; ask about what it proposed; research what it guesses; settle what it leaves open.
|
|
15
|
+
4. **Write the hand-off** in the intake note, under `## Hand-off`, one row per part:
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
| Part | Source | Goes to | Status |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| Transport | `.cruze/notes/2026-10-12-seed.md`, "The protocol" | architect | open |
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
A one-paragraph idea is all `vision`, so its hand-off is a row or two.
|
|
24
|
+
5. **Take up the vision's parts now,** one section at a time. Each section is one question, keep or change, with the input's position as your recommendation. Set each row's status to `settled` or `dropped` as the user decides.
|
|
25
|
+
|
|
26
|
+
## Taking up a hand-off later
|
|
27
|
+
|
|
28
|
+
Architect, the roadmap and feature-scope envision take up their own rows. `cruze show --notes <step or feature slug>` lists them, and `cruze show <ref>` lists them for a feature or change. Read each part at its source, ask the user about it as in step 5, record what they keep where the step records decisions, and set the row's status. A row still `open` when the step ends goes to the user: keep it open for a later step, or drop it.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Exploring what may come later
|
|
2
|
+
|
|
3
|
+
The user knows where the product is heading better than any document does, but rarely says it unprompted. Ask, so designs leave room for it and never close it off.
|
|
4
|
+
|
|
5
|
+
1. **Find the neighbours.** For each goal, user and capability in scope, name the capabilities that products in this domain commonly grow into, from what you know of the domain and its standards. Name them as the user would recognise them: single sign-on or multi-factor authentication next to sign-in, sync across devices next to local-only storage, teams and shared workspaces next to a single-user app, third-party plugins next to a fixed set of kinds, a second transport next to a local socket. Skip those the vision already records under `## Must stay possible` or `## Non-goals`.
|
|
6
|
+
2. **Ask them as a round,** following `.agents/skills/cruze-grilling/SKILL.md`: whether the product may need each one, how likely, and why. Recommend an answer from what the user has said so far. Keep a round to 3 to 5, the likeliest first. "No" is a good answer too.
|
|
7
|
+
3. **Record each answer:**
|
|
8
|
+
- **Likely or possible:** a `LATER-<name>` row under `## Must stay possible` in `docs/vision.md`, with the likelihood, why in the user's words, and what no design may close off. Say what must stay possible, never how to build it: the mechanism is decided when a feature builds it.
|
|
9
|
+
- **No, for a tempting neighbour of a goal:** a non-goal with the reason, so nobody proposes it again.
|
|
10
|
+
- **No, otherwise:** nothing.
|
|
11
|
+
4. **Check the principles.** For each new `LATER` row, check every `PRINCIPLE` row against it. When one would stand in its way, such as "every record has exactly one owner" against shared workspaces, settle with the user which one gives, and amend the principle or the row.
|
|
12
|
+
|
|
13
|
+
Done when every capability in scope has had its neighbours asked about once, and each answer is recorded. The vision changed, so the user approves it again with `cruze approve vision`.
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
The result is an approved `docs/vision.md` and a `docs/glossary.md` holding the terms that settled. Formats: `.agents/skills/cruze-formats/reference/durable-docs.md`.
|
|
4
4
|
|
|
5
5
|
1. **Create the documents.** Run `cruze new vision` and `cruze new glossary` for whichever doesn't exist yet. When the vision exists and you are reworking it, edit it in place. Bounded contexts don't exist yet, so group the glossary's terms under one `##` heading naming the product's domain, such as `## Console access`. `architect` regroups them by context.
|
|
6
|
-
2. **
|
|
6
|
+
2. **Take in the input** as [intake.md](intake.md) describes, then draft every section you can from the parts handed to `vision`, marking each as a question for step 3. Done when every part of the input has a hand-off row.
|
|
7
7
|
3. **List the open decisions,** section by section:
|
|
8
8
|
- **Problem:** the problem in the user's words, and who feels it.
|
|
9
9
|
- **Users:** each kind of user and the situation they are in.
|
|
10
10
|
- **Goals:** each goal as a `GOAL-<name>` row, with a measure that says how you would know it's met. A goal without a measure is still open.
|
|
11
11
|
- **Non-goals:** what the product deliberately doesn't do, and why. Ask about the tempting neighbours of each goal.
|
|
12
12
|
- **Constraints:** platforms, the implementation language, dependency policy, performance, security, privacy, licensing and legal limits.
|
|
13
|
+
- **Principles:** each rule every design must follow, as a `PRINCIPLE-<name>` row with why it holds. Ask about the rules behind the user's choices, such as what state and events are each for.
|
|
14
|
+
- **Must stay possible:** each capability the product may need after this release, as a `LATER-<name>` row, explored as [possibilities.md](possibilities.md) describes.
|
|
13
15
|
- **Feature map:** the capabilities that deliver the goals, each a slug with a one-line summary and the goals it serves. They are what later `envision "<feature>"` runs pick up.
|
|
14
|
-
4. **Grill in rounds** until every open decision is settled, following the grilling skill. As each domain term settles, add it to the glossary.
|
|
16
|
+
4. **Grill in rounds** until every open decision is settled, following the grilling skill. As each domain term settles, add it to the glossary. Once the goals and feature map have settled, ask about what may come later, as [possibilities.md](possibilities.md) describes.
|
|
15
17
|
5. **Write the vision.** Fill each section, and remove every template guide.
|
|
16
18
|
6. **Fill the feature map.** For each capability, run `cruze features add <slug> --summary "<summary>" --goals <GOAL IDs>`. Put command syntax in backticks, such as `` `consolectl console <device>` ``, so it isn't read as a template guide. Running `add` again for the same slug replaces its entry in place. Done when every goal is served by at least one feature on the map.
|
|
17
|
-
7. **Confirm.** Walk the user through the vision in one short summary: the problem, the goals with their measures, the non-goals, the constraints, and the feature map. Ask whether it matches their understanding, and apply any corrections.
|
|
19
|
+
7. **Confirm.** Walk the user through the vision in one short summary: the problem, the goals with their measures, the non-goals, the constraints, the principles, what must stay possible, and the feature map. Name what the hand-off gives each later step, and anything dropped, and why. Ask whether it matches their understanding, and apply any corrections.
|
|
18
20
|
8. **Approve.** When the user approves, run `cruze approve vision` and quote its result.
|
|
19
21
|
9. **Introduce the project in the README.** Under the title of `README.md`, write one paragraph drawn from the vision's Problem, Users and Goals: what the product is, who it is for, and why it exists, ending with a link to `docs/vision.md`. Keep anything already there that is still true. Done when `cruze validate` reports no `readme-overview` warning.
|
|
20
22
|
10. **Commit,** with a message such as `docs: envision the project`.
|
package/skills/explore/SKILL.md
CHANGED
|
@@ -10,7 +10,7 @@ Explore is the optional thinking partner that can come before any other Cruze st
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
12
|
1. **Frame the problem.** Ask what prompted the idea, who it affects, and what outcome would make it worthwhile. If the user starts from a solution, restate the problem underneath it and confirm it. Done when you can state the problem in one sentence the user agrees with.
|
|
13
|
-
2. **Read what exists.** Read whichever of these exist: `docs/vision.md`, `docs/glossary.md`, `docs/architecture.md
|
|
13
|
+
2. **Read what exists.** Read whichever of these exist: `docs/vision.md`, `docs/glossary.md`, `docs/architecture.md` as "Reading it" in `.agents/skills/cruze-formats/reference/architecture.md` says, `docs/roadmap.md`, and the code the idea touches. Run `cruze status` to see work in flight. Use the glossary's words from here on, following `.agents/skills/cruze-domain-language/SKILL.md`.
|
|
14
14
|
3. **Separate facts from guesses.** List what is known evidence, what is a hypothesis, and what is a preference. Look up any fact you can rather than asking the user for it.
|
|
15
15
|
4. **Diverge.** Lay out two to four genuinely different approaches, including leaving things as they are when that is credible. For each, give what it changes, what it leaves alone, its benefits, its costs and failure modes, the assumptions it rests on, and what evidence would tell it apart from the others. Show what each approach looks like, following `.agents/skills/cruze-grilling/illustrating.md`.
|
|
16
16
|
5. **Converge.** Compare the strongest options against the user's outcome, the vision's goals and constraints, and the architecture. Challenge assumptions and accidental scope growth, following the challenge rules in `.agents/skills/cruze-grilling/SKILL.md`. Recommend one option only when its trade-offs are understood. Otherwise recommend the smallest step that would settle the question, such as a spike, a measurement or a research question.
|
|
@@ -20,7 +20,7 @@ Explore is the optional thinking partner that can come before any other Cruze st
|
|
|
20
20
|
|
|
21
21
|
Only when the user says to capture:
|
|
22
22
|
|
|
23
|
-
1. Run `cruze new note <slug> --title "<title>"` and write the note at the path it returns.
|
|
23
|
+
1. Run `cruze new note <slug> --title "<title>" --kind explore --about <subjects>`, naming the feature slugs or contexts the idea concerns, or `project`, and write the note at the path it returns.
|
|
24
24
|
2. Give the note these sections: `## Problem`, `## Options`, `## Recommendation` and `## Open questions`. Mark each statement as fact, hypothesis, preference or recommendation.
|
|
25
25
|
3. Done when the note stands on its own for a reader who wasn't in the conversation.
|
|
26
26
|
|
package/skills/formats/SKILL.md
CHANGED
|
@@ -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` |
|
|
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,7 +36,7 @@ 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
|
|
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
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`) | |
|
|
@@ -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
|
|
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.
|
|
@@ -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.
|
|
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
|
|
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
|
|
package/skills/grilling/SKILL.md
CHANGED
|
@@ -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`.
|
|
@@ -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
|
package/skills/land/SKILL.md
CHANGED
|
@@ -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
|
-
-
|
|
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,
|
|
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
|
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -19,13 +19,13 @@ 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, the ledger and the references. Read an element it lists as cited only when a task will call it,
|
|
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>`.
|
|
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
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
|
|
|
@@ -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:
|
package/skills/plan/tasks.md
CHANGED
|
@@ -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
|
|
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,11 +21,11 @@ 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
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.
|
package/skills/realign/SKILL.md
CHANGED
|
@@ -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`. A note whose `Rule` is an item of
|
|
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
|
|
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.
|