mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
fix(cli): always check GitHub skills on init while skills.sh syncs (#1768)
* fix(cli): always check GitHub skills on init while skills.sh syncs The "don't pass --skip-skills" guidance lives in SKILL.md, which ships through the laggy skills.sh registry and can't be relied on to reach the agent — so an agent that improvises `--skip-skills` silently dodges the GitHub skills freshness pull. Put the guarantee in the CLI instead (the one channel that updates promptly via `npx hyperframes@latest`): - Neuter the `--skip-skills` FLAG so it no longer skips the check; gate skipping on the HYPERFRAMES_SKIP_SKILLS=1 env var instead (the agent/user CLI path never sets it). Print a one-line notice when the ignored flag is passed. - Wire the env escape hatch into the init test helper (one place) and the CI smoke-test / windows-canary steps so they stay offline and fast. - Update the skill docs that previously told agents `--skip-skills` opts out. Temporary measure while skills.sh catches up — revert init.ts's `skipSkills` to `args["skip-skills"] === true` once it does (noted inline). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(ci): build @hyperframes/lint before core in Test and Studio jobs The lint extraction (#1756) made @hyperframes/lint a runtime dependency of core — core's compiled compiler/staticGuard.js imports it via the package's "node" export condition (./dist/index.js). But the Test and Studio-load-smoke jobs pre-build only @hyperframes/{parsers,studio-server} before packages/core, so loading core's dist at test / dev-server time fails with: ERR_MODULE_NOT_FOUND: Cannot find module .../@hyperframes/lint/dist/index.js imported from .../packages/core/dist/compiler/staticGuard.js Build the canonical pre-core set @hyperframes/{parsers,lint,studio-server} (the glob the root build script uses) in both jobs so it can't drift again. The SDK job is left as-is — it builds parsers+core only and passes. Reproduced locally: removing packages/lint/dist reproduces the exact ERR_MODULE_NOT_FOUND; building lint resolves it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(cli): address PR #1768 review — stale comment + harden offline init - Update the stale interactive-path comment that still said "Opt out with --skip-skills"; the flag is neutered, opt-out is HYPERFRAMES_SKIP_SKILLS=1. - Wrap installAllSkills in ensureSkillsCurrent with try/catch. installAllSkills is already non-strict (swallows its own failures), but since --skip-skills no longer escapes this path, every init — including offline ones that fall through to "install anyway" — runs it. The guard guarantees a skills-install failure only warns and proceeds, never breaks init. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
7a4853dfe6
commit
bf630bfe1e
@@ -18,6 +18,9 @@ function runInit(args: string[]): { status: number; stdout: string; stderr: stri
|
||||
const res = spawnSync("bun", ["run", cliEntry, "init", ...args], {
|
||||
encoding: "utf-8",
|
||||
timeout: 30_000,
|
||||
// The `--skip-skills` flag is neutered (see init.ts); the GitHub skills check
|
||||
// is opted out only via this env var, so tests stay offline and fast.
|
||||
env: { ...process.env, HYPERFRAMES_SKIP_SKILLS: "1" },
|
||||
});
|
||||
return {
|
||||
status: res.status ?? -1,
|
||||
|
||||
@@ -10,7 +10,10 @@ export const examples: Example[] = [
|
||||
["Start from an audio file", "hyperframes init my-video --audio track.mp3"],
|
||||
["Scaffold with Tailwind CSS", "hyperframes init my-video --example blank --tailwind"],
|
||||
["Non-interactive mode (for CI or AI agents)", "hyperframes init my-video --non-interactive"],
|
||||
["Skip AI coding skills installation", "hyperframes init my-video --skip-skills"],
|
||||
[
|
||||
"Opt out of the GitHub skills check (CI/tests only)",
|
||||
"HYPERFRAMES_SKIP_SKILLS=1 hyperframes init my-video --non-interactive",
|
||||
],
|
||||
];
|
||||
import {
|
||||
existsSync,
|
||||
@@ -601,7 +604,19 @@ async function ensureSkillsCurrent(destDir: string): Promise<void> {
|
||||
// installAllSkills installs the full set once globally and mirrors it into
|
||||
// every installed agent's global dir — project-independent, so a freshly
|
||||
// scaffolded project doesn't need any agent folders yet.
|
||||
await installAllSkills({ cwd: destDir });
|
||||
//
|
||||
// Best-effort: installAllSkills (non-strict here) already swallows its own
|
||||
// failures, but now that --skip-skills no longer escapes this path every
|
||||
// init runs it — including offline ones, where checkSkills throws and we
|
||||
// fall through to "install anyway". Wrap defensively so a skills-install
|
||||
// failure can never break `init` itself; it only warns and proceeds.
|
||||
try {
|
||||
await installAllSkills({ cwd: destDir });
|
||||
} catch (err) {
|
||||
console.log(
|
||||
c.dim(`AI coding skills install skipped: ${err instanceof Error ? err.message : err}`),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
console.log(c.success("AI coding skills are already up to date."));
|
||||
}
|
||||
@@ -670,7 +685,8 @@ export default defineCommand({
|
||||
},
|
||||
"skip-skills": {
|
||||
type: "boolean",
|
||||
description: "Skip AI coding skills installation",
|
||||
description:
|
||||
"[temporarily ignored] init always checks AI skills against GitHub while the skills.sh registry catches up; set HYPERFRAMES_SKIP_SKILLS=1 to opt out (CI/tests)",
|
||||
},
|
||||
tailwind: {
|
||||
type: "boolean",
|
||||
@@ -705,13 +721,32 @@ export default defineCommand({
|
||||
const videoFlag = args.video;
|
||||
const audioFlag = args.audio;
|
||||
const skipTranscribe = args["skip-transcribe"] === true;
|
||||
const skipSkills = args["skip-skills"] === true;
|
||||
// Temporary measure while the skills.sh registry sync lags GitHub main: the
|
||||
// `--skip-skills` FLAG is neutered so an agent (or user) that passes it can
|
||||
// NOT dodge the GitHub skills freshness check. The "don't pass --skip-skills"
|
||||
// guidance lives in SKILL.md, which ships through the same laggy skills.sh
|
||||
// channel and can't be relied on to reach the agent — so the guarantee has to
|
||||
// live in the CLI, the one channel that updates promptly (`npx
|
||||
// hyperframes@latest`). CI and unit tests still opt out via the
|
||||
// HYPERFRAMES_SKIP_SKILLS=1 env var, which the agent/user CLI path never sets.
|
||||
// Revert to `args["skip-skills"] === true` once skills.sh catches up.
|
||||
const skipSkills = process.env.HYPERFRAMES_SKIP_SKILLS === "1";
|
||||
const skipSkillsFlagIgnored = args["skip-skills"] === true && !skipSkills;
|
||||
const tailwind = args.tailwind === true;
|
||||
const nonInteractive = args["non-interactive"] === true;
|
||||
const modelFlag = args.model;
|
||||
const languageFlag = args.language;
|
||||
const interactive = !nonInteractive && process.stdout.isTTY === true;
|
||||
|
||||
if (skipSkillsFlagIgnored) {
|
||||
console.log(
|
||||
c.dim(
|
||||
"Note: --skip-skills is temporarily ignored — init always checks AI skills " +
|
||||
"against GitHub while the skills.sh registry catches up.",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
let resolutionPreset: CanvasResolution | undefined;
|
||||
if (args.resolution !== undefined) {
|
||||
resolutionPreset = normalizeResolutionFlag(args.resolution);
|
||||
@@ -1053,7 +1088,8 @@ export default defineCommand({
|
||||
clack.note(files.map((f) => c.accent(f)).join("\n"), c.success(`Created ${name}/`));
|
||||
|
||||
// Check skills against GitHub and (re)install only if outdated or missing —
|
||||
// init is the one place the full set is pulled. Opt out with --skip-skills.
|
||||
// init is the one place the full set is pulled. The --skip-skills flag is
|
||||
// temporarily neutered (see above); CI/tests opt out via HYPERFRAMES_SKIP_SKILLS=1.
|
||||
if (!skipSkills) {
|
||||
await ensureSkillsCurrent(destDir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user