@printpractical/cruze 0.0.13 → 0.0.14
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 +61 -118
- package/dist/adapters/inbound/cli/cli_context.js +0 -27
- package/dist/adapters/inbound/cli/commands/code.js +5 -18
- package/dist/adapters/inbound/cli/commands/documents.js +11 -37
- package/dist/adapters/inbound/cli/commands/init.js +1 -1
- package/dist/adapters/inbound/cli/commands/review.js +2 -9
- package/dist/adapters/inbound/cli/commands/status.js +16 -63
- package/dist/adapters/inbound/cli/commands.js +10 -37
- package/dist/adapters/inbound/cli/parse_command.js +0 -54
- package/dist/adapters/outbound/git_repository.js +2 -71
- package/dist/app/ports/repository.js +0 -12
- package/dist/app/project_context.js +15 -25
- package/dist/app/use_cases/approve_document.js +29 -0
- package/dist/app/use_cases/check_code.js +21 -56
- package/dist/app/use_cases/new_document.js +25 -0
- package/dist/app/use_cases/project_status.js +43 -67
- package/dist/app/use_cases/run_review.js +11 -30
- package/dist/app/use_cases/validate_project.js +4 -4
- package/dist/domain/approvals.js +51 -0
- package/dist/domain/check/check_source.js +2 -31
- package/dist/domain/config.js +8 -84
- package/dist/domain/hashing.js +16 -30
- package/dist/domain/ids.js +13 -27
- package/dist/domain/next_step.js +41 -0
- package/dist/domain/project/features.js +71 -0
- package/dist/domain/project/layout.js +11 -27
- package/dist/domain/project/project_docs.js +48 -0
- package/dist/domain/project/release.js +30 -0
- package/dist/domain/scaffold.js +0 -1
- package/dist/domain/skill_budget.js +4 -4
- package/dist/domain/trace.js +8 -25
- package/dist/domain/validation/document_rules.js +70 -0
- package/dist/domain/validation/release_rules.js +45 -0
- package/dist/domain/validation/validate_project.js +20 -27
- package/dist/domain/versions/cruze_version.js +3 -9
- package/dist/main.js +1 -1
- package/package.json +1 -1
- package/skills/asking/SKILL.md +51 -0
- package/skills/behavioural-testing/SKILL.md +14 -16
- package/skills/behavioural-testing/examples.md +1 -2
- package/skills/behavioural-testing/fakes.md +2 -2
- package/skills/build/SKILL.md +34 -38
- package/skills/dependency-approval/SKILL.md +34 -31
- package/skills/envision/SKILL.md +23 -18
- package/skills/envision/architecture.md +16 -0
- package/skills/envision/breakdown.md +14 -0
- package/skills/envision/possibilities.md +6 -7
- package/skills/fix/SKILL.md +34 -0
- package/skills/formats/SKILL.md +39 -87
- package/skills/formats/config.md +47 -0
- package/skills/formats/templates/architecture.md +18 -74
- package/skills/formats/templates/feature.md +18 -34
- package/skills/formats/templates/vision.md +15 -27
- package/skills/hexagonal-design/SKILL.md +11 -11
- package/skills/hexagonal-design/contracts.md +3 -3
- package/skills/hexagonal-design/fundamentals.md +1 -1
- package/skills/hexagonal-design/languages/cpp.md +1 -1
- package/skills/hexagonal-design/languages/rust.md +1 -1
- package/skills/hexagonal-design/languages/swift.md +2 -2
- package/skills/hexagonal-design/runtime.md +2 -2
- package/skills/research/SKILL.md +4 -4
- package/skills/research/evaluation.md +1 -1
- package/skills/review/SKILL.md +27 -0
- package/skills/roles/SKILL.md +8 -59
- package/skills/roles/code-reviewer.md +21 -32
- package/skills/roles/researcher.md +3 -3
- package/skills/shape/SKILL.md +37 -0
- package/skills/shape/self-check.md +12 -0
- package/src/adapters/inbound/cli/cli_context.ts +0 -27
- package/src/adapters/inbound/cli/commands/code.ts +5 -18
- package/src/adapters/inbound/cli/commands/documents.ts +11 -37
- package/src/adapters/inbound/cli/commands/init.ts +1 -1
- package/src/adapters/inbound/cli/commands/review.ts +2 -9
- package/src/adapters/inbound/cli/commands/status.ts +16 -63
- package/src/adapters/inbound/cli/commands.ts +10 -37
- package/src/adapters/inbound/cli/parse_command.ts +0 -54
- package/src/adapters/outbound/git_repository.ts +2 -71
- package/src/app/ports/repository.ts +0 -12
- package/src/app/project_context.ts +15 -25
- package/src/app/use_cases/approve_document.ts +29 -0
- package/src/app/use_cases/check_code.ts +21 -56
- package/src/app/use_cases/new_document.ts +25 -0
- package/src/app/use_cases/project_status.ts +49 -73
- package/src/app/use_cases/run_review.ts +11 -30
- package/src/app/use_cases/validate_project.ts +4 -4
- package/src/domain/approvals.ts +51 -0
- package/src/domain/check/check_source.ts +2 -31
- package/src/domain/config.ts +9 -85
- package/src/domain/hashing.ts +16 -30
- package/src/domain/ids.ts +13 -27
- package/src/domain/next_step.ts +41 -0
- package/src/domain/project/features.ts +71 -0
- package/src/domain/project/layout.ts +11 -27
- package/src/domain/project/project_docs.ts +48 -0
- package/src/domain/project/release.ts +30 -0
- package/src/domain/scaffold.ts +0 -1
- package/src/domain/skill_budget.ts +4 -4
- package/src/domain/trace.ts +8 -25
- package/src/domain/validation/document_rules.ts +70 -0
- package/src/domain/validation/release_rules.ts +45 -0
- package/src/domain/validation/validate_project.ts +21 -28
- package/src/domain/versions/cruze_version.ts +3 -9
- package/src/main.ts +1 -1
- package/templates/init/AGENTS.md +4 -12
- package/templates/init/ci.yml +3 -3
- package/templates/init/config.yaml +8 -17
- package/templates/init/review/claude.yaml +2 -2
- package/dist/adapters/inbound/cli/argument_files.js +0 -29
- package/dist/adapters/inbound/cli/commands/diff.js +0 -23
- package/dist/adapters/inbound/cli/commands/journal.js +0 -32
- package/dist/adapters/inbound/cli/commands/progress.js +0 -55
- package/dist/adapters/inbound/cli/commands/realign.js +0 -28
- package/dist/adapters/inbound/cli/commands/show.js +0 -96
- package/dist/app/use_cases/abandon_work.js +0 -42
- package/dist/app/use_cases/approve_artifact.js +0 -197
- package/dist/app/use_cases/journal_events.js +0 -64
- package/dist/app/use_cases/land_change.js +0 -134
- package/dist/app/use_cases/new_project_doc.js +0 -48
- package/dist/app/use_cases/new_work_item.js +0 -75
- package/dist/app/use_cases/realign_done.js +0 -45
- package/dist/app/use_cases/realign_status.js +0 -106
- package/dist/app/use_cases/record_progress.js +0 -118
- package/dist/app/use_cases/show_elements.js +0 -18
- package/dist/app/use_cases/show_notes.js +0 -11
- package/dist/app/use_cases/show_scope.js +0 -51
- package/dist/app/use_cases/upstream_diff.js +0 -55
- package/dist/domain/approvals/agent_approval.js +0 -68
- package/dist/domain/approvals/evaluate.js +0 -36
- package/dist/domain/approvals/fingerprint.js +0 -52
- package/dist/domain/approvals/rebase.js +0 -39
- package/dist/domain/approvals/records.js +0 -50
- package/dist/domain/approvals/upstream_text.js +0 -36
- package/dist/domain/architecture_sections.js +0 -23
- package/dist/domain/check/decision_comments.js +0 -38
- package/dist/domain/decision_citations.js +0 -62
- package/dist/domain/edits/agents_file.js +0 -58
- package/dist/domain/edits/managed_tables.js +0 -60
- package/dist/domain/edits/progress_block.js +0 -33
- package/dist/domain/edits/status_lines.js +0 -52
- package/dist/domain/elements.js +0 -126
- package/dist/domain/journal.js +0 -109
- package/dist/domain/land/bookkeeping.js +0 -54
- package/dist/domain/land/merge_plan.js +0 -137
- package/dist/domain/land/text_ops.js +0 -66
- package/dist/domain/line_diff.js +0 -56
- package/dist/domain/project/artifact_ref.js +0 -42
- package/dist/domain/project/deltas.js +0 -49
- package/dist/domain/project/element_lookup.js +0 -124
- package/dist/domain/project/living_model.js +0 -55
- package/dist/domain/project/new_items.js +0 -48
- package/dist/domain/project/notes.js +0 -74
- package/dist/domain/project/plan_parts.js +0 -111
- package/dist/domain/project/progress.js +0 -43
- package/dist/domain/project/project_view.js +0 -72
- package/dist/domain/project/roadmap.js +0 -43
- package/dist/domain/project/scope_view.js +0 -134
- package/dist/domain/project/work_items.js +0 -68
- package/dist/domain/status/next_step.js +0 -181
- package/dist/domain/status/pending_rethink.js +0 -22
- package/dist/domain/status/verification.js +0 -29
- package/dist/domain/status/work_status.js +0 -125
- package/dist/domain/validation/decision_rules.js +0 -76
- package/dist/domain/validation/delta_rules.js +0 -81
- package/dist/domain/validation/element_rules.js +0 -104
- package/dist/domain/validation/future_rules.js +0 -40
- package/dist/domain/validation/living_rules.js +0 -99
- package/dist/domain/validation/plan_rules.js +0 -124
- package/dist/domain/validation/project_rules.js +0 -115
- package/dist/domain/validation/size_rules.js +0 -45
- package/dist/domain/validation/vision_rules.js +0 -41
- package/dist/domain/validation/work_item_rules.js +0 -175
- package/dist/domain/versions/realign_notes.js +0 -72
- package/dist/domain/versions/rule_versions.js +0 -29
- package/dist/domain/versions/scheduled_exceptions.js +0 -41
- package/skills/about/SKILL.md +0 -21
- package/skills/architect/SKILL.md +0 -49
- package/skills/architect/feature.md +0 -40
- package/skills/architect/project.md +0 -71
- package/skills/architect/tweak.md +0 -22
- package/skills/architect/walkthrough.md +0 -35
- package/skills/domain-language/SKILL.md +0 -37
- package/skills/envision/feature.md +0 -25
- package/skills/envision/intake.md +0 -28
- package/skills/envision/project.md +0 -24
- package/skills/explore/SKILL.md +0 -39
- package/skills/formats/reference/architecture.md +0 -84
- package/skills/formats/reference/config.md +0 -80
- package/skills/formats/reference/durable-docs.md +0 -74
- package/skills/formats/reference/specs.md +0 -65
- package/skills/formats/reference/work-items.md +0 -100
- package/skills/formats/templates/adr.md +0 -7
- package/skills/formats/templates/change.md +0 -29
- package/skills/formats/templates/glossary.md +0 -8
- package/skills/formats/templates/roadmap.md +0 -32
- package/skills/formats/templates/spec.md +0 -11
- package/skills/formats/templates/standalone-change.md +0 -46
- package/skills/grilling/SKILL.md +0 -90
- package/skills/grilling/illustrating.md +0 -38
- package/skills/improve/SKILL.md +0 -51
- package/skills/land/SKILL.md +0 -48
- package/skills/next/SKILL.md +0 -31
- package/skills/plan/SKILL.md +0 -62
- package/skills/plan/tasks.md +0 -35
- package/skills/plan/test-plan.md +0 -14
- package/skills/realign/SKILL.md +0 -37
- package/skills/realign/notes/0.0.10.md +0 -131
- package/skills/realign/notes/0.0.11.md +0 -15
- package/skills/realign/notes/0.0.12.md +0 -31
- package/skills/realign/notes/0.0.13.md +0 -11
- package/skills/realign/notes/0.0.2.md +0 -69
- package/skills/realign/notes/0.0.3.md +0 -11
- package/skills/realign/notes/0.0.4.md +0 -27
- package/skills/realign/notes/0.0.5.md +0 -38
- package/skills/realign/notes/0.0.6.md +0 -44
- package/skills/realign/notes/0.0.7.md +0 -11
- package/skills/realign/notes/0.0.8.md +0 -97
- package/skills/realign/notes/0.0.9.md +0 -59
- package/skills/realign/notes.md +0 -40
- package/skills/rethink/SKILL.md +0 -62
- package/skills/rethink/levels.md +0 -54
- package/skills/roadmap/SKILL.md +0 -54
- package/skills/roles/auditor.md +0 -35
- package/skills/roles/design-reviewer.md +0 -43
- package/skills/roles/design-rubric.md +0 -41
- package/skills/roles/plan-rubric.md +0 -11
- package/skills/roles/surveyor.md +0 -41
- package/skills/roles/verifier.md +0 -42
- package/skills/triage/SKILL.md +0 -37
- package/skills/verify/SKILL.md +0 -45
- package/skills/verify/manual-test.md +0 -23
- package/src/adapters/inbound/cli/argument_files.ts +0 -29
- package/src/adapters/inbound/cli/commands/diff.ts +0 -23
- package/src/adapters/inbound/cli/commands/journal.ts +0 -32
- package/src/adapters/inbound/cli/commands/progress.ts +0 -55
- package/src/adapters/inbound/cli/commands/realign.ts +0 -28
- package/src/adapters/inbound/cli/commands/show.ts +0 -96
- package/src/app/use_cases/abandon_work.ts +0 -42
- package/src/app/use_cases/approve_artifact.ts +0 -197
- package/src/app/use_cases/journal_events.ts +0 -64
- package/src/app/use_cases/land_change.ts +0 -134
- package/src/app/use_cases/new_project_doc.ts +0 -48
- package/src/app/use_cases/new_work_item.ts +0 -75
- package/src/app/use_cases/realign_done.ts +0 -45
- package/src/app/use_cases/realign_status.ts +0 -106
- package/src/app/use_cases/record_progress.ts +0 -118
- package/src/app/use_cases/show_elements.ts +0 -18
- package/src/app/use_cases/show_notes.ts +0 -11
- package/src/app/use_cases/show_scope.ts +0 -51
- package/src/app/use_cases/upstream_diff.ts +0 -55
- package/src/domain/approvals/agent_approval.ts +0 -68
- package/src/domain/approvals/evaluate.ts +0 -36
- package/src/domain/approvals/fingerprint.ts +0 -52
- package/src/domain/approvals/rebase.ts +0 -39
- package/src/domain/approvals/records.ts +0 -50
- package/src/domain/approvals/upstream_text.ts +0 -36
- package/src/domain/architecture_sections.ts +0 -23
- package/src/domain/check/decision_comments.ts +0 -38
- package/src/domain/decision_citations.ts +0 -62
- package/src/domain/edits/agents_file.ts +0 -58
- package/src/domain/edits/managed_tables.ts +0 -60
- package/src/domain/edits/progress_block.ts +0 -33
- package/src/domain/edits/status_lines.ts +0 -52
- package/src/domain/elements.ts +0 -126
- package/src/domain/journal.ts +0 -109
- package/src/domain/land/bookkeeping.ts +0 -54
- package/src/domain/land/merge_plan.ts +0 -137
- package/src/domain/land/text_ops.ts +0 -66
- package/src/domain/line_diff.ts +0 -56
- package/src/domain/project/artifact_ref.ts +0 -42
- package/src/domain/project/deltas.ts +0 -49
- package/src/domain/project/element_lookup.ts +0 -124
- package/src/domain/project/living_model.ts +0 -55
- package/src/domain/project/new_items.ts +0 -48
- package/src/domain/project/notes.ts +0 -74
- package/src/domain/project/plan_parts.ts +0 -111
- package/src/domain/project/progress.ts +0 -43
- package/src/domain/project/project_view.ts +0 -72
- package/src/domain/project/roadmap.ts +0 -43
- package/src/domain/project/scope_view.ts +0 -134
- package/src/domain/project/work_items.ts +0 -68
- package/src/domain/status/next_step.ts +0 -181
- package/src/domain/status/pending_rethink.ts +0 -22
- package/src/domain/status/verification.ts +0 -29
- package/src/domain/status/work_status.ts +0 -125
- package/src/domain/validation/decision_rules.ts +0 -76
- package/src/domain/validation/delta_rules.ts +0 -81
- package/src/domain/validation/element_rules.ts +0 -104
- package/src/domain/validation/future_rules.ts +0 -40
- package/src/domain/validation/living_rules.ts +0 -99
- package/src/domain/validation/plan_rules.ts +0 -124
- package/src/domain/validation/project_rules.ts +0 -115
- package/src/domain/validation/size_rules.ts +0 -45
- package/src/domain/validation/vision_rules.ts +0 -41
- package/src/domain/validation/work_item_rules.ts +0 -175
- package/src/domain/versions/realign_notes.ts +0 -72
- package/src/domain/versions/rule_versions.ts +0 -29
- package/src/domain/versions/scheduled_exceptions.ts +0 -41
- package/templates/init/gitattributes +0 -2
package/skills/build/SKILL.md
CHANGED
|
@@ -1,65 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-build
|
|
3
|
-
description: Builds
|
|
3
|
+
description: Builds an approved feature test-first, one scenario at a time, with ports and adapters as the architecture maps them, stopping for the user only when a scenario or the public API has to change.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Build
|
|
7
7
|
|
|
8
|
-
Build turns an approved
|
|
8
|
+
Build turns an approved feature into working, tested code without asking the user anything, unless what they approved has to change. Each scenario starts as a failing behaviour test and ends as a green, checked commit.
|
|
9
9
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
|
-
1. **
|
|
13
|
-
|
|
14
|
-
- Override it only when the user explicitly asks, with `cruze status --gate build --override "<their reason>"`. The override is journaled.
|
|
15
|
-
2. **Load the standards.** Read these, and follow them for every task:
|
|
12
|
+
1. **Check the approval.** Run `cruze status`. The feature must be `approved`; when it is `unapproved` or `edited`, stop and run `shape` first.
|
|
13
|
+
2. **Load the standards** and follow them throughout:
|
|
16
14
|
- `.agents/skills/cruze-behavioural-testing/SKILL.md`
|
|
17
15
|
- `.agents/skills/cruze-hexagonal-design/SKILL.md`, and its language file when one exists for the project's language
|
|
18
16
|
- `.agents/skills/cruze-dependency-approval/SKILL.md`
|
|
19
|
-
3. **Read the
|
|
20
|
-
4. **Build
|
|
21
|
-
5. **
|
|
22
|
-
|
|
23
|
-
- Run `cruze check --ci` and `cruze trace`, and quote their results.
|
|
24
|
-
- When all of them pass, record the commit they ran at with `cruze journal add checks --set commit=<commit> --item <ref>`, where the commit is the output of `git rev-parse --short HEAD`. Verify quotes this instead of running the suite again.
|
|
25
|
-
- Commit the progress record with a message such as `chore: record progress on <change>`.
|
|
26
|
-
- Done when all of them pass and the checks are recorded.
|
|
17
|
+
3. **Read the design:** the feature file, and the sections of `docs/architecture.md` its stack sketch touches. Done when you can name, for each scenario, the use case it runs and the ports it crosses.
|
|
18
|
+
4. **Build the foundation first,** when this is the release's first feature. See "The foundation" below.
|
|
19
|
+
5. **Build each scenario in order,** with the loop below.
|
|
20
|
+
6. **Finish.** Run the formatter, the linter, the build and the full test suite, then `cruze check --ci` and `cruze trace <slug>`, and fix what they report. Set the feature's status line to `- Status: built`, and commit. Done when every one of them passes.
|
|
27
21
|
|
|
28
|
-
## The
|
|
22
|
+
## The loop
|
|
29
23
|
|
|
30
|
-
For
|
|
24
|
+
For each scenario:
|
|
31
25
|
|
|
32
|
-
1. **
|
|
33
|
-
2. **
|
|
34
|
-
3. **
|
|
35
|
-
4. **
|
|
36
|
-
5. **Commit** with a Conventional Commit message naming the task, such as `feat(access): console session state machine (T2)`.
|
|
37
|
-
6. **Tick it.** Run `cruze task done T<n>`, which records the commit. Its progress edit rides along in the next commit.
|
|
26
|
+
1. **Red.** Write the behaviour test at the seam the testing skill names, carrying the scenario's ID in a comment or string, with the scenario's values as its expected values. Run it, and see it fail for the reason you expect.
|
|
27
|
+
2. **Green.** Write the code that makes it pass, inside out: domain types, then the use case, then the port, then the adapter, then the wiring in the composition root. Each port the stack sketch names gets a fake that honours its contract, and a contract test that both the fake and the real adapter pass.
|
|
28
|
+
3. **Check.** Run `cruze check --ci` on the files you touched, the formatter and the linter, and the tests near what you changed.
|
|
29
|
+
4. **Commit** with a Conventional Commit message, such as `feat(export): write rows as CSV (SCN-export-csv.basic)`.
|
|
38
30
|
|
|
39
|
-
|
|
31
|
+
Done for a scenario when its test passes, the checks pass and the commit exists.
|
|
40
32
|
|
|
41
|
-
|
|
33
|
+
## Deciding as you go
|
|
42
34
|
|
|
43
|
-
|
|
35
|
+
Decide everything local yourself: private helpers, file splits, internal types, test fixtures, an ordinary library. Note any choice a reviewer or the user might question in the feature's `## Decisions`, one line with the reason. Ask nothing about these.
|
|
44
36
|
|
|
45
|
-
|
|
37
|
+
Stop and run `shape` when the code needs any of these:
|
|
46
38
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
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.
|
|
39
|
+
- a scenario's behaviour or message to change, or a new scenario;
|
|
40
|
+
- a change to the public API the user approved;
|
|
41
|
+
- a significant dependency the architecture doesn't name;
|
|
42
|
+
- a port or a runtime change the architecture doesn't allow.
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
Show the user what changed, as code or output, before and after, and get the approval again. Then carry on; finished scenarios keep their commits.
|
|
45
|
+
|
|
46
|
+
## The foundation
|
|
47
|
+
|
|
48
|
+
The first feature of a release also sets up what every later feature relies on:
|
|
49
|
+
|
|
50
|
+
- the project's build, with the layers of `docs/architecture.md` as directories and `source`, `tests` and `layers` in `.cruze/config.yaml` matching them;
|
|
51
|
+
- CI in `.github/workflows/ci.yml` that runs the formatter, the linter, the build, the full test suite, and a line coverage gate, such as `cargo llvm-cov --fail-under-lines 80`, alongside the Cruze checks already there;
|
|
52
|
+
- `## Commands` and `## Layout` in `AGENTS.md`, filled in from what exists;
|
|
53
|
+
- the project's test and lint commands added to what `review.command` in `.cruze/config.yaml` allows, as `.agents/skills/cruze-formats/config.md` shows, so the reviewer can run them.
|
|
58
54
|
|
|
59
55
|
## Protecting the check
|
|
60
56
|
|
|
61
|
-
Never weaken, skip or delete a
|
|
57
|
+
Never weaken, skip or delete a test to get green. A failing test means the code is wrong, or the scenario is, and a wrong scenario goes through `shape`.
|
|
62
58
|
|
|
63
59
|
## Next step
|
|
64
60
|
|
|
65
|
-
`
|
|
61
|
+
`review`, once the finishing checks pass.
|
|
@@ -1,55 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-dependency-approval
|
|
3
|
-
description: The rule
|
|
3
|
+
description: The rule for adding dependencies to a Cruze project, covering which need the user's approval, how to ask, and where each is recorded. Use when a design would add a library, package, crate, framework, tool or vendored code; before editing a dependency manifest; when build needs something the design didn't name; and when reviewing a diff that changes dependency declarations.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Dependency approval
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Adopt a mature library wherever the clean design uses one. Only a significant dependency needs the user's explicit approval before it is declared or relied on; adopt any other without asking, and record it. A stricter policy in the vision's `## Constraints` wins.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Significant
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
2. Choose a recommendation, following `.agents/skills/cruze-research/SKILL.md`, which also says where versions come from.
|
|
14
|
-
3. Say where it will sit: the module that owns it, and the port that keeps it out of the core when it is infrastructure.
|
|
15
|
-
4. Name the realistic alternatives, including writing it yourself and what owning that code would cost. Never offer a hand-written alternative for cryptography, TLS or a security protocol.
|
|
16
|
-
5. Ask, then wait. Nothing is declared, installed or written against it until the user answers.
|
|
12
|
+
A package new to the project is significant when any of these holds:
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- It is hard to reverse: an async runtime, an application or UI framework, a database, or a wire or storage format with its code generator.
|
|
15
|
+
- It brings native code or a build requirement: C or C++ bindings such as a `-sys` crate, a system library, or a toolchain the build must install.
|
|
16
|
+
- Its licence isn't permissive, such as MIT, Apache-2.0, BSD or ISC.
|
|
17
|
+
- It does security work: cryptography, TLS, authentication or sandboxing.
|
|
18
|
+
- Research found a risk in its health or security record, or it breaks a vision constraint.
|
|
19
|
+
- It arrives outside the registry: vendored or copied code, a git dependency or a submodule.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
None of these needs approval or a record beyond the manifest: a feature of a package the project uses, declaring it in another crate, workspace member or target, or as a development dependency, and transitive dependencies. Version upgrades follow the project's upgrade policy; point out one that changes licensing, platforms or behaviour.
|
|
22
|
+
|
|
23
|
+
## Asking
|
|
24
|
+
|
|
25
|
+
For a significant dependency:
|
|
26
|
+
|
|
27
|
+
1. Establish the need: the capability, and the design with it and without it, as short code sketches following `.agents/skills/cruze-asking/SKILL.md`.
|
|
28
|
+
2. Choose a recommendation, following `.agents/skills/cruze-research/SKILL.md`, which also says where versions come from. Say which adapter owns it, and the port that keeps it out of the core when it is infrastructure.
|
|
29
|
+
3. Name the realistic alternatives, including writing it yourself and what owning that code would cost. Never offer a hand-written alternative for cryptography, TLS or a security protocol.
|
|
30
|
+
4. Ask, then wait. Nothing is declared, installed or written against it until the user answers.
|
|
24
31
|
|
|
25
32
|
```markdown
|
|
26
|
-
**Dependency: `russh` for SSH hops**
|
|
27
|
-
- Why not std or existing: the standard library has no SSH client, and no
|
|
33
|
+
**Dependency: `russh` for SSH hops** (significant: security protocol)
|
|
34
|
+
- Why not std or existing: the standard library has no SSH client, and no dependency the project uses provides one.
|
|
28
35
|
- Checked: <version from the registry> (released <date>), Apache-2.0, <release cadence>, pure Rust, <n> transitive crates.
|
|
29
|
-
- Sits in:
|
|
36
|
+
- Sits in: the SSH transport adapter, behind the console transport port.
|
|
30
37
|
- Alternatives: `ssh2` binds libssh2 (C, needs OpenSSL on macOS); shelling out to `ssh` loses error detail.
|
|
31
38
|
Recommended: adopt `russh`. Approve?
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
The user approves by naming the dependency ("use serde"), or by approving an architecture whose Technology table names it.
|
|
42
|
+
|
|
43
|
+
## Weighing
|
|
35
44
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- Researching, reading docs or source, and comparing options need no approval.
|
|
45
|
+
- Recommend the cleanest design: the one an experienced developer in the language would write, with the least code to own. A dependency, crate or feature is not a cost in itself. Weigh concrete costs: release health, security record, licence, and build time or binary size where a constraint makes them matter.
|
|
46
|
+
- "No new dependency" is never the reason for a choice. Name what the chosen option does better.
|
|
47
|
+
- A structure the language requires for an idiom, such as a separate crate for a derive macro, is part of that idiom, not an extra cost.
|
|
48
|
+
- Hand-writing commodity functionality is the user's call, not adopting a library: a parser, serializer, codec, stream combinator, CLI parser, retries, compression, or date and time handling. Code or a shell command that exists only to avoid a dependency is a design flaw.
|
|
41
49
|
|
|
42
50
|
## Recording
|
|
43
51
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
- When a build finds it needs a dependency the design didn't name, stop the task and ask as above. An approval changes the design, so record it through the rethink step at feature level, or at change level for a standalone change. A refusal keeps the decision open: don't add the package provisionally, and don't hand-write a replacement unless the user chooses that.
|
|
52
|
+
- The architecture's `## Technology` table records each significant dependency and each framework, with why. An ordinary library needs no record beyond the manifest.
|
|
53
|
+
- Hand-writing commodity functionality is recorded in the feature's `## Decisions`, with the concrete reason for owning the code.
|
|
54
|
+
- When build needs a significant package the architecture doesn't name, stop and ask as above. A refusal keeps the decision open: don't add the package provisionally, and don't hand-write a replacement unless the user chooses that.
|
|
48
55
|
|
|
49
56
|
## Checking
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- Every new direct dependency has a record. An unrecorded one is a blocker, even when the build passes.
|
|
54
|
-
- Lockfile churn alone isn't a new dependency.
|
|
55
|
-
- Done when you can list each new direct dependency next to the row or fact that approved it.
|
|
58
|
+
When reviewing a diff, compare every place dependencies are declared, such as `Cargo.toml` or `package.json`, CMake `FetchContent`, `.gitmodules` and copied third-party code, with the architecture's Technology table. A significant package without the user's approval is a blocker, even when the build passes.
|
package/skills/envision/SKILL.md
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-envision
|
|
3
|
-
description:
|
|
3
|
+
description: Starts a project, or a major shift in one, by putting the user's vision on paper, breaking the release into features with what each needs, and designing the architecture map those features and the future ones fit into.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Envision
|
|
7
7
|
|
|
8
|
-
Envision
|
|
8
|
+
Envision runs at the start of a project, and again when the product changes direction or a release is done. It turns the user's idea into three things everything later reads: a vision with future features, the release broken into features, and an architecture map designed with all of them in view. The user approves two documents once each, and the agent decides everything else.
|
|
9
|
+
|
|
10
|
+
Read `.agents/skills/cruze-asking/SKILL.md` before the first question, and `.agents/skills/cruze-formats/SKILL.md` before writing a document.
|
|
9
11
|
|
|
10
12
|
## Steps
|
|
11
13
|
|
|
12
|
-
1. **
|
|
13
|
-
2. **
|
|
14
|
-
3. **
|
|
15
|
-
4. **
|
|
16
|
-
5. **
|
|
14
|
+
1. **Take in what the user has.** The user's idea may be a sentence, a long document or a conversation. Read all of it, and the repository's README and code if there are any. When the user shares a document, keep it next to the docs, such as `docs/seed.md`, so nothing in it is lost. Done when you can say the product's purpose in one sentence.
|
|
15
|
+
2. **Write the vision.** Run `cruze new vision` if `docs/vision.md` doesn't exist, then fill in the problem, users, terms, non-goals and constraints from what the user said, in their words. Leave the Release and Future features tables for steps 3 and 4. Mark anything you inferred rather than read, so the user can see it.
|
|
16
|
+
3. **Ask what may come later,** as [possibilities.md](possibilities.md) says, and fill in `## Future features`. Done when the table holds every likely neighbour the user agreed to, each with what must stay possible.
|
|
17
|
+
4. **Break the release into features,** as [breakdown.md](breakdown.md) says, and fill in the `## Release` table. Done when `cruze validate` reports no release problem.
|
|
18
|
+
5. **Show the vision and the breakdown.** In one message: the product in two sentences; the release's features as a short table, with a plain-text diagram of what needs what; the future features in one line each; and every point you inferred. Ask one question: "Is anything missing, merged wrong, or in the wrong order?" Apply the answer. When the user approves, run `cruze approve vision`. Done when the vision is approved.
|
|
19
|
+
6. **Design the architecture map,** as [architecture.md](architecture.md) says. Done when `docs/architecture.md` exists, `cruze validate` reports no problem in it, and `.cruze/config.yaml` has its `source`, `tests` and `layers`.
|
|
20
|
+
7. **Show the architecture.** In one message, illustrated as `.agents/skills/cruze-asking/SKILL.md` says:
|
|
21
|
+
- a plain-text diagram of the ports and adapters, marking which serve future features;
|
|
22
|
+
- the runtime model in three lines: threads or tasks, the limits that matter, and what happens at shutdown;
|
|
23
|
+
- the core ports as code, with their errors;
|
|
24
|
+
- each technology choice and significant dependency, with why;
|
|
25
|
+
- every decision you took that the user might question.
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
Ask: "Do you approve this architecture, or what should change?" Apply changes and show what moved. When the user approves, run `cruze approve architecture`. Done when it is approved.
|
|
28
|
+
8. **Write the README** for someone who has never heard of the project: what it is and who it is for, in the vision's words; its status, such as "designing the first release", with the release's features in one line each; a short paragraph and the overview diagram of how it is built, in plain text so it reads anywhere; and where the vision, architecture and features live. Leave out what isn't true yet, such as install or usage steps. Done when nothing in it contradicts the vision or the architecture.
|
|
29
|
+
9. **Commit** the documents, the README and the config with a message such as `docs: envision <project>`.
|
|
19
30
|
|
|
20
|
-
|
|
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
|
-
- 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
|
-
- 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.
|
|
25
|
-
- Only the CLI writes the feature map. Use `cruze features add`, `cruze features update` and `cruze features drop`.
|
|
31
|
+
## A major shift or the next release
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
When the vision exists, edit it rather than starting again: move built features out of `## Release`, add the next release's features and update what they need, and move future features in when they join. Change the architecture map only where the new features move a boundary. Then show what changed and approve as in steps 5 and 7, and bring the README's status up to date.
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
- After feature scope: run `architect "<feature>"`.
|
|
35
|
+
## Next step
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
`shape` for the first feature of the release, which `cruze next` names.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Designing the architecture map
|
|
2
|
+
|
|
3
|
+
The architecture map is what every feature's shape and build read first. It says where things live and how the system runs, for the whole release, and leaves room for the future features. Keep it to what changes how code is written: under 3,000 words.
|
|
4
|
+
|
|
5
|
+
Read `.agents/skills/cruze-hexagonal-design/SKILL.md` and its language file, and `.agents/skills/cruze-dependency-approval/SKILL.md`. When a choice needs evidence, such as which library fits or whether a platform supports something, follow `.agents/skills/cruze-research/SKILL.md`.
|
|
6
|
+
|
|
7
|
+
1. **Trace each release feature through a hexagon.** For each, name the inbound adapter it arrives through, the use case it runs, the domain it touches and what it needs from outside: storage, network, devices, time. Each thing it needs from outside is a port.
|
|
8
|
+
2. **Check the future features against it.** For each, name what must stay possible and the boundary that keeps it so, such as a port that a second adapter could implement, or a type that doesn't assume one owner. Build nothing for them.
|
|
9
|
+
3. **Write the ports.** For each, its operations as code in the project's language, each with its errors and every number it depends on: timeouts, limits, buffer sizes.
|
|
10
|
+
4. **Write the runtime.** The threading or async model; where work queues, and what a full queue does; how a failed dependency is noticed and recovered from; what shutdown waits for and for how long. Follow `.agents/skills/cruze-hexagonal-design/runtime.md`.
|
|
11
|
+
5. **Choose the technology.** The language and framework, and each significant dependency, through the dependency-approval skill. Record each with why in one line.
|
|
12
|
+
6. **Write the layers** in prose, then as `layers:` in `.cruze/config.yaml`, with `source` and `tests` globs for the project's language, as `.agents/skills/cruze-formats/config.md` shows.
|
|
13
|
+
7. **Draw the overview** as a Mermaid flowchart: inbound adapters, the core, the ports and the adapters behind them.
|
|
14
|
+
8. **Record the decisions** that shape the whole system, one line each with the reason.
|
|
15
|
+
|
|
16
|
+
Done when `cruze validate` reports no problem in `docs/architecture.md` or the config.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Breaking the release into features
|
|
2
|
+
|
|
3
|
+
A feature is a slice the user can see working: a command that answers, a screen that shows something, a device that changes state. The release's features, built in order, deliver what the vision promises.
|
|
4
|
+
|
|
5
|
+
1. **Choose the foundation.** The first feature is the one everything else builds on and the user tries first. Pick the kind that fits, and say why when you show the breakdown:
|
|
6
|
+
- **Walking skeleton:** one real use case through every layer, from the inbound adapter to a driven adapter. It suits most systems.
|
|
7
|
+
- **Core component:** the component the others depend on, working for real through its own interface, such as a server with its command-line client. It suits a system of several components.
|
|
8
|
+
- **Product shell:** every screen or command the release offers, wired together over sample data. It suits settling look and flows before logic.
|
|
9
|
+
2. **List the slices.** Walk the vision's promise from the user's side and cut it where the user could stop and try something. Name each feature with a slug the user would recognise, such as `sign-in` or `export-csv`.
|
|
10
|
+
3. **Size each one** for one shape and one build: about 3 to 10 scenarios, the user's words for its behaviour fitting on a page. Split a bigger one along what the user can try first. Merge one that the user couldn't try without another.
|
|
11
|
+
4. **Name what each needs.** A feature needs another when it can't be built or tried without it. Ordering for convenience isn't a need.
|
|
12
|
+
5. **Order for the product, not the platform.** Put the features that prove the product's core purpose as early as their needs allow. Shared machinery, such as a plugin system, a scheduler or a generic store, goes in no feature of its own: it arrives inside the second feature that needs it. One project built six days of infrastructure and no product, and was restarted.
|
|
13
|
+
|
|
14
|
+
Done when every promise of the release is in some feature, and the Release table lists them in build order with their needs.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# Exploring what may come later
|
|
2
2
|
|
|
3
|
-
The user knows where the product is heading better than any document does, but rarely says it unprompted. Ask, so
|
|
3
|
+
The user knows where the product is heading better than any document does, but rarely says it unprompted. Ask, so the architecture leaves room for it and never closes it off.
|
|
4
4
|
|
|
5
|
-
1. **Find the neighbours.** For
|
|
6
|
-
2. **Ask them
|
|
5
|
+
1. **Find the neighbours.** For the product's users and the release's features, name what products in this domain commonly grow into, from what you know of the domain and its standards, as the user would recognise them: single sign-on next to sign-in, sync across devices next to local-only storage, teams next to a single-user app, plugins next to a fixed set of kinds, a second transport next to a local socket. Skip those the vision already records as future features or non-goals.
|
|
6
|
+
2. **Ask them in one question:** which of these the product may need, the likeliest first, three to five of them, with your recommendation for each. "No" is a good answer too.
|
|
7
7
|
3. **Record each answer:**
|
|
8
|
-
- **
|
|
9
|
-
- **No, for a tempting neighbour
|
|
8
|
+
- **Yes or maybe:** a row in `## Future features`, with what it would let the user do and what no design may rule out. 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:** a non-goal with the reason, so nobody proposes it again.
|
|
10
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
11
|
|
|
13
|
-
Done when every
|
|
12
|
+
Done when every answer is recorded.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cruze-fix
|
|
3
|
+
description: Takes a reported bug, from the user or an issue, from symptom to a merged fix, reproducing it with a failing test first, fixing the root cause, and reviewing the fix, going back to the user only when the fix changes approved behaviour.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fix
|
|
7
|
+
|
|
8
|
+
A bug report becomes a failing test, then a fix, then a reviewed pull request. Most bugs are code that doesn't do what its feature's scenario says, and those need nothing from the user. Only when the fix would change what a scenario or the public API says does the user decide.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Capture the symptom** from the user or the issue: the exact steps, what happened (output, error, exit code), what the user expected, and the environment. Done when you can write the steps as commands.
|
|
13
|
+
2. **Reproduce it** against the real system. Done when you can make it fail on demand and have quoted the output. When you can't, ask the user what differs in their environment, and stop until you can.
|
|
14
|
+
3. **Find the scenario** in `docs/features/` that covers this behaviour, and classify the bug:
|
|
15
|
+
- **The code is wrong:** a scenario says what should happen, and the code does something else.
|
|
16
|
+
- **A scenario is missing:** no scenario covers this case, and the right behaviour is obvious from the feature, such as a crash where the feature already says what failure looks like.
|
|
17
|
+
- **The behaviour is the user's call:** the right behaviour isn't obvious, or the fix changes what a scenario or the public API says.
|
|
18
|
+
4. **Find the root cause.** Trace the failing path until you can name the first wrong decision, not the place the error surfaces.
|
|
19
|
+
5. **Write the failing test first** on a branch such as `fix/<slug>`, at the seam `.agents/skills/cruze-behavioural-testing/SKILL.md` names, carrying the scenario's ID. For a missing scenario, add it to the feature file first, in the same style as its neighbours. Run the test, and see it fail for this bug's reason.
|
|
20
|
+
6. **Fix it** with the smallest change in the code that owns the wrong decision. Run `cruze check --ci`, `cruze trace` and the full suite.
|
|
21
|
+
7. **Ask the user only when it is their call.** Show the bug, the behaviour you recommend, and the change to the feature as before and after, as `.agents/skills/cruze-asking/SKILL.md` says. Edit the feature, and run `cruze approve <slug>` once they agree. Do this on the same branch.
|
|
22
|
+
8. **Review the fix:** run the code reviewer on the fix's diff, as `review` says, and fix what it finds.
|
|
23
|
+
9. **Land it.** Commit with a message such as `fix(<scope>): <what the user saw>`, add a line under `### Fixed` in `CHANGELOG.md`, and open a pull request or merge as the project does.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- A missing test is part of the cause. When the scenario had a test that passed anyway, say why it missed the bug, and strengthen it in the same fix.
|
|
28
|
+
- Fix the cause only. Clean-ups you notice go to the user as suggestions.
|
|
29
|
+
- Never change a scenario to match the code without the user's approval.
|
|
30
|
+
- A bug found during other work and not fixed then becomes an issue in the project's tracker, such as GitHub: the symptom, how to reproduce it, the cause when known, and the scenario it breaks. `fix` starts from it later; an agent's memory is no place for it.
|
|
31
|
+
|
|
32
|
+
## Next step
|
|
33
|
+
|
|
34
|
+
`cruze next`, or the next bug.
|
package/skills/formats/SKILL.md
CHANGED
|
@@ -1,95 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cruze-formats
|
|
3
|
-
description: The formats
|
|
3
|
+
description: The formats of every Cruze project document, with templates. Use when reading, writing or reviewing docs/vision.md, docs/architecture.md, docs/features/, or .cruze/config.yaml in a Cruze project.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Cruze document formats
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
A Cruze project has three kinds of document, all Markdown that people read and `cruze` parses. Create each with `cruze new`, which starts it from its template ([vision](templates/vision.md), [architecture](templates/architecture.md) or [feature](templates/feature.md)), and replace every `<angle-bracket>` guide. `cruze validate` reports what drifts.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
| Path | Document | Written by |
|
|
10
|
+
| Path | What it holds | Written by |
|
|
13
11
|
| --- | --- | --- |
|
|
14
|
-
| `docs/vision.md` |
|
|
15
|
-
| `docs/
|
|
16
|
-
| `docs/
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| `
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| `VIEW` | Overview diagram | architecture | none |
|
|
51
|
-
| `XC` | Cross-cutting concern | architecture | none |
|
|
52
|
-
| `REQ` | Requirement | specs | capability |
|
|
53
|
-
| `SCN` | Scenario of a requirement | specs | capability |
|
|
54
|
-
| `ADR` | Decision record, named by its file stem | `docs/adr/` | none |
|
|
55
|
-
|
|
56
|
-
## Elements
|
|
57
|
-
|
|
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.
|
|
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.
|
|
60
|
-
- Element facts are list items of the form `- Key: value`, directly in the element's body. Sub-items hold lists of values.
|
|
61
|
-
- An element cites another by writing its ID anywhere in its body. Every ID a document mentions counts as cited.
|
|
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.
|
|
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
|
-
|
|
73
|
-
## Managed content
|
|
74
|
-
|
|
75
|
-
The CLI owns some content so that routine bookkeeping never changes a design:
|
|
76
|
-
|
|
77
|
-
- A block between `<!-- cruze:managed -->` and `<!-- /cruze:managed -->` is written only by the CLI.
|
|
78
|
-
- A `- Status: planned` or `- Status: built` item in an element body is written only by the CLI. Elements that have code (`ENT`, `UC`, `PORT`, `ADP`, `FLOW`, `MOD`) and scenarios (`SCN`) carry one.
|
|
79
|
-
- Both are excluded from every hash. Read them freely; change them only through `cruze` commands:
|
|
80
|
-
- `cruze approve` adds missing statuses to the architecture, sets built elements back to planned with `--replan`, and binds a change to its branch. With `--by-agent` it approves a change whose plan review closed, and with `--restamp-unchanged` it re-stamps work a rethink left unchanged, recording that the agent gave the approval.
|
|
81
|
-
- `cruze task` records progress, and `cruze features` edits the feature map.
|
|
82
|
-
- `cruze land` merges work, marks it built and fills the Commands and Layout sections of `AGENTS.md`.
|
|
83
|
-
- `cruze roadmap prune` and `cruze abandon` update the roadmap's status.
|
|
84
|
-
|
|
85
|
-
## Reference files
|
|
86
|
-
|
|
87
|
-
Read the one that matches the document in front of you:
|
|
88
|
-
|
|
89
|
-
- [reference/architecture.md](reference/architecture.md) for `docs/architecture.md` and architecture deltas.
|
|
90
|
-
- [reference/specs.md](reference/specs.md) for `docs/specs/`, requirements, scenarios and spec deltas.
|
|
91
|
-
- [reference/work-items.md](reference/work-items.md) for `feature.md`, `change.md`, test plans and task lines.
|
|
92
|
-
- [reference/durable-docs.md](reference/durable-docs.md) for vision, glossary, ADRs and the roadmap.
|
|
93
|
-
- [reference/config.md](reference/config.md) for `.cruze/config.yaml`.
|
|
94
|
-
|
|
95
|
-
Create documents with `cruze new`: `cruze new vision`, `glossary`, `architecture` or `roadmap` for the project documents, and `cruze new feature`, `change`, `adr` or `note <slug> --title <title>` for the rest. It starts each one from the matching file in `templates/` and fills the `{{placeholders}}`. Replace every `<angle-bracket>` guide.
|
|
12
|
+
| `docs/vision.md` | The problem, users, terms, the release's features and what each needs, future features and what must stay possible, non-goals, constraints | envision |
|
|
13
|
+
| `docs/architecture.md` | The map: an overview diagram, ports with their operations, adapters, the runtime model, technology, layers, decisions | envision; shape when a feature moves a boundary |
|
|
14
|
+
| `docs/features/<slug>.md` | One feature: intent, behaviour as scenarios, public API as code, a stack sketch, decisions | shape; build marks it built |
|
|
15
|
+
| `.cruze/config.yaml` | Project configuration; see [config.md](config.md) | `cruze init`, the foundation feature |
|
|
16
|
+
|
|
17
|
+
Only `cruze approve` writes `.cruze/approvals.json`.
|
|
18
|
+
|
|
19
|
+
## The vision's Release table
|
|
20
|
+
|
|
21
|
+
`## Release` holds a table with the columns `Feature | Summary | Needs`, one row per feature of the release, in the order they should be built. Feature is the slug of its `docs/features/` file. Needs lists the slugs, comma-separated, of the features it can't be built without; leave it blank when there are none. `cruze next` picks the first feature not yet shaped whose needs are all built, and `cruze validate` refuses an unknown slug and a circle of needs.
|
|
22
|
+
|
|
23
|
+
`## Future features` uses `Feature | Summary | Must stay possible`. These shape boundaries in the architecture; nothing is built for them until they join a release.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
A feature file starts with its title and a status line:
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
# Sign in
|
|
31
|
+
|
|
32
|
+
- Status: shaped
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The status is `shaped` until build finishes the feature, then `built`. The sections are `## Intent`, `## Behaviour`, `## Public API`, `## Stack sketch` and `## Decisions`, in that order.
|
|
36
|
+
|
|
37
|
+
Each scenario under `## Behaviour` is a heading `### SCN-<slug>.<name>: <title>`, where `<slug>` is the feature's and `<name>` is lowercase words joined by hyphens, followed by Given, When and Then bullets in the user's words. A scenario ID is never reused, even after its scenario is removed, and the test that proves a scenario carries its ID in a comment or string, such as `// SCN-sign-in.wrong-password`. `cruze trace` fails when a built feature's scenario has no test, or a test names a scenario no feature defines.
|
|
38
|
+
|
|
39
|
+
A later feature that changes an earlier one's behaviour edits that feature's file in place, and git keeps the history.
|
|
40
|
+
|
|
41
|
+
## Approvals
|
|
42
|
+
|
|
43
|
+
`cruze approve <vision|architecture|slug>` records a hash of the document's content as the user approved it. Any later edit shows it as `edited` in `cruze status` until it is approved again. The status line and a feature's `## Decisions` are left out of the hash, so marking a feature built or recording a decision never counts as an edit. Approve only on the user's word.
|
|
44
|
+
|
|
45
|
+
## Size
|
|
46
|
+
|
|
47
|
+
A document is for a person to read in one sitting. `cruze validate` warns past 1,500 words for the vision, 3,000 for the architecture and 2,500 for a feature. Cut what the agent decided that the user needn't read, or split the feature.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Configuration format
|
|
2
|
+
|
|
3
|
+
`.cruze/config.yaml` configures the CLI for one project. `cruze init` creates it, and the foundation feature fills in `source`, `tests` and `layers` from `docs/architecture.md`.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
version: 2
|
|
7
|
+
cruze: "0.0.14"
|
|
8
|
+
project: "Console Access"
|
|
9
|
+
|
|
10
|
+
source: ["src/**/*.rs"]
|
|
11
|
+
tests: ["src/**/*.rs", "tests/**/*.rs"]
|
|
12
|
+
|
|
13
|
+
check:
|
|
14
|
+
max_lines: 600
|
|
15
|
+
max_types: 12
|
|
16
|
+
exceptions:
|
|
17
|
+
- path: src/cli/args.rs
|
|
18
|
+
reason: the clap derive struct lists every flag in one place
|
|
19
|
+
|
|
20
|
+
layers:
|
|
21
|
+
- name: domain
|
|
22
|
+
paths: ["src/domain/**"]
|
|
23
|
+
may_import: []
|
|
24
|
+
- name: app
|
|
25
|
+
paths: ["src/app/**"]
|
|
26
|
+
may_import: [domain]
|
|
27
|
+
- name: adapters
|
|
28
|
+
paths: ["src/adapters/**"]
|
|
29
|
+
may_import: [app, domain]
|
|
30
|
+
|
|
31
|
+
review:
|
|
32
|
+
command: ["claude", "-p", "--allowedTools", "Read Grep Glob Bash(git diff:*) Bash(git log:*) Bash(git show:*) Bash(cruze:*) Bash(cargo test:*)"]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
| Key | Meaning |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `version` | Format version, `2`. |
|
|
38
|
+
| `cruze` | The Cruze version whose skills the project installed. `cruze install` writes it. |
|
|
39
|
+
| `project` | The project name, quoted. |
|
|
40
|
+
| `source` | Globs of the source files `cruze check` inspects. |
|
|
41
|
+
| `tests` | Globs of the files `cruze trace` searches for scenario IDs. |
|
|
42
|
+
| `check.max_lines`, `check.max_types` | Budgets per source file, lines and top-level types, that `cruze check` warns past: a backstop against a file that has outgrown one responsibility, never a size to design to. A Rust file's `#[cfg(test)]` modules don't count. |
|
|
43
|
+
| `check.exceptions` | Files allowed past a budget, each with a `path` and a `reason`. |
|
|
44
|
+
| `layers` | Each layer has a `name`, the `paths` it covers, and `may_import`, the layers it may depend on. |
|
|
45
|
+
| `review.command` | The program and arguments `cruze review` runs to start an agent in a fresh context, with the prompt on standard input. Without it, `cruze review` hands the prompt back for the calling agent to run in a helper of its own. |
|
|
46
|
+
|
|
47
|
+
A source file belongs to the first layer whose paths match it, and `cruze check` fails an import into a layer its own layer may not import. A layer may import itself, and code outside the project, such as the standard library and dependencies, is always allowed. Keep every source file in a layer: `cruze check` warns on one that isn't.
|