great-cto 1.0.139 → 1.0.142
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/dist/main.js +44 -0
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -215,6 +215,50 @@ async function runInit(args) {
|
|
|
215
215
|
}
|
|
216
216
|
catch { /* best-effort — don't block install */ }
|
|
217
217
|
}
|
|
218
|
+
// ── 4c. bootstrap skills catalog (v1.0.140+) ─────────────
|
|
219
|
+
// Clone external skill repos + run skill-discover.sh so agents have
|
|
220
|
+
// the catalog locally from session 1, not after first SessionStart hook.
|
|
221
|
+
try {
|
|
222
|
+
const { existsSync, mkdirSync } = await import("node:fs");
|
|
223
|
+
const { homedir } = await import("node:os");
|
|
224
|
+
const { join } = await import("node:path");
|
|
225
|
+
const { spawnSync } = await import("node:child_process");
|
|
226
|
+
const greatCtoDir = join(homedir(), ".great_cto");
|
|
227
|
+
mkdirSync(greatCtoDir, { recursive: true });
|
|
228
|
+
const skillSources = [
|
|
229
|
+
{ name: "anthropic-skills", url: "https://github.com/anthropics/skills.git" },
|
|
230
|
+
{ name: "personal-skills", url: "https://github.com/avelikiy/ai-agent-skills.git" },
|
|
231
|
+
];
|
|
232
|
+
for (const src of skillSources) {
|
|
233
|
+
const path = join(greatCtoDir, src.name);
|
|
234
|
+
if (!existsSync(path)) {
|
|
235
|
+
log(` ${dim(`cloning ${src.name}...`)}`);
|
|
236
|
+
const r = spawnSync("git", ["clone", "--depth=1", src.url, path], {
|
|
237
|
+
stdio: "pipe",
|
|
238
|
+
timeout: 30_000,
|
|
239
|
+
});
|
|
240
|
+
if (r.status !== 0) {
|
|
241
|
+
log(` ${dim(`(skipped ${src.name}: clone failed; SessionStart hook will retry)`)}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
// Run skill-discover.sh to build initial registry
|
|
246
|
+
const pluginCacheBase = join(homedir(), ".claude", "plugins", "cache", "local", "great_cto");
|
|
247
|
+
const { readdirSync } = await import("node:fs");
|
|
248
|
+
if (existsSync(pluginCacheBase)) {
|
|
249
|
+
const versions = readdirSync(pluginCacheBase).sort().reverse();
|
|
250
|
+
if (versions.length > 0) {
|
|
251
|
+
const discover = join(pluginCacheBase, versions[0], "scripts", "skill-discover.sh");
|
|
252
|
+
if (existsSync(discover)) {
|
|
253
|
+
spawnSync("bash", [discover], { stdio: "ignore", timeout: 15_000 });
|
|
254
|
+
log(` ${dim("skills registry built at ~/.great_cto/skills-registry.json")}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
/* best-effort — don't block install if skills bootstrap fails */
|
|
261
|
+
}
|
|
218
262
|
// ── 5. bootstrap ─────────────────────────────────────────
|
|
219
263
|
step(5, 5, "bootstrapping .great_cto/PROJECT.md");
|
|
220
264
|
const bs = bootstrap(args.dir, detection, archetype, compliance);
|
package/package.json
CHANGED