4runr-cursor-setup 0.1.3 → 0.1.5

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.
@@ -1,6 +1,7 @@
1
1
  import * as fs from "fs";
2
2
  import * as path from "path";
3
3
  import * as url from "url";
4
+ import { ensureMemory } from "./memory.js";
4
5
  export const GROUPS = {
5
6
  core: ["4runr-start.md", "4runr-close.md"],
6
7
  planning: ["4runr-task.md", "4runr-phase.md"],
@@ -68,6 +69,8 @@ export function addGroup(opts) {
68
69
  copied++;
69
70
  }
70
71
  console.log('Installed group "' + group + '" into .cursor/commands (' + copied + " file(s) written).");
72
+ if (group === "core")
73
+ ensureMemory(cwd);
71
74
  }
72
75
  export function removeGroup(opts) {
73
76
  const { cwd, group } = opts;
@@ -21,6 +21,7 @@ function copyDir(srcDir, destDir) {
21
21
  }
22
22
  }
23
23
  }
24
+ import { ensureMemory } from "./memory.js";
24
25
  export async function init({ cwd }) {
25
26
  const __filename = fileURLToPath(import.meta.url);
26
27
  const __dirname = path.dirname(__filename);
@@ -37,7 +38,7 @@ export async function init({ cwd }) {
37
38
  const promptSrc = path.join(templatesRoot, "PROMPT_START.md");
38
39
  const promptDst = path.join(cwd, "PROMPT_START.md");
39
40
  writeFileIfMissing(promptDst, fs.readFileSync(promptSrc, "utf8"));
40
- console.log("Created Cursor project scaffold:");
41
+ ensureMemory(cwd);
41
42
  console.log(" - docs/*");
42
43
  console.log(" - .cursor/rules/project.md");
43
44
  console.log(" - plans/*");
@@ -0,0 +1,35 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ import * as url from "url";
4
+ function ensureDir(p) {
5
+ fs.mkdirSync(p, { recursive: true });
6
+ }
7
+ function copyIfMissing(src, dst) {
8
+ if (fs.existsSync(dst))
9
+ return false;
10
+ ensureDir(path.dirname(dst));
11
+ fs.copyFileSync(src, dst);
12
+ return true;
13
+ }
14
+ function getTemplatesRoot() {
15
+ const here = path.dirname(url.fileURLToPath(import.meta.url));
16
+ return path.resolve(here, "..", "templates");
17
+ }
18
+ export function ensureMemory(cwd) {
19
+ const root = getTemplatesRoot();
20
+ const srcBase = path.join(root, "memory");
21
+ const mappings = [
22
+ { src: path.join(srcBase, "docs", "status.md"), dst: path.join(cwd, "docs", "status.md") },
23
+ { src: path.join(srcBase, "docs", "todo.md"), dst: path.join(cwd, "docs", "todo.md") },
24
+ { src: path.join(srcBase, "docs", "decisions.md"), dst: path.join(cwd, "docs", "decisions.md") },
25
+ { src: path.join(srcBase, "cursor", "project.md"), dst: path.join(cwd, ".cursor", "rules", "project.md") },
26
+ ];
27
+ let created = 0;
28
+ for (const m of mappings) {
29
+ if (!fs.existsSync(m.src))
30
+ throw new Error("Template missing: " + m.src);
31
+ if (copyIfMissing(m.src, m.dst))
32
+ created++;
33
+ }
34
+ console.log(`Memory ensured (created ${created} file(s), left existing untouched).`);
35
+ }
@@ -0,0 +1,6 @@
1
+ # Project Rules
2
+ - Truth lives in files, not chat history.
3
+ - Do not claim tests pass unless executed.
4
+ - No emojis in docs.
5
+ - Avoid line-by-line comments.
6
+ - Prefer small, atomic diffs.
@@ -0,0 +1,2 @@
1
+ # Decisions
2
+ - (none yet)
@@ -0,0 +1,7 @@
1
+ # Status
2
+ - Project: (name)
3
+ - Current focus: (one line)
4
+ - Last known state: (one line)
5
+
6
+ # Notes
7
+ - Keep this file short.
@@ -0,0 +1,5 @@
1
+ # TODO
2
+ - [ ] (next atomic step)
3
+
4
+ # Blockers
5
+ - (none)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "4runr-cursor-setup",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -0,0 +1,6 @@
1
+ # Project Rules
2
+ - Truth lives in files, not chat history.
3
+ - Do not claim tests pass unless executed.
4
+ - No emojis in docs.
5
+ - Avoid line-by-line comments.
6
+ - Prefer small, atomic diffs.
@@ -0,0 +1,2 @@
1
+ # Decisions
2
+ - (none yet)
@@ -0,0 +1,7 @@
1
+ # Status
2
+ - Project: (name)
3
+ - Current focus: (one line)
4
+ - Last known state: (one line)
5
+
6
+ # Notes
7
+ - Keep this file short.
@@ -0,0 +1,5 @@
1
+ # TODO
2
+ - [ ] (next atomic step)
3
+
4
+ # Blockers
5
+ - (none)