4runr-cursor-setup 0.1.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.
- package/LICENSE +21 -0
- package/dist/cli.js +17 -0
- package/dist/commands/init.js +45 -0
- package/dist/templates/PROMPT_START.md +60 -0
- package/dist/templates/cursor/project.md +33 -0
- package/dist/templates/docs/architecture.md +16 -0
- package/dist/templates/docs/constraints.md +16 -0
- package/dist/templates/docs/decisions.md +21 -0
- package/dist/templates/docs/scope.md +16 -0
- package/dist/templates/docs/todo.md +13 -0
- package/dist/templates/plans/README.md +4 -0
- package/package.json +32 -0
- package/scripts/add-shebang.cjs +18 -0
- package/scripts/copy-templates.cjs +23 -0
- package/src/templates/PROMPT_START.md +60 -0
- package/src/templates/cursor/project.md +33 -0
- package/src/templates/docs/architecture.md +16 -0
- package/src/templates/docs/constraints.md +16 -0
- package/src/templates/docs/decisions.md +21 -0
- package/src/templates/docs/scope.md +16 -0
- package/src/templates/docs/todo.md +13 -0
- package/src/templates/plans/README.md +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 4Runr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { init } from "./commands/init.js";
|
|
3
|
+
const args = process.argv.slice(2);
|
|
4
|
+
const cmd = args[0];
|
|
5
|
+
async function main() {
|
|
6
|
+
if (cmd === "init") {
|
|
7
|
+
await init({ cwd: process.cwd() });
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
console.log("4runr-cursor-setup");
|
|
11
|
+
console.log("Usage: 4runr-cursor-setup init");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
main().catch((err) => {
|
|
15
|
+
console.error(err);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
function ensureDir(p) {
|
|
5
|
+
fs.mkdirSync(p, { recursive: true });
|
|
6
|
+
}
|
|
7
|
+
function writeFileIfMissing(filePath, content) {
|
|
8
|
+
if (!fs.existsSync(filePath))
|
|
9
|
+
fs.writeFileSync(filePath, content, "utf8");
|
|
10
|
+
}
|
|
11
|
+
function copyDir(srcDir, destDir) {
|
|
12
|
+
ensureDir(destDir);
|
|
13
|
+
for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
|
|
14
|
+
const src = path.join(srcDir, entry.name);
|
|
15
|
+
const dst = path.join(destDir, entry.name);
|
|
16
|
+
if (entry.isDirectory())
|
|
17
|
+
copyDir(src, dst);
|
|
18
|
+
else if (entry.isFile()) {
|
|
19
|
+
const content = fs.readFileSync(src, "utf8");
|
|
20
|
+
writeFileIfMissing(dst, content);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export async function init({ cwd }) {
|
|
25
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
26
|
+
const __dirname = path.dirname(__filename);
|
|
27
|
+
// src/commands -> src
|
|
28
|
+
const srcRoot = path.resolve(__dirname, "..");
|
|
29
|
+
const templatesRoot = path.join(srcRoot, "templates");
|
|
30
|
+
copyDir(path.join(templatesRoot, "docs"), path.join(cwd, "docs"));
|
|
31
|
+
copyDir(path.join(templatesRoot, "plans"), path.join(cwd, "plans"));
|
|
32
|
+
const cursorRulesDir = path.join(cwd, ".cursor", "rules");
|
|
33
|
+
ensureDir(cursorRulesDir);
|
|
34
|
+
const projectRuleSrc = path.join(templatesRoot, "cursor", "project.md");
|
|
35
|
+
const projectRuleDst = path.join(cursorRulesDir, "project.md");
|
|
36
|
+
writeFileIfMissing(projectRuleDst, fs.readFileSync(projectRuleSrc, "utf8"));
|
|
37
|
+
const promptSrc = path.join(templatesRoot, "PROMPT_START.md");
|
|
38
|
+
const promptDst = path.join(cwd, "PROMPT_START.md");
|
|
39
|
+
writeFileIfMissing(promptDst, fs.readFileSync(promptSrc, "utf8"));
|
|
40
|
+
console.log("Created Cursor project scaffold:");
|
|
41
|
+
console.log(" - docs/*");
|
|
42
|
+
console.log(" - .cursor/rules/project.md");
|
|
43
|
+
console.log(" - plans/*");
|
|
44
|
+
console.log(" - PROMPT_START.md");
|
|
45
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Project Initialization Prompt
|
|
2
|
+
|
|
3
|
+
You are now operating inside a specific project context.
|
|
4
|
+
|
|
5
|
+
Before doing anything else, you must:
|
|
6
|
+
|
|
7
|
+
1. Read and internalize the following files (if they exist):
|
|
8
|
+
- `docs/scope.md`
|
|
9
|
+
- `docs/architecture.md`
|
|
10
|
+
- `docs/constraints.md`
|
|
11
|
+
- `docs/decisions.md`
|
|
12
|
+
- `docs/todo.md`
|
|
13
|
+
- `.cursor/rules/project.md`
|
|
14
|
+
|
|
15
|
+
2. Treat these files as the source of truth for this project.
|
|
16
|
+
- If chat instructions conflict with these files, the files override chat.
|
|
17
|
+
- Do not invent requirements, architecture, or constraints that are not explicitly stated.
|
|
18
|
+
|
|
19
|
+
3. If any of these files are missing, incomplete, or ambiguous:
|
|
20
|
+
- Call it out explicitly.
|
|
21
|
+
- Ask targeted clarifying questions.
|
|
22
|
+
- Do NOT guess.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Operating Mode for This Project
|
|
27
|
+
|
|
28
|
+
### Planning-First Workflow
|
|
29
|
+
- Do not jump into implementation.
|
|
30
|
+
- Always propose a step-by-step plan before non-trivial work.
|
|
31
|
+
- Ask clarifying questions if you are less than 90% confident.
|
|
32
|
+
- Wait for approval before executing the plan.
|
|
33
|
+
|
|
34
|
+
### Atomic Execution
|
|
35
|
+
- Break work into small, isolated steps.
|
|
36
|
+
- Do not batch large changes.
|
|
37
|
+
- Do not refactor multiple systems at once.
|
|
38
|
+
- Request confirmation before large or structural changes.
|
|
39
|
+
|
|
40
|
+
### Context Discipline
|
|
41
|
+
- Treat context as limited system memory.
|
|
42
|
+
- Warn if context may be insufficient.
|
|
43
|
+
- Prefer file-based memory over chat memory.
|
|
44
|
+
- Ask for missing information instead of guessing.
|
|
45
|
+
|
|
46
|
+
### Transparency
|
|
47
|
+
- Be explicit about what you change and why.
|
|
48
|
+
- Never claim something works unless it was actually verified.
|
|
49
|
+
- Clearly distinguish between theoretical correctness and verified correctness.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Confirmation
|
|
54
|
+
|
|
55
|
+
First, confirm that you have:
|
|
56
|
+
1. Read the project files
|
|
57
|
+
2. Understood the scope and constraints
|
|
58
|
+
3. Identified any missing or unclear information
|
|
59
|
+
|
|
60
|
+
Then summarize your understanding of the system in 5–10 bullet points before doing any work.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Project Rules
|
|
2
|
+
|
|
3
|
+
## Stack
|
|
4
|
+
- Language(s):
|
|
5
|
+
- Framework(s):
|
|
6
|
+
- Runtime:
|
|
7
|
+
- Package manager:
|
|
8
|
+
- DB / storage:
|
|
9
|
+
- Hosting:
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
- Install:
|
|
13
|
+
- Dev:
|
|
14
|
+
- Build:
|
|
15
|
+
- Test:
|
|
16
|
+
- Lint:
|
|
17
|
+
- Typecheck:
|
|
18
|
+
|
|
19
|
+
## Architecture Rules
|
|
20
|
+
- Where does business logic live:
|
|
21
|
+
- Where do API routes live:
|
|
22
|
+
- Data access patterns:
|
|
23
|
+
- Error handling pattern:
|
|
24
|
+
- Logging / observability pattern:
|
|
25
|
+
|
|
26
|
+
## Code Style
|
|
27
|
+
- Naming conventions:
|
|
28
|
+
- Formatting:
|
|
29
|
+
- Testing style:
|
|
30
|
+
|
|
31
|
+
## Forbidden / Avoid
|
|
32
|
+
- Do not:
|
|
33
|
+
- Avoid:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Decisions
|
|
2
|
+
|
|
3
|
+
Use this format for each decision:
|
|
4
|
+
|
|
5
|
+
## Decision: <title>
|
|
6
|
+
**Date:** YYYY-MM-DD
|
|
7
|
+
**Status:** Proposed | Accepted | Deprecated
|
|
8
|
+
|
|
9
|
+
### Context
|
|
10
|
+
-
|
|
11
|
+
|
|
12
|
+
### Options Considered
|
|
13
|
+
1.
|
|
14
|
+
2.
|
|
15
|
+
3.
|
|
16
|
+
|
|
17
|
+
### Decision
|
|
18
|
+
-
|
|
19
|
+
|
|
20
|
+
### Trade-offs / Consequences
|
|
21
|
+
-
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "4runr-cursor-setup",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"dev": "tsx src/cli.ts",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"prepublishOnly": "npm run build",
|
|
11
|
+
"postbuild": "node scripts/copy-templates.cjs && node scripts/add-shebang.cjs"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^25.0.9",
|
|
19
|
+
"tsx": "^4.21.0",
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"4runr-cursor-setup": "dist/cli.js"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"src/templates",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"scripts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
|
|
3
|
+
const file = "dist/cli.js";
|
|
4
|
+
if (!fs.existsSync(file)) {
|
|
5
|
+
console.error(`[add-shebang] Missing ${file}. Run build first.`);
|
|
6
|
+
process.exit(1);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let content = fs.readFileSync(file, "utf8");
|
|
10
|
+
|
|
11
|
+
// Add shebang only if it's not already there
|
|
12
|
+
if (!content.startsWith("#!/usr/bin/env node")) {
|
|
13
|
+
content = "#!/usr/bin/env node\n" + content;
|
|
14
|
+
fs.writeFileSync(file, content, "utf8");
|
|
15
|
+
console.log("[add-shebang] Added shebang to dist/cli.js");
|
|
16
|
+
} else {
|
|
17
|
+
console.log("[add-shebang] Shebang already present");
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
function copyDir(src, dest) {
|
|
5
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
6
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
7
|
+
const srcPath = path.join(src, entry.name);
|
|
8
|
+
const destPath = path.join(dest, entry.name);
|
|
9
|
+
if (entry.isDirectory()) copyDir(srcPath, destPath);
|
|
10
|
+
else fs.copyFileSync(srcPath, destPath);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const srcTemplates = path.join(process.cwd(), "src", "templates");
|
|
15
|
+
const distTemplates = path.join(process.cwd(), "dist", "templates");
|
|
16
|
+
|
|
17
|
+
if (!fs.existsSync(srcTemplates)) {
|
|
18
|
+
console.error(`[copy-templates] Missing ${srcTemplates}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
copyDir(srcTemplates, distTemplates);
|
|
23
|
+
console.log("[copy-templates] Copied src/templates -> dist/templates");
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Project Initialization Prompt
|
|
2
|
+
|
|
3
|
+
You are now operating inside a specific project context.
|
|
4
|
+
|
|
5
|
+
Before doing anything else, you must:
|
|
6
|
+
|
|
7
|
+
1. Read and internalize the following files (if they exist):
|
|
8
|
+
- `docs/scope.md`
|
|
9
|
+
- `docs/architecture.md`
|
|
10
|
+
- `docs/constraints.md`
|
|
11
|
+
- `docs/decisions.md`
|
|
12
|
+
- `docs/todo.md`
|
|
13
|
+
- `.cursor/rules/project.md`
|
|
14
|
+
|
|
15
|
+
2. Treat these files as the source of truth for this project.
|
|
16
|
+
- If chat instructions conflict with these files, the files override chat.
|
|
17
|
+
- Do not invent requirements, architecture, or constraints that are not explicitly stated.
|
|
18
|
+
|
|
19
|
+
3. If any of these files are missing, incomplete, or ambiguous:
|
|
20
|
+
- Call it out explicitly.
|
|
21
|
+
- Ask targeted clarifying questions.
|
|
22
|
+
- Do NOT guess.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Operating Mode for This Project
|
|
27
|
+
|
|
28
|
+
### Planning-First Workflow
|
|
29
|
+
- Do not jump into implementation.
|
|
30
|
+
- Always propose a step-by-step plan before non-trivial work.
|
|
31
|
+
- Ask clarifying questions if you are less than 90% confident.
|
|
32
|
+
- Wait for approval before executing the plan.
|
|
33
|
+
|
|
34
|
+
### Atomic Execution
|
|
35
|
+
- Break work into small, isolated steps.
|
|
36
|
+
- Do not batch large changes.
|
|
37
|
+
- Do not refactor multiple systems at once.
|
|
38
|
+
- Request confirmation before large or structural changes.
|
|
39
|
+
|
|
40
|
+
### Context Discipline
|
|
41
|
+
- Treat context as limited system memory.
|
|
42
|
+
- Warn if context may be insufficient.
|
|
43
|
+
- Prefer file-based memory over chat memory.
|
|
44
|
+
- Ask for missing information instead of guessing.
|
|
45
|
+
|
|
46
|
+
### Transparency
|
|
47
|
+
- Be explicit about what you change and why.
|
|
48
|
+
- Never claim something works unless it was actually verified.
|
|
49
|
+
- Clearly distinguish between theoretical correctness and verified correctness.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Confirmation
|
|
54
|
+
|
|
55
|
+
First, confirm that you have:
|
|
56
|
+
1. Read the project files
|
|
57
|
+
2. Understood the scope and constraints
|
|
58
|
+
3. Identified any missing or unclear information
|
|
59
|
+
|
|
60
|
+
Then summarize your understanding of the system in 5–10 bullet points before doing any work.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Project Rules
|
|
2
|
+
|
|
3
|
+
## Stack
|
|
4
|
+
- Language(s):
|
|
5
|
+
- Framework(s):
|
|
6
|
+
- Runtime:
|
|
7
|
+
- Package manager:
|
|
8
|
+
- DB / storage:
|
|
9
|
+
- Hosting:
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
- Install:
|
|
13
|
+
- Dev:
|
|
14
|
+
- Build:
|
|
15
|
+
- Test:
|
|
16
|
+
- Lint:
|
|
17
|
+
- Typecheck:
|
|
18
|
+
|
|
19
|
+
## Architecture Rules
|
|
20
|
+
- Where does business logic live:
|
|
21
|
+
- Where do API routes live:
|
|
22
|
+
- Data access patterns:
|
|
23
|
+
- Error handling pattern:
|
|
24
|
+
- Logging / observability pattern:
|
|
25
|
+
|
|
26
|
+
## Code Style
|
|
27
|
+
- Naming conventions:
|
|
28
|
+
- Formatting:
|
|
29
|
+
- Testing style:
|
|
30
|
+
|
|
31
|
+
## Forbidden / Avoid
|
|
32
|
+
- Do not:
|
|
33
|
+
- Avoid:
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Decisions
|
|
2
|
+
|
|
3
|
+
Use this format for each decision:
|
|
4
|
+
|
|
5
|
+
## Decision: <title>
|
|
6
|
+
**Date:** YYYY-MM-DD
|
|
7
|
+
**Status:** Proposed | Accepted | Deprecated
|
|
8
|
+
|
|
9
|
+
### Context
|
|
10
|
+
-
|
|
11
|
+
|
|
12
|
+
### Options Considered
|
|
13
|
+
1.
|
|
14
|
+
2.
|
|
15
|
+
3.
|
|
16
|
+
|
|
17
|
+
### Decision
|
|
18
|
+
-
|
|
19
|
+
|
|
20
|
+
### Trade-offs / Consequences
|
|
21
|
+
-
|