kirograph 0.27.1 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +35 -2
  2. package/dist/bin/commands/annotations.js +56 -0
  3. package/dist/bin/commands/annotations.js.map +7 -0
  4. package/dist/bin/commands/ast-rewrite.js +55 -0
  5. package/dist/bin/commands/ast-rewrite.js.map +7 -0
  6. package/dist/bin/commands/bench.js +103 -0
  7. package/dist/bin/commands/bench.js.map +7 -0
  8. package/dist/bin/commands/branch.js +133 -0
  9. package/dist/bin/commands/branch.js.map +7 -0
  10. package/dist/bin/commands/callees.js +76 -0
  11. package/dist/bin/commands/callees.js.map +7 -0
  12. package/dist/bin/commands/callers.js +76 -0
  13. package/dist/bin/commands/callers.js.map +7 -0
  14. package/dist/bin/commands/changelog.js +55 -0
  15. package/dist/bin/commands/changelog.js.map +7 -0
  16. package/dist/bin/commands/circular-deps.js +68 -0
  17. package/dist/bin/commands/circular-deps.js.map +7 -0
  18. package/dist/bin/commands/commit-context.js +55 -0
  19. package/dist/bin/commands/commit-context.js.map +7 -0
  20. package/dist/bin/commands/complexity.js +60 -0
  21. package/dist/bin/commands/complexity.js.map +7 -0
  22. package/dist/bin/commands/cost.js +146 -0
  23. package/dist/bin/commands/cost.js.map +7 -0
  24. package/dist/bin/commands/dependency-depth.js +55 -0
  25. package/dist/bin/commands/dependency-depth.js.map +7 -0
  26. package/dist/bin/commands/diff-context.js +55 -0
  27. package/dist/bin/commands/diff-context.js.map +7 -0
  28. package/dist/bin/commands/distribution.js +56 -0
  29. package/dist/bin/commands/distribution.js.map +7 -0
  30. package/dist/bin/commands/doc-coverage.js +56 -0
  31. package/dist/bin/commands/doc-coverage.js.map +7 -0
  32. package/dist/bin/commands/doctor.js +202 -0
  33. package/dist/bin/commands/doctor.js.map +7 -0
  34. package/dist/bin/commands/dsm.js +56 -0
  35. package/dist/bin/commands/dsm.js.map +7 -0
  36. package/dist/bin/commands/gini.js +55 -0
  37. package/dist/bin/commands/gini.js.map +7 -0
  38. package/dist/bin/commands/god-class.js +56 -0
  39. package/dist/bin/commands/god-class.js.map +7 -0
  40. package/dist/bin/commands/health.js +55 -0
  41. package/dist/bin/commands/health.js.map +7 -0
  42. package/dist/bin/commands/help.js +224 -45
  43. package/dist/bin/commands/help.js.map +2 -2
  44. package/dist/bin/commands/impact.js +76 -0
  45. package/dist/bin/commands/impact.js.map +7 -0
  46. package/dist/bin/commands/inheritance-depth.js +56 -0
  47. package/dist/bin/commands/inheritance-depth.js.map +7 -0
  48. package/dist/bin/commands/insert-at.js +55 -0
  49. package/dist/bin/commands/insert-at.js.map +7 -0
  50. package/dist/bin/commands/largest.js +56 -0
  51. package/dist/bin/commands/largest.js.map +7 -0
  52. package/dist/bin/commands/manifest.js +158 -0
  53. package/dist/bin/commands/manifest.js.map +7 -0
  54. package/dist/bin/commands/module-api.js +57 -0
  55. package/dist/bin/commands/module-api.js.map +7 -0
  56. package/dist/bin/commands/monitor.js +91 -0
  57. package/dist/bin/commands/monitor.js.map +7 -0
  58. package/dist/bin/commands/multi-replace.js +66 -0
  59. package/dist/bin/commands/multi-replace.js.map +7 -0
  60. package/dist/bin/commands/pr-context.js +55 -0
  61. package/dist/bin/commands/pr-context.js.map +7 -0
  62. package/dist/bin/commands/query.js +19 -1
  63. package/dist/bin/commands/query.js.map +3 -3
  64. package/dist/bin/commands/rank.js +56 -0
  65. package/dist/bin/commands/rank.js.map +7 -0
  66. package/dist/bin/commands/read.js +1 -1
  67. package/dist/bin/commands/read.js.map +2 -2
  68. package/dist/bin/commands/recursion.js +56 -0
  69. package/dist/bin/commands/recursion.js.map +7 -0
  70. package/dist/bin/commands/rename-preview.js +56 -0
  71. package/dist/bin/commands/rename-preview.js.map +7 -0
  72. package/dist/bin/commands/session.js +60 -0
  73. package/dist/bin/commands/session.js.map +7 -0
  74. package/dist/bin/commands/simplify-scan.js +56 -0
  75. package/dist/bin/commands/simplify-scan.js.map +7 -0
  76. package/dist/bin/commands/str-replace.js +55 -0
  77. package/dist/bin/commands/str-replace.js.map +7 -0
  78. package/dist/bin/commands/test-coverage.js +59 -0
  79. package/dist/bin/commands/test-coverage.js.map +7 -0
  80. package/dist/bin/commands/test-map.js +56 -0
  81. package/dist/bin/commands/test-map.js.map +7 -0
  82. package/dist/bin/commands/test-risk.js +59 -0
  83. package/dist/bin/commands/test-risk.js.map +7 -0
  84. package/dist/bin/commands/type-hierarchy.js +76 -0
  85. package/dist/bin/commands/type-hierarchy.js.map +7 -0
  86. package/dist/bin/commands/unused-imports.js +55 -0
  87. package/dist/bin/commands/unused-imports.js.map +7 -0
  88. package/dist/bin/commands/upgrade.js +78 -0
  89. package/dist/bin/commands/upgrade.js.map +7 -0
  90. package/dist/bin/installer/common.js +19 -9
  91. package/dist/bin/installer/common.js.map +2 -2
  92. package/dist/bin/installer/config-prompt.js +147 -12
  93. package/dist/bin/installer/config-prompt.js.map +3 -3
  94. package/dist/bin/installer/index.js +62 -6
  95. package/dist/bin/installer/index.js.map +2 -2
  96. package/dist/bin/installer/instructions.js +14 -25
  97. package/dist/bin/installer/instructions.js.map +2 -2
  98. package/dist/bin/installer/mcp.js.map +2 -2
  99. package/dist/bin/installer/steering.js +569 -100
  100. package/dist/bin/installer/steering.js.map +2 -2
  101. package/dist/bin/installer/targets/aider.js +3 -3
  102. package/dist/bin/installer/targets/aider.js.map +2 -2
  103. package/dist/bin/installer/targets/amp.js +3 -3
  104. package/dist/bin/installer/targets/amp.js.map +2 -2
  105. package/dist/bin/installer/targets/antigravity.js +4 -4
  106. package/dist/bin/installer/targets/antigravity.js.map +2 -2
  107. package/dist/bin/installer/targets/augment.js +3 -3
  108. package/dist/bin/installer/targets/augment.js.map +2 -2
  109. package/dist/bin/installer/targets/claude.js +3 -3
  110. package/dist/bin/installer/targets/claude.js.map +2 -2
  111. package/dist/bin/installer/targets/cline.js +4 -4
  112. package/dist/bin/installer/targets/cline.js.map +2 -2
  113. package/dist/bin/installer/targets/codex.js +4 -4
  114. package/dist/bin/installer/targets/codex.js.map +2 -2
  115. package/dist/bin/installer/targets/continue.js +4 -4
  116. package/dist/bin/installer/targets/continue.js.map +2 -2
  117. package/dist/bin/installer/targets/copilot-cli.js +4 -4
  118. package/dist/bin/installer/targets/copilot-cli.js.map +2 -2
  119. package/dist/bin/installer/targets/copilot.js +4 -4
  120. package/dist/bin/installer/targets/copilot.js.map +2 -2
  121. package/dist/bin/installer/targets/cursor.js +5 -5
  122. package/dist/bin/installer/targets/cursor.js.map +2 -2
  123. package/dist/bin/installer/targets/devin.js +4 -4
  124. package/dist/bin/installer/targets/devin.js.map +2 -2
  125. package/dist/bin/installer/targets/gemini-cli.js +4 -4
  126. package/dist/bin/installer/targets/gemini-cli.js.map +2 -2
  127. package/dist/bin/installer/targets/generic.js +2 -2
  128. package/dist/bin/installer/targets/generic.js.map +2 -2
  129. package/dist/bin/installer/targets/goose.js +3 -4
  130. package/dist/bin/installer/targets/goose.js.map +3 -3
  131. package/dist/bin/installer/targets/index.js.map +1 -1
  132. package/dist/bin/installer/targets/junie.js +4 -4
  133. package/dist/bin/installer/targets/junie.js.map +2 -2
  134. package/dist/bin/installer/targets/kilo.js +4 -4
  135. package/dist/bin/installer/targets/kilo.js.map +2 -2
  136. package/dist/bin/installer/targets/kiro.js +27 -3
  137. package/dist/bin/installer/targets/kiro.js.map +2 -2
  138. package/dist/bin/installer/targets/opencode.js +3 -3
  139. package/dist/bin/installer/targets/opencode.js.map +2 -2
  140. package/dist/bin/installer/targets/openhands.js +3 -3
  141. package/dist/bin/installer/targets/openhands.js.map +2 -2
  142. package/dist/bin/installer/targets/qoder.js +2 -2
  143. package/dist/bin/installer/targets/qoder.js.map +2 -2
  144. package/dist/bin/installer/targets/qwen.js +2 -2
  145. package/dist/bin/installer/targets/qwen.js.map +2 -2
  146. package/dist/bin/installer/targets/replit.js +3 -3
  147. package/dist/bin/installer/targets/replit.js.map +2 -2
  148. package/dist/bin/installer/targets/roo.js +4 -4
  149. package/dist/bin/installer/targets/roo.js.map +2 -2
  150. package/dist/bin/installer/targets/tabnine.js +3 -3
  151. package/dist/bin/installer/targets/tabnine.js.map +2 -2
  152. package/dist/bin/installer/targets/trae.js +3 -3
  153. package/dist/bin/installer/targets/trae.js.map +2 -2
  154. package/dist/bin/installer/targets/warp.js +4 -4
  155. package/dist/bin/installer/targets/warp.js.map +2 -2
  156. package/dist/bin/installer/targets/windsurf.js +4 -4
  157. package/dist/bin/installer/targets/windsurf.js.map +2 -2
  158. package/dist/bin/kirograph.js +83 -1
  159. package/dist/bin/kirograph.js.map +3 -3
  160. package/dist/config.js +30 -8
  161. package/dist/config.js.map +2 -2
  162. package/dist/core/branch-manager.js +111 -0
  163. package/dist/core/branch-manager.js.map +7 -0
  164. package/dist/core/pipeline.js +3 -3
  165. package/dist/core/pipeline.js.map +2 -2
  166. package/dist/data/pixelrag-bridge.js +93 -0
  167. package/dist/data/pixelrag-bridge.js.map +7 -0
  168. package/dist/data/pixelrag-manager.js +416 -0
  169. package/dist/data/pixelrag-manager.js.map +7 -0
  170. package/dist/db/database.js +34 -7
  171. package/dist/db/database.js.map +2 -2
  172. package/dist/db/schema.sql +7 -1
  173. package/dist/extraction/complexity.js +116 -0
  174. package/dist/extraction/complexity.js.map +7 -0
  175. package/dist/extraction/extractor.js +52 -1
  176. package/dist/extraction/extractor.js.map +2 -2
  177. package/dist/graph/git-context.js +229 -0
  178. package/dist/graph/git-context.js.map +7 -0
  179. package/dist/index.js +4 -2
  180. package/dist/index.js.map +2 -2
  181. package/dist/mcp/cache.js +1 -1
  182. package/dist/mcp/cache.js.map +2 -2
  183. package/dist/mcp/handler.js +446 -0
  184. package/dist/mcp/handler.js.map +7 -0
  185. package/dist/mcp/handlers/architecture.js +297 -0
  186. package/dist/mcp/handlers/architecture.js.map +7 -0
  187. package/dist/mcp/handlers/branch.js +175 -0
  188. package/dist/mcp/handlers/branch.js.map +7 -0
  189. package/dist/mcp/handlers/code-health.js +563 -0
  190. package/dist/mcp/handlers/code-health.js.map +7 -0
  191. package/dist/mcp/handlers/complexity.js +267 -0
  192. package/dist/mcp/handlers/complexity.js.map +7 -0
  193. package/dist/mcp/handlers/core.js +611 -0
  194. package/dist/mcp/handlers/core.js.map +7 -0
  195. package/dist/mcp/handlers/data.js +337 -0
  196. package/dist/mcp/handlers/data.js.map +7 -0
  197. package/dist/mcp/handlers/docs.js +159 -0
  198. package/dist/mcp/handlers/docs.js.map +7 -0
  199. package/dist/mcp/handlers/edit-primitives.js +200 -0
  200. package/dist/mcp/handlers/edit-primitives.js.map +7 -0
  201. package/dist/mcp/handlers/git-context.js +286 -0
  202. package/dist/mcp/handlers/git-context.js.map +7 -0
  203. package/dist/mcp/handlers/memory.js +363 -0
  204. package/dist/mcp/handlers/memory.js.map +7 -0
  205. package/dist/mcp/handlers/patterns.js +310 -0
  206. package/dist/mcp/handlers/patterns.js.map +7 -0
  207. package/dist/mcp/handlers/security.js +699 -0
  208. package/dist/mcp/handlers/security.js.map +7 -0
  209. package/dist/mcp/handlers/utils.js +97 -0
  210. package/dist/mcp/handlers/utils.js.map +7 -0
  211. package/dist/mcp/handlers/watchmen.js +104 -0
  212. package/dist/mcp/handlers/watchmen.js.map +7 -0
  213. package/dist/mcp/handlers/wiki.js +242 -0
  214. package/dist/mcp/handlers/wiki.js.map +7 -0
  215. package/dist/mcp/server.js +72 -3
  216. package/dist/mcp/server.js.map +2 -2
  217. package/dist/mcp/tool-names.js +136 -10
  218. package/dist/mcp/tool-names.js.map +2 -2
  219. package/dist/mcp/tools.js +846 -3019
  220. package/dist/mcp/tools.js.map +3 -3
  221. package/dist/types.js.map +2 -2
  222. package/package.json +36 -10
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/bin/installer/steering.ts"],
4
- "sourcesContent": ["/**\n * KiroGraph Installer: Kiro steering file\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CAVEMAN_RULES, CavemanMode } from './caveman';\n\n\n// \u2500\u2500 Compression section builder (level-aware) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\\\\\`\\\\\\`\\\\\\``,\n aggressive: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\\\\\`\\\\\\`\\\\\\``,\n ultra: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\\\\\`\\\\\\`\\\\\\``,\n};\n\nfunction buildCompressionSection(level: 'normal' | 'aggressive' | 'ultra'): string {\n return `\n---\n\n## Shell Compression (\\\\\\`kirograph_exec\\\\\\`)\n\nWhen running shell commands, prefer \\\\\\`kirograph_exec\\\\\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\\\\\`kirograph_exec\\\\\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\\\\\`kirograph_gain\\\\\\` to check token savings statistics.`;\n}\n\nexport interface SteeringOptions {\n cavemanMode?: CavemanMode | 'off';\n enableCompression?: boolean;\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n enableArchitecture?: boolean;\n enableMemory?: boolean;\n enableDocs?: boolean;\n enableData?: boolean;\n enableSecurity?: boolean;\n enablePatterns?: boolean;\n enableWiki?: boolean;\n enableCodeHealth?: boolean;\n enableAdvancedAnalysis?: boolean;\n enableAgentUtils?: boolean;\n trackCallSites?: boolean;\n}\n\nfunction buildSteeringContent(opts?: SteeringOptions): string {\n const cavemanMode = opts?.cavemanMode;\n const enableCompression = opts?.enableCompression !== false && opts?.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts?.shellCompressionLevel ?? 'normal';\n const enableArchitecture = opts?.enableArchitecture ?? false;\n const enableMemory = opts?.enableMemory ?? false;\n const enableDocs = opts?.enableDocs ?? false;\n const enableData = opts?.enableData ?? false;\n const enableSecurity = opts?.enableSecurity ?? false;\n const enablePatterns = opts?.enablePatterns ?? false;\n const enableWiki = opts?.enableWiki ?? false;\n const enableCodeHealth = opts?.enableCodeHealth ?? false;\n const enableAdvancedAnalysis = opts?.enableAdvancedAnalysis ?? false;\n const enableAgentUtils = opts?.enableAgentUtils ?? false;\n const trackCallSites = opts?.trackCallSites ?? false;\n\n // Build guide rows\n const guideRows: string[] = [\n '| Where do I start on this task? | `kirograph_context` |',\n '| What is this symbol / show me its code | `kirograph_node` with `includeCode: true` |',\n '| Find a symbol by name | `kirograph_search` |',\n ...(trackCallSites ? [\n '| Who calls function X? | `kirograph_callers` |',\n '| What does function X call? | `kirograph_callees` |',\n ] : []),\n '| What breaks if I change X? | `kirograph_impact` |',\n '| How are X and Y connected? | `kirograph_path` |',\n ...(enableAdvancedAnalysis ? ['| What extends / implements this type? | `kirograph_type_hierarchy` |'] : []),\n ...(enableCodeHealth ? [\n '| Which code is never called? | `kirograph_dead_code` |',\n '| Are there import cycles? | `kirograph_circular_deps` |',\n ] : []),\n '| What files are indexed? | `kirograph_files` |',\n '| Is the index healthy? | `kirograph_status` |',\n ...(enableCodeHealth ? [\n '| What are the most critical symbols? | `kirograph_hotspots` |',\n '| Any unexpected cross-module coupling? | `kirograph_surprising` |',\n '| What changed since the last snapshot? | `kirograph_diff` |',\n ] : []),\n ...(enableArchitecture ? [\n '| What packages/layers exist? | `kirograph_architecture` |',\n '| How coupled is package X? | `kirograph_coupling` |',\n '| What does package X depend on? | `kirograph_package` |',\n ] : []),\n ...(enableCompression ? ['| Run a command with token savings | `kirograph_exec` |'] : []),\n ...(enableAgentUtils ? ['| Check token savings stats | `kirograph_gain` |'] : []),\n ...(enableData ? [\n '| What data files are indexed? | `kirograph_data_list` |',\n '| What columns does this dataset have? | `kirograph_data_describe` |',\n '| Query rows with filters | `kirograph_data_query` |',\n '| Aggregate data (sum, avg, count) | `kirograph_data_aggregate` |',\n ] : []),\n ...(enableSecurity ? [\n '| Are there vulnerable dependencies? | `kirograph_security` |',\n '| Which CVEs affect my project? | `kirograph_vulns` |',\n '| Is this vulnerability reachable? | `kirograph_reachability` |',\n '| What licenses do my dependencies use? | `kirograph_licenses` |',\n '| Are dependencies outdated? | `kirograph_staleness` |',\n '| Generate SBOM/VEX | `kirograph_sbom` / `kirograph_vex` |',\n '| Add a private CVE | `kirograph_vuln_add` |',\n ] : []),\n ...(enablePatterns ? ['| Find structural code patterns? | `kirograph_live_search` |'] : []),\n ];\n\n // Build tool reference sections\n let toolRef = `\n## Tool reference\n\n### \\`kirograph_context\\`: **start here for any code task**\n\nReturns entry points, related symbols, and code snippets for a natural-language task description. Usually enough to orient without any additional tool calls.\n\n\\`\\`\\`\nkirograph_context(task: \"fix the auth token expiry bug\")\nkirograph_context(task: \"add dark mode\", maxNodes: 30)\nkirograph_context(task: \"refactor payment service\", includeCode: false)\n\\`\\`\\`\n\n### \\`kirograph_search\\`: find symbols by name\n\nExact match \u2192 FTS \u2192 LIKE fallback \u2192 vector (last resort). Use instead of grep.\n\n\\`\\`\\`\nkirograph_search(query: \"signIn\")\nkirograph_search(query: \"UserService\", kind: \"class\")\nkirograph_search(query: \"auth\", limit: 20)\n\\`\\`\\`\n\nSupported kinds: \\`function\\`, \\`method\\`, \\`class\\`, \\`interface\\`, \\`type_alias\\`, \\`variable\\`, \\`route\\`, \\`component\\`\n\n### \\`kirograph_node\\`: inspect a symbol\n\nReturns kind, file, signature, docstring. Add \\`includeCode: true\\` to get the full source.\n\n\\`\\`\\`\nkirograph_node(symbol: \"validateToken\")\nkirograph_node(symbol: \"AuthService\", includeCode: true)\n\\`\\`\\``;\n\n if (trackCallSites) {\n toolRef += `\n\n### \\`kirograph_callers\\`: who calls this?\n\nBFS over incoming \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callers(symbol: \"processPayment\", limit: 30)\n\\`\\`\\`\n\n### \\`kirograph_callees\\`: what does this call?\n\nBFS over outgoing \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callees(symbol: \"handleRequest\")\n\\`\\`\\``;\n }\n\n toolRef += `\n\n### \\`kirograph_impact\\`: blast radius before a change\n\nTraverses all incoming edges up to \\`depth\\` hops. Call this before editing a symbol.\n\n\\`\\`\\`\nkirograph_impact(symbol: \"UserRepository\", depth: 3)\n\\`\\`\\`\n\n### \\`kirograph_path\\`: how are two symbols connected?\n\nBFS shortest path across all edge types.\n\n\\`\\`\\`\nkirograph_path(from: \"LoginController\", to: \"DatabasePool\")\n\\`\\`\\``;\n\n if (enableAdvancedAnalysis) {\n toolRef += `\n\n### \\`kirograph_type_hierarchy\\`: class/interface inheritance\n\n\\`\\`\\`\nkirograph_type_hierarchy(symbol: \"BaseRepository\", direction: \"down\") // derived types\nkirograph_type_hierarchy(symbol: \"PaymentService\", direction: \"up\") // base types\nkirograph_type_hierarchy(symbol: \"IUserStore\", direction: \"both\") // all\n\\`\\`\\``;\n }\n\n if (enableCodeHealth) {\n toolRef += `\n\n### \\`kirograph_dead_code\\`: unreferenced symbols\n\nReturns unexported symbols with zero incoming edges. Good first step when cleaning up.\n\n\\`\\`\\`\nkirograph_dead_code(limit: 50)\n\\`\\`\\`\n\n### \\`kirograph_circular_deps\\`: import cycles\n\nRuns Tarjan's SCC over import edges. No parameters needed.\n\n\\`\\`\\`\nkirograph_circular_deps()\n\\`\\`\\``;\n }\n\n toolRef += `\n\n### \\`kirograph_files\\`: indexed file structure\n\n\\`\\`\\`\nkirograph_files(format: \"tree\") // default\nkirograph_files(format: \"flat\") // one path per line\nkirograph_files(format: \"grouped\") // by directory\nkirograph_files(filterPath: \"src/auth\", maxDepth: 2)\nkirograph_files(pattern: \"**/*.test.ts\")\n\\`\\`\\`\n\n### \\`kirograph_status\\`: index health\n\nReturns file count, symbol count, edge count, embedding coverage, DB size. Call when something feels off.`;\n\n if (enableCodeHealth) {\n toolRef += `\n\n### \\`kirograph_hotspots\\`: most-connected symbols\n\nReturns the top-N symbols by total edge degree (in + out, excluding structural \\`contains\\` edges). Use to find core abstractions, identify high blast-radius symbols before a refactor, or understand what the codebase revolves around.\n\n\\`\\`\\`\nkirograph_hotspots(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_surprising\\`: unexpected cross-module coupling\n\nFinds direct edges between symbols in structurally distant files, scored by path distance \u00D7 edge-kind weight. Use before a refactor to discover hidden dependencies that will break. High score = more unexpected.\n\n\\`\\`\\`\nkirograph_surprising(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_diff\\`: what changed since a snapshot?\n\nCompares the current graph against a saved snapshot. Shows added/removed symbols and edges. A snapshot must exist: the user saves one with \\`kirograph snapshot save <label>\\` before making changes.\n\n\\`\\`\\`\nkirograph_diff() // vs latest snapshot\nkirograph_diff(snapshot: \"pre-refactor\") // vs named snapshot\n\\`\\`\\``;\n }\n\n // Architecture tools block\n if (enableArchitecture) {\n toolRef += `\n\n---\n\n## Architecture tools *(require \\`enableArchitecture: true\\` in config)*\n\n### \\`kirograph_architecture\\`: **start here for architectural questions**\n\nReturns the full package graph, detected layers (api/service/data/ui/shared), and their dependency edges.\n\n\\`\\`\\`\nkirograph_architecture() // packages + layers\nkirograph_architecture(level: \"packages\")\nkirograph_architecture(level: \"layers\")\nkirograph_architecture(includeFiles: true) // add file\u2192package assignments\n\\`\\`\\`\n\n### \\`kirograph_coupling\\`: stability metrics per package\n\nReturns Ca (afferent: depended on by), Ce (efferent: depends on), and instability (Ce/(Ca+Ce)).\n- High Ca + low instability = load-bearing, safe to depend on, risky to change interface.\n- High Ce + high instability = depends on many things, safe to refactor internals.\n\n\\`\\`\\`\nkirograph_coupling() // all packages, sorted by instability\nkirograph_coupling(sortBy: \"afferent\") // most depended-on first\nkirograph_coupling(sortBy: \"efferent\") // most outgoing deps first\n\\`\\`\\`\n\n### \\`kirograph_package\\`: drill into one package\n\nReturns metadata, coupling metrics, outgoing deps, incoming dependents, and file list.\n\n\\`\\`\\`\nkirograph_package(package: \"auth\")\nkirograph_package(package: \"src/services\", includeFiles: false)\n\\`\\`\\``;\n }\n\n // Build bug fix workflow\n let bugFixWorkflow = `**Bug fix or feature:**\n1. \\`kirograph_context\\`: orient, find entry points.\n2. \\`kirograph_node\\` with \\`includeCode: true\\`: read the relevant symbol.`;\n if (trackCallSites) {\n bugFixWorkflow += `\n3. \\`kirograph_callers\\` / \\`kirograph_callees\\`: trace the call flow.\n4. \\`kirograph_impact\\`: check blast radius before editing.`;\n } else {\n bugFixWorkflow += `\n3. \\`kirograph_impact\\`: check blast radius before editing.`;\n }\n\n // Build workflows section\n let workflows = `\n\n---\n\n## Workflows\n\n${bugFixWorkflow}`;\n\n if (enableCodeHealth) {\n workflows += `\n\n**Refactor planning:**\n1. \\`kirograph_hotspots\\`: identify the most-connected symbols; changing these is risky.\n2. \\`kirograph_surprising\\`: surface hidden coupling that will break.\n3. \\`kirograph_impact\\` on specific targets: confirm blast radius.\n4. \\`kirograph_diff\\` after the refactor: verify the structural change matches intent.`;\n }\n\n if (enableArchitecture) {\n workflows += `\n\n**Architectural review:**\n1. \\`kirograph_architecture\\`: get the package and layer map.\n2. \\`kirograph_coupling\\`: find the most stable (high Ca) and most volatile (high instability) packages.\n3. \\`kirograph_package\\`: drill into any package of interest.\n4. \\`kirograph_circular_deps\\`: check for import cycles.`;\n }\n\n if (enableCodeHealth) {\n workflows += `\n\n**Code cleanup:**\n1. \\`kirograph_dead_code\\`: find unreferenced unexported symbols.\n2. \\`kirograph_circular_deps\\`: find import cycles to untangle.\n3. \\`kirograph_surprising\\`: find unexpected coupling to decouple.`;\n }\n\n // Build workflow steering rows\n const workflowRows: string[] = [\n ...(enableSecurity ? ['| security audit, check vulnerabilities, CVE review | `.kiro/steering/kirograph-security.md` |'] : []),\n '| code review, review this PR | `.kiro/steering/kirograph-review.md` |',\n '| debug, trace this bug, root cause | `.kiro/steering/kirograph-debug.md` |',\n ...(enableArchitecture ? ['| architecture, understand structure, package map | `.kiro/steering/kirograph-architecture.md` |'] : []),\n '| onboard, understand this codebase | `.kiro/steering/kirograph-onboard.md` |',\n '| refactor, rename, safe refactoring | `.kiro/steering/kirograph-refactor.md` |',\n ...(enableMemory ? ['| memory, recall decisions, conflict detection | `.kiro/steering/kirograph-mem-workflow.md` |'] : []),\n ...(enableWiki ? ['| wiki, update knowledge base, ingest docs | `.kiro/steering/kirograph-wiki-workflow.md` |'] : []),\n ];\n\n const workflowSection = `\n\n---\n\n## Workflow steering files\n\nKiroGraph installs task-specific steering files in \\`.kiro/steering/\\`. They are not always active \u2014 load them on demand.\n\n**In Kiro IDE:** type \\`/kirograph-review\\`, \\`/kirograph-security\\`, etc. to activate a workflow for the current session.\n\n**In Kiro CLI / other agents:** when the user asks for a specific workflow or you recognize the intent, read the file directly:\n\n\\`\\`\\`\nRead file: .kiro/steering/kirograph-security.md\nRead file: .kiro/steering/kirograph-review.md\n\\`\\`\\`\n\n| User intent | File to load |\n|-------------|-------------|\n${workflowRows.join('\\n')}\n\nEach file contains numbered steps, exact tool calls, and an interpretation reference. Follow the steps in order.\n\n---\n\n## If \\`.kirograph/\\` does NOT exist\n\nAsk the user: \"This project doesn't have KiroGraph initialized. Run \\`kirograph init -i\\` to build a code knowledge graph for faster exploration?\"`;\n\n // Compose the full content\n let content = `---\ninclusion: always\n---\n\n# KiroGraph\n\nKiroGraph builds a semantic knowledge graph of your codebase. Use its MCP tools instead of grep/glob/file reads whenever \\`.kirograph/\\` exists in the project.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n${guideRows.join('\\n')}\n\n---\n${toolRef}\n${workflows}\n${workflowSection}\n`;\n\n // Insert compression section before the \"If .kirograph/ does NOT exist\" section\n if (enableCompression && shellCompressionLevel !== 'off') {\n const section = buildCompressionSection(shellCompressionLevel as 'normal' | 'aggressive' | 'ultra');\n content = content.replace(\n '---\\n\\n## If `.kirograph/` does NOT exist',\n section.trim() + '\\n\\n---\\n\\n## If `.kirograph/` does NOT exist',\n );\n }\n\n const caveman = cavemanMode && cavemanMode !== 'off' ? CAVEMAN_RULES[cavemanMode] : null;\n if (caveman) {\n content = content.trimEnd() + '\\n\\n' + caveman + '\\n';\n }\n\n // Memory section\n if (enableMemory) {\n const memorySection = `\n## Memory\n\nKiroGraph has persistent memory. Use it to recall past decisions and store new ones.\n\n| Question | Tool |\n|----------|------|\n| What did we decide about X? | \\`kirograph_mem_search\\` |\n| Store a decision / bug fix / pattern | \\`kirograph_mem_store\\` |\n| Does this contradict something stored? | \\`kirograph_mem_conflicts_scan\\` |\n| Two observations conflict \u2014 which wins? | \\`kirograph_mem_compare\\` \u2192 \\`kirograph_mem_judge\\` |\n| Extract observations from structured text | \\`kirograph_mem_capture\\` |\n| Which observations need re-evaluation? | \\`kirograph_mem_review\\` |\n| Mark an observation as still valid | \\`kirograph_mem_mark_reviewed\\` |\n\nMemory is searchable via hybrid FTS + vector search. Observations surface automatically in\n\\`kirograph_context\\` and \\`kirograph_impact\\` results when linked to relevant code symbols.\n\n**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,\nor learning something future sessions should know. One fact per store call. A hook reminds you\nat session end.\n\n**topicKey:** Use a stable semantic key (e.g. \\`\"architecture/auth-model\"\\`) when storing a\ndecision that may be superseded or revisited. Lets you address the same concept across sessions.\n\n**reviewAfter:** Pass an epoch-ms timestamp when an observation should expire or be re-evaluated\n(e.g. after a planned migration, a library upgrade, or a time-boxed experiment).\n\nFor the full conflict-detection workflow, load: \\`.kiro/steering/kirograph-mem-workflow.md\\`\n`;\n content = content.trimEnd() + '\\n\\n' + memorySection.trim() + '\\n';\n }\n\n // Documentation section\n if (enableDocs) {\n const docsSection = `\n## Documentation\n\nKiroGraph indexes project documentation by heading structure. Use \\`kirograph_docs_search\\`\nto find relevant doc sections instead of reading entire files. Use \\`kirograph_docs_section\\`\nto retrieve the exact section you need by ID.\n\n**Available tools:**\n- \\`kirograph_docs_toc\\` \u2014 table of contents for a file or the whole project\n- \\`kirograph_docs_search\\` \u2014 search sections by query (independent from code search)\n- \\`kirograph_docs_section\\` \u2014 retrieve full content of a section by ID\n- \\`kirograph_docs_outline\\` \u2014 heading hierarchy for a single document\n- \\`kirograph_docs_refs\\` \u2014 find code symbols referenced by a doc section (or vice versa)\n\n**When to use:** Before reading a documentation file directly, check if \\`kirograph_docs_search\\`\nor \\`kirograph_docs_outline\\` can give you the specific section you need. This saves tokens\nand gives you structured navigation instead of raw file content.\n`;\n content = content.trimEnd() + '\\n\\n' + docsSection.trim() + '\\n';\n }\n\n // Data section\n if (enableData) {\n const dataSection = `\n## Data\n\nKiroGraph indexes tabular data files (CSV, TSV, JSONL, JSON, Excel, Parquet) for structured\nquerying. Use \\`kirograph_data_describe\\` to understand a dataset's schema without loading\nthe file. Use \\`kirograph_data_query\\` with filters to retrieve specific rows.\n\n**Available tools:**\n- \\`kirograph_data_list\\` \u2014 list all indexed datasets with row/column counts\n- \\`kirograph_data_describe\\` \u2014 full schema profile: column names, types, cardinality, null%, samples\n- \\`kirograph_data_query\\` \u2014 filtered row retrieval with structured operators (eq, gt, contains, in, between)\n- \\`kirograph_data_aggregate\\` \u2014 server-side GROUP BY: count, sum, avg, min, max, count_distinct\n- \\`kirograph_data_search\\` \u2014 search column names and sample values by keyword\n\n**When to use:** Instead of reading a CSV/data file directly (which floods context with raw rows),\nuse \\`kirograph_data_describe\\` to understand the schema, then \\`kirograph_data_query\\` with\nfilters to get only the rows you need. For summary statistics, use \\`kirograph_data_aggregate\\`\nto compute results server-side. This saves 95-99% of tokens compared to reading raw data files.\n\n\\`\\`\\`\nkirograph_data_list()\nkirograph_data_describe(dataset: \"tests-fixtures-users\")\nkirograph_data_query(dataset: \"tests-fixtures-users\", filters: [{column: \"role\", op: \"eq\", value: \"admin\"}])\nkirograph_data_aggregate(dataset: \"data-orders\", groupBy: [\"region\"], metrics: [{column: \"amount\", op: \"sum\"}])\n\\`\\`\\`\n`;\n content = content.trimEnd() + '\\n\\n' + dataSection.trim() + '\\n';\n }\n\n // Patterns section\n if (enablePatterns) {\n const patternsSection = `\n## Pattern Matching\n\nKiroGraph can search for structural code patterns using @ast-grep/napi.\n\n**Available tools (only when enablePatterns: true and @ast-grep/napi installed):**\n- \\`kirograph_live_search\\` \u2014 search for any AST pattern across the codebase at query time\n\n**CLI commands:**\n- \\`kirograph pattern \"<pattern>\"\\` \u2014 live structural search\n- \\`kirograph pattern --list\\` \u2014 browse bundled SAST rules\n- \\`kirograph pattern --library <id>\\` \u2014 run a specific library rule\n\n**When to use:** When you need to find code patterns that can't be expressed as symbol names or semantic queries \u2014 \"all eval() calls\", \"all SQL string concatenation\", \"all readFile with request parameters\".\n`;\n content = content.trimEnd() + '\\n\\n' + patternsSection.trim() + '\\n';\n }\n\n // Wiki section\n if (enableWiki) {\n const wikiSection = `\n## Wiki\n\nKiroGraph maintains a structured LLM wiki \u2014 a set of markdown pages that compound knowledge\nacross sessions. Use it to look up project decisions, architecture facts, and domain knowledge\nbefore starting work. Use it to save knowledge that should survive context resets.\n\n**Available tools:**\n- \\`kirograph_wiki_ingest\\` \u2014 build an ingest prompt for a source text; pass the result to yourself to generate a WIKI_DIFF\n- \\`kirograph_wiki_apply_diff\\` \u2014 apply a WIKI_DIFF to create or update wiki pages\n- \\`kirograph_wiki_search\\` \u2014 full-text search over wiki pages\n- \\`kirograph_wiki_page\\` \u2014 retrieve the full content of a page by slug\n- \\`kirograph_wiki_list\\` \u2014 list all pages with metadata\n- \\`kirograph_wiki_lint\\` \u2014 health check: broken links, orphan pages, contradictions\n\n**When to consult the wiki:**\n- Before starting a complex feature or bug fix: \\`kirograph_wiki_search(query: \"<topic>\")\\`\n- When the user references a concept you don't recognize from the code graph alone\n- After \\`kirograph_context\\` returns wiki enrichments (pages above threshold score)\n\n**When to update the wiki:**\n- End of a session that produced durable knowledge (architecture decision, API contract, process)\n- The ingest hook will remind you at agentStop if \\`enableWiki: true\\` is set\n\n**Quick workflow:**\n1. \\`kirograph_wiki_ingest\\` \u2014 get the prompt with SCHEMA + MANIFEST + your source text\n2. Generate a \\`WIKI_DIFF\\` block (create/upsert/append per page)\n3. \\`kirograph_wiki_apply_diff\\` \u2014 apply it; review any pending conflicts in the response\n`;\n content = content.trimEnd() + '\\n\\n' + wikiSection.trim() + '\\n';\n }\n\n // Security section\n if (enableSecurity) {\n const securitySection = `\n## Security\n\nKiroGraph scans dependency manifests across 14 ecosystems for known vulnerabilities, performs\ncall-graph reachability analysis, tracks exploitation probability (EPSS), checks license\ncompliance, and monitors dependency staleness.\n\n**Available tools:**\n- \\`kirograph_security\\` \u2014 overview: dep count, CVE count, verdict breakdown, stale warnings\n- \\`kirograph_vulns\\` \u2014 list CVEs with severity, EPSS score, reachability verdict, fix suggestion\n- \\`kirograph_reachability\\` \u2014 deep-dive: call paths, entry points, affected layers for one CVE or package\n- \\`kirograph_licenses\\` \u2014 list dependency licenses; flag policy violations (deny/warn by SPDX pattern)\n- \\`kirograph_staleness\\` \u2014 identify outdated dependencies (staleness score 0.0\u20131.0)\n- \\`kirograph_sbom\\` \u2014 export CycloneDX 1.5 SBOM for compliance/auditing\n- \\`kirograph_vex\\` \u2014 export CycloneDX 1.5 VEX with reachability-derived analysis states\n- \\`kirograph_vuln_add\\` \u2014 manually register a private/internal CVE not in public databases\n\n**Proactive triggers \u2014 run \\`kirograph_security\\` when:**\n- You or the user add/update/remove a dependency\n- Before a production deploy or release branch cut\n- The user asks about security, compliance, or \"is it safe to upgrade X\"\n- \\`kirograph_context\\` surfaces a \u26A0 Security warning in its output\n\n**Interpreting verdicts:**\n- \\`affected\\` \u2014 a call path exists from an entry point to the vulnerable code. Act on this.\n- \\`not_affected\\` \u2014 no reachable path found, no unresolved imports. Strong signal: likely safe.\n- \\`under_investigation\\` \u2014 traversal hit unresolved symbols (dynamic dispatch, reflection). Treat with caution.\n\n**Interpreting EPSS scores** (shown by \\`kirograph_vulns\\`):\n- \\`>= 0.5\\` \u2014 actively exploited or very likely to be. Patch immediately regardless of CVSS.\n- \\`0.1 \u2013 0.5\\` \u2014 elevated risk. Prioritize over low-EPSS vulns with higher CVSS.\n- \\`< 0.1\\` \u2014 low exploitation probability. Use CVSS + reachability for triage.\n\n**Recommended workflow:**\n1. \\`kirograph_security\\` \u2014 get the big picture before diving in\n2. \\`kirograph_vulns --verdict affected\\` \u2014 focus only on confirmed reachable CVEs\n3. For each high-EPSS or high-CVSS result: \\`kirograph_reachability <cve>\\` to see exact call paths\n4. \\`kirograph_licenses --policy\\` \u2014 check for license violations before shipping\n5. \\`kirograph_staleness --threshold 0.5\\` \u2014 flag severely outdated dependencies\n6. Fix, then \\`kirograph_vulns --refresh\\` to re-query OSV and confirm resolution\n7. \\`kirograph_vex\\` / \\`kirograph_sbom\\` for compliance artifacts\n\n**Staleness score guide:** 0.0 = current; 0.3+ = worth reviewing; 0.7+ = significantly behind.\nA high staleness score alone is not a security issue, but old dependencies accumulate CVEs over time.\n`;\n content = content.trimEnd() + '\\n\\n' + securitySection.trim() + '\\n';\n }\n\n return content;\n}\n\nexport function writeSteering(kiroDir: string, opts?: SteeringOptions | CavemanMode | 'off'): void {\n const steeringDir = path.join(kiroDir, 'steering');\n fs.mkdirSync(steeringDir, { recursive: true });\n const steeringPath = path.join(steeringDir, 'kirograph.md');\n\n // Support both old signature (cavemanMode string) and new signature (options object)\n const resolvedOpts: SteeringOptions = typeof opts === 'string'\n ? { cavemanMode: opts }\n : opts ?? {};\n\n fs.writeFileSync(steeringPath, buildSteeringContent(resolvedOpts));\n console.log(` \u2713 Steering file written to ${steeringPath}`);\n\n // Write workflow-specific steering files\n writeWorkflowSteering(steeringDir, resolvedOpts);\n}\n\nfunction writeWorkflowSteering(steeringDir: string, opts?: SteeringOptions): void {\n const trackCallSites = opts?.trackCallSites ?? false;\n const enableCodeHealth = opts?.enableCodeHealth ?? false;\n const enableArchitecture = opts?.enableArchitecture ?? false;\n const enableAdvancedAnalysis = opts?.enableAdvancedAnalysis ?? false;\n\n // kirograph-review.md\n const reviewSteps: string[] = [\n `1. **Understand the change scope**\n \\`\\`\\`\n kirograph_context(task: \"<describe what changed>\")\n \\`\\`\\``,\n `2. **Analyze blast radius**\n For each key symbol that was modified:\n \\`\\`\\`\n kirograph_impact(symbol: \"<changed symbol>\", depth: 2)\n \\`\\`\\``,\n ];\n if (trackCallSites) {\n reviewSteps.push(`3. **Check test coverage**\n \\`\\`\\`\n kirograph_callers(symbol: \"<changed symbol>\")\n \\`\\`\\`\n Look for test files among the callers. Flag untested changes.`);\n }\n if (enableCodeHealth) {\n const n = reviewSteps.length + 1;\n reviewSteps.push(`${n}. **Look for surprising coupling**\n \\`\\`\\`\n kirograph_surprising(limit: 10)\n \\`\\`\\``);\n }\n const findingsN = reviewSteps.length + 1;\n reviewSteps.push(`${findingsN}. **Produce findings** grouped by risk level (high/medium/low) with:\n - What changed and why it matters\n - Test coverage status\n - Suggested improvements\n - Overall merge recommendation`);\n fs.writeFileSync(path.join(steeringDir, 'kirograph-review.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Code Review Workflow\n\nFollow these steps for a structured, risk-aware code review using the knowledge graph.\n\n## Steps\n\n${reviewSteps.join('\\n\\n')}\n`);\n\n // kirograph-debug.md\n const debugSteps: string[] = [\n `1. **Find related code**\n \\`\\`\\`\n kirograph_search(query: \"<error message or symptom keywords>\")\n \\`\\`\\``,\n `2. **Get full context**\n \\`\\`\\`\n kirograph_context(task: \"<describe the bug>\")\n \\`\\`\\``,\n ];\n if (trackCallSites) {\n debugSteps.push(`3. **Trace the call chain**\n \\`\\`\\`\n kirograph_callers(symbol: \"<suspected function>\")\n kirograph_callees(symbol: \"<suspected function>\")\n \\`\\`\\``);\n }\n if (enableCodeHealth) {\n const n = debugSteps.length + 1;\n debugSteps.push(`${n}. **Check what changed recently**\n \\`\\`\\`\n kirograph_diff()\n \\`\\`\\``);\n }\n const blastN = debugSteps.length + 1;\n debugSteps.push(`${blastN}. **Understand blast radius**\n \\`\\`\\`\n kirograph_impact(symbol: \"<root cause symbol>\", depth: 3)\n \\`\\`\\``);\n const debugTips: string[] = [];\n if (trackCallSites) debugTips.push('- Check both callers and callees to understand the full context');\n if (enableCodeHealth) debugTips.push('- Recent changes (via diff) are the most common source of new issues');\n debugTips.push('- Use `kirograph_path` to trace how two symbols are connected');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-debug.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Debug Workflow\n\nFollow these steps to systematically trace and debug issues using the knowledge graph.\n\n## Steps\n\n${debugSteps.join('\\n\\n')}\n\n## Tips\n${debugTips.join('\\n')}\n`);\n\n // kirograph-onboard.md\n const onboardSteps: string[] = [\n `1. **Project overview**\n \\`\\`\\`\n kirograph_status()\n \\`\\`\\``,\n `2. **File structure**\n \\`\\`\\`\n kirograph_files(format: \"tree\", maxDepth: 2)\n \\`\\`\\``,\n ];\n if (enableCodeHealth) {\n onboardSteps.push(`3. **Key entry points**\n \\`\\`\\`\n kirograph_hotspots(limit: 15)\n \\`\\`\\``);\n }\n if (enableArchitecture) {\n const n = onboardSteps.length + 1;\n onboardSteps.push(`${n}. **Architecture layers**\n \\`\\`\\`\n kirograph_architecture()\n \\`\\`\\``);\n }\n const exploreN = onboardSteps.length + 1;\n onboardSteps.push(`${exploreN}. **Explore a specific area**\n \\`\\`\\`\n kirograph_context(task: \"<area you want to understand>\")\n \\`\\`\\``);\n const symbolN = onboardSteps.length + 1;\n onboardSteps.push(`${symbolN}. **Understand a key symbol**\n \\`\\`\\`\n kirograph_node(symbol: \"<symbol name>\", includeCode: true)\n \\`\\`\\``);\n const onboardTips: string[] = ['- Start broad (status, files) then narrow down'];\n if (enableCodeHealth) onboardTips[0] = '- Start broad (status, files, hotspots) then narrow down';\n if (enableAdvancedAnalysis) onboardTips.push('- Use `kirograph_type_hierarchy` to understand inheritance patterns');\n if (trackCallSites) onboardTips.push('- Use `kirograph_callees` on entry points to trace execution flow');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-onboard.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Onboarding Workflow\n\nFollow these steps to quickly understand a new codebase.\n\n## Steps\n\n${onboardSteps.join('\\n\\n')}\n\n## Tips\n${onboardTips.join('\\n')}\n`);\n\n // kirograph-refactor.md\n const refactorSteps: string[] = [\n `1. **Understand what you're changing**\n \\`\\`\\`\n kirograph_node(symbol: \"<target symbol>\", includeCode: true)\n \\`\\`\\``,\n `2. **Check blast radius**\n \\`\\`\\`\n kirograph_impact(symbol: \"<target symbol>\", depth: 3)\n \\`\\`\\``,\n ];\n if (trackCallSites) {\n refactorSteps.push(`3. **Find all callers (rename preview)**\n \\`\\`\\`\n kirograph_callers(symbol: \"<target symbol>\", limit: 50)\n \\`\\`\\``);\n }\n if (enableCodeHealth) {\n let n = refactorSteps.length + 1;\n refactorSteps.push(`${n}. **Check for cycles that might complicate the refactor**\n \\`\\`\\`\n kirograph_circular_deps()\n \\`\\`\\``);\n n++;\n refactorSteps.push(`${n}. **Find dead code to clean up**\n \\`\\`\\`\n kirograph_dead_code(limit: 30)\n \\`\\`\\``);\n n++;\n refactorSteps.push(`${n}. **Verify after changes**\n Run \\`kirograph sync\\` then:\n \\`\\`\\`\n kirograph_diff()\n \\`\\`\\``);\n }\n const refactorChecks: string[] = ['- Always check `kirograph_impact` before major refactors'];\n if (trackCallSites) refactorChecks.push('- Use `kirograph_callers` as a rename preview (all locations that reference the symbol)');\n if (enableCodeHealth) refactorChecks.push('- After changes, use `kirograph_diff` to verify only intended symbols changed');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-refactor.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Refactoring Workflow\n\nFollow these steps to plan and execute safe refactoring.\n\n## Steps\n\n${refactorSteps.join('\\n\\n')}\n\n## Safety Checks\n${refactorChecks.join('\\n')}\n`);\n\n // kirograph-architecture.md only when enableArchitecture is true\n if (enableArchitecture) {\n const archSteps: string[] = [\n `1. **Get project overview**\n \\`\\`\\`\n kirograph_status()\n \\`\\`\\``,\n `2. **View architecture**\n \\`\\`\\`\n kirograph_architecture()\n \\`\\`\\``,\n `3. **Check coupling health**\n \\`\\`\\`\n kirograph_coupling(sortBy: \"instability\")\n \\`\\`\\``,\n ];\n if (enableCodeHealth) {\n let n = archSteps.length + 1;\n archSteps.push(`${n}. **Find core abstractions**\n \\`\\`\\`\n kirograph_hotspots(limit: 20)\n \\`\\`\\``);\n n++;\n archSteps.push(`${n}. **Detect hidden dependencies**\n \\`\\`\\`\n kirograph_surprising(limit: 15)\n \\`\\`\\``);\n n++;\n archSteps.push(`${n}. **Check for cycles**\n \\`\\`\\`\n kirograph_circular_deps()\n \\`\\`\\``);\n }\n fs.writeFileSync(path.join(steeringDir, 'kirograph-architecture.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Architecture Exploration Workflow\n\nFollow these steps to understand the high-level structure of the codebase.\n\n## Steps\n\n${archSteps.join('\\n\\n')}\n\n## Interpretation\n- High Ca (afferent) = load-bearing, risky to change interface\n- High Ce (efferent) = depends on many things, safe to refactor internals\n${enableCodeHealth ? '- Surprising edges = hidden coupling that may break during refactoring\\n' : ''}`);\n }\n\n // Security workflow \u2014 only when enableSecurity is true\n if (opts?.enableSecurity) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-security.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Security Audit Workflow\n\nFollow these steps for a structured security audit using the knowledge graph.\nActivate this workflow before a release, after adding dependencies, or when asked to review security posture.\n\n## Steps\n\n### 1. Overview\n\\`\\`\\`\nkirograph_security()\n\\`\\`\\`\nNote: total dependencies, vulnerability count, verdict breakdown, stale warning count.\n\n### 2. Triage reachable vulnerabilities\n\\`\\`\\`\nkirograph_vulns(verdict: \"affected\")\n\\`\\`\\`\nFocus only on confirmed reachable CVEs. Sort output by EPSS score (exploitation probability) first, then CVSS severity.\n\n**Act immediately on:** EPSS >= 0.5 (actively exploited). Patch regardless of CVSS.\n**Prioritize:** EPSS 0.1\u20130.5 over low-EPSS high-CVSS entries.\n**Low urgency:** EPSS < 0.1 \u2014 use CVSS + reachability for triage.\n\n### 3. Deep-dive reachability for critical CVEs\nFor each high-priority CVE from step 2:\n\\`\\`\\`\nkirograph_reachability(target: \"<CVE-ID or package name>\")\n\\`\\`\\`\nThis shows: exact call paths from entry points, affected architectural layers, distinct path count.\n\n- \\`affected\\` verdict with known entry points \u2192 fix this dependency\n- \\`not_affected\\` \u2192 no reachable path, document and move on\n- \\`under_investigation\\` \u2192 unresolved symbols, treat conservatively\n\n### 4. Check for under-investigation CVEs\n\\`\\`\\`\nkirograph_vulns(verdict: \"under_investigation\")\n\\`\\`\\`\nFor each: run \\`kirograph_reachability\\` to see what symbols are unresolved. If you can determine\nthe symbol is not called, you can downgrade to not_affected manually.\n\n### 5. License compliance\n\\`\\`\\`\nkirograph_licenses(policy: true)\n\\`\\`\\`\nReview any DENY violations \u2014 these must be resolved before shipping.\nWARN violations should be documented and approved by the team.\n\n### 6. Dependency staleness\n\\`\\`\\`\nkirograph_staleness(threshold: 0.5)\n\\`\\`\\`\nScore guide: 0.3+ = worth reviewing, 0.7+ = significantly behind.\nCross-reference with step 2 results: stale + vulnerable = highest priority.\n\n### 7. Refresh data if needed\nIf vulnerability data looks stale (flagged in step 1) or dependencies changed recently:\n\\`\\`\\`\nkirograph_vulns(refresh: true)\n\\`\\`\\`\n\n### 8. Export compliance artifacts\n\\`\\`\\`\nkirograph_sbom() // Software Bill of Materials\nkirograph_vex() // Vulnerability Exploitability eXchange\n\\`\\`\\`\n\n## Interpretation Reference\n\n| Signal | Meaning | Action |\n|--------|---------|--------|\n| \\`affected\\` + EPSS >= 0.5 | Actively exploited, reachable | Patch immediately |\n| \\`affected\\` + CVSS >= 9.0 | Critical, reachable | Patch this sprint |\n| \\`affected\\` + CVSS 7.0\u20138.9 | High, reachable | Plan fix within 2 weeks |\n| \\`not_affected\\` | No reachable path found | Document, no action needed |\n| \\`under_investigation\\` | Reachability unclear | Manual review required |\n| Stale >= 0.7 | Very outdated | Review for accumulated CVEs |\n| License DENY | Policy violation | Must resolve before release |\n`);\n console.log(` \u2713 Security workflow steering file written`);\n }\n\n // Patterns workflow \u2014 only when enablePatterns is true\n if (opts?.enablePatterns) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-patterns.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Pattern Search Workflow\n\nUse this workflow to find structural code patterns using AST matching.\nActivate with \\`/kirograph-patterns\\` in Kiro IDE or CLI.\n\n## Steps\n\n### 1. Browse available rules\n\\`\\`\\`\nkirograph_live_search(pattern: \"--list\")\n\\`\\`\\`\nOr use the CLI: \\`kirograph pattern --list\\`\n\n### 2. Search for a specific structural pattern\n\\`\\`\\`\nkirograph_live_search(pattern: \"eval($X)\", language: \"typescript\")\n\\`\\`\\`\n\n### 3. Run a bundled library rule\n\\`\\`\\`\nkirograph pattern --library sql-injection-concat-js\n\\`\\`\\`\n\n### 4. Add a custom rule\nCreate a YAML file in your \\`patternLibraryPath\\` directory:\n\\`\\`\\`yaml\nid: my-custom-rule\nlanguage: [javascript, typescript]\nseverity: high\nowaspCategory: A03\ndescription: Custom pattern description\nfixHint: How to fix this issue.\nrule:\n pattern: dangerousFunction($ARG)\n\\`\\`\\`\n\n## Pattern syntax examples\n\n| Pattern | Matches |\n|---------|---------|\n| \\`eval($X)\\` | Any eval() call |\n| \\`$OBJ.query($A + $B)\\` | String concat in any query method |\n| \\`fs.$F(req.$P, $$$)\\` | Any fs method with request param |\n| \\`createHash('md5')\\` | Hardcoded MD5 usage |\n\n## Interpretation\n\n- Findings mean the pattern was found in the AST \u2014 not a false positive from symbol name matching\n- Check the surrounding context: \\`kirograph_node(symbol: \"...\", includeCode: true)\\`\n- Use \\`kirograph_callers\\` to understand how the affected function is reached\n`);\n console.log(` \u2713 Patterns workflow steering file written`);\n }\n\n // Wiki workflow \u2014 only when enableWiki is true\n if (opts?.enableWiki) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-wiki-workflow.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Wiki Workflow\n\nUse this workflow when you need to consult or update the project wiki.\nActivate with \\`/kirograph-wiki-workflow\\` in Kiro IDE or read the file directly.\n\n## When to use\n\n- Before a complex task: look up relevant wiki pages\n- After a session with durable knowledge: ingest it into the wiki\n- After a source file is added: run ingest to capture its content\n- Periodically: run lint to catch broken links or contradictions\n\n## Steps\n\n### 1. Look up existing knowledge before starting work\n\n\\`\\`\\`\nkirograph_wiki_search(query: \"<topic or keyword>\")\n\\`\\`\\`\n\nRead any relevant pages:\n\n\\`\\`\\`\nkirograph_wiki_page(slug: \"<slug from search results>\")\n\\`\\`\\`\n\n### 2. Ingest new knowledge (two-tool flow)\n\n**a. Get the ingest prompt:**\n\n\\`\\`\\`\nkirograph_wiki_ingest(source: \"<text, notes, or paste from docs>\", sourceName: \"<descriptive name>\")\n\\`\\`\\`\n\nThe tool returns a structured prompt containing the wiki SCHEMA, the current MANIFEST, and your source text.\n\n**b. Generate the WIKI_DIFF:**\n\nPass the returned prompt to yourself. Produce a \\`WIKI_DIFF_START ... WIKI_DIFF_END\\` block following the schema. Each entry should have a JSON header with \\`action\\`, \\`slug\\`, \\`title\\`, and \\`section\\` (optional), followed by markdown content.\n\n**c. Apply the diff:**\n\n\\`\\`\\`\nkirograph_wiki_apply_diff(diff: \"<the WIKI_DIFF block you generated>\")\n\\`\\`\\`\n\nReview the response for any pending conflicts and resolve them.\n\n### 3. List all pages\n\n\\`\\`\\`\nkirograph_wiki_list()\n\\`\\`\\`\n\n### 4. Health check (periodic)\n\n\\`\\`\\`\nkirograph_wiki_lint()\n\\`\\`\\`\n\nIssues to look for:\n- \\`broken_link\\`: a \\`[[slug]]\\` reference that points to a non-existent page \u2192 fix the slug or create the page\n- \\`orphan\\`: a page with no Related section and no incoming links \u2192 add Related or merge into another page\n- \\`stale_source\\`: a source with no date metadata \u2192 add a date to the source header\n- \\`contradiction\\`: two pages make semantically opposite claims \u2192 resolve via ingest or manual edit\n\n## WIKI_DIFF format reference\n\n\\`\\`\\`\nWIKI_DIFF_START\n{\"action\": \"create\", \"slug\": \"auth-flow\", \"title\": \"Authentication Flow\"}\n# Authentication Flow\n\nThe login flow validates credentials via JWT...\n\n## Related\n- [[user-model]]\nWIKI_DIFF_END\n\\`\\`\\`\n\nSupported actions: \\`create\\`, \\`upsert\\` (merge into existing), \\`append\\` (add to specific section).\n\nFor append, include \\`\"section\": \"Known Issues\"\\` in the header.\n\n## Conflict handling\n\nIf a diff contradicts an existing page, the tool reports it as a conflict:\n- With \\`wikiAutoResolveConflicts: true\\`: the newer source wins automatically\n- Without: the conflict is listed in the response \u2014 read both sides and ingest a resolution\n\n## CLI commands\n\n\\`\\`\\`bash\nkirograph wiki search \"<query>\"\nkirograph wiki page <slug>\nkirograph wiki list\nkirograph wiki lint\nkirograph wiki status\nkirograph wiki reindex\n\\`\\`\\`\n`);\n console.log(` \u2713 Wiki workflow steering file written`);\n }\n\n // Memory workflow \u2014 only when enableMemory is true\n if (opts?.enableMemory) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-mem-workflow.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Memory Workflow\n\nUse this workflow to recall past knowledge, store new observations, and keep the memory base\nconsistent by detecting and resolving conflicts.\n\n## 1. Recall before acting\n\nBefore making an architecture decision or fixing a bug, search what's already known:\n\n\\`\\`\\`\nkirograph_mem_search(query: \"<topic or keywords>\", kind: \"decision\")\nkirograph_mem_search(query: \"<error symptom>\", kind: \"error\")\n\\`\\`\\`\n\nResults include inline conflict annotations (\u26A1) \u2014 review them before proceeding.\n\n## 2. Store a new observation\n\nAfter a decision, bug fix, or discovery:\n\n\\`\\`\\`\nkirograph_mem_store(\n content: \"<one concise fact>\",\n kind: \"decision\" | \"error\" | \"pattern\" | \"architecture\" | \"note\",\n topicKey: \"<category/slug>\", // optional: stable semantic key for revisitable decisions\n reviewAfter: <epoch-ms> // optional: schedule re-evaluation after a migration/upgrade\n)\n\\`\\`\\`\n\n**topicKey examples:** \\`\"architecture/auth-model\"\\`, \\`\"infra/db-choice\"\\`, \\`\"pattern/error-handling\"\\`\n\n## 3. Capture observations from structured text\n\nIf you have a markdown block with bullet points under headings like \\`## Key Learnings\\` or\n\\`## Decisions\\`, extract them all at once:\n\n\\`\\`\\`\nkirograph_mem_capture(content: \"<markdown text>\", kind: \"decision\")\n\\`\\`\\`\n\n## 4. Detect conflicts\n\nAfter storing related observations, scan for potential contradictions:\n\n\\`\\`\\`\nkirograph_mem_conflicts_scan(limit: 20)\n\\`\\`\\`\n\nReturns candidate pairs ranked by similarity. Review each one.\n\n## 5. Compare two observations\n\nTo understand if two observations conflict, are compatible, or one supersedes the other:\n\n\\`\\`\\`\nkirograph_mem_compare(observationA: \"<id or topicKey>\", observationB: \"<id or topicKey>\")\n\\`\\`\\`\n\nReturns both observations side by side. Read them, then judge.\n\n## 6. Judge a relation\n\n\\`\\`\\`\nkirograph_mem_judge(\n relationId: \"<id>\",\n relation: \"supersedes\" | \"conflicts_with\" | \"compatible\" | \"scoped\" | \"related\" | \"not_conflict\",\n confidence: 0.0\u20131.0,\n reason: \"<why>\"\n)\n\\`\\`\\`\n\nUse \\`supersedes\\` when a newer decision replaces an older one. Use \\`not_conflict\\` to dismiss\nfalse positives so they don't reappear in scans.\n\n## 7. Review stale observations\n\nFind observations scheduled for re-evaluation:\n\n\\`\\`\\`\nkirograph_mem_review(limit: 20)\n\\`\\`\\`\n\nFor each: verify it's still accurate. If valid, mark it reviewed:\n\n\\`\\`\\`\nkirograph_mem_mark_reviewed(id: \"<observation-id>\")\n\\`\\`\\`\n\nIf outdated, store a new observation with the correct information and judge the old one as\nsuperseded via \\`kirograph_mem_judge\\`.\n\n## Quick reference\n\n| Situation | Action |\n|-----------|--------|\n| About to make a decision | \\`mem_search\\` first |\n| Made a decision | \\`mem_store\\` with \\`kind: \"decision\"\\` and \\`topicKey\\` |\n| Fixed a non-obvious bug | \\`mem_store\\` with \\`kind: \"error\"\\` |\n| Two things seem to contradict | \\`mem_compare\\` \u2192 \\`mem_judge\\` |\n| Knowledge base getting stale | \\`mem_review\\` \u2192 \\`mem_mark_reviewed\\` |\n| Structured notes to extract | \\`mem_capture\\` |\n| Regular conflict hygiene | \\`mem_conflicts_scan\\` |\n`);\n console.log(` \u2713 Memory workflow steering file written`);\n }\n\n const written = ['review', 'debug', 'onboard', 'refactor'];\n if (opts?.enableArchitecture) written.push('architecture');\n if (opts?.enableSecurity) written.push('security');\n if (opts?.enablePatterns) written.push('patterns');\n if (opts?.enableMemory) written.push('memory');\n if (opts?.enableWiki) written.push('wiki');\n console.log(` \u2713 Workflow steering files written (${written.join(', ')})`);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,qBAA2C;AAK3C,MAAM,qBAA6C;AAAA,EACjD,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AACT;AAEA,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMZ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEA,SAAS,wBAAwB,OAAkD;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAoBc,KAAK,OAAO,mBAAmB,KAAK,CAAC;AAAA;AAAA,EAE1D,eAAe,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB;AAmBA,SAAS,qBAAqB,MAAgC;AAC5D,QAAM,cAAc,MAAM;AAC1B,QAAM,oBAAoB,MAAM,sBAAsB,SAAS,MAAM,0BAA0B;AAC/F,QAAM,wBAAwB,MAAM,yBAAyB;AAC7D,QAAM,qBAAqB,MAAM,sBAAsB;AACvD,QAAM,eAAe,MAAM,gBAAgB;AAC3C,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,iBAAiB,MAAM,kBAAkB;AAC/C,QAAM,iBAAiB,MAAM,kBAAkB;AAC/C,QAAM,aAAa,MAAM,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,2BAA2B,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CA0GzE;AACG,YAAQ,IAAI,gDAA2C;AAAA,EACzD;AAEA,QAAM,UAAU,CAAC,UAAU,SAAS,WAAW,UAAU;AACzD,MAAI,MAAM,mBAAoB,SAAQ,KAAK,cAAc;AACzD,MAAI,MAAM,eAAgB,SAAQ,KAAK,UAAU;AACjD,MAAI,MAAM,eAAgB,SAAQ,KAAK,UAAU;AACjD,MAAI,MAAM,aAAc,SAAQ,KAAK,QAAQ;AAC7C,MAAI,MAAM,WAAY,SAAQ,KAAK,MAAM;AACzC,UAAQ,IAAI,6CAAwC,QAAQ,KAAK,IAAI,CAAC,GAAG;AAC3E;",
4
+ "sourcesContent": ["/**\n * KiroGraph Installer: Kiro steering file\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CAVEMAN_RULES, CavemanMode } from './caveman';\n\n\n// \u2500\u2500 Compression section builder (level-aware) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst LEVEL_DESCRIPTIONS: Record<string, string> = {\n normal: 'Balanced: removes noise, keeps structure.',\n aggressive: 'Compact: groups by category, limits output.',\n ultra: 'Maximum compression: counts and summaries only.',\n};\n\nconst LEVEL_EXAMPLES: Record<string, string> = {\n normal: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\")\nkirograph_exec(command: \"npm test\")\nkirograph_exec(command: \"cargo build\")\nkirograph_exec(command: \"ls -la src/\")\n\\\\\\`\\\\\\`\\\\\\``,\n aggressive: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"aggressive\")\nkirograph_exec(command: \"npm test\", level: \"aggressive\")\nkirograph_exec(command: \"eslint .\", level: \"aggressive\")\nkirograph_exec(command: \"find . -name '*.ts'\", level: \"aggressive\")\n\\\\\\`\\\\\\`\\\\\\``,\n ultra: `\\\\\\`\\\\\\`\\\\\\`\nkirograph_exec(command: \"git status\", level: \"ultra\")\nkirograph_exec(command: \"npm test\", level: \"ultra\")\nkirograph_exec(command: \"docker ps\", level: \"ultra\")\nkirograph_exec(command: \"ls -la src/\", level: \"ultra\")\n\\\\\\`\\\\\\`\\\\\\``,\n};\n\nfunction buildCompressionSection(level: 'normal' | 'aggressive' | 'ultra'): string {\n return `\n---\n\n## Shell Compression (\\\\\\`kirograph_exec\\\\\\`)\n\nWhen running shell commands, prefer \\\\\\`kirograph_exec\\\\\\` over raw shell execution for:\n- **git** operations (status, log, diff, push, pull, commit, add, fetch, branch)\n- **GitHub CLI** (gh pr list/view, gh issue list, gh run list)\n- **test runners** (jest, vitest, pytest, cargo test, go test, rspec, minitest, playwright)\n- **linters/build** (eslint, tsc, ruff, clippy, cargo build, prettier, biome, golangci-lint, rubocop, next build)\n- **file listings** (ls, find, tree)\n- **search** (grep, rg/ripgrep: grouped by file)\n- **diff** (diff file1 file2: condensed context)\n- **docker/k8s** (docker ps, images, logs, compose ps, kubectl pods, logs, services)\n- **package managers** (npm/pnpm install/list, pip list/install, bundle install, prisma generate)\n- **AWS CLI** (sts, ec2, lambda, logs, cloudformation, dynamodb, iam, s3, ecs, sqs, sns)\n- **network** (curl, wget: strip progress bars and headers)\n\nThis saves 60-90% of tokens compared to raw output.\n\nCompression level: **${level}**: ${LEVEL_DESCRIPTIONS[level]}\n\n${LEVEL_EXAMPLES[level]}\n\n**Important:** Error details are always preserved. Failed commands show full diagnostic output regardless of level.\n\n**Do NOT re-run commands:** When \\\\\\`kirograph_exec\\\\\\` returns a result, treat it as the final answer. Never re-run the same command with raw shell execution to \"get more details.\" The compressed output preserves all essential information. If you genuinely need something missing from the output, explain what's missing before making a second call.\n\nUse \\\\\\`kirograph_gain\\\\\\` to check token savings statistics.`;\n}\n\nexport interface SteeringOptions {\n cavemanMode?: CavemanMode | 'off';\n enableCompression?: boolean;\n shellCompressionLevel?: 'off' | 'normal' | 'aggressive' | 'ultra';\n enableArchitecture?: boolean;\n enableMemory?: boolean;\n enableDocs?: boolean;\n enableData?: boolean;\n enableSecurity?: boolean;\n enablePatterns?: boolean;\n enableWiki?: boolean;\n enableCodeHealth?: boolean;\n enableNavigation?: boolean;\n enableComplexity?: boolean;\n enableGitContext?: boolean;\n enableEditPrimitives?: boolean;\n enableBranch?: boolean;\n enableAgentUtils?: boolean;\n enableGeneralCompression?: boolean;\n trackCallSites?: boolean;\n}\n\nfunction buildSteeringContent(opts?: SteeringOptions): string {\n const cavemanMode = opts?.cavemanMode;\n const enableCompression = opts?.enableCompression !== false && opts?.shellCompressionLevel !== 'off';\n const shellCompressionLevel = opts?.shellCompressionLevel ?? 'normal';\n const enableArchitecture = opts?.enableArchitecture ?? false;\n const enableMemory = opts?.enableMemory ?? false;\n const enableDocs = opts?.enableDocs ?? false;\n const enableData = opts?.enableData ?? false;\n const enableSecurity = opts?.enableSecurity ?? false;\n const enablePatterns = opts?.enablePatterns ?? false;\n const enableWiki = opts?.enableWiki ?? false;\n const enableCodeHealth = opts?.enableCodeHealth ?? false;\n const enableNavigation = opts?.enableNavigation ?? false;\n const enableGitContext = opts?.enableGitContext ?? false;\n const enableComplexity = opts?.enableComplexity ?? false;\n const enableEditPrimitives = opts?.enableEditPrimitives ?? false;\n const enableBranch = opts?.enableBranch ?? false;\n const enableAgentUtils = opts?.enableAgentUtils ?? false;\n const enableGeneralCompression = opts?.enableGeneralCompression ?? false;\n const trackCallSites = opts?.trackCallSites ?? false;\n\n // Build guide rows\n const guideRows: string[] = [\n '| Where do I start on this task? | `kirograph_context` |',\n '| What is this symbol / show me its code | `kirograph_node` with `includeCode: true` |',\n '| Find a symbol by name | `kirograph_search` |',\n ...(trackCallSites ? [\n '| Who calls function X? | `kirograph_callers` |',\n '| What does function X call? | `kirograph_callees` |',\n ] : []),\n ...(enableNavigation ? [\n '| What breaks if I change X? | `kirograph_impact` |',\n '| What files are indexed? | `kirograph_files` |',\n '| Is the index healthy? | `kirograph_status` |',\n ] : []),\n ...(enableCodeHealth ? [\n '| How are X and Y connected? | `kirograph_path` |',\n '| What extends / implements this type? | `kirograph_type_hierarchy` |',\n '| Which code is never called? | `kirograph_dead_code` |',\n '| Are there import cycles? | `kirograph_circular_deps` |',\n ] : []),\n ...(enableCodeHealth ? [\n '| What are the most critical symbols? | `kirograph_hotspots` |',\n '| Any unexpected cross-module coupling? | `kirograph_surprising` |',\n '| What changed since the last snapshot? | `kirograph_diff` |',\n ] : []),\n ...(enableArchitecture ? [\n '| What packages/layers exist? | `kirograph_architecture` |',\n '| How coupled is package X? | `kirograph_coupling` |',\n '| What does package X depend on? | `kirograph_package` |',\n ] : []),\n ...(enableCompression ? ['| Run a command with token savings | `kirograph_exec` |'] : []),\n ...(enableGeneralCompression ? ['| Compress text or shell output before sending | `kirograph_compress` |'] : []),\n ...(enableAgentUtils ? ['| Check token savings stats | `kirograph_gain` |'] : []),\n ...(enableData ? [\n '| What data files are indexed? | `kirograph_data_list` |',\n '| What columns does this dataset have? | `kirograph_data_describe` |',\n '| Query rows with filters | `kirograph_data_query` |',\n '| Aggregate data (sum, avg, count) | `kirograph_data_aggregate` |',\n ] : []),\n ...(enableSecurity ? [\n '| Are there vulnerable dependencies? | `kirograph_security` |',\n '| Which CVEs affect my project? | `kirograph_vulns` |',\n '| Is this vulnerability reachable? | `kirograph_reachability` |',\n '| What licenses do my dependencies use? | `kirograph_licenses` |',\n '| Are dependencies outdated? | `kirograph_staleness` |',\n '| Generate SBOM/VEX | `kirograph_sbom` / `kirograph_vex` |',\n '| Add a private CVE | `kirograph_vuln_add` |',\n ] : []),\n ...(enablePatterns ? ['| Find structural code patterns? | `kirograph_live_search` |'] : []),\n ...(enableComplexity ? [\n '| Overall graph health score | `kirograph_health` |',\n '| Most complex functions? | `kirograph_complexity` |',\n '| Which functions are highest risk to change? | `kirograph_test_risk` |',\n '| How are modules coupled? | `kirograph_dsm` |',\n ] : []),\n ...(enableGitContext ? [\n '| What symbols did I change? | `kirograph_diff_context` |',\n '| Build commit message context | `kirograph_commit_context` |',\n '| Generate PR description | `kirograph_pr_context` |',\n '| What tests cover symbol X? | `kirograph_test_map` |',\n '| Show per-file coverage report | `kirograph_test_coverage` |',\n ] : []),\n ...(enableEditPrimitives ? [\n '| Replace a unique string in a file | `kirograph_str_replace` |',\n '| Insert content before/after an anchor | `kirograph_insert_at` |',\n '| Atomic multi-replacement in a file | `kirograph_multi_str_replace` |',\n ] : []),\n ...(enableBranch ? [\n '| List tracked branches | `kirograph_branch_list` |',\n '| What changed between branches? | `kirograph_branch_diff` |',\n '| Search symbols in another branch | `kirograph_branch_search` |',\n ] : []),\n ];\n\n // Build tool reference sections\n let toolRef = `\n## Tool reference\n\n### \\`kirograph_context\\`: **start here for any code task**\n\nReturns entry points, related symbols, and code snippets for a natural-language task description. Usually enough to orient without any additional tool calls.\n\n\\`\\`\\`\nkirograph_context(task: \"fix the auth token expiry bug\")\nkirograph_context(task: \"add dark mode\", maxNodes: 30)\nkirograph_context(task: \"refactor payment service\", includeCode: false)\n\\`\\`\\`\n\n### \\`kirograph_search\\`: find symbols by name\n\nExact match \u2192 FTS \u2192 LIKE fallback \u2192 vector (last resort). Use instead of grep.\n\n\\`\\`\\`\nkirograph_search(query: \"signIn\")\nkirograph_search(query: \"UserService\", kind: \"class\")\nkirograph_search(query: \"auth\", limit: 20)\n\\`\\`\\`\n\nSupported kinds: \\`function\\`, \\`method\\`, \\`class\\`, \\`interface\\`, \\`type_alias\\`, \\`variable\\`, \\`route\\`, \\`component\\`\n\n### \\`kirograph_node\\`: inspect a symbol\n\nReturns kind, file, signature, docstring. Add \\`includeCode: true\\` to get the full source.\n\n\\`\\`\\`\nkirograph_node(symbol: \"validateToken\")\nkirograph_node(symbol: \"AuthService\", includeCode: true)\n\\`\\`\\``;\n\n if (trackCallSites) {\n toolRef += `\n\n### \\`kirograph_callers\\`: who calls this?\n\nBFS over incoming \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callers(symbol: \"processPayment\", limit: 30)\n\\`\\`\\`\n\n### \\`kirograph_callees\\`: what does this call?\n\nBFS over outgoing \\`calls\\` edges (depth 1).\n\n\\`\\`\\`\nkirograph_callees(symbol: \"handleRequest\")\n\\`\\`\\``;\n }\n\n if (enableNavigation) {\n toolRef += `\n\n### \\`kirograph_impact\\`: blast radius before a change\n\nTraverses all incoming edges up to \\`depth\\` hops. Call this before editing a symbol.\n\n\\`\\`\\`\nkirograph_impact(symbol: \"UserRepository\", depth: 3)\n\\`\\`\\``;\n }\n\n if (enableCodeHealth) {\n toolRef += `\n\n### \\`kirograph_path\\`: how are two symbols connected?\n\nBFS shortest path across all edge types.\n\n\\`\\`\\`\nkirograph_path(from: \"LoginController\", to: \"DatabasePool\")\n\\`\\`\\`\n\n### \\`kirograph_type_hierarchy\\`: class/interface inheritance\n\n\\`\\`\\`\nkirograph_type_hierarchy(symbol: \"BaseRepository\", direction: \"down\") // derived types\nkirograph_type_hierarchy(symbol: \"PaymentService\", direction: \"up\") // base types\nkirograph_type_hierarchy(symbol: \"IUserStore\", direction: \"both\") // all\n\\`\\`\\``;\n }\n\n if (enableCodeHealth) {\n toolRef += `\n\n### \\`kirograph_dead_code\\`: unreferenced symbols\n\nReturns unexported symbols with zero incoming edges. Good first step when cleaning up.\n\n\\`\\`\\`\nkirograph_dead_code(limit: 50)\n\\`\\`\\`\n\n### \\`kirograph_circular_deps\\`: import cycles\n\nRuns Tarjan's SCC over import edges. No parameters needed.\n\n\\`\\`\\`\nkirograph_circular_deps()\n\\`\\`\\``;\n }\n\n toolRef += `\n\n${enableNavigation ? `\n### \\`kirograph_files\\`: indexed file structure\n\n\\`\\`\\`\nkirograph_files(format: \"tree\") // default\nkirograph_files(format: \"flat\") // one path per line\nkirograph_files(format: \"grouped\") // by directory\nkirograph_files(filterPath: \"src/auth\", maxDepth: 2)\nkirograph_files(pattern: \"**/*.test.ts\")\n\\`\\`\\`\n\n### \\`kirograph_status\\`: index health\n\nReturns file count, symbol count, edge count, embedding coverage, DB size. Call when something feels off.` : ''}`;\n\n if (enableCodeHealth) {\n toolRef += `\n\n### \\`kirograph_hotspots\\`: most-connected symbols\n\nReturns the top-N symbols by total edge degree (in + out, excluding structural \\`contains\\` edges). Use to find core abstractions, identify high blast-radius symbols before a refactor, or understand what the codebase revolves around.\n\n\\`\\`\\`\nkirograph_hotspots(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_surprising\\`: unexpected cross-module coupling\n\nFinds direct edges between symbols in structurally distant files, scored by path distance \u00D7 edge-kind weight. Use before a refactor to discover hidden dependencies that will break. High score = more unexpected.\n\n\\`\\`\\`\nkirograph_surprising(limit: 20)\n\\`\\`\\`\n\n### \\`kirograph_diff\\`: what changed since a snapshot?\n\nCompares the current graph against a saved snapshot. Shows added/removed symbols and edges. A snapshot must exist: the user saves one with \\`kirograph snapshot save <label>\\` before making changes.\n\n\\`\\`\\`\nkirograph_diff() // vs latest snapshot\nkirograph_diff(snapshot: \"pre-refactor\") // vs named snapshot\n\\`\\`\\``;\n }\n\n // Architecture tools block\n if (enableArchitecture) {\n toolRef += `\n\n---\n\n## Architecture tools *(require \\`enableArchitecture: true\\` in config)*\n\n### \\`kirograph_architecture\\`: **start here for architectural questions**\n\nReturns the full package graph, detected layers (api/service/data/ui/shared), and their dependency edges.\n\n\\`\\`\\`\nkirograph_architecture() // packages + layers\nkirograph_architecture(level: \"packages\")\nkirograph_architecture(level: \"layers\")\nkirograph_architecture(includeFiles: true) // add file\u2192package assignments\n\\`\\`\\`\n\n### \\`kirograph_coupling\\`: stability metrics per package\n\nReturns Ca (afferent: depended on by), Ce (efferent: depends on), and instability (Ce/(Ca+Ce)).\n- High Ca + low instability = load-bearing, safe to depend on, risky to change interface.\n- High Ce + high instability = depends on many things, safe to refactor internals.\n\n\\`\\`\\`\nkirograph_coupling() // all packages, sorted by instability\nkirograph_coupling(sortBy: \"afferent\") // most depended-on first\nkirograph_coupling(sortBy: \"efferent\") // most outgoing deps first\n\\`\\`\\`\n\n### \\`kirograph_package\\`: drill into one package\n\nReturns metadata, coupling metrics, outgoing deps, incoming dependents, and file list.\n\n\\`\\`\\`\nkirograph_package(package: \"auth\")\nkirograph_package(package: \"src/services\", includeFiles: false)\n\\`\\`\\``;\n }\n\n // Complexity tools block\n if (enableComplexity) {\n toolRef += `\n\n---\n\n## Complexity tools *(require \\`enableComplexity: true\\` in config)*\n\n### \\`kirograph_health\\`: composite graph health score\n\nReturns a 0\u201310000 score across four dimensions: complexity, dead code, coupling, circular deps.\nHigher is better. Excellent \u2265 9000 \u00B7 Good \u2265 7000 \u00B7 Fair \u2265 5000 \u00B7 Poor \u2265 3000 \u00B7 Critical < 3000.\n\n\\`\\`\\`\nkirograph_health()\n\\`\\`\\`\n\n### \\`kirograph_complexity\\`: rank functions by complexity\n\nReturns cyclomatic complexity (CC), cognitive complexity, maintainability index (MI), and nesting depth, sorted by chosen metric.\n\n\\`\\`\\`\nkirograph_complexity(metric: \"cyclomatic\", limit: 30, threshold: 10)\nkirograph_complexity(metric: \"cognitive\")\nkirograph_complexity(metric: \"maintainability\") // sort ASC \u2014 lowest MI first\n\\`\\`\\`\n\n### \\`kirograph_dsm\\`: design structure matrix\n\nGroups nodes by top-level directory and shows a dependency count matrix between groups. Reveals which modules depend on which others and where tight coupling lives.\n\n\\`\\`\\`\nkirograph_dsm()\nkirograph_dsm(limit: 10) // cap number of groups shown\n\\`\\`\\`\n\n### \\`kirograph_test_risk\\`: risk-ranked functions\n\nRisk = complexity \u00D7 fan-in. Highest-risk functions are most likely to cause failures when changed.\n\n\\`\\`\\`\nkirograph_test_risk(limit: 20)\nkirograph_test_risk(threshold: 50) // only show risk score \u2265 50\n\\`\\`\\``;\n }\n\n // Git context tools block\n if (enableGitContext) {\n toolRef += `\n\n---\n\n## Git Context tools *(require \\`enableGitContext: true\\` in config)*\n\n### \\`kirograph_diff_context\\`: changed symbols in working tree\n\nReturns symbols whose definitions overlap with \\`git diff\\` line ranges, plus their callers and callees. Use before a commit to understand what you actually changed.\n\n\\`\\`\\`\nkirograph_diff_context() // unstaged changes\nkirograph_diff_context(staged: true) // staged changes only\n\\`\\`\\`\n\n### \\`kirograph_commit_context\\`: staged changes summary\n\nReturns staged files, diff stat, and affected symbols. Ready to paste into a commit message prompt.\n\n\\`\\`\\`\nkirograph_commit_context()\n\\`\\`\\`\n\n### \\`kirograph_pr_context\\`: semantic diff between two refs\n\nReturns symbols added/removed/changed between two git refs. Use for PR descriptions.\n\n\\`\\`\\`\nkirograph_pr_context(base: \"main\", head: \"HEAD\")\nkirograph_pr_context(base: \"v1.2.0\")\n\\`\\`\\`\n\n### \\`kirograph_test_map\\`: symbol \u2192 test file mapping\n\nShows which test files cover a symbol (by caller graph), and which symbols have no test coverage at all.\n\n\\`\\`\\`\nkirograph_test_map() // all uncovered symbols\nkirograph_test_map(symbol: \"processPayment\") // tests for a specific symbol\n\\`\\`\\`\n\n### \\`kirograph_test_coverage\\`: per-file coverage report\n\nParses lcov/Istanbul/Cobertura files. Sorted worst-first by default.\n\n\\`\\`\\`\nkirograph_test_coverage()\nkirograph_test_coverage(sortBy: \"desc\", limit: 20) // best coverage first\n\\`\\`\\``;\n }\n\n // Edit primitives tools block\n if (enableEditPrimitives) {\n toolRef += `\n\n---\n\n## Edit Primitives *(require \\`enableEditPrimitives: true\\` in config)*\n\nAtomic file edit tools. Each validates the anchor is unique before writing, then triggers \\`kirograph sync\\` to keep the graph up to date.\n\n### \\`kirograph_str_replace\\`: replace a unique string\n\nFails on 0 or >1 matches \u2014 safe to use without counting occurrences first.\n\n\\`\\`\\`\nkirograph_str_replace(file: \"src/auth.ts\", old_str: \"const timeout = 5000\", new_str: \"const timeout = 10000\")\n\\`\\`\\`\n\n### \\`kirograph_multi_str_replace\\`: N replacements as one transaction\n\nAll-or-nothing: if any replacement fails, none are applied.\n\n\\`\\`\\`\nkirograph_multi_str_replace(file: \"src/auth.ts\", pairs: [\n { old_str: \"oldFunctionName\", new_str: \"newFunctionName\" },\n { old_str: \"OldClass\", new_str: \"NewClass\" }\n])\n\\`\\`\\`\n\n### \\`kirograph_insert_at\\`: insert before/after an anchor\n\n\\`\\`\\`\nkirograph_insert_at(file: \"src/routes.ts\", anchor: \"// END ROUTES\", content: \"router.get('/health', healthCheck);\", position: \"before\")\n\\`\\`\\`\n\n### \\`kirograph_refactor\\`: structured search-and-replace across the graph\n\n\\`\\`\\`\nkirograph_refactor(symbol: \"OldName\", newName: \"NewName\", kind: \"function\")\n\\`\\`\\``;\n }\n\n // Branch tools block\n if (enableBranch) {\n toolRef += `\n\n---\n\n## Branch tools *(require \\`enableBranch: true\\` in config)*\n\nEach branch gets its own SQLite DB at \\`.kirograph/branch-<name>.db\\`. Use \\`kirograph branch add\\` to start tracking a branch.\n\n### \\`kirograph_branch_list\\`: tracked branches\n\n\\`\\`\\`\nkirograph_branch_list()\n\\`\\`\\`\n\n### \\`kirograph_branch_diff\\`: symbols added/removed/changed between branches\n\n\\`\\`\\`\nkirograph_branch_diff(branchA: \"feature/new-auth\", branchB: \"main\")\n\\`\\`\\`\n\n### \\`kirograph_branch_search\\`: search symbols in another branch\n\n\\`\\`\\`\nkirograph_branch_search(query: \"processPayment\", branch: \"main\")\n\\`\\`\\``;\n }\n\n // Build bug fix workflow\n let bugFixWorkflow = `**Bug fix or feature:**\n1. \\`kirograph_context\\`: orient, find entry points.\n2. \\`kirograph_node\\` with \\`includeCode: true\\`: read the relevant symbol.`;\n if (trackCallSites) {\n bugFixWorkflow += `\n3. \\`kirograph_callers\\` / \\`kirograph_callees\\`: trace the call flow.\n4. \\`kirograph_impact\\`: check blast radius before editing.`;\n } else {\n bugFixWorkflow += `\n3. \\`kirograph_impact\\`: check blast radius before editing.`;\n }\n\n // Build workflows section\n let workflows = `\n\n---\n\n## Workflows\n\n${bugFixWorkflow}`;\n\n if (enableCodeHealth) {\n workflows += `\n\n**Refactor planning:**\n1. \\`kirograph_hotspots\\`: identify the most-connected symbols; changing these is risky.\n2. \\`kirograph_surprising\\`: surface hidden coupling that will break.\n3. \\`kirograph_impact\\` on specific targets: confirm blast radius.\n4. \\`kirograph_diff\\` after the refactor: verify the structural change matches intent.`;\n }\n\n if (enableArchitecture) {\n workflows += `\n\n**Architectural review:**\n1. \\`kirograph_architecture\\`: get the package and layer map.\n2. \\`kirograph_coupling\\`: find the most stable (high Ca) and most volatile (high instability) packages.\n3. \\`kirograph_package\\`: drill into any package of interest.\n4. \\`kirograph_circular_deps\\`: check for import cycles.`;\n }\n\n if (enableCodeHealth) {\n workflows += `\n\n**Code cleanup:**\n1. \\`kirograph_dead_code\\`: find unreferenced unexported symbols.\n2. \\`kirograph_circular_deps\\`: find import cycles to untangle.\n3. \\`kirograph_surprising\\`: find unexpected coupling to decouple.`;\n }\n\n if (enableComplexity) {\n workflows += `\n\n**Code quality audit:**\n1. \\`kirograph_health\\`: get overall health score and breakdown.\n2. \\`kirograph_complexity\\`: rank functions by cyclomatic complexity \u2014 focus on CC > 10.\n3. \\`kirograph_test_risk\\`: find highest-risk functions (complexity \u00D7 fan-in) to prioritize test coverage.\n4. \\`kirograph_dsm\\`: check architectural coupling \u2014 high off-diagonal counts = tight coupling.`;\n }\n\n if (enableGitContext) {\n workflows += `\n\n**Pre-commit / pre-push review:**\n1. \\`kirograph_diff_context\\`: understand what symbols changed and who calls them.\n2. \\`kirograph_test_map\\`: verify changed symbols have test coverage.\n3. \\`kirograph_commit_context\\`: build a structured commit message.\n\n**PR description:**\n1. \\`kirograph_pr_context(base: \"main\")\\`: get semantic diff between branches.\n2. Use the output as structured context for the PR summary.`;\n }\n\n if (enableEditPrimitives) {\n workflows += `\n\n**Safe atomic edit:**\n1. \\`kirograph_impact\\`: check blast radius before editing.\n2. \\`kirograph_str_replace\\` or \\`kirograph_insert_at\\`: apply atomic change \u2014 validates uniqueness first.\n3. After edit: \\`kirograph_diff\\` to verify only intended symbols changed.`;\n }\n\n if (enableBranch) {\n workflows += `\n\n**Cross-branch investigation:**\n1. \\`kirograph_branch_list\\`: see which branches are tracked.\n2. \\`kirograph_branch_diff\\`: find symbols added/removed/changed vs target branch.\n3. \\`kirograph_branch_search\\`: locate a symbol in another branch's graph.`;\n }\n\n // Workflow steering files require at least navigation/call-sites/code-health to be useful\n const hasRichFeatures = enableNavigation || enableCodeHealth || trackCallSites;\n\n // Build workflow steering rows\n const workflowRows: string[] = [\n ...(enableSecurity ? ['| security audit, check vulnerabilities, CVE review | `.kiro/steering/kirograph-security.md` |'] : []),\n ...(hasRichFeatures ? ['| code review, review this PR | `.kiro/steering/kirograph-review.md` |'] : []),\n ...(hasRichFeatures ? ['| debug, trace this bug, root cause | `.kiro/steering/kirograph-debug.md` |'] : []),\n ...(enableArchitecture ? ['| architecture, understand structure, package map | `.kiro/steering/kirograph-architecture.md` |'] : []),\n ...(hasRichFeatures ? ['| onboard, understand this codebase | `.kiro/steering/kirograph-onboard.md` |'] : []),\n ...(hasRichFeatures ? ['| refactor, rename, safe refactoring | `.kiro/steering/kirograph-refactor.md` |'] : []),\n ...(enableGitContext ? ['| git diff review, PR context, commit message | `.kiro/steering/kirograph-git-context.md` |'] : []),\n ...(enableComplexity ? ['| code quality audit, complexity, health score | `.kiro/steering/kirograph-complexity.md` |'] : []),\n ...(enableMemory ? ['| memory, recall decisions, conflict detection | `.kiro/steering/kirograph-mem-workflow.md` |'] : []),\n ...(enableWiki ? ['| wiki, update knowledge base, ingest docs | `.kiro/steering/kirograph-wiki-workflow.md` |'] : []),\n ];\n\n const workflowSection = `\n\n---\n\n## Workflow steering files\n\nKiroGraph installs task-specific steering files in \\`.kiro/steering/\\`. They are not always active \u2014 load them on demand.\n\n**In Kiro IDE:** type \\`/kirograph-review\\`, \\`/kirograph-security\\`, etc. to activate a workflow for the current session.\n\n**In Kiro CLI / other agents:** when the user asks for a specific workflow or you recognize the intent, read the file directly:\n\n\\`\\`\\`\nRead file: .kiro/steering/kirograph-security.md\nRead file: .kiro/steering/kirograph-review.md\n\\`\\`\\`\n\n| User intent | File to load |\n|-------------|-------------|\n${workflowRows.join('\\n')}\n\nEach file contains numbered steps, exact tool calls, and an interpretation reference. Follow the steps in order.\n\n---\n\n## If \\`.kirograph/\\` does NOT exist\n\nAsk the user: \"This project doesn't have KiroGraph initialized. Run \\`kirograph init -i\\` to build a code knowledge graph for faster exploration?\"`;\n\n // Compose the full content\n let content = `---\ninclusion: always\n---\n\n# KiroGraph\n\nKiroGraph builds a semantic knowledge graph of your codebase. Use its MCP tools instead of grep/glob/file reads whenever \\`.kirograph/\\` exists in the project.\n\n## Quick decision guide\n\n| Question | Tool |\n|----------|------|\n${guideRows.join('\\n')}\n\n---\n${toolRef}\n${workflows}\n${workflowSection}\n`;\n\n // Insert compression section before the \"If .kirograph/ does NOT exist\" section\n if (enableCompression && shellCompressionLevel !== 'off') {\n const section = buildCompressionSection(shellCompressionLevel as 'normal' | 'aggressive' | 'ultra');\n content = content.replace(\n '---\\n\\n## If `.kirograph/` does NOT exist',\n section.trim() + '\\n\\n---\\n\\n## If `.kirograph/` does NOT exist',\n );\n }\n\n const caveman = cavemanMode && cavemanMode !== 'off' ? CAVEMAN_RULES[cavemanMode] : null;\n if (caveman) {\n content = content.trimEnd() + '\\n\\n' + caveman + '\\n';\n }\n\n // Memory section\n if (enableMemory) {\n const memorySection = `\n## Memory\n\nKiroGraph has persistent memory. Use it to recall past decisions and store new ones.\n\n| Question | Tool |\n|----------|------|\n| What did we decide about X? | \\`kirograph_mem_search\\` |\n| Store a decision / bug fix / pattern | \\`kirograph_mem_store\\` |\n| Does this contradict something stored? | \\`kirograph_mem_conflicts_scan\\` |\n| Two observations conflict \u2014 which wins? | \\`kirograph_mem_compare\\` \u2192 \\`kirograph_mem_judge\\` |\n| Extract observations from structured text | \\`kirograph_mem_capture\\` |\n| Which observations need re-evaluation? | \\`kirograph_mem_review\\` |\n| Mark an observation as still valid | \\`kirograph_mem_mark_reviewed\\` |\n\nMemory is searchable via hybrid FTS + vector search. Observations surface automatically in\n\\`kirograph_context\\` and \\`kirograph_impact\\` results when linked to relevant code symbols.\n\n**When to store:** After fixing a bug, making an architecture decision, discovering a pattern,\nor learning something future sessions should know. One fact per store call. A hook reminds you\nat session end.\n\n**topicKey:** Use a stable semantic key (e.g. \\`\"architecture/auth-model\"\\`) when storing a\ndecision that may be superseded or revisited. Lets you address the same concept across sessions.\n\n**reviewAfter:** Pass an epoch-ms timestamp when an observation should expire or be re-evaluated\n(e.g. after a planned migration, a library upgrade, or a time-boxed experiment).\n\nFor the full conflict-detection workflow, load: \\`.kiro/steering/kirograph-mem-workflow.md\\`\n`;\n content = content.trimEnd() + '\\n\\n' + memorySection.trim() + '\\n';\n }\n\n // Documentation section\n if (enableDocs) {\n const docsSection = `\n## Documentation\n\nKiroGraph indexes project documentation by heading structure. Use \\`kirograph_docs_search\\`\nto find relevant doc sections instead of reading entire files. Use \\`kirograph_docs_section\\`\nto retrieve the exact section you need by ID.\n\n**Available tools:**\n- \\`kirograph_docs_toc\\` \u2014 table of contents for a file or the whole project\n- \\`kirograph_docs_search\\` \u2014 search sections by query (independent from code search)\n- \\`kirograph_docs_section\\` \u2014 retrieve full content of a section by ID\n- \\`kirograph_docs_outline\\` \u2014 heading hierarchy for a single document\n- \\`kirograph_docs_refs\\` \u2014 find code symbols referenced by a doc section (or vice versa)\n\n**When to use:** Before reading a documentation file directly, check if \\`kirograph_docs_search\\`\nor \\`kirograph_docs_outline\\` can give you the specific section you need. This saves tokens\nand gives you structured navigation instead of raw file content.\n`;\n content = content.trimEnd() + '\\n\\n' + docsSection.trim() + '\\n';\n }\n\n // Data section\n if (enableData) {\n const dataSection = `\n## Data\n\nKiroGraph indexes tabular data files (CSV, TSV, JSONL, JSON, Excel, Parquet) for structured\nquerying. Use \\`kirograph_data_describe\\` to understand a dataset's schema without loading\nthe file. Use \\`kirograph_data_query\\` with filters to retrieve specific rows.\n\n**Available tools:**\n- \\`kirograph_data_list\\` \u2014 list all indexed datasets with row/column counts\n- \\`kirograph_data_describe\\` \u2014 full schema profile: column names, types, cardinality, null%, samples\n- \\`kirograph_data_query\\` \u2014 filtered row retrieval with structured operators (eq, gt, contains, in, between)\n- \\`kirograph_data_aggregate\\` \u2014 server-side GROUP BY: count, sum, avg, min, max, count_distinct\n- \\`kirograph_data_search\\` \u2014 search column names and sample values by keyword\n\n**When to use:** Instead of reading a CSV/data file directly (which floods context with raw rows),\nuse \\`kirograph_data_describe\\` to understand the schema, then \\`kirograph_data_query\\` with\nfilters to get only the rows you need. For summary statistics, use \\`kirograph_data_aggregate\\`\nto compute results server-side. This saves 95-99% of tokens compared to reading raw data files.\n\n\\`\\`\\`\nkirograph_data_list()\nkirograph_data_describe(dataset: \"tests-fixtures-users\")\nkirograph_data_query(dataset: \"tests-fixtures-users\", filters: [{column: \"role\", op: \"eq\", value: \"admin\"}])\nkirograph_data_aggregate(dataset: \"data-orders\", groupBy: [\"region\"], metrics: [{column: \"amount\", op: \"sum\"}])\n\\`\\`\\`\n`;\n content = content.trimEnd() + '\\n\\n' + dataSection.trim() + '\\n';\n }\n\n // Patterns section\n if (enablePatterns) {\n const patternsSection = `\n## Pattern Matching\n\nKiroGraph can search for structural code patterns using @ast-grep/napi.\n\n**Available tools (only when enablePatterns: true and @ast-grep/napi installed):**\n- \\`kirograph_live_search\\` \u2014 search for any AST pattern across the codebase at query time\n\n**CLI commands:**\n- \\`kirograph pattern \"<pattern>\"\\` \u2014 live structural search\n- \\`kirograph pattern --list\\` \u2014 browse bundled SAST rules\n- \\`kirograph pattern --library <id>\\` \u2014 run a specific library rule\n\n**When to use:** When you need to find code patterns that can't be expressed as symbol names or semantic queries \u2014 \"all eval() calls\", \"all SQL string concatenation\", \"all readFile with request parameters\".\n`;\n content = content.trimEnd() + '\\n\\n' + patternsSection.trim() + '\\n';\n }\n\n // General compression section\n if (enableGeneralCompression) {\n const generalCompressionSection = `\n## General-purpose compression\n\n\\`kirograph_compress\\` is an on-demand tool for reducing token usage before content reaches the model.\nCall it whenever you receive large input that you need to reason over but not reproduce verbatim.\n\n**Two engines \u2014 auto-routed by the \\`command\\` parameter:**\n\n| Scenario | Call |\n|----------|------|\n| Paste of shell output (git log, npm install, test run, docker ps\u2026) | \\`kirograph_compress(text: \"...\", command: \"git log\")\\` |\n| Prose text, RAG chunk, observation, or mixed content | \\`kirograph_compress(text: \"...\")\\` |\n\n- **With \\`command\\`:** rtk-style structural filters \u2014 pattern-matched to the command family (git, test, lint, docker, etc.), removes noise, deduplicates repeated lines, keeps structure.\n- **Without \\`command\\`:** caveman grammar \u2014 removes filler words, articles, hedging phrases, and (at ultra level) applies standard abbreviations. Preserves code blocks, paths, URLs, and identifiers unchanged.\n\n**Compression levels** (same enum for both engines):\n- \\`lite\\` / \\`normal\\` \u2014 light touch: remove noise and filler only\n- \\`full\\` / \\`aggressive\\` \u2014 default: also remove articles, hedging, group repeated output\n- \\`ultra\\` \u2014 maximum: abbreviations, causality arrows (\u2192), conjunction compression (+)\n\n**When to use:**\n- You received a large file diff, log dump, or search result and only need the structure\n- You want to store an observation in memory and the text is verbose\n- A tool output is close to or over budget and you need to trim before reasoning\n\n**When NOT to use:**\n- Content that must be reproduced exactly (code to be written to disk, user quotes)\n- Short content (< 200 tokens) \u2014 overhead not worth it\n- Already-compressed output (kirograph_exec already applies rtk filters automatically)\n\n**Savings are reported inline:** \\`[42% saved | 1800\u21921044 | rtk:git:aggressive]\\`\n`;\n content = content.trimEnd() + '\\n\\n' + generalCompressionSection.trim() + '\\n';\n }\n\n // Wiki section\n if (enableWiki) {\n const wikiSection = `\n## Wiki\n\nKiroGraph maintains a structured LLM wiki \u2014 a set of markdown pages that compound knowledge\nacross sessions. Use it to look up project decisions, architecture facts, and domain knowledge\nbefore starting work. Use it to save knowledge that should survive context resets.\n\n**Available tools:**\n- \\`kirograph_wiki_ingest\\` \u2014 build an ingest prompt for a source text; pass the result to yourself to generate a WIKI_DIFF\n- \\`kirograph_wiki_apply_diff\\` \u2014 apply a WIKI_DIFF to create or update wiki pages\n- \\`kirograph_wiki_search\\` \u2014 full-text search over wiki pages\n- \\`kirograph_wiki_page\\` \u2014 retrieve the full content of a page by slug\n- \\`kirograph_wiki_list\\` \u2014 list all pages with metadata\n- \\`kirograph_wiki_lint\\` \u2014 health check: broken links, orphan pages, contradictions\n\n**When to consult the wiki:**\n- Before starting a complex feature or bug fix: \\`kirograph_wiki_search(query: \"<topic>\")\\`\n- When the user references a concept you don't recognize from the code graph alone\n- After \\`kirograph_context\\` returns wiki enrichments (pages above threshold score)\n\n**When to update the wiki:**\n- End of a session that produced durable knowledge (architecture decision, API contract, process)\n- The ingest hook will remind you at agentStop if \\`enableWiki: true\\` is set\n\n**Quick workflow:**\n1. \\`kirograph_wiki_ingest\\` \u2014 get the prompt with SCHEMA + MANIFEST + your source text\n2. Generate a \\`WIKI_DIFF\\` block (create/upsert/append per page)\n3. \\`kirograph_wiki_apply_diff\\` \u2014 apply it; review any pending conflicts in the response\n`;\n content = content.trimEnd() + '\\n\\n' + wikiSection.trim() + '\\n';\n }\n\n // Security section\n if (enableSecurity) {\n const securitySection = `\n## Security\n\nKiroGraph scans dependency manifests across 14 ecosystems for known vulnerabilities, performs\ncall-graph reachability analysis, tracks exploitation probability (EPSS), checks license\ncompliance, and monitors dependency staleness.\n\n**Available tools:**\n- \\`kirograph_security\\` \u2014 overview: dep count, CVE count, verdict breakdown, stale warnings\n- \\`kirograph_vulns\\` \u2014 list CVEs with severity, EPSS score, reachability verdict, fix suggestion\n- \\`kirograph_reachability\\` \u2014 deep-dive: call paths, entry points, affected layers for one CVE or package\n- \\`kirograph_licenses\\` \u2014 list dependency licenses; flag policy violations (deny/warn by SPDX pattern)\n- \\`kirograph_staleness\\` \u2014 identify outdated dependencies (staleness score 0.0\u20131.0)\n- \\`kirograph_sbom\\` \u2014 export CycloneDX 1.5 SBOM for compliance/auditing\n- \\`kirograph_vex\\` \u2014 export CycloneDX 1.5 VEX with reachability-derived analysis states\n- \\`kirograph_vuln_add\\` \u2014 manually register a private/internal CVE not in public databases\n\n**Proactive triggers \u2014 run \\`kirograph_security\\` when:**\n- You or the user add/update/remove a dependency\n- Before a production deploy or release branch cut\n- The user asks about security, compliance, or \"is it safe to upgrade X\"\n- \\`kirograph_context\\` surfaces a \u26A0 Security warning in its output\n\n**Interpreting verdicts:**\n- \\`affected\\` \u2014 a call path exists from an entry point to the vulnerable code. Act on this.\n- \\`not_affected\\` \u2014 no reachable path found, no unresolved imports. Strong signal: likely safe.\n- \\`under_investigation\\` \u2014 traversal hit unresolved symbols (dynamic dispatch, reflection). Treat with caution.\n\n**Interpreting EPSS scores** (shown by \\`kirograph_vulns\\`):\n- \\`>= 0.5\\` \u2014 actively exploited or very likely to be. Patch immediately regardless of CVSS.\n- \\`0.1 \u2013 0.5\\` \u2014 elevated risk. Prioritize over low-EPSS vulns with higher CVSS.\n- \\`< 0.1\\` \u2014 low exploitation probability. Use CVSS + reachability for triage.\n\n**Recommended workflow:**\n1. \\`kirograph_security\\` \u2014 get the big picture before diving in\n2. \\`kirograph_vulns --verdict affected\\` \u2014 focus only on confirmed reachable CVEs\n3. For each high-EPSS or high-CVSS result: \\`kirograph_reachability <cve>\\` to see exact call paths\n4. \\`kirograph_licenses --policy\\` \u2014 check for license violations before shipping\n5. \\`kirograph_staleness --threshold 0.5\\` \u2014 flag severely outdated dependencies\n6. Fix, then \\`kirograph_vulns --refresh\\` to re-query OSV and confirm resolution\n7. \\`kirograph_vex\\` / \\`kirograph_sbom\\` for compliance artifacts\n\n**Staleness score guide:** 0.0 = current; 0.3+ = worth reviewing; 0.7+ = significantly behind.\nA high staleness score alone is not a security issue, but old dependencies accumulate CVEs over time.\n`;\n content = content.trimEnd() + '\\n\\n' + securitySection.trim() + '\\n';\n }\n\n return content;\n}\n\nexport function writeSteering(kiroDir: string, opts?: SteeringOptions | CavemanMode | 'off'): void {\n const steeringDir = path.join(kiroDir, 'steering');\n fs.mkdirSync(steeringDir, { recursive: true });\n const steeringPath = path.join(steeringDir, 'kirograph.md');\n\n // Support both old signature (cavemanMode string) and new signature (options object)\n const resolvedOpts: SteeringOptions = typeof opts === 'string'\n ? { cavemanMode: opts }\n : opts ?? {};\n\n fs.writeFileSync(steeringPath, buildSteeringContent(resolvedOpts));\n console.log(` \u2713 Steering file written to ${steeringPath}`);\n\n // Write workflow-specific steering files\n writeWorkflowSteering(steeringDir, resolvedOpts);\n}\n\nfunction writeWorkflowSteering(steeringDir: string, opts?: SteeringOptions): void {\n const trackCallSites = opts?.trackCallSites ?? false;\n const enableCodeHealth = opts?.enableCodeHealth ?? false;\n const enableArchitecture = opts?.enableArchitecture ?? false;\n const enableNavigation = opts?.enableNavigation ?? false;\n const enableGitContext = opts?.enableGitContext ?? false;\n const enableComplexity = opts?.enableComplexity ?? false;\n const enableEditPrimitives = opts?.enableEditPrimitives ?? false;\n\n // Only write review/debug/onboard/refactor workflows when the install has meaningful tool groups.\n // Core-only (3 tools) doesn't have kirograph_impact, kirograph_files etc. that these workflows depend on.\n const hasRichFeatures = enableNavigation || enableCodeHealth || trackCallSites;\n\n if (hasRichFeatures) {\n // kirograph-review.md\n const reviewSteps: string[] = [\n `1. **Understand the change scope**\n \\`\\`\\`\n kirograph_context(task: \"<describe what changed>\")\n \\`\\`\\``,\n ];\n if (enableGitContext) {\n reviewSteps.push(`2. **See exactly what symbols changed**\n \\`\\`\\`\n kirograph_diff_context(staged: true)\n \\`\\`\\`\n Lists changed symbols, their callers (who may break), and callees (what they depend on).`);\n }\n reviewSteps.push(`${reviewSteps.length + 1}. **Analyze blast radius**\n For each key symbol that was modified:\n \\`\\`\\`\n kirograph_impact(symbol: \"<changed symbol>\", depth: 2)\n \\`\\`\\``);\n if (enableGitContext) {\n reviewSteps.push(`${reviewSteps.length + 1}. **Verify test coverage for changed symbols**\n \\`\\`\\`\n kirograph_test_map(symbol: \"<changed symbol>\")\n \\`\\`\\`\n Flag any changed symbols with no test files in their caller graph.`);\n } else if (trackCallSites) {\n reviewSteps.push(`${reviewSteps.length + 1}. **Check test coverage**\n \\`\\`\\`\n kirograph_callers(symbol: \"<changed symbol>\")\n \\`\\`\\`\n Look for test files among the callers. Flag untested changes.`);\n }\n if (enableComplexity) {\n reviewSteps.push(`${reviewSteps.length + 1}. **Check risk score of changed functions**\n \\`\\`\\`\n kirograph_test_risk(limit: 10)\n \\`\\`\\`\n High risk (complexity \u00D7 fan-in) = extra scrutiny warranted.`);\n }\n if (enableCodeHealth) {\n reviewSteps.push(`${reviewSteps.length + 1}. **Look for surprising coupling**\n \\`\\`\\`\n kirograph_surprising(limit: 10)\n \\`\\`\\``);\n }\n const findingsN = reviewSteps.length + 1;\n reviewSteps.push(`${findingsN}. **Produce findings** grouped by risk level (high/medium/low) with:\n - What changed and why it matters\n - Test coverage status\n - Suggested improvements\n - Overall merge recommendation`);\n fs.writeFileSync(path.join(steeringDir, 'kirograph-review.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Code Review Workflow\n\nFollow these steps for a structured, risk-aware code review using the knowledge graph.\n\n## Steps\n\n${reviewSteps.join('\\n\\n')}\n`);\n\n // kirograph-debug.md\n const debugSteps: string[] = [\n `1. **Find related code**\n \\`\\`\\`\n kirograph_search(query: \"<error message or symptom keywords>\")\n \\`\\`\\``,\n `2. **Get full context**\n \\`\\`\\`\n kirograph_context(task: \"<describe the bug>\")\n \\`\\`\\``,\n ];\n if (enableGitContext) {\n debugSteps.push(`3. **Check what recently changed in related symbols**\n \\`\\`\\`\n kirograph_diff_context()\n \\`\\`\\`\n Most bugs trace back to recent changes \u2014 this surfaces them immediately.`);\n } else if (enableCodeHealth) {\n debugSteps.push(`3. **Check what changed recently**\n \\`\\`\\`\n kirograph_diff()\n \\`\\`\\``);\n }\n if (trackCallSites) {\n const n = debugSteps.length + 1;\n debugSteps.push(`${n}. **Trace the call chain**\n \\`\\`\\`\n kirograph_callers(symbol: \"<suspected function>\")\n kirograph_callees(symbol: \"<suspected function>\")\n \\`\\`\\``);\n }\n const blastN = debugSteps.length + 1;\n debugSteps.push(`${blastN}. **Understand blast radius**\n \\`\\`\\`\n kirograph_impact(symbol: \"<root cause symbol>\", depth: 3)\n \\`\\`\\``);\n const debugTips: string[] = [];\n if (trackCallSites) debugTips.push('- Check both callers and callees to understand the full context');\n if (enableGitContext) debugTips.push('- `kirograph_diff_context` is the fastest way to spot a regression \u2014 check it first');\n else if (enableCodeHealth) debugTips.push('- Recent changes (via diff) are the most common source of new issues');\n debugTips.push('- Use `kirograph_path` to trace how two symbols are connected');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-debug.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Debug Workflow\n\nFollow these steps to systematically trace and debug issues using the knowledge graph.\n\n## Steps\n\n${debugSteps.join('\\n\\n')}\n\n## Tips\n${debugTips.join('\\n')}\n`);\n\n // kirograph-onboard.md\n const onboardSteps: string[] = [\n `1. **Project overview**\n \\`\\`\\`\n kirograph_status()\n \\`\\`\\``,\n `2. **File structure**\n \\`\\`\\`\n kirograph_files(format: \"tree\", maxDepth: 2)\n \\`\\`\\``,\n ];\n if (enableCodeHealth) {\n onboardSteps.push(`3. **Key entry points**\n \\`\\`\\`\n kirograph_hotspots(limit: 15)\n \\`\\`\\``);\n }\n if (enableArchitecture) {\n const n = onboardSteps.length + 1;\n onboardSteps.push(`${n}. **Architecture layers**\n \\`\\`\\`\n kirograph_architecture()\n \\`\\`\\``);\n }\n const exploreN = onboardSteps.length + 1;\n onboardSteps.push(`${exploreN}. **Explore a specific area**\n \\`\\`\\`\n kirograph_context(task: \"<area you want to understand>\")\n \\`\\`\\``);\n const symbolN = onboardSteps.length + 1;\n onboardSteps.push(`${symbolN}. **Understand a key symbol**\n \\`\\`\\`\n kirograph_node(symbol: \"<symbol name>\", includeCode: true)\n \\`\\`\\``);\n const onboardTips: string[] = ['- Start broad (status, files) then narrow down'];\n if (enableCodeHealth) onboardTips[0] = '- Start broad (status, files, hotspots) then narrow down';\n if (enableCodeHealth) onboardTips.push('- Use `kirograph_type_hierarchy` to understand inheritance patterns');\n if (trackCallSites) onboardTips.push('- Use `kirograph_callees` on entry points to trace execution flow');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-onboard.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Onboarding Workflow\n\nFollow these steps to quickly understand a new codebase.\n\n## Steps\n\n${onboardSteps.join('\\n\\n')}\n\n## Tips\n${onboardTips.join('\\n')}\n`);\n\n // kirograph-refactor.md\n const refactorSteps: string[] = [\n `1. **Understand what you're changing**\n \\`\\`\\`\n kirograph_node(symbol: \"<target symbol>\", includeCode: true)\n \\`\\`\\``,\n `2. **Check blast radius**\n \\`\\`\\`\n kirograph_impact(symbol: \"<target symbol>\", depth: 3)\n \\`\\`\\``,\n ];\n if (trackCallSites) {\n refactorSteps.push(`3. **Find all callers (rename preview)**\n \\`\\`\\`\n kirograph_callers(symbol: \"<target symbol>\", limit: 50)\n \\`\\`\\``);\n }\n if (enableCodeHealth) {\n let n = refactorSteps.length + 1;\n refactorSteps.push(`${n}. **Check for cycles that might complicate the refactor**\n \\`\\`\\`\n kirograph_circular_deps()\n \\`\\`\\``);\n n++;\n refactorSteps.push(`${n}. **Find dead code to clean up**\n \\`\\`\\`\n kirograph_dead_code(limit: 30)\n \\`\\`\\``);\n n++;\n refactorSteps.push(`${n}. **Verify after changes**\n Run \\`kirograph sync\\` then:\n \\`\\`\\`\n kirograph_diff()\n \\`\\`\\``);\n }\n const refactorChecks: string[] = ['- Always check `kirograph_impact` before major refactors'];\n if (trackCallSites) refactorChecks.push('- Use `kirograph_callers` as a rename preview (all locations that reference the symbol)');\n if (enableCodeHealth) refactorChecks.push('- After changes, use `kirograph_diff` to verify only intended symbols changed');\n if (enableEditPrimitives) refactorChecks.push('- Use `kirograph_str_replace` / `kirograph_multi_str_replace` for atomic edits that auto-sync the graph');\n fs.writeFileSync(path.join(steeringDir, 'kirograph-refactor.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Refactoring Workflow\n\nFollow these steps to plan and execute safe refactoring.\n\n## Steps\n\n${refactorSteps.join('\\n\\n')}\n\n## Safety Checks\n${refactorChecks.join('\\n')}\n`);\n\n } // end hasRichFeatures\n\n // kirograph-architecture.md only when enableArchitecture is true\n if (enableArchitecture) {\n const archSteps: string[] = [\n `1. **Get project overview**\n \\`\\`\\`\n kirograph_status()\n \\`\\`\\``,\n `2. **View architecture**\n \\`\\`\\`\n kirograph_architecture()\n \\`\\`\\``,\n `3. **Check coupling health**\n \\`\\`\\`\n kirograph_coupling(sortBy: \"instability\")\n \\`\\`\\``,\n ];\n if (enableCodeHealth) {\n let n = archSteps.length + 1;\n archSteps.push(`${n}. **Find core abstractions**\n \\`\\`\\`\n kirograph_hotspots(limit: 20)\n \\`\\`\\``);\n n++;\n archSteps.push(`${n}. **Detect hidden dependencies**\n \\`\\`\\`\n kirograph_surprising(limit: 15)\n \\`\\`\\``);\n n++;\n archSteps.push(`${n}. **Check for cycles**\n \\`\\`\\`\n kirograph_circular_deps()\n \\`\\`\\``);\n }\n if (enableComplexity) {\n let n = archSteps.length + 1;\n archSteps.push(`${n}. **Module coupling matrix (DSM)**\n \\`\\`\\`\n kirograph_dsm()\n \\`\\`\\`\n High off-diagonal counts = tight coupling. Complements \\`kirograph_coupling\\` (package-level) with a symbol-level view.`);\n n++;\n archSteps.push(`${n}. **Overall health score**\n \\`\\`\\`\n kirograph_health()\n \\`\\`\\`\n The circular deps and coupling components directly reflect architectural quality.`);\n }\n const archInterpretation = [\n '- High Ca (afferent) = load-bearing, risky to change interface',\n '- High Ce (efferent) = depends on many things, safe to refactor internals',\n ...(enableCodeHealth ? ['- Surprising edges = hidden coupling that may break during refactoring'] : []),\n ...(enableComplexity ? ['- DSM diagonal = self-coupling (normal). Off-diagonal = cross-module coupling (minimize).'] : []),\n ...(enableComplexity ? ['- Health circular_score < 1500 = architectural debt requiring attention'] : []),\n ];\n fs.writeFileSync(path.join(steeringDir, 'kirograph-architecture.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Architecture Exploration Workflow\n\nFollow these steps to understand the high-level structure of the codebase.\n\n## Steps\n\n${archSteps.join('\\n\\n')}\n\n## Interpretation\n${archInterpretation.join('\\n')}\n`);\n }\n\n // Security workflow \u2014 only when enableSecurity is true\n if (opts?.enableSecurity) {\n const securityPatternsStep = opts?.enablePatterns ? `\n### 5b. Structural vulnerability patterns (AST search)\n\\`\\`\\`\nkirograph_live_search(pattern: \"eval($X)\", language: \"javascript\")\nkirograph_live_search(pattern: \"$OBJ.query($A + $B)\", language: \"typescript\")\n\\`\\`\\`\nUse \\`kirograph pattern --list\\` to browse bundled SAST rules (SQL injection, path traversal, hardcoded secrets, etc.).\nThese patterns find code issues missed by dependency scanning.` : '';\n\n const securityComplexityStep = enableComplexity ? `\n### 5c. High-complexity code in security-critical paths\n\\`\\`\\`\nkirograph_test_risk(limit: 15)\n\\`\\`\\`\nHigh risk (complexity \u00D7 fan-in) in auth/payment/session code = higher attack surface. Cross-reference with reachability results.` : '';\n\n fs.writeFileSync(path.join(steeringDir, 'kirograph-security.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Security Audit Workflow\n\nFollow these steps for a structured security audit using the knowledge graph.\nActivate this workflow before a release, after adding dependencies, or when asked to review security posture.\n\n## Steps\n\n### 1. Overview\n\\`\\`\\`\nkirograph_security()\n\\`\\`\\`\nNote: total dependencies, vulnerability count, verdict breakdown, stale warning count.\n\n### 2. Triage reachable vulnerabilities\n\\`\\`\\`\nkirograph_vulns(verdict: \"affected\")\n\\`\\`\\`\nFocus only on confirmed reachable CVEs. Sort output by EPSS score (exploitation probability) first, then CVSS severity.\n\n**Act immediately on:** EPSS >= 0.5 (actively exploited). Patch regardless of CVSS.\n**Prioritize:** EPSS 0.1\u20130.5 over low-EPSS high-CVSS entries.\n**Low urgency:** EPSS < 0.1 \u2014 use CVSS + reachability for triage.\n\n### 3. Deep-dive reachability for critical CVEs\nFor each high-priority CVE from step 2:\n\\`\\`\\`\nkirograph_reachability(target: \"<CVE-ID or package name>\")\n\\`\\`\\`\nThis shows: exact call paths from entry points, affected architectural layers, distinct path count.\n\n- \\`affected\\` verdict with known entry points \u2192 fix this dependency\n- \\`not_affected\\` \u2192 no reachable path, document and move on\n- \\`under_investigation\\` \u2192 unresolved symbols, treat conservatively\n\n### 4. Check for under-investigation CVEs\n\\`\\`\\`\nkirograph_vulns(verdict: \"under_investigation\")\n\\`\\`\\`\nFor each: run \\`kirograph_reachability\\` to see what symbols are unresolved. If you can determine\nthe symbol is not called, you can downgrade to not_affected manually.\n\n### 5. License compliance\n\\`\\`\\`\nkirograph_licenses(policy: true)\n\\`\\`\\`\nReview any DENY violations \u2014 these must be resolved before shipping.\nWARN violations should be documented and approved by the team.\n${securityPatternsStep}${securityComplexityStep}\n\n### 6. Dependency staleness\n\\`\\`\\`\nkirograph_staleness(threshold: 0.5)\n\\`\\`\\`\nScore guide: 0.3+ = worth reviewing, 0.7+ = significantly behind.\nCross-reference with step 2 results: stale + vulnerable = highest priority.\n\n### 7. Refresh data if needed\nIf vulnerability data looks stale (flagged in step 1) or dependencies changed recently:\n\\`\\`\\`\nkirograph_vulns(refresh: true)\n\\`\\`\\`\n\n### 8. Export compliance artifacts\n\\`\\`\\`\nkirograph_sbom() // Software Bill of Materials\nkirograph_vex() // Vulnerability Exploitability eXchange\n\\`\\`\\`\n\n## Interpretation Reference\n\n| Signal | Meaning | Action |\n|--------|---------|--------|\n| \\`affected\\` + EPSS >= 0.5 | Actively exploited, reachable | Patch immediately |\n| \\`affected\\` + CVSS >= 9.0 | Critical, reachable | Patch this sprint |\n| \\`affected\\` + CVSS 7.0\u20138.9 | High, reachable | Plan fix within 2 weeks |\n| \\`not_affected\\` | No reachable path found | Document, no action needed |\n| \\`under_investigation\\` | Reachability unclear | Manual review required |\n| Stale >= 0.7 | Very outdated | Review for accumulated CVEs |\n| License DENY | Policy violation | Must resolve before release |${opts?.enablePatterns ? '\\n| Pattern match in security-critical code | Code-level vulnerability pattern found | Review context with `kirograph_node` |' : ''}\n`);\n console.log(` \u2713 Security workflow steering file written`);\n }\n\n // Patterns workflow \u2014 only when enablePatterns is true\n if (opts?.enablePatterns) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-patterns.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Pattern Search Workflow\n\nUse this workflow to find structural code patterns using AST matching.\nActivate with \\`/kirograph-patterns\\` in Kiro IDE or CLI.\n\n## Steps\n\n### 1. Browse available rules\n\\`\\`\\`\nkirograph_live_search(pattern: \"--list\")\n\\`\\`\\`\nOr use the CLI: \\`kirograph pattern --list\\`\n\n### 2. Search for a specific structural pattern\n\\`\\`\\`\nkirograph_live_search(pattern: \"eval($X)\", language: \"typescript\")\n\\`\\`\\`\n\n### 3. Run a bundled library rule\n\\`\\`\\`\nkirograph pattern --library sql-injection-concat-js\n\\`\\`\\`\n\n### 4. Add a custom rule\nCreate a YAML file in your \\`patternLibraryPath\\` directory:\n\\`\\`\\`yaml\nid: my-custom-rule\nlanguage: [javascript, typescript]\nseverity: high\nowaspCategory: A03\ndescription: Custom pattern description\nfixHint: How to fix this issue.\nrule:\n pattern: dangerousFunction($ARG)\n\\`\\`\\`\n\n## Pattern syntax examples\n\n| Pattern | Matches |\n|---------|---------|\n| \\`eval($X)\\` | Any eval() call |\n| \\`$OBJ.query($A + $B)\\` | String concat in any query method |\n| \\`fs.$F(req.$P, $$$)\\` | Any fs method with request param |\n| \\`createHash('md5')\\` | Hardcoded MD5 usage |\n\n## Interpretation\n\n- Findings mean the pattern was found in the AST \u2014 not a false positive from symbol name matching\n- Check the surrounding context: \\`kirograph_node(symbol: \"...\", includeCode: true)\\`\n- Use \\`kirograph_callers\\` to understand how the affected function is reached\n`);\n console.log(` \u2713 Patterns workflow steering file written`);\n }\n\n // Wiki workflow \u2014 only when enableWiki is true\n if (opts?.enableWiki) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-wiki-workflow.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Wiki Workflow\n\nUse this workflow when you need to consult or update the project wiki.\nActivate with \\`/kirograph-wiki-workflow\\` in Kiro IDE or read the file directly.\n\n## When to use\n\n- Before a complex task: look up relevant wiki pages\n- After a session with durable knowledge: ingest it into the wiki\n- After a source file is added: run ingest to capture its content\n- Periodically: run lint to catch broken links or contradictions\n\n## Steps\n\n### 1. Look up existing knowledge before starting work\n\n\\`\\`\\`\nkirograph_wiki_search(query: \"<topic or keyword>\")\n\\`\\`\\`\n\nRead any relevant pages:\n\n\\`\\`\\`\nkirograph_wiki_page(slug: \"<slug from search results>\")\n\\`\\`\\`\n\n### 2. Ingest new knowledge (two-tool flow)\n\n**a. Get the ingest prompt:**\n\n\\`\\`\\`\nkirograph_wiki_ingest(source: \"<text, notes, or paste from docs>\", sourceName: \"<descriptive name>\")\n\\`\\`\\`\n\nThe tool returns a structured prompt containing the wiki SCHEMA, the current MANIFEST, and your source text.\n\n**b. Generate the WIKI_DIFF:**\n\nPass the returned prompt to yourself. Produce a \\`WIKI_DIFF_START ... WIKI_DIFF_END\\` block following the schema. Each entry should have a JSON header with \\`action\\`, \\`slug\\`, \\`title\\`, and \\`section\\` (optional), followed by markdown content.\n\n**c. Apply the diff:**\n\n\\`\\`\\`\nkirograph_wiki_apply_diff(diff: \"<the WIKI_DIFF block you generated>\")\n\\`\\`\\`\n\nReview the response for any pending conflicts and resolve them.\n\n### 3. List all pages\n\n\\`\\`\\`\nkirograph_wiki_list()\n\\`\\`\\`\n\n### 4. Health check (periodic)\n\n\\`\\`\\`\nkirograph_wiki_lint()\n\\`\\`\\`\n\nIssues to look for:\n- \\`broken_link\\`: a \\`[[slug]]\\` reference that points to a non-existent page \u2192 fix the slug or create the page\n- \\`orphan\\`: a page with no Related section and no incoming links \u2192 add Related or merge into another page\n- \\`stale_source\\`: a source with no date metadata \u2192 add a date to the source header\n- \\`contradiction\\`: two pages make semantically opposite claims \u2192 resolve via ingest or manual edit\n\n## WIKI_DIFF format reference\n\n\\`\\`\\`\nWIKI_DIFF_START\n{\"action\": \"create\", \"slug\": \"auth-flow\", \"title\": \"Authentication Flow\"}\n# Authentication Flow\n\nThe login flow validates credentials via JWT...\n\n## Related\n- [[user-model]]\nWIKI_DIFF_END\n\\`\\`\\`\n\nSupported actions: \\`create\\`, \\`upsert\\` (merge into existing), \\`append\\` (add to specific section).\n\nFor append, include \\`\"section\": \"Known Issues\"\\` in the header.\n\n## Conflict handling\n\nIf a diff contradicts an existing page, the tool reports it as a conflict:\n- With \\`wikiAutoResolveConflicts: true\\`: the newer source wins automatically\n- Without: the conflict is listed in the response \u2014 read both sides and ingest a resolution\n\n## CLI commands\n\n\\`\\`\\`bash\nkirograph wiki search \"<query>\"\nkirograph wiki page <slug>\nkirograph wiki list\nkirograph wiki lint\nkirograph wiki status\nkirograph wiki reindex\n\\`\\`\\`\n`);\n console.log(` \u2713 Wiki workflow steering file written`);\n }\n\n // Memory workflow \u2014 only when enableMemory is true\n if (opts?.enableMemory) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-mem-workflow.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Memory Workflow\n\nUse this workflow to recall past knowledge, store new observations, and keep the memory base\nconsistent by detecting and resolving conflicts.\n\n## 1. Recall before acting\n\nBefore making an architecture decision or fixing a bug, search what's already known:\n\n\\`\\`\\`\nkirograph_mem_search(query: \"<topic or keywords>\", kind: \"decision\")\nkirograph_mem_search(query: \"<error symptom>\", kind: \"error\")\n\\`\\`\\`\n\nResults include inline conflict annotations (\u26A1) \u2014 review them before proceeding.\n\n## 2. Store a new observation\n\nAfter a decision, bug fix, or discovery:\n\n\\`\\`\\`\nkirograph_mem_store(\n content: \"<one concise fact>\",\n kind: \"decision\" | \"error\" | \"pattern\" | \"architecture\" | \"note\",\n topicKey: \"<category/slug>\", // optional: stable semantic key for revisitable decisions\n reviewAfter: <epoch-ms> // optional: schedule re-evaluation after a migration/upgrade\n)\n\\`\\`\\`\n\n**topicKey examples:** \\`\"architecture/auth-model\"\\`, \\`\"infra/db-choice\"\\`, \\`\"pattern/error-handling\"\\`\n\n## 3. Capture observations from structured text\n\nIf you have a markdown block with bullet points under headings like \\`## Key Learnings\\` or\n\\`## Decisions\\`, extract them all at once:\n\n\\`\\`\\`\nkirograph_mem_capture(content: \"<markdown text>\", kind: \"decision\")\n\\`\\`\\`\n\n## 4. Detect conflicts\n\nAfter storing related observations, scan for potential contradictions:\n\n\\`\\`\\`\nkirograph_mem_conflicts_scan(limit: 20)\n\\`\\`\\`\n\nReturns candidate pairs ranked by similarity. Review each one.\n\n## 5. Compare two observations\n\nTo understand if two observations conflict, are compatible, or one supersedes the other:\n\n\\`\\`\\`\nkirograph_mem_compare(observationA: \"<id or topicKey>\", observationB: \"<id or topicKey>\")\n\\`\\`\\`\n\nReturns both observations side by side. Read them, then judge.\n\n## 6. Judge a relation\n\n\\`\\`\\`\nkirograph_mem_judge(\n relationId: \"<id>\",\n relation: \"supersedes\" | \"conflicts_with\" | \"compatible\" | \"scoped\" | \"related\" | \"not_conflict\",\n confidence: 0.0\u20131.0,\n reason: \"<why>\"\n)\n\\`\\`\\`\n\nUse \\`supersedes\\` when a newer decision replaces an older one. Use \\`not_conflict\\` to dismiss\nfalse positives so they don't reappear in scans.\n\n## 7. Review stale observations\n\nFind observations scheduled for re-evaluation:\n\n\\`\\`\\`\nkirograph_mem_review(limit: 20)\n\\`\\`\\`\n\nFor each: verify it's still accurate. If valid, mark it reviewed:\n\n\\`\\`\\`\nkirograph_mem_mark_reviewed(id: \"<observation-id>\")\n\\`\\`\\`\n\nIf outdated, store a new observation with the correct information and judge the old one as\nsuperseded via \\`kirograph_mem_judge\\`.\n\n## Quick reference\n\n| Situation | Action |\n|-----------|--------|\n| About to make a decision | \\`mem_search\\` first |\n| Made a decision | \\`mem_store\\` with \\`kind: \"decision\"\\` and \\`topicKey\\` |\n| Fixed a non-obvious bug | \\`mem_store\\` with \\`kind: \"error\"\\` |\n| Two things seem to contradict | \\`mem_compare\\` \u2192 \\`mem_judge\\` |\n| Knowledge base getting stale | \\`mem_review\\` \u2192 \\`mem_mark_reviewed\\` |\n| Structured notes to extract | \\`mem_capture\\` |\n| Regular conflict hygiene | \\`mem_conflicts_scan\\` |\n`);\n console.log(` \u2713 Memory workflow steering file written`);\n }\n\n // kirograph-git-context.md \u2014 only when enableGitContext is true\n if (enableGitContext) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-git-context.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Git Context Workflow\n\nUse this workflow for pre-commit reviews, PR descriptions, and understanding what changed.\n\n## 1. Before committing \u2014 understand what you changed\n\n\\`\\`\\`\nkirograph_diff_context() // unstaged \u2014 see what's touched\nkirograph_diff_context(staged: true) // staged \u2014 final check before commit\n\\`\\`\\`\n\nThis shows changed symbols, their callers (who might break), and their callees (what they call).\n\n## 2. Build commit message context\n\n\\`\\`\\`\nkirograph_commit_context()\n\\`\\`\\`\n\nReturns staged files, diff stat, and affected symbols. Feed into commit message generation.\n\n## 3. Check test coverage for changed symbols\n\n\\`\\`\\`\nkirograph_test_map() // all symbols with no test coverage\nkirograph_test_map(symbol: \"<changed fn>\") // tests for a specific symbol\n\\`\\`\\`\n\n## 4. PR description\n\n\\`\\`\\`\nkirograph_pr_context(base: \"main\", head: \"HEAD\")\n\\`\\`\\`\n\nReturns symbols added/removed/changed between refs. Use as structured context for PR summary.\n\n## 5. Coverage report (if lcov/Istanbul files exist)\n\n\\`\\`\\`\nkirograph_test_coverage() // worst-covered files first\nkirograph_test_coverage(sortBy: \"desc\") // best-covered files first\n\\`\\`\\`\n\n## Quick reference\n\n| Intent | Tool |\n|--------|------|\n| What did I change? | \\`kirograph_diff_context\\` |\n| Commit message | \\`kirograph_commit_context\\` |\n| PR description | \\`kirograph_pr_context\\` |\n| Are my changes tested? | \\`kirograph_test_map\\` |\n| Per-file coverage % | \\`kirograph_test_coverage\\` |\n| Semantic changelog | \\`kirograph_changelog\\` |\n`);\n console.log(` \u2713 Git context workflow steering file written`);\n }\n\n // kirograph-complexity.md \u2014 only when enableComplexity is true\n if (enableComplexity) {\n fs.writeFileSync(path.join(steeringDir, 'kirograph-complexity.md'), `---\ninclusion: manual\n---\n\n# KiroGraph: Code Quality Workflow\n\nUse this workflow to audit code quality, find high-risk functions, and track health over time.\n\n## 1. Get an overall health score\n\n\\`\\`\\`\nkirograph_health()\n\\`\\`\\`\n\nReturns a 0\u201310000 score across complexity, dead code, coupling, and circular dependencies.\nCheck all four components \u2014 a high total can mask one very low component.\n\n## 2. Find complex functions\n\n\\`\\`\\`\nkirograph_complexity(metric: \"cyclomatic\", threshold: 10)\nkirograph_complexity(metric: \"maintainability\") // lowest MI first \u2014 most unmaintainable\n\\`\\`\\`\n\n**Thresholds:** CC > 10 = review candidate. CC > 20 = refactor. MI < 50 = unmaintainable.\n\n## 3. Find highest-risk functions to change\n\n\\`\\`\\`\nkirograph_test_risk(limit: 20)\n\\`\\`\\`\n\nRisk = complexity \u00D7 fan-in. These functions will have the widest blast radius if they break.\n\n## 4. Check architectural coupling\n\n\\`\\`\\`\nkirograph_dsm()\n\\`\\`\\`\n\nHigh off-diagonal counts = tight coupling. Aim for low counts outside the diagonal.\n\n## 5. Scan for simplification candidates\n\n\\`\\`\\`\nkirograph_simplify_scan()\n\\`\\`\\`\n\nLists functions that fail on CC, MI, or LOC thresholds.\n\n## Quick reference\n\n| Intent | Tool |\n|--------|------|\n| Overall health | \\`kirograph_health\\` |\n| Most complex functions | \\`kirograph_complexity\\` |\n| Highest-risk to change | \\`kirograph_test_risk\\` |\n| Module coupling matrix | \\`kirograph_dsm\\` |\n| Simplification candidates | \\`kirograph_simplify_scan\\` |\n`);\n console.log(` \u2713 Complexity workflow steering file written`);\n }\n\n const written: string[] = [];\n if (hasRichFeatures) written.push('review', 'debug', 'onboard', 'refactor');\n if (opts?.enableArchitecture) written.push('architecture');\n if (opts?.enableSecurity) written.push('security');\n if (opts?.enablePatterns) written.push('patterns');\n if (enableGitContext) written.push('git-context');\n if (enableComplexity) written.push('complexity');\n if (opts?.enableMemory) written.push('memory');\n if (opts?.enableWiki) written.push('wiki');\n if (written.length > 0) {\n console.log(` \u2713 Workflow steering files written (${written.join(', ')})`);\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,SAAoB;AACpB,WAAsB;AACtB,qBAA2C;AAK3C,MAAM,qBAA6C;AAAA,EACjD,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,OAAO;AACT;AAEA,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMR,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMZ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAMT;AAEA,SAAS,wBAAwB,OAAkD;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAoBc,KAAK,OAAO,mBAAmB,KAAK,CAAC;AAAA;AAAA,EAE1D,eAAe,KAAK,CAAC;AAA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M,mBAAoB,SAAQ,KAAK,cAAc;AACzD,MAAI,MAAM,eAAgB,SAAQ,KAAK,UAAU;AACjD,MAAI,MAAM,eAAgB,SAAQ,KAAK,UAAU;AACjD,MAAI,iBAAkB,SAAQ,KAAK,aAAa;AAChD,MAAI,iBAAkB,SAAQ,KAAK,YAAY;AAC/C,MAAI,MAAM,aAAc,SAAQ,KAAK,QAAQ;AAC7C,MAAI,MAAM,WAAY,SAAQ,KAAK,MAAM;AACzC,MAAI,QAAQ,SAAS,GAAG;AACtB,YAAQ,IAAI,6CAAwC,QAAQ,KAAK,IAAI,CAAC,GAAG;AAAA,EAC3E;AACF;",
6
6
  "names": []
7
7
  }
@@ -42,13 +42,13 @@ var import_common2 = require("../common");
42
42
  const AIDER_BLOCK_ID = "aider";
43
43
  function installAiderEarly(_projectRoot) {
44
44
  }
45
- function installAiderLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns) {
45
+ function installAiderLate(projectRoot, opts) {
46
46
  const instructionsPath = path.join(projectRoot, ".kirograph", "aider.md");
47
47
  (0, import_common.ensureDir)(path.dirname(instructionsPath));
48
- fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
48
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
49
49
  console.log(` \u2713 Aider instructions written to ${instructionsPath}`);
50
50
  const conventionsPath = path.join(projectRoot, "CONVENTIONS.md");
51
- const changed = (0, import_common.upsertGeneratedBlock)(conventionsPath, AIDER_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
51
+ const changed = (0, import_common.upsertGeneratedBlock)(conventionsPath, AIDER_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
52
52
  console.log(changed ? ` \u2713 CONVENTIONS.md updated with KiroGraph instructions` : ` \u2713 CONVENTIONS.md already up to date`);
53
53
  }
54
54
  function uninitAider(projectRoot) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/bin/installer/targets/aider.ts"],
4
- "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n printMcpCommand,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst AIDER_BLOCK_ID = 'aider';\n\nexport function installAiderEarly(_projectRoot: string): void {\n // Aider MCP is configured via CLI flags (--mcp) or .aider.conf.yml.\n // We print the setup command in next steps instead of writing outside the project.\n}\n\nexport function installAiderLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean, enableDocs?: boolean, enableData?: boolean, enableSecurity?: boolean, enableArchitecture?: boolean, enablePatterns?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'aider.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(` \u2713 Aider instructions written to ${instructionsPath}`);\n\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n const changed = upsertGeneratedBlock(conventionsPath, AIDER_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(changed\n ? ` \u2713 CONVENTIONS.md updated with KiroGraph instructions`\n : ` \u2713 CONVENTIONS.md already up to date`);\n}\n\nexport function uninitAider(projectRoot: string): void {\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n if (removeGeneratedBlock(conventionsPath, AIDER_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from CONVENTIONS.md`);\n }\n}\n\nexport function printAiderNextSteps(projectRoot: string): void {\n const escapedPath = projectRoot.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n console.log('\\n Done! KiroGraph instructions are in CONVENTIONS.md.');\n printMcpCommand(`aider --mcp \"kirograph serve --mcp --path ${escapedPath}\"`);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAKO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAErC,MAAM,iBAAiB;AAEhB,SAAS,kBAAkB,cAA4B;AAG9D;AAEO,SAAS,iBAAiB,aAAqB,aAAmC,uBAAgC,cAAwB,YAAsB,YAAsB,gBAA0B,oBAA8B,gBAAgC;AACnR,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,UAAU;AACxE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,cAAc,QAAW,YAAY,YAAY,gBAAgB,oBAAoB,cAAc,CAAC,CAAC;AACxN,UAAQ,IAAI,0CAAqC,gBAAgB,EAAE;AAEnE,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,QAAM,cAAU,oCAAqB,iBAAiB,gBAAgB,oBAAgB,gDAAuB,qCAAqB,aAAa,uBAAuB,cAAc,QAAW,YAAY,YAAY,gBAAgB,oBAAoB,cAAc,CAAC,CAAC;AAC3Q,UAAQ,IAAI,UACR,gEACA,4CAAuC;AAC7C;AAEO,SAAS,YAAY,aAA2B;AACrD,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,UAAI,oCAAqB,iBAAiB,cAAc,GAAG;AACzD,YAAQ,IAAI,sDAAiD;AAAA,EAC/D;AACF;AAEO,SAAS,oBAAoB,aAA2B;AAC7D,QAAM,cAAc,YAAY,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK;AAC1E,UAAQ,IAAI,yDAAyD;AACrE,qCAAgB,6CAA6C,WAAW,GAAG;AAC7E;",
4
+ "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n printMcpCommand,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n LateInstallOptions,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst AIDER_BLOCK_ID = 'aider';\n\nexport function installAiderEarly(_projectRoot: string): void {\n // Aider MCP is configured via CLI flags (--mcp) or .aider.conf.yml.\n // We print the setup command in next steps instead of writing outside the project.\n}\n\nexport function installAiderLate(projectRoot: string, opts: LateInstallOptions): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'aider.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(` \u2713 Aider instructions written to ${instructionsPath}`);\n\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n const changed = upsertGeneratedBlock(conventionsPath, AIDER_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(changed\n ? ` \u2713 CONVENTIONS.md updated with KiroGraph instructions`\n : ` \u2713 CONVENTIONS.md already up to date`);\n}\n\nexport function uninitAider(projectRoot: string): void {\n const conventionsPath = path.join(projectRoot, 'CONVENTIONS.md');\n if (removeGeneratedBlock(conventionsPath, AIDER_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from CONVENTIONS.md`);\n }\n}\n\nexport function printAiderNextSteps(projectRoot: string): void {\n const escapedPath = projectRoot.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n console.log('\\n Done! KiroGraph instructions are in CONVENTIONS.md.');\n printMcpCommand(`aider --mcp \"kirograph serve --mcp --path ${escapedPath}\"`);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAMO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAErC,MAAM,iBAAiB;AAEhB,SAAS,kBAAkB,cAA4B;AAG9D;AAEO,SAAS,iBAAiB,aAAqB,MAAgC;AACpF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,UAAU;AACxE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAC5F,UAAQ,IAAI,0CAAqC,gBAAgB,EAAE;AAEnE,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,QAAM,cAAU,oCAAqB,iBAAiB,gBAAgB,oBAAgB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAC/I,UAAQ,IAAI,UACR,gEACA,4CAAuC;AAC7C;AAEO,SAAS,YAAY,aAA2B;AACrD,QAAM,kBAAkB,KAAK,KAAK,aAAa,gBAAgB;AAC/D,UAAI,oCAAqB,iBAAiB,cAAc,GAAG;AACzD,YAAQ,IAAI,sDAAiD;AAAA,EAC/D;AACF;AAEO,SAAS,oBAAoB,aAA2B;AAC7D,QAAM,cAAc,YAAY,QAAQ,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAK;AAC1E,UAAQ,IAAI,yDAAyD;AACrE,qCAAgB,6CAA6C,WAAW,GAAG;AAC7E;",
6
6
  "names": ["import_common"]
7
7
  }
@@ -51,14 +51,14 @@ function installAmpEarly(projectRoot) {
51
51
  (0, import_common.writeJson)(configPath, config);
52
52
  console.log(` \u2713 Sourcegraph Amp MCP server registered in ${configPath}`);
53
53
  }
54
- function installAmpLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns) {
54
+ function installAmpLate(projectRoot, opts) {
55
55
  const instructionsPath = path.join(projectRoot, ".kirograph", "amp.md");
56
56
  (0, import_common.ensureDir)(path.dirname(instructionsPath));
57
- fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
57
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
58
58
  console.log(` \u2713 Amp instructions written to ${instructionsPath}`);
59
59
  const ampInstructionsPath = path.join(projectRoot, ".amp", "instructions.md");
60
60
  (0, import_common.ensureDir)(path.dirname(ampInstructionsPath));
61
- fs.writeFileSync(ampInstructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
61
+ fs.writeFileSync(ampInstructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
62
62
  console.log(` \u2713 Amp instructions written to ${ampInstructionsPath}`);
63
63
  }
64
64
  function uninitAmp(projectRoot) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/bin/installer/targets/amp.ts"],
4
- "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n readJson,\n writeJson,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nexport function installAmpEarly(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', 'config.json');\n ensureDir(path.dirname(configPath));\n const config = readJson(configPath);\n config.mcpServers = config.mcpServers ?? {};\n config.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(configPath, config);\n console.log(` \u2713 Sourcegraph Amp MCP server registered in ${configPath}`);\n}\n\nexport function installAmpLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean, enableDocs?: boolean, enableData?: boolean, enableSecurity?: boolean, enableArchitecture?: boolean, enablePatterns?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'amp.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(` \u2713 Amp instructions written to ${instructionsPath}`);\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n ensureDir(path.dirname(ampInstructionsPath));\n fs.writeFileSync(ampInstructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(` \u2713 Amp instructions written to ${ampInstructionsPath}`);\n}\n\nexport function uninitAmp(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', 'config.json');\n if (fs.existsSync(configPath)) {\n const config = readJson(configPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n writeJson(configPath, config);\n console.log(` \u2713 Removed kirograph from .amp/config.json`);\n }\n }\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n if (fs.existsSync(ampInstructionsPath)) {\n fs.unlinkSync(ampInstructionsPath);\n console.log(` \u2713 Removed .amp/instructions.md`);\n }\n}\n\nexport function printAmpNextSteps(): void {\n console.log('\\n Done! Restart Sourcegraph Amp for the MCP server to load.');\n console.log(' KiroGraph instructions are in .amp/instructions.md\\n');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AAEtB,oBAOO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAE9B,SAAS,gBAAgB,aAA2B;AACzD,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ,aAAa;AAC/D,+BAAU,KAAK,QAAQ,UAAU,CAAC;AAClC,QAAM,aAAS,wBAAS,UAAU;AAClC,SAAO,aAAa,OAAO,cAAc,CAAC;AAC1C,SAAO,WAAW,mCAAqB,IAAI;AAAA,IACzC,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,qDAAgD,UAAU,EAAE;AAC1E;AAEO,SAAS,eAAe,aAAqB,aAAmC,uBAAgC,cAAwB,YAAsB,YAAsB,gBAA0B,oBAA8B,gBAAgC;AACjR,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,QAAQ;AACtE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,aAAa,uBAAuB,cAAc,QAAW,YAAY,YAAY,gBAAgB,oBAAoB,cAAc,CAAC,CAAC;AACxN,UAAQ,IAAI,wCAAmC,gBAAgB,EAAE;AAEjE,QAAM,sBAAsB,KAAK,KAAK,aAAa,QAAQ,iBAAiB;AAC5E,+BAAU,KAAK,QAAQ,mBAAmB,CAAC;AAC3C,KAAG,cAAc,yBAAqB,gDAAuB,qCAAqB,aAAa,uBAAuB,cAAc,QAAW,YAAY,YAAY,gBAAgB,oBAAoB,cAAc,CAAC,CAAC;AAC3N,UAAQ,IAAI,wCAAmC,mBAAmB,EAAE;AACtE;AAEO,SAAS,UAAU,aAA2B;AACnD,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ,aAAa;AAC/D,MAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,UAAM,aAAS,wBAAS,UAAU;AAClC,QAAI,OAAO,aAAa,mCAAqB,GAAG;AAC9C,aAAO,OAAO,WAAW,mCAAqB;AAC9C,mCAAU,YAAY,MAAM;AAC5B,cAAQ,IAAI,kDAA6C;AAAA,IAC3D;AAAA,EACF;AAEA,QAAM,sBAAsB,KAAK,KAAK,aAAa,QAAQ,iBAAiB;AAC5E,MAAI,GAAG,WAAW,mBAAmB,GAAG;AACtC,OAAG,WAAW,mBAAmB;AACjC,YAAQ,IAAI,uCAAkC;AAAA,EAChD;AACF;AAEO,SAAS,oBAA0B;AACxC,UAAQ,IAAI,+DAA+D;AAC3E,UAAQ,IAAI,wDAAwD;AACtE;",
4
+ "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport {\n ensureDir,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n LateInstallOptions,\n readJson,\n writeJson,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nexport function installAmpEarly(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', 'config.json');\n ensureDir(path.dirname(configPath));\n const config = readJson(configPath);\n config.mcpServers = config.mcpServers ?? {};\n config.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(configPath, config);\n console.log(` \u2713 Sourcegraph Amp MCP server registered in ${configPath}`);\n}\n\nexport function installAmpLate(projectRoot: string, opts: LateInstallOptions): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'amp.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(` \u2713 Amp instructions written to ${instructionsPath}`);\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n ensureDir(path.dirname(ampInstructionsPath));\n fs.writeFileSync(ampInstructionsPath, buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(` \u2713 Amp instructions written to ${ampInstructionsPath}`);\n}\n\nexport function uninitAmp(projectRoot: string): void {\n const configPath = path.join(projectRoot, '.amp', 'config.json');\n if (fs.existsSync(configPath)) {\n const config = readJson(configPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n writeJson(configPath, config);\n console.log(` \u2713 Removed kirograph from .amp/config.json`);\n }\n }\n\n const ampInstructionsPath = path.join(projectRoot, '.amp', 'instructions.md');\n if (fs.existsSync(ampInstructionsPath)) {\n fs.unlinkSync(ampInstructionsPath);\n console.log(` \u2713 Removed .amp/instructions.md`);\n }\n}\n\nexport function printAmpNextSteps(): void {\n console.log('\\n Done! Restart Sourcegraph Amp for the MCP server to load.');\n console.log(' KiroGraph instructions are in .amp/instructions.md\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,oBAQO;AACP,0BAAuC;AACvC,IAAAA,iBAAqC;AAE9B,SAAS,gBAAgB,aAA2B;AACzD,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ,aAAa;AAC/D,+BAAU,KAAK,QAAQ,UAAU,CAAC;AAClC,QAAM,aAAS,wBAAS,UAAU;AAClC,SAAO,aAAa,OAAO,cAAc,CAAC;AAC1C,SAAO,WAAW,mCAAqB,IAAI;AAAA,IACzC,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,+BAAU,YAAY,MAAM;AAC5B,UAAQ,IAAI,qDAAgD,UAAU,EAAE;AAC1E;AAEO,SAAS,eAAe,aAAqB,MAAgC;AAClF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,QAAQ;AACtE,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAC5F,UAAQ,IAAI,wCAAmC,gBAAgB,EAAE;AAEjE,QAAM,sBAAsB,KAAK,KAAK,aAAa,QAAQ,iBAAiB;AAC5E,+BAAU,KAAK,QAAQ,mBAAmB,CAAC;AAC3C,KAAG,cAAc,yBAAqB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAC/F,UAAQ,IAAI,wCAAmC,mBAAmB,EAAE;AACtE;AAEO,SAAS,UAAU,aAA2B;AACnD,QAAM,aAAa,KAAK,KAAK,aAAa,QAAQ,aAAa;AAC/D,MAAI,GAAG,WAAW,UAAU,GAAG;AAC7B,UAAM,aAAS,wBAAS,UAAU;AAClC,QAAI,OAAO,aAAa,mCAAqB,GAAG;AAC9C,aAAO,OAAO,WAAW,mCAAqB;AAC9C,mCAAU,YAAY,MAAM;AAC5B,cAAQ,IAAI,kDAA6C;AAAA,IAC3D;AAAA,EACF;AAEA,QAAM,sBAAsB,KAAK,KAAK,aAAa,QAAQ,iBAAiB;AAC5E,MAAI,GAAG,WAAW,mBAAmB,GAAG;AACtC,OAAG,WAAW,mBAAmB;AACjC,YAAQ,IAAI,uCAAkC;AAAA,EAChD;AACF;AAEO,SAAS,oBAA0B;AACxC,UAAQ,IAAI,+DAA+D;AAC3E,UAAQ,IAAI,wDAAwD;AACtE;",
6
6
  "names": ["import_common"]
7
7
  }
@@ -73,14 +73,14 @@ function installAntigravityEarly(_projectRoot) {
73
73
  (0, import_common.writeJson)(mcpPath, existing);
74
74
  console.log(` \u2713 Antigravity MCP server registered in ${mcpPath}`);
75
75
  }
76
- function installAntigravityLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns) {
77
- const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, true, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns);
76
+ function installAntigravityLate(projectRoot, opts) {
77
+ const instructionOpts = (0, import_common.buildInstructionOpts)(opts, true);
78
78
  const instructionsPath = path.join(projectRoot, ".kirograph", "antigravity.md");
79
79
  (0, import_common.ensureDir)(path.dirname(instructionsPath));
80
- fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
80
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(instructionOpts));
81
81
  console.log(` \u2713 Antigravity instructions written to ${instructionsPath}`);
82
82
  const geminiPath = path.join(projectRoot, "GEMINI.md");
83
- const changed = (0, import_common.upsertGeneratedBlock)(geminiPath, ANTIGRAVITY_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)(opts));
83
+ const changed = (0, import_common.upsertGeneratedBlock)(geminiPath, ANTIGRAVITY_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)(instructionOpts));
84
84
  console.log(changed ? ` \u2713 GEMINI.md updated with KiroGraph instructions` : ` \u2713 GEMINI.md already up to date`);
