Turn complex codebases into clear, navigable architecture diagrams with Claude Code.
TypeScript aiarchitectureclaude-codeclaude-code-skillclicodebase-visualizationdeveloper-toolsdiagramsdocumentationmermaid
Fix/cursor skills directory not found (#16)
김승진2fb887a57c68
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 64b834e..b3face1 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -7,7 +7,7 @@{"name": "oh-my-mermaid","description": "Turn complex codebases into clear, navigable architecture diagrams with Mermaid",- "version": "0.1.6",+ "version": "0.1.8","source": "./","category": "development","homepage": "https://github.com/oh-my-mermaid/oh-my-mermaid"diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex a4a411d..75e58fd 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "oh-my-mermaid","description": "Turn complex codebases into clear, navigable architecture diagrams",- "version": "0.1.6",+ "version": "0.1.8","author": {"name": "oh-my-mermaid"},diff --git a/package-lock.json b/package-lock.jsonindex a46f76e..58957f7 100644--- a/package-lock.json+++ b/package-lock.json@@ -1,12 +1,12 @@{"name": "oh-my-mermaid",- "version": "0.1.6",+ "version": "0.1.8","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "oh-my-mermaid",- "version": "0.1.6",+ "version": "0.1.8","license": "MIT","dependencies": {"yaml": "^2.8.3"diff --git a/package.json b/package.jsonindex 21f5fa1..40aefc1 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "oh-my-mermaid",- "version": "0.1.6",+ "version": "0.1.8","description": "Architecture mirror for vibe coding — CLI + Claude Code skills","type": "module","bin": {diff --git a/src/lib/platforms/cursor.ts b/src/lib/platforms/cursor.tsindex 2d389dc..46b8387 100644--- a/src/lib/platforms/cursor.ts+++ b/src/lib/platforms/cursor.ts@@ -2,7 +2,7 @@ import fs from 'node:fs';import path from 'node:path';import { execSync } from 'node:child_process';import type { Platform } from './types.js';-import { getSkillsSource, getPackageVersion } from './utils.js';+import { getSkillsSource, getAgentsSource, getPackageVersion } from './utils.js';const PLUGIN_DIR = '.cursor-plugin';const PLUGIN_FILE = 'plugin.json';@@ -23,6 +23,20 @@ function getInstalledVersion(): string | null {}}+/** Recursively copy a directory */+function copyDirSync(src: string, dest: string): void {+ fs.mkdirSync(dest, { recursive: true });+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {+ const srcPath = path.join(src, entry.name);+ const destPath = path.join(dest, entry.name);+ if (entry.isDirectory()) {+ copyDirSync(srcPath, destPath);+ } else {+ fs.copyFileSync(srcPath, destPath);+ }+ }+}+export const cursor: Platform = {name: 'Cursor',id: 'cursor',@@ -56,7 +70,16 @@ export const cursor: Platform = {const pluginDir = path.join(getCwd(), PLUGIN_DIR);fs.mkdirSync(pluginDir, { recursive: true });- const manifest = {+ // Copy skills into .cursor-plugin/skills/+ const skillsDest = path.join(pluginDir, 'skills');+ if (fs.existsSync(skillsDest)) {+ fs.rmSync(skillsDest, { recursive: true });+ }+ copyDirSync(skillsSource, skillsDest);++ // Copy agents into .cursor-plugin/agents/ (if available)+ const agentsSource = getAgentsSource();+ const manifest: Record<string, unknown> = {name: 'oh-my-mermaid',displayName: 'oh-my-mermaid',description: 'Turn complex codebases into clear, navigable architecture diagrams',@@ -64,14 +87,23 @@ export const cursor: Platform = {author: { name: 'oh-my-mermaid' },homepage: 'https://github.com/oh-my-mermaid/oh-my-mermaid',license: 'MIT',- skills: skillsSource,+ skills: `./${PLUGIN_DIR}/skills/`,};+ if (agentsSource) {+ const agentsDest = path.join(pluginDir, 'agents');+ if (fs.existsSync(agentsDest)) {+ fs.rmSync(agentsDest, { recursive: true });+ }+ copyDirSync(agentsSource, agentsDest);+ manifest.agents = `./${PLUGIN_DIR}/agents/`;+ }+fs.writeFileSync(path.join(pluginDir, PLUGIN_FILE),JSON.stringify(manifest, null, 2) + '\n',);- process.stderr.write(` Created ${PLUGIN_DIR}/${PLUGIN_FILE} in project\n`);+ process.stderr.write(` Created ${PLUGIN_DIR}/${PLUGIN_FILE} with skills in project\n`);},teardown(): void {diff --git a/src/lib/platforms/utils.ts b/src/lib/platforms/utils.tsindex 2fa118f..75fce45 100644--- a/src/lib/platforms/utils.ts+++ b/src/lib/platforms/utils.ts@@ -11,8 +11,30 @@ const __dirname = path.dirname(__filename);*/export function getSkillsSource(): string | null {const candidates = [- path.join(__dirname, '..', '..', 'skills'), // from dist/lib/platforms/- path.join(__dirname, '..', '..', '..', 'skills'), // from src/lib/platforms/+ path.join(__dirname, '..', 'skills'), // from dist/ (flat build via tsup)+ path.join(__dirname, '..', '..', 'skills'), // from dist/lib/platforms/+ path.join(__dirname, '..', '..', '..', 'skills'), // from src/lib/platforms/+ ];++ for (const candidate of candidates) {+ const resolved = path.resolve(candidate);+ if (fs.existsSync(resolved)) {+ return resolved;+ }+ }+ return null;+}++/**+ * Locate the agents/ directory shipped with the npm package.+ * Works from both dist/ (production) and src/ (dev).+ * Returns null if agents/ does not exist yet.+ */+export function getAgentsSource(): string | null {+ const candidates = [+ path.join(__dirname, '..', 'agents'), // from dist/ (flat build via tsup)+ path.join(__dirname, '..', '..', 'agents'), // from dist/lib/platforms/+ path.join(__dirname, '..', '..', '..', 'agents'), // from src/lib/platforms/];for (const candidate of candidates) {