ascelerate-skill 0.7.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 (2) hide show
  1. package/bin/install.js +141 -0
  2. package/package.json +21 -0
package/bin/install.js ADDED
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const os = require("os");
6
+ const https = require("https");
7
+ const readline = require("readline");
8
+
9
+ const home = os.homedir();
10
+ const skillURL =
11
+ "https://raw.githubusercontent.com/keremerkan/ascelerate/main/skills/ascelerate/SKILL.md";
12
+
13
+ const agents = [
14
+ {
15
+ name: "Claude Code",
16
+ dir: path.join(home, ".claude", "skills", "ascelerate"),
17
+ file: "SKILL.md",
18
+ detect: path.join(home, ".claude"),
19
+ },
20
+ {
21
+ name: "Cursor",
22
+ dir: path.join(home, ".cursor", "rules"),
23
+ file: "ascelerate.md",
24
+ detect: path.join(home, ".cursor"),
25
+ },
26
+ {
27
+ name: "Windsurf",
28
+ dir: path.join(home, ".windsurf", "rules"),
29
+ file: "ascelerate.md",
30
+ detect: path.join(home, ".windsurf"),
31
+ },
32
+ {
33
+ name: "GitHub Copilot",
34
+ dir: path.join(home, ".github", "instructions"),
35
+ file: "ascelerate.md",
36
+ detect: null,
37
+ },
38
+ ];
39
+
40
+ function prompt(question) {
41
+ const rl = readline.createInterface({
42
+ input: process.stdin,
43
+ output: process.stdout,
44
+ });
45
+ return new Promise((resolve) => {
46
+ rl.question(question, (answer) => {
47
+ rl.close();
48
+ resolve(answer.trim());
49
+ });
50
+ });
51
+ }
52
+
53
+ function fetch(url) {
54
+ return new Promise((resolve, reject) => {
55
+ https
56
+ .get(url, (res) => {
57
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
58
+ return fetch(res.headers.location).then(resolve, reject);
59
+ }
60
+ if (res.statusCode !== 200) {
61
+ return reject(new Error(`HTTP ${res.statusCode} fetching skill file.`));
62
+ }
63
+ const chunks = [];
64
+ res.on("data", (chunk) => chunks.push(chunk));
65
+ res.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
66
+ res.on("error", reject);
67
+ })
68
+ .on("error", reject);
69
+ });
70
+ }
71
+
72
+ async function main() {
73
+ const args = process.argv.slice(2);
74
+
75
+ if (args.includes("--help") || args.includes("-h")) {
76
+ console.log("Usage: npx ascelerate-skill [--uninstall]");
77
+ console.log("");
78
+ console.log("Install the ascelerate skill for AI coding agents.");
79
+ console.log("Fetches the latest skill file from GitHub.");
80
+ console.log("");
81
+ console.log("Options:");
82
+ console.log(" --uninstall Remove the installed skill");
83
+ console.log(" --help Show this help message");
84
+ return;
85
+ }
86
+
87
+ const uninstall = args.includes("--uninstall");
88
+
89
+ // Detect installed agents
90
+ const available = agents.filter(
91
+ (a) => a.detect === null || fs.existsSync(a.detect)
92
+ );
93
+
94
+ if (available.length === 0) {
95
+ console.log("No supported AI coding agents found.");
96
+ console.log("Supported: Claude Code, Cursor, Windsurf, GitHub Copilot");
97
+ process.exit(1);
98
+ }
99
+
100
+ // Show selection menu
101
+ console.log(uninstall ? "Remove skill from:" : "Install skill for:");
102
+ available.forEach((a, i) => {
103
+ console.log(` [${i + 1}] ${a.name}`);
104
+ });
105
+ console.log("");
106
+
107
+ const answer = await prompt("Select agent: ");
108
+ const index = parseInt(answer, 10) - 1;
109
+
110
+ if (isNaN(index) || index < 0 || index >= available.length) {
111
+ console.log("Canceled.");
112
+ process.exit(0);
113
+ }
114
+
115
+ const agent = available[index];
116
+ const target = path.join(agent.dir, agent.file);
117
+
118
+ if (uninstall) {
119
+ if (!fs.existsSync(target)) {
120
+ console.log(`No skill installed at ${target}`);
121
+ return;
122
+ }
123
+ fs.unlinkSync(target);
124
+ console.log(`Removed ascelerate skill from ${target}`);
125
+ return;
126
+ }
127
+
128
+ // Fetch latest skill from GitHub
129
+ console.log("Fetching latest skill from GitHub...");
130
+ const content = await fetch(skillURL);
131
+
132
+ fs.mkdirSync(agent.dir, { recursive: true });
133
+ fs.writeFileSync(target, content, "utf8");
134
+ console.log(`Installed ascelerate skill for ${agent.name}.`);
135
+ console.log(` ${target}`);
136
+ }
137
+
138
+ main().catch((err) => {
139
+ console.error(`Error: ${err.message}`);
140
+ process.exit(1);
141
+ });
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "ascelerate-skill",
3
+ "version": "0.7.0",
4
+ "description": "ascelerate skill for AI coding agents (Claude Code, Cursor, Windsurf, Copilot)",
5
+ "license": "MIT",
6
+ "author": "Kerem Erkan",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/keremerkan/ascelerate.git",
10
+ "directory": "skills"
11
+ },
12
+ "bin": {
13
+ "ascelerate-skill": "bin/install.js"
14
+ },
15
+ "files": [
16
+ "bin"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18.0.0"
20
+ }
21
+ }