@printpractical/cruze 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/README.md +61 -118
  2. package/dist/adapters/inbound/cli/cli_context.js +0 -27
  3. package/dist/adapters/inbound/cli/commands/code.js +5 -18
  4. package/dist/adapters/inbound/cli/commands/documents.js +11 -37
  5. package/dist/adapters/inbound/cli/commands/init.js +1 -1
  6. package/dist/adapters/inbound/cli/commands/install.js +1 -0
  7. package/dist/adapters/inbound/cli/commands/review.js +2 -9
  8. package/dist/adapters/inbound/cli/commands/status.js +16 -63
  9. package/dist/adapters/inbound/cli/commands.js +10 -37
  10. package/dist/adapters/inbound/cli/parse_command.js +0 -54
  11. package/dist/adapters/outbound/git_repository.js +2 -71
  12. package/dist/app/ports/repository.js +0 -12
  13. package/dist/app/project_context.js +15 -25
  14. package/dist/app/use_cases/approve_document.js +29 -0
  15. package/dist/app/use_cases/check_code.js +21 -56
  16. package/dist/app/use_cases/install_skills.js +7 -1
  17. package/dist/app/use_cases/new_document.js +25 -0
  18. package/dist/app/use_cases/project_status.js +43 -67
  19. package/dist/app/use_cases/run_review.js +11 -30
  20. package/dist/app/use_cases/validate_project.js +8 -5
  21. package/dist/domain/approvals.js +51 -0
  22. package/dist/domain/check/check_source.js +3 -32
  23. package/dist/domain/check/imports.js +3 -3
  24. package/dist/domain/check/rust_imports.js +25 -3
  25. package/dist/domain/config.js +8 -84
  26. package/dist/domain/hashing.js +16 -30
  27. package/dist/domain/ids.js +13 -27
  28. package/dist/domain/next_step.js +41 -0
  29. package/dist/domain/project/features.js +71 -0
  30. package/dist/domain/project/layout.js +11 -27
  31. package/dist/domain/project/project_docs.js +48 -0
  32. package/dist/domain/project/release.js +30 -0
  33. package/dist/domain/scaffold.js +0 -1
  34. package/dist/domain/skill_budget.js +4 -4
  35. package/dist/domain/trace.js +8 -25
  36. package/dist/domain/validation/document_rules.js +65 -0
  37. package/dist/domain/validation/release_rules.js +45 -0
  38. package/dist/domain/validation/review_rules.js +21 -0
  39. package/dist/domain/validation/validate_project.js +20 -27
  40. package/dist/domain/versions/cruze_version.js +3 -9
  41. package/dist/main.js +1 -1
  42. package/package.json +1 -1
  43. package/skills/asking/SKILL.md +51 -0
  44. package/skills/behavioural-testing/SKILL.md +14 -16
  45. package/skills/behavioural-testing/examples.md +1 -2
  46. package/skills/behavioural-testing/fakes.md +2 -2
  47. package/skills/build/SKILL.md +34 -38
  48. package/skills/dependency-approval/SKILL.md +34 -31
  49. package/skills/envision/SKILL.md +23 -18
  50. package/skills/envision/architecture.md +16 -0
  51. package/skills/envision/breakdown.md +14 -0
  52. package/skills/envision/possibilities.md +6 -7
  53. package/skills/fix/SKILL.md +34 -0
  54. package/skills/formats/SKILL.md +39 -87
  55. package/skills/formats/config.md +47 -0
  56. package/skills/formats/templates/architecture.md +18 -74
  57. package/skills/formats/templates/feature.md +18 -34
  58. package/skills/formats/templates/vision.md +15 -27
  59. package/skills/hexagonal-design/SKILL.md +11 -11
  60. package/skills/hexagonal-design/contracts.md +3 -3
  61. package/skills/hexagonal-design/fundamentals.md +1 -1
  62. package/skills/hexagonal-design/languages/cpp.md +1 -1
  63. package/skills/hexagonal-design/languages/rust.md +1 -1
  64. package/skills/hexagonal-design/languages/swift.md +2 -2
  65. package/skills/hexagonal-design/runtime.md +2 -2
  66. package/skills/research/SKILL.md +4 -4
  67. package/skills/research/evaluation.md +1 -1
  68. package/skills/review/SKILL.md +27 -0
  69. package/skills/roles/SKILL.md +8 -59
  70. package/skills/roles/code-reviewer.md +22 -32
  71. package/skills/roles/researcher.md +3 -3
  72. package/skills/shape/SKILL.md +37 -0
  73. package/skills/shape/self-check.md +12 -0
  74. package/src/adapters/inbound/cli/cli_context.ts +0 -27
  75. package/src/adapters/inbound/cli/commands/code.ts +5 -18
  76. package/src/adapters/inbound/cli/commands/documents.ts +11 -37
  77. package/src/adapters/inbound/cli/commands/init.ts +1 -1
  78. package/src/adapters/inbound/cli/commands/install.ts +1 -0
  79. package/src/adapters/inbound/cli/commands/review.ts +2 -9
  80. package/src/adapters/inbound/cli/commands/status.ts +16 -63
  81. package/src/adapters/inbound/cli/commands.ts +10 -37
  82. package/src/adapters/inbound/cli/parse_command.ts +0 -54
  83. package/src/adapters/outbound/git_repository.ts +2 -71
  84. package/src/app/ports/repository.ts +0 -12
  85. package/src/app/project_context.ts +15 -25
  86. package/src/app/use_cases/approve_document.ts +29 -0
  87. package/src/app/use_cases/check_code.ts +21 -56
  88. package/src/app/use_cases/install_skills.ts +7 -1
  89. package/src/app/use_cases/new_document.ts +25 -0
  90. package/src/app/use_cases/project_status.ts +49 -73
  91. package/src/app/use_cases/run_review.ts +11 -30
  92. package/src/app/use_cases/validate_project.ts +8 -5
  93. package/src/domain/approvals.ts +51 -0
  94. package/src/domain/check/check_source.ts +3 -32
  95. package/src/domain/check/imports.ts +3 -3
  96. package/src/domain/check/rust_imports.ts +25 -3
  97. package/src/domain/config.ts +9 -85
  98. package/src/domain/hashing.ts +16 -30
  99. package/src/domain/ids.ts +13 -27
  100. package/src/domain/next_step.ts +41 -0
  101. package/src/domain/project/features.ts +71 -0
  102. package/src/domain/project/layout.ts +11 -27
  103. package/src/domain/project/project_docs.ts +48 -0
  104. package/src/domain/project/release.ts +30 -0
  105. package/src/domain/scaffold.ts +0 -1
  106. package/src/domain/skill_budget.ts +4 -4
  107. package/src/domain/trace.ts +8 -25
  108. package/src/domain/validation/document_rules.ts +65 -0
  109. package/src/domain/validation/release_rules.ts +45 -0
  110. package/src/domain/validation/review_rules.ts +21 -0
  111. package/src/domain/validation/validate_project.ts +21 -28
  112. package/src/domain/versions/cruze_version.ts +3 -9
  113. package/src/main.ts +1 -1
  114. package/templates/init/AGENTS.md +4 -12
  115. package/templates/init/ci.yml +3 -3
  116. package/templates/init/config.yaml +8 -17
  117. package/templates/init/review/claude.yaml +2 -2
  118. package/dist/adapters/inbound/cli/argument_files.js +0 -29
  119. package/dist/adapters/inbound/cli/commands/diff.js +0 -23
  120. package/dist/adapters/inbound/cli/commands/journal.js +0 -32
  121. package/dist/adapters/inbound/cli/commands/progress.js +0 -55
  122. package/dist/adapters/inbound/cli/commands/realign.js +0 -28
  123. package/dist/adapters/inbound/cli/commands/show.js +0 -96
  124. package/dist/app/use_cases/abandon_work.js +0 -42
  125. package/dist/app/use_cases/approve_artifact.js +0 -197
  126. package/dist/app/use_cases/journal_events.js +0 -64
  127. package/dist/app/use_cases/land_change.js +0 -134
  128. package/dist/app/use_cases/new_project_doc.js +0 -48
  129. package/dist/app/use_cases/new_work_item.js +0 -75
  130. package/dist/app/use_cases/realign_done.js +0 -45
  131. package/dist/app/use_cases/realign_status.js +0 -106
  132. package/dist/app/use_cases/record_progress.js +0 -118
  133. package/dist/app/use_cases/show_elements.js +0 -18
  134. package/dist/app/use_cases/show_notes.js +0 -11
  135. package/dist/app/use_cases/show_scope.js +0 -51
  136. package/dist/app/use_cases/upstream_diff.js +0 -55
  137. package/dist/domain/approvals/agent_approval.js +0 -68
  138. package/dist/domain/approvals/evaluate.js +0 -36
  139. package/dist/domain/approvals/fingerprint.js +0 -52
  140. package/dist/domain/approvals/rebase.js +0 -39
  141. package/dist/domain/approvals/records.js +0 -50
  142. package/dist/domain/approvals/upstream_text.js +0 -36
  143. package/dist/domain/architecture_sections.js +0 -23
  144. package/dist/domain/check/decision_comments.js +0 -38
  145. package/dist/domain/decision_citations.js +0 -62
  146. package/dist/domain/edits/agents_file.js +0 -58
  147. package/dist/domain/edits/managed_tables.js +0 -60
  148. package/dist/domain/edits/progress_block.js +0 -33
  149. package/dist/domain/edits/status_lines.js +0 -52
  150. package/dist/domain/elements.js +0 -126
  151. package/dist/domain/journal.js +0 -109
  152. package/dist/domain/land/bookkeeping.js +0 -54
  153. package/dist/domain/land/merge_plan.js +0 -137
  154. package/dist/domain/land/text_ops.js +0 -66
  155. package/dist/domain/line_diff.js +0 -56
  156. package/dist/domain/project/artifact_ref.js +0 -42
  157. package/dist/domain/project/deltas.js +0 -49
  158. package/dist/domain/project/element_lookup.js +0 -124
  159. package/dist/domain/project/living_model.js +0 -55
  160. package/dist/domain/project/new_items.js +0 -48
  161. package/dist/domain/project/notes.js +0 -74
  162. package/dist/domain/project/plan_parts.js +0 -111
  163. package/dist/domain/project/progress.js +0 -43
  164. package/dist/domain/project/project_view.js +0 -72
  165. package/dist/domain/project/roadmap.js +0 -43
  166. package/dist/domain/project/scope_view.js +0 -134
  167. package/dist/domain/project/work_items.js +0 -68
  168. package/dist/domain/status/next_step.js +0 -181
  169. package/dist/domain/status/pending_rethink.js +0 -22
  170. package/dist/domain/status/verification.js +0 -29
  171. package/dist/domain/status/work_status.js +0 -125
  172. package/dist/domain/validation/decision_rules.js +0 -76
  173. package/dist/domain/validation/delta_rules.js +0 -81
  174. package/dist/domain/validation/element_rules.js +0 -104
  175. package/dist/domain/validation/future_rules.js +0 -40
  176. package/dist/domain/validation/living_rules.js +0 -99
  177. package/dist/domain/validation/plan_rules.js +0 -124
  178. package/dist/domain/validation/project_rules.js +0 -115
  179. package/dist/domain/validation/size_rules.js +0 -45
  180. package/dist/domain/validation/vision_rules.js +0 -41
  181. package/dist/domain/validation/work_item_rules.js +0 -175
  182. package/dist/domain/versions/realign_notes.js +0 -72
  183. package/dist/domain/versions/rule_versions.js +0 -29
  184. package/dist/domain/versions/scheduled_exceptions.js +0 -41
  185. package/skills/about/SKILL.md +0 -21
  186. package/skills/architect/SKILL.md +0 -49
  187. package/skills/architect/feature.md +0 -40
  188. package/skills/architect/project.md +0 -71
  189. package/skills/architect/tweak.md +0 -22
  190. package/skills/architect/walkthrough.md +0 -35
  191. package/skills/domain-language/SKILL.md +0 -37
  192. package/skills/envision/feature.md +0 -25
  193. package/skills/envision/intake.md +0 -28
  194. package/skills/envision/project.md +0 -24
  195. package/skills/explore/SKILL.md +0 -39
  196. package/skills/formats/reference/architecture.md +0 -84
  197. package/skills/formats/reference/config.md +0 -80
  198. package/skills/formats/reference/durable-docs.md +0 -74
  199. package/skills/formats/reference/specs.md +0 -65
  200. package/skills/formats/reference/work-items.md +0 -100
  201. package/skills/formats/templates/adr.md +0 -7
  202. package/skills/formats/templates/change.md +0 -29
  203. package/skills/formats/templates/glossary.md +0 -8
  204. package/skills/formats/templates/roadmap.md +0 -32
  205. package/skills/formats/templates/spec.md +0 -11
  206. package/skills/formats/templates/standalone-change.md +0 -46
  207. package/skills/grilling/SKILL.md +0 -90
  208. package/skills/grilling/illustrating.md +0 -38
  209. package/skills/improve/SKILL.md +0 -51
  210. package/skills/land/SKILL.md +0 -48
  211. package/skills/next/SKILL.md +0 -31
  212. package/skills/plan/SKILL.md +0 -62
  213. package/skills/plan/tasks.md +0 -35
  214. package/skills/plan/test-plan.md +0 -14
  215. package/skills/realign/SKILL.md +0 -37
  216. package/skills/realign/notes/0.0.10.md +0 -131
  217. package/skills/realign/notes/0.0.11.md +0 -15
  218. package/skills/realign/notes/0.0.12.md +0 -31
  219. package/skills/realign/notes/0.0.13.md +0 -11
  220. package/skills/realign/notes/0.0.2.md +0 -69
  221. package/skills/realign/notes/0.0.3.md +0 -11
  222. package/skills/realign/notes/0.0.4.md +0 -27
  223. package/skills/realign/notes/0.0.5.md +0 -38
  224. package/skills/realign/notes/0.0.6.md +0 -44
  225. package/skills/realign/notes/0.0.7.md +0 -11
  226. package/skills/realign/notes/0.0.8.md +0 -97
  227. package/skills/realign/notes/0.0.9.md +0 -59
  228. package/skills/realign/notes.md +0 -40
  229. package/skills/rethink/SKILL.md +0 -62
  230. package/skills/rethink/levels.md +0 -54
  231. package/skills/roadmap/SKILL.md +0 -54
  232. package/skills/roles/auditor.md +0 -35
  233. package/skills/roles/design-reviewer.md +0 -43
  234. package/skills/roles/design-rubric.md +0 -41
  235. package/skills/roles/plan-rubric.md +0 -11
  236. package/skills/roles/surveyor.md +0 -41
  237. package/skills/roles/verifier.md +0 -42
  238. package/skills/triage/SKILL.md +0 -37
  239. package/skills/verify/SKILL.md +0 -45
  240. package/skills/verify/manual-test.md +0 -23
  241. package/src/adapters/inbound/cli/argument_files.ts +0 -29
  242. package/src/adapters/inbound/cli/commands/diff.ts +0 -23
  243. package/src/adapters/inbound/cli/commands/journal.ts +0 -32
  244. package/src/adapters/inbound/cli/commands/progress.ts +0 -55
  245. package/src/adapters/inbound/cli/commands/realign.ts +0 -28
  246. package/src/adapters/inbound/cli/commands/show.ts +0 -96
  247. package/src/app/use_cases/abandon_work.ts +0 -42
  248. package/src/app/use_cases/approve_artifact.ts +0 -197
  249. package/src/app/use_cases/journal_events.ts +0 -64
  250. package/src/app/use_cases/land_change.ts +0 -134
  251. package/src/app/use_cases/new_project_doc.ts +0 -48
  252. package/src/app/use_cases/new_work_item.ts +0 -75
  253. package/src/app/use_cases/realign_done.ts +0 -45
  254. package/src/app/use_cases/realign_status.ts +0 -106
  255. package/src/app/use_cases/record_progress.ts +0 -118
  256. package/src/app/use_cases/show_elements.ts +0 -18
  257. package/src/app/use_cases/show_notes.ts +0 -11
  258. package/src/app/use_cases/show_scope.ts +0 -51
  259. package/src/app/use_cases/upstream_diff.ts +0 -55
  260. package/src/domain/approvals/agent_approval.ts +0 -68
  261. package/src/domain/approvals/evaluate.ts +0 -36
  262. package/src/domain/approvals/fingerprint.ts +0 -52
  263. package/src/domain/approvals/rebase.ts +0 -39
  264. package/src/domain/approvals/records.ts +0 -50
  265. package/src/domain/approvals/upstream_text.ts +0 -36
  266. package/src/domain/architecture_sections.ts +0 -23
  267. package/src/domain/check/decision_comments.ts +0 -38
  268. package/src/domain/decision_citations.ts +0 -62
  269. package/src/domain/edits/agents_file.ts +0 -58
  270. package/src/domain/edits/managed_tables.ts +0 -60
  271. package/src/domain/edits/progress_block.ts +0 -33
  272. package/src/domain/edits/status_lines.ts +0 -52
  273. package/src/domain/elements.ts +0 -126
  274. package/src/domain/journal.ts +0 -109
  275. package/src/domain/land/bookkeeping.ts +0 -54
  276. package/src/domain/land/merge_plan.ts +0 -137
  277. package/src/domain/land/text_ops.ts +0 -66
  278. package/src/domain/line_diff.ts +0 -56
  279. package/src/domain/project/artifact_ref.ts +0 -42
  280. package/src/domain/project/deltas.ts +0 -49
  281. package/src/domain/project/element_lookup.ts +0 -124
  282. package/src/domain/project/living_model.ts +0 -55
  283. package/src/domain/project/new_items.ts +0 -48
  284. package/src/domain/project/notes.ts +0 -74
  285. package/src/domain/project/plan_parts.ts +0 -111
  286. package/src/domain/project/progress.ts +0 -43
  287. package/src/domain/project/project_view.ts +0 -72
  288. package/src/domain/project/roadmap.ts +0 -43
  289. package/src/domain/project/scope_view.ts +0 -134
  290. package/src/domain/project/work_items.ts +0 -68
  291. package/src/domain/status/next_step.ts +0 -181
  292. package/src/domain/status/pending_rethink.ts +0 -22
  293. package/src/domain/status/verification.ts +0 -29
  294. package/src/domain/status/work_status.ts +0 -125
  295. package/src/domain/validation/decision_rules.ts +0 -76
  296. package/src/domain/validation/delta_rules.ts +0 -81
  297. package/src/domain/validation/element_rules.ts +0 -104
  298. package/src/domain/validation/future_rules.ts +0 -40
  299. package/src/domain/validation/living_rules.ts +0 -99
  300. package/src/domain/validation/plan_rules.ts +0 -124
  301. package/src/domain/validation/project_rules.ts +0 -115
  302. package/src/domain/validation/size_rules.ts +0 -45
  303. package/src/domain/validation/vision_rules.ts +0 -41
  304. package/src/domain/validation/work_item_rules.ts +0 -175
  305. package/src/domain/versions/realign_notes.ts +0 -72
  306. package/src/domain/versions/rule_versions.ts +0 -29
  307. package/src/domain/versions/scheduled_exceptions.ts +0 -41
  308. package/templates/init/gitattributes +0 -2
