@printpractical/cruze 0.0.7 → 0.0.9

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 (96) hide show
  1. package/README.md +6 -5
  2. package/dist/adapters/inbound/cli/cli_context.js +2 -0
  3. package/dist/adapters/inbound/cli/commands/code.js +2 -1
  4. package/dist/adapters/inbound/cli/commands/journal.js +1 -1
  5. package/dist/adapters/inbound/cli/commands/show.js +32 -0
  6. package/dist/adapters/inbound/cli/commands/status.js +19 -3
  7. package/dist/adapters/inbound/cli/commands.js +3 -1
  8. package/dist/adapters/outbound/git_repository.js +40 -7
  9. package/dist/adapters/outbound/project_root.js +13 -0
  10. package/dist/app/use_cases/approve_artifact.js +19 -1
  11. package/dist/app/use_cases/check_code.js +10 -3
  12. package/dist/app/use_cases/journal_events.js +8 -5
  13. package/dist/app/use_cases/project_status.js +4 -1
  14. package/dist/app/use_cases/show_scope.js +37 -0
  15. package/dist/domain/check/budget_text.js +61 -0
  16. package/dist/domain/check/check_source.js +7 -4
  17. package/dist/domain/config.js +23 -1
  18. package/dist/domain/edits/agents_file.js +6 -1
  19. package/dist/domain/journal.js +13 -2
  20. package/dist/domain/project/scope_view.js +134 -0
  21. package/dist/domain/status/next_step.js +25 -2
  22. package/dist/domain/status/verification.js +12 -0
  23. package/dist/domain/status/work_status.js +13 -2
  24. package/dist/domain/validation/element_rules.js +5 -0
  25. package/dist/domain/validation/plan_rules.js +1 -1
  26. package/dist/domain/validation/size_rules.js +14 -5
  27. package/dist/domain/validation/work_item_rules.js +25 -3
  28. package/dist/domain/versions/rule_versions.js +1 -0
  29. package/dist/main.js +14 -4
  30. package/package.json +1 -1
  31. package/skills/architect/SKILL.md +6 -1
  32. package/skills/architect/feature.md +1 -1
  33. package/skills/architect/walkthrough.md +7 -4
  34. package/skills/build/SKILL.md +10 -8
  35. package/skills/dependency-approval/SKILL.md +8 -1
  36. package/skills/envision/SKILL.md +2 -0
  37. package/skills/envision/feature.md +1 -1
  38. package/skills/explore/SKILL.md +1 -1
  39. package/skills/formats/reference/architecture.md +1 -1
  40. package/skills/formats/reference/config.md +13 -4
  41. package/skills/formats/reference/specs.md +1 -1
  42. package/skills/formats/reference/work-items.md +1 -1
  43. package/skills/grilling/SKILL.md +19 -7
  44. package/skills/grilling/illustrating.md +37 -0
  45. package/skills/hexagonal-design/SKILL.md +2 -1
  46. package/skills/hexagonal-design/languages/rust.md +2 -1
  47. package/skills/improve/SKILL.md +3 -3
  48. package/skills/land/SKILL.md +2 -2
  49. package/skills/next/SKILL.md +1 -1
  50. package/skills/plan/SKILL.md +3 -3
  51. package/skills/plan/tasks.md +9 -5
  52. package/skills/realign/SKILL.md +2 -2
  53. package/skills/realign/notes/0.0.8.md +97 -0
  54. package/skills/realign/notes/0.0.9.md +59 -0
  55. package/skills/realign/notes.md +2 -0
  56. package/skills/research/SKILL.md +2 -1
  57. package/skills/rethink/SKILL.md +3 -3
  58. package/skills/rethink/levels.md +2 -2
  59. package/skills/roadmap/SKILL.md +2 -0
  60. package/skills/roles/SKILL.md +8 -10
  61. package/skills/roles/code-reviewer.md +10 -9
  62. package/skills/roles/design-reviewer.md +22 -12
  63. package/skills/roles/surveyor.md +1 -1
  64. package/skills/roles/verifier.md +8 -5
  65. package/skills/triage/SKILL.md +2 -0
  66. package/skills/verify/SKILL.md +6 -4
  67. package/src/adapters/inbound/cli/cli_context.ts +2 -0
  68. package/src/adapters/inbound/cli/commands/code.ts +2 -1
  69. package/src/adapters/inbound/cli/commands/journal.ts +1 -1
  70. package/src/adapters/inbound/cli/commands/show.ts +32 -0
  71. package/src/adapters/inbound/cli/commands/status.ts +19 -3
  72. package/src/adapters/inbound/cli/commands.ts +3 -1
  73. package/src/adapters/outbound/git_repository.ts +40 -7
  74. package/src/adapters/outbound/project_root.ts +13 -0
  75. package/src/app/use_cases/approve_artifact.ts +19 -1
  76. package/src/app/use_cases/check_code.ts +10 -3
  77. package/src/app/use_cases/journal_events.ts +8 -5
  78. package/src/app/use_cases/project_status.ts +4 -1
  79. package/src/app/use_cases/show_scope.ts +37 -0
  80. package/src/domain/check/budget_text.ts +61 -0
  81. package/src/domain/check/check_source.ts +7 -4
  82. package/src/domain/config.ts +23 -1
  83. package/src/domain/edits/agents_file.ts +6 -1
  84. package/src/domain/journal.ts +13 -2
  85. package/src/domain/project/scope_view.ts +134 -0
  86. package/src/domain/status/next_step.ts +25 -2
  87. package/src/domain/status/verification.ts +12 -0
  88. package/src/domain/status/work_status.ts +13 -2
  89. package/src/domain/validation/element_rules.ts +5 -0
  90. package/src/domain/validation/plan_rules.ts +1 -1
  91. package/src/domain/validation/size_rules.ts +14 -5
  92. package/src/domain/validation/work_item_rules.ts +25 -3
  93. package/src/domain/versions/rule_versions.ts +1 -0
  94. package/src/main.ts +14 -4
  95. package/templates/init/AGENTS.md +1 -1
  96. package/templates/init/config.yaml +5 -4
