From 722e14b8b61830fe8b206d53f27e55555384c4ff Mon Sep 17 00:00:00 2001 From: Taissa Conde Date: Mon, 16 Mar 2026 20:58:28 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20audit=20consistency=20=E2=80=94=20missin?= =?UTF-8?q?g=20skills,=20remove=20windsurf/cline,=20fix=20refs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add browser and screen-capture SKILL.md to plugins/ai-memory/skills/ - Comment out windsurf and cline from adapters, environment, tool-inspect (not tested, no INSTALL.md — will re-add when onboarded) - Add copilot to environment-specs.json (detect .github/copilot-instructions.md) - Fix ANTIGRAVITY.md reference → antigravity-agent-setup.md in capability-specs - Move hardcoded Claude Code hook message to adapter postInstallNote field - Remove unused aiDir variable in docs-lint command - Update tool list in CLI output and MCP tool descriptions Co-Authored-By: Claude Opus 4.6 (1M context) --- plugins/ai-memory/skills/browser/SKILL.md | 27 +++++++++++++++++ .../ai-memory/skills/screen-capture/SKILL.md | 25 ++++++++++++++++ src/cli/adapters.ts | 27 ++++++++--------- src/cli/environment.ts | 9 ++++-- src/cli/index.ts | 29 +++++++++++-------- src/mcp-server/tools/index.ts | 2 +- src/mcp-server/tools/tool-inspect.ts | 24 +++++++-------- templates/.ai/reference/capability-specs.json | 28 ++++++++++++++++++ .../.ai/reference/environment-specs.json | 24 +++++++++++++++ 9 files changed, 154 insertions(+), 41 deletions(-) create mode 100644 plugins/ai-memory/skills/browser/SKILL.md create mode 100644 plugins/ai-memory/skills/screen-capture/SKILL.md create mode 100644 templates/.ai/reference/capability-specs.json create mode 100644 templates/.ai/reference/environment-specs.json diff --git a/plugins/ai-memory/skills/browser/SKILL.md b/plugins/ai-memory/skills/browser/SKILL.md new file mode 100644 index 0000000..187f802 --- /dev/null +++ b/plugins/ai-memory/skills/browser/SKILL.md @@ -0,0 +1,27 @@ +--- +name: browser +description: Use browser automation (screenshots, navigate, interact). Requires browser MCP. +type: skill +status: active +requires: + capabilities: [browser] + permission: read # read | edit | write — only request what the task needs +--- + +# browser — Browser Automation Skill + +## When to use + +- Take screenshots of web pages +- Navigate, fill forms, click elements +- Verify visual changes or UI state + +## Setup + +Ensure browser capability is enabled for your environment. See `.ai/reference/capability-specs.json` or run `ai-memory install --capability browser` when available. + +## Usage patterns + +- **Failures** → write to `debugging.md` via `commit_memory` with symptom, screenshot path, root cause +- **Screenshots** → reference path in memory entries; include URL and viewport +- **Visual regression** → `search_memory` for known changes; create debugging entry if unexpected diff --git a/plugins/ai-memory/skills/screen-capture/SKILL.md b/plugins/ai-memory/skills/screen-capture/SKILL.md new file mode 100644 index 0000000..1b74b27 --- /dev/null +++ b/plugins/ai-memory/skills/screen-capture/SKILL.md @@ -0,0 +1,25 @@ +--- +name: screen-capture +description: Capture desktop or app window for vision analysis. Platform-dependent (e.g. Peekaboo on macOS). +type: skill +status: active +requires: + capabilities: [screen_capture] +--- + +# screen-capture — Desktop/App Screenshot Skill + +## When to use + +- Read another app's screen (e.g. IDE, browser window) +- Capture for vision analysis or handoff +- Save to `.ai/temp/` for cross-tool handoff + +## Setup + +See `.ai/reference/capability-specs.json` for platform-specific install (e.g. Peekaboo on macOS). Manual fallback: screenshot to `.ai/temp/screen.png`. + +## Usage + +- Capture → save to `.ai/temp/` → agent reads via file or `get_memory` +- Handoff: write path to `.ai/temp/request-for-*.md` for another agent diff --git a/src/cli/adapters.ts b/src/cli/adapters.ts index 1208ff5..1de056e 100644 --- a/src/cli/adapters.ts +++ b/src/cli/adapters.ts @@ -306,9 +306,7 @@ Only request the permission the task requires. ## Setup -- **Cursor/Claude Code/Windsurf/Cline:** Run \`ai-memory install --capability desktop_automation\` -- **Antigravity:** Add ai-memory-desktop-automation to \`~/.gemini/antigravity/mcp_config.json\` manually. Config: \`{ "command": "uvx", "args": ["--python", "3.13", "computer-control-mcp@latest"] }\` -- **Python 3.14 users:** onnxruntime has no wheels for 3.14 yet. The config pins \`--python 3.13\` so uv uses a compatible version. If you see "No solution found when resolving tool dependencies", ensure uv can access Python 3.13 (\`uv python install 3.13\`). +Run \`ai-memory install --capability desktop_automation\` or see \`.ai/reference/capability-specs.json\` for tool-specific config. ## Usage @@ -440,6 +438,8 @@ export interface ToolAdapter { mcpPath?: string; /** Additional files to write (path relative to project root → content) */ extraFiles?: Record; + /** Message to show after install (tool-specific notes) */ + postInstallNote?: string; } export const TOOL_ADAPTERS: Record = { @@ -460,16 +460,16 @@ export const TOOL_ADAPTERS: Record = { ...skillStubsForDir(".agents/skills"), }, }, - windsurf: { - dest: ".windsurfrules", - content: BOOTSTRAP_INSTRUCTION, - mcp: true, - }, - cline: { - dest: ".clinerules", - content: BOOTSTRAP_INSTRUCTION, - mcp: true, - }, + // windsurf: { + // dest: ".windsurfrules", + // content: BOOTSTRAP_INSTRUCTION, + // mcp: true, + // }, + // cline: { + // dest: ".clinerules", + // content: BOOTSTRAP_INSTRUCTION, + // mcp: true, + // }, copilot: { dest: ".github/copilot-instructions.md", content: `# Copilot Instructions\n\n${BOOTSTRAP_INSTRUCTION}\n\n> Note: GitHub Copilot does not support MCP. Skills must be run by pasting content from \`.ai/skills/\`.\n`, @@ -479,6 +479,7 @@ export const TOOL_ADAPTERS: Record = { dest: "CLAUDE.md", content: `# Claude Code — Project Memory\n\n${BOOTSTRAP_INSTRUCTION}`, mcp: true, + postInstallNote: "Hooks installed: SessionStart (context injection), PreCompact (state preservation)\n Note: Restart Claude Code for hooks to take effect.", extraFiles: { ...skillStubsForDir(".claude/skills"), ".claude/hooks/SessionStart.js": SESSION_START_HOOK, diff --git a/src/cli/environment.ts b/src/cli/environment.ts index 64f0295..b148d07 100644 --- a/src/cli/environment.ts +++ b/src/cli/environment.ts @@ -109,8 +109,8 @@ export function getCapabilityManualInstructions( const ENV_MCP_PATHS: Record = { cursor: ".cursor/mcp.json", "claude-code": ".mcp.json", - windsurf: ".mcp.json", - cline: ".mcp.json", + // windsurf: ".mcp.json", + // cline: ".mcp.json", antigravity: ".mcp.json", // Antigravity uses global config; project path unused for injection }; @@ -158,12 +158,15 @@ function mcpEntryFromCapConfig(capability: string, config: Record | undefined; if (!command) return null; - return { + const entry: Record = { type: "stdio", command, args: args ?? ["-y", "@anthropic-ai/cursor-ide-browser"], }; + if (env && typeof env === "object") entry.env = env; + return entry; } return null; } diff --git a/src/cli/index.ts b/src/cli/index.ts index 456b2df..5e92f14 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -76,7 +76,7 @@ program console.log(` Or manually edit .ai/IDENTITY.md and .ai/PROJECT_STATUS.md.`); console.log(``); console.log(` Connect your tool: npx @radix-ai/ai-memory install --to `); - console.log(` Supported tools: cursor, claude-code, antigravity, windsurf, cline, copilot`); + console.log(` Supported tools: cursor, claude-code, antigravity, copilot`); }); async function scaffoldAiDir(aiDir: string, full: boolean): Promise { @@ -208,9 +208,8 @@ program console.log(`✓ Wrote .ai/skills/${skillName}/SKILL.md (canonical)`); } - if (tool === "claude-code") { - console.log(`\n Hooks installed: SessionStart (context injection), PreCompact (state preservation)`); - console.log(` Note: Restart Claude Code for hooks to take effect.`); + if (adapter.postInstallNote) { + console.log(`\n ${adapter.postInstallNote}`); } if (adapter.mcp) { @@ -267,13 +266,20 @@ program } } + // Post-install steps from tool-specific config (plugins/adapters//INSTALL.md) + const pkgRoot = join(__dirname_cli, "..", ".."); + const toolInstallPath = join(pkgRoot, "plugins", "adapters", tool, "INSTALL.md"); + const genericInstallPath = join(pkgRoot, "plugins", "adapters", "generic", "INSTALL.md"); + const installPath = existsSync(toolInstallPath) ? toolInstallPath : genericInstallPath; + const installContent = existsSync(installPath) ? readFileSync(installPath, "utf-8") : null; + console.log(`\nDone. Before starting:`); - if (tool === "antigravity") { - console.log(` 1. Add ai-memory MCP to ~/.gemini/antigravity/mcp_config.json (Antigravity uses global MCP config)`); - console.log(` 2. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`); - } else if (adapter.mcp) { - console.log(` 1. Enable the ai-memory MCP server in your tool's settings (it's disabled by default)`); - console.log(` 2. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`); + if (installContent) { + const lines = installContent.split("\n").filter((l) => l.trim()); + for (const line of lines) { + if (line.startsWith("#")) continue; // Skip headers + console.log(` ${line.trimStart()}`); + } } else { console.log(` 1. Start a new session and verify with: "What does .ai/IDENTITY.md say about this project?"`); } @@ -462,7 +468,6 @@ program .option("--paths ", "Comma-separated paths to check (default: from git diff --name-only)") .action(async (opts: { dir?: string; paths?: string }) => { const projectRoot = resolve(opts.dir ?? process.cwd()); - const aiDir = join(projectRoot, ".ai"); const { loadDocsSchema, validateDocPlacement } = await import("../docs-schema.js"); const schema = await loadDocsSchema(projectRoot); @@ -605,7 +610,7 @@ program checks.push({ name: "MCP config", status: mcpLocations.length > 0 ? "pass" : "warn", detail: mcpLocations.length > 0 ? mcpLocations.join(", ") : "None found — MCP tools won't be available" }); // 3. Bootstrap installed for at least one tool - const bootstrapMap: Record = { "claude-code": "CLAUDE.md", cursor: ".cursor/rules/00-load-ai-memory.mdc", windsurf: ".windsurfrules", cline: ".clinerules", copilot: ".github/copilot-instructions.md" }; + const bootstrapMap: Record = { "claude-code": "CLAUDE.md", cursor: ".cursor/rules/00-load-ai-memory.mdc", antigravity: ".agents/rules/00-load-ai-memory.md", copilot: ".github/copilot-instructions.md" }; const installed = Object.entries(bootstrapMap).filter(([, p]) => existsSync(join(projectRoot, p))).map(([t]) => t); checks.push({ name: "Bootstrap", status: installed.length > 0 ? "pass" : "warn", detail: installed.length > 0 ? `Installed for: ${installed.join(", ")}` : "None — run `ai-memory install --to `" }); diff --git a/src/mcp-server/tools/index.ts b/src/mcp-server/tools/index.ts index 73c4126..71d6ac5 100644 --- a/src/mcp-server/tools/index.ts +++ b/src/mcp-server/tools/index.ts @@ -251,7 +251,7 @@ export function registerTools(server: Server, aiDir: string): void { inputSchema: { type: "object", properties: { - tool_id: { type: "string", description: "Tool ID (cursor, claude-code, antigravity, windsurf, cline)" }, + tool_id: { type: "string", description: "Tool ID (cursor, claude-code, antigravity)" }, project_root: { type: "string", description: "Project root (default: parent of .ai/)" }, }, required: ["tool_id"], diff --git a/src/mcp-server/tools/tool-inspect.ts b/src/mcp-server/tools/tool-inspect.ts index 56a01fb..af956d9 100644 --- a/src/mcp-server/tools/tool-inspect.ts +++ b/src/mcp-server/tools/tool-inspect.ts @@ -46,18 +46,18 @@ export const TOOL_PATH_MAPPINGS: Record< skillsDir: ".agents/skills", mcpPath: ".mcp.json", }, - windsurf: { - rulesDir: null, - rulesPath: ".windsurfrules", - skillsDir: null, - mcpPath: ".mcp.json", - }, - cline: { - rulesDir: null, - rulesPath: ".clinerules", - skillsDir: null, - mcpPath: ".mcp.json", - }, + // windsurf: { + // rulesDir: null, + // rulesPath: ".windsurfrules", + // skillsDir: null, + // mcpPath: ".mcp.json", + // }, + // cline: { + // rulesDir: null, + // rulesPath: ".clinerules", + // skillsDir: null, + // mcpPath: ".mcp.json", + // }, }; // ─── Internal helpers ───────────────────────────────────────────────────── diff --git a/templates/.ai/reference/capability-specs.json b/templates/.ai/reference/capability-specs.json new file mode 100644 index 0000000..0f63fd3 --- /dev/null +++ b/templates/.ai/reference/capability-specs.json @@ -0,0 +1,28 @@ +{ + "capabilities": { + "browser": { + "description": "Browser automation (screenshots, navigate, interact)", + "environments": { + "cursor": { "native": true }, + "claude-code": { "mcp": { "type": "stdio", "command": "npx", "args": ["-y", "@anthropic-ai/cursor-ide-browser"] } }, + "antigravity": { "manual": "Add browser MCP to your global mcp_config.json. See docs/reference/antigravity-agent-setup.md." } + } + }, + "screen_capture": { + "description": "Desktop/app window screenshot", + "environments": { + "cursor": { "manual": "Platform tools (e.g. Peekaboo on macOS). Fallback: screenshot to .ai/temp/screen.png" }, + "claude-code": { "manual": "Platform tools (e.g. Peekaboo on macOS). Fallback: screenshot to .ai/temp/screen.png" }, + "antigravity": { "manual": "Platform tools (e.g. Peekaboo on macOS). Fallback: screenshot to .ai/temp/screen.png" } + } + }, + "desktop_automation": { + "description": "Desktop UI automation — mouse, keyboard, OCR", + "environments": { + "cursor": { "mcp": { "type": "stdio", "command": "uvx", "args": ["--python", "3.13", "computer-control-mcp@latest"], "env": { "PYTHONIOENCODING": "utf-8" } } }, + "claude-code": { "mcp": { "type": "stdio", "command": "uvx", "args": ["--python", "3.13", "computer-control-mcp@latest"], "env": { "PYTHONIOENCODING": "utf-8" } } }, + "antigravity": { "manual": "Add ai-memory-desktop-automation to %APPDATA%\\antigravity\\mcp_config.json (Windows) or ~/.antigravity/mcp_config.json (macOS/Linux). Config: { \"command\": \"uvx\", \"args\": [\"--python\", \"3.13\", \"computer-control-mcp@latest\"], \"env\": { \"PYTHONIOENCODING\": \"utf-8\" } }. See docs/reference/antigravity-agent-setup.md." } + } + } + } +} diff --git a/templates/.ai/reference/environment-specs.json b/templates/.ai/reference/environment-specs.json new file mode 100644 index 0000000..fefc8aa --- /dev/null +++ b/templates/.ai/reference/environment-specs.json @@ -0,0 +1,24 @@ +{ + "environments": [ + { + "id": "cursor", + "name": "Cursor", + "detect": { "paths": [".cursor/mcp.json", ".cursor/rules"] } + }, + { + "id": "antigravity", + "name": "Antigravity", + "detect": { "paths": [".agents/rules", ".agents/skills"] } + }, + { + "id": "claude-code", + "name": "Claude Code", + "detect": { "paths": [".claude/hooks", "CLAUDE.md"] } + }, + { + "id": "copilot", + "name": "GitHub Copilot", + "detect": { "paths": [".github/copilot-instructions.md"] } + } + ] +}