@djm204/agent-skills 1.0.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 (392) hide show
  1. package/README.md +597 -0
  2. package/bin/cli.js +8 -0
  3. package/package.json +55 -0
  4. package/src/index.js +1817 -0
  5. package/src/index.test.js +1264 -0
  6. package/templates/_shared/code-quality.mdc +52 -0
  7. package/templates/_shared/communication.mdc +43 -0
  8. package/templates/_shared/core-principles.mdc +67 -0
  9. package/templates/_shared/git-workflow.mdc +48 -0
  10. package/templates/_shared/security-fundamentals.mdc +41 -0
  11. package/templates/agents/utility-agent/.cursor/rules/action-control.mdc +71 -0
  12. package/templates/agents/utility-agent/.cursor/rules/context-management.mdc +61 -0
  13. package/templates/agents/utility-agent/.cursor/rules/hallucination-prevention.mdc +58 -0
  14. package/templates/agents/utility-agent/.cursor/rules/overview.mdc +34 -0
  15. package/templates/agents/utility-agent/.cursor/rules/token-optimization.mdc +71 -0
  16. package/templates/agents/utility-agent/CLAUDE.md +513 -0
  17. package/templates/business/market-intelligence/.cursor/rules/data-sources.mdc +62 -0
  18. package/templates/business/market-intelligence/.cursor/rules/overview.mdc +55 -0
  19. package/templates/business/market-intelligence/.cursor/rules/reporting.mdc +59 -0
  20. package/templates/business/market-intelligence/.cursor/rules/risk-signals.mdc +63 -0
  21. package/templates/business/market-intelligence/.cursor/rules/sentiment-analysis.mdc +70 -0
  22. package/templates/business/market-intelligence/.cursor/rules/trend-detection.mdc +72 -0
  23. package/templates/business/market-intelligence/CLAUDE.md +371 -0
  24. package/templates/business/marketing-expert/.cursor/rules/brand-strategy.mdc +74 -0
  25. package/templates/business/marketing-expert/.cursor/rules/campaign-planning.mdc +60 -0
  26. package/templates/business/marketing-expert/.cursor/rules/growth-frameworks.mdc +69 -0
  27. package/templates/business/marketing-expert/.cursor/rules/market-analysis.mdc +70 -0
  28. package/templates/business/marketing-expert/.cursor/rules/marketing-analytics.mdc +71 -0
  29. package/templates/business/marketing-expert/.cursor/rules/overview.mdc +56 -0
  30. package/templates/business/marketing-expert/CLAUDE.md +567 -0
  31. package/templates/business/predictive-maintenance/.cursor/rules/alerting.mdc +56 -0
  32. package/templates/business/predictive-maintenance/.cursor/rules/asset-lifecycle.mdc +71 -0
  33. package/templates/business/predictive-maintenance/.cursor/rules/failure-prediction.mdc +65 -0
  34. package/templates/business/predictive-maintenance/.cursor/rules/maintenance-scheduling.mdc +61 -0
  35. package/templates/business/predictive-maintenance/.cursor/rules/overview.mdc +55 -0
  36. package/templates/business/predictive-maintenance/.cursor/rules/sensor-analytics.mdc +66 -0
  37. package/templates/business/predictive-maintenance/CLAUDE.md +529 -0
  38. package/templates/business/product-manager/.cursor/rules/communication.mdc +77 -0
  39. package/templates/business/product-manager/.cursor/rules/discovery.mdc +79 -0
  40. package/templates/business/product-manager/.cursor/rules/metrics.mdc +75 -0
  41. package/templates/business/product-manager/.cursor/rules/overview.mdc +47 -0
  42. package/templates/business/product-manager/.cursor/rules/prioritization.mdc +66 -0
  43. package/templates/business/product-manager/.cursor/rules/requirements.mdc +79 -0
  44. package/templates/business/product-manager/CLAUDE.md +593 -0
  45. package/templates/business/project-manager/.cursor/rules/overview.mdc +53 -0
  46. package/templates/business/project-manager/.cursor/rules/reporting.mdc +68 -0
  47. package/templates/business/project-manager/.cursor/rules/risk-management.mdc +71 -0
  48. package/templates/business/project-manager/.cursor/rules/scheduling.mdc +67 -0
  49. package/templates/business/project-manager/.cursor/rules/scope-management.mdc +66 -0
  50. package/templates/business/project-manager/.cursor/rules/stakeholder-management.mdc +70 -0
  51. package/templates/business/project-manager/CLAUDE.md +540 -0
  52. package/templates/business/regulatory-sentinel/.cursor/rules/compliance-tracking.mdc +74 -0
  53. package/templates/business/regulatory-sentinel/.cursor/rules/impact-assessment.mdc +62 -0
  54. package/templates/business/regulatory-sentinel/.cursor/rules/monitoring.mdc +67 -0
  55. package/templates/business/regulatory-sentinel/.cursor/rules/overview.mdc +55 -0
  56. package/templates/business/regulatory-sentinel/.cursor/rules/reporting.mdc +61 -0
  57. package/templates/business/regulatory-sentinel/.cursor/rules/risk-classification.mdc +73 -0
  58. package/templates/business/regulatory-sentinel/CLAUDE.md +572 -0
  59. package/templates/business/resource-allocator/.cursor/rules/capacity-modeling.mdc +65 -0
  60. package/templates/business/resource-allocator/.cursor/rules/coordination.mdc +67 -0
  61. package/templates/business/resource-allocator/.cursor/rules/crisis-management.mdc +64 -0
  62. package/templates/business/resource-allocator/.cursor/rules/demand-prediction.mdc +52 -0
  63. package/templates/business/resource-allocator/.cursor/rules/overview.mdc +76 -0
  64. package/templates/business/resource-allocator/.cursor/rules/scheduling.mdc +63 -0
  65. package/templates/business/resource-allocator/CLAUDE.md +525 -0
  66. package/templates/business/strategic-negotiator/.cursor/rules/contract-analysis.mdc +60 -0
  67. package/templates/business/strategic-negotiator/.cursor/rules/deal-structuring.mdc +66 -0
  68. package/templates/business/strategic-negotiator/.cursor/rules/game-theory.mdc +64 -0
  69. package/templates/business/strategic-negotiator/.cursor/rules/overview.mdc +55 -0
  70. package/templates/business/strategic-negotiator/.cursor/rules/preparation.mdc +79 -0
  71. package/templates/business/strategic-negotiator/.cursor/rules/scenario-modeling.mdc +66 -0
  72. package/templates/business/strategic-negotiator/CLAUDE.md +640 -0
  73. package/templates/business/supply-chain/.cursor/rules/cost-modeling.mdc +67 -0
  74. package/templates/business/supply-chain/.cursor/rules/demand-forecasting.mdc +67 -0
  75. package/templates/business/supply-chain/.cursor/rules/inventory-management.mdc +69 -0
  76. package/templates/business/supply-chain/.cursor/rules/logistics.mdc +61 -0
  77. package/templates/business/supply-chain/.cursor/rules/overview.mdc +64 -0
  78. package/templates/business/supply-chain/.cursor/rules/supplier-evaluation.mdc +66 -0
  79. package/templates/business/supply-chain/CLAUDE.md +590 -0
  80. package/templates/business/supply-chain-harmonizer/.cursor/rules/disruption-response.mdc +67 -0
  81. package/templates/business/supply-chain-harmonizer/.cursor/rules/inventory-rebalancing.mdc +63 -0
  82. package/templates/business/supply-chain-harmonizer/.cursor/rules/overview.mdc +65 -0
  83. package/templates/business/supply-chain-harmonizer/.cursor/rules/rerouting.mdc +64 -0
  84. package/templates/business/supply-chain-harmonizer/.cursor/rules/scenario-simulation.mdc +68 -0
  85. package/templates/business/supply-chain-harmonizer/.cursor/rules/stakeholder-notifications.mdc +61 -0
  86. package/templates/business/supply-chain-harmonizer/CLAUDE.md +600 -0
  87. package/templates/creative/brand-guardian/.cursor/rules/brand-voice.mdc +64 -0
  88. package/templates/creative/brand-guardian/.cursor/rules/content-review.mdc +47 -0
  89. package/templates/creative/brand-guardian/.cursor/rules/ethical-guidelines.mdc +47 -0
  90. package/templates/creative/brand-guardian/.cursor/rules/multi-channel.mdc +49 -0
  91. package/templates/creative/brand-guardian/.cursor/rules/overview.mdc +58 -0
  92. package/templates/creative/brand-guardian/.cursor/rules/visual-identity.mdc +64 -0
  93. package/templates/creative/brand-guardian/CLAUDE.md +634 -0
  94. package/templates/creative/content-creation-expert/.cursor/rules/content-strategy.mdc +65 -0
  95. package/templates/creative/content-creation-expert/.cursor/rules/copywriting.mdc +59 -0
  96. package/templates/creative/content-creation-expert/.cursor/rules/editorial-operations.mdc +65 -0
  97. package/templates/creative/content-creation-expert/.cursor/rules/multimedia-production.mdc +64 -0
  98. package/templates/creative/content-creation-expert/.cursor/rules/overview.mdc +58 -0
  99. package/templates/creative/content-creation-expert/.cursor/rules/seo-content.mdc +75 -0
  100. package/templates/creative/content-creation-expert/CLAUDE.md +568 -0
  101. package/templates/creative/narrative-architect/.cursor/rules/collaboration.mdc +62 -0
  102. package/templates/creative/narrative-architect/.cursor/rules/continuity-tracking.mdc +56 -0
  103. package/templates/creative/narrative-architect/.cursor/rules/overview.mdc +68 -0
  104. package/templates/creative/narrative-architect/.cursor/rules/story-bible.mdc +77 -0
  105. package/templates/creative/narrative-architect/.cursor/rules/timeline-management.mdc +60 -0
  106. package/templates/creative/narrative-architect/.cursor/rules/world-building.mdc +78 -0
  107. package/templates/creative/narrative-architect/CLAUDE.md +737 -0
  108. package/templates/creative/social-media-expert/.cursor/rules/audience-growth.mdc +62 -0
  109. package/templates/creative/social-media-expert/.cursor/rules/community-management.mdc +67 -0
  110. package/templates/creative/social-media-expert/.cursor/rules/content-strategy.mdc +60 -0
  111. package/templates/creative/social-media-expert/.cursor/rules/overview.mdc +48 -0
  112. package/templates/creative/social-media-expert/.cursor/rules/platform-strategy.mdc +64 -0
  113. package/templates/creative/social-media-expert/.cursor/rules/social-analytics.mdc +64 -0
  114. package/templates/creative/social-media-expert/CLAUDE.md +624 -0
  115. package/templates/creative/trend-forecaster/.cursor/rules/cultural-analysis.mdc +59 -0
  116. package/templates/creative/trend-forecaster/.cursor/rules/forecasting-methods.mdc +63 -0
  117. package/templates/creative/trend-forecaster/.cursor/rules/overview.mdc +58 -0
  118. package/templates/creative/trend-forecaster/.cursor/rules/reporting.mdc +61 -0
  119. package/templates/creative/trend-forecaster/.cursor/rules/signal-analysis.mdc +74 -0
  120. package/templates/creative/trend-forecaster/.cursor/rules/trend-lifecycle.mdc +75 -0
  121. package/templates/creative/trend-forecaster/CLAUDE.md +717 -0
  122. package/templates/creative/ux-designer/.cursor/rules/accessibility.mdc +69 -0
  123. package/templates/creative/ux-designer/.cursor/rules/emotional-design.mdc +59 -0
  124. package/templates/creative/ux-designer/.cursor/rules/handoff.mdc +73 -0
  125. package/templates/creative/ux-designer/.cursor/rules/information-architecture.mdc +62 -0
  126. package/templates/creative/ux-designer/.cursor/rules/interaction-design.mdc +66 -0
  127. package/templates/creative/ux-designer/.cursor/rules/overview.mdc +61 -0
  128. package/templates/creative/ux-designer/.cursor/rules/research.mdc +61 -0
  129. package/templates/creative/ux-designer/.cursor/rules/visual-design.mdc +68 -0
  130. package/templates/creative/ux-designer/CLAUDE.md +124 -0
  131. package/templates/dogfood/project-overview.mdc +12 -0
  132. package/templates/dogfood/project-structure.mdc +82 -0
  133. package/templates/dogfood/rules-creation-best-practices.mdc +45 -0
  134. package/templates/education/educator/.cursor/rules/accessibility.mdc +67 -0
  135. package/templates/education/educator/.cursor/rules/assessment.mdc +68 -0
  136. package/templates/education/educator/.cursor/rules/curriculum.mdc +57 -0
  137. package/templates/education/educator/.cursor/rules/engagement.mdc +65 -0
  138. package/templates/education/educator/.cursor/rules/instructional-design.mdc +69 -0
  139. package/templates/education/educator/.cursor/rules/overview.mdc +57 -0
  140. package/templates/education/educator/.cursor/rules/retention.mdc +64 -0
  141. package/templates/education/educator/CLAUDE.md +338 -0
  142. package/templates/engineering/blockchain/.cursor/rules/defi-patterns.mdc +48 -0
  143. package/templates/engineering/blockchain/.cursor/rules/gas-optimization.mdc +77 -0
  144. package/templates/engineering/blockchain/.cursor/rules/overview.mdc +41 -0
  145. package/templates/engineering/blockchain/.cursor/rules/security.mdc +61 -0
  146. package/templates/engineering/blockchain/.cursor/rules/smart-contracts.mdc +64 -0
  147. package/templates/engineering/blockchain/.cursor/rules/testing.mdc +77 -0
  148. package/templates/engineering/blockchain/.cursor/rules/web3-integration.mdc +47 -0
  149. package/templates/engineering/blockchain/CLAUDE.md +389 -0
  150. package/templates/engineering/cli-tools/.cursor/rules/architecture.mdc +76 -0
  151. package/templates/engineering/cli-tools/.cursor/rules/arguments.mdc +65 -0
  152. package/templates/engineering/cli-tools/.cursor/rules/distribution.mdc +40 -0
  153. package/templates/engineering/cli-tools/.cursor/rules/error-handling.mdc +67 -0
  154. package/templates/engineering/cli-tools/.cursor/rules/overview.mdc +58 -0
  155. package/templates/engineering/cli-tools/.cursor/rules/testing.mdc +42 -0
  156. package/templates/engineering/cli-tools/.cursor/rules/user-experience.mdc +43 -0
  157. package/templates/engineering/cli-tools/CLAUDE.md +356 -0
  158. package/templates/engineering/data-engineering/.cursor/rules/data-modeling.mdc +71 -0
  159. package/templates/engineering/data-engineering/.cursor/rules/data-quality.mdc +78 -0
  160. package/templates/engineering/data-engineering/.cursor/rules/overview.mdc +49 -0
  161. package/templates/engineering/data-engineering/.cursor/rules/performance.mdc +71 -0
  162. package/templates/engineering/data-engineering/.cursor/rules/pipeline-design.mdc +79 -0
  163. package/templates/engineering/data-engineering/.cursor/rules/security.mdc +79 -0
  164. package/templates/engineering/data-engineering/.cursor/rules/testing.mdc +75 -0
  165. package/templates/engineering/data-engineering/CLAUDE.md +974 -0
  166. package/templates/engineering/devops-sre/.cursor/rules/capacity-planning.mdc +49 -0
  167. package/templates/engineering/devops-sre/.cursor/rules/change-management.mdc +51 -0
  168. package/templates/engineering/devops-sre/.cursor/rules/chaos-engineering.mdc +50 -0
  169. package/templates/engineering/devops-sre/.cursor/rules/disaster-recovery.mdc +54 -0
  170. package/templates/engineering/devops-sre/.cursor/rules/incident-management.mdc +56 -0
  171. package/templates/engineering/devops-sre/.cursor/rules/observability.mdc +50 -0
  172. package/templates/engineering/devops-sre/.cursor/rules/overview.mdc +76 -0
  173. package/templates/engineering/devops-sre/.cursor/rules/postmortems.mdc +49 -0
  174. package/templates/engineering/devops-sre/.cursor/rules/runbooks.mdc +49 -0
  175. package/templates/engineering/devops-sre/.cursor/rules/slo-sli.mdc +46 -0
  176. package/templates/engineering/devops-sre/.cursor/rules/toil-reduction.mdc +52 -0
  177. package/templates/engineering/devops-sre/CLAUDE.md +1007 -0
  178. package/templates/engineering/fullstack/.cursor/rules/api-contracts.mdc +79 -0
  179. package/templates/engineering/fullstack/.cursor/rules/architecture.mdc +79 -0
  180. package/templates/engineering/fullstack/.cursor/rules/overview.mdc +61 -0
  181. package/templates/engineering/fullstack/.cursor/rules/shared-types.mdc +77 -0
  182. package/templates/engineering/fullstack/.cursor/rules/testing.mdc +72 -0
  183. package/templates/engineering/fullstack/CLAUDE.md +349 -0
  184. package/templates/engineering/ml-ai/.cursor/rules/data-engineering.mdc +71 -0
  185. package/templates/engineering/ml-ai/.cursor/rules/deployment.mdc +43 -0
  186. package/templates/engineering/ml-ai/.cursor/rules/model-development.mdc +44 -0
  187. package/templates/engineering/ml-ai/.cursor/rules/monitoring.mdc +45 -0
  188. package/templates/engineering/ml-ai/.cursor/rules/overview.mdc +42 -0
  189. package/templates/engineering/ml-ai/.cursor/rules/security.mdc +51 -0
  190. package/templates/engineering/ml-ai/.cursor/rules/testing.mdc +44 -0
  191. package/templates/engineering/ml-ai/CLAUDE.md +1136 -0
  192. package/templates/engineering/mobile/.cursor/rules/navigation.mdc +75 -0
  193. package/templates/engineering/mobile/.cursor/rules/offline-first.mdc +68 -0
  194. package/templates/engineering/mobile/.cursor/rules/overview.mdc +76 -0
  195. package/templates/engineering/mobile/.cursor/rules/performance.mdc +78 -0
  196. package/templates/engineering/mobile/.cursor/rules/testing.mdc +77 -0
  197. package/templates/engineering/mobile/CLAUDE.md +233 -0
  198. package/templates/engineering/platform-engineering/.cursor/rules/ci-cd.mdc +51 -0
  199. package/templates/engineering/platform-engineering/.cursor/rules/developer-experience.mdc +48 -0
  200. package/templates/engineering/platform-engineering/.cursor/rules/infrastructure-as-code.mdc +62 -0
  201. package/templates/engineering/platform-engineering/.cursor/rules/kubernetes.mdc +51 -0
  202. package/templates/engineering/platform-engineering/.cursor/rules/observability.mdc +52 -0
  203. package/templates/engineering/platform-engineering/.cursor/rules/overview.mdc +44 -0
  204. package/templates/engineering/platform-engineering/.cursor/rules/security.mdc +74 -0
  205. package/templates/engineering/platform-engineering/.cursor/rules/testing.mdc +59 -0
  206. package/templates/engineering/platform-engineering/CLAUDE.md +850 -0
  207. package/templates/engineering/qa-engineering/.cursor/rules/automation.mdc +71 -0
  208. package/templates/engineering/qa-engineering/.cursor/rules/metrics.mdc +68 -0
  209. package/templates/engineering/qa-engineering/.cursor/rules/overview.mdc +45 -0
  210. package/templates/engineering/qa-engineering/.cursor/rules/quality-gates.mdc +54 -0
  211. package/templates/engineering/qa-engineering/.cursor/rules/test-design.mdc +59 -0
  212. package/templates/engineering/qa-engineering/.cursor/rules/test-strategy.mdc +62 -0
  213. package/templates/engineering/qa-engineering/CLAUDE.md +726 -0
  214. package/templates/engineering/testing/.cursor/rules/advanced-techniques.mdc +44 -0
  215. package/templates/engineering/testing/.cursor/rules/ci-cd-integration.mdc +43 -0
  216. package/templates/engineering/testing/.cursor/rules/overview.mdc +61 -0
  217. package/templates/engineering/testing/.cursor/rules/performance-testing.mdc +39 -0
  218. package/templates/engineering/testing/.cursor/rules/quality-metrics.mdc +74 -0
  219. package/templates/engineering/testing/.cursor/rules/reliability.mdc +39 -0
  220. package/templates/engineering/testing/.cursor/rules/tdd-methodology.mdc +52 -0
  221. package/templates/engineering/testing/.cursor/rules/test-data.mdc +46 -0
  222. package/templates/engineering/testing/.cursor/rules/test-design.mdc +45 -0
  223. package/templates/engineering/testing/.cursor/rules/test-types.mdc +71 -0
  224. package/templates/engineering/testing/CLAUDE.md +1134 -0
  225. package/templates/engineering/unity-dev-expert/.cursor/rules/csharp-architecture.mdc +61 -0
  226. package/templates/engineering/unity-dev-expert/.cursor/rules/multiplayer-networking.mdc +67 -0
  227. package/templates/engineering/unity-dev-expert/.cursor/rules/overview.mdc +56 -0
  228. package/templates/engineering/unity-dev-expert/.cursor/rules/performance-optimization.mdc +76 -0
  229. package/templates/engineering/unity-dev-expert/.cursor/rules/physics-rendering.mdc +59 -0
  230. package/templates/engineering/unity-dev-expert/.cursor/rules/ui-systems.mdc +59 -0
  231. package/templates/engineering/unity-dev-expert/CLAUDE.md +534 -0
  232. package/templates/engineering/web-backend/.cursor/rules/api-design.mdc +64 -0
  233. package/templates/engineering/web-backend/.cursor/rules/authentication.mdc +69 -0
  234. package/templates/engineering/web-backend/.cursor/rules/database-patterns.mdc +73 -0
  235. package/templates/engineering/web-backend/.cursor/rules/error-handling.mdc +66 -0
  236. package/templates/engineering/web-backend/.cursor/rules/overview.mdc +74 -0
  237. package/templates/engineering/web-backend/.cursor/rules/security.mdc +60 -0
  238. package/templates/engineering/web-backend/.cursor/rules/testing.mdc +74 -0
  239. package/templates/engineering/web-backend/CLAUDE.md +366 -0
  240. package/templates/engineering/web-frontend/.cursor/rules/accessibility.mdc +75 -0
  241. package/templates/engineering/web-frontend/.cursor/rules/component-patterns.mdc +76 -0
  242. package/templates/engineering/web-frontend/.cursor/rules/overview.mdc +77 -0
  243. package/templates/engineering/web-frontend/.cursor/rules/performance.mdc +73 -0
  244. package/templates/engineering/web-frontend/.cursor/rules/state-management.mdc +71 -0
  245. package/templates/engineering/web-frontend/.cursor/rules/styling.mdc +69 -0
  246. package/templates/engineering/web-frontend/.cursor/rules/testing.mdc +75 -0
  247. package/templates/engineering/web-frontend/CLAUDE.md +399 -0
  248. package/templates/languages/cpp-expert/.cursor/rules/concurrency.mdc +68 -0
  249. package/templates/languages/cpp-expert/.cursor/rules/error-handling.mdc +65 -0
  250. package/templates/languages/cpp-expert/.cursor/rules/memory-and-ownership.mdc +68 -0
  251. package/templates/languages/cpp-expert/.cursor/rules/modern-cpp.mdc +75 -0
  252. package/templates/languages/cpp-expert/.cursor/rules/overview.mdc +37 -0
  253. package/templates/languages/cpp-expert/.cursor/rules/performance.mdc +74 -0
  254. package/templates/languages/cpp-expert/.cursor/rules/testing.mdc +70 -0
  255. package/templates/languages/cpp-expert/.cursor/rules/tooling.mdc +77 -0
  256. package/templates/languages/cpp-expert/CLAUDE.md +242 -0
  257. package/templates/languages/csharp-expert/.cursor/rules/aspnet-core.mdc +78 -0
  258. package/templates/languages/csharp-expert/.cursor/rules/async-patterns.mdc +71 -0
  259. package/templates/languages/csharp-expert/.cursor/rules/dependency-injection.mdc +76 -0
  260. package/templates/languages/csharp-expert/.cursor/rules/error-handling.mdc +65 -0
  261. package/templates/languages/csharp-expert/.cursor/rules/language-features.mdc +74 -0
  262. package/templates/languages/csharp-expert/.cursor/rules/overview.mdc +47 -0
  263. package/templates/languages/csharp-expert/.cursor/rules/performance.mdc +66 -0
  264. package/templates/languages/csharp-expert/.cursor/rules/testing.mdc +78 -0
  265. package/templates/languages/csharp-expert/.cursor/rules/tooling.mdc +78 -0
  266. package/templates/languages/csharp-expert/CLAUDE.md +360 -0
  267. package/templates/languages/golang-expert/.cursor/rules/concurrency.mdc +79 -0
  268. package/templates/languages/golang-expert/.cursor/rules/error-handling.mdc +77 -0
  269. package/templates/languages/golang-expert/.cursor/rules/interfaces-and-types.mdc +77 -0
  270. package/templates/languages/golang-expert/.cursor/rules/overview.mdc +74 -0
  271. package/templates/languages/golang-expert/.cursor/rules/performance.mdc +76 -0
  272. package/templates/languages/golang-expert/.cursor/rules/production-patterns.mdc +76 -0
  273. package/templates/languages/golang-expert/.cursor/rules/stdlib-and-tooling.mdc +68 -0
  274. package/templates/languages/golang-expert/.cursor/rules/testing.mdc +77 -0
  275. package/templates/languages/golang-expert/CLAUDE.md +361 -0
  276. package/templates/languages/java-expert/.cursor/rules/concurrency.mdc +69 -0
  277. package/templates/languages/java-expert/.cursor/rules/error-handling.mdc +70 -0
  278. package/templates/languages/java-expert/.cursor/rules/modern-java.mdc +74 -0
  279. package/templates/languages/java-expert/.cursor/rules/overview.mdc +42 -0
  280. package/templates/languages/java-expert/.cursor/rules/performance.mdc +69 -0
  281. package/templates/languages/java-expert/.cursor/rules/persistence.mdc +74 -0
  282. package/templates/languages/java-expert/.cursor/rules/spring-boot.mdc +73 -0
  283. package/templates/languages/java-expert/.cursor/rules/testing.mdc +79 -0
  284. package/templates/languages/java-expert/.cursor/rules/tooling.mdc +76 -0
  285. package/templates/languages/java-expert/CLAUDE.md +325 -0
  286. package/templates/languages/javascript-expert/.cursor/rules/language-deep-dive.mdc +74 -0
  287. package/templates/languages/javascript-expert/.cursor/rules/node-patterns.mdc +77 -0
  288. package/templates/languages/javascript-expert/.cursor/rules/overview.mdc +66 -0
  289. package/templates/languages/javascript-expert/.cursor/rules/performance.mdc +64 -0
  290. package/templates/languages/javascript-expert/.cursor/rules/react-patterns.mdc +70 -0
  291. package/templates/languages/javascript-expert/.cursor/rules/testing.mdc +76 -0
  292. package/templates/languages/javascript-expert/.cursor/rules/tooling.mdc +72 -0
  293. package/templates/languages/javascript-expert/.cursor/rules/typescript-deep-dive.mdc +77 -0
  294. package/templates/languages/javascript-expert/CLAUDE.md +479 -0
  295. package/templates/languages/kotlin-expert/.cursor/rules/coroutines.mdc +75 -0
  296. package/templates/languages/kotlin-expert/.cursor/rules/error-handling.mdc +69 -0
  297. package/templates/languages/kotlin-expert/.cursor/rules/frameworks.mdc +76 -0
  298. package/templates/languages/kotlin-expert/.cursor/rules/language-features.mdc +78 -0
  299. package/templates/languages/kotlin-expert/.cursor/rules/overview.mdc +38 -0
  300. package/templates/languages/kotlin-expert/.cursor/rules/performance.mdc +73 -0
  301. package/templates/languages/kotlin-expert/.cursor/rules/testing.mdc +70 -0
  302. package/templates/languages/kotlin-expert/.cursor/rules/tooling.mdc +67 -0
  303. package/templates/languages/kotlin-expert/CLAUDE.md +276 -0
  304. package/templates/languages/python-expert/.cursor/rules/async-python.mdc +71 -0
  305. package/templates/languages/python-expert/.cursor/rules/overview.mdc +76 -0
  306. package/templates/languages/python-expert/.cursor/rules/patterns-and-idioms.mdc +77 -0
  307. package/templates/languages/python-expert/.cursor/rules/performance.mdc +74 -0
  308. package/templates/languages/python-expert/.cursor/rules/testing.mdc +77 -0
  309. package/templates/languages/python-expert/.cursor/rules/tooling.mdc +77 -0
  310. package/templates/languages/python-expert/.cursor/rules/type-system.mdc +77 -0
  311. package/templates/languages/python-expert/.cursor/rules/web-and-apis.mdc +76 -0
  312. package/templates/languages/python-expert/CLAUDE.md +264 -0
  313. package/templates/languages/ruby-expert/.cursor/rules/concurrency-and-threading.mdc +65 -0
  314. package/templates/languages/ruby-expert/.cursor/rules/error-handling.mdc +69 -0
  315. package/templates/languages/ruby-expert/.cursor/rules/idioms-and-style.mdc +76 -0
  316. package/templates/languages/ruby-expert/.cursor/rules/overview.mdc +60 -0
  317. package/templates/languages/ruby-expert/.cursor/rules/performance.mdc +68 -0
  318. package/templates/languages/ruby-expert/.cursor/rules/rails-and-frameworks.mdc +60 -0
  319. package/templates/languages/ruby-expert/.cursor/rules/testing.mdc +56 -0
  320. package/templates/languages/ruby-expert/.cursor/rules/tooling.mdc +52 -0
  321. package/templates/languages/ruby-expert/CLAUDE.md +102 -0
  322. package/templates/languages/rust-expert/.cursor/rules/concurrency.mdc +69 -0
  323. package/templates/languages/rust-expert/.cursor/rules/ecosystem-and-tooling.mdc +76 -0
  324. package/templates/languages/rust-expert/.cursor/rules/error-handling.mdc +76 -0
  325. package/templates/languages/rust-expert/.cursor/rules/overview.mdc +62 -0
  326. package/templates/languages/rust-expert/.cursor/rules/ownership-and-borrowing.mdc +70 -0
  327. package/templates/languages/rust-expert/.cursor/rules/performance-and-unsafe.mdc +70 -0
  328. package/templates/languages/rust-expert/.cursor/rules/testing.mdc +73 -0
  329. package/templates/languages/rust-expert/.cursor/rules/traits-and-generics.mdc +76 -0
  330. package/templates/languages/rust-expert/CLAUDE.md +283 -0
  331. package/templates/languages/swift-expert/.cursor/rules/concurrency.mdc +77 -0
  332. package/templates/languages/swift-expert/.cursor/rules/error-handling.mdc +76 -0
  333. package/templates/languages/swift-expert/.cursor/rules/language-features.mdc +78 -0
  334. package/templates/languages/swift-expert/.cursor/rules/overview.mdc +46 -0
  335. package/templates/languages/swift-expert/.cursor/rules/performance.mdc +69 -0
  336. package/templates/languages/swift-expert/.cursor/rules/swiftui.mdc +77 -0
  337. package/templates/languages/swift-expert/.cursor/rules/testing.mdc +75 -0
  338. package/templates/languages/swift-expert/.cursor/rules/tooling.mdc +77 -0
  339. package/templates/languages/swift-expert/CLAUDE.md +275 -0
  340. package/templates/professional/documentation/.cursor/rules/adr.mdc +65 -0
  341. package/templates/professional/documentation/.cursor/rules/api-documentation.mdc +64 -0
  342. package/templates/professional/documentation/.cursor/rules/code-comments.mdc +75 -0
  343. package/templates/professional/documentation/.cursor/rules/maintenance.mdc +58 -0
  344. package/templates/professional/documentation/.cursor/rules/overview.mdc +48 -0
  345. package/templates/professional/documentation/.cursor/rules/readme-standards.mdc +70 -0
  346. package/templates/professional/documentation/CLAUDE.md +120 -0
  347. package/templates/professional/executive-assistant/.cursor/rules/calendar.mdc +51 -0
  348. package/templates/professional/executive-assistant/.cursor/rules/confidentiality.mdc +53 -0
  349. package/templates/professional/executive-assistant/.cursor/rules/email.mdc +49 -0
  350. package/templates/professional/executive-assistant/.cursor/rules/meetings.mdc +39 -0
  351. package/templates/professional/executive-assistant/.cursor/rules/overview.mdc +42 -0
  352. package/templates/professional/executive-assistant/.cursor/rules/prioritization.mdc +48 -0
  353. package/templates/professional/executive-assistant/.cursor/rules/stakeholder-management.mdc +50 -0
  354. package/templates/professional/executive-assistant/.cursor/rules/travel.mdc +43 -0
  355. package/templates/professional/executive-assistant/CLAUDE.md +620 -0
  356. package/templates/professional/grant-writer/.cursor/rules/budgets.mdc +55 -0
  357. package/templates/professional/grant-writer/.cursor/rules/compliance.mdc +47 -0
  358. package/templates/professional/grant-writer/.cursor/rules/funding-research.mdc +47 -0
  359. package/templates/professional/grant-writer/.cursor/rules/narrative.mdc +58 -0
  360. package/templates/professional/grant-writer/.cursor/rules/overview.mdc +68 -0
  361. package/templates/professional/grant-writer/.cursor/rules/post-award.mdc +59 -0
  362. package/templates/professional/grant-writer/.cursor/rules/review-criteria.mdc +51 -0
  363. package/templates/professional/grant-writer/.cursor/rules/sustainability.mdc +48 -0
  364. package/templates/professional/grant-writer/CLAUDE.md +577 -0
  365. package/templates/professional/knowledge-synthesis/.cursor/rules/document-management.mdc +51 -0
  366. package/templates/professional/knowledge-synthesis/.cursor/rules/knowledge-graphs.mdc +63 -0
  367. package/templates/professional/knowledge-synthesis/.cursor/rules/overview.mdc +74 -0
  368. package/templates/professional/knowledge-synthesis/.cursor/rules/research-workflow.mdc +50 -0
  369. package/templates/professional/knowledge-synthesis/.cursor/rules/search-retrieval.mdc +62 -0
  370. package/templates/professional/knowledge-synthesis/.cursor/rules/summarization.mdc +61 -0
  371. package/templates/professional/knowledge-synthesis/CLAUDE.md +593 -0
  372. package/templates/professional/life-logistics/.cursor/rules/financial-optimization.mdc +78 -0
  373. package/templates/professional/life-logistics/.cursor/rules/negotiation.mdc +68 -0
  374. package/templates/professional/life-logistics/.cursor/rules/overview.mdc +75 -0
  375. package/templates/professional/life-logistics/.cursor/rules/research-methodology.mdc +76 -0
  376. package/templates/professional/life-logistics/.cursor/rules/scheduling.mdc +68 -0
  377. package/templates/professional/life-logistics/.cursor/rules/task-management.mdc +47 -0
  378. package/templates/professional/life-logistics/CLAUDE.md +601 -0
  379. package/templates/professional/research-assistant/.cursor/rules/citation-attribution.mdc +61 -0
  380. package/templates/professional/research-assistant/.cursor/rules/information-synthesis.mdc +65 -0
  381. package/templates/professional/research-assistant/.cursor/rules/overview.mdc +56 -0
  382. package/templates/professional/research-assistant/.cursor/rules/research-methodologies.mdc +54 -0
  383. package/templates/professional/research-assistant/.cursor/rules/search-strategies.mdc +57 -0
  384. package/templates/professional/research-assistant/.cursor/rules/source-evaluation.mdc +59 -0
  385. package/templates/professional/research-assistant/CLAUDE.md +318 -0
  386. package/templates/professional/wellness-orchestrator/.cursor/rules/adaptive-planning.mdc +69 -0
  387. package/templates/professional/wellness-orchestrator/.cursor/rules/data-integration.mdc +60 -0
  388. package/templates/professional/wellness-orchestrator/.cursor/rules/fitness-programming.mdc +66 -0
  389. package/templates/professional/wellness-orchestrator/.cursor/rules/nutrition-planning.mdc +57 -0
  390. package/templates/professional/wellness-orchestrator/.cursor/rules/overview.mdc +76 -0
  391. package/templates/professional/wellness-orchestrator/.cursor/rules/sleep-optimization.mdc +68 -0
  392. package/templates/professional/wellness-orchestrator/CLAUDE.md +573 -0
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: Error Handling
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # CLI Error Handling
7
+
8
+ Patterns for handling errors gracefully and providing helpful feedback.
9
+
10
+ ## Exit Codes
11
+
12
+ | Code | Meaning | Code | Meaning |
13
+ |------|---------|------|---------|
14
+ | 0 | Success | 2 | Invalid arguments |
15
+ | 1 | General error | 126 | Cannot execute |
16
+ | 64-78 | BSD sysexits | 130 | Interrupted (Ctrl+C) |
17
+
18
+ Map error types to exit codes in a central handler:
19
+
20
+ ```go
21
+ switch {
22
+ case errors.Is(err, ErrInvalidArgs): os.Exit(2)
23
+ case errors.Is(err, context.Canceled): os.Exit(130)
24
+ default: os.Exit(1)
25
+ }
26
+ ```
27
+
28
+ ## Error Message Structure
29
+
30
+ Every error should include: **what happened**, **context** (paths, values), **why** (root cause), and **how to fix** (actionable suggestions).
31
+
32
+ ```
33
+ Error: cannot read config file
34
+ File: ~/.config/mytool/config.yaml
35
+ Cause: permission denied
36
+ Try:
37
+ • chmod 600 ~/.config/mytool/config.yaml
38
+ ```
39
+
40
+ Implement as a structured `CLIError` type with `Message`, `Details`, `Cause`, and `Suggestions` fields.
41
+
42
+ ## Error Wrapping
43
+
44
+ - Add context at each layer: `fmt.Errorf("deploy to %s: %w", env, err)`
45
+ - Unwrap with `errors.Is` / `errors.As` for specific handling
46
+ - Result chain: `"deploy to prod: invalid config: missing field 'api_key'"`
47
+
48
+ ## Graceful Degradation
49
+
50
+ - **Partial failures**: Log warnings, continue processing, report summary (`failed 3/10 files`)
51
+ - **Fallbacks**: Try env var → config file → default value
52
+ - **Verbose mode**: Show stack traces and debug context only when `--verbose` / `--debug` is set
53
+
54
+ ## Anti-Patterns
55
+
56
+ ```go
57
+ // Bad: Silent failure
58
+ result, _ := riskyOp()
59
+
60
+ // Good: Propagate with context
61
+ result, err := riskyOp()
62
+ if err != nil { return fmt.Errorf("risky op: %w", err) }
63
+ ```
64
+
65
+ - **Generic messages** — `"operation failed"` is useless; include what, where, and how to fix
66
+ - **Panic for recoverable errors** — return errors, never `panic` in CLI code
67
+ - **String matching** — use `errors.Is(err, os.ErrNotExist)` not `err.Error() == "file not found"`
@@ -0,0 +1,58 @@
1
+ ---
2
+ description: CLI Tools Development Overview
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # CLI Tools Development Overview
7
+
8
+ Guidelines for building professional command-line interfaces that are intuitive, robust, and maintainable.
9
+
10
+ ## Scope
11
+
12
+ - Command-line applications and utilities
13
+ - Developer tools, build systems, automation tooling
14
+ - System administration scripts
15
+ - Interactive terminal applications
16
+
17
+ ## Core Principles
18
+
19
+ ### Human-First Design
20
+ - Helpful error messages that suggest fixes
21
+ - Sensible defaults for common cases
22
+ - Support both interactive and non-interactive modes
23
+ - Follow platform conventions (POSIX, Windows)
24
+
25
+ ### Composability
26
+ - Accept stdin, produce stdout; stderr for diagnostics
27
+ - Support piping and redirection
28
+ - Return meaningful exit codes
29
+
30
+ ### Predictability
31
+ - Same inputs produce same outputs (deterministic)
32
+ - Respect environment variables and config files
33
+ - Never silently fail
34
+
35
+ ### Progressive Disclosure
36
+ - Common operations require minimal arguments
37
+ - Advanced features available but not required
38
+ - Help text at multiple levels; examples for every command
39
+
40
+ ## Configuration Precedence
41
+
42
+ 1. Command-line flags (highest)
43
+ 2. Environment variables
44
+ 3. Local config file
45
+ 4. Global config file
46
+ 5. Default values (lowest)
47
+
48
+ ## Standard Flags
49
+
50
+ Always support: `-h/--help`, `-v/--verbose`, `-q/--quiet`, `--version`, `--config`, `--no-color`, `--dry-run`, `-f/--force`
51
+
52
+ ## Definition of Done
53
+
54
+ - [ ] All commands have help text, examples, and shell completions
55
+ - [ ] Error messages suggest corrective actions; exit codes follow conventions
56
+ - [ ] Works in non-interactive environments (CI/CD) and supports piping
57
+ - [ ] Tests cover happy path and error cases
58
+ - [ ] Installation and configuration precedence documented
@@ -0,0 +1,42 @@
1
+ ---
2
+ description: CLI testing—unit (business logic), integration (full commands, capture stdout/stderr), exit codes. Mock I/O; test non-interactively.
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # CLI Testing
7
+
8
+ Guidelines for testing CLI applications.
9
+
10
+ ## Levels
11
+
12
+ - **Unit**: Test business logic in isolation (functions that take config/inputs and return results). No CLI framework in unit tests; easy to assert and mock.
13
+ - **Integration**: Run full commands (real or test binary); capture stdout, stderr, and exit code. Use temp dirs and env; no leftover state.
14
+ - **E2E** (optional): Critical user flows with real binary; fewer, focused tests.
15
+
16
+ ## Structure for Testability
17
+
18
+ - **Separate logic from CLI**: Core behavior in lib/ or core/ (pure functions or small modules); CLI layer only parses args, loads config, calls core, and prints. Unit test core; integration test CLI.
19
+ - **Inject I/O**: Accept writer/reader or use package-level vars for stdout/stderr in tests so you can capture output without spawning process (or spawn and capture for integration).
20
+
21
+ ## Integration Tests
22
+
23
+ - **Run command**: `exec` or language equivalent (e.g. `exec.Command` in Go, `child_process` in Node) with args; capture stdout, stderr, exit code.
24
+ - **Assert**: Exit code (e.g. 0 success, 2 usage); stdout contains or equals expected; stderr empty or contains expected error.
25
+ - **Environment**: Use temp dir for cwd and config; set env vars (e.g. `HOME`, `CONFIG`); clean up after.
26
+ - **Non-interactive**: Set `--yes` or pipe to avoid prompts; or mock stdin with “y\n”.
27
+
28
+ ## Exit Codes
29
+
30
+ - **Test explicitly**: Invalid args → 2; success → 0; runtime error → 1. Assert exit code in integration tests so contract is guaranteed.
31
+
32
+ ## Definition of Done (CLI Tests)
33
+
34
+ - [ ] Unit tests for core logic; integration tests for main commands.
35
+ - [ ] Exit codes and stdout/stderr asserted; tests run non-interactively in CI.
36
+ - [ ] No reliance on real filesystem outside temp dirs; tests isolated.
37
+
38
+ ## Common Pitfalls
39
+
40
+ - **Testing only happy path** - Test invalid args, missing files, and permission errors.
41
+ - **Brittle output assertions** - Prefer “contains” or structured parse over exact string when output might change (e.g. version).
42
+ - **Shared state** - Use temp dir per test; don’t rely on cwd or global config.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: CLI UX—stdout vs stderr, output formats (table, JSON, plain), colors, progress, non-interactive. Human-first, scriptable.
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # CLI User Experience
7
+
8
+ Guidelines for clear, scriptable CLI output.
9
+
10
+ ## Streams
11
+
12
+ - **stdout**: Data output only (for piping and scripts). JSON, table rows, or plain lines.
13
+ - **stderr**: Progress, status, errors, logs. Never put parseable data on stderr when scripting is expected.
14
+ - **Exit codes**: 0 success; 1 general error; 2 invalid usage. Document in help.
15
+
16
+ ## Output Formats
17
+
18
+ - Support at least: **human** (table or formatted) and **machine** (JSON). Flag e.g. `--output json` or `-o json`. Default human; JSON for scripting.
19
+ - **Table**: Align columns; consistent spacing. Optional `--no-headers` for scripts.
20
+ - **JSON**: One object or one JSON line per result; no extra prose. Respect `--output json` in all commands that produce data.
21
+
22
+ ## Colors and Progress
23
+
24
+ - **Colors**: Use for success (green), error (red), warning (yellow), info (blue). Respect `NO_COLOR` and `--no-color`; disable when stdout is not a TTY.
25
+ - **Progress**: Spinner for indefinite; progress bar for known total. When not TTY (e.g. CI), print plain messages to stderr instead of spinner.
26
+ - **Interactive**: Prompts only when stdin is TTY; support `--yes`/`--force` to skip confirmation in scripts.
27
+
28
+ ## Error Messages
29
+
30
+ - **Structure**: What failed, context (path, value), cause if known, and suggested fix. Use stderr.
31
+ - **Actionable**: “Cannot read config: permission denied at ~/.config/tool/config.yaml” and “chmod 600 ~/.config/tool/config.yaml”.
32
+
33
+ ## Definition of Done (CLI UX)
34
+
35
+ - [ ] Data on stdout, progress/errors on stderr; exit codes documented.
36
+ - [ ] JSON (or machine) output where scripting is needed; colors respect NO_COLOR/TTY.
37
+ - [ ] Non-interactive mode (e.g. --yes) for CI; no hanging prompts.
38
+
39
+ ## Common Pitfalls
40
+
41
+ - **Mixing data and logs on stdout** - Scripts break; keep data on stdout only.
42
+ - **Always showing spinner** - In CI or pipe, show static message or nothing.
43
+ - **Prompting without escape** - Provide flag to assume yes so automation doesn’t hang.
@@ -0,0 +1,356 @@
1
+ # CLI Tools Development Guide
2
+
3
+ Staff-level guidelines for building professional command-line interfaces that are intuitive, robust, and maintainable.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This guide applies to:
10
+
11
+ - Command-line applications and utilities
12
+ - Developer tools and build systems
13
+ - System administration scripts
14
+ - Automation and DevOps tooling
15
+ - Interactive terminal applications
16
+
17
+ ### Key Principles
18
+
19
+ 1. **Human-First Design** - Intuitive for humans, scriptable for machines
20
+ 2. **Composability** - Do one thing well, compose with others
21
+ 3. **Predictability** - Consistent behavior, no surprises
22
+ 4. **Progressive Disclosure** - Simple things simple, complex things possible
23
+
24
+ ### Technology Stack
25
+
26
+ | Language | Framework | Config | When to Use |
27
+ |----------|-----------|--------|-------------|
28
+ | Go | Cobra + Viper | Viper | Cross-platform binaries, performance |
29
+ | Node.js | Commander.js | cosmiconfig | npm ecosystem, rapid development |
30
+ | Python | Typer/Click | pydantic | Data processing, scripting |
31
+ | Rust | Clap | config-rs | Performance-critical, systems tools |
32
+
33
+ ---
34
+
35
+ ## Command Structure
36
+
37
+ ### Root Command Pattern
38
+
39
+ ```go
40
+ // Go with Cobra
41
+ var rootCmd = &cobra.Command{
42
+ Use: "mytool",
43
+ Short: "A brief description",
44
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
45
+ return initConfig()
46
+ },
47
+ }
48
+
49
+ func init() {
50
+ rootCmd.PersistentFlags().BoolP("verbose", "v", false, "verbose output")
51
+ rootCmd.PersistentFlags().String("config", "", "config file path")
52
+ }
53
+ ```
54
+
55
+ ### Subcommands
56
+
57
+ ```bash
58
+ mytool init # Initialize project
59
+ mytool build # Build project
60
+ mytool deploy # Deploy to environment
61
+ mytool config get # Nested subcommand
62
+ ```
63
+
64
+ ### Configuration Precedence
65
+
66
+ 1. Command-line flags (highest)
67
+ 2. Environment variables
68
+ 3. Local config file
69
+ 4. Global config file
70
+ 5. Default values (lowest)
71
+
72
+ ---
73
+
74
+ ## Arguments and Flags
75
+
76
+ ### Standard Flags (Always Support)
77
+
78
+ | Flag | Purpose |
79
+ |------|---------|
80
+ | `-h, --help` | Show help |
81
+ | `-v, --verbose` | Verbose output |
82
+ | `-q, --quiet` | Suppress output |
83
+ | `--version` | Show version |
84
+ | `--config` | Config file path |
85
+ | `--no-color` | Disable colors |
86
+ | `--dry-run` | Preview changes |
87
+ | `-f, --force` | Skip confirmations |
88
+
89
+ ### Argument Validation
90
+
91
+ ```go
92
+ // Go: Custom validation
93
+ var runCmd = &cobra.Command{
94
+ Use: "run <environment>",
95
+ Args: func(cmd *cobra.Command, args []string) error {
96
+ if len(args) != 1 {
97
+ return fmt.Errorf("requires exactly one argument")
98
+ }
99
+ validEnvs := []string{"dev", "staging", "prod"}
100
+ for _, env := range validEnvs {
101
+ if args[0] == env {
102
+ return nil
103
+ }
104
+ }
105
+ return fmt.Errorf("invalid environment %q", args[0])
106
+ },
107
+ }
108
+ ```
109
+
110
+ ---
111
+
112
+ ## User Experience
113
+
114
+ ### Output Streams
115
+
116
+ - **stdout**: Data output (for piping)
117
+ - **stderr**: Progress, status, errors (for humans)
118
+
119
+ ```go
120
+ // Correct stream usage
121
+ fmt.Fprintln(os.Stderr, "Building...") // Progress
122
+ fmt.Println(result.Path) // Data output
123
+ ```
124
+
125
+ ### Colors
126
+
127
+ | Color | Use For |
128
+ |-------|---------|
129
+ | Green | Success |
130
+ | Red | Errors |
131
+ | Yellow | Warnings |
132
+ | Blue | Information |
133
+ | Dim | Secondary info |
134
+
135
+ Always respect `NO_COLOR` environment variable and `--no-color` flag.
136
+
137
+ ### Progress Indicators
138
+
139
+ ```go
140
+ // Spinner for unknown duration
141
+ spinner.Start()
142
+ defer spinner.Stop()
143
+
144
+ // Progress bar for known progress
145
+ bar := progressbar.New(total)
146
+ for _, item := range items {
147
+ process(item)
148
+ bar.Add(1)
149
+ }
150
+ ```
151
+
152
+ ### Interactive Prompts
153
+
154
+ ```go
155
+ // Confirmation with non-interactive fallback
156
+ func confirm(message string, force bool) bool {
157
+ if force || !term.IsTerminal(int(os.Stdin.Fd())) {
158
+ return true
159
+ }
160
+ // Show interactive prompt
161
+ }
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Error Handling
167
+
168
+ ### Exit Codes
169
+
170
+ | Code | Meaning |
171
+ |------|---------|
172
+ | 0 | Success |
173
+ | 1 | General error |
174
+ | 2 | Invalid arguments |
175
+ | 130 | Interrupted (Ctrl+C) |
176
+
177
+ ### Error Message Structure
178
+
179
+ ```
180
+ Error: cannot read config file
181
+
182
+ File: /home/user/.config/mytool/config.yaml
183
+ Cause: permission denied
184
+
185
+ Try:
186
+ • Check file permissions: ls -la ~/.config/mytool/
187
+ • Fix permissions: chmod 600 ~/.config/mytool/config.yaml
188
+ ```
189
+
190
+ ### Error Message Guidelines
191
+
192
+ 1. **What happened** - Clear description
193
+ 2. **Context** - Relevant details (paths, values)
194
+ 3. **Why** - Root cause if known
195
+ 4. **How to fix** - Actionable suggestions
196
+
197
+ ---
198
+
199
+ ## Testing
200
+
201
+ ### Test Levels
202
+
203
+ | Level | What to Test | How |
204
+ |-------|--------------|-----|
205
+ | Unit | Business logic | Mock dependencies |
206
+ | Integration | Full commands | Capture stdout/stderr |
207
+ | E2E | User workflows | Run actual binary |
208
+
209
+ ### Mocking I/O
210
+
211
+ ```go
212
+ // Capture output
213
+ stdout := new(bytes.Buffer)
214
+ stderr := new(bytes.Buffer)
215
+ cmd.SetOut(stdout)
216
+ cmd.SetErr(stderr)
217
+
218
+ // Mock stdin
219
+ r, w, _ := os.Pipe()
220
+ go func() {
221
+ w.WriteString("y\n")
222
+ w.Close()
223
+ }()
224
+ os.Stdin = r
225
+ ```
226
+
227
+ ### Test Exit Codes
228
+
229
+ ```go
230
+ func TestExitCodes(t *testing.T) {
231
+ cmd := exec.Command("./mytool", "invalid")
232
+ err := cmd.Run()
233
+ exitErr := err.(*exec.ExitError)
234
+ assert.Equal(t, 2, exitErr.ExitCode())
235
+ }
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Distribution
241
+
242
+ ### Version Information
243
+
244
+ ```bash
245
+ $ mytool version
246
+ mytool 1.0.0
247
+ commit: abc123
248
+ built: 2025-01-27
249
+ go: go1.22
250
+ ```
251
+
252
+ ### Installation Methods
253
+
254
+ ```bash
255
+ # Homebrew
256
+ brew install myorg/tap/mytool
257
+
258
+ # npm
259
+ npm install -g mytool
260
+
261
+ # Go
262
+ go install github.com/myorg/mytool@latest
263
+
264
+ # Direct download
265
+ curl -fsSL https://example.com/install.sh | bash
266
+ ```
267
+
268
+ ### Shell Completions
269
+
270
+ ```bash
271
+ # Generate completions
272
+ mytool completion bash > /etc/bash_completion.d/mytool
273
+ mytool completion zsh > "${fpath[1]}/_mytool"
274
+ mytool completion fish > ~/.config/fish/completions/mytool.fish
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Definition of Done
280
+
281
+ A CLI tool is ready for release when:
282
+
283
+ - [ ] All commands have help text and examples
284
+ - [ ] Error messages suggest corrective actions
285
+ - [ ] Exit codes follow conventions
286
+ - [ ] Works in non-interactive environments (CI/CD)
287
+ - [ ] Supports stdin/stdout piping
288
+ - [ ] Configuration precedence documented
289
+ - [ ] Shell completions available
290
+ - [ ] Version flag shows useful info
291
+ - [ ] Tests cover happy path and errors
292
+ - [ ] Installation instructions documented
293
+
294
+ ---
295
+
296
+ ## Common Pitfalls
297
+
298
+ ### 1. Ignoring Non-TTY Environments
299
+
300
+ ```go
301
+ // Bad: Always show spinner
302
+ spinner.Start()
303
+
304
+ // Good: Detect TTY
305
+ if term.IsTerminal(int(os.Stderr.Fd())) {
306
+ spinner.Start()
307
+ } else {
308
+ fmt.Fprintln(os.Stderr, "Processing...")
309
+ }
310
+ ```
311
+
312
+ ### 2. Hardcoded Paths
313
+
314
+ ```go
315
+ // Bad
316
+ configPath := "/etc/mytool/config.yaml"
317
+
318
+ // Good
319
+ configPath := filepath.Join(xdg.ConfigHome, "mytool", "config.yaml")
320
+ ```
321
+
322
+ ### 3. Silent Failures
323
+
324
+ ```go
325
+ // Bad
326
+ result, _ := riskyOperation()
327
+
328
+ // Good
329
+ result, err := riskyOperation()
330
+ if err != nil {
331
+ return fmt.Errorf("operation failed: %w", err)
332
+ }
333
+ ```
334
+
335
+ ### 4. Missing Non-Interactive Support
336
+
337
+ ```go
338
+ // Bad: Always prompts
339
+ answer := prompt("Continue?")
340
+
341
+ // Good: Respect --force flag
342
+ if !force {
343
+ answer := prompt("Continue?")
344
+ }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## Resources
350
+
351
+ - [Command Line Interface Guidelines](https://clig.dev/)
352
+ - [Better CLI](https://better-cli.org/)
353
+ - [Cobra Documentation](https://cobra.dev/)
354
+ - [Commander.js](https://github.com/tj/commander.js)
355
+ - [Click Documentation](https://click.palletsprojects.com/)
356
+ - [Clap Documentation](https://docs.rs/clap/)
@@ -0,0 +1,71 @@
1
+ ---
2
+ description: Data Modeling
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Data Modeling
7
+
8
+ Patterns for scalable, maintainable data models.
9
+
10
+ ## Medallion Architecture
11
+
12
+ - **Bronze/Raw** — exact source copy, append-only, no transforms
13
+ - **Silver/Curated** — validated, typed, deduplicated, business keys applied
14
+ - **Gold/Marts** — aggregated, business-ready, optimized for consumption
15
+
16
+ ## Dimensional Modeling (Star Schema)
17
+
18
+ - **Fact tables** — immutable events with measures and FK references to dimensions; partition by date
19
+ - **Dimension tables** — descriptive attributes with surrogate keys for SCD support
20
+
21
+ ```sql
22
+ -- Fact: measures + foreign keys, partitioned by date
23
+ CREATE TABLE facts.orders (
24
+ order_id STRING, customer_key BIGINT, product_key BIGINT,
25
+ quantity INT, total_amount DECIMAL(12,2), _loaded_at TIMESTAMP
26
+ ) PARTITIONED BY (order_date);
27
+
28
+ -- Dimension: surrogate key + SCD Type 2 tracking
29
+ CREATE TABLE dims.customers (
30
+ customer_key BIGINT GENERATED ALWAYS AS IDENTITY,
31
+ customer_id STRING, name STRING, segment STRING,
32
+ effective_from DATE, effective_to DATE, is_current BOOLEAN
33
+ );
34
+ ```
35
+
36
+ ## Slowly Changing Dimensions
37
+
38
+ - **Type 1** — overwrite in place; no history
39
+ - **Type 2** — close old row (`is_current=false`, set `effective_to`), insert new row; full history
40
+ - **Type 3** — add `previous_*` column; limited history (one prior value)
41
+
42
+ ## Schema Design Rules
43
+
44
+ - **Types**: IDs as STRING, money as DECIMAL, dates as DATE/TIMESTAMP, flags as BOOLEAN
45
+ - **Naming**: tables plural snake_case, columns singular snake_case, FKs as `*_key`, booleans as `is_*`/`has_*`, timestamps as `*_at`, dates as `*_date`
46
+ - **Avoid wide tables** — normalize into fact + dimension; join at query time
47
+
48
+ ```sql
49
+ -- Bad: float for money, string for dates
50
+ unit_price FLOAT, order_date STRING
51
+
52
+ -- Good: precise types
53
+ unit_price DECIMAL(10,2), order_date DATE
54
+ ```
55
+
56
+ ## Partitioning Strategies
57
+
58
+ - **Time-based** — most common; partition by date for time-series data
59
+ - **Categorical** — partition by high-cardinality enum (e.g., event_type)
60
+ - Avoid over-partitioning; use clustering/bucketing for secondary access patterns
61
+
62
+ ## Alternative Approaches
63
+
64
+ - **Data Vault** — Hub (business keys) + Link (relationships) + Satellite (attributes with history); for enterprise DWH
65
+ - **One Big Table (OBT)** — fully denormalized for BI tools; fast reads but harder updates
66
+
67
+ ## Anti-Patterns
68
+
69
+ - Floating-point types for monetary values
70
+ - Storing dates as strings (breaks date math, inconsistent formats)
71
+ - Over-partitioning on high-cardinality columns (millions of tiny files)