@hivehub/rulebook 1.2.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 (379) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +539 -0
  3. package/dist/agents/claude-code.d.ts +69 -0
  4. package/dist/agents/claude-code.d.ts.map +1 -0
  5. package/dist/agents/claude-code.js +180 -0
  6. package/dist/agents/claude-code.js.map +1 -0
  7. package/dist/agents/cursor-agent.d.ts +184 -0
  8. package/dist/agents/cursor-agent.d.ts.map +1 -0
  9. package/dist/agents/cursor-agent.js +299 -0
  10. package/dist/agents/cursor-agent.js.map +1 -0
  11. package/dist/agents/gemini-cli.d.ts +69 -0
  12. package/dist/agents/gemini-cli.d.ts.map +1 -0
  13. package/dist/agents/gemini-cli.js +180 -0
  14. package/dist/agents/gemini-cli.js.map +1 -0
  15. package/dist/cli/commands.d.ts +57 -0
  16. package/dist/cli/commands.d.ts.map +1 -0
  17. package/dist/cli/commands.js +1370 -0
  18. package/dist/cli/commands.js.map +1 -0
  19. package/dist/cli/docs-prompts.d.ts +3 -0
  20. package/dist/cli/docs-prompts.d.ts.map +1 -0
  21. package/dist/cli/docs-prompts.js +45 -0
  22. package/dist/cli/docs-prompts.js.map +1 -0
  23. package/dist/cli/prompts.d.ts +6 -0
  24. package/dist/cli/prompts.d.ts.map +1 -0
  25. package/dist/cli/prompts.js +376 -0
  26. package/dist/cli/prompts.js.map +1 -0
  27. package/dist/core/agent-manager.d.ts +89 -0
  28. package/dist/core/agent-manager.d.ts.map +1 -0
  29. package/dist/core/agent-manager.js +546 -0
  30. package/dist/core/agent-manager.js.map +1 -0
  31. package/dist/core/auto-fixer.d.ts +14 -0
  32. package/dist/core/auto-fixer.d.ts.map +1 -0
  33. package/dist/core/auto-fixer.js +207 -0
  34. package/dist/core/auto-fixer.js.map +1 -0
  35. package/dist/core/changelog-generator.d.ts +44 -0
  36. package/dist/core/changelog-generator.d.ts.map +1 -0
  37. package/dist/core/changelog-generator.js +222 -0
  38. package/dist/core/changelog-generator.js.map +1 -0
  39. package/dist/core/cli-bridge.d.ts +113 -0
  40. package/dist/core/cli-bridge.d.ts.map +1 -0
  41. package/dist/core/cli-bridge.js +1094 -0
  42. package/dist/core/cli-bridge.js.map +1 -0
  43. package/dist/core/config-manager.d.ts +65 -0
  44. package/dist/core/config-manager.d.ts.map +1 -0
  45. package/dist/core/config-manager.js +266 -0
  46. package/dist/core/config-manager.js.map +1 -0
  47. package/dist/core/coverage-checker.d.ts +14 -0
  48. package/dist/core/coverage-checker.d.ts.map +1 -0
  49. package/dist/core/coverage-checker.js +176 -0
  50. package/dist/core/coverage-checker.js.map +1 -0
  51. package/dist/core/custom-templates.d.ts +27 -0
  52. package/dist/core/custom-templates.d.ts.map +1 -0
  53. package/dist/core/custom-templates.js +122 -0
  54. package/dist/core/custom-templates.js.map +1 -0
  55. package/dist/core/dependency-checker.d.ts +21 -0
  56. package/dist/core/dependency-checker.d.ts.map +1 -0
  57. package/dist/core/dependency-checker.js +247 -0
  58. package/dist/core/dependency-checker.js.map +1 -0
  59. package/dist/core/detector.d.ts +3 -0
  60. package/dist/core/detector.d.ts.map +1 -0
  61. package/dist/core/detector.js +1443 -0
  62. package/dist/core/detector.js.map +1 -0
  63. package/dist/core/docs-generator.d.ts +9 -0
  64. package/dist/core/docs-generator.d.ts.map +1 -0
  65. package/dist/core/docs-generator.js +531 -0
  66. package/dist/core/docs-generator.js.map +1 -0
  67. package/dist/core/generator.d.ts +16 -0
  68. package/dist/core/generator.d.ts.map +1 -0
  69. package/dist/core/generator.js +561 -0
  70. package/dist/core/generator.js.map +1 -0
  71. package/dist/core/gitignore-generator.d.ts +13 -0
  72. package/dist/core/gitignore-generator.d.ts.map +1 -0
  73. package/dist/core/gitignore-generator.js +307 -0
  74. package/dist/core/gitignore-generator.js.map +1 -0
  75. package/dist/core/health-scorer.d.ts +22 -0
  76. package/dist/core/health-scorer.d.ts.map +1 -0
  77. package/dist/core/health-scorer.js +395 -0
  78. package/dist/core/health-scorer.js.map +1 -0
  79. package/dist/core/logger.d.ts +116 -0
  80. package/dist/core/logger.d.ts.map +1 -0
  81. package/dist/core/logger.js +289 -0
  82. package/dist/core/logger.js.map +1 -0
  83. package/dist/core/merger.d.ts +6 -0
  84. package/dist/core/merger.d.ts.map +1 -0
  85. package/dist/core/merger.js +131 -0
  86. package/dist/core/merger.js.map +1 -0
  87. package/dist/core/migrator.d.ts +19 -0
  88. package/dist/core/migrator.d.ts.map +1 -0
  89. package/dist/core/migrator.js +102 -0
  90. package/dist/core/migrator.js.map +1 -0
  91. package/dist/core/minimal-scaffolder.d.ts +8 -0
  92. package/dist/core/minimal-scaffolder.d.ts.map +1 -0
  93. package/dist/core/minimal-scaffolder.js +51 -0
  94. package/dist/core/minimal-scaffolder.js.map +1 -0
  95. package/dist/core/modern-console-new.d.ts +81 -0
  96. package/dist/core/modern-console-new.d.ts.map +1 -0
  97. package/dist/core/modern-console-new.js +340 -0
  98. package/dist/core/modern-console-new.js.map +1 -0
  99. package/dist/core/modern-console.d.ts +99 -0
  100. package/dist/core/modern-console.d.ts.map +1 -0
  101. package/dist/core/modern-console.js +568 -0
  102. package/dist/core/modern-console.js.map +1 -0
  103. package/dist/core/openspec-manager.d.ts +133 -0
  104. package/dist/core/openspec-manager.d.ts.map +1 -0
  105. package/dist/core/openspec-manager.js +605 -0
  106. package/dist/core/openspec-manager.js.map +1 -0
  107. package/dist/core/openspec-migrator.d.ts +27 -0
  108. package/dist/core/openspec-migrator.d.ts.map +1 -0
  109. package/dist/core/openspec-migrator.js +255 -0
  110. package/dist/core/openspec-migrator.js.map +1 -0
  111. package/dist/core/task-manager.d.ts +65 -0
  112. package/dist/core/task-manager.d.ts.map +1 -0
  113. package/dist/core/task-manager.js +318 -0
  114. package/dist/core/task-manager.js.map +1 -0
  115. package/dist/core/test-task-manager.d.ts +49 -0
  116. package/dist/core/test-task-manager.d.ts.map +1 -0
  117. package/dist/core/test-task-manager.js +121 -0
  118. package/dist/core/test-task-manager.js.map +1 -0
  119. package/dist/core/validator.d.ts +21 -0
  120. package/dist/core/validator.d.ts.map +1 -0
  121. package/dist/core/validator.js +177 -0
  122. package/dist/core/validator.js.map +1 -0
  123. package/dist/core/version-bumper.d.ts +19 -0
  124. package/dist/core/version-bumper.d.ts.map +1 -0
  125. package/dist/core/version-bumper.js +180 -0
  126. package/dist/core/version-bumper.js.map +1 -0
  127. package/dist/core/watcher.d.ts +9 -0
  128. package/dist/core/watcher.d.ts.map +1 -0
  129. package/dist/core/watcher.js +22 -0
  130. package/dist/core/watcher.js.map +1 -0
  131. package/dist/core/workflow-generator.d.ts +10 -0
  132. package/dist/core/workflow-generator.d.ts.map +1 -0
  133. package/dist/core/workflow-generator.js +279 -0
  134. package/dist/core/workflow-generator.js.map +1 -0
  135. package/dist/index.d.ts +3 -0
  136. package/dist/index.d.ts.map +1 -0
  137. package/dist/index.js +159 -0
  138. package/dist/index.js.map +1 -0
  139. package/dist/mcp/handlers/archive-task.d.ts +17 -0
  140. package/dist/mcp/handlers/archive-task.d.ts.map +1 -0
  141. package/dist/mcp/handlers/archive-task.js +36 -0
  142. package/dist/mcp/handlers/archive-task.js.map +1 -0
  143. package/dist/mcp/handlers/create-task.d.ts +17 -0
  144. package/dist/mcp/handlers/create-task.d.ts.map +1 -0
  145. package/dist/mcp/handlers/create-task.js +56 -0
  146. package/dist/mcp/handlers/create-task.js.map +1 -0
  147. package/dist/mcp/handlers/list-tasks.d.ts +22 -0
  148. package/dist/mcp/handlers/list-tasks.d.ts.map +1 -0
  149. package/dist/mcp/handlers/list-tasks.js +42 -0
  150. package/dist/mcp/handlers/list-tasks.js.map +1 -0
  151. package/dist/mcp/handlers/show-task.d.ts +25 -0
  152. package/dist/mcp/handlers/show-task.d.ts.map +1 -0
  153. package/dist/mcp/handlers/show-task.js +43 -0
  154. package/dist/mcp/handlers/show-task.js.map +1 -0
  155. package/dist/mcp/handlers/update-task.d.ts +17 -0
  156. package/dist/mcp/handlers/update-task.d.ts.map +1 -0
  157. package/dist/mcp/handlers/update-task.js +35 -0
  158. package/dist/mcp/handlers/update-task.js.map +1 -0
  159. package/dist/mcp/handlers/validate-task.d.ts +15 -0
  160. package/dist/mcp/handlers/validate-task.d.ts.map +1 -0
  161. package/dist/mcp/handlers/validate-task.js +27 -0
  162. package/dist/mcp/handlers/validate-task.js.map +1 -0
  163. package/dist/mcp/rulebook-config.d.ts +22 -0
  164. package/dist/mcp/rulebook-config.d.ts.map +1 -0
  165. package/dist/mcp/rulebook-config.js +65 -0
  166. package/dist/mcp/rulebook-config.js.map +1 -0
  167. package/dist/mcp/rulebook-server.d.ts +4 -0
  168. package/dist/mcp/rulebook-server.d.ts.map +1 -0
  169. package/dist/mcp/rulebook-server.js +246 -0
  170. package/dist/mcp/rulebook-server.js.map +1 -0
  171. package/dist/types.d.ts +190 -0
  172. package/dist/types.d.ts.map +1 -0
  173. package/dist/types.js +2 -0
  174. package/dist/types.js.map +1 -0
  175. package/dist/utils/file-system.d.ts +9 -0
  176. package/dist/utils/file-system.d.ts.map +1 -0
  177. package/dist/utils/file-system.js +51 -0
  178. package/dist/utils/file-system.js.map +1 -0
  179. package/dist/utils/git-hooks.d.ts +8 -0
  180. package/dist/utils/git-hooks.d.ts.map +1 -0
  181. package/dist/utils/git-hooks.js +440 -0
  182. package/dist/utils/git-hooks.js.map +1 -0
  183. package/dist/utils/rulesignore.d.ts +9 -0
  184. package/dist/utils/rulesignore.d.ts.map +1 -0
  185. package/dist/utils/rulesignore.js +42 -0
  186. package/dist/utils/rulesignore.js.map +1 -0
  187. package/package.json +106 -0
  188. package/templates/cli/AIDER.md +49 -0
  189. package/templates/cli/AMAZON_Q.md +25 -0
  190. package/templates/cli/AUGGIE.md +32 -0
  191. package/templates/cli/CLAUDE.md +32 -0
  192. package/templates/cli/CLAUDE_CODE.md +35 -0
  193. package/templates/cli/CLINE.md +32 -0
  194. package/templates/cli/CODEBUDDY.md +20 -0
  195. package/templates/cli/CODEIUM.md +20 -0
  196. package/templates/cli/CODEX.md +21 -0
  197. package/templates/cli/CONTINUE.md +34 -0
  198. package/templates/cli/CURSOR_CLI.md +28 -0
  199. package/templates/cli/FACTORY.md +18 -0
  200. package/templates/cli/GEMINI.md +35 -0
  201. package/templates/cli/KILOCODE.md +18 -0
  202. package/templates/cli/OPENCODE.md +18 -0
  203. package/templates/cli/_GENERIC_TEMPLATE.md +29 -0
  204. package/templates/commands/rulebook-task-apply.md +67 -0
  205. package/templates/commands/rulebook-task-archive.md +70 -0
  206. package/templates/commands/rulebook-task-create.md +93 -0
  207. package/templates/commands/rulebook-task-list.md +42 -0
  208. package/templates/commands/rulebook-task-show.md +52 -0
  209. package/templates/commands/rulebook-task-validate.md +53 -0
  210. package/templates/core/AGENT_AUTOMATION.md +184 -0
  211. package/templates/core/DAG.md +304 -0
  212. package/templates/core/DOCUMENTATION_RULES.md +37 -0
  213. package/templates/core/QUALITY_ENFORCEMENT.md +68 -0
  214. package/templates/core/RULEBOOK.md +1874 -0
  215. package/templates/frameworks/ANGULAR.md +36 -0
  216. package/templates/frameworks/DJANGO.md +83 -0
  217. package/templates/frameworks/ELECTRON.md +147 -0
  218. package/templates/frameworks/FLASK.md +38 -0
  219. package/templates/frameworks/FLUTTER.md +55 -0
  220. package/templates/frameworks/JQUERY.md +32 -0
  221. package/templates/frameworks/LARAVEL.md +38 -0
  222. package/templates/frameworks/NESTJS.md +43 -0
  223. package/templates/frameworks/NEXTJS.md +127 -0
  224. package/templates/frameworks/NUXT.md +40 -0
  225. package/templates/frameworks/RAILS.md +66 -0
  226. package/templates/frameworks/REACT.md +38 -0
  227. package/templates/frameworks/REACT_NATIVE.md +47 -0
  228. package/templates/frameworks/SPRING.md +39 -0
  229. package/templates/frameworks/SYMFONY.md +36 -0
  230. package/templates/frameworks/VUE.md +36 -0
  231. package/templates/frameworks/ZEND.md +35 -0
  232. package/templates/git/CI_CD_PATTERNS.md +661 -0
  233. package/templates/git/GITHUB_ACTIONS.md +728 -0
  234. package/templates/git/GITLAB_CI.md +730 -0
  235. package/templates/git/GIT_WORKFLOW.md +1157 -0
  236. package/templates/git/SECRETS_MANAGEMENT.md +585 -0
  237. package/templates/hooks/COMMIT_MSG.md +530 -0
  238. package/templates/hooks/POST_CHECKOUT.md +546 -0
  239. package/templates/hooks/PREPARE_COMMIT_MSG.md +619 -0
  240. package/templates/hooks/PRE_COMMIT.md +414 -0
  241. package/templates/hooks/PRE_PUSH.md +601 -0
  242. package/templates/hooks/csharp-pre-commit.sh +23 -0
  243. package/templates/hooks/csharp-pre-push.sh +23 -0
  244. package/templates/hooks/dart-pre-commit.sh +30 -0
  245. package/templates/hooks/dart-pre-push.sh +25 -0
  246. package/templates/hooks/elixir-pre-commit.sh +32 -0
  247. package/templates/hooks/elixir-pre-push.sh +31 -0
  248. package/templates/hooks/erlang-pre-commit.sh +30 -0
  249. package/templates/hooks/erlang-pre-push.sh +37 -0
  250. package/templates/hooks/go-pre-commit.sh +40 -0
  251. package/templates/hooks/go-pre-push.sh +31 -0
  252. package/templates/hooks/haskell-pre-commit.sh +41 -0
  253. package/templates/hooks/haskell-pre-push.sh +37 -0
  254. package/templates/hooks/java-pre-commit.sh +34 -0
  255. package/templates/hooks/java-pre-push.sh +24 -0
  256. package/templates/hooks/kotlin-pre-commit.sh +32 -0
  257. package/templates/hooks/kotlin-pre-push.sh +16 -0
  258. package/templates/hooks/php-pre-commit.sh +36 -0
  259. package/templates/hooks/php-pre-push.sh +26 -0
  260. package/templates/hooks/python-pre-commit.sh +51 -0
  261. package/templates/hooks/python-pre-push.sh +25 -0
  262. package/templates/hooks/ruby-pre-commit.sh +33 -0
  263. package/templates/hooks/ruby-pre-push.sh +32 -0
  264. package/templates/hooks/rust-pre-commit.sh +30 -0
  265. package/templates/hooks/rust-pre-push.sh +30 -0
  266. package/templates/hooks/scala-pre-commit.sh +32 -0
  267. package/templates/hooks/scala-pre-push.sh +24 -0
  268. package/templates/hooks/swift-pre-commit.sh +25 -0
  269. package/templates/hooks/swift-pre-push.sh +23 -0
  270. package/templates/hooks/typescript-pre-commit.sh +37 -0
  271. package/templates/hooks/typescript-pre-push.sh +36 -0
  272. package/templates/ides/COPILOT.md +37 -0
  273. package/templates/ides/CURSOR.md +43 -0
  274. package/templates/ides/JETBRAINS_AI.md +35 -0
  275. package/templates/ides/REPLIT.md +36 -0
  276. package/templates/ides/TABNINE.md +29 -0
  277. package/templates/ides/VSCODE.md +40 -0
  278. package/templates/ides/WINDSURF.md +36 -0
  279. package/templates/ides/ZED.md +32 -0
  280. package/templates/languages/ADA.md +58 -0
  281. package/templates/languages/C.md +333 -0
  282. package/templates/languages/CPP.md +743 -0
  283. package/templates/languages/CSHARP.md +417 -0
  284. package/templates/languages/DART.md +332 -0
  285. package/templates/languages/ELIXIR.md +454 -0
  286. package/templates/languages/ERLANG.md +361 -0
  287. package/templates/languages/GO.md +645 -0
  288. package/templates/languages/HASKELL.md +177 -0
  289. package/templates/languages/JAVA.md +607 -0
  290. package/templates/languages/JAVASCRIPT.md +631 -0
  291. package/templates/languages/JULIA.md +97 -0
  292. package/templates/languages/KOTLIN.md +511 -0
  293. package/templates/languages/LISP.md +100 -0
  294. package/templates/languages/LUA.md +74 -0
  295. package/templates/languages/OBJECTIVEC.md +90 -0
  296. package/templates/languages/PHP.md +416 -0
  297. package/templates/languages/PYTHON.md +682 -0
  298. package/templates/languages/R.md +350 -0
  299. package/templates/languages/RUBY.md +421 -0
  300. package/templates/languages/RUST.md +477 -0
  301. package/templates/languages/SAS.md +73 -0
  302. package/templates/languages/SCALA.md +348 -0
  303. package/templates/languages/SOLIDITY.md +580 -0
  304. package/templates/languages/SQL.md +137 -0
  305. package/templates/languages/SWIFT.md +466 -0
  306. package/templates/languages/TYPESCRIPT.md +591 -0
  307. package/templates/languages/ZIG.md +265 -0
  308. package/templates/modules/ATLASSIAN.md +255 -0
  309. package/templates/modules/CONTEXT7.md +54 -0
  310. package/templates/modules/FIGMA.md +267 -0
  311. package/templates/modules/GITHUB_MCP.md +64 -0
  312. package/templates/modules/GRAFANA.md +328 -0
  313. package/templates/modules/NOTION.md +247 -0
  314. package/templates/modules/PLAYWRIGHT.md +90 -0
  315. package/templates/modules/RULEBOOK_MCP.md +156 -0
  316. package/templates/modules/SERENA.md +337 -0
  317. package/templates/modules/SUPABASE.md +223 -0
  318. package/templates/modules/SYNAP.md +69 -0
  319. package/templates/modules/VECTORIZER.md +63 -0
  320. package/templates/services/AZURE_BLOB.md +184 -0
  321. package/templates/services/CASSANDRA.md +239 -0
  322. package/templates/services/DYNAMODB.md +308 -0
  323. package/templates/services/ELASTICSEARCH.md +347 -0
  324. package/templates/services/GCS.md +178 -0
  325. package/templates/services/INFLUXDB.md +265 -0
  326. package/templates/services/KAFKA.md +341 -0
  327. package/templates/services/MARIADB.md +183 -0
  328. package/templates/services/MEMCACHED.md +242 -0
  329. package/templates/services/MINIO.md +201 -0
  330. package/templates/services/MONGODB.md +268 -0
  331. package/templates/services/MYSQL.md +358 -0
  332. package/templates/services/NEO4J.md +247 -0
  333. package/templates/services/ORACLE.md +290 -0
  334. package/templates/services/POSTGRESQL.md +326 -0
  335. package/templates/services/RABBITMQ.md +286 -0
  336. package/templates/services/REDIS.md +292 -0
  337. package/templates/services/S3.md +298 -0
  338. package/templates/services/SQLITE.md +294 -0
  339. package/templates/services/SQLSERVER.md +294 -0
  340. package/templates/workflows/codespell.yml +31 -0
  341. package/templates/workflows/cpp-lint.yml +47 -0
  342. package/templates/workflows/cpp-publish.yml +119 -0
  343. package/templates/workflows/cpp-test.yml +77 -0
  344. package/templates/workflows/dotnet-lint.yml +29 -0
  345. package/templates/workflows/dotnet-publish.yml +40 -0
  346. package/templates/workflows/dotnet-test.yml +41 -0
  347. package/templates/workflows/elixir-lint.yml +45 -0
  348. package/templates/workflows/elixir-publish.yml +49 -0
  349. package/templates/workflows/elixir-test.yml +54 -0
  350. package/templates/workflows/erlang-lint.yml +47 -0
  351. package/templates/workflows/erlang-test.yml +62 -0
  352. package/templates/workflows/go-lint.yml +39 -0
  353. package/templates/workflows/go-publish.yml +95 -0
  354. package/templates/workflows/go-test.yml +59 -0
  355. package/templates/workflows/java-lint.yml +60 -0
  356. package/templates/workflows/java-publish.yml +120 -0
  357. package/templates/workflows/java-test.yml +85 -0
  358. package/templates/workflows/kotlin-lint.yml +34 -0
  359. package/templates/workflows/kotlin-publish.yml +56 -0
  360. package/templates/workflows/kotlin-test.yml +48 -0
  361. package/templates/workflows/php-lint.yml +39 -0
  362. package/templates/workflows/php-publish.yml +50 -0
  363. package/templates/workflows/php-test.yml +54 -0
  364. package/templates/workflows/python-lint.yml +47 -0
  365. package/templates/workflows/python-publish.yml +91 -0
  366. package/templates/workflows/python-test.yml +59 -0
  367. package/templates/workflows/rust-lint.yml +54 -0
  368. package/templates/workflows/rust-publish.yml +66 -0
  369. package/templates/workflows/rust-test.yml +75 -0
  370. package/templates/workflows/solidity-lint.yml +41 -0
  371. package/templates/workflows/solidity-test.yml +47 -0
  372. package/templates/workflows/swift-lint.yml +32 -0
  373. package/templates/workflows/swift-publish.yml +58 -0
  374. package/templates/workflows/swift-test.yml +44 -0
  375. package/templates/workflows/typescript-lint.yml +61 -0
  376. package/templates/workflows/typescript-publish.yml +60 -0
  377. package/templates/workflows/typescript-test.yml +73 -0
  378. package/templates/workflows/zig-lint.yml +27 -0
  379. package/templates/workflows/zig-test.yml +40 -0
