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
6 changes: 6 additions & 0 deletions src/services/skills-installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ export const TARGET_CONFIGS: Record<string, TargetConfig> = {
// Codeium's per-user config tree (memories, global_workflows).
relativeDir: path.join(".codeium", "windsurf", "skills"),
},
zed: {
name: "Zed",
// Per zed.dev/docs/ai/skills, Zed's agent loads user-level Agent Skills
// from ~/.agents/skills/ (project-level lives at <worktree>/.agents/skills/).
relativeDir: path.join(".agents", "skills"),
},
};

/**
Expand Down
16 changes: 16 additions & 0 deletions src/services/tool-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ const TOOL_CHECKS: ToolCheck[] = [
winPaths: [path.join(localAppData, "Programs", "Windsurf", "Windsurf.exe")],
configDirs: [path.join(home, ".windsurf")],
},
{
id: "zed",
name: "Zed",
installMethod: InstallMethod.FileCopy,
cliNames: ["zed"],
macApps: ["/Applications/Zed.app"],
// Zed's Linux install script unpacks to ~/.local/zed.app and links a `zed`
// launcher into ~/.local/bin; package builds land in /usr/{bin,lib}.
linuxPaths: [
path.join(home, ".local", "zed.app"),
"/usr/bin/zed",
"/usr/lib/zed",
],
winPaths: [path.join(localAppData, "Programs", "Zed", "Zed.exe")],
configDirs: [path.join(home, ".config", "zed")],
},
];

function checkCli(name: string): Promise<string | null> {
Expand Down
7 changes: 7 additions & 0 deletions test/unit/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const ALL_UNDETECTED: DetectedTool[] = [
evidence: "",
installMethod: InstallMethod.FileCopy,
},
{
id: "zed",
name: "Zed",
detected: false,
evidence: "",
installMethod: InstallMethod.FileCopy,
},
];

async function buildSkillsTarball(...names: string[]): Promise<Buffer> {
Expand Down
8 changes: 8 additions & 0 deletions test/unit/commands/skills/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const ALL_UNDETECTED: DetectedTool[] = [
evidence: "",
installMethod: InstallMethod.FileCopy,
},
{
id: "zed",
name: "Zed",
detected: false,
evidence: "",
installMethod: InstallMethod.FileCopy,
},
];

async function buildSkillsTarball(...names: string[]): Promise<Buffer> {
Expand Down Expand Up @@ -237,6 +244,7 @@ describe("skills:install command", () => {
expect(stdout).toContain("auto");
expect(stdout).toContain("vscode");
expect(stdout).toContain("windsurf");
expect(stdout).toContain("zed");
});
});

Expand Down
6 changes: 3 additions & 3 deletions test/unit/services/skills-installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ describe("SkillsInstaller", () => {
const { results } = installer.install({
skills,

targets: ["claude-code", "cursor", "vscode"],
targets: ["claude-code", "cursor", "vscode", "zed"],
});

expect(results).toHaveLength(3);
expect(results).toHaveLength(4);

for (const target of [".claude", ".cursor", ".copilot"]) {
for (const target of [".claude", ".cursor", ".copilot", ".agents"]) {
expect(
fs.existsSync(
path.join(
Expand Down
25 changes: 25 additions & 0 deletions test/unit/services/tool-detector.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
import { execFile } from "node:child_process";
import fs from "node:fs";
import path from "node:path";

vi.mock("node:child_process", () => ({
execFile: vi.fn(),
Expand Down Expand Up @@ -106,6 +107,30 @@ describe("tool-detector", () => {
expect(cursor!.installMethod).toBe("file-copy");
});

it("should detect Zed via its config directory", async () => {
mockedExecFile.mockImplementation(
(_cmd: unknown, _args: unknown, _opts: unknown, cb: unknown) => {
(cb as (err: Error | null, stdout: string) => void)(
new Error("not found"),
"",
);
return undefined as never;
},
);

mockedExistsSync.mockImplementation((p: fs.PathLike) =>
String(p).includes(path.join(".config", "zed")),
);

const results = await detectTools();
const zed = results.find((t) => t.id === "zed");

expect(zed).toBeDefined();
expect(zed!.detected).toBe(true);
expect(zed!.evidence).toMatch(/^config:/);
expect(zed!.installMethod).toBe("file-copy");
});

it("should detect multiple tools simultaneously", async () => {
mockedExecFile.mockImplementation(
(_cmd: unknown, args: unknown, _opts: unknown, cb: unknown) => {
Expand Down
Loading