claude-stm32-keil 1.0.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/install.js +49 -0
  2. package/package.json +17 -0
package/install.js ADDED
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const { execSync } = require('child_process');
7
+
8
+ const SKILL_NAME = 'stm32-keil';
9
+ const REPO_URL = 'https://github.com/xjc666-666/claude-skills.git';
10
+
11
+ function run(cmd, opts) {
12
+ return execSync(cmd, { stdio: 'inherit', ...opts });
13
+ }
14
+
15
+ function install() {
16
+ const skillsDir = path.join(os.homedir(), '.claude', 'skills');
17
+ const targetDir = path.join(skillsDir, SKILL_NAME);
18
+ const tmpDir = path.join(os.tmpdir(), 'claude-skills-' + Date.now());
19
+
20
+ console.log(`\nšŸ“¦ Installing Claude Code STM32-Keil skill...\n`);
21
+
22
+ // Clone repo (shallow, blobless — minimal download)
23
+ console.log('Downloading from GitHub...');
24
+ run(`git clone --depth 1 --filter=blob:none "${REPO_URL}" "${tmpDir}"`);
25
+
26
+ // Remove existing installation
27
+ if (fs.existsSync(targetDir)) {
28
+ fs.rmSync(targetDir, { recursive: true, force: true });
29
+ }
30
+
31
+ // Copy stm32-keil skill
32
+ const src = path.join(tmpDir, SKILL_NAME);
33
+ if (!fs.existsSync(src)) {
34
+ console.error(`Error: ${SKILL_NAME} not found in repo`);
35
+ fs.rmSync(tmpDir, { recursive: true, force: true });
36
+ process.exit(1);
37
+ }
38
+
39
+ fs.mkdirSync(skillsDir, { recursive: true });
40
+ fs.cpSync(src, targetDir, { recursive: true });
41
+
42
+ // Cleanup
43
+ fs.rmSync(tmpDir, { recursive: true, force: true });
44
+
45
+ console.log(`āœ… Installed to: ${targetDir}`);
46
+ console.log(' Now use /stm32-keil in Claude Code.\n');
47
+ }
48
+
49
+ install();
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "claude-stm32-keil",
3
+ "version": "1.0.0",
4
+ "description": "STM32 Keil firmware development skill for Claude Code",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/xjc666-666/claude-skills.git"
8
+ },
9
+ "license": "MIT",
10
+ "keywords": ["claude-code", "skill", "stm32", "keil", "embedded", "firmware"],
11
+ "files": [
12
+ "install.js"
13
+ ],
14
+ "scripts": {
15
+ "postinstall": "node install.js"
16
+ }
17
+ }