fix(cli): install skills into project dir on non-interactive init (#1671)

`hyperframes init` only installed AI coding skills on the interactive path
(behind a clack confirm). When an agent drives it non-interactively (no TTY),
it just printed `npx skills add ...` and returned — so skills were never
installed and the agent later hit `Unknown skill: <workflow>`.

- init: both interactive and non-interactive branches now run
  `npx skills add` with `cwd` set to the new project dir so skills land
  there, not in the caller's working directory. Non-interactive additionally
  passes `--yes`; when Claude Code is driving (CLAUDECODE env var), adds
  `--agent claude-code` so skills target `.claude/skills/`.
- skills: `runSkillsAdd` accepts `cwd` and `extraArgs` so callers can
  control where and how skills are installed.
- templates: CLAUDE.md / AGENTS.md now tell agents to run
  `npx skills add heygen-com/hyperframes` to install or update skills.

Co-authored-by: Wenbo Zhu <295860553+kiritowoo@users.noreply.github.com>
This commit is contained in:
Miguel Ángel
2026-06-23 13:56:43 -04:00
committed by GitHub
co-authored by Wenbo Zhu
parent 2681085624
commit bf4f34b359
4 changed files with 51 additions and 25 deletions
+20 -4
View File
@@ -800,11 +800,27 @@ export default defineCommand({
for (const f of readdirSync(destDir).filter((f) => !f.startsWith("."))) {
console.log(` ${c.accent(f)}`);
}
if (!skipSkills) {
const { installAllSkills } = await import("./skills.js");
// --yes keeps it non-interactive. When Claude Code is driving
// (CLAUDECODE env var), target its native dir so skills land in
// .claude/skills/ instead of only .agents/skills/.
const args = process.env["CLAUDECODE"] ? ["--agent", "claude-code", "--yes"] : ["--yes"];
await installAllSkills({ cwd: destDir, extraArgs: args });
}
console.log();
console.log("Get started:");
console.log();
console.log(` ${c.accent("1.")} Install AI coding skills (one-time):`);
console.log(` ${c.accent("npx skills add heygen-com/hyperframes")}`);
if (skipSkills) {
console.log(` ${c.accent("1.")} Install AI coding skills (one-time):`);
console.log(` ${c.accent("npx skills add heygen-com/hyperframes --yes")}`);
} else {
console.log(
` ${c.accent("1.")} Restart your AI agent (new session) so it loads the skills.`,
);
}
console.log();
console.log(` ${c.accent("2.")} Open this project with your AI coding agent:`);
console.log(
@@ -1018,8 +1034,8 @@ export default defineCommand({
process.exit(0);
}
if (installSkills) {
const skillsCmd = await import("./skills.js").then((m) => m.default);
await runCommand(skillsCmd, { rawArgs: [] });
const { installAllSkills } = await import("./skills.js");
await installAllSkills({ cwd: destDir });
}
}