85
85
  const hooksPath = path.join(projectRoot, ".agents", "hooks.json");
86
86
  (0, import_common.ensureDir)(path.dirname(hooksPath));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/bin/installer/targets/antigravity.ts"],
4
- "sourcesContent": ["/**\n * Antigravity IDE target.\n *\n * MCP: user-scoped at ~/.gemini/antigravity/mcp_config.json (print instructions)\n * Hooks: .agents/hooks.json (workspace-level)\n * Instructions: GEMINI.md (upsert block)\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n buildInstructionOpts,\n readJson,\n writeJson,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst ANTIGRAVITY_BLOCK_ID = 'antigravity';\n\nfunction buildAntigravityHooks(): object {\n return {\n 'kirograph-sync': {\n Stop: [\n {\n hooks: [\n {\n type: 'command',\n command: 'kirograph sync --quiet 2>/dev/null || true',\n timeout: 30,\n },\n ],\n },\n ],\n },\n };\n}\n\nexport function installAntigravityEarly(_projectRoot: string): void {\n // Write MCP config to user-scoped ~/.gemini/antigravity/mcp_config.json\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n ensureDir(path.dirname(mcpPath));\n const existing = readJson(mcpPath);\n existing.mcpServers = existing.mcpServers ?? {};\n if (existing.mcpServers[KIROGRAPH_SERVER_NAME]) {\n console.log(` \u2713 Antigravity MCP already configured in ${mcpPath}`);\n return;\n }\n existing.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(mcpPath, existing);\n console.log(` \u2713 Antigravity MCP server registered in ${mcpPath}`);\n}\n\nexport function installAntigravityLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean, enableDocs?: boolean, enableData?: boolean, enableSecurity?: boolean, enableArchitecture?: boolean, enablePatterns?: boolean): void {\n const opts = buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, true, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns);\n\n const instructionsPath = path.join(projectRoot, '.kirograph', 'antigravity.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(opts));\n console.log(` \u2713 Antigravity instructions written to ${instructionsPath}`);\n\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n const changed = upsertGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID, '## KiroGraph', buildAgentInstructions(opts));\n console.log(changed\n ? ` \u2713 GEMINI.md updated with KiroGraph instructions`\n : ` \u2713 GEMINI.md already up to date`);\n\n // Write hooks to .agents/hooks.json\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n ensureDir(path.dirname(hooksPath));\n const existing = readJson(hooksPath);\n const kgHooks = buildAntigravityHooks() as any;\n // Merge without overwriting existing hooks\n for (const [name, config] of Object.entries(kgHooks)) {\n if (!existing[name]) {\n existing[name] = config;\n }\n }\n writeJson(hooksPath, existing);\n console.log(` \u2713 Antigravity hooks written to ${hooksPath}`);\n}\n\nexport function uninitAntigravity(projectRoot: string): void {\n // Remove user-scoped MCP config\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n if (fs.existsSync(mcpPath)) {\n const config = readJson(mcpPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n if (Object.keys(config.mcpServers).length === 0) delete config.mcpServers;\n writeJson(mcpPath, config);\n console.log(` \u2713 Removed kirograph from ${mcpPath}`);\n }\n }\n\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n if (removeGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from GEMINI.md`);\n }\n\n // Remove hooks\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n if (fs.existsSync(hooksPath)) {\n const config = readJson(hooksPath);\n if (config['kirograph-sync']) {\n delete config['kirograph-sync'];\n writeJson(hooksPath, config);\n console.log(` \u2713 Removed kirograph-sync from .agents/hooks.json`);\n }\n }\n}\n\nexport function printAntigravityNextSteps(_projectRoot: string): void {\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n console.log('\\n Done! Restart Antigravity for the MCP server to load.');\n console.log(` MCP registered in ${mcpPath}`);\n console.log(' KiroGraph instructions are in GEMINI.md');\n console.log(' Auto-sync hook installed in .agents/hooks.json\\n');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAUO;AACP,0BAAuC;AAEvC,MAAM,uBAAuB;AAE7B,SAAS,wBAAgC;AACvC,SAAO;AAAA,IACL,kBAAkB;AAAA,MAChB,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,YACL;AAAA,cACE,MAAM;AAAA,cACN,SAAS;AAAA,cACT,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,wBAAwB,cAA4B;AAElE,QAAM,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,eAAe;AAC5D,QAAM,UAAU,KAAK,KAAK,MAAM,WAAW,eAAe,iBAAiB;AAC3E,+BAAU,KAAK,QAAQ,OAAO,CAAC;AAC/B,QAAM,eAAW,wBAAS,OAAO;AACjC,WAAS,aAAa,SAAS,cAAc,CAAC;AAC9C,MAAI,SAAS,WAAW,mCAAqB,GAAG;AAC9C,YAAQ,IAAI,kDAA6C,OAAO,EAAE;AAClE;AAAA,EACF;AACA,WAAS,WAAW,mCAAqB,IAAI;AAAA,IAC3C,SAAS;AAAA,IACT,MAAM;AAAA,EACR;AACA,+BAAU,SAAS,QAAQ;AAC3B,UAAQ,IAAI,iDAA4C,OAAO,EAAE;AACnE;AAEO,SAAS,uBAAuB,aAAqB,aAAmC,uBAAgC,cAAwB,YAAsB,YAAsB,gBAA0B,oBAA8B,gBAAgC;AACzR,QAAM,WAAO,oCAAqB,aAAa,uBAAuB,cAAc,MAAM,YAAY,YAAY,gBAAgB,oBAAoB,cAAc;AAEpK,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,gBAAgB;AAC9E,+BAAU,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,aAAa,WAAW,YAAY;AAChE,MAAI,GAAG,WAAW,SAAS,GAAG;AAC5B,UAAM,aAAS,wBAAS,SAAS;AACjC,QAAI,OAAO,gBAAgB,GAAG;AAC5B,aAAO,OAAO,gBAAgB;AAC9B,mCAAU,WAAW,MAAM;AAC3B,cAAQ,IAAI,yDAAoD;AAAA,IAClE;AAAA,EACF;AACF;AAEO,SAAS,0BAA0B,cAA4B;AACpE,QAAM,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,eAAe;AAC5D,QAAM,UAAU,KAAK,KAAK,MAAM,WAAW,eAAe,iBAAiB;AAC3E,UAAQ,IAAI,2DAA2D;AACvE,UAAQ,IAAI,uBAAuB,OAAO,EAAE;AAC5C,UAAQ,IAAI,2CAA2C;AACvD,UAAQ,IAAI,oDAAoD;AAClE;",
4
+ "sourcesContent": ["/**\n * Antigravity IDE target.\n *\n * MCP: user-scoped at ~/.gemini/antigravity/mcp_config.json (print instructions)\n * Hooks: .agents/hooks.json (workspace-level)\n * Instructions: GEMINI.md (upsert block)\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n buildInstructionOpts,\n readJson,\n writeJson,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n KIROGRAPH_SERVER_NAME,\n LateInstallOptions,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\n\nconst ANTIGRAVITY_BLOCK_ID = 'antigravity';\n\nfunction buildAntigravityHooks(): object {\n return {\n 'kirograph-sync': {\n Stop: [\n {\n hooks: [\n {\n type: 'command',\n command: 'kirograph sync --quiet 2>/dev/null || true',\n timeout: 30,\n },\n ],\n },\n ],\n },\n };\n}\n\nexport function installAntigravityEarly(_projectRoot: string): void {\n // Write MCP config to user-scoped ~/.gemini/antigravity/mcp_config.json\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n ensureDir(path.dirname(mcpPath));\n const existing = readJson(mcpPath);\n existing.mcpServers = existing.mcpServers ?? {};\n if (existing.mcpServers[KIROGRAPH_SERVER_NAME]) {\n console.log(` \u2713 Antigravity MCP already configured in ${mcpPath}`);\n return;\n }\n existing.mcpServers[KIROGRAPH_SERVER_NAME] = {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n };\n writeJson(mcpPath, existing);\n console.log(` \u2713 Antigravity MCP server registered in ${mcpPath}`);\n}\n\nexport function installAntigravityLate(projectRoot: string, opts: LateInstallOptions): void {\n const instructionOpts = buildInstructionOpts(opts, true);\n\n const instructionsPath = path.join(projectRoot, '.kirograph', 'antigravity.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(instructionOpts));\n console.log(` \u2713 Antigravity instructions written to ${instructionsPath}`);\n\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n const changed = upsertGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID, '## KiroGraph', buildAgentInstructions(instructionOpts));\n console.log(changed\n ? ` \u2713 GEMINI.md updated with KiroGraph instructions`\n : ` \u2713 GEMINI.md already up to date`);\n\n // Write hooks to .agents/hooks.json\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n ensureDir(path.dirname(hooksPath));\n const existing = readJson(hooksPath);\n const kgHooks = buildAntigravityHooks() as any;\n // Merge without overwriting existing hooks\n for (const [name, config] of Object.entries(kgHooks)) {\n if (!existing[name]) {\n existing[name] = config;\n }\n }\n writeJson(hooksPath, existing);\n console.log(` \u2713 Antigravity hooks written to ${hooksPath}`);\n}\n\nexport function uninitAntigravity(projectRoot: string): void {\n // Remove user-scoped MCP config\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n if (fs.existsSync(mcpPath)) {\n const config = readJson(mcpPath);\n if (config.mcpServers?.[KIROGRAPH_SERVER_NAME]) {\n delete config.mcpServers[KIROGRAPH_SERVER_NAME];\n if (Object.keys(config.mcpServers).length === 0) delete config.mcpServers;\n writeJson(mcpPath, config);\n console.log(` \u2713 Removed kirograph from ${mcpPath}`);\n }\n }\n\n const geminiPath = path.join(projectRoot, 'GEMINI.md');\n if (removeGeneratedBlock(geminiPath, ANTIGRAVITY_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from GEMINI.md`);\n }\n\n // Remove hooks\n const hooksPath = path.join(projectRoot, '.agents', 'hooks.json');\n if (fs.existsSync(hooksPath)) {\n const config = readJson(hooksPath);\n if (config['kirograph-sync']) {\n delete config['kirograph-sync'];\n writeJson(hooksPath, config);\n console.log(` \u2713 Removed kirograph-sync from .agents/hooks.json`);\n }\n }\n}\n\nexport function printAntigravityNextSteps(_projectRoot: string): void {\n const home = process.env.HOME || process.env.USERPROFILE || '';\n const mcpPath = path.join(home, '.gemini', 'antigravity', 'mcp_config.json');\n console.log('\\n Done! Restart Antigravity for the MCP server to load.');\n console.log(` MCP registered in ${mcpPath}`);\n console.log(' KiroGraph instructions are in GEMINI.md');\n console.log(' Auto-sync hook installed in .agents/hooks.json\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,SAAoB;AACpB,WAAsB;AAEtB,oBAWO;AACP,0BAAuC;AAEvC,MAAM,uBAAuB;AAE7B,SAAS,wBAAgC;AACvC,SAAO;AAAA,IACL,kBAAkB;AAAA,MAChB,MAAM;AAAA,QACJ;AAAA,UACE,OAAO;AAAA,YACL;AAAA,cACE,MAAM;AAAA,cACN,SAAS;AAAA,cACT,SAAS;AAAA,YACX;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,wBAAwB,cAA4B;AAElE,QAAM,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,eAAe;AAC5D,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O,QAAQ,IAAI,QAAQ,QAAQ,IAAI,eAAe;AAC5D,QAAM,UAAU,KAAK,KAAK,MAAM,WAAW,eAAe,iBAAiB;AAC3E,MAAI,GAAG,WAAW,OAAO,GAAG;AAC1B,UAAM,aAAS,wBAAS,OAAO;AAC/B,QAAI,OAAO,aAAa,mCAAqB,GAAG;AAC9C,aAAO,OAAO,WAAW,mCAAqB;AAC9C,UAAI,OAAO,KAAK,OAAO,UAAU,EAAE,WAAW,EAAG,QAAO,OAAO;AAC/D,mCAAU,SAAS,MAAM;AACzB,cAAQ,IAAI,mCAA8B,OAAO,EAAE;AAAA,IACrD;AAAA,EACF;AAEA,QAAM,aAAa,KAAK,KAAK,aAAa,WAAW;AACrD,UAAI,oCAAqB,YAAY,oBAAoB,GAAG;AAC1D,YAAQ,IAAI,iDAA4C;AAAA,EAC1D;AAGA,QAAM,YAAY,KAAK,KAAK,aAAa,WAAW,YAAY;AAChE,MAAI,GAAG,WAAW,SAAS,GAAG;AAC5B,UAAM,aAAS,wBAAS,SAAS;AACjC,QAAI,OAAO,gBAAgB,GAAG;AAC5B,aAAO,OAAO,gBAAgB;AAC9B,mCAAU,WAAW,MAAM;AAC3B,cAAQ,IAAI,yDAAoD;AAAA,IAClE;AAAA,EACF;AACF;AAEO,SAAS,0BAA0B,cAA4B;AACpE,QAAM,OAAO,QAAQ,IAAI,QAAQ,QAAQ,IAAI,eAAe;AAC5D,QAAM,UAAU,KAAK,KAAK,MAAM,WAAW,eAAe,iBAAiB;AAC3E,UAAQ,IAAI,2DAA2D;AACvE,UAAQ,IAAI,uBAAuB,OAAO,EAAE;AAC5C,UAAQ,IAAI,2CAA2C;AACvD,UAAQ,IAAI,oDAAoD;AAClE;",
6
6
  "names": []
7
7
  }
@@ -48,13 +48,13 @@ function installAugmentEarly(projectRoot) {
48
48
  });
