Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/packages/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,11 @@ locked-down production renders, compile Tailwind to CSS and link the stylesheet.

Every new project gets an `AGENTS.md` and an identical `CLAUDE.md`: they tell a
coding agent what HyperFrames is and which commands preview, check, snapshot and
render the video. After scaffolding, `init` checks and installs the core AI
skills from the current GitHub source. See [`skills`](#skills).
render the video. After scaffolding, `init` checks and installs any missing
core AI skills from the current GitHub source. They install globally, into
`~/.claude/skills` and `~/.agents/skills`, so every project on the machine uses
them, even one with its own `hyperframes` dependency; pass `--skip-skills` to
leave them alone. See [`skills`](#skills).

### `add`

Expand Down
48 changes: 48 additions & 0 deletions packages/cli/src/commands/init.skillsNotice.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { afterEach, beforeEach, expect, it, vi } from "vitest";
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import type { ArgsDef } from "citty";
import { runCommand } from "citty";
import { consumeCommandResult } from "../utils/commandResult.js";
import init from "./init.js";

vi.mock("../telemetry/events.js", () => ({ trackInitTemplate: vi.fn() }));
vi.mock("./skills.js", () => ({
updateSkills: vi.fn(async () => ({ installed: ["hyperframes"], presenceOnly: false })),
}));

let dir: string;
let printed: string[];

beforeEach(() => {
dir = mkdtempSync(join(tmpdir(), "hf-init-skills-"));
printed = [];
vi.stubEnv("HYPERFRAMES_SKIP_SKILLS", "");
vi.spyOn(console, "log").mockImplementation((...args) => void printed.push(args.join(" ")));
vi.spyOn(console, "error").mockImplementation(() => {});
});

afterEach(() => {
rmSync(dir, { recursive: true, force: true });
vi.restoreAllMocks();
vi.unstubAllEnvs();
consumeCommandResult();
});

it("says the skills it installed are global and how to leave them alone", async () => {
await runCommand(init, {
rawArgs: [join(dir, "proj"), "--example", "blank", "--non-interactive"],
});
const output = printed.join("\n");
expect(output).toContain("These skills are global");
expect(output).toContain("--skip-skills");
});

it("names the global skill folders in the --skip-skills help", () => {
const args = init.args as ArgsDef;
const skip = args["skip-skills"];
const description = skip && typeof skip === "object" ? String(skip.description) : "";
expect(description).toContain("~/.claude/skills");
expect(description).toContain("HYPERFRAMES_SKIP_SKILLS=1");
});
8 changes: 7 additions & 1 deletion packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,11 @@ async function keepSkillsCurrent(destDir: string): Promise<void> {
console.log(
c.dim("Workflow skills not installed here are added on demand, when first used."),
);
console.log(
c.dim(
"These skills are global: every project on this machine uses them. `init --skip-skills` (or HYPERFRAMES_SKIP_SKILLS=1) leaves skills alone.",
),
);
}
} catch (err) {
console.log(
Expand Down Expand Up @@ -833,7 +838,8 @@ export default defineCommand({
},
"skip-skills": {
type: "boolean",
description: "Skip installing missing core AI skills (also HYPERFRAMES_SKIP_SKILLS=1)",
description:
"Leave AI skills alone. Without it, init installs missing core skills globally (~/.claude/skills, ~/.agents/skills), for every project. Also HYPERFRAMES_SKIP_SKILLS=1",
},
tailwind: {
type: "boolean",
Expand Down