@@ -36,15 +36,9 @@ export function versionSkew(cli , recorded )
36
36
  * after `version:`, so the file's comments and layout survive.
37
37
  */
38
38
  export function withRecordedVersion(configText , version ) {
39
- return withVersionLine(configText, "cruze", version);
40
- }
41
-
42
- /** The config text with a top-level version key, such as `cruze:` or `standards:`, set in place. */
43
- export function withVersionLine(configText , key , version ) {
44
- const line = `${key}: ${JSON.stringify(version)}`;
45
- const existing = new RegExp(`^${key}:.*$`, "m");
46
- if (existing.test(configText)) return configText.replace(existing, line);
47
- const anchor = key === "standards" ? /^cruze:.*$/m.exec(configText) ?? /^version:.*$/m.exec(configText) : /^version:.*$/m.exec(configText);
39
+ const line = `cruze: ${JSON.stringify(version)}`;
40
+ if (/^cruze:.*$/m.test(configText)) return configText.replace(/^cruze:.*$/m, line);
41
+ const anchor = /^version:.*$/m.exec(configText);
48
42
  if (anchor === null) return `${line}\n${configText}`;
49
43
  const end = anchor.index + anchor[0].length;
50
44
  return `${configText.slice(0, end)}\n${line}${configText.slice(end)}`;
package/dist/main.js CHANGED
@@ -10,7 +10,7 @@ import { ProcessAgentRunner } from "./adapters/outbound/process_agent_runner.js"
10
10
  import { SystemClock } from "./adapters/outbound/system_clock.js";
11
11
  import { DefaultAnswerPrompter, TerminalPrompter } from "./adapters/outbound/terminal_prompter.js";
12
12
 
13
- // A reader that stops early, such as `cruze journal list | head`, closes the pipe; that is not an error worth a stack trace.
13
+ // A reader that stops early, such as `cruze status --text | head`, closes the pipe; that is not an error worth a stack trace.
14
14
  process.stdout.on("error", (error ) => {
15
15
  if (error.code === "EPIPE") process.exit(0);
16
16
  throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@printpractical/cruze",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Spec-driven development for coding agents: one living model of the system, small deltas, convergent review.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Chris Buchter",
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: cruze-asking
3
+ description: When to ask the user and when to decide, and how to show a question so the user can answer it cold, with plain words, code sketches and diagrams. Use before asking the user anything during envision, shape, build, review or fix.
4
+ ---
5
+
6
+ # Asking the user
7
+
8
+ The user's time is the scarcest thing in the project. Every question costs them a context switch, and a long run of questions turns into rubber-stamping: in one project the user answered 71% of 187 design questions with a bare "agree". So ask little, ask what only the user can answer, and show it so it can be answered at a glance.
9
+
10
+ ## What to ask and what to decide
11
+
12
+ Ask when a choice changes something the user will see or live with:
13
+
14
+ - behaviour a user of the product will notice, including what they see when something fails;
15
+ - a public API: anything another program, person or team calls, types, or reads;
16
+ - scope: what is in a feature and what is out;
17
+ - a significant dependency, through `.agents/skills/cruze-dependency-approval/SKILL.md`;
18
+ - security, privacy, stored data, compatibility, or a commitment that is costly to reverse.
19
+
20
+ Decide everything else yourself: internal structure, private names, which module owns what, internal types, file layout, equivalent idioms, limits and timeouts with an obvious value. Pick the conventional option. Uncertainty alone doesn't make a choice the user's: investigate first. Then list the decisions a user might question in the document's `## Decisions`, one line each with the reason, so the user sees them when they approve, without being asked.
21
+
22
+ ## How many
23
+
24
+ At most one question round per step, of five questions or fewer, before you show the document. When a choice has a sensible default, take it and list it under Decisions instead of asking. When the user defers ("you decide"), decide, and don't ask again.
25
+
26
+ ## Showing a question
27
+
28
+ The user knows what the product should do, not the design's internals, and is often coming back from other work.
29
+
30
+ - **Say where things stand** in one line first: the step and the feature, such as "Shaping export-csv."
31
+ - **Explain the part before asking about it:** what it is, what it does, and why the question comes up now.
32
+ - **Use plain words.** Name a scenario or decision by what it says, and add its ID after it in parentheses only when the user may want to look it up. Never let an ID stand alone.
33
+ - **Show each option** with the form that fits:
34
+
35
+ | The question decides | Show |
36
+ | --- | --- |
37
+ | What a user does or sees | The command and its exact output, or a sketch of the screen, with real values |
38
+ | A public API or a port | A code sketch in the project's language: types, signatures, errors, and one call |
39
+ | Where something lives | A box-and-arrow diagram, or the directory tree |
40
+ | An order of steps, or what happens on failure | A numbered sequence with the failure branch |
41
+ | A stored format or config | A sample of the file |
42
+ | A dependency | The code with it and without it |
43
+
44
+ - **Keep sketches short:** shape only, bodies left out, about 15 lines per option. Draw diagrams in plain text, which reads in a terminal; documents keep their Mermaid.
45
+ - **Mark your recommendation** and why, in one line.
46
+
47
+ A shape the user chose from a sketch is part of the decision: write it into the document, so build makes it as the user saw it.
48
+
49
+ ## Challenge, then defer
50
+
51
+ When the user steers toward something that breaks the architecture or a standard, name the rule, the concrete risk here and your alternative, once. Then the user decides, and their decision stands.
@@ -1,30 +1,28 @@
1
1
  ---
2
2
  name: cruze-behavioural-testing
3
- description: The testing standard for a Cruze project, covering which tests to write, the seam each one drives, the ID it carries, and fakes instead of mocks. Use when writing a change's test plan, when writing, changing or fixing a test, when building a fake for a port, when deciding whether a unit test is warranted, or when reviewing tests.
3
+ description: The testing standard for a Cruze project, covering which tests to write, the seam each one drives, the ID it carries, and fakes instead of mocks. Use when writing, changing or fixing a test, when building a fake for a port, when deciding whether a unit test is warranted, or when reviewing tests.
4
4
  ---
5
5
 
6
6
  # Behavioural testing
7
7
 
8
- Behaviour is the contract. Every scenario in the specs becomes a test that drives the system through a use case and checks what a caller would see. Tests pin behaviour, not structure, so the code behind them can be rewritten freely.
8
+ Behaviour is the contract. Every scenario in a feature becomes a test that drives the system through a use case and checks what a caller would see. Tests pin behaviour, not structure, so the code behind them can be rewritten freely.
9
9
 
10
- ## Writing tests for a task
10
+ ## Writing tests for a feature
11
11
 
12
- 1. Find the test plan rows whose Subject the task proves. Done when you know the seam, test file and kind of every test the task needs.
13
- 2. Write one test at its seam, carrying its subject ID. Take the inputs and expected values from the scenario's GIVEN, WHEN and THEN.
12
+ 1. For each scenario, pick its seam from the table below. Done when you know the seam, test file and kind of every test the feature needs.
13
+ 2. Write one test at its seam, carrying the scenario's ID. Take the inputs and expected values from the scenario's GIVEN, WHEN and THEN.
14
14
  3. Run it and watch it fail for the reason you expect (red). A test that passes before the code exists proves nothing, so fix the test. A test that guards a race or an ordering must be seen failing against code that has the flaw: run the racing work concurrently, on a multi-threaded runtime where there is one, and wait for a signal the system gives, such as a watch having opened, never for a fixed sleep.
15
15
  4. Write the least code that makes it pass (green). Then write the next test. Work in tracer bullets, one test and one slice of code at a time, never all the tests first.
16
- 5. Done when every test plan row whose Subject the task proves has a passing test carrying that ID, and each test fails when the behaviour it checks is removed. Tasks that prove only a `UC`, `ADP` or `MOD` are proved by the rows of the scenarios and ports they serve.
16
+ 5. Done when every scenario has a passing test carrying its ID, every port with a real adapter has contract tests, and each test fails when the behaviour it checks is removed.
17
17
 
18
18
  ## The four kinds
19
19
 
20
- These match the test plan in `.agents/skills/cruze-formats/reference/work-items.md`.
21
-
22
20
  | Kind | Subject | Seam | When |
23
21
  | --- | --- | --- | --- |
24
- | `behaviour` | `SCN` | The use case's API with a fake for each driven port, or the inbound adapter when the outcome is what that adapter shows, such as CLI output, an exit code or an HTTP status | One or more per scenario, always |
25
- | `contract` | `PORT` | The same cases run against the fake and every real adapter | Every driven port that has a real adapter |
26
- | `domain` | `ENT` | The entity's own API | Only for real logic: state machines, calculations, invariants with edge cases |
27
- | `smoke` | `FLOW` | The real inbound adapter, wired by the real composition root | The top 1 to 3 flows |
22
+ | `behaviour` | a scenario | The use case's API with a fake for each driven port, or the inbound adapter when the outcome is what that adapter shows, such as CLI output, an exit code or an HTTP status | One or more per scenario, always |
23
+ | `contract` | a port | The same cases run against the fake and every real adapter | Every driven port that has a real adapter |
24
+ | `domain` | a domain type | The entity's own API | Only for real logic: state machines, calculations, invariants with edge cases |
25
+ | `smoke` | the main path | The real inbound adapter, wired by the real composition root | The top 1 to 3 paths through the system |
28
26
 
29
27
  A behaviour test drives a use case, not a single domain type, so it keeps passing when rules move between entities. In a library with no use cases, the seam is the library's public API. Write a domain test only when a rule's edge cases are too many to reach through use cases one by one.
30
28
 
@@ -51,9 +49,9 @@ A behaviour test drives a use case, not a single domain type, so it keeps passin
51
49
 
52
50
  ## Protecting the check
53
51
 
54
- - Behaviour, contract and smoke tests for approved scenarios, ports and flows are the safety net. Never edit one to get green. When one fails, either the code is wrong, or the spec is. A wrong spec or design goes through the rethink step, and the test changes only with the delta that changes its subject: a spec delta for a `SCN`, an architecture delta for a `PORT` or `FLOW`.
52
+ - Behaviour, contract and smoke tests for approved scenarios and ports are the safety net. Never edit one to get green. When one fails, either the code is wrong, or the scenario is. A wrong scenario goes back through shape, and the test changes only after the user approves the changed scenario.
55
53
  - Domain tests are disposable. Rewrite or delete them along with the code they test.
56
- - Never skip a test, delete one, or weaken an assertion to finish a task. Verify flags any diff to a safety-net test that has no matching delta.
54
+ - Never skip a test, delete one, or weaken an assertion to finish. Review flags any weakened safety-net test.
57
55
 
58
56
  ## What not to write
59
57
 
@@ -65,6 +63,6 @@ Side-by-side examples are in [examples.md](examples.md).
65
63
 
66
64
  ## Naming and tracing
67
65
 
68
- - Every test carries its subject ID where `.agents/skills/cruze-formats/reference/work-items.md` says, such as `// SCN-access.direct-serial` on the line above it.
66
+ - Every behaviour test carries its scenario's ID in a comment or string, such as `// SCN-open-serial.attach` on the line above it. A test name alone doesn't count, since `cruze trace` looks for the literal ID.
69
67
  - A scenario may need several tests, and each of them carries its ID. One test covers one scenario.
70
- - `cruze trace` checks scenarios only: it fails when a scenario the change delivers has no test carrying its ID, or when a test cites a scenario nobody defined. Run it before calling a change's tests complete, and quote its result. For the `contract`, `domain` and `smoke` rows, list each subject ID next to the test that carries it.
68
+ - `cruze trace <slug>` fails when one of the feature's scenarios has no test carrying its ID, or when a test cites a scenario no feature defines. Run it before calling a feature's tests complete, and quote its result.
@@ -7,7 +7,7 @@ The examples are in Rust, from a console-access tool. The shape is the same in a
7
7
  Good. It drives the use case, fakes the ports, and checks what the caller sees:
8
8
 
9
9
  ```rust
10
- // SCN-access.second-hop-refused
10
+ // SCN-ssh-hops.second-hop-refused
11
11
  #[test]
12
12
  fn second_hop_refused_closes_the_first_hop() {
13
13
  let catalog = InMemoryDeviceCatalog::with(device("lab-router", ssh_via("jump-1")));
@@ -89,7 +89,6 @@ The file format is the TOML adapter's business. Its contract tests cover it, and
89
89
  Good. A state machine with real rules, tested through the entity's own API:
90
90
 
91
91
  ```rust
92
- // ENT-access.console-session
93
92
  #[test]
94
93
  fn a_closed_session_cannot_reopen() {
95
94
  let mut session = ConsoleSession::opening();
@@ -4,7 +4,7 @@ A fake is a real, working implementation of a driven port that keeps its state i
4
4
 
5
5
  ## Writing a fake
6
6
 
7
- 1. Read the port's `Operations`, with `cruze show <PORT ID>`. The fake implements every operation with the guarantees and failures listed there, and nothing more. That includes every way the real adapter ends on its own, such as a session closed when its stream ends or its server shuts down.
7
+ 1. Read the port's operations in `docs/architecture.md`. The fake implements every operation with the guarantees and failures listed there, and nothing more. That includes every way the real adapter ends on its own, such as a session closed when its stream ends or its server shuts down.
8
8
  2. Keep state in plain in-memory structures: a map for a catalog, a list for recorded effects, a settable value for a clock.
9
9
  3. Give tests a way to arrange state and to inject each failure the contract lists. Use a constructor that takes the initial state, and a method such as `fail_next_with(HopError::Refused)`. When a use case writes through the port, also let a test stall an operation, and fail one that writes several things partway through, so each partial failure and cancellation can be tested from every state it can leave.
10
10
  4. Record effects the contract makes observable, such as the order hops were closed in, so tests can assert them.
@@ -21,7 +21,7 @@ A contract test states the port's contract once and runs it against every implem
21
21
  3. Run the suite against the fake in the ordinary test run.
22
22
  4. Run it against each real adapter too. When the real adapter needs something external, such as an SSH server, a serial device or a database, use a local stand-in (a test server, a pseudo-terminal, a container), and mark the run so CI can provide it.
23
23
 
24
- When the contract changes, the port's `Operations` change first through a delta, then the contract suite, then the fake and the adapters.
24
+ When the contract changes, the port's operations in `docs/architecture.md` change first, then the contract suite, then the fake and the adapters.
25
25
 
26
26
  ## What a fake is not
27
27
 
@@ -1,65 +1,61 @@
1
1
  ---
2
2
  name: cruze-build
3
- description: Builds the change bound to this branch task by task, each one test-first, checked with cruze check and committed, stopping to rethink when reality diverges from the design.
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 plan into code, one task at a time. Each task starts with a failing test at the seam the plan names and ends as a green, checked commit. The design is settled, so build follows it. When the code shows the design is wrong, build stops and says so.
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. **Pass the gate.** Run `cruze status --gate build` and quote its result.
13
- - When it is blocked, stop, and show the reasons with the step that fixes them (`cruze next` names it).
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 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
- 4. **Build each open task in order,** following the task loop below. Skip the tasks already ticked in `## Progress`.
21
- 5. **Finish.** When every task is ticked:
22
- - Run the format, lint and build commands and the full suite, as `.agents/skills/cruze-formats/reference/config.md` defines it under `commands`.
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 task loop
22
+ ## The loop
29
23
 
30
- For task `T<n>`:
24
+ For each scenario:
31
25
 
32
- 1. **Read it.** Note its owner, its files, the IDs it proves, and the test plan rows for those IDs.
33
- 2. **Red.** Write the tests for the IDs it proves, at the seams the test plan names, carrying the IDs. Run them, and see them fail for the reason you expect. When the task names a break, use it, or any break that compiles and turns the same assertion red.
34
- 3. **Green.** Write the least code that makes them pass, in the task's files. Code that belongs to another task, or another change, waits for it, even when the next change will need it.
35
- 4. **Check.** Run `cruze check --ci <the task's files>`, the formatter and the linter, and fix what they report. Meet a budget as the budget rule in `.agents/skills/cruze-hexagonal-design/SKILL.md` says, never by bending the code. Run the tests the task touched. When `commands:` has a `test_full`, run `test` too, since it is the fast tier. Otherwise run the rest of the suite only when it is quick.
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
- 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.
31
+ Done for a scenario when its test passes, the checks pass and the commit exists.
40
32
 
41
- Done for a task when its tests pass, `cruze check --ci` passes for its files, the commit exists and the task is ticked.
33
+ ## Deciding as you go
42
34
 
43
- ## Deviations
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
- The plan is design. Within a task you decide only what is local and reversible.
37
+ Stop and run `shape` when the code needs any of these:
46
38
 
47
- - **Record it and carry on** for a task-level choice: a private helper in another file of the same module, a new file of the owner's module that splits off a responsibility, a `check.exceptions` entry with its reason, a private type, a fixture or harness added to the test support module that the task's tests need, or two tasks' commits swapped for a reason. The test support module is in every test-writing task's scope, so extend it rather than writing a private helper in a test file. Run `cruze task deviation T<n> "<what you did and why>"`.
48
- - **Stop and offer `rethink`** when the code needs any of these:
49
- - a new element, port operation or scenario;
50
- - a file outside the owner's module, other than the test support module;
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
- Explain what you found, with the evidence, and don't work around it. Completed tasks keep their commits.
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.
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 behaviour, contract or smoke test for an approved scenario, port or flow to get green. A failing one means the code is wrong, or the spec is. A wrong spec goes through `rethink`.
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
- `verify`, once every task is ticked and the finishing checks pass. Start it in a new session, so its context starts empty: one session that ran plan, build, verify and land reached 745k tokens.
61
+ `review`, once the finishing checks pass.
@@ -1,55 +1,58 @@
1
1
  ---
2
2
  name: cruze-dependency-approval
3
- description: The rule that no dependency enters a Cruze project without the user's explicit approval, with how to ask for one and where to record it. Use when a design or plan would add a library, package, crate, framework, build or test tool, or vendored code; before editing a dependency manifest; when a build finds it needs something the design didn't name; and when reviewing a diff that changes dependency declarations.
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
- Every new dependency needs the user's explicit approval before it is declared or relied on. That includes runtime libraries, development and test tools, build plugins, and vendored or copied third-party code. Changing how it is acquired, such as vendoring, a git submodule or copying files, doesn't get around the rule.
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
- ## Asking
10
+ ## Significant
11
11
 
12
- 1. Establish the need: the capability, and what the design looks like with the dependency and without it, using the standard library and the project's already-approved dependencies. Show both as short code sketches, following `.agents/skills/cruze-grilling/illustrating.md`.
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
- ## Weighing
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
- - Recommend the option that gives the cleanest design: the one an experienced developer in the language would write, with the least code to own. A dependency, a new crate or package, or a feature of an approved dependency is not a cost in itself. Weigh its concrete costs: maintenance and release health, security record, licence, and build time or binary size where a stated constraint makes them matter.
21
- - "No new dependency" is never the reason for a choice. Name what the chosen option does better.
22
- - 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.
23
- - When the clean design needs a dependency or feature nobody approved yet, ask for it. Hand-written code, a shell command or a less idiomatic construct that exists only to avoid asking is a design flaw.
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 approved dependency provides one.
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: ADP-access.ssh-connector, behind PORT-access.hop-connector.
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
- ## What counts as approval
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
- - The user names the dependency ("use serde"), or approves a design whose `## Adopt or build` table or `Adopts` fact names it. Approving a feature doesn't cover a dependency its design doesn't name, so the design walkthrough lists every new dependency out loud.
37
- - An approval covers the package's ordinary transitive dependencies, and later use for the same purpose in the same package or workspace member.
38
- - It doesn't cover another workspace member, a different purpose, or turning on native code, a network service or new platform requirements. Ask again for those.
39
- - Routine version upgrades follow the project's upgrade policy, not this rule. Point out upgrades that change licensing, platforms or behaviour.
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
- - A feature or standalone change records it as a row in `## Adopt or build`: the component, `adopt`, the package, and the reason. The adapter that uses it carries an `Adopts` fact in the architecture delta.
45
- - At project scope, the adapter's `Adopts` fact in `docs/architecture.md` records it, and a dependency no adapter owns, such as a test framework or a build tool, goes in the foundation change's `## Adopt or build`. A choice that is hard to reverse, such as an async runtime, a framework or a database, also gets an ADR.
46
- - Choosing to build commodity functionality is also the user's call: a parser, serializer, protocol codec, CLI parser, URL or version handling, retries, compression, or date and time handling. Record it as a `build` row with the concrete reason for owning the code.
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
- Before a change is verified, compare the diff of every place dependencies are declared with the approvals recorded in the feature, the change and the architecture. That includes manifests such as `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `vcpkg.json` and `conanfile.*`, CMake `FetchContent` and `find_package` calls, `.gitmodules`, and third-party code copied into the tree.
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.
@@ -1,32 +1,37 @@
1
1
  ---
2
2
  name: cruze-envision
3
- description: Decides what to build with the user, either for the whole project (problem, users, goals, non-goals, constraints, feature map and glossary) or for one feature (intent and requirements with scenarios), by grilling in rounds on the gaps.
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 decides the what: the problem, who has it, and the behaviour that solves it. It takes whatever drafts the user brings as input, finds the gaps, and grills in rounds until the user confirms a shared understanding. Architecture, modules and code belong to `architect`.
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. **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 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
- 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
- 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
- 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.
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
- ## Rules
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
- - 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
- - 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
- ## Next step
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
- - After project scope: run `architect` at project scope.
30
- - After feature scope: run `architect "<feature>"`.
35
+ ## Next step
31
36
 
32
- Start it in a new session, so its context starts empty.
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.
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 designs leave room for it and never close it off.
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 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.
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
- - **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.
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 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`.
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.