mindforge-cc 10.0.3 → 11.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 (333) hide show
  1. package/.mindforge/MINDFORGE-V2-SCHEMA.json +43 -10
  2. package/.mindforge/config.json +30 -2
  3. package/.mindforge/engine/cross-model-eval.md +74 -0
  4. package/.mindforge/engine/proactive/signal-detector.md +60 -0
  5. package/.mindforge/engine/proactive/suggestion-engine.md +100 -0
  6. package/.mindforge/personas/agent-architect.md +57 -0
  7. package/.mindforge/personas/agent-evaluator.md +162 -0
  8. package/.mindforge/personas/agent-memory-designer.md +157 -0
  9. package/.mindforge/personas/agent-ops-engineer.md +120 -0
  10. package/.mindforge/personas/agent-orchestrator.md +112 -0
  11. package/.mindforge/personas/ai-economist.md +57 -0
  12. package/.mindforge/personas/ai-safety-engineer.md +57 -0
  13. package/.mindforge/personas/analytics-engineer.md +57 -0
  14. package/.mindforge/personas/anti-pattern-hunter.md +61 -0
  15. package/.mindforge/personas/api-gateway-designer.md +132 -0
  16. package/.mindforge/personas/auth-engineer.md +112 -0
  17. package/.mindforge/personas/build-engineer.md +57 -0
  18. package/.mindforge/personas/business-analyst.md +56 -0
  19. package/.mindforge/personas/cache-architect.md +100 -0
  20. package/.mindforge/personas/causal-scientist.md +57 -0
  21. package/.mindforge/personas/cdn-architect.md +118 -0
  22. package/.mindforge/personas/change-agent.md +104 -0
  23. package/.mindforge/personas/code-narrator.md +52 -0
  24. package/.mindforge/personas/codegen-specialist.md +68 -0
  25. package/.mindforge/personas/communication-architect.md +102 -0
  26. package/.mindforge/personas/compliance-engineer.md +96 -0
  27. package/.mindforge/personas/consensus-engineer.md +116 -0
  28. package/.mindforge/personas/contract-tester.md +60 -192
  29. package/.mindforge/personas/data-architect.md +108 -0
  30. package/.mindforge/personas/data-mesh-architect.md +57 -0
  31. package/.mindforge/personas/data-pipeline-architect.md +120 -0
  32. package/.mindforge/personas/de-sloppifier.md +60 -0
  33. package/.mindforge/personas/debt-manager.md +66 -0
  34. package/.mindforge/personas/decision-architect.md +82 -51
  35. package/.mindforge/personas/deployment-captain.md +74 -0
  36. package/.mindforge/personas/design-system-lead.md +112 -0
  37. package/.mindforge/personas/dmux-orchestrator.md +75 -0
  38. package/.mindforge/personas/dx-engineer.md +96 -0
  39. package/.mindforge/personas/ecommerce-engineer.md +57 -0
  40. package/.mindforge/personas/edge-engineer.md +94 -0
  41. package/.mindforge/personas/edtech-architect.md +106 -0
  42. package/.mindforge/personas/embedding-architect.md +57 -0
  43. package/.mindforge/personas/environment-engineer.md +57 -0
  44. package/.mindforge/personas/eval-judge.md +55 -0
  45. package/.mindforge/personas/event-architect.md +102 -0
  46. package/.mindforge/personas/experiment-designer.md +138 -0
  47. package/.mindforge/personas/feature-store-engineer.md +57 -0
  48. package/.mindforge/personas/finops-analyst.md +66 -0
  49. package/.mindforge/personas/fintech-architect.md +57 -0
  50. package/.mindforge/personas/flutter-engineer.md +104 -0
  51. package/.mindforge/personas/gaming-engineer.md +57 -0
  52. package/.mindforge/personas/graphql-designer.md +73 -0
  53. package/.mindforge/personas/healthcare-engineer.md +57 -0
  54. package/.mindforge/personas/hiring-strategist.md +105 -0
  55. package/.mindforge/personas/hitl-architect.md +165 -0
  56. package/.mindforge/personas/i18n-architect.md +69 -0
  57. package/.mindforge/personas/iot-architect.md +105 -0
  58. package/.mindforge/personas/knowledge-curator.md +139 -0
  59. package/.mindforge/personas/knowledge-engineer.md +57 -0
  60. package/.mindforge/personas/lakehouse-architect.md +57 -0
  61. package/.mindforge/personas/llm-orchestrator.md +57 -0
  62. package/.mindforge/personas/logistics-architect.md +106 -0
  63. package/.mindforge/personas/market-analyst.md +53 -0
  64. package/.mindforge/personas/marketplace-engineer.md +105 -0
  65. package/.mindforge/personas/mcp-designer.md +54 -0
  66. package/.mindforge/personas/meeting-designer.md +104 -0
  67. package/.mindforge/personas/mentorship-lead.md +106 -0
  68. package/.mindforge/personas/migration-architect.md +57 -0
  69. package/.mindforge/personas/ml-ops-engineer.md +101 -0
  70. package/.mindforge/personas/mobile-architect.md +105 -0
  71. package/.mindforge/personas/mobile-security-engineer.md +106 -0
  72. package/.mindforge/personas/multi-tenancy-architect.md +71 -0
  73. package/.mindforge/personas/multimodal-engineer.md +57 -0
  74. package/.mindforge/personas/offline-specialist.md +105 -0
  75. package/.mindforge/personas/onboarding-navigator.md +63 -0
  76. package/.mindforge/personas/payments-engineer.md +135 -0
  77. package/.mindforge/personas/pipeline-engineer.md +115 -0
  78. package/.mindforge/personas/platform-engineer.md +97 -0
  79. package/.mindforge/personas/platform-lead.md +57 -0
  80. package/.mindforge/personas/privacy-engineer.md +57 -0
  81. package/.mindforge/personas/product-owner.md +56 -0
  82. package/.mindforge/personas/productivity-analyst.md +57 -0
  83. package/.mindforge/personas/prompt-architect.md +101 -0
  84. package/.mindforge/personas/proofreader.md +53 -0
  85. package/.mindforge/personas/pwa-architect.md +105 -0
  86. package/.mindforge/personas/quality-scorer.md +63 -0
  87. package/.mindforge/personas/react-native-engineer.md +106 -0
  88. package/.mindforge/personas/resilience-engineer.md +69 -0
  89. package/.mindforge/personas/rfc-architect.md +64 -0
  90. package/.mindforge/personas/saga-orchestrator.md +80 -0
  91. package/.mindforge/personas/secrets-engineer.md +57 -0
  92. package/.mindforge/personas/skill-smith.md +79 -0
  93. package/.mindforge/personas/sre-lead.md +107 -0
  94. package/.mindforge/personas/stream-engineer.md +57 -0
  95. package/.mindforge/personas/streaming-engineer.md +64 -0
  96. package/.mindforge/personas/swarm-templates.json +674 -44
  97. package/.mindforge/personas/system-designer.md +57 -0
  98. package/.mindforge/personas/team-coach.md +120 -0
  99. package/.mindforge/personas/tech-lead-coach.md +103 -0
  100. package/.mindforge/personas/technical-writer-lead.md +111 -0
  101. package/.mindforge/personas/vibe-checker.md +75 -0
  102. package/.mindforge/personas/worktree-manager.md +56 -0
  103. package/.mindforge/personas/zero-trust-engineer.md +113 -0
  104. package/.mindforge/skills/a11y-testing/SKILL.md +143 -0
  105. package/.mindforge/skills/agent-evaluation-framework/SKILL.md +227 -0
  106. package/.mindforge/skills/agent-memory-design/SKILL.md +199 -0
  107. package/.mindforge/skills/agent-orchestration-patterns/SKILL.md +129 -0
  108. package/.mindforge/skills/agent-tool-selection/SKILL.md +204 -0
  109. package/.mindforge/skills/ai-agent-deployment/SKILL.md +176 -0
  110. package/.mindforge/skills/ai-cost-management/SKILL.md +57 -0
  111. package/.mindforge/skills/ai-safety-alignment/SKILL.md +53 -0
  112. package/.mindforge/skills/analytics-instrumentation/SKILL.md +172 -0
  113. package/.mindforge/skills/api-gateway-patterns/SKILL.md +177 -0
  114. package/.mindforge/skills/api-marketplace/SKILL.md +56 -0
  115. package/.mindforge/skills/api-versioning/SKILL.md +100 -0
  116. package/.mindforge/skills/app-store-deployment/SKILL.md +44 -0
  117. package/.mindforge/skills/architecture-tradeoff-analysis/SKILL.md +97 -0
  118. package/.mindforge/skills/audit-logging/SKILL.md +140 -0
  119. package/.mindforge/skills/auth-patterns/SKILL.md +148 -0
  120. package/.mindforge/skills/autonomous-agent-harness/SKILL.md +218 -0
  121. package/.mindforge/skills/autonomous-agents/SKILL.md +59 -0
  122. package/.mindforge/skills/build-system-optimization/SKILL.md +54 -0
  123. package/.mindforge/skills/build-vs-buy/SKILL.md +80 -0
  124. package/.mindforge/skills/bundle-optimization/SKILL.md +174 -0
  125. package/.mindforge/skills/business-analyst/SKILL.md +82 -0
  126. package/.mindforge/skills/caching-strategies/SKILL.md +132 -0
  127. package/.mindforge/skills/capacity-planning/SKILL.md +96 -0
  128. package/.mindforge/skills/causal-inference/SKILL.md +42 -0
  129. package/.mindforge/skills/cdn-optimization/SKILL.md +212 -0
  130. package/.mindforge/skills/change-management/SKILL.md +106 -0
  131. package/.mindforge/skills/chaos-engineering/SKILL.md +99 -0
  132. package/.mindforge/skills/ci-cd-pipeline/SKILL.md +118 -0
  133. package/.mindforge/skills/cli-design/SKILL.md +118 -0
  134. package/.mindforge/skills/code-generation-patterns/SKILL.md +92 -0
  135. package/.mindforge/skills/code-review-methodology/SKILL.md +180 -0
  136. package/.mindforge/skills/code-tour/SKILL.md +145 -0
  137. package/.mindforge/skills/codebase-onboarding/SKILL.md +95 -0
  138. package/.mindforge/skills/compliance-as-code/SKILL.md +195 -0
  139. package/.mindforge/skills/conflict-resolution/SKILL.md +87 -0
  140. package/.mindforge/skills/connection-pooling/SKILL.md +151 -0
  141. package/.mindforge/skills/container-security/SKILL.md +151 -0
  142. package/.mindforge/skills/context-engineering/SKILL.md +114 -0
  143. package/.mindforge/skills/contract-testing/SKILL.md +85 -0
  144. package/.mindforge/skills/cost-estimation/SKILL.md +82 -0
  145. package/.mindforge/skills/cqrs-event-sourcing/SKILL.md +95 -0
  146. package/.mindforge/skills/cross-platform-testing/SKILL.md +43 -0
  147. package/.mindforge/skills/data-governance/SKILL.md +42 -0
  148. package/.mindforge/skills/data-lakehouse/SKILL.md +42 -0
  149. package/.mindforge/skills/data-mesh/SKILL.md +42 -0
  150. package/.mindforge/skills/data-modeling/SKILL.md +107 -0
  151. package/.mindforge/skills/data-pipeline-design/SKILL.md +171 -0
  152. package/.mindforge/skills/data-privacy-engineering/SKILL.md +42 -0
  153. package/.mindforge/skills/database-performance/SKILL.md +174 -0
  154. package/.mindforge/skills/database-sharding-advanced/SKILL.md +206 -0
  155. package/.mindforge/skills/de-sloppify/SKILL.md +120 -0
  156. package/.mindforge/skills/defense-in-depth/SKILL.md +84 -0
  157. package/.mindforge/skills/delegation-patterns/SKILL.md +123 -0
  158. package/.mindforge/skills/dependency-management/SKILL.md +94 -0
  159. package/.mindforge/skills/deployment-workflow/SKILL.md +135 -0
  160. package/.mindforge/skills/design-system/SKILL.md +113 -0
  161. package/.mindforge/skills/developer-onboarding/SKILL.md +99 -0
  162. package/.mindforge/skills/developer-productivity-metrics/SKILL.md +59 -0
  163. package/.mindforge/skills/distributed-consensus/SKILL.md +141 -0
  164. package/.mindforge/skills/dmux-workflows/SKILL.md +141 -0
  165. package/.mindforge/skills/dns-architecture/SKILL.md +167 -0
  166. package/.mindforge/skills/ecommerce-architecture/SKILL.md +41 -0
  167. package/.mindforge/skills/edge-computing/SKILL.md +91 -0
  168. package/.mindforge/skills/edtech-platform/SKILL.md +41 -0
  169. package/.mindforge/skills/email-deliverability/SKILL.md +177 -0
  170. package/.mindforge/skills/embedding-systems/SKILL.md +55 -0
  171. package/.mindforge/skills/environment-management/SKILL.md +54 -0
  172. package/.mindforge/skills/error-handling-architecture/SKILL.md +118 -0
  173. package/.mindforge/skills/estimation-techniques/SKILL.md +113 -0
  174. package/.mindforge/skills/eval-harness/SKILL.md +180 -0
  175. package/.mindforge/skills/event-driven-architecture/SKILL.md +162 -0
  176. package/.mindforge/skills/experiment-design/SKILL.md +139 -0
  177. package/.mindforge/skills/experiment-platform/SKILL.md +43 -0
  178. package/.mindforge/skills/feature-engineering/SKILL.md +42 -0
  179. package/.mindforge/skills/feature-flag-management/SKILL.md +183 -0
  180. package/.mindforge/skills/fine-tuning-workflow/SKILL.md +189 -0
  181. package/.mindforge/skills/fintech-patterns/SKILL.md +41 -0
  182. package/.mindforge/skills/flutter-architecture/SKILL.md +42 -0
  183. package/.mindforge/skills/gaming-backend/SKILL.md +41 -0
  184. package/.mindforge/skills/git-workflow-design/SKILL.md +129 -0
  185. package/.mindforge/skills/graceful-degradation/SKILL.md +95 -0
  186. package/.mindforge/skills/graphql-patterns/SKILL.md +243 -0
  187. package/.mindforge/skills/guardrails-and-safety/SKILL.md +137 -0
  188. package/.mindforge/skills/healthcare-systems/SKILL.md +40 -0
  189. package/.mindforge/skills/hiring-engineering/SKILL.md +119 -0
  190. package/.mindforge/skills/human-in-the-loop-design/SKILL.md +234 -0
  191. package/.mindforge/skills/i18n-architecture/SKILL.md +147 -0
  192. package/.mindforge/skills/idempotency-patterns/SKILL.md +84 -0
  193. package/.mindforge/skills/incident-communication/SKILL.md +96 -0
  194. package/.mindforge/skills/incident-management/SKILL.md +97 -0
  195. package/.mindforge/skills/infrastructure-as-code/SKILL.md +98 -0
  196. package/.mindforge/skills/instinct-clustering/SKILL.md +190 -0
  197. package/.mindforge/skills/internal-developer-platform/SKILL.md +51 -0
  198. package/.mindforge/skills/iot-platform/SKILL.md +41 -0
  199. package/.mindforge/skills/k8s-deployment/SKILL.md +358 -0
  200. package/.mindforge/skills/knowledge-graphs/SKILL.md +56 -0
  201. package/.mindforge/skills/knowledge-sharing-systems/SKILL.md +112 -0
  202. package/.mindforge/skills/llm-cost-optimization/SKILL.md +198 -0
  203. package/.mindforge/skills/llm-orchestration/SKILL.md +56 -0
  204. package/.mindforge/skills/load-testing/SKILL.md +84 -0
  205. package/.mindforge/skills/logistics-optimization/SKILL.md +40 -0
  206. package/.mindforge/skills/market-researcher/SKILL.md +99 -0
  207. package/.mindforge/skills/marketplace-trust/SKILL.md +40 -0
  208. package/.mindforge/skills/mcp-server-patterns/SKILL.md +264 -0
  209. package/.mindforge/skills/media-streaming/SKILL.md +41 -0
  210. package/.mindforge/skills/meeting-architecture/SKILL.md +146 -0
  211. package/.mindforge/skills/mentoring-patterns/SKILL.md +77 -0
  212. package/.mindforge/skills/microservices-patterns/SKILL.md +83 -0
  213. package/.mindforge/skills/migration-platform/SKILL.md +61 -0
  214. package/.mindforge/skills/migration-strategies/SKILL.md +129 -0
  215. package/.mindforge/skills/ml-feature-store/SKILL.md +56 -0
  216. package/.mindforge/skills/ml-monitoring/SKILL.md +42 -0
  217. package/.mindforge/skills/mobile-performance/SKILL.md +44 -0
  218. package/.mindforge/skills/mobile-security/SKILL.md +45 -0
  219. package/.mindforge/skills/model-evaluation/SKILL.md +53 -0
  220. package/.mindforge/skills/monorepo-management/SKILL.md +100 -0
  221. package/.mindforge/skills/multi-tenancy-patterns/SKILL.md +145 -0
  222. package/.mindforge/skills/multi-turn-conversation-design/SKILL.md +206 -0
  223. package/.mindforge/skills/multimodal-ai/SKILL.md +51 -0
  224. package/.mindforge/skills/mutation-testing/SKILL.md +97 -0
  225. package/.mindforge/skills/notification-system-design/SKILL.md +168 -0
  226. package/.mindforge/skills/observability-stack/SKILL.md +136 -0
  227. package/.mindforge/skills/offline-first-design/SKILL.md +43 -0
  228. package/.mindforge/skills/on-call-design/SKILL.md +111 -0
  229. package/.mindforge/skills/pagination-patterns/SKILL.md +230 -0
  230. package/.mindforge/skills/payment-integration/SKILL.md +176 -0
  231. package/.mindforge/skills/performance-reviews/SKILL.md +140 -0
  232. package/.mindforge/skills/platform-observability/SKILL.md +58 -0
  233. package/.mindforge/skills/platform-reliability/SKILL.md +52 -0
  234. package/.mindforge/skills/post-incident-learning/SKILL.md +96 -0
  235. package/.mindforge/skills/product-manager/SKILL.md +104 -0
  236. package/.mindforge/skills/progressive-web-app/SKILL.md +44 -0
  237. package/.mindforge/skills/prompt-engineering/SKILL.md +94 -0
  238. package/.mindforge/skills/proofreader/SKILL.md +158 -0
  239. package/.mindforge/skills/push-notification-architecture/SKILL.md +45 -0
  240. package/.mindforge/skills/python-performance/SKILL.md +183 -0
  241. package/.mindforge/skills/quality-audit/SKILL.md +171 -0
  242. package/.mindforge/skills/queue-design/SKILL.md +85 -0
  243. package/.mindforge/skills/rag-architecture/SKILL.md +176 -0
  244. package/.mindforge/skills/rate-limiting-design/SKILL.md +94 -0
  245. package/.mindforge/skills/react-native-patterns/SKILL.md +42 -0
  246. package/.mindforge/skills/react-performance/SKILL.md +229 -0
  247. package/.mindforge/skills/real-time-analytics/SKILL.md +42 -0
  248. package/.mindforge/skills/real-time-sync/SKILL.md +83 -0
  249. package/.mindforge/skills/responsive-native/SKILL.md +44 -0
  250. package/.mindforge/skills/responsive-patterns/SKILL.md +141 -0
  251. package/.mindforge/skills/rfc-pipeline/SKILL.md +114 -0
  252. package/.mindforge/skills/saas-multi-tenant/SKILL.md +41 -0
  253. package/.mindforge/skills/santa-method/SKILL.md +134 -0
  254. package/.mindforge/skills/search-implementation/SKILL.md +98 -0
  255. package/.mindforge/skills/secrets-platform/SKILL.md +56 -0
  256. package/.mindforge/skills/secrets-rotation/SKILL.md +173 -0
  257. package/.mindforge/skills/self-serve-infrastructure/SKILL.md +51 -0
  258. package/.mindforge/skills/serverless-patterns/SKILL.md +119 -0
  259. package/.mindforge/skills/skill-creator-meta/SKILL.md +146 -0
  260. package/.mindforge/skills/sprint-retrospective-facilitation/SKILL.md +112 -0
  261. package/.mindforge/skills/stakeholder-communication/SKILL.md +85 -0
  262. package/.mindforge/skills/state-management/SKILL.md +104 -0
  263. package/.mindforge/skills/stream-processing/SKILL.md +43 -0
  264. package/.mindforge/skills/streaming-architecture/SKILL.md +81 -0
  265. package/.mindforge/skills/supply-chain-security/SKILL.md +145 -0
  266. package/.mindforge/skills/synthetic-data-generation/SKILL.md +52 -0
  267. package/.mindforge/skills/system-design/SKILL.md +88 -0
  268. package/.mindforge/skills/team-topology-design/SKILL.md +107 -0
  269. package/.mindforge/skills/technical-debt-management/SKILL.md +86 -0
  270. package/.mindforge/skills/technical-interview-design/SKILL.md +98 -0
  271. package/.mindforge/skills/technical-leadership/SKILL.md +75 -0
  272. package/.mindforge/skills/technical-writing/SKILL.md +237 -0
  273. package/.mindforge/skills/technology-radar/SKILL.md +88 -0
  274. package/.mindforge/skills/testing-anti-patterns/SKILL.md +288 -0
  275. package/.mindforge/skills/tool-design/SKILL.md +138 -0
  276. package/.mindforge/skills/typescript-advanced/SKILL.md +198 -0
  277. package/.mindforge/skills/using-git-worktrees/SKILL.md +139 -0
  278. package/.mindforge/skills/verification-loop/SKILL.md +13 -1
  279. package/.mindforge/skills/vibe-security/SKILL.md +165 -0
  280. package/.mindforge/skills/visual-regression-testing/SKILL.md +97 -0
  281. package/.mindforge/skills/websocket-patterns/SKILL.md +203 -0
  282. package/.mindforge/skills/writing-plans/SKILL.md +170 -0
  283. package/.mindforge/skills/writing-skills/SKILL.md +216 -0
  284. package/.mindforge/skills/zero-trust-architecture/SKILL.md +166 -0
  285. package/CHANGELOG.md +240 -0
  286. package/MINDFORGE.md +4 -4
  287. package/README.md +49 -4
  288. package/RELEASENOTES.md +80 -0
  289. package/SECURITY.md +20 -8
  290. package/bin/autonomous/audit-writer.js +13 -0
  291. package/bin/autonomous/auto-runner.js +74 -16
  292. package/bin/autonomous/context-refactorer.js +26 -11
  293. package/bin/autonomous/state-manager.js +62 -6
  294. package/bin/autonomous/stuck-monitor.js +46 -7
  295. package/bin/autonomous/wave-executor.js +66 -25
  296. package/bin/dashboard/api-router.js +43 -0
  297. package/bin/dashboard/metrics-aggregator.js +28 -1
  298. package/bin/dashboard/server.js +67 -4
  299. package/bin/dashboard/sse-bridge.js +4 -4
  300. package/bin/engine/feedback-loop.js +8 -0
  301. package/bin/engine/intelligence-interlock.js +32 -15
  302. package/bin/engine/logic-drift-detector.js +2 -1
  303. package/bin/engine/nexus-tracer.js +3 -2
  304. package/bin/engine/remediation-engine.js +155 -32
  305. package/bin/engine/self-corrective-synthesizer.js +84 -10
  306. package/bin/engine/sre-manager.js +12 -4
  307. package/bin/engine/temporal-hub.js +131 -34
  308. package/bin/governance/approve.js +41 -5
  309. package/bin/governance/impact-analyzer.js +28 -0
  310. package/bin/governance/policy-engine.js +10 -3
  311. package/bin/governance/quantum-crypto.js +32 -19
  312. package/bin/governance/rbac-manager.js +74 -2
  313. package/bin/governance/ztai-manager.js +49 -7
  314. package/bin/hindsight-injector.js +3 -3
  315. package/bin/memory/eis-client.js +71 -34
  316. package/bin/memory/embedding-engine.js +61 -0
  317. package/bin/memory/knowledge-graph.js +58 -5
  318. package/bin/memory/knowledge-indexer.js +53 -6
  319. package/bin/memory/knowledge-store.js +22 -0
  320. package/bin/migrations/10.7.0-to-11.0.0.js +110 -0
  321. package/bin/migrations/schema-versions.js +13 -0
  322. package/bin/models/anthropic-provider.js +45 -0
  323. package/bin/models/cloud-broker.js +68 -20
  324. package/bin/models/gemini-provider.js +51 -0
  325. package/bin/models/model-client.js +20 -0
  326. package/bin/models/model-router.js +28 -8
  327. package/bin/models/openai-provider.js +44 -0
  328. package/bin/utils/file-io.js +63 -1
  329. package/bin/utils/index.js +58 -0
  330. package/docs/getting-started.md +1 -1
  331. package/docs/user-guide.md +2 -2
  332. package/package.json +2 -2
  333. package/.mindforge/personas/data-privacy-engineer.md +0 -187
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: fine-tuning-workflow
3
+ version: 1.0.0
4
+ min_mindforge_version: 0.1.0
5
+ status: stable
6
+ triggers: fine tuning, dataset preparation, training config, eval during training, model deployment, model A/B test, LoRA adapter, training data quality, hyperparameter tuning, model versioning, training pipeline, fine tune evaluation
7
+ ---
8
+
9
+ # Skill — Fine-Tuning Workflow
10
+
11
+ ## When this skill activates
12
+ Any task involving LLM fine-tuning, training dataset preparation, LoRA/QLoRA
13
+ adaptation, model evaluation during training, or model deployment with A/B testing.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before writing any code
18
+ 1. Define the fine-tuning objective (style adaptation, domain knowledge, task specialization).
19
+ 2. Audit training data quality (deduplication, format consistency, bias check).
20
+ 3. Establish baseline metrics with the un-tuned model.
21
+
22
+ ### During implementation
23
+ - Run evaluation on held-out validation set at regular intervals during training.
24
+ - Implement early stopping on quality degradation.
25
+ - Track training metrics: loss, eval metrics, learning rate schedule.
26
+
27
+ ### After implementation
28
+ - Compare fine-tuned model against baseline on the eval suite.
29
+ - Deploy with canary traffic (shadow or A/B testing).
30
+ - Document the model card with training details and performance.
31
+
32
+ ## Dataset Preparation
33
+
34
+ ### Data Requirements by Objective
35
+ | Objective | Min Examples | Quality Requirement |
36
+ |-----------|-------------|-------------------|
37
+ | Style/tone adaptation | 100-500 | High quality exemplars of target style |
38
+ | Domain knowledge | 1,000-10,000 | Accurate, diverse domain Q&A pairs |
39
+ | Task specialization | 500-5,000 | Varied task examples with edge cases |
40
+ | Instruction following | 1,000+ | Diverse instruction/response pairs |
41
+
42
+ ### Data Format (Instruction Tuning)
43
+ ```jsonl
44
+ {"messages": [
45
+ {"role": "system", "content": "You are a helpful coding assistant."},
46
+ {"role": "user", "content": "Write a function to reverse a string in Python."},
47
+ {"role": "assistant", "content": "def reverse_string(s: str) -> str:\n return s[::-1]"}
48
+ ]}
49
+ ```
50
+
51
+ ### Data Quality Checklist
52
+ - [ ] Deduplicated (no exact or near-duplicate examples).
53
+ - [ ] Consistent format across all examples.
54
+ - [ ] Balanced across categories/topics.
55
+ - [ ] No PII or sensitive data (unless intentional and consented).
56
+ - [ ] Correct and high-quality responses (garbage in = garbage out).
57
+ - [ ] Diverse inputs (length, complexity, edge cases).
58
+
59
+ ### Data Cleaning Pipeline
60
+ 1. **Deduplication**: hash-based exact dedup + embedding-based semantic dedup.
61
+ 2. **Format validation**: ensure all examples match expected schema.
62
+ 3. **Quality filtering**: remove low-quality examples (too short, incoherent).
63
+ 4. **Balance check**: verify distribution across categories.
64
+ 5. **Contamination check**: ensure eval data not in training set.
65
+
66
+ ## Training Approaches
67
+
68
+ ### Full Fine-Tuning
69
+ - Updates all model parameters.
70
+ - Use for: significant behavior changes, large datasets.
71
+ - Cost: high (full model in GPU memory, long training time).
72
+ - Risk: catastrophic forgetting of base model capabilities.
73
+
74
+ ### LoRA (Low-Rank Adaptation)
75
+ - Adds small trainable matrices alongside frozen base model.
76
+ - Use for: most fine-tuning tasks (efficient, less forgetting).
77
+ - Cost: low (only adapter weights in GPU memory).
78
+ - Benefit: merge adapter with base model for zero-overhead inference.
79
+
80
+ ### QLoRA (Quantized LoRA)
81
+ - Base model quantized to 4-bit, LoRA adapters in 16-bit.
82
+ - Use for: large models on limited GPU memory.
83
+ - Cost: very low (fits 70B model on single GPU for training).
84
+ - Trade-off: slight quality reduction from quantization.
85
+
86
+ ### Key Hyperparameters
87
+ | Parameter | Typical Range | Notes |
88
+ |-----------|--------------|-------|
89
+ | Learning rate | 1e-5 to 5e-5 | Lower for larger models |
90
+ | Batch size | 4-32 | Larger = more stable, needs more memory |
91
+ | Epochs | 1-5 | More epochs risk overfitting |
92
+ | LoRA rank | 8-64 | Higher = more capacity, more compute |
93
+ | LoRA alpha | 16-128 | Usually 2x rank |
94
+ | Warmup steps | 5-10% of total | Prevents early divergence |
95
+
96
+ ## Evaluation During Training
97
+
98
+ ### Validation Set
99
+ - Hold out 10-20% of data as validation (never train on it).
100
+ - Evaluate every N steps (e.g., every 100 steps or every epoch).
101
+ - Track: validation loss, task-specific metrics.
102
+
103
+ ### Early Stopping
104
+ - Stop training if validation metric doesn't improve for N evaluations.
105
+ - Prevents overfitting (model memorizes training data).
106
+ - Save checkpoint at best validation score, not last step.
107
+
108
+ ### Evaluation Metrics
109
+ | Metric | Use Case | What It Measures |
110
+ |--------|----------|-----------------|
111
+ | Perplexity | General quality | Model confidence on held-out data |
112
+ | ROUGE-L | Summarization | Overlap with reference summaries |
113
+ | Exact Match | Q&A, classification | Correct answer percentage |
114
+ | Human preference | Style/quality | A/B comparison by annotators |
115
+ | Task-specific | Custom tasks | Domain-specific correctness |
116
+
117
+ ## Model Deployment
118
+
119
+ ### Deployment Pipeline
120
+ ```
121
+ Train → Evaluate → Register → Shadow Test → Canary → Full Rollout
122
+ ```
123
+
124
+ ### Model Registry
125
+ - Version every model with: training data hash, hyperparameters, eval scores.
126
+ - Store model artifacts in versioned storage (S3, GCS, MLflow).
127
+ - Link to training run for full reproducibility.
128
+
129
+ ### Shadow Traffic Testing
130
+ - Deploy new model alongside production model.
131
+ - Route production traffic to both (only serve old model's response).
132
+ - Compare outputs offline (quality, latency, error rate).
133
+ - Promote to canary only if shadow results are satisfactory.
134
+
135
+ ### Canary Rollout
136
+ - Route 5% of traffic to new model.
137
+ - Monitor: quality metrics, latency p99, error rate, user feedback.
138
+ - If metrics are good after 24-48 hours: increase to 25% → 50% → 100%.
139
+ - Rollback instantly if any metric degrades.
140
+
141
+ ## A/B Testing
142
+
143
+ ### Experiment Design
144
+ - Split users randomly (not requests — same user should see same model).
145
+ - Define primary metric (quality score, user satisfaction, task completion).
146
+ - Define guardrail metrics (latency, error rate, cost).
147
+ - Run for statistical significance (typically 1-2 weeks).
148
+
149
+ ### Analysis
150
+ - Compare primary metric between control (old model) and treatment (new model).
151
+ - Verify guardrail metrics haven't degraded.
152
+ - Check for segment effects (does new model help some users but hurt others?).
153
+ - Document results and decision in model card.
154
+
155
+ ## Model Versioning (Model Card)
156
+
157
+ ```yaml
158
+ model_card:
159
+ name: customer-support-assistant-v3
160
+ base_model: llama-3-8b
161
+ adapter: LoRA (rank 32)
162
+ training_data:
163
+ source: customer_support_conversations_2024
164
+ examples: 5,432
165
+ hash: sha256:def456...
166
+ hyperparameters:
167
+ learning_rate: 2e-5
168
+ epochs: 3
169
+ batch_size: 16
170
+ lora_rank: 32
171
+ evaluation:
172
+ held_out_accuracy: 0.89
173
+ human_preference_win_rate: 0.72
174
+ latency_p99_ms: 340
175
+ deployed_at: 2024-01-20
176
+ parent_version: customer-support-assistant-v2
177
+ ```
178
+
179
+ ## Self-check before task completion
180
+
181
+ Before marking a task done when this skill was active:
182
+
183
+ - [ ] Did I read the full SKILL.md before starting? (Not just the triggers)
184
+ - [ ] Is training data deduplicated, validated, and quality-checked?
185
+ - [ ] Is evaluation running on held-out validation set during training?
186
+ - [ ] Is early stopping configured to prevent overfitting?
187
+ - [ ] Are baseline metrics established for comparison?
188
+ - [ ] Is the model versioned with full training lineage?
189
+ - [ ] Is deployment using canary/A/B testing (not instant full rollout)?
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: fintech-patterns
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.2.0
5
+ status: stable
6
+ triggers: fintech architecture, payment processing system, PCI-DSS compliance, double-entry ledger, financial reconciliation, KYC workflow, AML detection, transaction processing, financial regulation, banking integration, money movement, payment rail design
7
+ compose: payment-integration
8
+ ---
9
+
10
+ # Skill — Fintech Patterns
11
+
12
+ ## When this skill activates
13
+ This skill activates when building payment processing systems, implementing double-entry accounting ledgers, handling financial transactions, integrating with banking APIs, ensuring PCI-DSS compliance, or implementing KYC/AML regulatory workflows.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before writing any code
18
+ 1. Design ledger architecture using double-entry accounting principles: every transaction creates equal and opposite debits/credits, with immutable transaction logs, balance snapshots for performance, and idempotency keys to prevent duplicate charges
19
+ 2. Map regulatory compliance requirements: PCI-DSS scope (SAQ-A for payment gateway, SAQ-D for card storage), KYC verification levels (identity document, address proof, sanctions screening), AML transaction monitoring thresholds (structuring patterns, velocity checks, geographic risk)
20
+ 3. Document money movement flows with state machines: pending → authorized → captured → settled (for cards), initiated → processing → completed → reconciled (for ACH), with explicit rollback/refund paths and partial capture support
21
+
22
+ ### During implementation
23
+ - Implement financial primitives with arbitrary-precision arithmetic: use Decimal types (never floats) for all monetary amounts, store values in smallest currency unit (cents/paise), handle currency conversion with mid-market rates and spread transparency
24
+ - Build idempotent transaction endpoints: require client-generated idempotency keys (UUID v4), cache results for 24 hours, return identical response for duplicate requests (201 for first, 200 for subsequent), prevent phantom charges during network retries
25
+ - Design ledger tables with append-only semantics: never UPDATE transaction records, use compensating transactions for corrections, store audit trail with user attribution, implement row-level checksums for tamper detection
26
+ - Implement three-phase commit for distributed transactions: reserve funds (pessimistic lock), execute payment processing (call external API), commit or rollback based on response, with automatic retry logic for transient failures and dead letter queue for manual review
27
+ - Enforce PCI-DSS compliance boundaries: tokenize card data immediately (Stripe/Adyen tokens), never log full PAN, redact card numbers in UI (show last 4 digits), use TLS 1.2+ for payment gateway communication, implement network segmentation between card data environment and application servers
28
+
29
+ ### After implementation
30
+ - Execute financial reconciliation: match internal ledger balances against bank statements (daily), payment gateway settlement reports (batch ID reconciliation), and third-party wallet providers, with automated alerting for discrepancies >$10 or >0.1%
31
+ - Validate transaction integrity: sum of all debits equals sum of all credits (ledger balance proof), account balance equals sum of transaction deltas (aggregate consistency check), no orphaned transactions without matching counterparty entries
32
+ - Conduct security testing specific to financial systems: SQL injection in payment search, authorization bypass for fund transfers, race conditions in balance checks (concurrent withdrawals), replay attacks on payment endpoints, and IDOR vulnerabilities in transaction history APIs
33
+
34
+ ## Self-check before task completion
35
+ - [ ] All monetary amounts use Decimal/BigDecimal types with explicit currency codes (ISO 4217), never floating-point arithmetic
36
+ - [ ] Transaction endpoints are idempotent with client-provided idempotency keys, cached responses for duplicate requests
37
+ - [ ] Ledger implements double-entry accounting with immutable transaction records, audit trails, and balance proof validation
38
+ - [ ] PCI-DSS scope is minimized: no full card numbers stored, tokenization at payment entry point, encryption for sensitive data (AES-256-GCM)
39
+ - [ ] KYC/AML workflows implemented: identity verification (document upload + liveness check), sanctions screening (OFAC/EU lists), transaction monitoring (velocity limits, geographic risk scoring)
40
+ - [ ] Financial reconciliation automated: daily bank statement matching, payment gateway settlement verification, alerting for discrepancies
41
+ - [ ] State machine transitions documented: pending → processing → settled → reconciled, with explicit rollback/refund paths and timeout handling
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: flutter-architecture
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.4.0
5
+ status: stable
6
+ triggers: flutter architecture, widget composition pattern, flutter state management, platform channel flutter, dart design pattern, flutter navigation, flutter performance optimization, riverpod provider, flutter plugin development, flutter build runner, flutter layout pattern, flutter app architecture
7
+ ---
8
+
9
+ # Skill — Flutter Architecture & Widget Composition
10
+
11
+ ## When this skill activates
12
+ This skill activates when building Flutter applications, including widget composition strategies, state management implementation, platform channel integration, or establishing scalable app architecture patterns.
13
+
14
+ ## Mandatory actions when this skill is active
15
+
16
+ ### Before writing any code
17
+ 1. Choose state management approach based on app complexity (Riverpod for large apps, Provider for medium, setState for simple)
18
+ 2. Define navigation strategy (GoRouter for declarative routing, Navigator 2.0 for complex flows)
19
+ 3. Establish platform channel contracts for native functionality and document method signatures
20
+ 4. Plan widget composition hierarchy to maximize reusability and minimize rebuild scope
21
+
22
+ ### During implementation
23
+ - Keep widget `build()` methods pure and deterministic — move side effects to lifecycle methods or controllers
24
+ - Use `const` constructors wherever possible to enable widget caching and reduce rebuild overhead
25
+ - Implement proper widget keys (GlobalKey, ValueKey, ObjectKey) for stateful widgets in lists
26
+ - Leverage code generation (`build_runner`, `freezed`, `json_serializable`) for data models and state classes
27
+ - Separate business logic from UI using repositories, services, and view models (MVVM pattern)
28
+ - Use platform channels with proper codec (StandardMethodCodec, JSONMethodCodec) and error handling
29
+ - Implement proper dispose() methods to prevent memory leaks in StatefulWidgets and controllers
30
+
31
+ ### After implementation
32
+ - Run Flutter DevTools to profile widget rebuilds, identify expensive builds, and check memory usage
33
+ - Test on both iOS and Android with platform-specific behaviors (back button, system gestures, status bar)
34
+ - Verify hot reload works correctly — stateful widgets preserve state, providers remain intact
35
+ - Check widget test coverage for critical UI logic and integration tests for user flows
36
+
37
+ ## Self-check before task completion
38
+ - [ ] State management solution scales appropriately (no global setState, proper scoping of providers)
39
+ - [ ] Platform channels include both method calls and event channels where needed, with proper error codes
40
+ - [ ] Widget tree depth is reasonable (use composition over deep nesting, extract widgets strategically)
41
+ - [ ] Build performance is acceptable (use `flutter run --profile` to measure frame rendering times)
42
+ - [ ] Navigation handles back button, deep links, and state restoration correctly
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: gaming-backend
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.2.0
5
+ status: stable
6
+ triggers: gaming backend, multiplayer architecture, matchmaking system, game leaderboard, game state synchronization, anti-cheat system, virtual economy design, game server architecture, real-time gaming, player session management, game lobby system, competitive ranking
7
+ compose: real-time-sync
8
+ ---
9
+
10
+ # Skill — Gaming Backend
11
+
12
+ ## When this skill activates
13
+ This skill activates when building real-time multiplayer game servers, matchmaking systems, leaderboards, game state synchronization, anti-cheat systems, virtual economies, player session management, or competitive ranking systems.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before writing any code
18
+ 1. Design game state synchronization strategy: authoritative server architecture (server validates all actions), client-side prediction with server reconciliation, delta compression for bandwidth optimization, lag compensation (rewind time for hit detection), and tick rate optimization (60 Hz for fast-paced, 20 Hz for strategy)
19
+ 2. Model matchmaking algorithm: skill-based rating (ELO/Glicko-2), queue time vs match quality tradeoff, party/premade handling (avoid unfair team compositions), region-based latency constraints (<50ms preferred), and backfill logic for mid-game joins
20
+ 3. Map virtual economy flows: currency earn rates (gameplay rewards, daily login, achievements), sinks (cosmetics, upgrades, gacha), faucets (freemium currency), conversion ratios (premium to free currency), and anti-inflation mechanisms (decay, seasonal resets)
21
+
22
+ ### During implementation
23
+ - Implement authoritative game server: validate all player inputs server-side (movement, attacks, item usage), reject impossible actions (speed hacks, teleportation), maintain canonical game state, broadcast state updates to clients at fixed tick rate, handle client disconnects gracefully (AI takeover or pause)
24
+ - Build matchmaking queue system: players enter queue with skill rating and region preferences, matchmaker runs periodically (every 1-5 seconds), expands search criteria over time (relax skill range after 60s, add regions after 90s), create balanced teams (sum of ratings similar), reserve game server instance, notify players
25
+ - Design leaderboard with efficient ranking: use Redis sorted sets (ZADD for score updates, ZREVRANK for rank lookup, ZREVRANGE for top-N), store composite score (wins, kills, time), implement seasonal resets with archival, handle ties deterministically (timestamp tiebreaker), support filtering by region/mode
26
+ - Implement anti-cheat detection: server-side validation (impossible speeds, impossible accuracy), statistical anomaly detection (headshot rate >90%, reaction time <50ms), behavioral fingerprinting (mouse movement patterns), report system with manual review queue, automated bans for blatant cheats with appeal process
27
+ - Build session management: player login creates session token (JWT with short expiry), heartbeat every 30s to maintain session, detect duplicates (kick old session), handle region transfers (migrate session to nearest server), graceful shutdown notifications (5 min warning before maintenance)
28
+
29
+ ### After implementation
30
+ - Load test game servers under realistic conditions: spawn 1000+ concurrent bots with realistic behavior (movement, combat, chat), measure tick rate stability (should not drop below target), validate state synchronization (all clients see same events within latency bounds), identify performance bottlenecks (physics, pathfinding, network I/O)
31
+ - Validate matchmaking quality metrics: measure average queue time (should be <60s for 80th percentile), skill disparity in matches (std dev of player ratings <200), match abandonment rate (<5% pre-game), and player retention after first match
32
+ - Test anti-cheat effectiveness: attempt common exploits (speed hacks via Cheat Engine, aim bots, packet manipulation), verify server rejects invalid actions, check detection latency (should flag anomaly within 3 minutes), test false positive rate (<0.1% of legit players)
33
+
34
+ ## Self-check before task completion
35
+ - [ ] Game server is authoritative: validates all player inputs, rejects impossible actions, maintains canonical state, uses lag compensation for hit detection
36
+ - [ ] Matchmaking balances skill vs queue time: expands search criteria gradually, creates balanced teams, respects region/latency constraints
37
+ - [ ] Leaderboard performs at scale: Redis sorted sets for O(log N) updates, supports millions of players, handles seasonal resets with archival
38
+ - [ ] Anti-cheat detects common exploits: speed hacks, aim bots, statistical anomalies (headshot rate, reaction time), with manual review queue
39
+ - [ ] Session management robust: heartbeat mechanism, duplicate detection, graceful disconnects, region transfer support
40
+ - [ ] Virtual economy balanced: currency earn rates tuned, inflation controls (sinks match faucets), gacha odds transparent and compliant with regulations
41
+ - [ ] Real-time performance meets targets: tick rate stable under load (60 Hz for action, 20 Hz for strategy), latency <100ms for 95th percentile players
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: git-workflow-design
3
+ version: 1.0.0
4
+ min_mindforge_version: 0.3.0
5
+ status: stable
6
+ triggers: git workflow design, trunk based development, gitflow, branch policy, merge strategy, squash vs rebase, commit standard, branch naming, release branch, hotfix workflow, protected branch, merge queue
7
+ ---
8
+
9
+ # Skill — Git Workflow Design
10
+
11
+ ## When this skill activates
12
+ Any task involving git branching strategies, merge policies, commit standards,
13
+ release workflows, or repository governance.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before recommending a workflow
18
+ 1. Assess team size and release cadence.
19
+ 2. Identify deployment model (continuous vs scheduled releases).
20
+ 3. Consider CI/CD maturity and test coverage levels.
21
+
22
+ ### Trunk-Based Development
23
+
24
+ **Characteristics:**
25
+ - Main branch is always deployable.
26
+ - Short-lived feature branches (< 2 days).
27
+ - CI runs on every commit to main.
28
+ - Feature flags for incomplete work.
29
+
30
+ **Best for:** small-to-medium teams, continuous deployment, high CI maturity.
31
+
32
+ **Rules:**
33
+ - Branch from main, merge back to main.
34
+ - No long-lived branches (except main).
35
+ - Feature flags decouple deploy from release.
36
+ - Revert fast if main breaks — don't "fix forward" under pressure.
37
+
38
+ ### GitFlow
39
+
40
+ **Characteristics:**
41
+ - develop branch for integration.
42
+ - release/* branches for stabilization.
43
+ - hotfix/* branches from main for urgent fixes.
44
+ - Longer release cycles (weekly/monthly).
45
+
46
+ **Best for:** teams with scheduled releases, multiple versions in production, regulatory requirements.
47
+
48
+ **Rules:**
49
+ - Feature branches from develop.
50
+ - Release branch cut when ready — only bug fixes after cut.
51
+ - Hotfix from main, merge back to both main AND develop.
52
+ - Tag every release on main.
53
+
54
+ ### Merge strategies
55
+
56
+ **Squash merge:**
57
+ - Produces clean, linear history on main.
58
+ - One commit per PR — easy to revert entire features.
59
+ - Loses granular commit history from the branch.
60
+ - Best for: feature branches with messy/WIP commits.
61
+
62
+ **Rebase merge:**
63
+ - Linear history, preserves individual commits.
64
+ - Requires clean, meaningful commits on the branch.
65
+ - Best for: teams that enforce atomic commits.
66
+
67
+ **Merge commit:**
68
+ - Preserves branch topology (merge bubbles visible).
69
+ - Easy to see "this group of commits was one PR."
70
+ - Best for: teams that value traceability over linearity.
71
+
72
+ ### Branch naming conventions
73
+
74
+ **Format:** `type/ticket-description`
75
+
76
+ **Examples:**
77
+ - `feat/PROJ-123-add-oauth-login`
78
+ - `fix/PROJ-456-null-pointer-checkout`
79
+ - `chore/upgrade-react-19`
80
+ - `hotfix/payment-timeout`
81
+
82
+ **Rules:**
83
+ - Lowercase, hyphen-separated.
84
+ - Include ticket number when applicable.
85
+ - Keep descriptions short but meaningful.
86
+ - No personal names or dates in branch names.
87
+
88
+ ### Protected branch rules
89
+
90
+ - **Require pull request** — no direct pushes to main/develop.
91
+ - **Require CI pass** — all status checks green before merge.
92
+ - **Require review** — at least 1 approval (2 for critical paths).
93
+ - **Require up-to-date branch** — must be rebased on latest main.
94
+ - **Restrict force-push** — disabled on main, develop, release/*.
95
+ - **Require signed commits** — for regulated environments.
96
+
97
+ ### Merge queue
98
+
99
+ - Batches multiple approved PRs together.
100
+ - Tests the combined result before merging.
101
+ - Automatically reverts PRs that break the batch.
102
+ - Prevents "works individually, breaks together" scenarios.
103
+ - Available: GitHub merge queue, Mergify, Bors.
104
+
105
+ ### Commit standards
106
+
107
+ **Conventional Commits format:**
108
+ ```
109
+ type(scope): description
110
+
111
+ [optional body]
112
+
113
+ [optional footer]
114
+ ```
115
+
116
+ **Types:** feat, fix, refactor, docs, test, chore, perf, ci, build, revert.
117
+
118
+ **Rules:**
119
+ - Subject line < 72 characters.
120
+ - Imperative mood ("add" not "added").
121
+ - Body explains WHY, not WHAT (the diff shows what).
122
+ - Footer for breaking changes: `BREAKING CHANGE: description`.
123
+ - Enforce with commitlint + husky pre-commit hook.
124
+
125
+ ## Self-check before task completion
126
+ - [ ] Did I follow the mandatory actions for this skill?
127
+ - [ ] Did I apply the patterns appropriate to the context?
128
+ - [ ] Did I verify the implementation meets the criteria above?
129
+ - [ ] Did I document decisions and trade-offs made?
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: graceful-degradation
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.0.9
5
+ status: stable
6
+ triggers: graceful degradation, circuit breaker cascade, fallback hierarchy, reduced functionality mode, health-based routing, partial availability, degraded response, feature shedding, load shedding, priority-based degradation, degradation strategy, availability tier
7
+ ---
8
+
9
+ # Skill — Graceful Degradation
10
+
11
+ ## When this skill activates
12
+ Any task involving resilience under failure, circuit breakers, fallback hierarchies,
13
+ load shedding, feature shedding, or priority-based degradation design.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before writing any code
18
+ 1. Classify all features into availability tiers (critical/important/nice-to-have).
19
+ 2. Define fallback hierarchy for each external dependency.
20
+ 3. Identify degradation triggers and corresponding responses.
21
+
22
+ ### During implementation
23
+ - Circuit breakers on all external service calls.
24
+ - Fallback responses for every dependency (cache → static → error).
25
+ - Feature flags to disable non-critical features under load.
26
+ - Load shedding with priority-based request classification.
27
+
28
+ ### After implementation
29
+ - Chaos test: kill dependencies, spike load, verify partial functionality.
30
+ - Verify system remains usable when any single dependency fails.
31
+ - Document degradation playbook for on-call.
32
+
33
+ ## Availability Tiers
34
+
35
+ | Tier | Policy | Examples |
36
+ |------|--------|----------|
37
+ | Tier 1: Critical | Never shed | Auth, payments, data persistence, core API |
38
+ | Tier 2: Important | Shed under extreme load | Search, recommendations, notifications |
39
+ | Tier 3: Nice-to-have | Shed early | Personalization, A/B tracking, social features |
40
+
41
+ ## Load Shedding
42
+
43
+ ```
44
+ Priority 1 (Critical): Health checks, auth, payment finalization
45
+ Priority 2 (High): Core reads/writes, search
46
+ Priority 3 (Normal): Recommendations, analytics, batch
47
+ Priority 4 (Low): Prefetching, enrichment, non-critical webhooks
48
+ ```
49
+
50
+ - At 80% capacity: reject P4. At 90%: reject P3+P4. At 95%: P1 only.
51
+ - Return 503 with `Retry-After`. Never reject P1 (that means full outage).
52
+
53
+ ## Fallback Hierarchies
54
+
55
+ ```
56
+ Live data → Cached (recent) → Static default → Graceful error (hide widget)
57
+ ```
58
+
59
+ - Each level independently deployable and testable.
60
+ - Fallback data pre-computed and stored close to consumer.
61
+ - Never let fallback failure cascade. Log fallback frequency as health signal.
62
+
63
+ ## Circuit Breaker Design
64
+
65
+ - **Closed** (normal): requests flow, track failure rate.
66
+ - **Open** (tripped): return fallback immediately, no calls to dependency.
67
+ - **Half-Open** (probing): allow 1 request to test recovery.
68
+ - Config: 5 failures/30s → OPEN, 30s timeout → HALF-OPEN, 3 successes → CLOSED.
69
+
70
+ ### Cascade Prevention
71
+ - Timeout hierarchy: A→B=2s, B→C=500ms. When C trips in B, B returns fallback to A.
72
+ - A never sees C's failure — only potentially degraded but fast responses from B.
73
+
74
+ ## Health-Based Routing
75
+ - Each instance reports health score (0-100) based on CPU, errors, latency, memory.
76
+ - Score >80: full traffic. 50-80: reduced traffic. <50: no new traffic, drain.
77
+
78
+ ## Feature Shedding (Shed First)
79
+ 1. Search-as-you-type / autocomplete.
80
+ 2. Personalized recommendations (ML model calls).
81
+ 3. Real-time analytics / activity feeds.
82
+ 4. Image/video transcoding.
83
+ 5. Non-critical webhooks.
84
+
85
+ Automated via feature flags tied to system load. Re-enable gradually after recovery.
86
+
87
+ ## Self-check before task completion
88
+
89
+ - [ ] Are all features classified into availability tiers?
90
+ - [ ] Is there a fallback for every dependency (cache → static → error)?
91
+ - [ ] Are circuit breakers on all external calls?
92
+ - [ ] Is load shedding priority-based with correct request classification?
93
+ - [ ] Does the system remain usable when any single dependency fails?
94
+ - [ ] Are feature flags in place for non-critical shedding?
95
+ - [ ] Is the degradation playbook documented for on-call?