@slowcook-ai/cli 0.2.0 → 0.4.0

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 (40) hide show
  1. package/README.md +65 -1
  2. package/dist/cli.js +14 -2
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/init/index.d.ts +2 -0
  5. package/dist/commands/init/index.d.ts.map +1 -0
  6. package/dist/commands/init/index.js +181 -0
  7. package/dist/commands/init/index.js.map +1 -0
  8. package/dist/commands/init/plan.d.ts +58 -0
  9. package/dist/commands/init/plan.d.ts.map +1 -0
  10. package/dist/commands/init/plan.js +136 -0
  11. package/dist/commands/init/plan.js.map +1 -0
  12. package/dist/commands/init/templates.d.ts +17 -0
  13. package/dist/commands/init/templates.d.ts.map +1 -0
  14. package/dist/commands/init/templates.js +163 -0
  15. package/dist/commands/init/templates.js.map +1 -0
  16. package/dist/commands/refine/agent.d.ts +62 -0
  17. package/dist/commands/refine/agent.d.ts.map +1 -0
  18. package/dist/commands/refine/agent.js +209 -0
  19. package/dist/commands/refine/agent.js.map +1 -0
  20. package/dist/commands/refine/index.d.ts +2 -0
  21. package/dist/commands/refine/index.d.ts.map +1 -0
  22. package/dist/commands/refine/index.js +177 -0
  23. package/dist/commands/refine/index.js.map +1 -0
  24. package/dist/commands/refine/llm.d.ts +27 -0
  25. package/dist/commands/refine/llm.d.ts.map +1 -0
  26. package/dist/commands/refine/llm.js +33 -0
  27. package/dist/commands/refine/llm.js.map +1 -0
  28. package/dist/commands/refine/prompts.d.ts +23 -0
  29. package/dist/commands/refine/prompts.d.ts.map +1 -0
  30. package/dist/commands/refine/prompts.js +115 -0
  31. package/dist/commands/refine/prompts.js.map +1 -0
  32. package/dist/commands/refine/relationship.d.ts +21 -0
  33. package/dist/commands/refine/relationship.d.ts.map +1 -0
  34. package/dist/commands/refine/relationship.js +148 -0
  35. package/dist/commands/refine/relationship.js.map +1 -0
  36. package/dist/commands/refine/spec-yaml.d.ts +192 -0
  37. package/dist/commands/refine/spec-yaml.d.ts.map +1 -0
  38. package/dist/commands/refine/spec-yaml.js +125 -0
  39. package/dist/commands/refine/spec-yaml.js.map +1 -0
  40. package/package.json +7 -3
package/README.md CHANGED
@@ -8,7 +8,71 @@ CLI for the slowcook brewing harness. Installs the `slowcook` binary.
8
8
  npm i -D @slowcook-ai/cli
