feat(skills): install bundled orchestration skills for Antigravity

Antigravity CLI (`agy`), App, and IDE do not scan `~/.agents/skills` or
`~/.claude/skills` globally; they discover global skills one level deep
from `~/.gemini/config/skills/<skill>/SKILL.md`. Gemini CLI already
discovers `~/.agents/skills`, so targeting `~/.gemini/config/skills`
only (instead of `~/.gemini/skills`) avoids duplicate skill entries in
both Gemini CLI and `agy`.

Appends `antigravityDir` at root index 3 in skill transactions so any
in-flight pre-upgrade transaction manifest retains its existing backup
indices, and includes `antigravityDir` in legacy Codex alias checks so
symlinked roots are not retired.
This commit is contained in:
Mohamed Boudra
2026-11-20 06:52:34 +01:00
parent 66f764eefd
commit 8cf074fa2e
20 changed files with 411 additions and 92 deletions
+7 -5
View File
@@ -186,11 +186,13 @@ Terminal activity contributes to the workspace status bucket **per `workspaceId`
Single file, validated with `PersistedConfigSchema`.
`agents.skills.selection` is the daemon host's orchestration-skill preference. Missing means
`{ mode: "all" }`. Installed state is not persisted; the daemon derives it from the shared
`~/.agents/skills` and Claude skill directories and keeps config plus filesystem convergence behind
one serialized owner. Codex discovers the shared directory. Updates retire unchanged files from
Paseo-managed copies in `~/.codex/skills`, preserving user edits and untracked files.
`agents.skills.selection` stores the orchestration-skill preference for the daemon host, and a
missing value defaults to `{ mode: "all" }`. The daemon does not persist installed state. It
derives installed state from `~/.agents/skills`, `~/.claude/skills`, and `~/.gemini/config/skills`,
and serializes configuration and filesystem convergence through one owner. Codex and Gemini CLI
discover `~/.agents/skills`, while Antigravity discovers `~/.gemini/config/skills`. Updates retire
unchanged files from Paseo-managed copies in `~/.codex/skills` and preserve user edits and
untracked files.
`paseo reload` reads and validates this file once inside the daemon. That snapshot drives resolution,
classification, application, and reload bookkeeping. `DaemonConfigStore` owns applying runtime-safe
@@ -22,7 +22,7 @@ type AgentSkillsClient = Pick<
"close" | "connect" | "getAgentSkillsStatus" | "saveAgentSkillsSelection"
>;
export type SkillTargetName = "agents" | "claude";
export type SkillTargetName = "agents" | "claude" | "antigravity";
export interface AgentSkillsSandbox {
available: string[];
@@ -64,6 +64,7 @@ export async function startAgentSkillsSandbox(): Promise<AgentSkillsSandbox> {
const targets = {
agents: path.join(home, ".agents", "skills"),
claude: path.join(home, ".claude", "skills"),
antigravity: path.join(home, ".gemini", "config", "skills"),
};
const codexSkillsDir = path.join(home, ".codex", "skills");
@@ -196,7 +196,7 @@ export interface SetupHost {
/**
* An isolated host whose only agent history is the Claude sessions given here, so suggestions
* never depend on the machine running the test. Its HOME is a scratch folder, so the skills setup
* installs never land in the real ~/.agents, ~/.claude or ~/.codex. `withBrokenProvider` adds a
* installs never land in the real ~/.agents, ~/.claude, ~/.codex, or ~/.gemini/config. `withBrokenProvider` adds a
* provider that cannot start.
*/
export async function startSetupHost(
+3 -2
View File
@@ -2892,7 +2892,8 @@ export const ar: TranslationResources = {
updateAvailable: "التحديث متاح",
updateTitle: "تحديث مهارات Paseo ؟",
uninstallTitle: "إلغاء تثبيت مهارات Paseo ؟",
uninstallMessage: "يزيل جميع مهارات تنسيق Paseo من ~/.agents ، ~/.claude ، ~/.codex.",
uninstallMessage:
"يزيل جميع مهارات تنسيق Paseo من ~/.agents و~/.claude و~/.codex و~/.gemini/config.",
choose: "اختيار المهارات",
chooseAll: "كل المهارات",
chooseAllHint: "أبقِ جميع المهارات المرفقة مثبتة، بما فيها ما يُضاف لاحقًا.",
@@ -2900,7 +2901,7 @@ export const ar: TranslationResources = {
chooseEmpty: "لا تتضمن هذه النسخة أي مهارات.",
removeTitle: "إزالة المهارات غير المحددة؟",
removeMessage:
"سيتم حذف {{skills}} من ~/.agents و~/.claude و~/.codex. كما يُحذف كل ما أضفته داخل مجلدات المهارات تلك.",
"سيتم حذف {{skills}} من ~/.agents و~/.claude و~/.codex و~/.gemini/config. كما يُحذف كل ما أضفته داخل مجلدات المهارات تلك.",
saveFailed: "تعذر حفظ اختيار المهارات.",
statusFailed: "غير قادر على التحقق من حالة مهارات التنسيق.",
updateFailed: "غير قادر على تحديث مهارات التنسيق.",
+2 -2
View File
@@ -2994,7 +2994,7 @@ export const en = {
updateTitle: "Update Paseo skills?",
uninstallTitle: "Uninstall Paseo skills?",
uninstallMessage:
"Removes all Paseo orchestration skills from ~/.agents, ~/.claude, ~/.codex on this host.",
"Removes all Paseo orchestration skills from ~/.agents, ~/.claude, ~/.codex, and ~/.gemini/config on this host.",
choose: "Choose skills",
chooseAll: "All skills",
chooseAllHint: "Keep every bundled skill installed, including ones added later.",
@@ -3002,7 +3002,7 @@ export const en = {
chooseEmpty: "This host bundles no skills.",
removeTitle: "Remove deselected skills?",
removeMessage:
"{{skills}} will be deleted from ~/.agents, ~/.claude, and ~/.codex on this host. Anything you added inside those skill folders is deleted too.",
"{{skills}} will be deleted from ~/.agents, ~/.claude, ~/.codex, and ~/.gemini/config on this host. Anything you added inside those skill folders is deleted too.",
saveFailed: "Could not save your skill selection.",
actions: {
update: "Update",
+2 -2
View File
@@ -2916,7 +2916,7 @@ export const es: TranslationResources = {
updateTitle: "¿Actualizar las habilidades dePaseo?",
uninstallTitle: "¿Desinstalar las habilidadesPaseo?",
uninstallMessage:
"Elimina todas las habilidades de orquestaciónPaseode ~/.agents, ~/.claude, ~/.codex.",
"Elimina todas las habilidades de orquestación Paseo de ~/.agents, ~/.claude, ~/.codex y ~/.gemini/config.",
choose: "Elegir habilidades",
chooseAll: "Todas las habilidades",
chooseAllHint:
@@ -2925,7 +2925,7 @@ export const es: TranslationResources = {
chooseEmpty: "Esta versión no incluye habilidades.",
removeTitle: "¿Eliminar las habilidades deseleccionadas?",
removeMessage:
"{{skills}} se eliminarán de ~/.agents, ~/.claude y ~/.codex. También se elimina todo lo que hayas añadido dentro de esas carpetas de habilidades.",
"{{skills}} se eliminarán de ~/.agents, ~/.claude, ~/.codex y ~/.gemini/config. También se elimina todo lo que hayas añadido dentro de esas carpetas de habilidades.",
saveFailed: "No se pudo guardar tu selección de habilidades.",
statusFailed: "No se puede comprobar el estado de las habilidades de orquestación.",
updateFailed: "No se pueden actualizar las habilidades de orquestación.",
+2 -2
View File
@@ -2919,7 +2919,7 @@ export const fr: TranslationResources = {
updateTitle: "Mettre à jour les skills Paseo ?",
uninstallTitle: "Désinstaller les skills Paseo ?",
uninstallMessage:
"Supprime tous les skills d’orchestration Paseo de ~/.agents, ~/.claude et ~/.codex sur cet hôte.",
"Supprime tous les skills d’orchestration Paseo de ~/.agents, ~/.claude, ~/.codex et ~/.gemini/config sur cet hôte.",
choose: "Choisir les skills",
chooseAll: "Tous les skills",
chooseAllHint:
@@ -2928,7 +2928,7 @@ export const fr: TranslationResources = {
chooseEmpty: "Cet hôte ne fournit aucun skill.",
removeTitle: "Supprimer les skills décochés ?",
removeMessage:
"{{skills}} seront supprimés de ~/.agents, ~/.claude et ~/.codex sur cet hôte. Tout ce que vous avez ajouté dans ces dossiers de skills sera également supprimé.",
"{{skills}} seront supprimés de ~/.agents, ~/.claude, ~/.codex et ~/.gemini/config sur cet hôte. Tout ce que vous avez ajouté dans ces dossiers de skills sera également supprimé.",
saveFailed: "Impossible d’enregistrer votre sélection de skills.",
statusFailed: "Impossible de vérifier l’état des skills d’orchestration.",
updateFailed: "Impossible de mettre à jour les skills d’orchestration.",
+2 -2
View File
@@ -2884,7 +2884,7 @@ export const ja: TranslationResources = {
updateTitle: "Paseoスキルを更新しますか?",
uninstallTitle: "Paseoスキルをアンインストールしますか?",
uninstallMessage:
"~/.agents、~/.claude、~/.codexからすべてのPaseoオーケストレーションスキルを削除します。",
"~/.agents、~/.claude、~/.codex、~/.gemini/configからすべてのPaseoオーケストレーションスキルを削除します。",
choose: "スキルを選択",
chooseAll: "すべてのスキル",
chooseAllHint:
@@ -2893,7 +2893,7 @@ export const ja: TranslationResources = {
chooseEmpty: "このビルドにはスキルが含まれていません。",
removeTitle: "選択を外したスキルを削除しますか?",
removeMessage:
"{{skills}} を ~/.agents、~/.claude、~/.codex から削除します。それらのスキルフォルダー内に追加したものもすべて削除されます。",
"{{skills}} を ~/.agents、~/.claude、~/.codex、~/.gemini/config から削除します。それらのスキルフォルダー内に追加したものもすべて削除されます。",
saveFailed: "スキルの選択を保存できませんでした。",
statusFailed: "オーケストレーションスキルのステータスを確認できません。",
updateFailed: "オーケストレーションスキルを更新できません。",
+2 -2
View File
@@ -2871,7 +2871,7 @@ export const ko: TranslationResources = {
updateTitle: "Paseo 스킬을 업데이트할까요?",
uninstallTitle: "Paseo 스킬을 제거할까요?",
uninstallMessage:
"~/.agents, ~/.claude, ~/.codex에서 모든 Paseo 오케스트레이션 스킬을 제거합니다.",
"~/.agents, ~/.claude, ~/.codex, ~/.gemini/config에서 모든 Paseo 오케스트레이션 스킬을 제거합니다.",
choose: "스킬 선택",
chooseAll: "모든 스킬",
chooseAllHint: "나중에 추가되는 항목을 포함하여 모든 번들 스킬을 설치된 상태로 유지합니다.",
@@ -2879,7 +2879,7 @@ export const ko: TranslationResources = {
chooseEmpty: "이 빌드에는 번들 스킬이 없습니다.",
removeTitle: "선택 해제한 스킬을 제거할까요?",
removeMessage:
"{{skills}}는 ~/.agents, ~/.claude 및 ~/.codex에서 삭제됩니다. 해당 스킬 폴더 안에 추가한 모든 항목도 삭제됩니다.",
"{{skills}}는 ~/.agents, ~/.claude, ~/.codex 및 ~/.gemini/config에서 삭제됩니다. 해당 스킬 폴더 안에 추가한 모든 항목도 삭제됩니다.",
saveFailed: "선택한 스킬을 저장하지 못했습니다.",
statusFailed: "오케스트레이션 스킬 상태를 확인할 수 없습니다.",
updateFailed: "오케스트레이션 스킬을 업데이트할 수 없습니다.",
+2 -2
View File
@@ -2897,7 +2897,7 @@ export const ptBR: TranslationResources = {
updateTitle: "Atualizar Paseo skills?",
uninstallTitle: "Desinstalar Paseo skills?",
uninstallMessage:
"Remove todas as skills de orquestração do Paseo de ~/.agents, ~/.claude e ~/.codex.",
"Remove todas as skills de orquestração do Paseo de ~/.agents, ~/.claude, ~/.codex e ~/.gemini/config.",
choose: "Escolher skills",
chooseAll: "Todas as skills",
chooseAllHint:
@@ -2906,7 +2906,7 @@ export const ptBR: TranslationResources = {
chooseEmpty: "Esta versão não inclui skills.",
removeTitle: "Remover as skills desmarcadas?",
removeMessage:
"{{skills}} serão excluídas de ~/.agents, ~/.claude e ~/.codex. Tudo o que você adicionou dentro dessas pastas de skills também é excluído.",
"{{skills}} serão excluídas de ~/.agents, ~/.claude, ~/.codex e ~/.gemini/config. Tudo o que você adicionou dentro dessas pastas de skills também é excluído.",
saveFailed: "Não foi possível salvar sua seleção de skills.",
statusFailed: "Não foi possível verificar o status das skills de orquestração.",
updateFailed: "Não foi possível atualizar as skills de orquestração.",
+2 -2
View File
@@ -2909,7 +2909,7 @@ export const ru: TranslationResources = {
updateTitle: "Обновить навыки Paseo?",
uninstallTitle: "Удалить навыки Paseo?",
uninstallMessage:
"Удаляет все навыки оркестрации Paseo из ~/.agents, ~/.claude и ~/.codex на этом хосте.",
"Удаляет все навыки оркестрации Paseo из ~/.agents, ~/.claude, ~/.codex и ~/.gemini/config на этом хосте.",
choose: "Выбрать навыки",
chooseAll: "Все навыки",
chooseAllHint: "Устанавливать все встроенные навыки, включая добавленные позже.",
@@ -2917,7 +2917,7 @@ export const ru: TranslationResources = {
chooseEmpty: "На этом хосте нет встроенных навыков.",
removeTitle: "Удалить снятые навыки?",
removeMessage:
"{{skills}} будут удалены из ~/.agents, ~/.claude и ~/.codex на этом хосте. Всё, что вы добавили в эти папки навыков, тоже будет удалено.",
"{{skills}} будут удалены из ~/.agents, ~/.claude, ~/.codex и ~/.gemini/config на этом хосте. Всё, что вы добавили в эти папки навыков, тоже будет удалено.",
saveFailed: "Не удалось сохранить выбор навыков.",
statusFailed: "Не удалось проверить состояние навыков оркестрации.",
updateFailed: "Не удалось обновить навыки оркестрации.",
+3 -2
View File
@@ -2826,7 +2826,8 @@ export const zhCN: TranslationResources = {
updateAvailable: "有更新可用",
updateTitle: "更新 Paseo skills?",
uninstallTitle: "卸载 Paseo skills?",
uninstallMessage: "会从 ~/.agents、~/.claude、~/.codex 移除所有 Paseo 编排 skills。",
uninstallMessage:
"会从 ~/.agents、~/.claude、~/.codex、~/.gemini/config 移除所有 Paseo 编排 skills。",
choose: "选择 skills",
chooseAll: "全部 skills",
chooseAllHint: "保持安装所有内置 skills,包括以后新增的。",
@@ -2834,7 +2835,7 @@ export const zhCN: TranslationResources = {
chooseEmpty: "此版本未内置 skills。",
removeTitle: "移除取消勾选的 skills?",
removeMessage:
"将从 ~/.agents、~/.claude、~/.codex 中删除 {{skills}}。你在这些 skill 文件夹里添加的内容也会一并删除。",
"将从 ~/.agents、~/.claude、~/.codex、~/.gemini/config 中删除 {{skills}}。你在这些 skill 文件夹里添加的内容也会一并删除。",
saveFailed: "无法保存你的 skills 选择。",
statusFailed: "无法检查编排 skills 状态。",
updateFailed: "无法更新编排 skills。",
@@ -38,6 +38,7 @@ async function makeHarness(selectionStore?: SkillSelectionStore): Promise<Harnes
agentsDir: path.join(root, "home", ".agents", "skills"),
claudeDir: path.join(root, "home", ".claude", "skills"),
codexDir: path.join(root, "home", ".codex", "skills"),
antigravityDir: path.join(root, "home", ".gemini", "config", "skills"),
};
for (const name of BUNDLED_SKILLS) {
await mkdir(path.join(targets.sourceDir, name), { recursive: true });
@@ -147,7 +148,11 @@ async function installedSkills(dir: string): Promise<string[]> {
}
async function installedEverywhere(targets: SkillTargets): Promise<string[][]> {
return Promise.all([targets.agentsDir, targets.claudeDir, targets.codexDir].map(installedSkills));
return Promise.all(
[targets.agentsDir, targets.claudeDir, targets.codexDir, targets.antigravityDir].map(
installedSkills,
),
);
}
async function writeUserFile(
@@ -156,7 +161,12 @@ async function writeUserFile(
relativePath: string,
contents: string,
): Promise<void> {
for (const dir of [targets.agentsDir, targets.claudeDir, targets.codexDir]) {
for (const dir of [
targets.agentsDir,
targets.claudeDir,
targets.codexDir,
targets.antigravityDir,
]) {
const file = path.join(dir, skill, relativePath);
await mkdir(path.dirname(file), { recursive: true });
await writeFile(file, contents);
@@ -169,7 +179,7 @@ async function readUserFile(
relativePath: string,
): Promise<Array<string | null>> {
return Promise.all(
[targets.agentsDir, targets.claudeDir, targets.codexDir].map((dir) =>
[targets.agentsDir, targets.claudeDir, targets.codexDir, targets.antigravityDir].map((dir) =>
readFile(path.join(dir, skill, relativePath), "utf8").catch(() => null),
),
);
@@ -178,16 +188,19 @@ async function readUserFile(
/** Anything the transaction staged and failed to clean up sits beside the skills tree. */
async function backupArtifacts(targets: SkillTargets): Promise<string[][]> {
return Promise.all(
[targets.agentsDir, targets.claudeDir, targets.codexDir].map(async (dir) => {
const parentEntries = await readdir(path.dirname(dir)).catch(() => []);
const rootEntries = await readdir(dir).catch(() => []);
return [
...parentEntries.filter(
(entry) => entry !== path.basename(dir) && !entry.startsWith(".paseo-skills-recovered-"),
),
...rootEntries.filter((entry) => entry.startsWith(".paseo-skills-transaction-")),
].sort();
}),
[targets.agentsDir, targets.claudeDir, targets.codexDir, targets.antigravityDir].map(
async (dir) => {
const parentEntries = await readdir(path.dirname(dir)).catch(() => []);
const rootEntries = await readdir(dir).catch(() => []);
return [
...parentEntries.filter(
(entry) =>
entry !== path.basename(dir) && !entry.startsWith(".paseo-skills-recovered-"),
),
...rootEntries.filter((entry) => entry.startsWith(".paseo-skills-transaction-")),
].sort();
},
),
);
}
@@ -210,7 +223,7 @@ async function blockAgentsDir(targets: SkillTargets): Promise<void> {
}
async function isInstalled(targets: SkillTargets, name: string): Promise<boolean> {
const dirs = [targets.agentsDir, targets.claudeDir];
const dirs = [targets.agentsDir, targets.claudeDir, targets.antigravityDir];
const present = await Promise.all(
dirs.map((dir) =>
access(path.join(dir, name))
@@ -251,7 +264,7 @@ describe("skills controller", () => {
selection: { mode: "custom", skills: ["paseo", "paseo-loop"] },
},
);
expect(await installedEverywhere(harness.targets)).toEqual([[], [], []]);
expect(await installedEverywhere(harness.targets)).toEqual([[], [], [], []]);
});
let harness: Harness;
@@ -299,6 +312,7 @@ describe("skills controller", () => {
"keep this",
"keep this",
"keep this",
"keep this",
]);
});
@@ -455,13 +469,15 @@ describe("skills controller", () => {
["paseo", "paseo-loop"],
["paseo", "paseo-loop"],
["paseo-loop"],
["paseo", "paseo-loop"],
]);
expect(await readUserFile(readOnly.targets, "paseo-loop", "notes/mine.md")).toEqual([
"hand written",
"hand written",
"hand written",
"hand written",
]);
expect(await backupArtifacts(readOnly.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(readOnly.targets)).toEqual([[], [], [], []]);
await rm(readOnly.root, { recursive: true, force: true });
});
@@ -482,6 +498,7 @@ describe("skills controller", () => {
"keep this",
"keep this",
"keep this",
"keep this",
]);
await rm(readOnly.root, { recursive: true, force: true });
});
@@ -506,6 +523,7 @@ describe("skills controller", () => {
"keep this",
"keep this",
"keep this",
"keep this",
]);
await rm(readOnly.root, { recursive: true, force: true });
});
@@ -534,11 +552,13 @@ describe("skills controller", () => {
"restore this",
"restore this",
"restore this",
"restore this",
]);
expect(await readUserFile(readOnly.targets, "paseo-loop", "notes/concurrent.md")).toEqual([
"keep this",
"keep this",
"keep this",
"keep this",
]);
await rm(readOnly.root, { recursive: true, force: true });
});
@@ -562,6 +582,7 @@ describe("skills controller", () => {
"keep this",
"keep this",
"keep this",
"keep this",
]);
expect(await isInstalled(harness.targets, "paseo-loop")).toBe(true);
});
@@ -580,6 +601,7 @@ describe("skills controller", () => {
harness.targets.agentsDir,
harness.targets.claudeDir,
harness.targets.codexDir,
harness.targets.antigravityDir,
].map((root) => path.join(root, "paseo-loop"));
for (const live of livePaths) await chmod(live, 0o700);
const before = await Promise.all(livePaths.map(lstat));
@@ -591,7 +613,7 @@ describe("skills controller", () => {
const after = await Promise.all(livePaths.map(lstat));
expect(after.map((entry) => entry.ino)).toEqual(before.map((entry) => entry.ino));
expect(after.map((entry) => entry.mode & 0o777)).toEqual([0o700, 0o700, 0o700]);
expect(after.map((entry) => entry.mode & 0o777)).toEqual([0o700, 0o700, 0o700, 0o700]);
},
);
@@ -622,8 +644,9 @@ describe("skills controller", () => {
"paseo-loop-v1",
"paseo-loop-v1",
null,
"paseo-loop-v1",
]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
await expect(harness.controller.status()).resolves.toMatchObject({ selection: previous });
});
@@ -656,8 +679,9 @@ describe("skills controller", () => {
"keep this",
"keep this",
null,
"keep this",
]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
await expect(harness.controller.status()).resolves.toMatchObject({ selection: previous });
});
@@ -693,7 +717,7 @@ describe("skills controller", () => {
expect(
await readFile(path.join(harness.targets.codexDir, recovered!, "notes", "mine.md"), "utf8"),
).toBe("staged notes");
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
await expect(harness.controller.status()).resolves.toMatchObject({ selection: previous });
});
@@ -732,8 +756,9 @@ describe("skills controller", () => {
null,
"keep this",
"keep this",
"keep this",
]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
await expect(harness.controller.status()).resolves.toMatchObject({ selection: previous });
});
@@ -775,7 +800,7 @@ describe("skills controller", () => {
expect(await readFile(entry!.livePath, "utf8")).toBe("external replacement");
expect(await readFile(path.join(recovered, "notes", "mine.md"), "utf8")).toBe("captured notes");
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it("preserves a directory that replaces a captured file before recovery", async () => {
@@ -806,7 +831,7 @@ describe("skills controller", () => {
expect(
await readFile(path.join(path.dirname(harness.targets.agentsDir), recovered!), "utf8"),
).toBe("captured file");
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it.skipIf(process.platform !== "linux")(
@@ -926,6 +951,7 @@ describe("skills controller", () => {
readOnly.targets.agentsDir,
readOnly.targets.claudeDir,
readOnly.targets.codexDir,
readOnly.targets.antigravityDir,
]) {
const notes = path.join(root, "paseo-loop", "notes");
await mkdir(notes, { recursive: true });
@@ -946,6 +972,7 @@ describe("skills controller", () => {
readOnly.targets.agentsDir,
readOnly.targets.claudeDir,
readOnly.targets.codexDir,
readOnly.targets.antigravityDir,
]) {
const restored = path.join(root, "paseo-loop", "notes", "latest.md");
expect((await lstat(restored)).isSymbolicLink()).toBe(true);
@@ -970,6 +997,7 @@ describe("skills controller", () => {
readOnly.targets.agentsDir,
readOnly.targets.claudeDir,
readOnly.targets.codexDir,
readOnly.targets.antigravityDir,
]) {
await chmod(path.join(root, "paseo-loop", "hooks", "run.sh"), 0o751);
}
@@ -987,6 +1015,7 @@ describe("skills controller", () => {
readOnly.targets.agentsDir,
readOnly.targets.claudeDir,
readOnly.targets.codexDir,
readOnly.targets.antigravityDir,
]) {
const restored = await lstat(path.join(root, "paseo-loop", "hooks", "run.sh"));
expect(restored.mode & 0o777).toBe(0o751);
@@ -998,7 +1027,7 @@ describe("skills controller", () => {
it("leaves no backup artifacts behind after a successful save", async () => {
await harness.controller.save({ mode: "custom", skills: ["paseo"] });
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it.skipIf(process.platform === "win32")(
@@ -1025,7 +1054,7 @@ describe("skills controller", () => {
expect(outcome.ok).toBe(true);
expect(await gated.store.get()).toEqual(next);
await blocked.controller.status();
expect(await backupArtifacts(blocked.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(blocked.targets)).toEqual([[], [], [], []]);
await rm(blocked.root, { recursive: true, force: true });
},
);
@@ -1061,6 +1090,7 @@ describe("skills controller", () => {
harness.targets.agentsDir,
harness.targets.claudeDir,
harness.targets.codexDir,
harness.targets.antigravityDir,
]) {
await rm(path.join(root, "paseo-loop"), { recursive: true, force: true });
}
@@ -1071,8 +1101,9 @@ describe("skills controller", () => {
"hand written",
"hand written",
"hand written",
"hand written",
]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it("does not roll back an interrupted transaction after the selection committed", async () => {
@@ -1092,6 +1123,7 @@ describe("skills controller", () => {
harness.targets.agentsDir,
harness.targets.claudeDir,
harness.targets.codexDir,
harness.targets.antigravityDir,
]) {
await rm(path.join(root, "paseo-loop"), { recursive: true, force: true });
}
@@ -1101,7 +1133,7 @@ describe("skills controller", () => {
expect(snapshot.selection).toEqual(next);
expect(await isInstalled(harness.targets, "paseo-loop")).toBe(false);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it("asks for confirmation naming the directories a save would delete", async () => {
@@ -1119,6 +1151,7 @@ describe("skills controller", () => {
["paseo", "paseo-advisor", "paseo-loop"],
["paseo", "paseo-advisor", "paseo-loop"],
["paseo-advisor"],
["paseo", "paseo-advisor", "paseo-loop"],
]);
expect(result.selection).toEqual({ mode: "custom", skills: ["paseo", "paseo-loop"] });
});
@@ -1134,7 +1167,12 @@ describe("skills controller", () => {
expect(result.confirmationRequired).toBeNull();
expect(result.selection).toEqual({ mode: "custom", skills: ["paseo"] });
expect(await installedEverywhere(harness.targets)).toEqual([["paseo"], ["paseo"], []]);
expect(await installedEverywhere(harness.targets)).toEqual([
["paseo"],
["paseo"],
[],
["paseo"],
]);
});
it("asks again when another directory appears before the retry", async () => {
@@ -1154,6 +1192,7 @@ describe("skills controller", () => {
["paseo", "paseo-advisor", "paseo-chat", "paseo-loop"],
["paseo", "paseo-advisor", "paseo-chat", "paseo-loop"],
["paseo-chat"],
["paseo", "paseo-advisor", "paseo-chat", "paseo-loop"],
]);
});
@@ -1175,6 +1214,7 @@ describe("skills controller", () => {
"hand written",
"hand written",
"hand written",
"hand written",
]);
});
@@ -1182,7 +1222,12 @@ describe("skills controller", () => {
const result = await harness.controller.save({ mode: "custom", skills: ["paseo"] });
expect(result.confirmationRequired).toBeNull();
expect(await installedEverywhere(harness.targets)).toEqual([["paseo"], ["paseo"], []]);
expect(await installedEverywhere(harness.targets)).toEqual([
["paseo"],
["paseo"],
[],
["paseo"],
]);
});
it("preserves a regular file at a skill path when save convergence fails", async () => {
@@ -1195,6 +1240,18 @@ describe("skills controller", () => {
expect(await readFile(collision, "utf8")).toBe("keep this file");
});
it("rolls back earlier targets when writing to Antigravity fails", async () => {
await mkdir(harness.targets.antigravityDir, { recursive: true });
const collision = path.join(harness.targets.antigravityDir, "paseo");
await writeFile(collision, "keep this file");
await expect(harness.controller.save({ mode: "custom", skills: ["paseo"] })).rejects.toThrow();
expect(await readFile(collision, "utf8")).toBe("keep this file");
expect(await installedEverywhere(harness.targets)).toEqual([[], [], [], []]);
expect(await backupArtifacts(harness.targets)).toEqual([[], [], [], []]);
});
it("serializes startup convergence with an interactive save", async () => {
await harness.controller.install();
// Startup finds drift it wants to repair while the user narrows the
@@ -1214,7 +1271,12 @@ describe("skills controller", () => {
]);
expect(saved.selection).toEqual({ mode: "custom", skills: ["paseo"] });
expect(await installedEverywhere(harness.targets)).toEqual([["paseo"], ["paseo"], []]);
expect(await installedEverywhere(harness.targets)).toEqual([
["paseo"],
["paseo"],
[],
["paseo"],
]);
expect(await harness.controller.status()).toEqual({
state: "up-to-date",
ops: [],
@@ -1247,6 +1309,7 @@ describe("skills controller", () => {
"keep this",
"keep this",
"keep this",
"keep this",
]);
});
});
@@ -33,6 +33,7 @@ async function makeSandbox(): Promise<Sandbox> {
agentsDir: path.join(root, "home", ".agents", "skills"),
claudeDir: path.join(root, "home", ".claude", "skills"),
codexDir: path.join(root, "home", ".codex", "skills"),
antigravityDir: path.join(root, "home", ".gemini", "config", "skills"),
};
await fs.mkdir(targets.sourceDir, { recursive: true });
return { root, targets };
@@ -71,6 +72,7 @@ async function writeOnDiskSkillToAllTargets(
writeOnDiskSkill(targets.agentsDir, name, files),
writeOnDiskSkill(targets.claudeDir, name, files),
writeOnDiskSkill(targets.codexDir, name, files),
writeOnDiskSkill(targets.antigravityDir, name, files),
]);
}
@@ -88,7 +90,7 @@ async function pathExists(p: string): Promise<boolean> {
async function installedIn(targets: SkillTargets, name: string): Promise<boolean[]> {
return Promise.all(
[targets.agentsDir, targets.claudeDir, targets.codexDir].map((dir) =>
[targets.agentsDir, targets.claudeDir, targets.codexDir, targets.antigravityDir].map((dir) =>
pathExists(path.join(dir, name)),
),
);
@@ -196,6 +198,10 @@ describe("getSkillsStatus", () => {
"SKILL.md": "paseo-v1",
"hooks/guard.sh": "user guard",
});
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo", {
"SKILL.md": "paseo-v1",
"notes/local.md": "user notes",
});
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
@@ -212,6 +218,7 @@ describe("getSkillsStatus", () => {
await writeOnDiskSkill(sandbox.targets.agentsDir, "paseo", { "SKILL.md": "stale" });
await writeOnDiskSkill(sandbox.targets.claudeDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.codexDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkillToAllTargets(sandbox.targets, "paseo-loop", { "SKILL.md": "loop-v1" });
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
@@ -228,6 +235,8 @@ describe("getSkillsStatus", () => {
await writeOnDiskSkill(sandbox.targets.claudeDir, "paseo-loop", { "SKILL.md": "loop-v1" });
await writeOnDiskSkill(sandbox.targets.codexDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.codexDir, "paseo-loop", { "SKILL.md": "loop-v1" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo-loop", { "SKILL.md": "loop-v1" });
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
@@ -235,6 +244,35 @@ describe("getSkillsStatus", () => {
expect(status.ops).toEqual([{ kind: "update", name: "paseo" }]);
});
it("returns drift when Antigravity is missing or stale", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await writeOnDiskSkill(sandbox.targets.agentsDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.agentsDir, "paseo-loop", { "SKILL.md": "loop-v1" });
await writeOnDiskSkill(sandbox.targets.claudeDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.claudeDir, "paseo-loop", { "SKILL.md": "loop-v1" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo", { "SKILL.md": "stale" });
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
expect(status.state).toBe("drift");
expect(status.ops).toEqual([
{ kind: "update", name: "paseo" },
{ kind: "add", name: "paseo-loop" },
]);
});
it("returns not-installed when only user-personal skills exist in Antigravity", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await writeOnDiskSkill(sandbox.targets.antigravityDir, "my-agy-skill", {
"SKILL.md": "user-agy",
});
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
expect(status.state).toBe("not-installed");
expect(status.installed).toEqual([]);
});
it("returns drift with add ops for the bundled skills missing from disk", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await writeOnDiskSkillToAllTargets(sandbox.targets, "paseo", { "SKILL.md": "paseo-v1" });
@@ -262,6 +300,7 @@ describe("getSkillsStatus", () => {
await writeOnDiskSkill(sandbox.targets.agentsDir, "paseo", { "SKILL.md": "stale" });
await writeOnDiskSkill(sandbox.targets.claudeDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.codexDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "paseo", { "SKILL.md": "paseo-v1" });
await writeOnDiskSkill(sandbox.targets.agentsDir, "paseo-chat", { "SKILL.md": "chat-old" });
const status = await getSkillsStatus(sandbox.targets, ALL_SKILLS);
@@ -299,9 +338,14 @@ describe("custom skill selection", () => {
available: ["paseo", "paseo-advisor", "paseo-loop"],
installed: ["paseo", "paseo-loop"],
});
expect(await installedIn(sandbox.targets, "paseo")).toEqual([true, true, false]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([true, true, false]);
expect(await installedIn(sandbox.targets, "paseo-advisor")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo")).toEqual([true, true, false, true]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([true, true, false, true]);
expect(await installedIn(sandbox.targets, "paseo-advisor")).toEqual([
false,
false,
false,
false,
]);
});
it("reports up-to-date while an unselected bundled skill is absent", async () => {
@@ -323,9 +367,14 @@ describe("custom skill selection", () => {
const status = await installSkills(sandbox.targets, only("paseo"));
expect(status.state).toBe("up-to-date");
expect(await installedIn(sandbox.targets, "paseo")).toEqual([true, true, false]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-advisor")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo")).toEqual([true, true, false, true]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([false, false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-advisor")).toEqual([
false,
false,
false,
false,
]);
});
it("reports a delete op for a deselected skill before it is applied", async () => {
@@ -339,12 +388,21 @@ describe("custom skill selection", () => {
it("leaves unrelated user skills untouched", async () => {
await writeOnDiskSkill(sandbox.targets.agentsDir, "unslop", { "SKILL.md": "user-unslop" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "custom-agy", {
"SKILL.md": "user-agy",
});
await installSkills(sandbox.targets, only("paseo"));
expect(
await fs.readFile(path.join(sandbox.targets.agentsDir, "unslop", "SKILL.md"), "utf-8"),
).toBe("user-unslop");
expect(
await fs.readFile(
path.join(sandbox.targets.antigravityDir, "custom-agy", "SKILL.md"),
"utf-8",
),
).toBe("user-agy");
});
it("treats an empty custom selection as no managed skills installed", async () => {
@@ -358,8 +416,8 @@ describe("custom skill selection", () => {
available: ["paseo", "paseo-advisor", "paseo-loop"],
installed: [],
});
expect(await installedIn(sandbox.targets, "paseo")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo")).toEqual([false, false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-loop")).toEqual([false, false, false, false]);
});
it("ignores selected names that the bundle does not ship", async () => {
@@ -371,7 +429,7 @@ describe("custom skill selection", () => {
available: ["paseo", "paseo-advisor", "paseo-loop"],
installed: ["paseo"],
});
expect(await installedIn(sandbox.targets, "not-a-skill")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "not-a-skill")).toEqual([false, false, false, false]);
});
it("still deletes legacy skill names that are not selectable", async () => {
@@ -381,7 +439,12 @@ describe("custom skill selection", () => {
await installSkills(sandbox.targets, only("paseo"));
expect(await installedIn(sandbox.targets, "paseo-orchestrator")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-orchestrator")).toEqual([
false,
false,
false,
false,
]);
});
});
@@ -396,9 +459,12 @@ describe("installSkills / updateSkills", () => {
await fs.rm(sandbox.root, { recursive: true, force: true });
});
it("installs into shared and Claude roots without duplicating Codex discovery", async () => {
it("installs into shared, Claude, and Antigravity roots without duplicating Codex discovery", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await writeOnDiskSkill(sandbox.targets.agentsDir, "unslop", { "SKILL.md": "user-unslop" });
await writeOnDiskSkill(sandbox.targets.antigravityDir, "custom-agy", {
"SKILL.md": "user-agy",
});
const status = await installSkills(sandbox.targets, ALL_SKILLS);
@@ -409,15 +475,25 @@ describe("installSkills / updateSkills", () => {
installed: ["paseo", "paseo-loop"],
});
for (const name of ["paseo", "paseo-loop"]) {
const expected = name === "paseo" ? "paseo-v1" : "loop-v1";
expect(
await fs.readFile(path.join(sandbox.targets.agentsDir, name, "SKILL.md"), "utf-8"),
).toBe(name === "paseo" ? "paseo-v1" : "loop-v1");
).toBe(expected);
expect(await pathExists(path.join(sandbox.targets.codexDir, name, "SKILL.md"))).toBe(false);
expect(await pathExists(path.join(sandbox.targets.claudeDir, name))).toBe(true);
expect(
await fs.readFile(path.join(sandbox.targets.antigravityDir, name, "SKILL.md"), "utf-8"),
).toBe(expected);
}
expect(
await fs.readFile(path.join(sandbox.targets.agentsDir, "unslop", "SKILL.md"), "utf-8"),
).toBe("user-unslop");
expect(
await fs.readFile(
path.join(sandbox.targets.antigravityDir, "custom-agy", "SKILL.md"),
"utf-8",
),
).toBe("user-agy");
});
it("retires unchanged managed Codex copies while preserving personal files", async () => {
@@ -469,14 +545,23 @@ describe("installSkills / updateSkills", () => {
});
it.each([
{ alias: "codex", target: "agents" },
{ alias: "codex", target: "claude" },
{ alias: "claude", target: "codex" },
{ alias: "codex", target: "agents", expected: [true, true, true, true] },
{ alias: "codex", target: "claude", expected: [true, true, true, true] },
{ alias: "claude", target: "codex", expected: [true, true, true, true] },
{ alias: "codex", target: "antigravity", expected: [true, true, true, true] },
{ alias: "antigravity", target: "codex", expected: [true, true, true, true] },
{ alias: "antigravity", target: "agents", expected: [true, true, false, true] },
{ alias: "antigravity", target: "claude", expected: [true, true, false, true] },
] as const)(
"keeps installed skills when the $alias root links to the $target root",
async ({ alias, target }) => {
async ({ alias, target, expected }) => {
await writeCurrentBundle(sandbox.targets.sourceDir);
const rootOf = { agents: "agentsDir", claude: "claudeDir", codex: "codexDir" } as const;
const rootOf = {
agents: "agentsDir",
claude: "claudeDir",
codex: "codexDir",
antigravity: "antigravityDir",
} as const;
const aliasRoot = sandbox.targets[rootOf[alias]];
const targetRoot = sandbox.targets[rootOf[target]];
await fs.mkdir(targetRoot, { recursive: true });
@@ -488,12 +573,36 @@ describe("installSkills / updateSkills", () => {
expect(installed.state).toBe("up-to-date");
expect(updated.state).toBe("up-to-date");
expect((await fs.lstat(aliasRoot)).isSymbolicLink()).toBe(true);
for (const name of ["paseo", "paseo-loop"]) {
expect(await installedIn(sandbox.targets, name)).toEqual([true, true, true]);
expect(await installedIn(sandbox.targets, name)).toEqual([...expected]);
}
},
);
it("keeps an installed skill when its Antigravity directory links to the shared copy", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await fs.mkdir(path.join(sandbox.targets.agentsDir, "paseo"), { recursive: true });
await fs.mkdir(sandbox.targets.antigravityDir, { recursive: true });
await fs.symlink(
path.join(sandbox.targets.agentsDir, "paseo"),
path.join(sandbox.targets.antigravityDir, "paseo"),
"dir",
);
const installed = await installSkills(sandbox.targets, ALL_SKILLS);
const updated = await autoUpdateInstalledSkills(sandbox.targets, ALL_SKILLS);
expect(installed.state).toBe("up-to-date");
expect(updated.state).toBe("up-to-date");
expect(
(await fs.lstat(path.join(sandbox.targets.antigravityDir, "paseo"))).isSymbolicLink(),
).toBe(true);
expect(
await fs.readFile(path.join(sandbox.targets.antigravityDir, "paseo", "SKILL.md"), "utf8"),
).toBe("paseo-v1");
});
it("keeps an installed skill when its Codex directory links to the shared copy", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await fs.mkdir(path.join(sandbox.targets.agentsDir, "paseo"), { recursive: true });
@@ -604,6 +713,15 @@ describe("installSkills / updateSkills", () => {
expect(
await fs.readFile(path.join(sandbox.targets.claudeDir, "paseo-loop", "SKILL.md"), "utf-8"),
).toBe("loop-v1");
expect(
await fs.readFile(path.join(sandbox.targets.antigravityDir, "paseo", "SKILL.md"), "utf-8"),
).toBe("paseo-v1");
expect(
await fs.readFile(
path.join(sandbox.targets.antigravityDir, "paseo-loop", "SKILL.md"),
"utf-8",
),
).toBe("loop-v1");
});
it("auto-updates drifted installed skills", async () => {
@@ -626,6 +744,9 @@ describe("installSkills / updateSkills", () => {
"utf-8",
),
).toBe("user guard");
expect(
await fs.readFile(path.join(sandbox.targets.antigravityDir, "paseo", "SKILL.md"), "utf-8"),
).toBe("paseo-v1");
});
it("does not auto-install skills on a clean machine", async () => {
@@ -642,7 +763,7 @@ describe("installSkills / updateSkills", () => {
available: ["paseo", "paseo-loop"],
installed: [],
});
expect(await installedIn(sandbox.targets, "paseo")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo")).toEqual([false, false, false, false]);
});
it("is idempotent — running install twice keeps state at up-to-date", async () => {
@@ -667,24 +788,51 @@ describe("uninstallSkills", () => {
await fs.rm(sandbox.root, { recursive: true, force: true });
});
it("removes every Paseo skill from all three targets and preserves user dirs", async () => {
it("removes every Paseo skill from all targets and preserves user dirs and symlinks", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
await installSkills(sandbox.targets, ALL_SKILLS);
for (const name of ["unslop", "tdd", "devbox"]) {
await writeOnDiskSkill(sandbox.targets.agentsDir, name, { "SKILL.md": `user-${name}` });
}
await writeOnDiskSkill(sandbox.targets.antigravityDir, "user-agy-skill", {
"SKILL.md": "user-agy",
});
const linkedSource = path.join(sandbox.root, "external-user-skill");
await writeFiles(linkedSource, { "SKILL.md": "linked-user-skill" });
await fs.symlink(
linkedSource,
path.join(sandbox.targets.antigravityDir, "linked-user-skill"),
"dir",
);
const status = await uninstallSkills(sandbox.targets, ALL_SKILLS);
expect(status.state).toBe("not-installed");
for (const name of ["paseo", "paseo-loop", ...LEGACY_SKILL_NAMES]) {
expect(await installedIn(sandbox.targets, name)).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, name)).toEqual([false, false, false, false]);
}
for (const name of ["unslop", "tdd", "devbox"]) {
expect(
await fs.readFile(path.join(sandbox.targets.agentsDir, name, "SKILL.md"), "utf-8"),
).toBe(`user-${name}`);
}
expect(
await fs.readFile(
path.join(sandbox.targets.antigravityDir, "user-agy-skill", "SKILL.md"),
"utf-8",
),
).toBe("user-agy");
expect(
(
await fs.lstat(path.join(sandbox.targets.antigravityDir, "linked-user-skill"))
).isSymbolicLink(),
).toBe(true);
expect(
await fs.readFile(
path.join(sandbox.targets.antigravityDir, "linked-user-skill", "SKILL.md"),
"utf-8",
),
).toBe("linked-user-skill");
});
it("is a no-op when nothing is installed", async () => {
@@ -695,12 +843,13 @@ describe("uninstallSkills", () => {
expect(status.state).toBe("not-installed");
});
it("cleans up legacy skill names that linger in agents, claude, and codex", async () => {
it("cleans up legacy skill names that linger in agents, claude, codex, and antigravity", async () => {
await writeCurrentBundle(sandbox.targets.sourceDir);
for (const dir of [
sandbox.targets.agentsDir,
sandbox.targets.claudeDir,
sandbox.targets.codexDir,
sandbox.targets.antigravityDir,
]) {
await writeOnDiskSkill(dir, "paseo-chat", { "SKILL.md": "chat-old" });
}
@@ -708,6 +857,6 @@ describe("uninstallSkills", () => {
const status = await uninstallSkills(sandbox.targets, ALL_SKILLS);
expect(status.state).toBe("not-installed");
expect(await installedIn(sandbox.targets, "paseo-chat")).toEqual([false, false, false]);
expect(await installedIn(sandbox.targets, "paseo-chat")).toEqual([false, false, false, false]);
});
});
@@ -38,6 +38,7 @@ export interface SkillTargets {
agentsDir: string;
claudeDir: string;
codexDir: string;
antigravityDir: string;
}
// Names the bundle used to ship. They are never selectable, but every scan still
@@ -163,13 +164,14 @@ export async function getSkillsStatus(
): Promise<SkillsStatus> {
const available = await listBundledSkills(targets.sourceDir);
const names = managedSkillNames(available);
const [bundle, agentsDisk, claudeDisk, codexDisk] = await Promise.all([
const [bundle, agentsDisk, claudeDisk, codexDisk, antigravityDisk] = await Promise.all([
hashSkills(targets.sourceDir, available),
hashSkills(targets.agentsDir, names),
hashSkills(targets.claudeDir, names),
hashSkills(targets.codexDir, names),
hashSkills(targets.antigravityDir, names),
]);
const disks = [agentsDisk, claudeDisk];
const disks = [agentsDisk, claudeDisk, antigravityDisk];
const desired = resolveDesiredSkills(selection, available);
const ops = diff(bundle, disks, names, desired);
for (const name of codexDisk.keys()) {
@@ -206,6 +208,7 @@ async function applySkills(
agentsDir: targets.agentsDir,
claudeDir: targets.claudeDir,
codexDir: targets.codexDir,
antigravityDir: targets.antigravityDir,
skillNames: writes,
});
}
@@ -216,6 +219,7 @@ async function applySkills(
agentsDir: targets.agentsDir,
claudeDir: targets.claudeDir,
codexDir: targets.codexDir,
antigravityDir: targets.antigravityDir,
});
}
@@ -264,6 +268,7 @@ export async function uninstallSkills(
agentsDir: targets.agentsDir,
claudeDir: targets.claudeDir,
codexDir: targets.codexDir,
antigravityDir: targets.antigravityDir,
});
}
return getSkillsStatus(targets, selection);
@@ -48,6 +48,7 @@ describe("orchestration skill paths", () => {
agentsDir: path.join(home, ".agents", "skills"),
claudeDir: path.join(home, ".claude", "skills"),
codexDir: path.join(home, ".codex", "skills"),
antigravityDir: path.join(home, ".gemini", "config", "skills"),
});
});
});
@@ -20,5 +20,6 @@ export function resolveSkillTargets(home: string = os.homedir()): SkillTargets {
agentsDir: path.join(home, ".agents", "skills"),
claudeDir: path.join(home, ".claude", "skills"),
codexDir: path.join(home, ".codex", "skills"),
antigravityDir: path.join(home, ".gemini", "config", "skills"),
};
}
@@ -10,6 +10,7 @@ interface Sandbox {
agentsDir: string;
claudeDir: string;
codexDir: string;
antigravityDir: string;
}
async function makeSandbox(): Promise<Sandbox> {
@@ -18,8 +19,9 @@ async function makeSandbox(): Promise<Sandbox> {
const agentsDir = path.join(root, "home", ".agents", "skills");
const claudeDir = path.join(root, "home", ".claude", "skills");
const codexDir = path.join(root, "home", ".codex", "skills");
const antigravityDir = path.join(root, "home", ".gemini", "config", "skills");
await fs.mkdir(sourceDir, { recursive: true });
return { root, sourceDir, agentsDir, claudeDir, codexDir };
return { root, sourceDir, agentsDir, claudeDir, codexDir, antigravityDir };
}
async function writeBundleSkill(
@@ -60,6 +62,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
@@ -75,6 +78,11 @@ describe("syncSkills", () => {
"utf-8",
);
expect(claudeContent).toBe("new paseo content");
const antigravityContent = await fs.readFile(
path.join(sandbox.antigravityDir, "paseo", "SKILL.md"),
"utf-8",
);
expect(antigravityContent).toBe("new paseo content");
await expect(fs.stat(path.join(sandbox.codexDir, "paseo", "SKILL.md"))).rejects.toMatchObject({
code: "ENOENT",
});
@@ -91,6 +99,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo-committee"],
});
@@ -115,6 +124,15 @@ describe("syncSkills", () => {
expect(await fs.readFile(path.join(claudeSkillDir, "references", "roles.md"), "utf-8")).toBe(
"roles content",
);
const antigravitySkillDir = path.join(sandbox.antigravityDir, "paseo-committee");
expect((await fs.lstat(antigravitySkillDir)).isDirectory()).toBe(true);
expect(await fs.readFile(path.join(antigravitySkillDir, "SKILL.md"), "utf-8")).toBe(
"committee content",
);
expect(
await fs.readFile(path.join(antigravitySkillDir, "references", "roles.md"), "utf-8"),
).toBe("roles content");
});
it("leaves on-disk skills not in the bundle untouched", async () => {
@@ -122,16 +140,23 @@ describe("syncSkills", () => {
const customSkill = path.join(sandbox.agentsDir, "user-custom-skill");
await fs.mkdir(customSkill, { recursive: true });
await fs.writeFile(path.join(customSkill, "SKILL.md"), "user content");
const antigravityCustomSkill = path.join(sandbox.antigravityDir, "user-antigravity-skill");
await fs.mkdir(antigravityCustomSkill, { recursive: true });
await fs.writeFile(path.join(antigravityCustomSkill, "SKILL.md"), "antigravity user content");
await syncSkills({
sourceDir: sandbox.sourceDir,
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
expect(await fs.readFile(path.join(customSkill, "SKILL.md"), "utf-8")).toBe("user content");
expect(await fs.readFile(path.join(antigravityCustomSkill, "SKILL.md"), "utf-8")).toBe(
"antigravity user content",
);
});
it("removes stale files previously written to managed skill dirs", async () => {
@@ -146,6 +171,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
@@ -157,12 +183,19 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
expect(await fs.readFile(path.join(onDiskSkill, "SKILL.md"), "utf-8")).toBe("new");
await expect(fs.access(path.join(onDiskSkill, "references", "stale.md"))).rejects.toThrow();
await expect(fs.access(path.join(onDiskSkill, "references"))).rejects.toThrow();
const antigravitySkill = path.join(sandbox.antigravityDir, "paseo");
expect(await fs.readFile(path.join(antigravitySkill, "SKILL.md"), "utf-8")).toBe("new");
await expect(
fs.access(path.join(antigravitySkill, "references", "stale.md")),
).rejects.toThrow();
await expect(fs.access(path.join(antigravitySkill, "references"))).rejects.toThrow();
});
it("preserves user-added files in managed skill dirs", async () => {
@@ -172,12 +205,17 @@ describe("syncSkills", () => {
await fs.writeFile(path.join(onDiskSkill, "SKILL.md"), "old");
await fs.writeFile(path.join(onDiskSkill, "my-context.md"), "user context");
await fs.writeFile(path.join(onDiskSkill, "references", "notes.md"), "user notes");
const antigravitySkill = path.join(sandbox.antigravityDir, "paseo");
await fs.mkdir(path.join(antigravitySkill, "references"), { recursive: true });
await fs.writeFile(path.join(antigravitySkill, "SKILL.md"), "old");
await fs.writeFile(path.join(antigravitySkill, "my-context.md"), "antigravity user context");
await syncSkills({
sourceDir: sandbox.sourceDir,
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
@@ -188,6 +226,10 @@ describe("syncSkills", () => {
expect(await fs.readFile(path.join(onDiskSkill, "references", "notes.md"), "utf-8")).toBe(
"user notes",
);
expect(await fs.readFile(path.join(antigravitySkill, "SKILL.md"), "utf-8")).toBe("new");
expect(await fs.readFile(path.join(antigravitySkill, "my-context.md"), "utf-8")).toBe(
"antigravity user context",
);
});
it.skipIf(process.platform === "win32")(
@@ -211,6 +253,41 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
}),
).rejects.toThrow("Cannot sync through symbolic link");
expect(await fs.readFile(path.join(onDiskSkill, "SKILL.md"), "utf-8")).toBe("old skill");
expect(await fs.readFile(path.join(externalReferences, "guide.md"), "utf-8")).toBe(
"external guide",
);
expect((await fs.lstat(path.join(onDiskSkill, "references"))).isSymbolicLink()).toBe(true);
},
);
it.skipIf(process.platform === "win32")(
"rejects managed paths that would write through a symlink in Antigravity",
async () => {
await writeBundleSkill(sandbox.sourceDir, "paseo", {
"SKILL.md": "new skill",
"references/guide.md": "new guide",
});
const onDiskSkill = path.join(sandbox.antigravityDir, "paseo");
const externalReferences = path.join(sandbox.root, "external-antigravity-references");
await fs.mkdir(onDiskSkill, { recursive: true });
await fs.mkdir(externalReferences, { recursive: true });
await fs.writeFile(path.join(onDiskSkill, "SKILL.md"), "old skill");
await fs.writeFile(path.join(externalReferences, "guide.md"), "external guide");
await fs.symlink(externalReferences, path.join(onDiskSkill, "references"), "dir");
await expect(
syncSkills({
sourceDir: sandbox.sourceDir,
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
}),
).rejects.toThrow("Cannot sync through symbolic link");
@@ -234,6 +311,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
expect(first.changedFiles).toBeGreaterThan(0);
@@ -243,6 +321,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
expect(second.changedFiles).toBe(0);
@@ -258,6 +337,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo", "paseo-removed"],
onSkillError: (name, error) => errors.push({ name, error }),
});
@@ -281,6 +361,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo", "paseo-deprecated"],
});
@@ -296,6 +377,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
onSkillError: (skillName) => errors.push(skillName),
});
@@ -316,6 +398,7 @@ describe("syncSkills", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
onSkillError: (skillName) => errors.push(skillName),
});
@@ -336,13 +419,14 @@ describe("removeSkill", () => {
await fs.rm(sandbox.root, { recursive: true, force: true });
});
it("removes the skill from all three targets when present", async () => {
it("removes the skill from all targets when present", async () => {
await writeBundleSkill(sandbox.sourceDir, "paseo", { "SKILL.md": "content" });
await syncSkills({
sourceDir: sandbox.sourceDir,
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
skillNames: ["paseo"],
});
@@ -350,11 +434,13 @@ describe("removeSkill", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
});
await expect(fs.access(path.join(sandbox.agentsDir, "paseo"))).rejects.toThrow();
await expect(fs.access(path.join(sandbox.claudeDir, "paseo"))).rejects.toThrow();
await expect(fs.access(path.join(sandbox.codexDir, "paseo"))).rejects.toThrow();
await expect(fs.access(path.join(sandbox.antigravityDir, "paseo"))).rejects.toThrow();
});
it("does not throw when targets are missing", async () => {
@@ -363,6 +449,7 @@ describe("removeSkill", () => {
agentsDir: sandbox.agentsDir,
claudeDir: sandbox.claudeDir,
codexDir: sandbox.codexDir,
antigravityDir: sandbox.antigravityDir,
}),
).resolves.toBeUndefined();
});
@@ -7,6 +7,7 @@ export interface SkillSyncOptions {
agentsDir: string;
claudeDir: string;
codexDir: string;
antigravityDir: string;
skillNames: readonly string[];
onSkillError?: (skillName: string, error: unknown) => void;
}
@@ -174,6 +175,7 @@ export interface RemoveSkillTargets {
agentsDir: string;
claudeDir: string;
codexDir: string;
antigravityDir: string;
}
export async function removeSkill(skillName: string, targets: RemoveSkillTargets): Promise<void> {
@@ -181,6 +183,7 @@ export async function removeSkill(skillName: string, targets: RemoveSkillTargets
path.join(targets.agentsDir, skillName),
path.join(targets.claudeDir, skillName),
path.join(targets.codexDir, skillName),
path.join(targets.antigravityDir, skillName),
];
for (const p of paths) {
await fs.rm(p, { recursive: true, force: true });
@@ -194,7 +197,7 @@ async function isSameDirectory(a: string, b: string): Promise<boolean> {
/**
* Codex also discovers .agents/skills, so its dedicated copy is a leftover. When
* the Codex skill directory resolves to the shared or Claude copy, it is that
* the Codex skill directory resolves to an active install target, it is that
* copy, and retiring it would delete the install.
*/
export async function isLegacyCodexCopy(
@@ -202,7 +205,7 @@ export async function isLegacyCodexCopy(
targets: RemoveSkillTargets,
): Promise<boolean> {
const codexSkillDir = path.join(targets.codexDir, skillName);
for (const root of [targets.agentsDir, targets.claudeDir]) {
for (const root of [targets.agentsDir, targets.claudeDir, targets.antigravityDir]) {
if (await isSameDirectory(codexSkillDir, path.join(root, skillName))) return false;
}
return true;
@@ -252,6 +255,11 @@ export async function syncSkills(options: SkillSyncOptions): Promise<SkillSyncRe
path.join(options.claudeDir, skillName),
);
changedFiles += await syncDirectoryFiles(
bundleSkillDir,
path.join(options.antigravityDir, skillName),
);
// Retain user edits to the old dedicated Codex copy.
if (await isLegacyCodexCopy(skillName, options)) {
changedFiles += await retireManagedSkill(path.join(options.codexDir, skillName));
@@ -128,13 +128,17 @@ function selectionsEqual(left: SkillSelection, right: SkillSelection): boolean {
);
}
function skillRoots(targets: SkillTargets): string[] {
return [targets.agentsDir, targets.claudeDir, targets.codexDir, targets.antigravityDir];
}
async function validateEntries(
targets: SkillTargets,
transactionDir: string,
entries: CapturedDirectory[],
): Promise<boolean> {
const names = new Set(await listManagedSkillNames(targets.sourceDir));
const roots = [targets.agentsDir, targets.claudeDir, targets.codexDir];
const roots = skillRoots(targets);
return entries.every((entry) => {
const rootIndex = roots.findIndex((root) => path.dirname(entry.livePath) === root);
if (rootIndex === -1) return false;
@@ -441,11 +445,7 @@ async function restore(
}
function transactionParents(targets: SkillTargets): string[] {
return [
...new Set(
[targets.agentsDir, targets.claudeDir, targets.codexDir].map((root) => path.dirname(root)),
),
];
return [...new Set(skillRoots(targets).map((root) => path.dirname(root)))];
}
/**
@@ -493,7 +493,7 @@ export async function beginSkillsTransaction(
nextSelection: SkillSelection,
ops: readonly SkillOp[],
): Promise<SkillsTransaction> {
const roots = [targets.agentsDir, targets.claudeDir, targets.codexDir];
const roots = skillRoots(targets);
const seenRoots = new Set<string>();
const uniqueRoots: Array<{ root: string; rootIndex: number }> = [];
for (const [rootIndex, root] of roots.entries()) {