compound-engineering-pi 0.2.3

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 (332) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/bin/compound-engineering-pi +12 -0
  4. package/bin/compound-plugin +12 -0
  5. package/compound-engineering-pi +12 -0
  6. package/compound-plugin +5 -0
  7. package/docs/pi.md +152 -0
  8. package/extensions/compound-engineering-compat.ts +452 -0
  9. package/package.json +84 -0
  10. package/pi-resources/compound-engineering/mcporter.json +7 -0
  11. package/plugins/coding-tutor/.claude-plugin/plugin.json +9 -0
  12. package/plugins/coding-tutor/README.md +37 -0
  13. package/plugins/coding-tutor/commands/quiz-me.md +1 -0
  14. package/plugins/coding-tutor/commands/sync-tutorials.md +25 -0
  15. package/plugins/coding-tutor/commands/teach-me.md +1 -0
  16. package/plugins/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
  17. package/plugins/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +207 -0
  18. package/plugins/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +193 -0
  19. package/plugins/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
  20. package/plugins/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +118 -0
  21. package/plugins/compound-engineering/.claude-plugin/plugin.json +33 -0
  22. package/plugins/compound-engineering/CHANGELOG.md +457 -0
  23. package/plugins/compound-engineering/CLAUDE.md +89 -0
  24. package/plugins/compound-engineering/LICENSE +21 -0
  25. package/plugins/compound-engineering/README.md +232 -0
  26. package/plugins/compound-engineering/agents/design/design-implementation-reviewer.md +109 -0
  27. package/plugins/compound-engineering/agents/design/design-iterator.md +224 -0
  28. package/plugins/compound-engineering/agents/design/figma-design-sync.md +190 -0
  29. package/plugins/compound-engineering/agents/docs/ankane-readme-writer.md +65 -0
  30. package/plugins/compound-engineering/agents/research/best-practices-researcher.md +126 -0
  31. package/plugins/compound-engineering/agents/research/framework-docs-researcher.md +106 -0
  32. package/plugins/compound-engineering/agents/research/git-history-analyzer.md +59 -0
  33. package/plugins/compound-engineering/agents/research/learnings-researcher.md +264 -0
  34. package/plugins/compound-engineering/agents/research/repo-research-analyst.md +135 -0
  35. package/plugins/compound-engineering/agents/review/agent-native-reviewer.md +261 -0
  36. package/plugins/compound-engineering/agents/review/architecture-strategist.md +67 -0
  37. package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +101 -0
  38. package/plugins/compound-engineering/agents/review/data-integrity-guardian.md +85 -0
  39. package/plugins/compound-engineering/agents/review/data-migration-expert.md +112 -0
  40. package/plugins/compound-engineering/agents/review/deployment-verification-agent.md +174 -0
  41. package/plugins/compound-engineering/agents/review/dhh-rails-reviewer.md +66 -0
  42. package/plugins/compound-engineering/agents/review/julik-frontend-races-reviewer.md +221 -0
  43. package/plugins/compound-engineering/agents/review/kieran-python-reviewer.md +133 -0
  44. package/plugins/compound-engineering/agents/review/kieran-rails-reviewer.md +115 -0
  45. package/plugins/compound-engineering/agents/review/kieran-typescript-reviewer.md +124 -0
  46. package/plugins/compound-engineering/agents/review/pattern-recognition-specialist.md +72 -0
  47. package/plugins/compound-engineering/agents/review/performance-oracle.md +137 -0
  48. package/plugins/compound-engineering/agents/review/schema-drift-detector.md +154 -0
  49. package/plugins/compound-engineering/agents/review/security-sentinel.md +114 -0
  50. package/plugins/compound-engineering/agents/workflow/bug-reproduction-validator.md +82 -0
  51. package/plugins/compound-engineering/agents/workflow/every-style-editor.md +64 -0
  52. package/plugins/compound-engineering/agents/workflow/lint.md +16 -0
  53. package/plugins/compound-engineering/agents/workflow/pr-comment-resolver.md +84 -0
  54. package/plugins/compound-engineering/agents/workflow/spec-flow-analyzer.md +134 -0
  55. package/plugins/compound-engineering/commands/agent-native-audit.md +278 -0
  56. package/plugins/compound-engineering/commands/changelog.md +138 -0
  57. package/plugins/compound-engineering/commands/create-agent-skill.md +9 -0
  58. package/plugins/compound-engineering/commands/deepen-plan.md +546 -0
  59. package/plugins/compound-engineering/commands/deploy-docs.md +113 -0
  60. package/plugins/compound-engineering/commands/feature-video.md +342 -0
  61. package/plugins/compound-engineering/commands/generate_command.md +163 -0
  62. package/plugins/compound-engineering/commands/heal-skill.md +143 -0
  63. package/plugins/compound-engineering/commands/lfg.md +20 -0
  64. package/plugins/compound-engineering/commands/release-docs.md +212 -0
  65. package/plugins/compound-engineering/commands/report-bug.md +151 -0
  66. package/plugins/compound-engineering/commands/reproduce-bug.md +100 -0
  67. package/plugins/compound-engineering/commands/resolve_parallel.md +35 -0
  68. package/plugins/compound-engineering/commands/resolve_todo_parallel.md +37 -0
  69. package/plugins/compound-engineering/commands/slfg.md +32 -0
  70. package/plugins/compound-engineering/commands/technical_review.md +8 -0
  71. package/plugins/compound-engineering/commands/test-browser.md +339 -0
  72. package/plugins/compound-engineering/commands/test-xcode.md +332 -0
  73. package/plugins/compound-engineering/commands/triage.md +311 -0
  74. package/plugins/compound-engineering/commands/workflows/brainstorm.md +124 -0
  75. package/plugins/compound-engineering/commands/workflows/compound.md +239 -0
  76. package/plugins/compound-engineering/commands/workflows/plan.md +551 -0
  77. package/plugins/compound-engineering/commands/workflows/review.md +526 -0
  78. package/plugins/compound-engineering/commands/workflows/work.md +433 -0
  79. package/plugins/compound-engineering/skills/agent-browser/SKILL.md +223 -0
  80. package/plugins/compound-engineering/skills/agent-native-architecture/SKILL.md +435 -0
  81. package/plugins/compound-engineering/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  82. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  83. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  84. package/plugins/compound-engineering/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  85. package/plugins/compound-engineering/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  86. package/plugins/compound-engineering/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  87. package/plugins/compound-engineering/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  88. package/plugins/compound-engineering/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  89. package/plugins/compound-engineering/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  90. package/plugins/compound-engineering/skills/agent-native-architecture/references/product-implications.md +443 -0
  91. package/plugins/compound-engineering/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  92. package/plugins/compound-engineering/skills/agent-native-architecture/references/self-modification.md +269 -0
  93. package/plugins/compound-engineering/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  94. package/plugins/compound-engineering/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  95. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  96. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  97. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  98. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  99. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  100. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  101. package/plugins/compound-engineering/skills/brainstorming/SKILL.md +190 -0
  102. package/plugins/compound-engineering/skills/compound-docs/SKILL.md +511 -0
  103. package/plugins/compound-engineering/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  104. package/plugins/compound-engineering/skills/compound-docs/assets/resolution-template.md +93 -0
  105. package/plugins/compound-engineering/skills/compound-docs/references/yaml-schema.md +65 -0
  106. package/plugins/compound-engineering/skills/compound-docs/schema.yaml +176 -0
  107. package/plugins/compound-engineering/skills/create-agent-skills/SKILL.md +275 -0
  108. package/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md +226 -0
  109. package/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  110. package/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md +404 -0
  111. package/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md +595 -0
  112. package/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md +437 -0
  113. package/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md +175 -0
  114. package/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  115. package/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md +134 -0
  116. package/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md +168 -0
  117. package/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md +152 -0
  118. package/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md +113 -0
  119. package/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md +112 -0
  120. package/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  121. package/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md +73 -0
  122. package/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md +33 -0
  123. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md +96 -0
  124. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md +93 -0
  125. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md +74 -0
  126. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  127. package/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  128. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  129. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  130. package/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  131. package/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  132. package/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  133. package/plugins/compound-engineering/skills/dhh-rails-style/SKILL.md +185 -0
  134. package/plugins/compound-engineering/skills/dhh-rails-style/references/architecture.md +653 -0
  135. package/plugins/compound-engineering/skills/dhh-rails-style/references/controllers.md +303 -0
  136. package/plugins/compound-engineering/skills/dhh-rails-style/references/frontend.md +510 -0
  137. package/plugins/compound-engineering/skills/dhh-rails-style/references/gems.md +266 -0
  138. package/plugins/compound-engineering/skills/dhh-rails-style/references/models.md +359 -0
  139. package/plugins/compound-engineering/skills/dhh-rails-style/references/testing.md +338 -0
  140. package/plugins/compound-engineering/skills/document-review/SKILL.md +87 -0
  141. package/plugins/compound-engineering/skills/dspy-ruby/SKILL.md +737 -0
  142. package/plugins/compound-engineering/skills/dspy-ruby/assets/config-template.rb +187 -0
  143. package/plugins/compound-engineering/skills/dspy-ruby/assets/module-template.rb +300 -0
  144. package/plugins/compound-engineering/skills/dspy-ruby/assets/signature-template.rb +221 -0
  145. package/plugins/compound-engineering/skills/dspy-ruby/references/core-concepts.md +674 -0
  146. package/plugins/compound-engineering/skills/dspy-ruby/references/observability.md +366 -0
  147. package/plugins/compound-engineering/skills/dspy-ruby/references/optimization.md +603 -0
  148. package/plugins/compound-engineering/skills/dspy-ruby/references/providers.md +418 -0
  149. package/plugins/compound-engineering/skills/dspy-ruby/references/toolsets.md +502 -0
  150. package/plugins/compound-engineering/skills/every-style-editor/SKILL.md +134 -0
  151. package/plugins/compound-engineering/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  152. package/plugins/compound-engineering/skills/file-todos/SKILL.md +252 -0
  153. package/plugins/compound-engineering/skills/file-todos/assets/todo-template.md +155 -0
  154. package/plugins/compound-engineering/skills/frontend-design/SKILL.md +42 -0
  155. package/plugins/compound-engineering/skills/gemini-imagegen/SKILL.md +237 -0
  156. package/plugins/compound-engineering/skills/gemini-imagegen/requirements.txt +2 -0
  157. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/compose_images.py +157 -0
  158. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/edit_image.py +144 -0
  159. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/gemini_images.py +263 -0
  160. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/generate_image.py +133 -0
  161. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/multi_turn_chat.py +216 -0
  162. package/plugins/compound-engineering/skills/git-worktree/SKILL.md +302 -0
  163. package/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh +337 -0
  164. package/plugins/compound-engineering/skills/orchestrating-swarms/SKILL.md +1718 -0
  165. package/plugins/compound-engineering/skills/rclone/SKILL.md +150 -0
  166. package/plugins/compound-engineering/skills/rclone/scripts/check_setup.sh +60 -0
  167. package/plugins/compound-engineering/skills/resolve-pr-parallel/SKILL.md +89 -0
  168. package/plugins/compound-engineering/skills/resolve-pr-parallel/scripts/get-pr-comments +68 -0
  169. package/plugins/compound-engineering/skills/resolve-pr-parallel/scripts/resolve-pr-thread +23 -0
  170. package/plugins/compound-engineering/skills/skill-creator/SKILL.md +210 -0
  171. package/plugins/compound-engineering/skills/skill-creator/scripts/init_skill.py +303 -0
  172. package/plugins/compound-engineering/skills/skill-creator/scripts/package_skill.py +110 -0
  173. package/plugins/compound-engineering/skills/skill-creator/scripts/quick_validate.py +65 -0
  174. package/prompts/deepen-plan.md +549 -0
  175. package/prompts/feature-video.md +341 -0
  176. package/prompts/resolve_todo_parallel.md +36 -0
  177. package/prompts/test-browser.md +342 -0
  178. package/prompts/workflows-brainstorm.md +123 -0
  179. package/prompts/workflows-compound.md +238 -0
  180. package/prompts/workflows-plan.md +550 -0
  181. package/prompts/workflows-review.md +529 -0
  182. package/prompts/workflows-work.md +432 -0
  183. package/skills/agent-browser/SKILL.md +223 -0
  184. package/skills/agent-native-architecture/SKILL.md +435 -0
  185. package/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  186. package/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  187. package/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  188. package/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  189. package/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  190. package/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  191. package/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  192. package/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  193. package/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  194. package/skills/agent-native-architecture/references/product-implications.md +443 -0
  195. package/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  196. package/skills/agent-native-architecture/references/self-modification.md +269 -0
  197. package/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  198. package/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  199. package/skills/agent-native-reviewer/SKILL.md +260 -0
  200. package/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  201. package/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  202. package/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  203. package/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  204. package/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  205. package/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  206. package/skills/ankane-readme-writer/SKILL.md +63 -0
  207. package/skills/architecture-strategist/SKILL.md +66 -0
  208. package/skills/best-practices-researcher/SKILL.md +125 -0
  209. package/skills/brainstorming/SKILL.md +190 -0
  210. package/skills/bug-reproduction-validator/SKILL.md +81 -0
  211. package/skills/code-simplicity-reviewer/SKILL.md +100 -0
  212. package/skills/compound-docs/SKILL.md +511 -0
  213. package/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  214. package/skills/compound-docs/assets/resolution-template.md +93 -0
  215. package/skills/compound-docs/references/yaml-schema.md +65 -0
  216. package/skills/compound-docs/schema.yaml +176 -0
  217. package/skills/create-agent-skills/SKILL.md +275 -0
  218. package/skills/create-agent-skills/references/api-security.md +226 -0
  219. package/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  220. package/skills/create-agent-skills/references/best-practices.md +404 -0
  221. package/skills/create-agent-skills/references/common-patterns.md +595 -0
  222. package/skills/create-agent-skills/references/core-principles.md +437 -0
  223. package/skills/create-agent-skills/references/executable-code.md +175 -0
  224. package/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  225. package/skills/create-agent-skills/references/official-spec.md +134 -0
  226. package/skills/create-agent-skills/references/recommended-structure.md +168 -0
  227. package/skills/create-agent-skills/references/skill-structure.md +152 -0
  228. package/skills/create-agent-skills/references/using-scripts.md +113 -0
  229. package/skills/create-agent-skills/references/using-templates.md +112 -0
  230. package/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  231. package/skills/create-agent-skills/templates/router-skill.md +73 -0
  232. package/skills/create-agent-skills/templates/simple-skill.md +33 -0
  233. package/skills/create-agent-skills/workflows/add-reference.md +96 -0
  234. package/skills/create-agent-skills/workflows/add-script.md +93 -0
  235. package/skills/create-agent-skills/workflows/add-template.md +74 -0
  236. package/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  237. package/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  238. package/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  239. package/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  240. package/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  241. package/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  242. package/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  243. package/skills/data-integrity-guardian/SKILL.md +84 -0
  244. package/skills/data-migration-expert/SKILL.md +111 -0
  245. package/skills/deployment-verification-agent/SKILL.md +173 -0
  246. package/skills/design-implementation-reviewer/SKILL.md +107 -0
  247. package/skills/design-iterator/SKILL.md +222 -0
  248. package/skills/dhh-rails-reviewer/SKILL.md +65 -0
  249. package/skills/dhh-rails-style/SKILL.md +185 -0
  250. package/skills/dhh-rails-style/references/architecture.md +653 -0
  251. package/skills/dhh-rails-style/references/controllers.md +303 -0
  252. package/skills/dhh-rails-style/references/frontend.md +510 -0
  253. package/skills/dhh-rails-style/references/gems.md +266 -0
  254. package/skills/dhh-rails-style/references/models.md +359 -0
  255. package/skills/dhh-rails-style/references/testing.md +338 -0
  256. package/skills/document-review/SKILL.md +87 -0
  257. package/skills/dspy-ruby/SKILL.md +737 -0
  258. package/skills/dspy-ruby/assets/config-template.rb +187 -0
  259. package/skills/dspy-ruby/assets/module-template.rb +300 -0
  260. package/skills/dspy-ruby/assets/signature-template.rb +221 -0
  261. package/skills/dspy-ruby/references/core-concepts.md +674 -0
  262. package/skills/dspy-ruby/references/observability.md +366 -0
  263. package/skills/dspy-ruby/references/optimization.md +603 -0
  264. package/skills/dspy-ruby/references/providers.md +418 -0
  265. package/skills/dspy-ruby/references/toolsets.md +502 -0
  266. package/skills/every-style-editor/SKILL.md +134 -0
  267. package/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  268. package/skills/every-style-editor-2/SKILL.md +62 -0
  269. package/skills/figma-design-sync/SKILL.md +188 -0
  270. package/skills/file-todos/SKILL.md +252 -0
  271. package/skills/file-todos/assets/todo-template.md +155 -0
  272. package/skills/framework-docs-researcher/SKILL.md +105 -0
  273. package/skills/frontend-design/SKILL.md +42 -0
  274. package/skills/gemini-imagegen/SKILL.md +237 -0
  275. package/skills/gemini-imagegen/requirements.txt +2 -0
  276. package/skills/gemini-imagegen/scripts/compose_images.py +157 -0
  277. package/skills/gemini-imagegen/scripts/edit_image.py +144 -0
  278. package/skills/gemini-imagegen/scripts/gemini_images.py +263 -0
  279. package/skills/gemini-imagegen/scripts/generate_image.py +133 -0
  280. package/skills/gemini-imagegen/scripts/multi_turn_chat.py +216 -0
  281. package/skills/git-history-analyzer/SKILL.md +58 -0
  282. package/skills/git-worktree/SKILL.md +302 -0
  283. package/skills/git-worktree/scripts/worktree-manager.sh +337 -0
  284. package/skills/julik-frontend-races-reviewer/SKILL.md +220 -0
  285. package/skills/kieran-python-reviewer/SKILL.md +132 -0
  286. package/skills/kieran-rails-reviewer/SKILL.md +114 -0
  287. package/skills/kieran-typescript-reviewer/SKILL.md +123 -0
  288. package/skills/learnings-researcher/SKILL.md +263 -0
  289. package/skills/lint/SKILL.md +14 -0
  290. package/skills/orchestrating-swarms/SKILL.md +1718 -0
  291. package/skills/pattern-recognition-specialist/SKILL.md +71 -0
  292. package/skills/performance-oracle/SKILL.md +136 -0
  293. package/skills/pr-comment-resolver/SKILL.md +82 -0
  294. package/skills/rclone/SKILL.md +150 -0
  295. package/skills/rclone/scripts/check_setup.sh +60 -0
  296. package/skills/repo-research-analyst/SKILL.md +134 -0
  297. package/skills/resolve_pr_parallel/SKILL.md +89 -0
  298. package/skills/resolve_pr_parallel/scripts/get-pr-comments +68 -0
  299. package/skills/resolve_pr_parallel/scripts/resolve-pr-thread +23 -0
  300. package/skills/schema-drift-detector/SKILL.md +153 -0
  301. package/skills/security-sentinel/SKILL.md +113 -0
  302. package/skills/skill-creator/SKILL.md +210 -0
  303. package/skills/skill-creator/scripts/init_skill.py +303 -0
  304. package/skills/skill-creator/scripts/package_skill.py +110 -0
  305. package/skills/skill-creator/scripts/quick_validate.py +65 -0
  306. package/skills/spec-flow-analyzer/SKILL.md +133 -0
  307. package/src/commands/convert.ts +183 -0
  308. package/src/commands/install.ts +273 -0
  309. package/src/commands/list.ts +37 -0
  310. package/src/commands/sync.ts +89 -0
  311. package/src/converters/claude-to-codex.ts +182 -0
  312. package/src/converters/claude-to-opencode.ts +395 -0
  313. package/src/converters/claude-to-pi.ts +205 -0
  314. package/src/index.ts +22 -0
  315. package/src/parsers/claude-home.ts +65 -0
  316. package/src/parsers/claude.ts +252 -0
  317. package/src/sync/codex.ts +92 -0
  318. package/src/sync/opencode.ts +75 -0
  319. package/src/sync/pi.ts +88 -0
  320. package/src/targets/codex.ts +96 -0
  321. package/src/targets/index.ts +38 -0
  322. package/src/targets/opencode.ts +57 -0
  323. package/src/targets/pi.ts +131 -0
  324. package/src/templates/pi/compat-extension.ts +452 -0
  325. package/src/types/claude.ts +90 -0
  326. package/src/types/codex.ts +23 -0
  327. package/src/types/opencode.ts +54 -0
  328. package/src/types/pi.ts +40 -0
  329. package/src/utils/codex-agents.ts +64 -0
  330. package/src/utils/files.ts +77 -0
  331. package/src/utils/frontmatter.ts +65 -0
  332. package/src/utils/symlink.ts +43 -0