49
49
  console.log(` \u2713 Augment Code MCP server registered in ${mcpPath}`);
50
50
  }
51
- function installAugmentLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns) {
51
+ function installAugmentLate(projectRoot, opts) {
52
52
  const instructionsPath = path.join(projectRoot, ".kirograph", "augment.md");
53
53
  (0, import_common.ensureDir)(path.dirname(instructionsPath));
54
- fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
54
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
55
55
  console.log(` \u2713 Augment instructions written to ${instructionsPath}`);
56
56
  const guidelinesPath = path.join(projectRoot, "augment-guidelines.md");
57
- const changed = (0, import_common.upsertGeneratedBlock)(guidelinesPath, AUGMENT_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, void 0, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));
57
+ const changed = (0, import_common.upsertGeneratedBlock)(guidelinesPath, AUGMENT_BLOCK_ID, "## KiroGraph", (0, import_instructions.buildAgentInstructions)((0, import_common2.buildInstructionOpts)(opts, false)));
58
58
  console.log(changed ? ` \u2713 augment-guidelines.md updated with KiroGraph instructions` : ` \u2713 augment-guidelines.md already up to date`);
59
59
  }
60
60
  function uninitAugment(projectRoot) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/bin/installer/targets/augment.ts"],
4
- "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport { CavemanMode } from '../caveman';\nimport {\n ensureDir,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n removeMcpServersConfig,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n writeMcpServersConfig,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts } from '../common';\n\nconst AUGMENT_BLOCK_ID = 'augment';\n\nexport function installAugmentEarly(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n writeMcpServersConfig(mcpPath, {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n });\n console.log(` \u2713 Augment Code MCP server registered in ${mcpPath}`);\n}\n\nexport function installAugmentLate(projectRoot: string, cavemanMode?: CavemanMode | 'off', shellCompressionLevel?: string, enableMemory?: boolean, enableDocs?: boolean, enableData?: boolean, enableSecurity?: boolean, enableArchitecture?: boolean, enablePatterns?: boolean): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'augment.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(` \u2713 Augment instructions written to ${instructionsPath}`);\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n const changed = upsertGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(cavemanMode, shellCompressionLevel, enableMemory, undefined, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns)));\n console.log(changed\n ? ` \u2713 augment-guidelines.md updated with KiroGraph instructions`\n : ` \u2713 augment-guidelines.md already up to date`);\n}\n\nexport function uninitAugment(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` \u2713 Removed kirograph from .augment/mcp.json`);\n }\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n if (removeGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from augment-guidelines.md`);\n }\n}\n\nexport function printAugmentNextSteps(): void {\n console.log('\\n Done! Restart Augment Code for the MCP server to load.');\n console.log(' KiroGraph instruct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C1D,YAAQ,IAAI,6DAAwD;AAAA,EACtE;AACF;AAEO,SAAS,wBAA8B;AAC5C,UAAQ,IAAI,4DAA4D;AACxE,UAAQ,IAAI,yDAAyD;AACvE;",
4
+ "sourcesContent": ["import * as fs from 'fs';\nimport * as path from 'path';\nimport {\n ensureDir,\n KIROGRAPH_COMMAND,\n KIROGRAPH_MCP_ARGS,\n removeMcpServersConfig,\n upsertGeneratedBlock,\n removeGeneratedBlock,\n writeMcpServersConfig,\n} from '../common';\nimport { buildAgentInstructions } from '../instructions';\nimport { buildInstructionOpts, LateInstallOptions } from '../common';\n\nconst AUGMENT_BLOCK_ID = 'augment';\n\nexport function installAugmentEarly(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n writeMcpServersConfig(mcpPath, {\n command: KIROGRAPH_COMMAND,\n args: KIROGRAPH_MCP_ARGS,\n });\n console.log(` \u2713 Augment Code MCP server registered in ${mcpPath}`);\n}\n\nexport function installAugmentLate(projectRoot: string, opts: LateInstallOptions): void {\n const instructionsPath = path.join(projectRoot, '.kirograph', 'augment.md');\n ensureDir(path.dirname(instructionsPath));\n fs.writeFileSync(instructionsPath, buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(` \u2713 Augment instructions written to ${instructionsPath}`);\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n const changed = upsertGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID, '## KiroGraph', buildAgentInstructions(buildInstructionOpts(opts, false)));\n console.log(changed\n ? ` \u2713 augment-guidelines.md updated with KiroGraph instructions`\n : ` \u2713 augment-guidelines.md already up to date`);\n}\n\nexport function uninitAugment(projectRoot: string): void {\n const mcpPath = path.join(projectRoot, '.augment', 'mcp.json');\n if (removeMcpServersConfig(mcpPath)) {\n console.log(` \u2713 Removed kirograph from .augment/mcp.json`);\n }\n\n const guidelinesPath = path.join(projectRoot, 'augment-guidelines.md');\n if (removeGeneratedBlock(guidelinesPath, AUGMENT_BLOCK_ID)) {\n console.log(` \u2713 Removed KiroGraph block from augment-guidelines.md`);\n }\n}\n\nexport function printAugmentNextSteps(): void {\n console.log('\\n Done! Restart Augment Code for the MCP server to load.');\n console.log(' KiroGraph instructions are in augment-guidelines.md\\n');\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAoB;AACpB,WAAsB;AACtB,oBAQO;AACP,0BAAuC;AACvC,IAAAA,iBAAyD;AAEzD,MAAM,mBAAmB;AAElB,SAAS,oBAAoB,aAA2B;AAC7D,QAAM,UAAU,KAAK,KAAK,aAAa,YAAY,UAAU;AAC7D,2CAAsB,SAAS;AAAA,IAC7B,SAAS;AAAA,IACT,MAAM;AAAA,EACR,CAAC;AACD,UAAQ,IAAI,kDAA6C,OAAO,EAAE;AACpE;AAEO,SAAS,mBAAmB,aAAqB,MAAgC;AACtF,QAAM,mBAAmB,KAAK,KAAK,aAAa,cAAc,YAAY;AAC1E,+BAAU,KAAK,QAAQ,gBAAgB,CAAC;AACxC,KAAG,cAAc,sBAAkB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAC5F,UAAQ,IAAI,4CAAuC,gBAAgB,EAAE;AAErE,QAAM,iBAAiB,KAAK,KAAK,aAAa,uBAAuB;AACrE,QAAM,cAAU,oCAAqB,gBAAgB,kBAAkB,oBAAgB,gDAAuB,qCAAqB,MAAM,KAAK,CAAC,CAAC;AAChJ,UAAQ,IAAI,UACR,uEACA,mDAA8C;AACpD;AAEO,SAAS,cAAc,aAA2B;AACvD,QAAM,UAAU,KAAK,KAAK,aAAa,YAAY,UAAU;AAC7D,UAAI,sCAAuB,OAAO,GAAG;AACnC,YAAQ,IAAI,mDAA8C;AAAA,EAC5D;AAEA,QAAM,iBAAiB,KAAK,KAAK,aAAa,uBAAuB;AACrE,UAAI,oCAAqB,gBAAgB,gBAAgB,GAAG;AAC1D,YAAQ,IAAI,6DAAwD;AAAA,EACtE;AACF;AAEO,SAAS,wBAA8B;AAC5C,UAAQ,IAAI,4DAA4D;AACxE,UAAQ,IAAI,yDAAyD;AACvE;",
6
6
  "names": ["import_common"]
7
7
  }
