fix(cli): address review feedback on skills install

- Lazy process.cwd() for Cursor target (getter, not module-load)
- Track overwritten skills (logged in install output)
- Add --skip-skills flag to init for agent-friendly non-interactive use
- Guard both interactive and non-interactive paths with skipSkills

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-03-26 17:50:46 +00:00
committed by Vance Ingalls
co-authored by Claude Opus 4.6
parent cbb0316f4d
commit ca66f1cf05
2 changed files with 15 additions and 5 deletions
+8 -2
View File
@@ -411,10 +411,12 @@ export default defineCommand({
alias: "t",
},
video: { type: "string", description: "Path to a source video file", alias: "V" },
"skip-skills": { type: "boolean", description: "Skip AI skills installation" },
},
async run({ args }) {
const templateFlag = args.template;
const videoFlag = args.video;
const skipSkills = args["skip-skills"] === true;
// -----------------------------------------------------------------------
// Non-interactive mode: flags provided
@@ -450,7 +452,9 @@ export default defineCommand({
scaffoldProject(destDir, basename(destDir), templateId, localVideoName);
trackInitTemplate(templateId);
await installSkills(false);
if (!skipSkills) {
await installSkills(false);
}
console.log(c.success(`\nCreated ${c.accent(name + "/")}`));
for (const f of readdirSync(destDir)) {
@@ -573,7 +577,9 @@ export default defineCommand({
trackInitTemplate(templateId);
// 5. Install AI coding skills
await installSkills(true);
if (!skipSkills) {
await installSkills(true);
}
const files = readdirSync(destDir);
clack.note(files.map((f) => c.accent(f)).join("\n"), c.success(`Created ${name}/`));
+7 -3
View File
@@ -39,7 +39,9 @@ const TARGETS: Target[] = [
{
name: "Cursor",
flag: "cursor",
dir: join(process.cwd(), ".cursor", "skills"),
get dir() {
return join(process.cwd(), ".cursor", "skills");
},
defaultEnabled: false,
},
];
@@ -122,6 +124,7 @@ function fetchRepo(source: SkillSource): string {
interface InstalledSkill {
name: string;
source: string;
overwritten: boolean;
}
function installSkillsFromDir(
@@ -139,10 +142,11 @@ function installSkillsFromDir(
if (!existsSync(skillFile)) continue;
const destDir = join(targetDir, entry.name);
if (existsSync(destDir)) rmSync(destDir, { recursive: true, force: true });
const overwritten = existsSync(destDir);
if (overwritten) rmSync(destDir, { recursive: true, force: true });
mkdirSync(destDir, { recursive: true });
cpSync(join(sourceDir, entry.name), destDir, { recursive: true });
installed.push({ name: entry.name, source: sourceName });
installed.push({ name: entry.name, source: sourceName, overwritten });
}
return installed;
}