cp-toolkit 2.2.0 ā 2.2.2
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/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -91,13 +91,38 @@ export async function initCommand(directory, options) {
|
|
|
91
91
|
// Create standard instruction files
|
|
92
92
|
await createInstructionFiles(instructionsTargetDir);
|
|
93
93
|
|
|
94
|
-
//
|
|
94
|
+
// 4. Setup .github/skills/ (essential skills referenced by agents)
|
|
95
|
+
spinner.text = 'Copying essential skills...';
|
|
96
|
+
const skillsTargetDir = path.join(targetDir, '.github', 'skills');
|
|
97
|
+
await fs.ensureDir(skillsTargetDir);
|
|
98
|
+
|
|
99
|
+
// Copy essential skills that agents reference
|
|
100
|
+
const essentialSkills = [
|
|
101
|
+
'mobile-design',
|
|
102
|
+
'frontend-design',
|
|
103
|
+
'api-patterns',
|
|
104
|
+
'database-design',
|
|
105
|
+
'testing-patterns',
|
|
106
|
+
'deployment-procedures',
|
|
107
|
+
'architecture'
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
for (const skill of essentialSkills) {
|
|
111
|
+
const skillSourceDir = path.join(templatesDir, 'skills', 'optional', skill);
|
|
112
|
+
if (fs.existsSync(skillSourceDir)) {
|
|
113
|
+
const skillTargetDir = path.join(skillsTargetDir, skill);
|
|
114
|
+
await fs.ensureDir(skillTargetDir);
|
|
115
|
+
await fs.copy(skillSourceDir, skillTargetDir, { overwrite: true });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// 5. Setup .github/copilot-instructions.md
|
|
95
120
|
spinner.text = 'Creating copilot-instructions.md...';
|
|
96
121
|
const instructionsPath = path.join(targetDir, '.github', 'copilot-instructions.md');
|
|
97
122
|
const instructionsContent = generateCopilotInstructions(config);
|
|
98
123
|
await fs.writeFile(instructionsPath, instructionsContent);
|
|
99
124
|
|
|
100
|
-
//
|
|
125
|
+
// 6. Setup .vscode/mcp.json
|
|
101
126
|
spinner.text = 'Configuring MCP Server...';
|
|
102
127
|
const vscodeDir = path.join(targetDir, '.vscode');
|
|
103
128
|
await fs.ensureDir(vscodeDir);
|
|
@@ -122,6 +147,14 @@ export async function initCommand(directory, options) {
|
|
|
122
147
|
],
|
|
123
148
|
"disabled": false,
|
|
124
149
|
"autoApprove": []
|
|
150
|
+
},
|
|
151
|
+
"antigravity": {
|
|
152
|
+
"command": "node",
|
|
153
|
+
"args": [
|
|
154
|
+
"${workspaceFolder}/.github/scripts/mcp-server.js"
|
|
155
|
+
],
|
|
156
|
+
"disabled": false,
|
|
157
|
+
"autoApprove": []
|
|
125
158
|
}
|
|
126
159
|
}
|
|
127
160
|
};
|
|
@@ -131,7 +164,7 @@ export async function initCommand(directory, options) {
|
|
|
131
164
|
JSON.stringify(mcpConfig, null, 2)
|
|
132
165
|
);
|
|
133
166
|
|
|
134
|
-
//
|
|
167
|
+
// 7. Copy workflows to .github/workflows-copilot/ (optional reference)
|
|
135
168
|
if (config.installEverything) {
|
|
136
169
|
spinner.text = 'Copying workflows...';
|
|
137
170
|
const workflowsSourceDir = path.join(templatesDir, 'workflows');
|
|
@@ -142,13 +175,43 @@ export async function initCommand(directory, options) {
|
|
|
142
175
|
}
|
|
143
176
|
}
|
|
144
177
|
|
|
178
|
+
// 8. Copy scripts to .github/scripts/
|
|
179
|
+
spinner.text = 'Copying scripts...';
|
|
180
|
+
const scriptsSourceDir = path.join(templatesDir, 'scripts');
|
|
181
|
+
const scriptsTargetDir = path.join(targetDir, '.github', 'scripts');
|
|
182
|
+
if (fs.existsSync(scriptsSourceDir)) {
|
|
183
|
+
await fs.ensureDir(scriptsTargetDir);
|
|
184
|
+
await fs.copy(scriptsSourceDir, scriptsTargetDir, { overwrite: true });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// 9. Copy ARCHITECTURE.md to .github/
|
|
188
|
+
spinner.text = 'Copying architecture documentation...';
|
|
189
|
+
const architectureSource = path.join(templatesDir, 'ARCHITECTURE.md');
|
|
190
|
+
const architectureTarget = path.join(targetDir, '.github', 'ARCHITECTURE.md');
|
|
191
|
+
if (fs.existsSync(architectureSource)) {
|
|
192
|
+
await fs.copy(architectureSource, architectureTarget, { overwrite: true });
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// 10. Copy rules to .github/rules/
|
|
196
|
+
spinner.text = 'Copying rules...';
|
|
197
|
+
const rulesSourceDir = path.join(templatesDir, 'rules');
|
|
198
|
+
const rulesTargetDir = path.join(targetDir, '.github', 'rules');
|
|
199
|
+
if (fs.existsSync(rulesSourceDir)) {
|
|
200
|
+
await fs.ensureDir(rulesTargetDir);
|
|
201
|
+
await fs.copy(rulesSourceDir, rulesTargetDir, { overwrite: true });
|
|
202
|
+
}
|
|
203
|
+
|
|
145
204
|
spinner.succeed(chalk.green('⨠Copilot Kit initialized successfully!'));
|
|
146
205
|
|
|
147
206
|
console.log(chalk.bold('\nš Created structure:'));
|
|
148
207
|
console.log(chalk.dim(' .github/'));
|
|
149
208
|
console.log(chalk.dim(' āāā agents/ ') + chalk.cyan('ā 20 specialist agents'));
|
|
209
|
+
console.log(chalk.dim(' āāā skills/ ') + chalk.cyan('ā Essential skills library'));
|
|
150
210
|
console.log(chalk.dim(' āāā instructions/ ') + chalk.cyan('ā Language-specific rules'));
|
|
151
211
|
console.log(chalk.dim(' āāā copilot-workflows/') + chalk.cyan('ā Workflow templates'));
|
|
212
|
+
console.log(chalk.dim(' āāā scripts/ ') + chalk.cyan('ā MCP server & utilities'));
|
|
213
|
+
console.log(chalk.dim(' āāā rules/ ') + chalk.cyan('ā Global AI rules'));
|
|
214
|
+
console.log(chalk.dim(' āāā ARCHITECTURE.md ') + chalk.cyan('ā System documentation'));
|
|
152
215
|
console.log(chalk.dim(' āāā copilot-instructions.md'));
|
|
153
216
|
console.log(chalk.dim(' .vscode/'));
|
|
154
217
|
console.log(chalk.dim(' āāā mcp.json ') + chalk.cyan('ā MCP server config'));
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import * as fs from 'fs/promises';
|
|
30
30
|
import * as path from 'path';
|
|
31
31
|
|
|
32
|
-
const AGENT_ROOT = process.env.AGENT_ROOT || path.join(process.cwd(), '.
|
|
32
|
+
const AGENT_ROOT = process.env.AGENT_ROOT || path.join(process.cwd(), '.github');
|
|
33
33
|
|
|
34
34
|
// ============================================================================
|
|
35
35
|
// HELPERS
|