@sk-labs/copilot-kit 3.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.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # @sk-labs/copilot-kit
2
+
3
+ CLI tool to install Custom Agents, Skills & Prompt Workflows for GitHub Copilot in VS Code.
4
+
5
+ ## Installation
6
+
7
+ ### Quick Use (npx)
8
+
9
+ ```bash
10
+ npx @sk-labs/copilot-kit init
11
+ ```
12
+
13
+ ### Global Install
14
+
15
+ ```bash
16
+ npm install -g @sk-labs/copilot-kit
17
+ copilot-kit init
18
+ ```
19
+
20
+ ## Commands
21
+
22
+ ### `copilot-kit init`
23
+
24
+ Install .github structure into your project.
25
+
26
+ **Options:**
27
+ - `-f, --force` - Overwrite existing .github folder
28
+ - `-p, --path <path>` - Install in specific directory (default: current directory)
29
+ - `-b, --branch <branch>` - Use specific branch (default: main)
30
+ - `-q, --quiet` - Suppress output (for CI/CD)
31
+ - `--dry-run` - Preview actions without executing
32
+
33
+ **Examples:**
34
+ ```bash
35
+ copilot-kit init
36
+ copilot-kit init --force
37
+ copilot-kit init --path ./my-project
38
+ copilot-kit init --branch dev
39
+ copilot-kit init --dry-run
40
+ ```
41
+
42
+ ### `copilot-kit update`
43
+
44
+ Update to the latest version.
45
+
46
+ **Options:**
47
+ - `-p, --path <path>` - Project directory (default: current directory)
48
+ - `-q, --quiet` - Suppress output
49
+
50
+ **Examples:**
51
+ ```bash
52
+ copilot-kit update
53
+ copilot-kit update --path ./my-project
54
+ ```
55
+
56
+ ### `copilot-kit status`
57
+
58
+ Check installation status and verify structure.
59
+
60
+ **Options:**
61
+ - `-p, --path <path>` - Project directory (default: current directory)
62
+
63
+ **Example:**
64
+ ```bash
65
+ copilot-kit status
66
+ ```
67
+
68
+ ## What Gets Installed
69
+
70
+ ```
71
+ .github/
72
+ ├── agents/ # 20 custom agents (.agent.md)
73
+ ├── skills/ # 37 domain skills (SKILL.md)
74
+ ├── prompts/ # 11 slash commands (.prompt.md)
75
+ ├── instructions/ # Path-specific rules
76
+ ├── copilot-instructions.md # Global behavior
77
+ └── AGENTS.md # Architecture docs
78
+ ```
79
+
80
+ ## Requirements
81
+
82
+ - Node.js 16.0 or later
83
+ - VS Code with GitHub Copilot extension
84
+
85
+ ## Repository
86
+
87
+ https://github.com/sk-labs/copilot-kit
88
+
89
+ ## License
90
+
91
+ MIT © sk-labs
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const { init, update, status } = require('../lib/commands');
5
+ const pkg = require('../package.json');
6
+
7
+ program
8
+ .name('copilot-kit')
9
+ .description('CLI tool to install Custom Agents, Skills & Prompt Workflows for GitHub Copilot')
10
+ .version(pkg.version);
11
+
12
+ program
13
+ .command('init')
14
+ .description('Install .github structure into your project')
15
+ .option('-f, --force', 'Overwrite existing .github folder')
16
+ .option('-p, --path <path>', 'Install in specific directory', '.')
17
+ .option('-b, --branch <branch>', 'Use specific branch', 'main')
18
+ .option('-q, --quiet', 'Suppress output (for CI/CD)')
19
+ .option('--dry-run', 'Preview actions without executing')
20
+ .action(init);
21
+
22
+ program
23
+ .command('update')
24
+ .description('Update to the latest version')
25
+ .option('-p, --path <path>', 'Project directory', '.')
26
+ .option('-q, --quiet', 'Suppress output')
27
+ .action(update);
28
+
29
+ program
30
+ .command('status')
31
+ .description('Check installation status')
32
+ .option('-p, --path <path>', 'Project directory', '.')
33
+ .action(status);
34
+
35
+ program.parse();
@@ -0,0 +1,204 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const https = require('https');
4
+ const chalk = require('chalk');
5
+ const ora = require('ora');
6
+ const AdmZip = require('adm-zip');
7
+
8
+ const GITHUB_REPO = 'sk-labs/copilot-kit';
9
+ const GITHUB_API = 'https://api.github.com';
10
+
11
+ async function init(options) {
12
+ const targetPath = path.resolve(options.path || '.');
13
+ const githubPath = path.join(targetPath, '.github');
14
+
15
+ if (!options.quiet) {
16
+ console.log(chalk.bold.blue('\n🚀 Copilot Kit Installer\n'));
17
+ }
18
+
19
+ // Check if .github exists
20
+ if (fs.existsSync(githubPath) && !options.force && !options.dryRun) {
21
+ console.log(chalk.yellow('⚠️ .github folder already exists!'));
22
+ console.log(chalk.dim(' Use --force to overwrite\n'));
23
+ process.exit(1);
24
+ }
25
+
26
+ if (options.dryRun) {
27
+ console.log(chalk.cyan('🔍 Dry run - no changes will be made\n'));
28
+ console.log(chalk.dim('Would download from:'), `https://github.com/${GITHUB_REPO}/archive/${options.branch}.zip`);
29
+ console.log(chalk.dim('Would install to:'), githubPath);
30
+ return;
31
+ }
32
+
33
+ const spinner = options.quiet ? null : ora('Downloading Copilot Kit...').start();
34
+
35
+ try {
36
+ // Download repo archive
37
+ const zipBuffer = await downloadRepo(options.branch);
38
+
39
+ if (spinner) spinner.text = 'Extracting files...';
40
+
41
+ // Extract .github folder
42
+ const zip = new AdmZip(zipBuffer);
43
+ const entries = zip.getEntries();
44
+
45
+ // Find the root folder name (copilot-kit-main or similar)
46
+ const rootFolder = entries[0].entryName.split('/')[0];
47
+
48
+ // Extract only .github folder
49
+ let fileCount = 0;
50
+ entries.forEach(entry => {
51
+ if (entry.entryName.startsWith(`${rootFolder}/.github/`)) {
52
+ const relativePath = entry.entryName.replace(`${rootFolder}/`, '');
53
+ const targetFile = path.join(targetPath, relativePath);
54
+
55
+ if (entry.isDirectory) {
56
+ fs.mkdirSync(targetFile, { recursive: true });
57
+ } else {
58
+ fs.mkdirSync(path.dirname(targetFile), { recursive: true });
59
+ fs.writeFileSync(targetFile, entry.getData());
60
+ fileCount++;
61
+ }
62
+ }
63
+ });
64
+
65
+ if (spinner) spinner.succeed(chalk.green('✓ Copilot Kit installed successfully!'));
66
+
67
+ if (!options.quiet) {
68
+ console.log(chalk.dim(`\n📦 Installed ${fileCount} files to ${githubPath}\n`));
69
+ console.log(chalk.bold('Next steps:'));
70
+ console.log(chalk.dim(' 1. Open VS Code with GitHub Copilot extension'));
71
+ console.log(chalk.dim(' 2. Try: @frontend-specialist or /brainstorm'));
72
+ console.log(chalk.dim(' 3. Docs: https://github.com/sk-labs/copilot-kit\n'));
73
+ }
74
+ } catch (error) {
75
+ if (spinner) spinner.fail(chalk.red('Installation failed'));
76
+ console.error(chalk.red('\n❌ Error:'), error.message);
77
+ process.exit(1);
78
+ }
79
+ }
80
+
81
+ async function update(options) {
82
+ const targetPath = path.resolve(options.path || '.');
83
+ const githubPath = path.join(targetPath, '.github');
84
+
85
+ if (!fs.existsSync(githubPath)) {
86
+ console.log(chalk.yellow('⚠️ No .github folder found. Run "copilot-kit init" first.\n'));
87
+ process.exit(1);
88
+ }
89
+
90
+ const spinner = options.quiet ? null : ora('Updating Copilot Kit...').start();
91
+
92
+ try {
93
+ // Backup current installation
94
+ const backupPath = `${githubPath}.backup.${Date.now()}`;
95
+ fs.renameSync(githubPath, backupPath);
96
+
97
+ // Download latest
98
+ const zipBuffer = await downloadRepo('main');
99
+
100
+ // Extract
101
+ const zip = new AdmZip(zipBuffer);
102
+ const entries = zip.getEntries();
103
+ const rootFolder = entries[0].entryName.split('/')[0];
104
+
105
+ let fileCount = 0;
106
+ entries.forEach(entry => {
107
+ if (entry.entryName.startsWith(`${rootFolder}/.github/`)) {
108
+ const relativePath = entry.entryName.replace(`${rootFolder}/`, '');
109
+ const targetFile = path.join(targetPath, relativePath);
110
+
111
+ if (entry.isDirectory) {
112
+ fs.mkdirSync(targetFile, { recursive: true });
113
+ } else {
114
+ fs.mkdirSync(path.dirname(targetFile), { recursive: true });
115
+ fs.writeFileSync(targetFile, entry.getData());
116
+ fileCount++;
117
+ }
118
+ }
119
+ });
120
+
121
+ // Remove backup on success
122
+ fs.rmSync(backupPath, { recursive: true, force: true });
123
+
124
+ if (spinner) spinner.succeed(chalk.green('✓ Copilot Kit updated successfully!'));
125
+ if (!options.quiet) {
126
+ console.log(chalk.dim(`\n📦 Updated ${fileCount} files\n`));
127
+ }
128
+ } catch (error) {
129
+ if (spinner) spinner.fail(chalk.red('Update failed'));
130
+ console.error(chalk.red('\n❌ Error:'), error.message);
131
+ process.exit(1);
132
+ }
133
+ }
134
+
135
+ async function status(options) {
136
+ const targetPath = path.resolve(options.path || '.');
137
+ const githubPath = path.join(targetPath, '.github');
138
+
139
+ console.log(chalk.bold.blue('\n📊 Copilot Kit Status\n'));
140
+
141
+ if (!fs.existsSync(githubPath)) {
142
+ console.log(chalk.red('❌ Not installed'));
143
+ console.log(chalk.dim(' Run "copilot-kit init" to install\n'));
144
+ return;
145
+ }
146
+
147
+ console.log(chalk.green('✓ Installed'), chalk.dim(`at ${githubPath}`));
148
+
149
+ // Check structure
150
+ const checks = [
151
+ { path: 'agents', label: 'Agents' },
152
+ { path: 'skills', label: 'Skills' },
153
+ { path: 'prompts', label: 'Prompt Workflows' },
154
+ { path: 'copilot-instructions.md', label: 'Global Instructions' }
155
+ ];
156
+
157
+ console.log();
158
+ checks.forEach(check => {
159
+ const fullPath = path.join(githubPath, check.path);
160
+ const exists = fs.existsSync(fullPath);
161
+ const icon = exists ? chalk.green('✓') : chalk.red('✗');
162
+
163
+ if (exists) {
164
+ const stats = fs.statSync(fullPath);
165
+ if (stats.isDirectory()) {
166
+ const files = fs.readdirSync(fullPath);
167
+ console.log(`${icon} ${check.label}: ${chalk.cyan(files.length)} items`);
168
+ } else {
169
+ console.log(`${icon} ${check.label}: ${chalk.green('present')}`);
170
+ }
171
+ } else {
172
+ console.log(`${icon} ${check.label}: ${chalk.red('missing')}`);
173
+ }
174
+ });
175
+
176
+ console.log();
177
+ }
178
+
179
+ function downloadRepo(branch = 'main') {
180
+ return new Promise((resolve, reject) => {
181
+ const url = `https://github.com/${GITHUB_REPO}/archive/refs/heads/${branch}.zip`;
182
+
183
+ https.get(url, { headers: { 'User-Agent': 'copilot-kit-cli' } }, (response) => {
184
+ if (response.statusCode === 302 || response.statusCode === 301) {
185
+ // Follow redirect
186
+ https.get(response.headers.location, { headers: { 'User-Agent': 'copilot-kit-cli' } }, (redirectResponse) => {
187
+ const chunks = [];
188
+ redirectResponse.on('data', chunk => chunks.push(chunk));
189
+ redirectResponse.on('end', () => resolve(Buffer.concat(chunks)));
190
+ redirectResponse.on('error', reject);
191
+ });
192
+ } else if (response.statusCode === 200) {
193
+ const chunks = [];
194
+ response.on('data', chunk => chunks.push(chunk));
195
+ response.on('end', () => resolve(Buffer.concat(chunks)));
196
+ response.on('error', reject);
197
+ } else {
198
+ reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
199
+ }
200
+ }).on('error', reject);
201
+ });
202
+ }
203
+
204
+ module.exports = { init, update, status };
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@sk-labs/copilot-kit",
3
+ "version": "3.0.0",
4
+ "description": "CLI tool to install Custom Agents, Skills & Prompt Workflows for GitHub Copilot",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "copilot-kit": "./bin/copilot-kit.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node test.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/sk-labs/copilot-kit.git"
15
+ },
16
+ "keywords": [
17
+ "copilot",
18
+ "github-copilot",
19
+ "vscode",
20
+ "ai",
21
+ "agent",
22
+ "cli"
23
+ ],
24
+ "author": "sk-labs",
25
+ "license": "MIT",
26
+ "bugs": {
27
+ "url": "https://github.com/sk-labs/copilot-kit/issues"
28
+ },
29
+ "homepage": "https://github.com/sk-labs/copilot-kit#readme",
30
+ "dependencies": {
31
+ "commander": "^12.0.0",
32
+ "chalk": "^4.1.2",
33
+ "ora": "^5.4.1",
34
+ "adm-zip": "^0.5.10"
35
+ },
36
+ "engines": {
37
+ "node": ">=16.0.0"
38
+ }
39
+ }