CLI usage
Three commands. All are idempotent — running them twice in a row is a no-op the second time.
agent-kit init
Scaffold a starter AGENTS.md (only if it does not exist) and derive the per-tool files from it.
npx agent-kit initFlags:
--cwd <path>— start from a different working directory (defaults toprocess.cwd()).
Behavior:
- If
AGENTS.mdexists → leave it alone. - If
AGENTS.mdis missing → write a starter template. - Always derives
CLAUDE.md,.gemini/GEMINI.md,.github/copilot-instructions.md,CONVENTIONS.md.
agent-kit sync
Re-derive the per-tool files from AGENTS.md and export skills from installed packages.
npx agent-kit syncnpx agent-kit sync --target claude,cursornpx agent-kit sync --derive-onlynpx agent-kit sync --skills-onlynpx agent-kit sync --path @warlock.jsnpx agent-kit sync --overrideFlags:
--cwd <path>— working directory override.--target <names>— comma-separated skill targets. Valid:claude,copilot,cursor,codex,opencode,amp,goose,kiro,antigravity. Defaults toclaude.--derive-only— skip skills export.--skills-only— skip derivation.--path <dirs>/-p— comma-separated extra dirs to scan, each treated like anode_modules/. Use for monorepos (yarn workspaces,pnpm workspaces) or local dev setups where framework packages live outsidenode_modules/. Packages found in scan paths override same-named entries innode_modules/.--override— replace user-authored destination folders (those without our.agent-kit-managedsentinel). Skipped with a warning by default.
This is the command to wire into your project’s postinstall:
{ "scripts": { "postinstall": "agent-kit sync" }}agent-kit watch
Watch AGENTS.md, the project’s local skills/**/SKILL.md, and every node_modules/**/skills/**/SKILL.md; re-derive and re-sync on change. Intended for the active dev loop when editing skills locally and for monorepo / path-linked setups where postinstall does not re-fire.
npx agent-kit watchnpx agent-kit watch --path @warlock.jsFlags:
--cwd <path>— working directory override.--path <dirs>/-p— extra dirs whose**/skills/**/SKILL.mdshould also be watched.--override— replace user-authored destination folders on each re-sync.
Behavior:
- Performs a full sync on startup so the working tree is consistent.
- Listens for
add/change/unlinkevents on all four watch sets (AGENTS.md, localskills/,node_modules/, extra paths). - Debounces re-syncs by 150ms.
Programmatic API
import { deriveAll, syncSkills, findProjectRoot, scanForSkillPackages, deriveSlugForSkill,} from "@mongez/agent-kit";
const root = await findProjectRoot();if (!root) throw new Error("No package.json found");
const derived = await deriveAll({ root, targets: ["claude"] });const skills = await syncSkills({ root, targets: ["claude", "cursor"], scanPaths: ["@warlock.js"], // optional: extra scan roots beyond node_modules override: false, // optional: replace user-authored dest folders});
// skills.exported, skills.pruned, skills.skipped, skills.targets, skills.packages, skills.scannedPathsExit behavior
- All commands exit 0 on success.
syncexits non-zero ifAGENTS.mdis missing (the derive pass throws).--skills-onlybypasses that pass and succeeds without it.initnever errors on a missing source — it creates one.watchruns until the process is killed.