@@ -56,11 +56,11 @@ function installClaudeEarly(projectRoot) {
56
56
  });
57
57
  console.log(written ? ` \u2713 Claude MCP server registered in ${mcpPath}` : ` \u2713 Claude MCP already configured in ${mcpPath}`);
58
58
  }
59
- function installClaudeLate(projectRoot, cavemanMode, shellCompressionLevel, enableMemory, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns) {
60
- const opts = (0, import_common.buildInstructionOpts)(cavemanMode, shellCompressionLevel, enableMemory, true, enableDocs, enableData, enableSecurity, enableArchitecture, enablePatterns);
59
+ function installClaudeLate(projectRoot, opts) {
60
+ const instructionOpts = (0, import_common.buildInstructionOpts)(opts, false);
61
61
  const instructionsPath = path.join(projectRoot, ".kirograph", "claude.md");
62
62
  (0, import_common.ensureDir)(path.dirname(instructionsPath));
63
- fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(opts));
63
+ fs.writeFileSync(instructionsPath, (0, import_instructions.buildAgentInstructions)(instructionOpts));
64
64
  console.log(` \u2713 Claude instructions written to ${instructionsPath}`);
65
65
  const memoryPath = path.join(projectRoot, "CLAUDE.md");
66
66
  const changed = (0, import_common.appendImportLine)(memoryPath, CLAUDE_IMPORT, "## KiroGraph");