Skip to content
Merged
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
9 changes: 9 additions & 0 deletions extensions/claude-code/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
9 changes: 9 additions & 0 deletions extensions/cursor-cli/home-manager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions src/rootcell/rootcell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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", () => {
Expand Down