9
9
  ```
10
10
 
11
- ## Commands (v0.1)
11
+ ## Commands (v0.4)
12
+
13
+ ### `slowcook refine` (first agent)
14
+
15
+ Drives a GitHub issue through a clarifying-question loop until a frozen spec is emitted as a draft PR. Enforces the issue-level ratchet: new issues must not silently duplicate or contradict earlier decisions.
16
+
17
+ ```bash
18
+ npx slowcook refine --issue <number> [options]
19
+ ```
20
+
21
+ **Required environment:**
22
+
23
+ - `ANTHROPIC_API_KEY` — for the refinement and relationship-analysis LLM calls
24
+ - `GITHUB_TOKEN` — with `contents: write`, `issues: write`, `pull-requests: write`
25
+
26
+ **Options:**
27
+
28
+ | Flag | Default | Description |
29
+ |---|---|---|
30
+ | `--issue <number>` | required | GitHub issue number |
31
+ | `--cwd <path>` | `.` | Repo working directory |
32
+ | `--owner <login>` | parsed from git remote | Repo owner |
33
+ | `--repo <name>` | parsed from git remote | Repo name |
34
+ | `--base <branch>` | `main` | Base branch for the draft spec PR |
35
+ | `--refine-model <id>` | `claude-opus-4-7` | Model for the refinement loop |
36
+ | `--relationship-model <id>` | `claude-sonnet-4-5` | Model for relationship analysis |
37
+
38
+ **Behaviour per invocation:**
39
+
40
+ 1. Reads the issue (body + labels + comments) and all currently-active specs.
41
+ 2. Runs a relationship analysis: `new_or_independent | overlap | contradiction`.
42
+ 3. Acts on the verdict:
43
+ - **overlap** — posts a comment naming the overlapping spec ids, applies `blocked-overlap` label, exits.
44
+ - **contradiction** without `change-of-mind` label — posts a blocker comment, applies `blocked-contradiction` label, exits.
45
+ - **contradiction** with `change-of-mind` label — proceeds; the spec's `supersedes` field is populated.
46
+ - **new / independent** — proceeds to the refinement loop.
47
+ 4. Runs one round of refinement: either posts clarifying questions (and exits; next invocation picks up on the next PM comment) OR emits the spec YAML, writes `specs/story-N.yaml` and updates `specs/_index.yaml`, commits + pushes a branch, opens a draft PR, applies `spec-ready` label.
48
+
49
+ Re-run on every new PM comment in the issue (via a GitHub Actions workflow triggered by `issue_comment` + `issues` events).
50
+
51
+ ### `slowcook init`
52
+
53
+ Scaffold slowcook configuration in a consumer project. Writes `.brewing/*`, `.github/workflows/slowcook.yml`, and a `CODEOWNERS` section. Idempotent — re-running skips existing files unless `--force`.
54
+
55
+ ```bash
56
+ npx slowcook init [--owner <handle>] [--force] [--dry-run] [--cwd <path>]
57
+ ```
58
+
59
+ **Options:**
60
+
61
+ | Flag | Default | Description |
62
+ |---|---|---|
63
+ | `--cwd <path>` | `.` | Target project directory |
64
+ | `--owner <handle>` | detected from git remote | CODEOWNERS handle/team (e.g. `@aminazar`, `@acme/frontend`) |
65
+ | `--force` | false | Overwrite existing slowcook files |
66
+ | `--dry-run` | false | Print the plan without writing anything |
67
+
68
+ **Stack detection (0.3):** reads `package.json`. Requires Vitest in `devDependencies`. If Playwright is present, it's noted as a warning and left out of `stack.json` until slowcook supports Playwright discovery.
69
+
70
+ **CODEOWNERS handling:** uses `# --- slowcook:frozen-paths BEGIN/END ---` markers so re-running or adopting slowcook in a repo that already has a `CODEOWNERS` is safe.
71
+
72
+ **Exit codes:**
73
+
74
+ - `0` — success (or dry-run completed)
75
+ - `2` — script error (no `package.json`, vitest not found, invalid JSON)
12
76
 
13
77
  ### `slowcook guard`
14
78
 
package/dist/cli.js CHANGED
@@ -1,23 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import { guard } from "./commands/guard.js";
3
3
  import { manifest } from "./commands/manifest.js";
4
- const VERSION = "0.2.0";
4
+ import { init } from "./commands/init/index.js";
5
+ import { refine } from "./commands/refine/index.js";
6
+ const VERSION = "0.4.0";
5
7
  const USAGE = `
6
8
  slowcook — TDD-first agentic development harness
7
9
 
8
10
  Usage:
11
+ slowcook init [--owner <handle>] [--force] [--dry-run] [--cwd <path>]
9
12
  slowcook guard --base <ref> --head <ref> [--override] [--config <path>]
10
13
  slowcook manifest record [--stack-config <path>] [--manifest <path>] [--story <id>]
11
14
  slowcook manifest verify [--stack-config <path>] [--manifest <path>] [--story <id>]
15
+ slowcook refine --issue <number> [--cwd <path>] [--owner <login>] [--repo <name>]
12
16
  slowcook version
13
17
  slowcook help
14
18
 
15
19
  Commands available in ${VERSION}:
20
+ init Scaffold slowcook configuration in a consumer project.
16
21
  guard Check for frozen-path violations between two git refs.
17
22
  manifest Record or verify the set of discoverable tests.
23
+ refine Drive a GitHub issue toward a frozen spec (refinement agent).
18
24
 
19
25
  Coming in later versions:
20
- init, refine, testgen, brew, review, dashboard
26
+ testgen, brew, review, dashboard
21
27
 
22
28
  Docs: https://github.com/aminazar/slowcook
23
29
  `;
@@ -25,12 +31,18 @@ async function main() {
25
31
  const args = process.argv.slice(2);
26
32
  const command = args[0];
27
33
  switch (command) {
34
+ case "init":
35
+ await init(args.slice(1), VERSION);
36
+ return;
28
37
  case "guard":
29
38
  await guard(args.slice(1));
30
39
  return;
31
40
  case "manifest":
32
41
  await manifest(args.slice(1));
33
42
  return;
43
+ case "refine":
44
+ await refine(args.slice(1), VERSION);
45
+ return;
34
46
  case "version":
35
47
  case "--version":
36
48
  case "-v":
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,MAAM,KAAK,GAAG;;;;;;;;;;wBAUU,OAAO;;;;;;;;CAQ9B,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,C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CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function init(argv: string[], cliVersion: string): Promise<void>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAmIA,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2E5E"}
@@ -0,0 +1,181 @@
1
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, } from "node:fs";
2
+ import { dirname, resolve, relative, isAbsolute } from "node:path";
3
+ import { execSync } from "node:child_process";
4
+ import { buildPlan, InitError } from "./plan.js";
5
+ function parseArgs(argv) {
6
+ const args = {
7
+ cwd: process.cwd(),
8
+ owner: undefined,
9
+ force: false,
10
+ dryRun: false,
11
+ };
12
+ for (let i = 0; i < argv.length; i++) {
13
+ const arg = argv[i];
14
+ const next = argv[i + 1];
15
+ if (arg === "--cwd" && next) {
16
+ args.cwd = resolve(next);
17
+ i++;
18
+ }
19
+ else if (arg === "--owner" && next) {
20
+ args.owner = next;
21
+ i++;
22
+ }
23
+ else if (arg === "--force") {
24
+ args.force = true;
25
+ }
26
+ else if (arg === "--dry-run") {
27
+ args.dryRun = true;
28
+ }
29
+ else if (arg === "--help" || arg === "-h") {
30
+ printHelp();
31
+ process.exit(0);
32
+ }
33
+ }
34
+ return args;
35
+ }
36
+ function printHelp() {
37
+ console.log(`
38
+ slowcook init — scaffold slowcook configuration in a consumer project
39
+
40
+ Usage:
41
+ slowcook init [options]
42
+
43
+ Options:
44
+ --cwd <path> Target project directory (default: current directory)
45
+ --owner <handle> CODEOWNERS handle/team, e.g. "@aminazar" or "@acme/frontend".
46
+ If omitted, slowcook tries to detect from \`git remote get-url origin\`;
47
+ falls back to "@TODO-OWNER" with a warning.
48
+ --force Overwrite existing slowcook files (default: skip existing)
49
+ --dry-run Print the plan without writing anything to disk
50
+ --help, -h Show this help
51
+
52
+ Writes:
53
+ .brewing/frozen-paths.json
54
+ .brewing/stack.json
55
+ .brewing/README.md
56
+ .brewing/manifests/.gitkeep
57
+ .github/workflows/slowcook.yml
58
+ CODEOWNERS (appends slowcook section if file exists)
59
+
60
+ Exit codes:
61
+ 0 success (or dry-run completed)
62
+ 2 script error (no package.json, vitest not detected, etc.)
63
+ `);
64
+ }
65
+ function makeReader(cwd) {
66
+ return {
67
+ exists: (p) => existsSync(resolveIn(cwd, p)),
68
+ read: (p) => readFileSync(resolveIn(cwd, p), "utf8"),
69
+ };
70
+ }
71
+ function resolveIn(cwd, path) {
72
+ if (isAbsolute(path))
73
+ return path;
74
+ return resolve(cwd, path);
75
+ }
76
+ function detectOwnerFromGitRemote(cwd) {
77
+ try {
78
+ const url = execSync("git remote get-url origin", {
79
+ cwd,
80
+ encoding: "utf8",
81
+ stdio: ["ignore", "pipe", "ignore"],
82
+ }).trim();
83
+ // https://github.com/USER/REPO.git | git@github.com:USER/REPO.git
84
+ const m = url.match(/github\.com[:/]([^/]+)\/[^/.]+(?:\.git)?$/) ??
85
+ url.match(/gitlab\.com[:/]([^/]+)\/[^/.]+(?:\.git)?$/);
86
+ if (m && m[1])
87
+ return `@${m[1]}`;
88
+ }
89
+ catch {
90
+ // not a git repo, or no origin — fine, fall through
91
+ }
92
+ return null;
93
+ }
94
+ function formatAction(a) {
95
+ switch (a.kind) {
96
+ case "create":
97
+ return ` CREATE ${a.path}`;
98
+ case "overwrite":
99
+ return ` OVERWRITE ${a.path}`;
100
+ case "append":
101
+ return ` APPEND ${a.path} (preserving existing content)`;
102
+ case "skip-exists":
103
+ return ` SKIP ${a.path} (${a.reason})`;
104
+ case "conflict":
105
+ return ` CONFLICT ${a.path} (${a.reason})`;
106
+ }
107
+ }
108
+ function applyAction(cwd, a) {
109
+ if (a.kind === "skip-exists" || a.kind === "conflict")
110
+ return;
111
+ const full = resolveIn(cwd, a.path);
112
+ mkdirSync(dirname(full), { recursive: true });
113
+ const contents = a.kind === "create" || a.kind === "overwrite" || a.kind === "append"
114
+ ? a.contents
115
+ : "";
116
+ writeFileSync(full, contents, "utf8");
117
+ }
118
+ export async function init(argv, cliVersion) {
119
+ const args = parseArgs(argv);
120
+ const reader = makeReader(args.cwd);
121
+ let owner = args.owner;
122
+ if (!owner) {
123
+ const detected = detectOwnerFromGitRemote(args.cwd);
124
+ if (detected) {
125
+ owner = detected;
126
+ console.log(`Detected CODEOWNERS handle from git remote: ${owner}`);
127
+ }
128
+ else {
129
+ owner = "@TODO-OWNER";
130
+ console.log("::warning::Could not detect a CODEOWNERS handle from git remote. Using @TODO-OWNER as a placeholder — replace it after init.");
131
+ }
132
+ }
133
+ let plan;
134
+ try {
135
+ plan = buildPlan(reader, {
136
+ cwd: args.cwd,
137
+ owner,
138
+ force: args.force,
139
+ cliVersion,
140
+ });
141
+ }
142
+ catch (e) {
143
+ if (e instanceof InitError) {
144
+ console.error(`slowcook init: ${e.message}`);
145
+ process.exit(2);
146
+ }
147
+ throw e;
148
+ }
149
+ console.log(`Detected stack:`);
150
+ console.log(` language: ${plan.detected.language}`);
151
+ console.log(` vitest: ${plan.detected.hasVitest}`);
152
+ console.log(` playwright: ${plan.detected.hasPlaywright}`);
153
+ console.log();
154
+ if (plan.warnings.length > 0) {
155
+ console.log("Warnings:");
156
+ for (const w of plan.warnings)
157
+ console.log(` - ${w}`);
158
+ console.log();
159
+ }
160
+ console.log(`Planned file actions (cwd: ${relative(process.cwd(), args.cwd) || "."}):`);
161
+ for (const a of plan.actions)
162
+ console.log(formatAction(a));
163
+ console.log();
164
+ if (args.dryRun) {
165
+ console.log("Dry-run complete — no files written.");
166
+ return;
167
+ }
168
+ for (const a of plan.actions)
169
+ applyAction(args.cwd, a);
170
+ const skippedCount = plan.actions.filter((a) => a.kind === "skip-exists").length;
171
+ console.log(`slowcook init: ${plan.actions.length - skippedCount} file(s) written, ${skippedCount} skipped.`);
172
+ console.log();
173
+ console.log("Next steps:");
174
+ console.log(` 1. Review .brewing/frozen-paths.json — add/remove directories to match your repo.`);
175
+ if (owner === "@TODO-OWNER") {
176
+ console.log(` 2. Replace @TODO-OWNER in CODEOWNERS with your GitHub handle/team.`);
177
+ }
178
+ console.log(` ${owner === "@TODO-OWNER" ? "3." : "2."} Run \`slowcook manifest record\` once your test set is stable.`);
179
+ console.log(` ${owner === "@TODO-OWNER" ? "4." : "3."} Commit and open a PR; slowcook CI will run on it.`);
180
+ }
181
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAoC,MAAM,WAAW,CAAC;AASnF,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,IAAI,GAAa;QACrB,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;KACd,CAAC;IACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,E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AAC;IAEd,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,OAAO;IACT,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAEvD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,MAAM,CAAC;IACjF,OAAO,CAAC,GAAG,CACT,kBAAkB,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,YAAY,qBAAqB,YAAY,WAAW,CACjG,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,CACT,qFAAqF,CACtF,CAAC;IACF,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,iEAAiE,CAC5G,CAAC;IACF,OAAO,CAAC,GAAG,CACT,KAAK,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,oDAAoD,CAC/F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,58 @@
1
+ export interface PackageJson {
2
+ dependencies?: Record<string, string>;
3
+ devDependencies?: Record<string, string>;
4
+ scripts?: Record<string, string>;
5
+ }
6
+ export interface DetectedStack {
7
+ language: "typescript";
8
+ hasVitest: boolean;
9
+ hasPlaywright: boolean;
10
+ }
11
+ /** Minimal filesystem reader so planning is pure. */
12
+ export interface FileReader {
13
+ exists(path: string): boolean;
14
+ read(path: string): string;
15
+ }
16
+ export interface PlanOptions {
17
+ /** Consumer project root (where package.json lives). */
18
+ cwd: string;
19
+ /** CODEOWNERS handle/team (e.g., "@aminazar"). */
20
+ owner: string;
21
+ /** Overwrite existing files (default: skip-if-exists). */
22
+ force: boolean;
23
+ /** Version of the CLI invoking init; drives the CI workflow pin. */
24
+ cliVersion?: string;
25
+ }
26
+ export type FileAction = {
27
+ kind: "create";
28
+ path: string;
29
+ contents: string;
30
+ } | {
31
+ kind: "skip-exists";
32
+ path: string;
33
+ reason: string;
34
+ } | {
35
+ kind: "overwrite";
36
+ path: string;
37
+ contents: string;
38
+ } | {
39
+ kind: "append";
40
+ path: string;
41
+ contents: string;
42
+ existingContents: string;
43
+ } | {
44
+ kind: "conflict";
45
+ path: string;
46
+ reason: string;
47
+ };
48
+ export interface Plan {
49
+ detected: DetectedStack;
50
+ actions: FileAction[];
51
+ warnings: string[];
52
+ }
53
+ export declare function detectStack(pkg: PackageJson): DetectedStack;
54
+ export declare class InitError extends Error {
55
+ constructor(message: string);
56
+ }
57
+ export declare function buildPlan(reader: FileReader, options: PlanOptions): Plan;
58
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/init/plan.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,WAAW;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qDAAqD;AACrD,MAAM,WAAW,UAAU;IACzB,MAAM,CAA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AAI,CAiExE"}
@@ -0,0 +1,136 @@
1
+ // Pure planning logic for `slowcook init`. Takes a snapshot of the filesystem
2
+ // (via an injected reader), returns the planned actions. No I/O side effects
3
+ // here — all writes happen in the CLI wrapper so this is trivially testable.
4
+ import { frozenPathsJson, stackJson, brewingReadme, slowcookWorkflow, codeownersFullFile, codeownersSection, gitkeep, CLI_VERSION_FOR_TEMPLATES, SLOWCOOK_CODEOWNERS_MARKER_BEGIN, SLOWCOOK_CODEOWNERS_MARKER_END, } from "./templates.js";
5
+ const TARGETS = {
6
+ frozenPaths: ".brewing/frozen-paths.json",
7
+ stack: ".brewing/stack.json",
8
+ brewingReadme: ".brewing/README.md",
9
+ manifestsGitkeep: ".brewing/manifests/.gitkeep",
10
+ workflow: ".github/workflows/slowcook.yml",
11
+ codeowners: "CODEOWNERS",
12
+ packageJson: "package.json",
13
+ };
14
+ export function detectStack(pkg) {
15
+ const deps = { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) };
16
+ return {
17
+ language: "typescript",
18
+ hasVitest: "vitest" in deps,
19
+ hasPlaywright: "@playwright/test" in deps || "playwright" in deps,
20
+ };
21
+ }
22
+ export class InitError extends Error {
23
+ constructor(message) {
24
+ super(message);
25
+ this.name = "InitError";
26
+ }
27
+ }
28
+ export function buildPlan(reader, options) {
29
+ if (!reader.exists(TARGETS.packageJson)) {
30
+ throw new InitError(`No package.json found at ${options.cwd}. \`slowcook init\` expects to run in a TS/JS project root.`);
31
+ }
32
+ let pkg;
33
+ try {
34
+ pkg = JSON.parse(reader.read(TARGETS.packageJson));
35
+ }
36
+ catch (e) {
37
+ throw new InitError(`package.json is not valid JSON: ${e.message}`);
38
+ }
39
+ const detected = detectStack(pkg);
40
+ const warnings = [];
41
+ const actions = [];
42
+ const cliVersion = options.cliVersion ?? CLI_VERSION_FOR_TEMPLATES;
43
+ if (!detected.hasVitest) {
44
+ throw new InitError(`No test runner detected. slowcook 0.3 requires Vitest (found in devDependencies). ` +
45
+ `Install it with \`npm i -D vitest\` and re-run.`);
46
+ }
47
+ if (detected.hasPlaywright) {
48
+ warnings.push("Playwright detected. slowcook 0.3 doesn't yet implement Playwright discovery, " +
49
+ "so the e2e suite is intentionally omitted from stack.json. Add it back when " +
50
+ "playwright discovery ships in a later slowcook release.");
51
+ }
52
+ const tmplParams = {
53
+ owner: options.owner,
54
+ hasPlaywright: detected.hasPlaywright,
55
+ };
56
+ // 1. .brewing/frozen-paths.json
57
+ addSimpleFile(actions, reader, options.force, TARGETS.frozenPaths, frozenPathsJson());
58
+ // 2. .brewing/stack.json
59
+ addSimpleFile(actions, reader, options.force, TARGETS.stack, stackJson(tmplParams));
60
+ // 3. .brewing/README.md
61
+ addSimpleFile(actions, reader, options.force, TARGETS.brewingReadme, brewingReadme());
62
+ // 4. .brewing/manifests/.gitkeep (only if we're creating the dir)
63
+ if (!reader.exists(".brewing/manifests/")) {
64
+ actions.push({ kind: "create", path: TARGETS.manifestsGitkeep, contents: gitkeep() });
65
+ }
66
+ // 5. .github/workflows/slowcook.yml
67
+ addSimpleFile(actions, reader, options.force, TARGETS.workflow, slowcookWorkflow(cliVersion));
68
+ // 6. CODEOWNERS — special case (append if exists without our markers)
69
+ actions.push(planCodeowners(reader, options, tmplParams));
70
+ return { detected, actions, warnings };
71
+ }
72
+ function addSimpleFile(actions, reader, force, path, contents) {
73
+ if (!reader.exists(path)) {
74
+ actions.push({ kind: "create", path, contents });
75
+ return;
76
+ }
77
+ const existing = reader.read(path);
78
+ if (existing === contents) {
79
+ actions.push({ kind: "skip-exists", path, reason: "file already matches template" });
80
+ return;
81
+ }
82
+ if (force) {
83
+ actions.push({ kind: "overwrite", path, contents });
84
+ return;
85
+ }
86
+ actions.push({
87
+ kind: "skip-exists",
88
+ path,
89
+ reason: "file exists and differs from template (use --force to overwrite)",
90
+ });
91
+ }
92
+ function planCodeowners(reader, options, params) {
93
+ const path = TARGETS.codeowners;
94
+ if (!reader.exists(path)) {
95
+ return { kind: "create", path, contents: codeownersFullFile(params) };
96
+ }
97
+ const existing = reader.read(path);
98
+ if (existing.includes(SLOWCOOK_CODEOWNERS_MARKER_BEGIN) &&
99
+ existing.includes(SLOWCOOK_CODEOWNERS_MARKER_END)) {
100
+ if (options.force) {
101
+ // Replace the slowcook section inline
102
+ const replaced = replaceCodeownersSection(existing, params);
103
+ return { kind: "overwrite", path, contents: replaced };
104
+ }
105
+ return {
106
+ kind: "skip-exists",
107
+ path,
108
+ reason: "slowcook section already present (use --force to regenerate)",
109
+ };
110
+ }
111
+ // Existing CODEOWNERS without our markers → append
112
+ const toAppend = (existing.endsWith("\n") ? existing : existing + "\n") +
113
+ "\n" +
114
+ codeownersSection(params);
115
+ return {
116
+ kind: "append",
117
+ path,
118
+ contents: toAppend,
119
+ existingContents: existing,
120
+ };
121
+ }
122
+ function replaceCodeownersSection(existing, params) {
123
+ const begin = existing.indexOf(SLOWCOOK_CODEOWNERS_MARKER_BEGIN);
124
+ const endMarkerStart = existing.indexOf(SLOWCOOK_CODEOWNERS_MARKER_END);
125
+ if (begin === -1 || endMarkerStart === -1 || endMarkerStart < begin) {
126
+ // Shouldn't happen if caller verified markers exist, but be defensive
127
+ return existing + "\n" + codeownersSection(params);
128
+ }
129
+ const endMarkerEnd = endMarkerStart + SLOWCOOK_CODEOWNERS_MARKER_END.length;
130
+ // Include the trailing newline if present
131
+ const after = existing[endMarkerEnd] === "\n"
132
+ ? existing.slice(endMarkerEnd + 1)
133
+ : existing.slice(endMarkerEnd);
134
+ return existing.slice(0, begin) + codeownersSection(params) + after;
135
+ }
136
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../../src/commands/init/plan.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,6EAA6E;AAE7E,OAAO,EACL,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,yBAAyB,EAC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AAK,CAAC,CAAC,IAAI,cAAc,GAAG,KAAK,EAAE,CAAC;QACpE,sEAAsE;QACtE,OAAO,QAAQ,GAAG,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,YAAY,GAAG,cAAc,GAAG,8BAA8B,CAAC,MAAM,CAAC;IAC5E,0CAA0C;IAC1C,MAAM,KAAK,GACT,QAAQ,CAAC,YAAY,CAAC,KAAK,IAAI;QAC7B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;QAClC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AACtE,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const CLI_VERSION_FOR_TEMPLATES = "0.3.0";
2
+ export interface TemplateParams {
3
+ /** CODEOWNERS handle or team (e.g. "@aminazar" or "@acme/frontend"). */
4
+ owner: string;
5
+ /** Whether the project has Playwright installed (affects stack.json comments). */
6
+ hasPlaywright: boolean;
7
+ }
8
+ export declare const SLOWCOOK_CODEOWNERS_MARKER_BEGIN = "# --- slowcook:frozen-paths BEGIN ---";
9
+ export declare const SLOWCOOK_CODEOWNERS_MARKER_END = "# --- slowcook:frozen-paths END ---";
10
+ export declare function frozenPathsJson(): string;
11
+ export declare function stackJson(params: TemplateParams): string;
12
+ export declare function brewingReadme(): string;
13
+ export declare function slowcookWorkflow(cliVersion: string): string;
14
+ export declare function codeownersSection(params: TemplateParams): string;
15
+ export declare function codeownersFullFile(params: TemplateParams): string;
16
+ export declare function gitkeep(): string;
17
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/commands/init/templates.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gCAAgC,0CAA0C,CAAC;AACxF,eAAO,MAAM,8BAA8B,wCAAwC,CAAC;AAEpF,wBAAgB,eAAe,IAAI,MAAM,CAiCxC;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAkCxD;AAED,wBAAgB,aAAa,IAAI,MAAM,CA+BtC;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA2C3D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAchE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAQjE;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC"}