@@ -0,0 +1,267 @@
1
+ <!-- FIGMA:START -->
2
+ # Figma MCP Instructions
3
+
4
+ **CRITICAL**: Use MCP Figma for design system integration, asset export, and design-to-code workflows.
5
+
6
+ ## Core Operations
7
+
8
+ ### File Operations
9
+ ```typescript
10
+ // Get file
11
+ figma.getFile({ file_key: 'file-key' })
12
+
13
+ // Get file nodes
14
+ figma.getFileNodes({
15
+ file_key: 'file-key',
16
+ ids: ['node-id-1', 'node-id-2']
17
+ })
18
+
19
+ // Get file versions
20
+ figma.getFileVersions({ file_key: 'file-key' })
21
+ ```
22
+
23
+ ### Image Export
24
+ ```typescript
25
+ // Export images
26
+ figma.getImage({
27
+ file_key: 'file-key',
28
+ ids: 'node-id',
29
+ format: 'png', // png, jpg, svg, pdf
30
+ scale: 2 // @2x resolution
31
+ })
32
+
33
+ // Export multiple
34
+ figma.getImage({
35
+ file_key: 'file-key',
36
+ ids: 'node-1,node-2,node-3',
37
+ format: 'svg',
38
+ svg_outline_text: true
39
+ })
40
+ ```
41
+
42
+ ### Components
43
+ ```typescript
44
+ // Get components
45
+ figma.getFileComponents({ file_key: 'file-key' })
46
+
47
+ // Get component sets
48
+ figma.getFileComponentSets({ file_key: 'file-key' })
49
+
50
+ // Get team components
51
+ figma.getTeamComponents({ team_id: 'team-id' })
52
+ ```
53
+
54
+ ### Styles
55
+ ```typescript
56
+ // Get file styles
57
+ figma.getFileStyles({ file_key: 'file-key' })
58
+
59
+ // Get team styles
60
+ figma.getTeamStyles({ team_id: 'team-id' })
61
+ ```
62
+
63
+ ### Comments
64
+ ```typescript
65
+ // Get comments
66
+ figma.getComments({ file_key: 'file-key' })
67
+
68
+ // Post comment
69
+ figma.postComment({
70
+ file_key: 'file-key',
71
+ message: 'Approved for development',
72
+ comment_id: 'parent-comment-id' // For replies
73
+ })
74
+ ```
75
+
76
+ ## Common Patterns
77
+
78
+ ### Design Token Export
79
+ ```typescript
80
+ // Export design tokens from Figma styles
81
+ const { data: { styles } } = await figma.getFileStyles({ file_key: fileKey })
82
+
83
+ const tokens = {
84
+ colors: {},
85
+ typography: {},
86
+ spacing: {}
87
+ }
88
+
89
+ for (const style of Object.values(styles)) {
90
+ if (style.style_type === 'FILL') {
91
+ tokens.colors[style.name] = extractColor(style)
92
+ } else if (style.style_type === 'TEXT') {
93
+ tokens.typography[style.name] = extractTextStyle(style)
94
+ }
95
+ }
96
+
97
+ // Write to tokens.json
98
+ fs.writeFileSync('tokens.json', JSON.stringify(tokens, null, 2))
99
+ ```
100
+
101
+ ### Component Sync
102
+ ```typescript
103
+ // Sync Figma components to code
104
+ const { data: components } = await figma.getFileComponents({ file_key: fileKey })
105
+
106
+ for (const component of Object.values(components)) {
107
+ // Export component as SVG
108
+ const { data: images } = await figma.getImage({
109
+ file_key: fileKey,
110
+ ids: component.node_id,
111
+ format: 'svg'
112
+ })
113
+
114
+ // Save to assets folder
115
+ const svg = await fetch(images[component.node_id]).then(r => r.text())
116
+ fs.writeFileSync(`assets/icons/${component.name}.svg`, svg)
117
+ }
118
+ ```
119
+
120
+ ### Screenshot Generation
121
+ ```typescript
122
+ // Generate screenshots for documentation
123
+ const screens = ['home-screen', 'login-screen', 'dashboard']
124
+
125
+ for (const screenId of screens) {
126
+ const { data: images } = await figma.getImage({
127
+ file_key: fileKey,
128
+ ids: screenId,
129
+ format: 'png',
130
+ scale: 2
131
+ })
132
+
133
+ const imageUrl = images[screenId]
134
+ const response = await fetch(imageUrl)
135
+ const buffer = await response.buffer()
136
+
137
+ fs.writeFileSync(`docs/screenshots/${screenId}.png`, buffer)
138
+ }
139
+ ```
140
+
141
+ ### Design Review Automation
142
+ ```typescript
143
+ // Check for new comments
144
+ const { data: comments } = await figma.getComments({ file_key: fileKey })
145
+
146
+ const unresolved = comments.filter(c => !c.resolved_at)
147
+
148
+ if (unresolved.length > 0) {
149
+ console.log(`${unresolved.length} unresolved design comments`)
150
+
151
+ // Create Jira issues for unresolved comments
152
+ for (const comment of unresolved) {
153
+ await jira.issues.createIssue({
154
+ fields: {
155
+ project: { key: 'DESIGN' },
156
+ summary: `Design feedback: ${comment.message.substring(0, 50)}`,
157
+ description: comment.message,
158
+ issuetype: { name: 'Task' }
159
+ }
160
+ })
161
+ }
162
+ }
163
+ ```
164
+
165
+ ### Design System Documentation
166
+ ```typescript
167
+ // Generate component documentation
168
+ const { data: components } = await figma.getFileComponents({ file_key: fileKey })
169
+
170
+ let markdown = '# Design System Components\n\n'
171
+
172
+ for (const [id, component] of Object.entries(components)) {
173
+ // Export thumbnail
174
+ const { data: images } = await figma.getImage({
175
+ file_key: fileKey,
176
+ ids: id,
177
+ format: 'png',
178
+ scale: 1
179
+ })
180
+
181
+ markdown += `## ${component.name}\n\n`
182
+ markdown += `![${component.name}](${images[id]})\n\n`
183
+ markdown += `**Description:** ${component.description || 'No description'}\n\n`
184
+ }
185
+
186
+ fs.writeFileSync('docs/design-system.md', markdown)
187
+ ```
188
+
189
+ ## Best Practices
190
+
191
+ ✅ **DO:**
192
+ - Cache file data to reduce API calls
193
+ - Use version history for tracking changes
194
+ - Export assets at appropriate resolutions
195
+ - Document component usage
196
+ - Use meaningful component names
197
+ - Keep design tokens in sync
198
+ - Handle rate limits (requests/minute)
199
+
200
+ ❌ **DON'T:**
201
+ - Export entire files repeatedly
202
+ - Ignore version control
203
+ - Hardcode file keys
204
+ - Skip error handling
205
+ - Export at wrong resolutions
206
+ - Commit API tokens
207
+
208
+ ## Configuration
209
+
210
+ ```json
211
+ {
212
+ "mcpServers": {
213
+ "figma": {
214
+ "command": "npx",
215
+ "args": ["-y", "@modelcontextprotocol/server-figma"],
216
+ "env": {
217
+ "FIGMA_ACCESS_TOKEN": "your-personal-access-token"
218
+ }
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ **Setup:**
225
+ 1. Generate personal access token: Account Settings → Personal Access Tokens
226
+ 2. Grant appropriate scopes (file content, comments)
227
+ 3. Store token securely
228
+
229
+ ## Integration Patterns
230
+
231
+ ### CI/CD Asset Pipeline
232
+ ```bash
233
+ # Export icons on every design update
234
+ figma-export --file-key=$FIGMA_FILE --format=svg --output=src/assets/icons
235
+
236
+ # Optimize SVGs
237
+ svgo --folder src/assets/icons
238
+
239
+ # Commit if changes detected
240
+ git diff --quiet src/assets/icons || git commit -m "chore: Update design assets"
241
+ ```
242
+
243
+ ### Design-to-Code Workflow
244
+ ```typescript
245
+ // 1. Detect design changes
246
+ const currentVersion = await figma.getFile({ file_key: fileKey })
247
+ const lastVersion = loadLastProcessedVersion()
248
+
249
+ if (currentVersion.version !== lastVersion) {
250
+ // 2. Export updated components
251
+ await exportComponents(fileKey)
252
+
253
+ // 3. Generate code
254
+ await generateComponentCode()
255
+
256
+ // 4. Run tests
257
+ await runVisualRegressionTests()
258
+
259
+ // 5. Create PR if tests pass
260
+ if (testsPass) {
261
+ await createPullRequest('Update components from Figma')
262
+ }
263
+ }
264
+ ```
265
+
266
+ <!-- FIGMA:END -->
267
+
@@ -0,0 +1,64 @@
1
+ <!-- GITHUB_MCP:START -->
2
+ # GitHub MCP Server Integration
3
+
4
+ **CRITICAL**: Monitor CI/CD workflows after every `git push` using GitHub MCP.
5
+
6
+ ## Workflow After Push
7
+
8
+ ```
9
+ 1. Push changes
10
+ 2. Wait 10 seconds
11
+ 3. Check workflow status via GitHub MCP
12
+ 4. If workflows running → check again in next interaction
13
+ 5. If workflows failed → fetch logs, analyze, fix
14
+ 6. If workflows passed → confirm to user
15
+ ```
16
+
17
+ ## Error Recovery
18
+
19
+ **When CI/CD fails:**
20
+
21
+ ```
22
+ 1. Fetch error information (workflow, job, step, logs)
23
+ 2. Analyze against AGENTS.md standards
24
+ 3. Propose fix
25
+ 4. Implement fix with full quality checks
26
+ 5. Commit and provide push command
27
+ 6. Monitor workflows again
28
+ ```
29
+
30
+ ## Best Practices
31
+
32
+ ✅ **DO:**
33
+ - Always check workflows after push
34
+ - Fetch complete error logs on failures
35
+ - Fix issues before next feature
36
+ - Verify fixes locally before re-pushing
37
+ - Report status to user
38
+
39
+ ❌ **DON'T:**
40
+ - Ignore workflow failures
41
+ - Push again without fixing
42
+ - Skip error analysis
43
+ - Proceed if workflows failing
44
+ - Create tags if CI/CD failed
45
+
46
+ ## Configuration
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "github": {
52
+ "command": "npx",
53
+ "args": ["-y", "@modelcontextprotocol/server-github"],
54
+ "env": {
55
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ **Token permissions:** Repository (read), Actions (read), Workflows (read/write)
63
+
64
+ <!-- GITHUB_MCP:END -->
@@ -0,0 +1,328 @@
1
+ <!-- GRAFANA:START -->
2
+ # Grafana MCP Instructions
3
+
4
+ **CRITICAL**: Use MCP Grafana for metrics visualization, alerting, and observability dashboards.
5
+
6
+ ## Core Operations
7
+
8
+ ### Dashboard Management
9
+ ```typescript
10
+ // Get dashboard
11
+ grafana.dashboards.getDashboardByUid({ uid: 'dashboard-uid' })
12
+
13
+ // Create dashboard
14
+ grafana.dashboards.postDashboard({
15
+ dashboard: {
16
+ title: 'Application Metrics',
17
+ tags: ['production', 'api'],
18
+ timezone: 'browser',
19
+ panels: [
20
+ {
21
+ title: 'Request Rate',
22
+ type: 'graph',
23
+ targets: [{ expr: 'rate(http_requests_total[5m])' }]
24
+ }
25
+ ]
26
+ },
27
+ overwrite: false
28
+ })
29
+
30
+ // Update dashboard
31
+ grafana.dashboards.postDashboard({
32
+ dashboard: modifiedDashboard,
33
+ overwrite: true
34
+ })
35
+
36
+ // Delete dashboard
37
+ grafana.dashboards.deleteDashboardByUid({ uid: 'dashboard-uid' })
38
+ ```
39
+
40
+ ### Data Sources
41
+ ```typescript
42
+ // Get data sources
43
+ grafana.datasources.getDataSources()
44
+
45
+ // Add data source
46
+ grafana.datasources.addDataSource({
47
+ name: 'Prometheus',
48
+ type: 'prometheus',
49
+ url: 'http://prometheus:9090',
50
+ access: 'proxy',
51
+ isDefault: true
52
+ })
53
+
54
+ // Query data source
55
+ grafana.datasources.queryDataSource({
56
+ datasourceId: 1,
57
+ from: Date.now() - 3600000, // 1 hour ago
58
+ to: Date.now(),
59
+ queries: [
60
+ { expr: 'up', refId: 'A' }
61
+ ]
62
+ })
63
+ ```
64
+
65
+ ### Alerts
66
+ ```typescript
67
+ // Get alerts
68
+ grafana.alerting.getAlerts({ state: 'alerting' })
69
+
70
+ // Create alert rule
71
+ grafana.alerting.postAlertRule({
72
+ title: 'High Error Rate',
73
+ condition: 'A',
74
+ data: [
75
+ {
76
+ refId: 'A',
77
+ queryType: '',
78
+ relativeTimeRange: { from: 600, to: 0 },
79
+ datasourceUid: 'prometheus-uid',
80
+ model: {
81
+ expr: 'rate(http_errors_total[5m]) > 0.05'
82
+ }
83
+ }
84
+ ],
85
+ noDataState: 'NoData',
86
+ execErrState: 'Alerting',
87
+ for: '5m',
88
+ annotations: {
89
+ description: 'Error rate exceeded 5%'
90
+ },
91
+ labels: { severity: 'high' }
92
+ })
93
+
94
+ // Pause alert
95
+ grafana.alerting.pauseAlertRule({ uid: 'alert-uid', paused: true })
96
+ ```
97
+
98
+ ### Annotations
99
+ ```typescript
100
+ // Create annotation
101
+ grafana.annotations.postAnnotation({
102
+ dashboardUid: 'dashboard-uid',
103
+ time: Date.now(),
104
+ timeEnd: Date.now(),
105
+ tags: ['deployment'],
106
+ text: 'Deployed version 1.2.0'
107
+ })
108
+
109
+ // Get annotations
110
+ grafana.annotations.getAnnotations({
111
+ from: Date.now() - 86400000, // Last 24h
112
+ to: Date.now(),
113
+ tags: ['deployment']
114
+ })
115
+ ```
116
+
117
+ ### Organizations & Users
118
+ ```typescript
119
+ // Get organization
120
+ grafana.orgs.getOrgByName({ orgName: 'Main Org' })
121
+
122
+ // Add user
123
+ grafana.users.createUser({
124
+ email: 'user@example.com',
125
+ login: 'username',
126
+ password: 'secure-password',
127
+ name: 'User Name'
128
+ })
129
+
130
+ // Update user permissions
131
+ grafana.org.updateOrgUser({
132
+ userId: 123,
133
+ role: 'Editor' // Viewer, Editor, Admin
134
+ })
135
+ ```
136
+
137
+ ## Common Patterns
138
+
139
+ ### Deployment Tracking
140
+ ```typescript
141
+ // Mark deployment on dashboard
142
+ await grafana.annotations.postAnnotation({
143
+ time: Date.now(),
144
+ tags: ['deployment', 'production'],
145
+ text: `Deployed ${process.env.GIT_SHA}`,
146
+ dashboardUid: 'main-dashboard'
147
+ })
148
+
149
+ // Create snapshot after deployment
150
+ const snapshot = await grafana.snapshots.createDashboardSnapshot({
151
+ dashboard: dashboard,
152
+ name: `Production Metrics - ${new Date().toISOString()}`,
153
+ expires: 86400 // 24 hours
154
+ })
155
+ ```
156
+
157
+ ### Automated Dashboard Creation
158
+ ```typescript
159
+ // Create dashboard for new service
160
+ async function createServiceDashboard(serviceName) {
161
+ const dashboard = {
162
+ title: `${serviceName} Metrics`,
163
+ tags: ['microservices', serviceName],
164
+ panels: [
165
+ {
166
+ title: 'Request Rate',
167
+ type: 'graph',
168
+ targets: [{
169
+ expr: `rate(http_requests_total{service="${serviceName}"}[5m])`
170
+ }]
171
+ },
172
+ {
173
+ title: 'Error Rate',
174
+ type: 'graph',
175
+ targets: [{
176
+ expr: `rate(http_errors_total{service="${serviceName}"}[5m])`
177
+ }]
178
+ },
179
+ {
180
+ title: 'Response Time (p95)',
181
+ type: 'graph',
182
+ targets: [{
183
+ expr: `histogram_quantile(0.95, rate(http_duration_seconds_bucket{service="${serviceName}"}[5m]))`
184
+ }]
185
+ }
186
+ ]
187
+ }
188
+
189
+ return await grafana.dashboards.postDashboard({
190
+ dashboard,
191
+ overwrite: false
192
+ })
193
+ }
194
+ ```
195
+
196
+ ### Alert Management
197
+ ```typescript
198
+ // Check for firing alerts
199
+ const alerts = await grafana.alerting.getAlerts({ state: 'alerting' })
200
+
201
+ if (alerts.length > 0) {
202
+ console.log(`${alerts.length} alerts firing:`)
203
+
204
+ for (const alert of alerts) {
205
+ console.log(`- ${alert.labels.alertname}: ${alert.annotations.description}`)
206
+
207
+ // Create incident ticket
208
+ await jira.issues.createIssue({
209
+ fields: {
210
+ project: { key: 'OPS' },
211
+ summary: `Alert: ${alert.labels.alertname}`,
212
+ description: alert.annotations.description,
213
+ issuetype: { name: 'Incident' },
214
+ priority: { name: alert.labels.severity === 'critical' ? 'Highest' : 'High' }
215
+ }
216
+ })
217
+ }
218
+ }
219
+ ```
220
+
221
+ ### Metrics Reporting
222
+ ```typescript
223
+ // Generate daily metrics report
224
+ async function generateDailyReport() {
225
+ const datasourceId = 1 // Prometheus
226
+ const from = Date.now() - 86400000 // 24h ago
227
+ const to = Date.now()
228
+
229
+ // Query metrics
230
+ const requestRate = await grafana.datasources.queryDataSource({
231
+ datasourceId,
232
+ from,
233
+ to,
234
+ queries: [{ expr: 'sum(rate(http_requests_total[24h]))', refId: 'A' }]
235
+ })
236
+
237
+ const errorRate = await grafana.datasources.queryDataSource({
238
+ datasourceId,
239
+ from,
240
+ to,
241
+ queries: [{ expr: 'sum(rate(http_errors_total[24h]))', refId: 'A' }]
242
+ })
243
+
244
+ // Create report
245
+ const report = {
246
+ date: new Date().toISOString(),
247
+ totalRequests: requestRate.results.A.frames[0].data.values[1][0],
248
+ totalErrors: errorRate.results.A.frames[0].data.values[1][0],
249
+ errorPercentage: (totalErrors / totalRequests * 100).toFixed(2)
250
+ }
251
+
252
+ // Post to Confluence/Notion
253
+ await notion.pages.create({
254
+ parent: { database_id: reportsDbId },
255
+ properties: {
256
+ 'Title': { title: [{ text: { content: `Daily Metrics - ${report.date}` } }] },
257
+ 'Requests': { number: report.totalRequests },
258
+ 'Errors': { number: report.totalErrors },
259
+ 'Error Rate': { number: parseFloat(report.errorPercentage) }
260
+ }
261
+ })
262
+ }
263
+ ```
264
+
265
+ ## Best Practices
266
+
267
+ ✅ **DO:**
268
+ - Use dashboard folders for organization
269
+ - Tag dashboards appropriately
270
+ - Set up proper alert thresholds
271
+ - Use variables for flexibility
272
+ - Create snapshots before changes
273
+ - Document dashboard purpose
274
+ - Use templating for multi-instance dashboards
275
+
276
+ ❌ **DON'T:**
277
+ - Create duplicate dashboards
278
+ - Set alerts without testing
279
+ - Ignore alert fatigue
280
+ - Hardcode dashboard IDs
281
+ - Skip dashboard backups
282
+ - Over-complicate queries
283
+
284
+ ## Configuration
285
+
286
+ ```json
287
+ {
288
+ "mcpServers": {
289
+ "grafana": {
290
+ "command": "npx",
291
+ "args": ["-y", "@modelcontextprotocol/server-grafana"],
292
+ "env": {
293
+ "GRAFANA_URL": "http://grafana:3000",
294
+ "GRAFANA_API_KEY": "your-api-key",
295
+ "GRAFANA_ORG_ID": "1"
296
+ }
297
+ }
298
+ }
299
+ }
300
+ ```
301
+
302
+ **Setup:**
303
+ 1. Create API key: Configuration → API Keys → Add API key
304
+ 2. Grant appropriate permissions (Admin for management, Viewer for read-only)
305
+ 3. Store securely
306
+
307
+ ## Integration with CI/CD
308
+
309
+ ```typescript
310
+ // Add deployment annotation on successful deploy
311
+ if (deploymentSuccess) {
312
+ await grafana.annotations.postAnnotation({
313
+ time: Date.now(),
314
+ tags: ['deployment', process.env.ENVIRONMENT],
315
+ text: `Deployed ${process.env.GIT_SHA} to ${process.env.ENVIRONMENT}`,
316
+ dashboardUid: process.env.GRAFANA_DASHBOARD_UID
317
+ })
318
+ }
319
+
320
+ // Check alerts before deployment
321
+ const alerts = await grafana.alerting.getAlerts({ state: 'alerting' })
322
+ if (alerts.length > 0) {
323
+ console.warn('⚠️ Active alerts detected. Deployment may be risky.')
324
+ }
325
+ ```
326
+
327
+ <!-- GRAFANA:END -->
328
+