@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.
- package/README.md +6 -5
- package/dist/adapters/inbound/cli/cli_context.js +2 -0
- package/dist/adapters/inbound/cli/commands/code.js +2 -1
- package/dist/adapters/inbound/cli/commands/journal.js +1 -1
- package/dist/adapters/inbound/cli/commands/show.js +32 -0
- package/dist/adapters/inbound/cli/commands/status.js +19 -3
- package/dist/adapters/inbound/cli/commands.js +3 -1
- package/dist/adapters/outbound/git_repository.js +40 -7
- package/dist/adapters/outbound/project_root.js +13 -0
- package/dist/app/use_cases/approve_artifact.js +19 -1
- package/dist/app/use_cases/check_code.js +10 -3
- package/dist/app/use_cases/journal_events.js +8 -5
- package/dist/app/use_cases/project_status.js +4 -1
- package/dist/app/use_cases/show_scope.js +37 -0
- package/dist/domain/check/budget_text.js +61 -0
- package/dist/domain/check/check_source.js +7 -4
- package/dist/domain/config.js +23 -1
- package/dist/domain/edits/agents_file.js +6 -1
- package/dist/domain/journal.js +13 -2
- package/dist/domain/project/scope_view.js +134 -0
- package/dist/domain/status/next_step.js +25 -2
- package/dist/domain/status/verification.js +12 -0
- package/dist/domain/status/work_status.js +13 -2
- package/dist/domain/validation/element_rules.js +5 -0
- package/dist/domain/validation/plan_rules.js +1 -1
- package/dist/domain/validation/size_rules.js +14 -5
- package/dist/domain/validation/work_item_rules.js +25 -3
- package/dist/domain/versions/rule_versions.js +1 -0
- package/dist/main.js +14 -4
- package/package.json +1 -1
- package/skills/architect/SKILL.md +6 -1
- package/skills/architect/feature.md +1 -1
- package/skills/architect/walkthrough.md +7 -4
- package/skills/build/SKILL.md +10 -8
- package/skills/dependency-approval/SKILL.md +8 -1
- package/skills/envision/SKILL.md +2 -0
- package/skills/envision/feature.md +1 -1
- package/skills/explore/SKILL.md +1 -1
- package/skills/formats/reference/architecture.md +1 -1
- package/skills/formats/reference/config.md +13 -4
- package/skills/formats/reference/specs.md +1 -1
- package/skills/formats/reference/work-items.md +1 -1
- package/skills/grilling/SKILL.md +19 -7
- package/skills/grilling/illustrating.md +37 -0
- package/skills/hexagonal-design/SKILL.md +2 -1
- package/skills/hexagonal-design/languages/rust.md +2 -1
- package/skills/improve/SKILL.md +3 -3
- package/skills/land/SKILL.md +2 -2
- package/skills/next/SKILL.md +1 -1
- package/skills/plan/SKILL.md +3 -3
- package/skills/plan/tasks.md +9 -5
- package/skills/realign/SKILL.md +2 -2
- package/skills/realign/notes/0.0.8.md +97 -0
- package/skills/realign/notes/0.0.9.md +59 -0
- package/skills/realign/notes.md +2 -0
- package/skills/research/SKILL.md +2 -1
- package/skills/rethink/SKILL.md +3 -3
- package/skills/rethink/levels.md +2 -2
- package/skills/roadmap/SKILL.md +2 -0
- package/skills/roles/SKILL.md +8 -10
- package/skills/roles/code-reviewer.md +10 -9
- package/skills/roles/design-reviewer.md +22 -12
- package/skills/roles/surveyor.md +1 -1
- package/skills/roles/verifier.md +8 -5
- package/skills/triage/SKILL.md +2 -0
- package/skills/verify/SKILL.md +6 -4
- package/src/adapters/inbound/cli/cli_context.ts +2 -0
- package/src/adapters/inbound/cli/commands/code.ts +2 -1
- package/src/adapters/inbound/cli/commands/journal.ts +1 -1
- package/src/adapters/inbound/cli/commands/show.ts +32 -0
- package/src/adapters/inbound/cli/commands/status.ts +19 -3
- package/src/adapters/inbound/cli/commands.ts +3 -1
- package/src/adapters/outbound/git_repository.ts +40 -7
- package/src/adapters/outbound/project_root.ts +13 -0
- package/src/app/use_cases/approve_artifact.ts +19 -1
- package/src/app/use_cases/check_code.ts +10 -3
- package/src/app/use_cases/journal_events.ts +8 -5
- package/src/app/use_cases/project_status.ts +4 -1
- package/src/app/use_cases/show_scope.ts +37 -0
- package/src/domain/check/budget_text.ts +61 -0
- package/src/domain/check/check_source.ts +7 -4
- package/src/domain/config.ts +23 -1
- package/src/domain/edits/agents_file.ts +6 -1
- package/src/domain/journal.ts +13 -2
- package/src/domain/project/scope_view.ts +134 -0
- package/src/domain/status/next_step.ts +25 -2
- package/src/domain/status/verification.ts +12 -0
- package/src/domain/status/work_status.ts +13 -2
- package/src/domain/validation/element_rules.ts +5 -0
- package/src/domain/validation/plan_rules.ts +1 -1
- package/src/domain/validation/size_rules.ts +14 -5
- package/src/domain/validation/work_item_rules.ts +25 -3
- package/src/domain/versions/rule_versions.ts +1 -0
- package/src/main.ts +14 -4
- package/templates/init/AGENTS.md +1 -1
- 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(
|
|
25
|
+
files: new NodeProjectFiles(root),
|
|
17
26
|
bundle: await PackageBundle.locate(),
|
|
18
27
|
clock: new SystemClock(),
|
|
19
|
-
repository: new GitRepository(
|
|
28
|
+
repository: new GitRepository(root),
|
|
20
29
|
interactivePrompter: new TerminalPrompter(),
|
|
21
30
|
unattendedPrompter: new DefaultAnswerPrompter(),
|
|
22
|
-
runner: new ProcessAgentRunner(
|
|
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`),
|
package/templates/init/AGENTS.md
CHANGED
|
@@ -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/`.
|
|
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
|
|
19
|
-
#
|
|
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:
|
|
22
|
-
max_types:
|
|
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.
|