package/src/main.ts CHANGED
@@ -1,27 +1,37 @@
1
1
  #!/usr/bin/env node
2
2
  // Composition root: the only place that constructs adapters.
3
- import { basename } from "node:path";
3
+ import { basename, relative } from "node:path";
4
4
  import { runCli } from "./adapters/inbound/cli/run_cli.ts";
5
5
  import { GitRepository } from "./adapters/outbound/git_repository.ts";
6
6
  import { NodeProjectFiles } from "./adapters/outbound/node_project_files.ts";
7
7
  import { PackageBundle } from "./adapters/outbound/package_bundle.ts";
8
+ import { findProjectRoot } from "./adapters/outbound/project_root.ts";
8
9
  import { ProcessAgentRunner } from "./adapters/outbound/process_agent_runner.ts";
9
10
  import { SystemClock } from "./adapters/outbound/system_clock.ts";
10
11
  import { DefaultAnswerPrompter, TerminalPrompter } from "./adapters/outbound/terminal_prompter.ts";
11
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.
14
+ process.stdout.on("error", (error: NodeJS.ErrnoException) => {
15
+ if (error.code === "EPIPE") process.exit(0);
16
+ throw error;
17
+ });
18
+
12
19
  const cwd = process.cwd();
20
+ // Every command but init works on the project that holds the working directory, so it runs from any subdirectory.
21
+ const root = process.argv[2] === "init" ? cwd : (findProjectRoot(cwd) ?? cwd);
13
22
  const exitCode = await runCli(
14
23
  process.argv.slice(2),
15
24
  {
16
- files: new NodeProjectFiles(cwd),
25
+ files: new NodeProjectFiles(root),
17
26
  bundle: await PackageBundle.locate(),
18
27
  clock: new SystemClock(),
19
- repository: new GitRepository(cwd),
28
+ repository: new GitRepository(root),
20
29
  interactivePrompter: new TerminalPrompter(),
21
30
  unattendedPrompter: new DefaultAnswerPrompter(),
22
- runner: new ProcessAgentRunner(cwd),
31
+ runner: new ProcessAgentRunner(root),
23
32
  interactive: process.stdin.isTTY === true,
24
33
  directoryName: basename(cwd),
34
+ workingDirectory: relative(root, cwd).split("\\").join("/"),
25
35
  },
26
36
  {
27
37
  stdout: (text) => process.stdout.write(`${text}\n`),
@@ -4,7 +4,7 @@ Instructions for coding agents working in this repository. Cruze keeps the manag
4
4
 
5
5
  ## Workflow
6
6
 
7
- This project uses [Cruze](https://github.com/PrintPractical/cruze) for spec-driven development. Durable documents live in `docs/`: vision, glossary, architecture, ADRs, specs and roadmap. Work in progress lives in `.cruze/`. Read `docs/architecture.md` before changing code, once it exists. The Cruze skills run the `cruze` command; when it is missing, install it as https://github.com/PrintPractical/cruze#quick-start describes.
7
+ This project uses [Cruze](https://github.com/PrintPractical/cruze) for spec-driven development. Durable documents live in `docs/`: vision, glossary, architecture, ADRs, specs and roadmap. Work in progress lives in `.cruze/`. Before changing code, read the design the change builds with `cruze show <change>`, once it exists. Each Cruze step runs in a new session, so its context holds what the step reads and nothing else. The Cruze skills run the `cruze` command; when it is missing, install it as https://github.com/PrintPractical/cruze#quick-start describes.
8
8
 
9
9
  ## Commands
10
10
 
@@ -15,11 +15,12 @@ tracker: markdown
15
15
  source: []
16
16
  tests: []
17
17
 
18
- # Budgets enforced by `cruze check`. List a file under exceptions, with a
19
- # reason, to allow it past a budget.
18
+ # Budgets enforced by `cruze check`: a backstop against a file that has
19
+ # outgrown one responsibility, not a size to design to. List a file under
20
+ # exceptions, with a reason, to allow it past a budget.
20
21
  check:
21
- max_lines: 250
22
- max_types: 5
22
+ max_lines: 600
23
+ max_types: 12
23
24
  exceptions: []
24
25
 
25
26
  # Layer rules, written by project-scope architecture design from the module map.