arash-claude-template 0.0.1

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/bin/index.js ADDED
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+
3
+ import chalk from "chalk";
4
+ import figlet from "figlet";
5
+ import gradient from "gradient-string";
6
+ import { select } from "@inquirer/prompts";
7
+ import fs from "fs";
8
+ import path from "path";
9
+ import { fileURLToPath } from "url";
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ const TEMPLATES_DIR = path.join(__dirname, "..", "src", "templates");
15
+
16
+ // -- Banner --
17
+ function showBanner() {
18
+ const ascii = figlet.textSync("ARASH", {
19
+ font: "ANSI Shadow",
20
+ horizontalLayout: "default",
21
+ });
22
+
23
+ const coolGradient = gradient(["#fc5c7d", "#6a82fb", "#05dfd7"]);
24
+
25
+ console.log(coolGradient(ascii));
26
+ console.log(
27
+ chalk.gray(" ─────────────────────────────────────────────────")
28
+ );
29
+ console.log(
30
+ chalk.white(" GitHub: ") + chalk.cyan("https://github.com/A-Shalchian")
31
+ );
32
+ console.log(
33
+ chalk.gray(" ─────────────────────────────────────────────────\n")
34
+ );
35
+ }
36
+
37
+ // -- Actions --
38
+ async function createClaudeMd() {
39
+ const claudeDir = path.join(process.cwd(), ".claude");
40
+
41
+ if (!fs.existsSync(claudeDir)) {
42
+ fs.mkdirSync(claudeDir);
43
+ console.log(chalk.gray("\n Created .claude/ directory."));
44
+ }
45
+
46
+ const dest = path.join(claudeDir, "CLAUDE.md");
47
+
48
+ if (fs.existsSync(dest)) {
49
+ console.log(chalk.yellow("\n .claude/CLAUDE.md already exists."));
50
+ const overwrite = await select({
51
+ message: "Overwrite it?",
52
+ choices: [
53
+ { name: "Yes", value: true },
54
+ { name: "No", value: false },
55
+ ],
56
+ });
57
+
58
+ if (!overwrite) {
59
+ console.log(chalk.gray(" Skipped.\n"));
60
+ return;
61
+ }
62
+ }
63
+
64
+ const template = fs.readFileSync(
65
+ path.join(TEMPLATES_DIR, "CLAUDE.md"),
66
+ "utf-8"
67
+ );
68
+ fs.writeFileSync(dest, template);
69
+ console.log(chalk.green("\n .claude/CLAUDE.md created successfully!\n"));
70
+ }
71
+
72
+ // -- Menu --
73
+ async function main() {
74
+ console.clear();
75
+ showBanner();
76
+
77
+ const action = await select({
78
+ message: chalk.white("What would you like to do?"),
79
+ choices: [
80
+ {
81
+ name: `${chalk.cyan("1.")} Create CLAUDE.md`,
82
+ value: "claude",
83
+ description: "Scaffold a CLAUDE.md with coding style rules",
84
+ },
85
+ {
86
+ name: `${chalk.cyan("2.")} Exit`,
87
+ value: "exit",
88
+ description: "Quit the CLI",
89
+ },
90
+ ],
91
+ });
92
+
93
+ switch (action) {
94
+ case "claude":
95
+ await createClaudeMd();
96
+ break;
97
+ case "exit":
98
+ console.log(chalk.gray(" Goodbye!\n"));
99
+ process.exit(0);
100
+ }
101
+ }
102
+
103
+ main().catch((err) => {
104
+ if (err.name === "ExitPromptError") {
105
+ console.log(chalk.gray("\n Goodbye!\n"));
106
+ process.exit(0);
107
+ }
108
+ console.error(err);
109
+ process.exit(1);
110
+ });
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "arash-claude-template",
3
+ "version": "0.0.1",
4
+ "description": "CLI tool to scaffold projects with CLAUDE.md and more",
5
+ "type": "module",
6
+ "bin": {
7
+ "arash-claude-template": "./bin/index.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/index.js",
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "keywords": ["cli", "scaffold", "claude", "template"],
14
+ "author": "A-Shalchian",
15
+ "license": "MIT",
16
+ "dependencies": {
17
+ "chalk": "^5.6.2",
18
+ "figlet": "^1.10.0",
19
+ "gradient-string": "^3.0.0",
20
+ "inquirer": "^13.2.5"
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ # CLAUDE.md
2
+
3
+ ## Coding Style Rules
4
+
5
+ - Only add comments for non-obvious business logic, complex algorithms, or when explaining "why" decisions were made
6
+ - Avoid obvious comments that just restate what the code does
7
+ - Keep code clean and self-documenting through clear naming
8
+ - Use `@/` path aliases for imports (e.g., `@/convex/_generated/api` not `../../../convex`)