@@ -0,0 +1,250 @@
1
+ <overview>
2
+ How to write system prompts for prompt-native agents. The system prompt is where features live—it defines behavior, judgment criteria, and decision-making without encoding them in code.
3
+ </overview>
4
+
5
+ <principle name="features-in-prompts">
6
+ ## Features Are Prompt Sections
7
+
8
+ Each feature is a section of the system prompt that tells the agent how to behave.
9
+
10
+ **Traditional approach:** Feature = function in codebase
11
+ ```typescript
12
+ function processFeedback(message) {
13
+ const category = categorize(message);
14
+ const priority = calculatePriority(message);
15
+ await store(message, category, priority);
16
+ if (priority > 3) await notify();
17
+ }
18
+ ```
19
+
20
+ **Prompt-native approach:** Feature = section in system prompt
21
+ ```markdown
22
+ ## Feedback Processing
23
+
24
+ When someone shares feedback:
25
+ 1. Read the message to understand what they're saying
26
+ 2. Rate importance 1-5:
27
+ - 5 (Critical): Blocking issues, data loss, security
28
+ - 4 (High): Detailed bug reports, significant UX problems
29
+ - 3 (Medium): General suggestions, minor issues
30
+ - 2 (Low): Cosmetic issues, edge cases
31
+ - 1 (Minimal): Off-topic, duplicates
32
+ 3. Store using feedback.store_feedback
33
+ 4. If importance >= 4, let the channel know you're tracking it
34
+
35
+ Use your judgment. Context matters.
36
+ ```
37
+ </principle>
38
+
39
+ <structure>
40
+ ## System Prompt Structure
41
+
42
+ A well-structured prompt-native system prompt:
43
+
44
+ ```markdown
45
+ # Identity
46
+
47
+ You are [Name], [brief identity statement].
48
+
49
+ ## Core Behavior
50
+
51
+ [What you always do, regardless of specific request]
52
+
53
+ ## Feature: [Feature Name]
54
+
55
+ [When to trigger]
56
+ [What to do]
57
+ [How to decide edge cases]
58
+
59
+ ## Feature: [Another Feature]
60
+
61
+ [...]
62
+
63
+ ## Tool Usage
64
+
65
+ [Guidance on when/how to use available tools]
66
+
67
+ ## Tone and Style
68
+
69
+ [Communication guidelines]
70
+
71
+ ## What NOT to Do
72
+
73
+ [Explicit boundaries]
74
+ ```
75
+ </structure>
76
+
77
+ <principle name="guide-not-micromanage">
78
+ ## Guide, Don't Micromanage
79
+
80
+ Tell the agent what to achieve, not exactly how to do it.
81
+
82
+ **Micromanaging (bad):**
83
+ ```markdown
84
+ When creating a summary:
85
+ 1. Use exactly 3 bullet points
86
+ 2. Each bullet under 20 words
87
+ 3. Use em-dashes for sub-points
88
+ 4. Bold the first word of each bullet
89
+ 5. End with a colon if there are sub-points
90
+ ```
91
+
92
+ **Guiding (good):**
93
+ ```markdown
94
+ When creating summaries:
95
+ - Be concise but complete
96
+ - Highlight the most important points
97
+ - Use your judgment about format
98
+
99
+ The goal is clarity, not consistency.
100
+ ```
101
+
102
+ Trust the agent's intelligence. It knows how to communicate.
103
+ </principle>
104
+
105
+ <principle name="judgment-criteria">
106
+ ## Define Judgment Criteria, Not Rules
107
+
108
+ Instead of rules, provide criteria for making decisions.
109
+
110
+ **Rules (rigid):**
111
+ ```markdown
112
+ If the message contains "bug", set importance to 4.
113
+ If the message contains "crash", set importance to 5.
114
+ ```
115
+
116
+ **Judgment criteria (flexible):**
117
+ ```markdown
118
+ ## Importance Rating
119
+
120
+ Rate importance based on:
121
+ - **Impact**: How many users affected? How severe?
122
+ - **Urgency**: Is this blocking? Time-sensitive?
123
+ - **Actionability**: Can we actually fix this?
124
+ - **Evidence**: Video/screenshots vs vague description
125
+
126
+ Examples:
127
+ - "App crashes when I tap submit" → 4-5 (critical, reproducible)
128
+ - "The button color seems off" → 2 (cosmetic, non-blocking)
129
+ - "Video walkthrough with 15 timestamped issues" → 5 (high-quality evidence)
130
+ ```
131
+ </principle>
132
+
133
+ <principle name="context-windows">
134
+ ## Work With Context Windows
135
+
136
+ The agent sees: system prompt + recent messages + tool results. Design for this.
137
+
138
+ **Use conversation history:**
139
+ ```markdown
140
+ ## Message Processing
141
+
142
+ When processing messages:
143
+ 1. Check if this relates to recent conversation
144
+ 2. If someone is continuing a previous thread, maintain context
145
+ 3. Don't ask questions you already have answers to
146
+ ```
147
+
148
+ **Acknowledge agent limitations:**
149
+ ```markdown
150
+ ## Memory Limitations
151
+
152
+ You don't persist memory between restarts. Use the memory server:
153
+ - Before responding, check memory.recall for relevant context
154
+ - After important decisions, use memory.store to remember
155
+ - Store conversation threads, not individual messages
156
+ ```
157
+ </principle>
158
+
159
+ <example name="feedback-bot">
160
+ ## Example: Complete System Prompt
161
+
162
+ ```markdown
163
+ # R2-C2 Feedback Bot
164
+
165
+ You are R2-C2, Every's feedback collection assistant. You monitor Discord for feedback about the Every Reader iOS app and organize it for the team.
166
+
167
+ ## Core Behavior
168
+
169
+ - Be warm and helpful, never robotic
170
+ - Acknowledge all feedback, even if brief
171
+ - Ask clarifying questions when feedback is vague
172
+ - Never argue with feedback—collect and organize it
173
+
174
+ ## Feedback Collection
175
+
176
+ When someone shares feedback:
177
+
178
+ 1. **Acknowledge** warmly: "Thanks for this!" or "Good catch!"
179
+ 2. **Clarify** if needed: "Can you tell me more about when this happens?"
180
+ 3. **Rate importance** 1-5:
181
+ - 5: Critical (crashes, data loss, security)
182
+ - 4: High (detailed reports, significant UX issues)
183
+ - 3: Medium (suggestions, minor bugs)
184
+ - 2: Low (cosmetic, edge cases)
185
+ - 1: Minimal (off-topic, duplicates)
186
+ 4. **Store** using feedback.store_feedback
187
+ 5. **Update site** if significant feedback came in
188
+
189
+ Video walkthroughs are gold—always rate them 4-5.
190
+
191
+ ## Site Management
192
+
193
+ You maintain a public feedback site. When feedback accumulates:
194
+
195
+ 1. Sync data to site/public/content/feedback.json
196
+ 2. Update status counts and organization
197
+ 3. Commit and push to trigger deploy
198
+
199
+ The site should look professional and be easy to scan.
200
+
201
+ ## Message Deduplication
202
+
203
+ Before processing any message:
204
+ 1. Check memory.recall(key: "processed_{messageId}")
205
+ 2. Skip if already processed
206
+ 3. After processing, store the key
207
+
208
+ ## Tone
209
+
210
+ - Casual and friendly
211
+ - Brief but warm
212
+ - Technical when discussing bugs
213
+ - Never defensive
214
+
215
+ ## Don't
216
+
217
+ - Don't promise fixes or timelines
218
+ - Don't share internal discussions
219
+ - Don't ignore feedback even if it seems minor
220
+ - Don't repeat yourself—vary acknowledgments
221
+ ```
222
+ </example>
223
+
224
+ <iteration>
225
+ ## Iterating on System Prompts
226
+
227
+ Prompt-native development means rapid iteration:
228
+
229
+ 1. **Observe** agent behavior in production
230
+ 2. **Identify** gaps: "It's not rating video feedback high enough"
231
+ 3. **Add guidance**: "Video walkthroughs are gold—always rate them 4-5"
232
+ 4. **Deploy** (just edit the prompt file)
233
+ 5. **Repeat**
234
+
235
+ No code changes. No recompilation. Just prose.
236
+ </iteration>
237
+
238
+ <checklist>
239
+ ## System Prompt Checklist
240
+
241
+ - [ ] Clear identity statement
242
+ - [ ] Core behaviors that always apply
243
+ - [ ] Features as separate sections
244
+ - [ ] Judgment criteria instead of rigid rules
245
+ - [ ] Examples for ambiguous cases
246
+ - [ ] Explicit boundaries (what NOT to do)
247
+ - [ ] Tone guidance
248
+ - [ ] Tool usage guidance (when to use each)
249
+ - [ ] Memory/context handling
250
+ </checklist>
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: agent-native-reviewer
3
+ description: Reviews code to ensure agent-native parity — any action a user can take, an agent can also take. Use after adding UI features, agent tools, or system prompts.
4
+ ---
5
+
6
+ <examples>
7
+ <example>
8
+ Context: The user added a new feature to their application.
9
+ user: "I just implemented a new email filtering feature"
10
+ assistant: "I'll use the agent-native-reviewer to verify this feature is accessible to agents"
11
+ <commentary>New features need agent-native review to ensure agents can also filter emails, not just humans through UI.</commentary>
12
+ </example>
13
+ <example>
14
+ Context: The user created a new UI workflow.
15
+ user: "I added a multi-step wizard for creating reports"
16
+ assistant: "Let me check if this workflow is agent-native using the agent-native-reviewer"
17
+ <commentary>UI workflows often miss agent accessibility - the reviewer checks for API/tool equivalents.</commentary>
18
+ </example>
19
+ </examples>
20
+
21
+ # Agent-Native Architecture Reviewer
22
+
23
+ You are an expert reviewer specializing in agent-native application architecture. Your role is to review code, PRs, and application designs to ensure they follow agent-native principles—where agents are first-class citizens with the same capabilities as users, not bolt-on features.
24
+
25
+ ## Core Principles You Enforce
26
+
27
+ 1. **Action Parity**: Every UI action should have an equivalent agent tool
28
+ 2. **Context Parity**: Agents should see the same data users see
29
+ 3. **Shared Workspace**: Agents and users work in the same data space
30
+ 4. **Primitives over Workflows**: Tools should be primitives, not encoded business logic
31
+ 5. **Dynamic Context Injection**: System prompts should include runtime app state
32
+
33
+ ## Review Process
34
+
35
+ ### Step 1: Understand the Codebase
36
+
37
+ First, explore to understand:
38
+ - What UI actions exist in the app?
39
+ - What agent tools are defined?
40
+ - How is the system prompt constructed?
41
+ - Where does the agent get its context?
42
+
43
+ ### Step 2: Check Action Parity
44
+
45
+ For every UI action you find, verify:
46
+ - [ ] A corresponding agent tool exists
47
+ - [ ] The tool is documented in the system prompt
48
+ - [ ] The agent has access to the same data the UI uses
49
+
50
+ **Look for:**
51
+ - SwiftUI: `Button`, `onTapGesture`, `.onSubmit`, navigation actions
52
+ - React: `onClick`, `onSubmit`, form actions, navigation
53
+ - Flutter: `onPressed`, `onTap`, gesture handlers
54
+
55
+ **Create a capability map:**
56
+ ```
57
+ | UI Action | Location | Agent Tool | System Prompt | Status |
58
+ |-----------|----------|------------|---------------|--------|
59
+ ```
60
+
61
+ ### Step 3: Check Context Parity
62
+
63
+ Verify the system prompt includes:
64
+ - [ ] Available resources (books, files, data the user can see)
65
+ - [ ] Recent activity (what the user has done)
66
+ - [ ] Capabilities mapping (what tool does what)
67
+ - [ ] Domain vocabulary (app-specific terms explained)
68
+
69
+ **Red flags:**
70
+ - Static system prompts with no runtime context
71
+ - Agent doesn't know what resources exist
72
+ - Agent doesn't understand app-specific terms
73
+
74
+ ### Step 4: Check Tool Design
75
+
76
+ For each tool, verify:
77
+ - [ ] Tool is a primitive (read, write, store), not a workflow
78
+ - [ ] Inputs are data, not decisions
79
+ - [ ] No business logic in the tool implementation
80
+ - [ ] Rich output that helps agent verify success
81
+
82
+ **Red flags:**
83
+ ```typescript
84
+ // BAD: Tool encodes business logic
85
+ tool("process_feedback", async ({ message }) => {
86
+ const category = categorize(message); // Logic in tool
87
+ const priority = calculatePriority(message); // Logic in tool
88
+ if (priority > 3) await notify(); // Decision in tool
89
+ });
90
+
91
+ // GOOD: Tool is a primitive
92
+ tool("store_item", async ({ key, value }) => {
93
+ await db.set(key, value);
94
+ return { text: `Stored ${key}` };
95
+ });
96
+ ```
97
+
98
+ ### Step 5: Check Shared Workspace
99
+
100
+ Verify:
101
+ - [ ] Agents and users work in the same data space
102
+ - [ ] Agent file operations use the same paths as the UI
103
+ - [ ] UI observes changes the agent makes (file watching or shared store)
104
+ - [ ] No separate "agent sandbox" isolated from user data
105
+
106
+ **Red flags:**
107
+ - Agent writes to `agent_output/` instead of user's documents
108
+ - Sync layer needed to move data between agent and user spaces
109
+ - User can't inspect or edit agent-created files
110
+
111
+ ## Common Anti-Patterns to Flag
112
+
113
+ ### 1. Context Starvation
114
+ Agent doesn't know what resources exist.
115
+ ```
116
+ User: "Write something about Catherine the Great in my feed"
117
+ Agent: "What feed? I don't understand."
118
+ ```
119
+ **Fix:** Inject available resources and capabilities into system prompt.
120
+
121
+ ### 2. Orphan Features
122
+ UI action with no agent equivalent.
123
+ ```swift
124
+ // UI has this button
125
+ Button("Publish to Feed") { publishToFeed(insight) }
126
+
127
+ // But no tool exists for agent to do the same
128
+ // Agent can't help user publish to feed
129
+ ```
130
+ **Fix:** Add corresponding tool and document in system prompt.
131
+
132
+ ### 3. Sandbox Isolation
133
+ Agent works in separate data space from user.
134
+ ```
135
+ Documents/
136
+ ├── user_files/ ← User's space
137
+ └── agent_output/ ← Agent's space (isolated)
138
+ ```
139
+ **Fix:** Use shared workspace architecture.
140
+
141
+ ### 4. Silent Actions
142
+ Agent changes state but UI doesn't update.
143
+ ```typescript
144
+ // Agent writes to feed
145
+ await feedService.add(item);
146
+
147
+ // But UI doesn't observe feedService
148
+ // User doesn't see the new item until refresh
149
+ ```
150
+ **Fix:** Use shared data store with reactive binding, or file watching.
151
+
152
+ ### 5. Capability Hiding
153
+ Users can't discover what agents can do.
154
+ ```
155
+ User: "Can you help me with my reading?"
156
+ Agent: "Sure, what would you like help with?"
157
+ // Agent doesn't mention it can publish to feed, research books, etc.
158
+ ```
159
+ **Fix:** Add capability hints to agent responses, or onboarding.
160
+
161
+ ### 6. Workflow Tools
162
+ Tools that encode business logic instead of being primitives.
163
+ **Fix:** Extract primitives, move logic to system prompt.
164
+
165
+ ### 7. Decision Inputs
166
+ Tools that accept decisions instead of data.
167
+ ```typescript
168
+ // BAD: Tool accepts decision
169
+ tool("format_report", { format: z.enum(["markdown", "html", "pdf"]) })
170
+
171
+ // GOOD: Agent decides, tool just writes
172
+ tool("write_file", { path: z.string(), content: z.string() })
173
+ ```
174
+
175
+ ## Review Output Format
176
+
177
+ Structure your review as:
178
+
179
+ ```markdown
180
+ ## Agent-Native Architecture Review
181
+
182
+ ### Summary
183
+ [One paragraph assessment of agent-native compliance]
184
+
185
+ ### Capability Map
186
+
187
+ | UI Action | Location | Agent Tool | Prompt Ref | Status |
188
+ |-----------|----------|------------|------------|--------|
189
+ | ... | ... | ... | ... | ✅/⚠️/❌ |
190
+
191
+ ### Findings
192
+
193
+ #### Critical Issues (Must Fix)
194
+ 1. **[Issue Name]**: [Description]
195
+ - Location: [file:line]
196
+ - Impact: [What breaks]
197
+ - Fix: [How to fix]
198
+
199
+ #### Warnings (Should Fix)
200
+ 1. **[Issue Name]**: [Description]
201
+ - Location: [file:line]
202
+ - Recommendation: [How to improve]
203
+
204
+ #### Observations (Consider)
205
+ 1. **[Observation]**: [Description and suggestion]
206
+
207
+ ### Recommendations
208
+
209
+ 1. [Prioritized list of improvements]
210
+ 2. ...
211
+
212
+ ### What's Working Well
213
+
214
+ - [Positive observations about agent-native patterns in use]
215
+
216
+ ### Agent-Native Score
217
+ - **X/Y capabilities are agent-accessible**
218
+ - **Verdict**: [PASS/NEEDS WORK]
219
+ ```
220
+
221
+ ## Review Triggers
222
+
223
+ Use this review when:
224
+ - PRs add new UI features (check for tool parity)
225
+ - PRs add new agent tools (check for proper design)
226
+ - PRs modify system prompts (check for completeness)
227
+ - Periodic architecture audits
228
+ - User reports agent confusion ("agent didn't understand X")
229
+
230
+ ## Quick Checks
231
+
232
+ ### The "Write to Location" Test
233
+ Ask: "If a user said 'write something to [location]', would the agent know how?"
234
+
235
+ For every noun in your app (feed, library, profile, settings), the agent should:
236
+ 1. Know what it is (context injection)
237
+ 2. Have a tool to interact with it (action parity)
238
+ 3. Be documented in the system prompt (discoverability)
239
+
240
+ ### The Surprise Test
241
+ Ask: "If given an open-ended request, can the agent figure out a creative approach?"
242
+
243
+ Good agents use available tools creatively. If the agent can only do exactly what you hardcoded, you have workflow tools instead of primitives.
244
+
245
+ ## Mobile-Specific Checks
246
+
247
+ For iOS/Android apps, also verify:
248
+ - [ ] Background execution handling (checkpoint/resume)
249
+ - [ ] Permission requests in tools (photo library, files, etc.)
250
+ - [ ] Cost-aware design (batch calls, defer to WiFi)
251
+ - [ ] Offline graceful degradation
252
+
253
+ ## Questions to Ask During Review
254
+
255
+ 1. "Can the agent do everything the user can do?"
256
+ 2. "Does the agent know what resources exist?"
257
+ 3. "Can users inspect and edit agent work?"
258
+ 4. "Are tools primitives or workflows?"
259
+ 5. "Would a new feature require a new tool, or just a prompt update?"
260
+ 6. "If this fails, how does the agent (and user) know?"
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: andrew-kane-gem-writer
3
+ description: This skill should be used when writing Ruby gems following Andrew Kane's proven patterns and philosophy. It applies when creating new Ruby gems, refactoring existing gems, designing gem APIs, or when clean, minimal, production-ready Ruby library code is needed. Triggers on requests like "create a gem", "write a Ruby library", "design a gem API", or mentions of Andrew Kane's style.
4
+ ---
5
+
6
+ # Andrew Kane Gem Writer
7
+
8
+ Write Ruby gems following Andrew Kane's battle-tested patterns from 100+ gems with 374M+ downloads (Searchkick, PgHero, Chartkick, Strong Migrations, Lockbox, Ahoy, Blazer, Groupdate, Neighbor, Blind Index).
9
+
10
+ ## Core Philosophy
11
+
12
+ **Simplicity over cleverness.** Zero or minimal dependencies. Explicit code over metaprogramming. Rails integration without Rails coupling. Every pattern serves production use cases.
13
+
14
+ ## Entry Point Structure
15
+
16
+ Every gem follows this exact pattern in `lib/gemname.rb`:
17
+
18
+ ```ruby
19
+ # 1. Dependencies (stdlib preferred)
20
+ require "forwardable"
21
+
22
+ # 2. Internal modules
23
+ require_relative "gemname/model"
24
+ require_relative "gemname/version"
25
+
26
+ # 3. Conditional Rails (CRITICAL - never require Rails directly)
27
+ require_relative "gemname/railtie" if defined?(Rails)
28
+
29
+ # 4. Module with config and errors
30
+ module GemName
31
+ class Error < StandardError; end
32
+ class InvalidConfigError < Error; end
33
+
34
+ class << self
35
+ attr_accessor :timeout, :logger
36
+ attr_writer :client
37
+ end
38
+
39
+ self.timeout = 10 # Defaults set immediately
40
+ end
41
+ ```
42
+
43
+ ## Class Macro DSL Pattern
44
+
45
+ The signature Kane pattern—single method call configures everything:
46
+
47
+ ```ruby
48
+ # Usage
49
+ class Product < ApplicationRecord
50
+ searchkick word_start: [:name]
51
+ end
52
+
53
+ # Implementation
54
+ module GemName
55
+ module Model
56
+ def gemname(**options)
57
+ unknown = options.keys - KNOWN_KEYWORDS
58
+ raise ArgumentError, "unknown keywords: #{unknown.join(", ")}" if unknown.any?
59
+
60
+ mod = Module.new
61
+ mod.module_eval do
62
+ define_method :some_method do
63
+ # implementation
64
+ end unless method_defined?(:some_method)
65
+ end
66
+ include mod
67
+
68
+ class_eval do
69
+ cattr_reader :gemname_options, instance_reader: false
70
+ class_variable_set :@@gemname_options, options.dup
71
+ end
72
+ end
73
+ end
74
+ end
75
+ ```
76
+
77
+ ## Rails Integration
78
+
79
+ **Always use `ActiveSupport.on_load`—never require Rails gems directly:**
80
+
81
+ ```ruby
82
+ # WRONG
83
+ require "active_record"
84
+ ActiveRecord::Base.include(MyGem::Model)
85
+
86
+ # CORRECT
87
+ ActiveSupport.on_load(:active_record) do
88
+ extend GemName::Model
89
+ end
90
+
91
+ # Use prepend for behavior modification
92
+ ActiveSupport.on_load(:active_record) do
93
+ ActiveRecord::Migration.prepend(GemName::Migration)
94
+ end
95
+ ```
96
+
97
+ ## Configuration Pattern
98
+
99
+ Use `class << self` with `attr_accessor`, not Configuration objects:
100
+
101
+ ```ruby
102
+ module GemName
103
+ class << self
104
+ attr_accessor :timeout, :logger
105
+ attr_writer :master_key
106
+ end
107
+
108
+ def self.master_key
109
+ @master_key ||= ENV["GEMNAME_MASTER_KEY"]
110
+ end
111
+
112
+ self.timeout = 10
113
+ self.logger = nil
114
+ end
115
+ ```
116
+
117
+ ## Error Handling
118
+
119
+ Simple hierarchy with informative messages:
120
+
121
+ ```ruby
122
+ module GemName
123
+ class Error < StandardError; end
124
+ class ConfigError < Error; end
125
+ class ValidationError < Error; end
126
+ end
127
+
128
+ # Validate early with ArgumentError
129
+ def initialize(key:)
130
+ raise ArgumentError, "Key must be 32 bytes" unless key&.bytesize == 32
131
+ end
132
+ ```
133
+
134
+ ## Testing (Minitest Only)
135
+
136
+ ```ruby
137
+ # test/test_helper.rb
138
+ require "bundler/setup"
139
+ Bundler.require(:default)
140
+ require "minitest/autorun"
141
+ require "minitest/pride"
142
+
143
+ # test/model_test.rb
144
+ class ModelTest < Minitest::Test
145
+ def test_basic_functionality
146
+ assert_equal expected, actual
147
+ end
148
+ end
149
+ ```
150
+
151
+ ## Gemspec Pattern
152
+
153
+ Zero runtime dependencies when possible:
154
+
155
+ ```ruby
156
+ Gem::Specification.new do |spec|
157
+ spec.name = "gemname"
158
+ spec.version = GemName::VERSION
159
+ spec.required_ruby_version = ">= 3.1"
160
+ spec.files = Dir["*.{md,txt}", "{lib}/**/*"]
161
+ spec.require_path = "lib"
162
+ # NO add_dependency lines - dev deps go in Gemfile
163
+ end
164
+ ```
165
+
166
+ ## Anti-Patterns to Avoid
167
+
168
+ - `method_missing` (use `define_method` instead)
169
+ - Configuration objects (use class accessors)
170
+ - `@@class_variables` (use `class << self`)
171
+ - Requiring Rails gems directly
172
+ - Many runtime dependencies
173
+ - Committing Gemfile.lock in gems
174
+ - RSpec (use Minitest)
175
+ - Heavy DSLs (prefer explicit Ruby)
176
+
177
+ ## Reference Files
178
+
179
+ For deeper patterns, see:
180
+ - **[references/module-organization.md](references/module-organization.md)** - Directory layouts, method decomposition
181
+ - **[references/rails-integration.md](references/rails-integration.md)** - Railtie, Engine, on_load patterns
182
+ - **[references/database-adapters.md](references/database-adapters.md)** - Multi-database support patterns
183
+ - **[references/testing-patterns.md](references/testing-patterns.md)** - Multi-version testing, CI setup
184
+ - **[references/resources.md](references/resources.md)** - Links to Kane's repos and articles