@recapt/mcp 0.0.15-beta → 0.0.16-beta

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.
@@ -193,7 +193,7 @@ async function runSetupSelfHealingGh() {
193
193
  }
194
194
  newline();
195
195
  print("Installing self-healing skill...");
196
- const skillInstalled = installSkill(cwd, "self-healing");
196
+ const skillInstalled = installSkill(cwd, "self-healing", true);
197
197
  if (!skillInstalled) {
198
198
  error("Failed to install self-healing skill");
199
199
  process.exit(1);
@@ -12,13 +12,13 @@ interface SkillInfo {
12
12
  }
13
13
  export type { SkillInfo };
14
14
  export declare function getAvailableSkills(): SkillInfo[];
15
- export declare function installSkill(cwd: string, skillName: string): boolean;
15
+ export declare function installSkill(cwd: string, skillName: string, force?: boolean): boolean;
16
16
  export interface InstallResult {
17
17
  success: boolean;
18
18
  installed: string[];
19
19
  failed: string[];
20
20
  error?: string;
21
21
  }
22
- export declare function installAllSkills(cwd: string): InstallResult;
23
- export declare function installSelectedSkills(cwd: string, skillNames: string[]): InstallResult;
22
+ export declare function installAllSkills(cwd: string, force?: boolean): InstallResult;
23
+ export declare function installSelectedSkills(cwd: string, skillNames: string[], force?: boolean): InstallResult;
24
24
  export declare const skillCommand: Command;
@@ -115,7 +115,7 @@ ${MARKER_END}`;
115
115
  }
116
116
  writeAgentsMd(cwd, content + "\n");
117
117
  }
118
- export function installSkill(cwd, skillName) {
118
+ export function installSkill(cwd, skillName, force = false) {
119
119
  let skills;
120
120
  try {
121
121
  skills = getAvailableSkills();
@@ -134,11 +134,23 @@ export function installSkill(cwd, skillName) {
134
134
  const sourcePath = path.join(SKILLS_DIR, skill.file);
135
135
  const destPath = path.join(cwd, AGENTS_DIR, skill.file);
136
136
  if (fs.existsSync(destPath)) {
137
- console.log(`Skill already installed: ${skillName}`);
138
- return true;
137
+ const sourceContent = fs.readFileSync(sourcePath, "utf-8");
138
+ const destContent = fs.readFileSync(destPath, "utf-8");
139
+ if (sourceContent === destContent) {
140
+ console.log(`Skill already up to date: ${skillName}`);
141
+ return true;
142
+ }
143
+ if (!force) {
144
+ console.log(`Skill outdated: ${skillName} (use --force to update)`);
145
+ return true;
146
+ }
147
+ fs.copyFileSync(sourcePath, destPath);
148
+ console.log(`Updated: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
149
+ }
150
+ else {
151
+ fs.copyFileSync(sourcePath, destPath);
152
+ console.log(`Installed: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
139
153
  }
140
- fs.copyFileSync(sourcePath, destPath);
141
- console.log(`Installed: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
142
154
  updateAgentsMdReferences(cwd);
143
155
  return true;
144
156
  }
@@ -180,7 +192,7 @@ function listSkills(cwd) {
180
192
  }
181
193
  console.log();
182
194
  }
183
- export function installAllSkills(cwd) {
195
+ export function installAllSkills(cwd, force = false) {
184
196
  let skills;
185
197
  try {
186
198
  skills = getAvailableSkills();
@@ -190,14 +202,14 @@ export function installAllSkills(cwd) {
190
202
  console.error(`Failed to load skills: ${message}`);
191
203
  return { success: false, installed: [], failed: [], error: message };
192
204
  }
193
- return installSelectedSkills(cwd, skills.map((s) => s.name));
205
+ return installSelectedSkills(cwd, skills.map((s) => s.name), force);
194
206
  }
195
- export function installSelectedSkills(cwd, skillNames) {
207
+ export function installSelectedSkills(cwd, skillNames, force = false) {
196
208
  const installed = [];
197
209
  const failed = [];
198
210
  for (const skillName of skillNames) {
199
211
  try {
200
- if (installSkill(cwd, skillName)) {
212
+ if (installSkill(cwd, skillName, force)) {
201
213
  installed.push(skillName);
202
214
  }
203
215
  else {
@@ -224,17 +236,18 @@ const installCommand = new Command("install")
224
236
  .description("Install a skill")
225
237
  .argument("[name]", "Skill name to install")
226
238
  .option("-a, --all", "Install all skills")
239
+ .option("-f, --force", "Force update if skill already exists")
227
240
  .action((name, options) => {
228
241
  const cwd = process.cwd();
229
242
  if (options.all) {
230
- installAllSkills(cwd);
243
+ installAllSkills(cwd, options.force);
231
244
  return;
232
245
  }
233
246
  if (!name) {
234
247
  console.error("Usage: recapt skill install <name> or recapt skill install --all");
235
248
  process.exit(1);
236
249
  }
237
- if (installSkill(cwd, name)) {
250
+ if (installSkill(cwd, name, options.force)) {
238
251
  console.log(`\nSkill reference added to ${AGENTS_MD}`);
239
252
  }
240
253
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recapt/mcp",
3
- "version": "0.0.15-beta",
3
+ "version": "0.0.16-beta",
4
4
  "description": "MCP exposing recapt behavioral intelligence to AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",