{"version":3,"sources":["../node_modules/.pnpm/tsup@8.5.0_postcss@8.5.6_typescript@5.8.3/node_modules/tsup/assets/cjs_shims.js","../src/yaml-parser.ts","../src/importers.ts","../src/cli.ts","../src/index.ts","../src/parser.ts","../src/exporters.ts","../src/utils/colors.ts","../src/utils/prompt.ts"],"sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n  typeof document === 'undefined'\n    ? new URL(`file:${__filename}`).href\n    : (document.currentScript && document.currentScript.src) ||\n      new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","import yaml from 'js-yaml'\nimport type { GrayMatterOption } from 'gray-matter'\n\n/**\n * Custom YAML parser that handles glob patterns starting with *\n * by pre-processing the YAML to quote unquoted strings that start with * during parsing\n * and removing quotes from glob patterns during stringification\n */\nexport function createSafeYamlParser() {\n  return {\n    parse: (str: string): object => {\n      // Pre-process the YAML string to quote glob patterns\n      // This regex looks for unquoted strings starting with * in YAML values\n      const processedStr = str.replace(\n        /^(\\s*\\w+:\\s*)(\\*[^\\n\\r\"']*?)(\\s*(?:\\r?\\n|$))/gm,\n        (match, prefix, value, suffix) => {\n          // Check if the value is already quoted\n          if (value.startsWith('\"') || value.startsWith(\"'\")) {\n            return match\n          }\n          // Quote the value to prevent it from being interpreted as a YAML alias\n          return `${prefix}\"${value}\"${suffix}`\n        }\n      )\n      \n      // Also handle array items that start with *\n      const fullyProcessedStr = processedStr.replace(\n        /^(\\s*-\\s+)(\\*[^\\n\\r\"']*?)(\\s*(?:\\r?\\n|$))/gm,\n        (match, prefix, value, suffix) => {\n          // Check if the value is already quoted\n          if (value.startsWith('\"') || value.startsWith(\"'\")) {\n            return match\n          }\n          // Quote the value\n          return `${prefix}\"${value}\"${suffix}`\n        }\n      )\n      \n      try {\n        return yaml.load(fullyProcessedStr) as object\n      } catch (error) {\n        // If preprocessing fails, try the original string\n        return yaml.load(str) as object\n      }\n    },\n    stringify: (data: object) => {\n      const yamlOutput = yaml.dump(data)\n      const lines = yamlOutput.split(/\\r?\\n/)\n      const out: string[] = []\n      let inGlobsArray = false\n      let globsIndent = ''\n      const containsGlob = (s: string) => s.includes('*')\n\n      for (let i = 0; i < lines.length; i++) {\n        let line = lines[i]\n\n        // Detect the globs key\n        const globsMatch = line.match(/^(\\s*)globs:\\s*(.*)$/)\n        if (globsMatch) {\n          globsIndent = globsMatch[1]\n          const value = globsMatch[2]\n\n          // Array style begins on next lines\n          if (value === '') {\n            inGlobsArray = true\n            out.push(line)\n            continue\n          }\n\n          // Scalar style on same line: globs: \"...\"\n          const scalar = value.match(/^(['\"])(.+)\\1(\\s*(?:#.*)?)$/)\n          if (scalar && containsGlob(scalar[2])) {\n            line = `${globsIndent}globs: ${scalar[2]}${scalar[3] ?? ''}`\n          }\n          out.push(line)\n          continue\n        }\n\n        if (inGlobsArray) {\n          // End of the globs array when we dedent\n          if (!line.startsWith(globsIndent + '  ')) {\n            inGlobsArray = false\n            i-- // reprocess this line outside array handling\n            continue\n          }\n          // Sequence item: - \"...\"\n          const item = line.match(/^(\\s*-\\s*)(['\"])(.+)\\2(\\s*(?:#.*)?)$/)\n          if (item && containsGlob(item[3])) {\n            line = `${item[1]}${item[3]}${item[4] ?? ''}`\n          }\n          out.push(line)\n          continue\n        }\n\n        out.push(line)\n      }\n      return out.join('\\n')\n    }\n  }\n}\n\n/**\n * Gray-matter options with custom YAML parser for handling glob patterns\n */\nexport const grayMatterOptions: GrayMatterOption<string, object> = {\n  engines: {\n    yaml: createSafeYamlParser()\n  }\n}","import { readFileSync, existsSync, readdirSync, statSync, Dirent } from 'fs'\nimport { join, basename } from 'path'\nimport matter from 'gray-matter'\nimport type { ImportResult, ImportResults, RuleBlock } from './types.js'\nimport { grayMatterOptions } from './yaml-parser.js'\n\n// Helper function to detect if a file/path indicates a private rule\nfunction isPrivateRule(filePath: string): boolean {\n  const lowerPath = filePath.toLowerCase()\n  return lowerPath.includes('.local.') || lowerPath.includes('/private/') || lowerPath.includes('\\\\private\\\\')\n}\n\nexport async function importAll(repoPath: string): Promise<ImportResults> {\n  const results: ImportResult[] = []\n  const errors: Array<{ file: string; error: string }> = []\n  \n  // Check for Agent directory (.agent/)\n  const agentDir = join(repoPath, '.agent')\n  if (existsSync(agentDir)) {\n    try {\n      results.push(importAgent(agentDir))\n    } catch (e) {\n      errors.push({ file: agentDir, error: String(e) })\n    }\n  }\n  \n  // Check for VS Code Copilot instructions\n  const copilotPath = join(repoPath, '.github', 'copilot-instructions.md')\n  if (existsSync(copilotPath)) {\n    try {\n      results.push(importCopilot(copilotPath))\n    } catch (e) {\n      errors.push({ file: copilotPath, error: String(e) })\n    }\n  }\n  \n  // Check for local VS Code Copilot instructions\n  const copilotLocalPath = join(repoPath, '.github', 'copilot-instructions.local.md')\n  if (existsSync(copilotLocalPath)) {\n    try {\n      results.push(importCopilot(copilotLocalPath))\n    } catch (e) {\n      errors.push({ file: copilotLocalPath, error: String(e) })\n    }\n  }\n  \n  // Check for Cursor directory (.cursor/)\n  const cursorDir = join(repoPath, '.cursor')\n  if (existsSync(cursorDir)) {\n    try {\n      results.push(importCursor(cursorDir))\n    } catch (e) {\n      errors.push({ file: cursorDir, error: String(e) })\n    }\n  }\n  \n  // Legacy single .cursorrules file\n  const cursorRulesFile = join(repoPath, '.cursorrules')\n  if (existsSync(cursorRulesFile)) {\n    try {\n      results.push(importCursorLegacy(cursorRulesFile))\n    } catch (e) {\n      errors.push({ file: cursorRulesFile, error: String(e) })\n    }\n  }\n  \n  // Check for Cline rules\n  const clinerules = join(repoPath, '.clinerules')\n  if (existsSync(clinerules)) {\n    try {\n      results.push(importCline(clinerules))\n    } catch (e) {\n      errors.push({ file: clinerules, error: String(e) })\n    }\n  }\n  \n  // Check for local Cline rules\n  const clinerulesLocal = join(repoPath, '.clinerules.local')\n  if (existsSync(clinerulesLocal)) {\n    try {\n      results.push(importCline(clinerulesLocal))\n    } catch (e) {\n      errors.push({ file: clinerulesLocal, error: String(e) })\n    }\n  }\n  \n  // Check for Windsurf rules\n  const windsurfRules = join(repoPath, '.windsurfrules')\n  if (existsSync(windsurfRules)) {\n    try {\n      results.push(importWindsurf(windsurfRules))\n    } catch (e) {\n      errors.push({ file: windsurfRules, error: String(e) })\n    }\n  }\n  \n  // Check for local Windsurf rules\n  const windsurfRulesLocal = join(repoPath, '.windsurfrules.local')\n  if (existsSync(windsurfRulesLocal)) {\n    try {\n      results.push(importWindsurf(windsurfRulesLocal))\n    } catch (e) {\n      errors.push({ file: windsurfRulesLocal, error: String(e) })\n    }\n  }\n  \n  // Check for Zed rules\n  const zedRules = join(repoPath, '.rules')\n  if (existsSync(zedRules)) {\n    try {\n      results.push(importZed(zedRules))\n    } catch (e) {\n      errors.push({ file: zedRules, error: String(e) })\n    }\n  }\n  \n  // Check for local Zed rules\n  const zedRulesLocal = join(repoPath, '.rules.local')\n  if (existsSync(zedRulesLocal)) {\n    try {\n      results.push(importZed(zedRulesLocal))\n    } catch (e) {\n      errors.push({ file: zedRulesLocal, error: String(e) })\n    }\n  }\n  \n  // Check for OpenAI Codex AGENTS.md\n  const agentsMd = join(repoPath, 'AGENTS.md')\n  if (existsSync(agentsMd)) {\n    try {\n      results.push(importCodex(agentsMd))\n    } catch (e) {\n      errors.push({ file: agentsMd, error: String(e) })\n    }\n  }\n  \n  // Check for local AGENTS.md\n  const agentsLocalMd = join(repoPath, 'AGENTS.local.md')\n  if (existsSync(agentsLocalMd)) {\n    try {\n      results.push(importCodex(agentsLocalMd))\n    } catch (e) {\n      errors.push({ file: agentsLocalMd, error: String(e) })\n    }\n  }\n  \n  // Check for CLAUDE.md (Claude Code)\n  const claudeMd = join(repoPath, 'CLAUDE.md')\n  if (existsSync(claudeMd)) {\n    try {\n      results.push(importClaudeCode(claudeMd))\n    } catch (e) {\n      errors.push({ file: claudeMd, error: String(e) })\n    }\n  }\n  \n  // Check for AGENTS.md (OpenCode)\n  const opencodeMd = join(repoPath, 'AGENTS.md')\n  if (existsSync(opencodeMd)) {\n    try {\n      results.push(importOpenCode(opencodeMd))\n    } catch (e) {\n      errors.push({ file: opencodeMd, error: String(e) })\n    }\n  }\n  \n  // Check for AGENTS.md (OpenAI Codex) - Note: This conflicts with OpenCode,\n  // so we need to handle this carefully. For now, we'll prioritize OpenAI Codex\n  // since it was implemented first, but this could be made configurable.\n  // Users can explicitly specify the format using the CLI if needed.\n  \n  // Check for GEMINI.md (Gemini CLI)\n  const geminiMd = join(repoPath, 'GEMINI.md')\n  if (existsSync(geminiMd)) {\n    try {\n      results.push(importGemini(geminiMd))\n    } catch (e) {\n      errors.push({ file: geminiMd, error: String(e) })\n    }\n  }\n\n  // Check for best_practices.md (Qodo)\n  const bestPracticesMd = join(repoPath, 'best_practices.md')\n  if (existsSync(bestPracticesMd)) {\n    try {\n      results.push(importQodo(bestPracticesMd))\n    } catch (e) {\n      errors.push({ file: bestPracticesMd, error: String(e) })\n    }\n  }\n\n  // Check for local CLAUDE.md\n  const claudeLocalMd = join(repoPath, 'CLAUDE.local.md')\n  if (existsSync(claudeLocalMd)) {\n    try {\n      results.push(importClaudeCode(claudeLocalMd))\n    } catch (e) {\n      errors.push({ file: claudeLocalMd, error: String(e) })\n    }\n  }\n  \n  // Check for local GEMINI.md\n  const geminiLocalMd = join(repoPath, 'GEMINI.local.md')\n  if (existsSync(geminiLocalMd)) {\n    try {\n      results.push(importGemini(geminiLocalMd))\n    } catch (e) {\n      errors.push({ file: geminiLocalMd, error: String(e) })\n    }\n  }\n  \n  // Check for CONVENTIONS.md (Aider)\n  const conventionsMd = join(repoPath, 'CONVENTIONS.md')\n  if (existsSync(conventionsMd)) {\n    try {\n      results.push(importAider(conventionsMd))\n    } catch (e) {\n      errors.push({ file: conventionsMd, error: String(e) })\n    }\n  }\n  \n  // Check for local CONVENTIONS.md\n  const conventionsLocalMd = join(repoPath, 'CONVENTIONS.local.md')\n  if (existsSync(conventionsLocalMd)) {\n    try {\n      results.push(importAider(conventionsLocalMd))\n    } catch (e) {\n      errors.push({ file: conventionsLocalMd, error: String(e) })\n    }\n  }\n  \n  // Check for Amazon Q rules\n  const amazonqRulesDir = join(repoPath, '.amazonq', 'rules')\n  if (existsSync(amazonqRulesDir)) {\n    try {\n      results.push(importAmazonQ(amazonqRulesDir))\n    } catch (e) {\n      errors.push({ file: amazonqRulesDir, error: String(e) })\n    }\n  }\n\n  // Check for Roo rules\n  const rooRulesDir = join(repoPath, '.roo', 'rules')\n  if (existsSync(rooRulesDir)) {\n    try {\n      results.push(importRoo(rooRulesDir))\n    } catch (e) {\n      errors.push({ file: rooRulesDir, error: String(e) })\n    }\n  }\n\n  // Check for Junie guidelines\n  const junieGuidelines = join(repoPath, '.junie', 'guidelines.md')\n  if (existsSync(junieGuidelines)) {\n    try {\n      results.push(importJunie(junieGuidelines))\n    } catch (e) {\n      errors.push({ file: junieGuidelines, error: String(e) })\n    }\n  }\n  \n  return { results, errors }\n}\n\nexport function importCopilot(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivate = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'copilot-instructions',\n    alwaysApply: true,\n    description: 'GitHub Copilot custom instructions'\n  }\n  \n  if (isPrivate) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'copilot',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importAgent(agentDir: string): ImportResult {\n  const rules: RuleBlock[] = []\n  \n  // Recursively find all .md files in the agent directory\n  function findMarkdownFiles(dir: string, relativePath = ''): void {\n    const entries = readdirSync(dir, { withFileTypes: true })\n    \n    // Ensure deterministic ordering: process directories before files, then sort alphabetically\n    entries.sort((a: Dirent, b: Dirent) => {\n      if (a.isDirectory() && !b.isDirectory()) return -1;\n      if (!a.isDirectory() && b.isDirectory()) return 1;\n      return a.name.localeCompare(b.name);\n    })\n    \n    for (const entry of entries) {\n      const fullPath = join(dir, entry.name)\n      const relPath = relativePath ? join(relativePath, entry.name) : entry.name\n      \n      if (entry.isDirectory()) {\n        // Recursively search subdirectories\n        findMarkdownFiles(fullPath, relPath)\n      } else if (entry.isFile() && entry.name.endsWith('.md')) {\n        const content = readFileSync(fullPath, 'utf-8')\n        const { data, content: body } = matter(content, grayMatterOptions)\n        \n        // Remove any leading numeric ordering prefixes (e.g., \"001-\" or \"12-\") from each path segment\n        let segments = relPath\n          .replace(/\\.md$/, '')\n          .replace(/\\\\/g, '/')\n          .split('/')\n          .map((s: string) => s.replace(/^\\d{2,}-/, '').replace(/\\.local$/, ''))\n        if (segments[0] === 'private') segments = segments.slice(1)\n        const defaultId = segments.join('/')\n        \n        // Check if this is a private rule (either by path or frontmatter)\n        const isPrivateFile = isPrivateRule(fullPath)\n        \n        const metadata: any = {\n          id: data.id || defaultId,\n          ...data\n        }\n        \n        // Set default alwaysApply to false if not specified\n        if (metadata.alwaysApply === undefined) {\n          metadata.alwaysApply = false\n        }\n        \n        // Only set private if it's true (from file pattern or frontmatter)\n        if (data.private === true || (data.private === undefined && isPrivateFile)) {\n          metadata.private = true\n        }\n        \n        rules.push({\n          metadata,\n          content: body.trim()\n        })\n      }\n    }\n  }\n  \n  findMarkdownFiles(agentDir)\n  \n  return {\n    format: 'agent',\n    filePath: agentDir,\n    rules\n  }\n}\n\nexport function importCursor(cursorDir: string): ImportResult {\n  const rules: RuleBlock[] = []\n  \n  // Recursively find all .mdc and .md files in the .cursor directory\n  function findCursorFiles(dir: string, relativePath = ''): void {\n    const entries = readdirSync(dir, { withFileTypes: true })\n    \n    // Ensure deterministic ordering: process directories before files, then sort alphabetically\n    entries.sort((a: Dirent, b: Dirent) => {\n      if (a.isDirectory() && !b.isDirectory()) return -1;\n      if (!a.isDirectory() && b.isDirectory()) return 1;\n      return a.name.localeCompare(b.name);\n    })\n    \n    for (const entry of entries) {\n      const fullPath = join(dir, entry.name)\n      const relPath = relativePath ? join(relativePath, entry.name) : entry.name\n      \n      if (entry.isDirectory()) {\n        // Recursively search subdirectories\n        findCursorFiles(fullPath, relPath)\n      } else if (entry.isFile() && (entry.name.endsWith('.mdc') || entry.name.endsWith('.md'))) {\n        const content = readFileSync(fullPath, 'utf-8')\n        const { data, content: body } = matter(content, grayMatterOptions)\n        \n        // Remove any leading numeric ordering prefixes (e.g., \"001-\" or \"12-\") from each path segment\n        let segments = relPath\n          .replace(/\\.(mdc|md)$/, '')\n          .replace(/\\\\/g, '/')\n          .split('/')\n          .map((s: string) => s.replace(/^\\d{2,}-/, '').replace(/\\.local$/, ''))\n        \n        // Special handling for backward compatibility\n        if (segments[0] === 'private') segments = segments.slice(1)\n        // If the file is directly in the 'rules' directory, don't include 'rules' in the ID\n        if (segments[0] === 'rules' && segments.length === 2) segments = segments.slice(1)\n        \n        const defaultId = segments.join('/')\n        \n        // Check if this is a private rule\n        const isPrivateFile = isPrivateRule(fullPath)\n        \n        const metadata: any = {\n          id: data.id || defaultId,\n          ...data\n        }\n        \n        // Set default alwaysApply to false if not specified\n        if (metadata.alwaysApply === undefined) {\n          metadata.alwaysApply = false\n        }\n        \n        // Only set private if it's true (from file pattern or frontmatter)\n        if (data.private === true || (data.private === undefined && isPrivateFile)) {\n          metadata.private = true\n        }\n        \n        rules.push({\n          metadata,\n          content: body.trim()\n        })\n      }\n    }\n  }\n  \n  findCursorFiles(cursorDir)\n  \n  return {\n    format: 'cursor',\n    filePath: cursorDir,\n    rules\n  }\n}\n\nexport function importCursorLegacy(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const rules: RuleBlock[] = [{\n    metadata: {\n      id: 'cursor-rules-legacy',\n      alwaysApply: true,\n      description: 'Legacy Cursor rules'\n    },\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'cursor',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importCline(rulesPath: string): ImportResult {\n  const rules: RuleBlock[] = []\n  \n  // Check if it's a directory\n  if (existsSync(rulesPath) && statSync(rulesPath).isDirectory()) {\n    // Recursively find all .md files\n    function findMdFiles(dir: string, relativePath = ''): void {\n      const entries = readdirSync(dir, { withFileTypes: true })\n      \n      // Ensure deterministic ordering: process directories before files, then sort alphabetically\n      entries.sort((a: Dirent, b: Dirent) => {\n        if (a.isDirectory() && !b.isDirectory()) return -1;\n        if (!a.isDirectory() && b.isDirectory()) return 1;\n        return a.name.localeCompare(b.name);\n      })\n      \n      for (const entry of entries) {\n        const fullPath = join(dir, entry.name)\n        const relPath = relativePath ? join(relativePath, entry.name) : entry.name\n        \n        if (entry.isDirectory()) {\n          findMdFiles(fullPath, relPath)\n        } else if (entry.isFile() && entry.name.endsWith('.md')) {\n          const content = readFileSync(fullPath, 'utf-8')\n          const isPrivateFile = isPrivateRule(fullPath)\n          // Remove any leading numeric ordering prefixes (e.g., \"001-\" or \"12-\") from each path segment\n          let segments = relPath\n            .replace(/\\.md$/, '')\n            .replace(/\\\\/g, '/')\n            .split('/')\n            .map((s: string) => s.replace(/^\\d{2,}-/, '').replace(/\\.local$/, ''))\n          if (segments[0] === 'private') segments = segments.slice(1)\n          const defaultId = segments.join('/')\n          \n          const metadata: any = {\n            id: defaultId,\n            alwaysApply: true,\n            description: `Cline rules from ${relPath}`\n          }\n          \n          if (isPrivateFile) {\n            metadata.private = true\n          }\n          \n          rules.push({\n            metadata,\n            content: content.trim()\n          })\n        }\n      }\n    }\n    \n    findMdFiles(rulesPath)\n  } else {\n    // Single .clinerules file\n    const content = readFileSync(rulesPath, 'utf-8')\n    const isPrivateFile = isPrivateRule(rulesPath)\n    \n    const metadata: any = {\n      id: 'cline-rules',\n      alwaysApply: true,\n      description: 'Cline project rules'\n    }\n    \n    if (isPrivateFile) {\n      metadata.private = true\n    }\n    \n    rules.push({\n      metadata,\n      content: content.trim()\n    })\n  }\n  \n  return {\n    format: 'cline',\n    filePath: rulesPath,\n    rules\n  }\n}\n\nexport function importWindsurf(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'windsurf-rules',\n    alwaysApply: true,\n    description: 'Windsurf AI rules'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'windsurf',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importZed(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'zed-rules',\n    alwaysApply: true,\n    description: 'Zed editor rules'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'zed',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importCodex(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const format = basename(filePath) === 'AGENTS.md' || basename(filePath) === 'AGENTS.local.md' ? 'codex' : 'unknown'\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: format === 'codex' ? 'codex-agents' : 'claude-rules',\n    alwaysApply: true,\n    description: format === 'codex' ? 'OpenAI Codex agent instructions' : 'Claude AI instructions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format,\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importAider(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'aider-conventions',\n    alwaysApply: true,\n    description: 'Aider CLI conventions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'aider',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importClaudeCode(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'claude-code-instructions',\n    alwaysApply: true,\n    description: 'Claude Code context and instructions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'claude',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importOpenCode(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'opencode-agents',\n    alwaysApply: true,\n    description: 'OpenCode agents and instructions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'opencode',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importGemini(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'gemini-instructions',\n    alwaysApply: true,\n    description: 'Gemini CLI context and instructions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'gemini',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importQodo(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const rules: RuleBlock[] = [{\n    metadata: {\n      id: 'qodo-best-practices',\n      alwaysApply: true,\n      description: 'Qodo best practices and coding standards',\n      scope: '**/*',\n      priority: 'high'\n    },\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'qodo',\n    filePath,\n    rules,\n    raw: content\n  }\n}\n\nexport function importAmazonQ(rulesDir: string): ImportResult {\n  const rules: RuleBlock[] = []\n  \n  // Recursively find all .md files in the Amazon Q rules directory\n  function findMdFiles(dir: string, relativePath = ''): void {\n    const entries = readdirSync(dir, { withFileTypes: true })\n    \n    // Ensure deterministic ordering: process directories before files, then sort alphabetically\n    entries.sort((a: Dirent, b: Dirent) => {\n      if (a.isDirectory() && !b.isDirectory()) return -1;\n      if (!a.isDirectory() && b.isDirectory()) return 1;\n      return a.name.localeCompare(b.name);\n    })\n    \n    for (const entry of entries) {\n      const fullPath = join(dir, entry.name)\n      const relPath = relativePath ? join(relativePath, entry.name) : entry.name\n      \n      if (entry.isDirectory()) {\n        // Recursively search subdirectories\n        findMdFiles(fullPath, relPath)\n      } else if (entry.isFile() && entry.name.endsWith('.md')) {\n        const content = readFileSync(fullPath, 'utf-8')\n        const isPrivateFile = isPrivateRule(fullPath)\n        \n        // Remove any leading numeric ordering prefixes (e.g., \"001-\" or \"12-\") from each path segment\n        let segments = relPath\n          .replace(/\\.md$/, '')\n          .replace(/\\\\/g, '/')\n          .split('/')\n          .map((s: string) => s.replace(/^\\d{2,}-/, '').replace(/\\.local$/, ''))\n        if (segments[0] === 'private') segments = segments.slice(1)\n        const defaultId = segments.join('/')\n        \n        const metadata: any = {\n          id: `amazonq-${defaultId}`,\n          alwaysApply: true,\n          description: `Amazon Q rules from ${relPath}`\n        }\n        \n        if (isPrivateFile) {\n          metadata.private = true\n        }\n        \n        rules.push({\n          metadata,\n          content: content.trim()\n        })\n      }\n    }\n  }\n  \n  findMdFiles(rulesDir)\n  \n  return {\n    format: 'amazonq',\n    filePath: rulesDir,\n    rules\n  }\n}\n\nexport function importRoo(rulesDir: string): ImportResult {\n  const rules: RuleBlock[] = []\n  \n  // Recursively find all .md files in the Roo rules directory\n  function findMdFiles(dir: string, relativePath = ''): void {\n    const entries = readdirSync(dir, { withFileTypes: true })\n      \n      // Ensure deterministic ordering: process directories before files, then sort alphabetically\n      entries.sort((a: Dirent, b: Dirent) => {\n        if (a.isDirectory() && !b.isDirectory()) return -1;\n        if (!a.isDirectory() && b.isDirectory()) return 1;\n        return a.name.localeCompare(b.name);\n      })\n      \n      for (const entry of entries) {\n        const fullPath = join(dir, entry.name)\n        const relPath = relativePath ? join(relativePath, entry.name) : entry.name\n        \n        if (entry.isDirectory()) {\n          // Recursively search subdirectories\n          findMdFiles(fullPath, relPath)\n        } else if (entry.isFile() && entry.name.endsWith('.md')) {\n          const content = readFileSync(fullPath, 'utf-8')\n          const { data, content: body } = matter(content, grayMatterOptions)\n          \n          // Remove any leading numeric ordering prefixes (e.g., \"001-\" or \"12-\") from each path segment\n          let segments = relPath\n            .replace(/\\.md$/, '')\n            .replace(/\\\\/g, '/')\n            .split('/')\n            .map((s: string) => s.replace(/^\\d{2,}-/, '').replace(/\\.local$/, ''))\n          if (segments[0] === 'private') segments = segments.slice(1)\n          const defaultId = segments.join('/')\n          \n          // Check if this is a private rule (either by path or frontmatter)\n          const isPrivateFile = isPrivateRule(fullPath)\n          \n          const metadata: any = {\n            id: data.id || defaultId,\n            ...data\n          }\n          \n          // Set default alwaysApply to false if not specified\n          if (metadata.alwaysApply === undefined) {\n            metadata.alwaysApply = false\n          }\n          \n          // Only set private if it's true (from file pattern or frontmatter)\n          if (data.private === true || (data.private === undefined && isPrivateFile)) {\n            metadata.private = true\n          }\n          \n          rules.push({\n            metadata,\n            content: body.trim()\n          })\n        }\n      }\n    }\n    \n    findMdFiles(rulesDir)\n    \n    return {\n      format: 'roo',\n      filePath: rulesDir,\n      rules\n    }\n}\n\nexport function importJunie(filePath: string): ImportResult {\n  const content = readFileSync(filePath, 'utf-8')\n  const isPrivateFile = isPrivateRule(filePath)\n  \n  const metadata: any = {\n    id: 'junie-guidelines',\n    alwaysApply: true,\n    description: 'JetBrains Junie guidelines and instructions'\n  }\n  \n  if (isPrivateFile) {\n    metadata.private = true\n  }\n  \n  const rules: RuleBlock[] = [{\n    metadata,\n    content: content.trim()\n  }]\n  \n  return {\n    format: 'junie' as any,\n    filePath,\n    rules,\n    raw: content\n  }\n}","#!/usr/bin/env node\n\nimport { existsSync, readFileSync, writeFileSync, appendFileSync, rmSync } from 'fs'\nimport { join, resolve, dirname } from 'path'\nimport { parseArgs } from 'util'\nimport { importAll, importAgent, exportToAgent, exportAll, exportToCopilot, exportToCursor, exportToCline, exportToWindsurf, exportToZed, exportToCodex, exportToAider, exportToClaudeCode, exportToGemini, exportToQodo, importRoo, exportToRoo, exportToJunie, importOpenCode, exportToOpenCode } from './index.js'\nimport { color, header, formatList } from './utils/colors.js'\nimport { select, confirm } from './utils/prompt.js'\n\nconst { values, positionals } = parseArgs({\n  args: process.argv.slice(2),\n  options: {\n    help: { type: 'boolean', short: 'h' },\n    output: { type: 'string', short: 'o' },\n    format: { type: 'string', short: 'f' },\n    formats: { type: 'string' },\n    overwrite: { type: 'boolean', short: 'w' },\n    'dry-run': { type: 'boolean', short: 'd' },\n    'include-private': { type: 'boolean' },\n    'skip-private': { type: 'boolean' },\n    'gitignore': { type: 'boolean' },\n    'no-gitignore': { type: 'boolean' },\n  },\n  allowPositionals: true\n}) as { values: any; positionals: string[] }\n\n// Validate mutually exclusive flags\nif (values['gitignore'] && values['no-gitignore']) {\n  console.error(color.error('Cannot use both --gitignore and --no-gitignore flags together'))\n  process.exit(1)\n}\n\nfunction showHelp() {\n  console.log(`\n${color.bold('dotagent')} - Multi-file AI agent configuration manager\n\n${color.bold('Usage:')}\n  ${color.command('dotagent import')} ${color.dim('<repo-path>')}    Import all rule files from a repository\n  ${color.command('dotagent export')} ${color.dim('[repo-path]')}   Export .agent/ directory to all supported formats\n  ${color.command('dotagent convert')} ${color.dim('<file>')}        Convert a specific rule file\n\n${color.bold('Options:')}\n  ${color.yellow('-h, --help')}       Show this help message\n  ${color.yellow('-o, --output')}     Output file path (for convert command)\n  ${color.yellow('-f, --format')}     Specify format (copilot|cursor|cline|windsurf|zed|codex|aider|claude|gemini|qodo|roo|junie|opencode)\n  ${color.yellow('--formats')}        Specify multiple formats (comma-separated)\n  ${color.yellow('-w, --overwrite')}  Overwrite existing files\n  ${color.yellow('-d, --dry-run')}    Preview operations without making changes\n  ${color.yellow('--gitignore')}      Auto-update gitignore (skip prompt)\n  ${color.yellow('--no-gitignore')}   Skip gitignore prompt\n\n${color.bold('Examples:')}\n  ${color.dim('# Import all rules from current directory (creates .agent/)')}\n  ${color.command('dotagent import .')}\n\n  ${color.dim('# Export .agent/ directory to all formats')}\n  ${color.command('dotagent export')}\n  \n  ${color.dim('# Export from specific directory')}\n  ${color.command('dotagent export /path/to/repo')}\n\n  ${color.dim('# Preview what would be imported without creating files')}\n  ${color.command('dotagent import . --dry-run')}\n`)\n}\n\nasync function main() {\n  if (values.help || positionals.length === 0) {\n    showHelp()\n    process.exit(0)\n  }\n\n  const command = positionals[0]\n  const target = positionals[1]\n  const isDryRun = values['dry-run']\n\n  if (isDryRun) {\n    console.log(color.info('Running in dry-run mode - no files will be modified'))\n  }\n\n  switch (command) {\n    case 'import': {\n      // Default to current directory if no target specified\n      const importTarget = target || '.'\n\n      const repoPath = resolve(importTarget)\n      if (!existsSync(repoPath)) {\n        console.error(color.error(`Path does not exist: ${color.path(repoPath)}`))\n        console.error(color.dim('Hint: Check if the path is correct or use \".\" for current directory'))\n        process.exit(1)\n      }\n\n      console.log(header('Importing Rules'))\n      console.log(`Scanning: ${color.path(repoPath)}`)\n      \n      const { results, errors } = await importAll(repoPath)\n\n      if (results.length === 0) {\n        console.log(color.warning('No rule files found'))\n        console.log(color.dim('Hint: DotAgent looks for:'))\n        console.log(formatList([\n          '.agent/**/*.md',\n          '.github/copilot-instructions.md',\n          '.cursor/**/*.{mdc,md}',\n          '.clinerules',\n          '.windsurfrules',\n          '.rules',\n          'AGENTS.md',\n          'CLAUDE.md',\n          'GEMINI.md',\n          'best_practices.md'\n        ]))\n      } else {\n        console.log(color.success(`Found ${color.number(results.length.toString())} rule file(s):`))\n        \n        for (const result of results) {\n          const ruleCount = color.number(`${result.rules.length} rule(s)`)\n          console.log(`  ${color.format(result.format)}: ${color.path(result.filePath)} ${color.dim(`(${ruleCount})`)}`)\n        }\n\n        // Combine all rules\n        const allRules = results.flatMap(r => r.rules)\n        \n        // Check if .agent directory exists\n        const agentDir = join(repoPath, '.agent')\n        if (existsSync(agentDir)) {\n          const existingAgent = importAgent(agentDir)\n          console.log(color.info(`Found existing .agent/ directory with ${color.number(existingAgent.rules.length.toString())} rule(s)`))\n        }\n\n        if (isDryRun) {\n          console.log(color.info(`Would export to: ${color.path(agentDir)}`))\n          console.log(color.dim(`Total rules: ${allRules.length}`))\n        } else {\n          const outputDir = values.output || repoPath\n          exportToAgent(allRules, outputDir)\n          console.log(color.success(`Created .agent/ directory with ${color.number(allRules.length.toString())} rule(s)`))\n        }\n      }\n\n      if (errors.length > 0) {\n        console.log(color.warning('Import errors:'))\n        for (const error of errors) {\n          console.log(`  ${color.red('×')} ${color.path(error.file)}: ${error.error}`)\n        }\n      }\n      break\n    }\n\n    case 'export': {\n      // Default to current directory if no target specified\n      const repoPath = target ? resolve(target) : process.cwd()\n      const agentDir = join(repoPath, '.agent')\n      \n      if (!existsSync(agentDir)) {\n        console.error(color.error(`No .agent/ directory found in: ${color.path(repoPath)}`))\n        console.error(color.dim('Hint: Run \"dotagent import .\" first to create .agent/ directory'))\n        process.exit(1)\n      }\n\n      // Check for legacy .agentconfig file\n      const agentConfigPath = join(repoPath, '.agentconfig')\n      if (existsSync(agentConfigPath)) {\n        console.error(color.error('Found deprecated .agentconfig file'))\n        console.error(color.dim('The single-file .agentconfig format is deprecated. Please run \"dotagent import .\" to migrate to .agent/ directory.'))\n        process.exit(1)\n      }\n\n      console.log(header('Exporting Rules'))\n      \n      const result = importAgent(agentDir)\n      const rules = result.rules\n      \n      console.log(color.success(`Found ${color.number(rules.length.toString())} rule(s) in ${color.path(agentDir)}`))\n      \n      // Count private rules\n      const privateRuleCount = rules.filter(r => r.metadata.private).length\n      if (privateRuleCount > 0) {\n        console.log(color.dim(`Including ${privateRuleCount} private rule(s)`))\n      }\n\n      const outputDir = values.output || repoPath\n      \n      const exportFormats = [\n        { name: 'All formats', value: 'all' },\n        { name: 'VS Code Copilot (.github/copilot-instructions.md)', value: 'copilot' },\n        { name: 'Cursor (.cursor/rules/)', value: 'cursor' },\n        { name: 'Cline (.clinerules)', value: 'cline' },\n        { name: 'Windsurf (.windsurfrules)', value: 'windsurf' },\n        { name: 'Zed (.rules)', value: 'zed' },\n        { name: 'OpenAI Codex (AGENTS.md)', value: 'codex' },\n        { name: 'Aider (CONVENTIONS.md)', value: 'aider' },\n        { name: 'Claude Code (CLAUDE.md)', value: 'claude' },\n        { name: 'Gemini CLI (GEMINI.md)', value: 'gemini' },\n        { name: 'Qodo Merge (best_practices.md)', value: 'qodo' },\n        { name: 'Roo Code (.roo/rules/)', value: 'roo' },\n        { name: 'JetBrains Junie (.junie/guidelines.md)', value: 'junie' },\n        { name: 'OpenCode (AGENTS.md)', value: 'opencode' }\n      ]\n\n      // Handle format parameter or show interactive menu\n      let selectedFormats: string[] = []\n      \n      if (values.formats) {\n        // Parse comma-separated formats\n        selectedFormats = values.formats.split(',').map((f: string) => f.trim())\n      } else if (values.format) {\n        // Single format from -f flag\n        selectedFormats = [values.format]\n      } else {\n        // Interactive menu\n        console.log()\n        const selectedFormat = await select('Select export format:', exportFormats, 0)\n        selectedFormats = selectedFormat === 'all' ? ['all'] : [selectedFormat]\n      }\n\n      // Validate formats\n      const validFormats = ['all', 'copilot', 'cursor', 'cline', 'windsurf', 'zed', 'codex', 'aider', 'claude', 'gemini', 'qodo', 'roo', 'junie', 'opencode']\n      const invalidFormats = selectedFormats.filter(f => !validFormats.includes(f))\n      if (invalidFormats.length > 0) {\n        console.error(color.error(`Invalid format(s): ${invalidFormats.join(', ')}`))\n        console.error(color.dim(`Valid formats: ${validFormats.slice(1).join(', ')}, all`))\n        process.exit(1)\n      }\n      \n      if (isDryRun) {\n        console.log(color.info('Dry run mode - no files will be written'))\n      }\n      \n      const options = { includePrivate: values['include-private'] }\n      const exportedPaths: string[] = []\n      \n      // Handle multiple formats\n      for (const selectedFormat of selectedFormats) {\n        if (selectedFormat === 'all') {\n          if (!isDryRun) {\n            exportAll(rules, outputDir, false, options)\n          }\n          console.log(color.success('Exported to all formats'))\n          exportedPaths.push(\n            '.github/copilot-instructions.md',\n            '.cursor/rules/',\n            '.clinerules',\n            '.windsurfrules',\n            '.rules',\n            'AGENTS.md',\n            'CONVENTIONS.md',\n            'CLAUDE.md',\n            'GEMINI.md',\n            'best_practices.md'\n          )\n        } else {\n          // Export to specific format\n          let exportPath = ''\n          \n          switch (selectedFormat) {\n            case 'copilot':\n              exportPath = join(outputDir, '.github', 'copilot-instructions.md')\n              if (!isDryRun) exportToCopilot(rules, exportPath, options)\n              exportedPaths.push('.github/copilot-instructions.md')\n              break\n            case 'cursor':\n              if (!isDryRun) exportToCursor(rules, outputDir, options)\n              exportPath = join(outputDir, '.cursor/rules/')\n              exportedPaths.push('.cursor/rules/')\n              break\n            case 'cline':\n              exportPath = join(outputDir, '.clinerules')\n              if (!isDryRun) exportToCline(rules, exportPath, options)\n              exportedPaths.push('.clinerules')\n              break\n            case 'windsurf':\n              exportPath = join(outputDir, '.windsurfrules')\n              if (!isDryRun) exportToWindsurf(rules, exportPath, options)\n              exportedPaths.push('.windsurfrules')\n              break\n            case 'zed':\n              exportPath = join(outputDir, '.rules')\n              if (!isDryRun) exportToZed(rules, exportPath, options)\n              exportedPaths.push('.rules')\n              break\n            case 'codex':\n              exportPath = join(outputDir, 'AGENTS.md')\n              if (!isDryRun) exportToCodex(rules, exportPath, options)\n              exportedPaths.push('AGENTS.md')\n              break\n            case 'aider':\n              exportPath = join(outputDir, 'CONVENTIONS.md')\n              if (!isDryRun) exportToAider(rules, exportPath, options)\n              exportedPaths.push('CONVENTIONS.md')\n              break\n            case 'claude':\n              exportPath = join(outputDir, 'CLAUDE.md')\n              if (!isDryRun) exportToClaudeCode(rules, exportPath, options)\n              exportedPaths.push('CLAUDE.md')\n              break\n            case 'gemini':\n              exportPath = join(outputDir, 'GEMINI.md')\n              if (!isDryRun) exportToGemini(rules, exportPath, options)\n              exportedPaths.push('GEMINI.md')\n              break\n            case 'opencode':\n              exportPath = join(outputDir, 'AGENTS.md')\n              if (!isDryRun) exportToOpenCode(rules, exportPath, options)\n              exportedPaths.push('AGENTS.md')\n              break\n            case 'qodo':\n              exportPath = join(outputDir, 'best_practices.md')\n              if (!isDryRun) exportToQodo(rules, exportPath, options)\n              exportedPaths.push('best_practices.md')\n              break\n            case 'roo':\n              if (!isDryRun) exportToRoo(rules, outputDir, options)\n              exportPath = join(outputDir, '.roo/rules/')\n              exportedPaths.push('.roo/rules/')\n              break\n            case 'junie':\n              if (!isDryRun) exportToJunie(rules, outputDir, options)\n              exportPath = join(outputDir, '.junie/guidelines.md')\n              exportedPaths.push('.junie/guidelines.md')\n              break\n          }\n          \n          if (exportPath) {\n            console.log(color.success(`Exported to: ${color.path(exportPath)}`))\n          }\n        }\n      }\n      \n      if (!values['include-private'] && privateRuleCount > 0) {\n        console.log(color.dim(`\\nExcluded ${privateRuleCount} private rule(s). Use --include-private to include them.`))\n      }\n      \n      // Handle gitignore updates\n      if (!isDryRun && exportedPaths.length > 0) {\n        let shouldUpdateGitignore = false\n        \n        // Check if there are actually new patterns to add\n        const hasNewPatterns = checkForNewGitignorePatterns(outputDir, exportedPaths)\n        \n        if (values['gitignore']) {\n          // --gitignore flag: automatically update gitignore (answer yes)\n          shouldUpdateGitignore = true\n          console.log(color.info('Updating .gitignore (auto-enabled by --gitignore flag)'))\n        } else if (!values['no-gitignore'] && hasNewPatterns) {\n          // Default behavior: ask user only if there are new patterns\n          console.log()\n          shouldUpdateGitignore = await confirm('Add exported files to .gitignore?', true)\n        }\n        // If --no-gitignore is specified or no new patterns, shouldUpdateGitignore remains false\n\n        if (shouldUpdateGitignore) {\n          const wasUpdated = updateGitignoreWithPaths(outputDir, exportedPaths)\n          if (wasUpdated) {\n            console.log(color.success('Updated .gitignore'))\n          }\n        }\n      }\n      break\n    }\n\n    case 'convert': {\n      if (!target) {\n        console.error(color.error('Input file path required'))\n        process.exit(1)\n      }\n\n      const inputPath = resolve(target)\n      if (!existsSync(inputPath)) {\n        console.error(color.error(`File does not exist: ${color.path(inputPath)}`))\n        process.exit(1)\n      }\n\n      console.log(header('Converting File'))\n\n      // Auto-detect format or use specified\n      let format = values.format\n      if (!format) {\n        if (inputPath.includes('copilot-instructions')) format = 'copilot'\n        else if (inputPath.endsWith('.mdc')) format = 'cursor'\n        else if (inputPath.includes('.clinerules')) format = 'cline'\n        else if (inputPath.includes('.windsurfrules')) format = 'windsurf'\n        else if (inputPath.endsWith('.rules')) format = 'zed'\n        else if (inputPath.endsWith('AGENTS.md')) format = 'codex'\n        else if (inputPath.endsWith('CLAUDE.md')) format = 'claude'\n        else if (inputPath.endsWith('GEMINI.md')) format = 'gemini'\n        else if (inputPath.endsWith('CONVENTIONS.md')) format = 'aider'\n        else if (inputPath.endsWith('best_practices.md')) format = 'qodo'\n        else if (inputPath.includes('.roo/rules')) format = 'roo'\n        else {\n          console.error(color.error('Cannot auto-detect format'))\n          console.error(color.dim('Hint: Specify format with -f (copilot|cursor|cline|windsurf|zed|codex|aider|claude|gemini|qodo|roo|opencode)'))\n          process.exit(1)\n        }\n      }\n\n      console.log(`Format: ${color.format(format)}`)\n      console.log(`Input: ${color.path(inputPath)}`)\n\n      // Import using appropriate importer\n      const { importCopilot, importCursor, importCline, importWindsurf, importZed, importCodex, importAider, importClaudeCode, importGemini, importQodo } = await import('./importers.js')\n      \n      let result\n      switch (format) {\n        case 'copilot':\n          result = importCopilot(inputPath)\n          break\n        case 'cursor':\n          result = importCursor(inputPath)\n          break\n        case 'cline':\n          result = importCline(inputPath)\n          break\n        case 'windsurf':\n          result = importWindsurf(inputPath)\n          break\n        case 'zed':\n          result = importZed(inputPath)\n          break\n        case 'codex':\n          result = importCodex(inputPath)\n          break\n        case 'aider':\n          result = importAider(inputPath)\n          break\n        case 'claude':\n          result = importClaudeCode(inputPath)\n          break\n        case 'opencode':\n          result = importOpenCode(inputPath)\n          break\n        case 'gemini':\n          result = importGemini(inputPath)\n          break\n        case 'qodo':\n          result = importQodo(inputPath)\n          break\n        case 'roo':\n          result = importRoo(inputPath)\n          break\n        default:\n          console.error(color.error(`Unknown format: ${format}`))\n          process.exit(1)\n      }\n\n      const outputDir = values.output || dirname(inputPath)\n      const agentDir = join(outputDir, '.agent')\n\n      // If an .agent directory already exists and overwrite flag is NOT set,\n      // remove it to ensure a clean conversion output. This prevents stale\n      // rules from previous operations (e.g., example workspaces) from\n      // contaminating the converted output and breaking ordering-sensitive tests.\n      if (existsSync(agentDir) && !values.overwrite) {\n        rmSync(agentDir, { recursive: true, force: true })\n      }\n\n      if (isDryRun) {\n        console.log(color.info(`Would export to: ${color.path(agentDir)}`))\n        console.log(color.dim(`Rules found: ${result.rules.length}`))\n      } else {\n        exportToAgent(result.rules, outputDir)\n        console.log(color.success(`Exported to: ${color.path(agentDir)}`))\n        console.log(color.dim(`Created ${result.rules.length} .mdc file(s)`))\n      }\n      break\n    }\n\n    default:\n      console.error(color.error(`Unknown command: ${command}`))\n      showHelp()\n      process.exit(1)\n  }\n}\n\nfunction filterNewPatterns(content: string, paths: string[]): string[] {\n  const lines = content\n    .split(/\\r?\\n/)\n    .map(l => l.trim())\n    .filter(l => l && !l.startsWith('#'))\n\n  const lineSet = new Set(lines)\n\n  const variants = (p: string): string[] => {\n    if (p.endsWith('/')) {\n      const base = p.replace(/^\\/+/, '')\n      return [base, `${base}**`, `/${base}`, `/${base}**`]\n    } else {\n      const base = p.replace(/^\\/+/, '')\n      return [base, `/${base}`]\n    }\n  }\n\n  return paths.filter(p => !variants(p).some(v => lineSet.has(v)))\n}\n\nfunction checkForNewGitignorePatterns(repoPath: string, paths: string[]): boolean {\n  const gitignorePath = join(repoPath, '.gitignore')\n  \n  // If gitignore doesn't exist, all patterns are new\n  if (!existsSync(gitignorePath)) {\n    return paths.length > 0\n  }\n  \n  const content = readFileSync(gitignorePath, 'utf-8')\n  const newPatterns = filterNewPatterns(content, paths)\n  \n  return newPatterns.length > 0\n}\n\nfunction updateGitignoreWithPaths(repoPath: string, paths: string[]): boolean {\n  const gitignorePath = join(repoPath, '.gitignore')\n  \n  const patterns = [\n    '',\n    '# Added by dotagent: ignore exported AI rule files',\n    ...paths.map(p => p.endsWith('/') ? p + '**' : p),\n    ''\n  ].join('\\n')\n  \n  if (existsSync(gitignorePath)) {\n    const content = readFileSync(gitignorePath, 'utf-8')\n    \n    // Check if any of the patterns already exist\n    const newPatterns = filterNewPatterns(content, paths)\n    \n    if (newPatterns.length > 0) {\n      appendFileSync(gitignorePath, patterns)\n      return true\n    }\n    return false\n  } else {\n    writeFileSync(gitignorePath, patterns.trim() + '\\n')\n    return true\n  }\n}\n\nfunction updateGitignore(repoPath: string): void {\n  const gitignorePath = join(repoPath, '.gitignore')\n  const privatePatterns = [\n    '# Added by dotagent: ignore private AI rule files',\n    '.agent/**/*.local.md',\n    '.agent/private/**',\n    '.github/copilot-instructions.local.md',\n    '.cursor/rules/**/*.local.{mdc,md}',\n    '.cursor/rules-private/**',\n    '.clinerules.local',\n    '.clinerules/private/**',\n    '.windsurfrules.local',\n    '.rules.local',\n    'AGENTS.local.md',\n    'CONVENTIONS.local.md',\n    'CLAUDE.local.md',\n    'GEMINI.local.md'\n  ].join('\\n')\n  \n  if (existsSync(gitignorePath)) {\n    const content = readFileSync(gitignorePath, 'utf-8')\n    \n    // Check if patterns are already present\n    if (!content.includes('# Added by dotagent:')) {\n      console.log(color.info('Updating .gitignore with private file patterns'))\n      appendFileSync(gitignorePath, '\\n\\n' + privatePatterns + '\\n', 'utf-8')\n    }\n  } else {\n    // Create new .gitignore\n    console.log(color.info('Creating .gitignore with private file patterns'))\n    writeFileSync(gitignorePath, privatePatterns + '\\n', 'utf-8')\n  }\n}\n\nmain().catch(error => {\n  console.error(color.error('Unexpected error:'))\n  console.error(error)\n  process.exit(1)\n})","export {\n  parseAgentMarkdown,\n  parseFenceEncodedMarkdown\n} from './parser.js'\n\nexport {\n  importAll,\n  importAgent,\n  importCopilot,\n  importCursor,\n  importCursorLegacy,\n  importCline,\n  importWindsurf,\n  importZed,\n  importCodex,\n  importAider,\n  importClaudeCode,\n  importOpenCode,\n  importGemini,\n  importQodo,\n  importAmazonQ,\n  importRoo,\n  importJunie\n} from './importers.js'\n\nexport {\n  toAgentMarkdown,\n  exportToAgent,\n  exportToCopilot,\n  exportToCursor,\n  exportToCline,\n  exportToWindsurf,\n  exportToZed,\n  exportToCodex,\n  exportToAider,\n  exportToClaudeCode,\n  exportToOpenCode,\n  exportToGemini,\n  exportToQodo,\n  exportToAmazonQ,\n  exportToRoo,\n  exportToJunie,\n  exportAll\n} from './exporters.js'\n\nexport type {\n  RuleMetadata,\n  RuleBlock,\n  ImportResult,\n  ImportResults,\n  ExportOptions,\n  ParserOptions\n} from './types.js'","import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport { toMarkdown } from 'mdast-util-to-markdown'\nimport yaml from 'js-yaml'\nimport type { Root, RootContent } from 'mdast'\nimport type { RuleBlock, RuleMetadata, ParserOptions } from './types.js'\n\n/**\n * @deprecated Use importAgent() instead. Single-file .agentconfig format is deprecated.\n */\nexport function parseAgentMarkdown(\n  markdown: string,\n  options: ParserOptions = {}\n): RuleBlock[] {\n  console.warn('Warning: parseAgentMarkdown() is deprecated. Use importAgent() to import from .agent/ directory instead.')\n  const processor = unified().use(remarkParse)\n  const tree = processor.parse(markdown) as Root\n\n  const rules: RuleBlock[] = []\n  let currentMetadata: RuleMetadata | null = null\n  let currentContent: RootContent[] = []\n  let currentPosition: RuleBlock['position'] | undefined\n\n  for (let i = 0; i < tree.children.length; i++) {\n    const node = tree.children[i]\n\n    // Check for HTML comment with @<id> directive\n    if (node.type === 'html' && isRuleComment(node.value)) {\n      // If we have accumulated content, save the previous rule\n      if (currentMetadata && currentContent.length > 0) {\n        rules.push({\n          metadata: currentMetadata,\n          content: nodesToMarkdown(currentContent),\n          position: currentPosition\n        })\n      }\n\n      // Parse the new metadata\n      currentMetadata = parseRuleComment(node.value)\n      currentContent = []\n      currentPosition = node.position ? {\n        start: { ...node.position.start },\n        end: { ...node.position.end }\n      } : undefined\n    }\n    // Accumulate content\n    else if (currentMetadata) {\n      currentContent.push(node)\n      if (currentPosition && node.position) {\n        currentPosition.end = { ...node.position.end }\n      }\n    }\n  }\n\n  // Don't forget the last rule\n  if (currentMetadata && currentContent.length > 0) {\n    rules.push({\n      metadata: currentMetadata,\n      content: nodesToMarkdown(currentContent),\n      position: currentPosition\n    })\n  }\n\n  return rules\n}\n\nfunction isRuleComment(html: string): boolean {\n  // Check if it contains @<id> pattern (@ followed by alphanumeric and hyphens)\n  return /<!--\\s*@[a-zA-Z0-9-]+(\\s|$)/.test(html)\n}\n\nfunction parseRuleComment(html: string): RuleMetadata {\n  // Extract @<id> and any additional metadata\n  const match = html.match(/<!--\\s*@([a-zA-Z0-9-]+)\\s*([\\s\\S]*?)\\s*-->/)\n  if (!match) {\n    throw new Error('Invalid rule comment format')\n  }\n\n  const id = match[1]\n  const metaContent = match[2].trim()\n\n  // Start with the ID from the @<id> pattern\n  const metadata: RuleMetadata = { id }\n\n  // If there's no additional content, return just the ID\n  if (!metaContent) {\n    return metadata\n  }\n\n  // Check if it looks like YAML (has newlines or starts with a YAML indicator)\n  if (metaContent.includes('\\n') || metaContent.startsWith('-') || metaContent.includes(': ')) {\n    // Try to parse as YAML\n    try {\n      const parsed = yaml.load(metaContent) as Record<string, unknown>\n      if (typeof parsed === 'object' && parsed !== null) {\n        // Merge with existing metadata, but preserve the ID from @<id>\n        return { ...parsed, id } as RuleMetadata\n      }\n    } catch {\n      // Fall through to key:value parsing\n    }\n  }\n\n  // Parse as key:value pairs\n  // First check if it's all on one line (inline format)\n  if (!metaContent.includes('\\n')) {\n    // Inline format: key:value pairs separated by spaces\n    const pairs = metaContent.matchAll(/(\\w+):(\\S+)(?:\\s|$)/g);\n    for (const [, key, value] of pairs) {\n      // Skip 'id' since we already have it from @<id>\n      if (key === 'scope' && value.includes(',')) {\n        metadata[key] = value.split(',').map(s => s.trim())\n      } else if (key === 'alwaysApply' || key === 'manual') {\n        metadata[key] = value === 'true'\n      } else if (key !== 'id') {\n        metadata[key] = value\n      }\n    }\n  } else {\n    // Multi-line format: one key:value per line\n    const lines = metaContent.split('\\n');\n    for (const line of lines) {\n      const colonIndex = line.indexOf(':');\n      if (colonIndex > 0) {\n        const key = line.substring(0, colonIndex).trim();\n        const value = line.substring(colonIndex + 1).trim();\n        \n        // Skip 'id' since we already have it from @<id>\n        if (key === 'scope' && value.includes(',')) {\n          metadata[key] = value.split(',').map(s => s.trim())\n        } else if (key === 'alwaysApply' || key === 'manual') {\n          metadata[key] = value === 'true'\n        } else if (key !== 'id' && value) {\n          metadata[key] = value\n        }\n      }\n    }\n  }\n\n  return metadata\n}\n\nfunction nodesToMarkdown(nodes: RootContent[]): string {\n  const tree: Root = {\n    type: 'root',\n    children: nodes\n  }\n\n  return toMarkdown(tree, {\n    bullet: '-',\n    emphasis: '*',\n    rule: '-'\n  }).trim()\n}\n\n// Alternative parser for fence-encoded format\nexport function parseFenceEncodedMarkdown(\n  markdown: string,\n  options: ParserOptions = {}\n): RuleBlock[] {\n  const processor = unified().use(remarkParse)\n  const tree = processor.parse(markdown) as Root\n\n  const rules: RuleBlock[] = []\n  let currentMetadata: RuleMetadata | null = null\n  let currentContent: RootContent[] = []\n  let currentPosition: RuleBlock['position'] | undefined\n\n  for (let i = 0; i < tree.children.length; i++) {\n    const node = tree.children[i]\n\n    // Check for code block with 'rule' language\n    if (node.type === 'code' && node.lang === 'rule') {\n      // Save previous rule if exists\n      if (currentMetadata && currentContent.length > 0) {\n        rules.push({\n          metadata: currentMetadata,\n          content: nodesToMarkdown(currentContent),\n          position: currentPosition\n        })\n      }\n\n      // Parse the rule metadata\n      try {\n        currentMetadata = yaml.load(node.value) as RuleMetadata\n        if (!currentMetadata.id) {\n          currentMetadata.id = `rule-${Date.now()}`\n        }\n        currentContent = []\n        currentPosition = node.position ? {\n          start: { ...node.position.start },\n          end: { ...node.position.end }\n        } : undefined\n      } catch (e) {\n        if (options.strict) {\n          throw new Error(`Failed to parse rule metadata: ${e}`)\n        }\n        // Skip invalid rule blocks in non-strict mode\n        currentMetadata = null\n      }\n    }\n    // Accumulate content after rule block\n    else if (currentMetadata) {\n      currentContent.push(node)\n      if (currentPosition && node.position) {\n        currentPosition.end = { ...node.position.end }\n      }\n    }\n  }\n\n  // Don't forget the last rule\n  if (currentMetadata && currentContent.length > 0) {\n    rules.push({\n      metadata: currentMetadata,\n      content: nodesToMarkdown(currentContent),\n      position: currentPosition\n    })\n  }\n\n  return rules\n}","import { writeFileSync, mkdirSync, existsSync } from 'fs'\nimport { join, dirname, relative } from 'path'\nimport yaml from 'js-yaml'\nimport matter from 'gray-matter'\nimport type { RuleBlock, ExportOptions } from './types.js'\nimport { grayMatterOptions } from './yaml-parser.js'\n\n/**\n * Generate conditional rules section for single-file formats\n */\nfunction generateConditionalRulesSection(rules: RuleBlock[], repoPath: string): string {\n  const sections: string[] = []\n  \n  // Separate rules by type\n  const alwaysApplyRules = rules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalRules = rules.filter(r => r.metadata.alwaysApply === false)\n  \n  if (conditionalRules.length === 0) {\n    return ''\n  }\n  \n  // Group rules by folder (e.g., workflows, components, etc.)\n  const rulesByFolder: Record<string, RuleBlock[]> = {}\n  const rulesWithScope: RuleBlock[] = []\n  const rulesWithDescription: RuleBlock[] = []\n  \n  conditionalRules.forEach(rule => {\n    // Extract folder from ID if it contains a slash\n    if (rule.metadata.id && rule.metadata.id.includes('/')) {\n      const folder = rule.metadata.id.split('/')[0]\n      if (!rulesByFolder[folder]) {\n        rulesByFolder[folder] = []\n      }\n      rulesByFolder[folder].push(rule)\n    }\n    \n    // Categorize by scope/description\n    if (rule.metadata.scope) {\n      rulesWithScope.push(rule)\n    } else if (rule.metadata.description && !rule.metadata.scope && !rule.metadata.id?.includes('/')) {\n      // Only treat as description-based if it's not in a folder\n      rulesWithDescription.push(rule)\n    }\n  })\n  \n  sections.push('## Context-Specific Rules')\n  sections.push('')\n  \n  // Add rules with scope patterns\n  if (rulesWithScope.length > 0) {\n    rulesWithScope.forEach(rule => {\n      const scopes = Array.isArray(rule.metadata.scope) ? rule.metadata.scope : [rule.metadata.scope]\n      scopes.forEach(scope => {\n        const rulePath = `.agent/${rule.metadata.id}.md`\n        const description = rule.metadata.description ? ` - ${rule.metadata.description}` : ''\n        sections.push(`When working with files matching \\`${scope}\\`, also apply:`)\n        sections.push(`→ [${rule.metadata.id}](${rulePath})${description}`)\n        sections.push('')\n      })\n    })\n  }\n  \n  // Add rules with description keywords\n  if (rulesWithDescription.length > 0) {\n    rulesWithDescription.forEach(rule => {\n      const rulePath = `.agent/${rule.metadata.id}.md`\n      sections.push(`When working with ${rule.metadata.description}, also apply:`)\n      sections.push(`→ [${rule.metadata.id}](${rulePath})`)\n      sections.push('')\n    })\n  }\n  \n  // Add folder-based sections (e.g., Workflows)\n  Object.entries(rulesByFolder).forEach(([folder, folderRules]) => {\n    // Skip if already handled above\n    const unhandledRules = folderRules.filter(r => \n      !rulesWithScope.includes(r) && !rulesWithDescription.includes(r)\n    )\n    \n    if (unhandledRules.length > 0) {\n      // Capitalize folder name for section title\n      const sectionTitle = folder.charAt(0).toUpperCase() + folder.slice(1)\n      sections.push(`## ${sectionTitle}`)\n      sections.push('')\n      \n      unhandledRules.forEach(rule => {\n        const rulePath = `.agent/${rule.metadata.id}.md`\n        const description = rule.metadata.description ? ` - ${rule.metadata.description}` : ''\n        sections.push(`→ [${rule.metadata.id}](${rulePath})${description}`)\n      })\n      sections.push('')\n    }\n  })\n  \n  return sections.join('\\n')\n}\n\n/**\n * @deprecated Use exportToAgent() instead. Single-file .agentconfig format is deprecated.\n */\nexport function toAgentMarkdown(rules: RuleBlock[]): string {\n  console.warn('Warning: toAgentMarkdown() is deprecated. Use exportToAgent() to export to .agent/ directory instead.')\n  \n  const sections: string[] = []\n\n  for (const rule of rules) {\n    const { metadata, content } = rule\n\n    // Extract id and other metadata\n    const { id, ...otherMetadata } = metadata\n\n    // Build the comment starting with @<id>\n    let metaComment = `<!-- @${id}`\n\n    // If there are other metadata properties, add them\n    if (Object.keys(otherMetadata).length > 0) {\n      // Format remaining metadata as YAML\n      const metaYaml = yaml.dump(otherMetadata, {\n        flowLevel: 1,\n        lineWidth: -1\n      }).trim()\n\n      metaComment += `\\n${metaYaml}`\n    }\n\n    metaComment += ' -->'\n\n    // Add section\n    sections.push(`${metaComment}\\n\\n${content}`)\n  }\n\n  return sections.join('\\n\\n')\n}\n\nexport function exportToCopilot(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  // Separate always-apply rules from conditional rules\n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  // Combine always-apply rules into main content\n  const mainContent = alwaysApplyRules\n    .map(rule => rule.content)\n    .join('\\n\\n---\\n\\n')\n  \n  // Add conditional rules section if there are any\n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n---\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nexport function exportToAgent(rules: RuleBlock[], outputDir: string, options?: ExportOptions): void {\n  const agentDir = join(outputDir, '.agent')\n  mkdirSync(agentDir, { recursive: true })\n\n  let topIndex = 1;\n  rules.forEach(rule => {\n    // Support nested folders based on rule ID (e.g., \"api/auth\" -> \"api/auth.md\")\n    let filename: string\n    let filePath: string\n\n    if (rule.metadata.id && rule.metadata.id.includes('/')) {\n      // Create nested structure based on ID\n      const parts = rule.metadata.id.split('/')\n      const fileName = parts.pop() + '.md'\n      const subDir = join(agentDir, ...parts)\n      mkdirSync(subDir, { recursive: true })\n      filePath = join(subDir, fileName)\n    } else {\n      if (rule.metadata.private) {\n        const prefix = String(topIndex).padStart(3, '0') + '-'\n        topIndex++\n        filename = `${prefix}${rule.metadata.id || 'rule'}.md`\n        const privDir = join(agentDir, 'private')\n        mkdirSync(privDir, { recursive: true })\n        filePath = join(privDir, filename)\n      } else {\n        filename = `${rule.metadata.id || 'rule'}.md`\n        filePath = join(agentDir, filename)\n      }\n    }\n\n    // Prepare front matter data - filter out undefined and null values\n    const frontMatterBase: Record<string, unknown> = {}\n\n    if (rule.metadata.description !== undefined && rule.metadata.description !== null) frontMatterBase.description = rule.metadata.description\n    if (rule.metadata.alwaysApply !== undefined) frontMatterBase.alwaysApply = rule.metadata.alwaysApply\n    if (rule.metadata.globs !== undefined && rule.metadata.globs !== null) frontMatterBase.globs = rule.metadata.globs\n    if (rule.metadata.manual !== undefined && rule.metadata.manual !== null) frontMatterBase.manual = rule.metadata.manual\n    if (rule.metadata.scope !== undefined && rule.metadata.scope !== null) frontMatterBase.scope = rule.metadata.scope\n    if (rule.metadata.priority !== undefined && rule.metadata.priority !== null) frontMatterBase.priority = rule.metadata.priority\n    if (rule.metadata.triggers !== undefined && rule.metadata.triggers !== null) frontMatterBase.triggers = rule.metadata.triggers\n\n    // Add other metadata fields but exclude 'private' if it's false or null\n    for (const [key, value] of Object.entries(rule.metadata)) {\n      if (!['id', 'description', 'alwaysApply', 'globs', 'manual', 'scope', 'priority', 'triggers'].includes(key) && value !== undefined && value !== null) {\n        // Don't include private: false in frontmatter\n        if (key === 'private' && value === false) continue\n        frontMatterBase[key] = value\n      }\n    }\n\n    const frontMatter = frontMatterBase\n\n    // Create Markdown content with frontmatter\n    const mdContent = matter.stringify(rule.content, frontMatter, grayMatterOptions)\n    writeFileSync(filePath, mdContent, 'utf-8')\n  })\n}\n\nexport function exportToCursor(rules: RuleBlock[], outputDir: string, options?: ExportOptions): void {\n  const rulesDir = join(outputDir, '.cursor', 'rules')\n  mkdirSync(rulesDir, { recursive: true })\n\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  for (const rule of filteredRules) {\n    // Support nested folders based on rule ID\n    let filePath: string\n    \n    if (rule.metadata.id && rule.metadata.id.includes('/')) {\n      // Create nested structure based on ID\n      const parts = rule.metadata.id.split('/')\n      const fileName = parts.pop() + '.mdc'\n      const subDir = join(rulesDir, ...parts)\n      mkdirSync(subDir, { recursive: true })\n      filePath = join(subDir, fileName)\n    } else {\n      const filename = `${rule.metadata.id || 'rule'}.mdc`\n      filePath = join(rulesDir, filename)\n    }\n\n    // Prepare front matter data - filter out undefined and null values\n    const frontMatterBase: Record<string, unknown> = {}\n\n    if (rule.metadata.description !== undefined && rule.metadata.description !== null) frontMatterBase.description = rule.metadata.description\n    if (rule.metadata.alwaysApply !== undefined) frontMatterBase.alwaysApply = rule.metadata.alwaysApply\n    if (rule.metadata.globs !== undefined && rule.metadata.globs !== null) frontMatterBase.globs = rule.metadata.globs\n    if (rule.metadata.manual !== undefined && rule.metadata.manual !== null) frontMatterBase.manual = rule.metadata.manual\n    if (rule.metadata.scope !== undefined && rule.metadata.scope !== null) frontMatterBase.scope = rule.metadata.scope\n    if (rule.metadata.priority !== undefined && rule.metadata.priority !== null) frontMatterBase.priority = rule.metadata.priority\n    if (rule.metadata.triggers !== undefined && rule.metadata.triggers !== null) frontMatterBase.triggers = rule.metadata.triggers\n\n    // Add other metadata fields but exclude 'private' if it's false or null\n    for (const [key, value] of Object.entries(rule.metadata)) {\n      if (!['id', 'description', 'alwaysApply', 'globs', 'manual', 'scope', 'priority', 'triggers'].includes(key) && value !== undefined && value !== null) {\n        // Don't include private: false in frontmatter\n        if (key === 'private' && value === false) continue\n        frontMatterBase[key] = value\n      }\n    }\n\n    const frontMatter = frontMatterBase\n\n    // Create MDC content\n    const mdcContent = matter.stringify(rule.content, frontMatter, grayMatterOptions)\n    writeFileSync(filePath, mdcContent, 'utf-8')\n  }\n}\n\nexport function exportToCline(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  if (outputPath.endsWith('.clinerules')) {\n    // Single file mode\n    const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n    const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n    \n    const mainContent = alwaysApplyRules\n      .map(rule => {\n        const header = rule.metadata.description ? `## ${rule.metadata.description}\\n\\n` : ''\n        return header + rule.content\n      })\n      .join('\\n\\n')\n    \n    const fullContent = conditionalSection \n      ? `${mainContent}\\n\\n${conditionalSection}`\n      : mainContent\n\n    ensureDirectoryExists(outputPath)\n    writeFileSync(outputPath, fullContent, 'utf-8')\n  } else {\n    // Directory mode\n    const rulesDir = join(outputPath, '.clinerules')\n    mkdirSync(rulesDir, { recursive: true })\n\n    filteredRules.forEach((rule, index) => {\n      const filename = `${String(index + 1).padStart(2, '0')}-${rule.metadata.id || 'rule'}.md`\n      const filePath = join(rulesDir, filename)\n      writeFileSync(filePath, rule.content, 'utf-8')\n    })\n  }\n}\n\nexport function exportToWindsurf(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => rule.content)\n    .join('\\n\\n')\n  \n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nexport function exportToZed(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => rule.content)\n    .join('\\n\\n')\n  \n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nfunction exportSingleFileWithHeaders(\n  rules: RuleBlock[],\n  outputPath: string,\n  options?: ExportOptions\n): void {\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => {\n      const header = rule.metadata.description ? `# ${rule.metadata.description}\\n\\n` : ''\n      return header + rule.content\n    })\n    .join('\\n\\n')\n  \n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nexport function exportToCodex(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  exportSingleFileWithHeaders(rules, outputPath, options)\n}\n\nexport function exportToAider(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => rule.content)\n    .join('\\n\\n')\n  \n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nexport function exportToClaudeCode(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  exportSingleFileWithHeaders(rules, outputPath, options)\n}\n\nexport function exportToOpenCode(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  exportSingleFileWithHeaders(rules, outputPath, options)\n}\n\nexport function exportToGemini(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const content = filteredRules\n    .map(rule => {\n      const header = rule.metadata.description ? `# ${rule.metadata.description}\\n\\n` : ''\n      return header + rule.content\n    })\n    .join('\\n\\n')\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, content, 'utf-8')\n}\n\nexport function exportToQodo(rules: RuleBlock[], outputPath: string, options?: ExportOptions): void {\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, dirname(outputPath))\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => {\n      const header = rule.metadata.description ? `# ${rule.metadata.description}\\n\\n` : ''\n      return header + rule.content\n    })\n    .join('\\n\\n---\\n\\n')\n  \n  const fullContent = conditionalSection \n    ? `${mainContent}\\n\\n---\\n\\n${conditionalSection}`\n    : mainContent\n\n  ensureDirectoryExists(outputPath)\n  writeFileSync(outputPath, fullContent, 'utf-8')\n}\n\nexport function exportToAmazonQ(rules: RuleBlock[], outputDir: string, options?: ExportOptions): void {\n  const rulesDir = join(outputDir, '.amazonq', 'rules')\n  mkdirSync(rulesDir, { recursive: true })\n\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  for (const rule of filteredRules) {\n    // Support nested folders based on rule ID\n    let filePath: string\n    \n    if (rule.metadata.id && rule.metadata.id.includes('/')) {\n      // Create nested structure based on ID\n      const parts = rule.metadata.id.split('/')\n      const fileName = parts.pop() + '.md'\n      const subDir = join(rulesDir, ...parts)\n      mkdirSync(subDir, { recursive: true })\n      filePath = join(subDir, fileName)\n    } else {\n      // Clean up the ID by removing amazonq- prefix if present\n      const cleanId = rule.metadata.id?.startsWith('amazonq-')\n        ? rule.metadata.id.substring(8)\n        : rule.metadata.id || 'rule'\n      const filename = `${cleanId}.md`\n      filePath = join(rulesDir, filename)\n    }\n\n    // Amazon Q uses simple markdown format without frontmatter\n    writeFileSync(filePath, rule.content, 'utf-8')\n  }\n}\n\nexport function exportToRoo(rules: RuleBlock[], outputDir: string, options?: ExportOptions): void {\n  const rulesDir = join(outputDir, '.roo', 'rules')\n  mkdirSync(rulesDir, { recursive: true })\n\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  for (const rule of filteredRules) {\n    // Support nested folders based on rule ID\n    let filePath: string\n    \n    if (rule.metadata.id && rule.metadata.id.includes('/')) {\n      // Create nested structure based on ID\n      const parts = rule.metadata.id.split('/')\n      const fileName = parts.pop() + '.md'\n      const subDir = join(rulesDir, ...parts)\n      mkdirSync(subDir, { recursive: true })\n      filePath = join(subDir, fileName)\n    } else {\n      const filename = `${rule.metadata.id || 'rule'}.md`\n      filePath = join(rulesDir, filename)\n    }\n\n    // Prepare front matter data - filter out undefined and null values\n    // Order matters for consistent output and test expectations\n    const frontMatterBase: Record<string, unknown> = {}\n\n    // Add fields in deterministic order: alwaysApply, description, scope, globs, manual, priority, triggers\n    if (rule.metadata.alwaysApply !== undefined) frontMatterBase.alwaysApply = rule.metadata.alwaysApply\n    if (rule.metadata.description !== undefined && rule.metadata.description !== null) frontMatterBase.description = rule.metadata.description\n    if (rule.metadata.scope !== undefined && rule.metadata.scope !== null) frontMatterBase.scope = rule.metadata.scope\n    if (rule.metadata.globs !== undefined && rule.metadata.globs !== null) frontMatterBase.globs = rule.metadata.globs\n    if (rule.metadata.manual !== undefined && rule.metadata.manual !== null) frontMatterBase.manual = rule.metadata.manual\n    if (rule.metadata.priority !== undefined && rule.metadata.priority !== null) frontMatterBase.priority = rule.metadata.priority\n    if (rule.metadata.triggers !== undefined && rule.metadata.triggers !== null) frontMatterBase.triggers = rule.metadata.triggers\n\n    // Add other metadata fields but exclude 'private' if it's false or null\n    for (const [key, value] of Object.entries(rule.metadata)) {\n      if (!['id', 'alwaysApply', 'description', 'scope', 'globs', 'manual', 'priority', 'triggers'].includes(key) && value !== undefined && value !== null) {\n        // Don't include private: false in frontmatter\n        if (key === 'private' && value === false) continue\n        frontMatterBase[key] = value\n      }\n    }\n\n    const frontMatter = frontMatterBase\n\n    // Create Markdown content with frontmatter\n    // Ensure content starts with newline for proper frontmatter formatting\n    const content = rule.content.startsWith('\\n') ? rule.content : '\\n' + rule.content\n    const mdContent = matter.stringify(content, frontMatter, grayMatterOptions)\n    writeFileSync(filePath, mdContent, 'utf-8')\n  }\n}\n\nexport function exportToJunie(rules: RuleBlock[], outputDir: string, options?: ExportOptions): void {\n  const junieDir = join(outputDir, '.junie')\n  mkdirSync(junieDir, { recursive: true })\n\n  // Filter out private rules unless includePrivate is true\n  const filteredRules = rules.filter(rule => !rule.metadata.private || options?.includePrivate)\n  \n  // Junie uses a single guidelines.md file, so we need to combine all rules\n  const alwaysApplyRules = filteredRules.filter(r => r.metadata.alwaysApply !== false)\n  const conditionalSection = generateConditionalRulesSection(filteredRules, outputDir)\n  \n  const mainContent = alwaysApplyRules\n    .map(rule => {\n      const header = rule.metadata.description ? `## ${rule.metadata.description}\\n\\n` : ''\n      return header + rule.content\n    })\n    .join('\\n\\n')\n  \n  const fullContent = conditionalSection\n    ? `${mainContent}\\n\\n${conditionalSection}`\n    : mainContent\n\n  const filePath = join(junieDir, 'guidelines.md')\n  writeFileSync(filePath, fullContent, 'utf-8')\n}\n\nexport function exportAll(rules: RuleBlock[], repoPath: string, dryRun = false, options: ExportOptions = { includePrivate: false }): void {\n  // Export to all supported formats\n  if (!dryRun) {\n    exportToAgent(rules, repoPath, options)\n    exportToCopilot(rules, join(repoPath, '.github', 'copilot-instructions.md'), options)\n    exportToCursor(rules, repoPath, options)\n    exportToCline(rules, join(repoPath, '.clinerules'), options)\n    exportToWindsurf(rules, join(repoPath, '.windsurfrules'), options)\n    exportToZed(rules, join(repoPath, '.rules'), options)\n    exportToCodex(rules, join(repoPath, 'AGENTS.md'), options)\n    exportToAider(rules, join(repoPath, 'CONVENTIONS.md'), options)\n    exportToClaudeCode(rules, join(repoPath, 'CLAUDE.md'), options)\n    exportToOpenCode(rules, join(repoPath, 'AGENTS.md'), options)\n    exportToGemini(rules, join(repoPath, 'GEMINI.md'), options)\n    exportToQodo(rules, join(repoPath, 'best_practices.md'), options)\n    exportToAmazonQ(rules, repoPath, options)\n    exportToRoo(rules, repoPath, options)\n    exportToJunie(rules, repoPath, options)\n  }\n}\n\nfunction ensureDirectoryExists(filePath: string): void {\n  const dir = dirname(filePath)\n  if (!existsSync(dir)) {\n    mkdirSync(dir, { recursive: true })\n  }\n}","// ANSI color codes for terminal output\nconst colors = {\n  reset: '\\x1b[0m',\n  bright: '\\x1b[1m',\n  dim: '\\x1b[2m',\n  \n  // Foreground colors\n  red: '\\x1b[31m',\n  green: '\\x1b[32m',\n  yellow: '\\x1b[33m',\n  blue: '\\x1b[34m',\n  magenta: '\\x1b[35m',\n  cyan: '\\x1b[36m',\n  gray: '\\x1b[90m',\n  \n  // Background colors\n  bgRed: '\\x1b[41m',\n  bgGreen: '\\x1b[42m',\n  bgYellow: '\\x1b[43m',\n}\n\n// Check if colors are supported\nfunction supportsColor(): boolean {\n  if (process.env.NO_COLOR) return false\n  if (process.env.TERM === 'dumb') return false\n  if (process.env.COLORTERM) return true\n  if (process.env.TERM?.includes('color')) return true\n  // Default to false for safety in tests\n  return false\n}\n\nexport function colorize(text: string, color: keyof typeof colors): string {\n  if (!supportsColor()) return text\n  return `${colors[color]}${text}${colors.reset}`\n}\n\nexport const color = {\n  // Status messages\n  success: (text: string) => colorize(`✓ ${text}`, 'green'),\n  error: (text: string) => colorize(`✗ ${text}`, 'red'),\n  warning: (text: string) => colorize(`⚠ ${text}`, 'yellow'),\n  info: (text: string) => colorize(`ℹ ${text}`, 'blue'),\n  \n  // Text formatting\n  bold: (text: string) => colorize(text, 'bright'),\n  dim: (text: string) => colorize(text, 'dim'),\n  \n  // Semantic colors\n  path: (text: string) => colorize(text, 'cyan'),\n  command: (text: string) => colorize(text, 'magenta'),\n  number: (text: string) => colorize(text, 'yellow'),\n  format: (text: string) => colorize(text, 'blue'),\n  \n  // Raw colors\n  red: (text: string) => colorize(text, 'red'),\n  green: (text: string) => colorize(text, 'green'),\n  yellow: (text: string) => colorize(text, 'yellow'),\n  blue: (text: string) => colorize(text, 'blue'),\n  gray: (text: string) => colorize(text, 'gray'),\n}\n\n// Helper for creating formatted lists\nexport function formatList(items: string[], prefix = '  '): string {\n  return items.map(item => `${prefix}${color.dim('•')} ${item}`).join('\\n')\n}\n\n// Helper for creating a header\nexport function header(text: string): string {\n  const line = color.dim('─'.repeat(text.length + 4))\n  return `\\n${line}\\n${color.bold(`  ${text}  `)}\\n${line}\\n`\n}","import { select as inquirerSelect, confirm as inquirerConfirm } from '@inquirer/prompts'\n\nexport async function confirm(question: string, defaultValue = false): Promise<boolean> {\n  // Check if we're in a non-interactive environment\n  if (!process.stdin.isTTY || process.env.NODE_ENV === 'test') {\n    return defaultValue\n  }\n  \n  return await inquirerConfirm({\n    message: question,\n    default: defaultValue\n  })\n}\n\nexport async function select<T>(\n  message: string,\n  choices: Array<{ name: string; value: T }>,\n  defaultIndex = 0\n): Promise<T> {\n  // Convert to inquirer format\n  const inquirerChoices = choices.map((choice, index) => ({\n    name: choice.name,\n    value: choice.value,\n    // Set the default based on index\n    ...(index === defaultIndex ? { default: true } : {})\n  }))\n\n  return await inquirerSelect({\n    message,\n    choices: inquirerChoices\n  })\n}\n\n// Keep prompt function for backwards compatibility if needed\nexport async function prompt(question: string): Promise<string> {\n  // For now, we'll just throw an error if this is called\n  // since it's not used in the current codebase\n  throw new Error('prompt() is deprecated. Use select() or confirm() instead.')\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACQO,SAAS,uBAAuB;AACrC,SAAO;AAAA,IACL,OAAO,CAAC,QAAwB;AAG9B,YAAM,eAAe,IAAI;AAAA,QACvB;AAAA,QACA,CAAC,OAAO,QAAQ,OAAO,WAAW;AAEhC,cAAI,MAAM,WAAW,GAAG,KAAK,MAAM,WAAW,GAAG,GAAG;AAClD,mBAAO;AAAA,UACT;AAEA,iBAAO,GAAG,MAAM,IAAI,KAAK,IAAI,MAAM;AAAA,QACrC;AAAA,MACF;AAGA,YAAM,oBAAoB,aAAa;AAAA,QACrC;AAAA,QACA,CAAC,OAAO,QAAQ,OAAO,WAAW;AAEhC,cAAI,MAAM,WAAW,GAAG,KAAK,MAAM,WAAW,GAAG,GAAG;AAClD,mBAAO;AAAA,UACT;AAEA,iBAAO,GAAG,MAAM,IAAI,KAAK,IAAI,MAAM;AAAA,QACrC;AAAA,MACF;AAEA,UAAI;AACF,eAAO,gBAAAA,QAAK,KAAK,iBAAiB;AAAA,MACpC,SAAS,OAAO;AAEd,eAAO,gBAAAA,QAAK,KAAK,GAAG;AAAA,MACtB;AAAA,IACF;AAAA,IACA,WAAW,CAAC,SAAiB;AAC3B,YAAM,aAAa,gBAAAA,QAAK,KAAK,IAAI;AACjC,YAAM,QAAQ,WAAW,MAAM,OAAO;AACtC,YAAM,MAAgB,CAAC;AACvB,UAAI,eAAe;AACnB,UAAI,cAAc;AAClB,YAAM,eAAe,CAAC,MAAc,EAAE,SAAS,GAAG;AAElD,eAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,YAAI,OAAO,MAAM,CAAC;AAGlB,cAAM,aAAa,KAAK,MAAM,sBAAsB;AACpD,YAAI,YAAY;AACd,wBAAc,WAAW,CAAC;AAC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AAAA,IACf;AAAA,IACA;AAAA,IACA,GAAG,MAAM,IAAI,OAAK,EAAE,SAAS,GAAG,IAAI,IAAI,OAAO,CAAC;AAAA,IAChD;AAAA,EACF,EAAE,KAAK,IAAI;AAEX,UAAI,uBAAW,aAAa,GAAG;AAC7B,UAAM,cAAU,yBAAa,eAAe,OAAO;AAGnD,UAAM,cAAc,kBAAkB,SAAS,KAAK;AAEpD,QAAI,YAAY,SAAS,GAAG;AAC1B,qCAAe,eAAe,QAAQ;AACtC,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,OAAO;AACL,kCAAc,eAAe,SAAS,KAAK,IAAI,IAAI;AACnD,WAAO;AAAA,EACT;AACF;AAoCA,KAAK,EAAE,MAAM,WAAS;AACpB,UAAQ,MAAM,MAAM,MAAM,mBAAmB,CAAC;AAC9C,UAAQ,MAAM,KAAK;AACnB,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["yaml","import_js_yaml","matter","findMdFiles","import_fs","import_path","import_fs","import_path","import_js_yaml","import_gray_matter","matter","header","color","inquirerConfirm","inquirerSelect","importCopilot","importCursor","importCline","importWindsurf","importZed","importCodex","importAider","importClaudeCode","importGemini","importQodo"]}