diff --git a/extensions/claude-code/home-manager.nix b/extensions/claude-code/home-manager.nix index e8af30a..11523e4 100644 --- a/extensions/claude-code/home-manager.nix +++ b/extensions/claude-code/home-manager.nix @@ -5,6 +5,15 @@ pkgs.claude-code ]; + home.file.".claude/skills/add-flake-dep" = { + source = ../../pi/agent/skills/add-flake-dep; + recursive = true; + }; + home.file.".claude/skills/network-allowlist" = { + source = ../../pi/agent/skills/network-allowlist; + recursive = true; + }; + home.sessionVariables = { CLAUDE_CODE_USE_BEDROCK = "1"; ANTHROPIC_MODEL = "us.anthropic.claude-sonnet-4-6"; diff --git a/extensions/cursor-cli/home-manager.nix b/extensions/cursor-cli/home-manager.nix index f8ac936..5d5f056 100644 --- a/extensions/cursor-cli/home-manager.nix +++ b/extensions/cursor-cli/home-manager.nix @@ -5,6 +5,15 @@ pkgs.cursor-cli ]; + home.file.".cursor/skills-cursor/add-flake-dep" = { + source = ../../pi/agent/skills/add-flake-dep; + recursive = true; + }; + home.file.".cursor/skills-cursor/network-allowlist" = { + source = ../../pi/agent/skills/network-allowlist; + recursive = true; + }; + home.activation.cursorCliHttp1ForAgent = lib.hm.dag.entryAfter [ "writeBoundary" ] '' config="$HOME/.cursor/cli-config.json" tmp="$config.tmp" diff --git a/src/rootcell/rootcell.test.ts b/src/rootcell/rootcell.test.ts index 622ead1..059ad4c 100644 --- a/src/rootcell/rootcell.test.ts +++ b/src/rootcell/rootcell.test.ts @@ -147,6 +147,16 @@ describe("rootcell extension registry", () => { expect(claudeCode?.hostCommands).toEqual(expect.schemaMatching(EmptyStringArraySchema)); }); + test("Claude Code extension installs bundled Rootcell skills", () => { + const module = readFileSync(join("extensions", "claude-code", "home-manager.nix"), "utf8"); + + expect(module).toContain('home.file.".claude/skills/add-flake-dep"'); + expect(module).toContain('home.file.".claude/skills/network-allowlist"'); + expect(module).toContain("source = ../../pi/agent/skills/add-flake-dep;"); + expect(module).toContain("source = ../../pi/agent/skills/network-allowlist;"); + expect(module.match(/recursive = true;/g)).toHaveLength(2); + }); + test("registers Cursor CLI package install hook", () => { const cursor = ROOTCELL_EXTENSIONS.find((extension) => extension.id === "cursor-cli"); @@ -155,6 +165,16 @@ describe("rootcell extension registry", () => { expect(cursor?.guestHooks.firewallNixos).toEqual(expect.schemaMatching(EmptyStringArraySchema)); expect(cursor?.hostCommands).toEqual(expect.schemaMatching(EmptyStringArraySchema)); }); + + test("Cursor CLI extension installs bundled Rootcell skills", () => { + const module = readFileSync(join("extensions", "cursor-cli", "home-manager.nix"), "utf8"); + + expect(module).toContain('home.file.".cursor/skills-cursor/add-flake-dep"'); + expect(module).toContain('home.file.".cursor/skills-cursor/network-allowlist"'); + expect(module).toContain("source = ../../pi/agent/skills/add-flake-dep;"); + expect(module).toContain("source = ../../pi/agent/skills/network-allowlist;"); + expect(module.match(/recursive = true;/g)).toHaveLength(2); + }); }); describe("rootcell argument parsing", () => {