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,140 @@
1
+ ---
2
+ name: audit-logging
3
+ version: 1.0.0
4
+ min_mindforge_version: 0.3.0
5
+ status: stable
6
+ triggers: audit logging, immutable audit trail, audit event, who what when why, retention policy, compliance logging, tamper detection, audit query, audit archival, audit schema, change tracking, audit correlation
7
+ ---
8
+
9
+ # Skill — Audit Logging
10
+
11
+ ## When this skill activates
12
+ Any task involving audit trails, compliance logging, change tracking, tamper detection,
13
+ event recording for accountability, or data retention policies.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before implementing audit logging
18
+ 1. Identify what events must be audited (regulatory + business requirements).
19
+ 2. Define the retention policy (how long, where stored, who can access).
20
+ 3. Design the event schema before writing any code.
21
+
22
+ ### Event schema (the 5 Ws)
23
+
24
+ Every audit event MUST capture:
25
+
26
+ | Field | Description | Example |
27
+ |-------|-------------|---------|
28
+ | **who** | user_id, IP address, session_id, service account | `{ userId: "u-123", ip: "10.0.1.5", sessionId: "sess-abc" }` |
29
+ | **what** | action performed, resource affected, changes made | `{ action: "update", resource: "user/u-456", changes: { email: { from: "old@x.com", to: "new@x.com" } } }` |
30
+ | **when** | UTC timestamp, monotonic sequence number | `{ timestamp: "2025-01-15T10:30:00Z", sequence: 1042 }` |
31
+ | **why** | correlation_id, request_id, triggering event | `{ correlationId: "req-789", trigger: "user_request" }` |
32
+ | **outcome** | success or failure, error details if failed | `{ status: "success" }` or `{ status: "failure", error: "permission_denied" }` |
33
+
34
+ ### Immutability guarantees
35
+
36
+ **Append-only storage:**
37
+ - Audit table has NO UPDATE or DELETE permissions for application roles.
38
+ - Use a dedicated audit service account with INSERT-only grants.
39
+ - Application database user must not have ALTER TABLE on audit tables.
40
+
41
+ **Hash chain for tamper detection:**
42
+ ```
43
+ event.hash = SHA-256(event.data + previous_event.hash)
44
+ ```
45
+ - Each event references the hash of the previous event.
46
+ - Broken chain = tampering detected.
47
+ - Verify chain integrity on scheduled basis (daily audit job).
48
+
49
+ **Alternative: immutable storage backends:**
50
+ - AWS QLDB (purpose-built immutable ledger).
51
+ - Object storage with Object Lock (S3 with WORM).
52
+ - Append-only Kafka topic with compaction disabled.
53
+
54
+ ### Retention policy
55
+
56
+ | Tier | Duration | Storage | Access |
57
+ |------|----------|---------|--------|
58
+ | Hot | 90 days | Primary database (indexed) | Real-time query |
59
+ | Warm | 1 year | Object storage (Parquet/JSON) | Query via data warehouse |
60
+ | Cold | 7+ years | Compressed archive (Glacier/equivalent) | Manual retrieval |
61
+
62
+ **Rules:**
63
+ - Define retention per event type (auth events may need longer than UI events).
64
+ - Automate tier transitions (cron job moves hot → warm → cold).
65
+ - Deletion must be cryptographic (delete encryption key, not data) for compliance.
66
+ - Document retention policy in compliance documentation.
67
+
68
+ ### What to audit (mandatory events)
69
+
70
+ **Authentication:**
71
+ - Login success and failure (with failure reason).
72
+ - Logout.
73
+ - Password change / reset.
74
+ - MFA enrollment / removal.
75
+ - Session creation and termination.
76
+
77
+ **Authorization:**
78
+ - Permission grants and revocations.
79
+ - Role assignments and removals.
80
+ - Access denied events.
81
+
82
+ **Data mutations:**
83
+ - Create, update, delete of business entities.
84
+ - Bulk operations (with count and scope).
85
+ - Data exports and downloads.
86
+
87
+ **Admin actions:**
88
+ - Configuration changes.
89
+ - User account management (create, disable, delete).
90
+ - System setting modifications.
91
+
92
+ **Failed access attempts:**
93
+ - Rate limit violations.
94
+ - Invalid token usage.
95
+ - Attempts to access other tenants' data.
96
+
97
+ ### Querying audit logs
98
+
99
+ **Required indexes:**
100
+ - `user_id` — "show me everything user X did."
101
+ - `resource_id` — "show me everything that happened to resource Y."
102
+ - `timestamp` — "show me events in time range."
103
+ - `action` — "show me all delete events."
104
+ - `correlation_id` — "show me the full request chain."
105
+
106
+ **Search capabilities:**
107
+ - Full-text search on action descriptions.
108
+ - Filter by outcome (success/failure).
109
+ - Aggregate by user, resource, or time window.
110
+
111
+ ### Implementation patterns
112
+
113
+ **Middleware/interceptor approach:**
114
+ ```
115
+ Request → [Auth] → [Audit: log attempt] → Handler → [Audit: log outcome] → Response
116
+ ```
117
+
118
+ **Event-driven approach:**
119
+ - Domain events trigger audit entries asynchronously.
120
+ - Decouples audit from business logic.
121
+ - Risk: event loss if queue fails (use durable queue with DLQ).
122
+
123
+ **Database trigger approach:**
124
+ - PostgreSQL triggers capture all changes automatically.
125
+ - No application code needed — cannot be bypassed.
126
+ - Downside: less context (no user_id unless set in session).
127
+
128
+ ### Anti-patterns
129
+
130
+ - Logging sensitive data in audit trail (passwords, full credit card numbers).
131
+ - Audit log in same table/database as business data (lifecycle coupling).
132
+ - Synchronous audit blocking the business transaction.
133
+ - No alerting on audit failures (silent data loss).
134
+ - Audit logs accessible to the application for modification.
135
+
136
+ ## Self-check before task completion
137
+ - [ ] Did I follow the mandatory actions for this skill?
138
+ - [ ] Did I apply the patterns appropriate to the context?
139
+ - [ ] Did I verify the implementation meets the criteria above?
140
+ - [ ] Did I document decisions and trade-offs made?
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: auth-patterns
3
+ version: 1.0.0
4
+ min_mindforge_version: 0.1.0
5
+ status: stable
6
+ triggers: auth architecture design, oauth2 flow design, oidc implementation, session strategy design, jwt architecture pattern, token rotation strategy, mfa flow design, social login integration, rbac model design, abac policy engine, authorization architecture, identity provider pattern
7
+ compose: guardrails-and-safety
8
+ ---
9
+
10
+ # Skill — Auth Patterns
11
+
12
+ ## When this skill activates
13
+ Any task involving authentication flow design, authorization model selection,
14
+ token lifecycle management, MFA implementation, or identity provider integration.
15
+
16
+ ## Mandatory actions when this skill is active
17
+
18
+ ### Before writing any code
19
+ 1. Identify the auth requirements: Who are the users? What are the trust boundaries?
20
+ 2. Select the appropriate OAuth2 flow for the client type.
21
+ 3. Decide between sessions and JWTs based on revocation requirements.
22
+ 4. Map out the authorization model (RBAC vs ABAC vs hybrid).
23
+
24
+ ### During implementation
25
+ - Never store plain-text credentials anywhere.
26
+ - Use short-lived access tokens (15 min max) with long-lived refresh tokens (7 days max).
27
+ - Implement token rotation on every refresh (detect reuse = compromised).
28
+ - Check permissions in code, never roles directly.
29
+ - Log every auth failure with context (IP, user agent, timestamp).
30
+
31
+ ### After implementation
32
+ - Verify no auth bypass exists on any protected route.
33
+ - Test token expiration and refresh flows end-to-end.
34
+ - Confirm MFA cannot be bypassed via API directly.
35
+ - Run security scan on auth-related endpoints.
36
+
37
+ ## OAuth2 Flows
38
+
39
+ ### Authorization Code + PKCE (SPAs, Mobile)
40
+ ```
41
+ 1. Client generates code_verifier + code_challenge
42
+ 2. Redirect to /authorize with code_challenge
43
+ 3. User authenticates, IdP redirects with auth_code
44
+ 4. Client exchanges auth_code + code_verifier for tokens
45
+ 5. IdP verifies challenge, returns access + refresh tokens
46
+ ```
47
+ Use for: Browser apps, mobile apps, any public client.
48
+
49
+ ### Client Credentials (Machine-to-Machine)
50
+ ```
51
+ 1. Service sends client_id + client_secret to /token
52
+ 2. IdP returns access token (no refresh token needed)
53
+ 3. Service uses access token for API calls
54
+ ```
55
+ Use for: Backend services, cron jobs, microservice-to-microservice.
56
+
57
+ ### Device Authorization (CLI, TV)
58
+ ```
59
+ 1. Device requests device_code + user_code from /device/authorize
60
+ 2. User visits verification URL, enters user_code
61
+ 3. Device polls /token until user completes auth
62
+ ```
63
+ Use for: CLI tools, IoT devices, smart TVs.
64
+
65
+ ## Session vs JWT
66
+
67
+ ### Sessions (Server-Side)
68
+ - **Pros**: Instantly revocable, smaller payload, server controls lifetime.
69
+ - **Cons**: Requires session store (Redis), sticky sessions or shared store in distributed systems.
70
+ - **Use when**: You need instant revocation, have a monolith or can share session store.
71
+
72
+ ### JWT (Stateless)
73
+ - **Pros**: No server-side storage, works across services, self-contained claims.
74
+ - **Cons**: Cannot revoke until expiry (unless you add a blocklist, negating statelessness).
75
+ - **Use when**: Microservices, short-lived tokens acceptable, combined with refresh token rotation.
76
+
77
+ ### Hybrid (Recommended)
78
+ - Short-lived JWT access token (15 min) — never stored server-side.
79
+ - Long-lived refresh token (7 days) — stored server-side, rotated on each use.
80
+ - Revoke by deleting refresh token and waiting for access token expiry.
81
+
82
+ ## Token Rotation
83
+ ```
84
+ 1. Client sends refresh_token to /token
85
+ 2. Server issues NEW access_token + NEW refresh_token
86
+ 3. Server invalidates the OLD refresh_token
87
+ 4. If old refresh_token is used again → COMPROMISED
88
+ 5. Revoke entire token family (all refresh tokens for this session)
89
+ ```
90
+
91
+ ## MFA Implementation
92
+
93
+ ### TOTP (Time-Based One-Time Password) — Preferred
94
+ - Generate shared secret, encode as QR code for authenticator apps.
95
+ - Verify with time-window tolerance (±1 step = 30 seconds).
96
+ - Store backup codes (hashed) for account recovery.
97
+
98
+ ### WebAuthn / Passkeys — Most Secure
99
+ - Phishing-resistant (bound to origin).
100
+ - No shared secrets to steal.
101
+ - Use as primary or second factor.
102
+
103
+ ### SMS — Last Resort
104
+ - Vulnerable to SIM swapping.
105
+ - Use only if no alternative and combine with other signals.
106
+
107
+ ## Authorization Models
108
+
109
+ ### RBAC (Role-Based Access Control)
110
+ ```
111
+ User → Role → Permissions → Actions
112
+
113
+ // In code: check PERMISSION, not ROLE
114
+ if (user.hasPermission('posts:delete')) { ... }
115
+ // NOT: if (user.role === 'admin') { ... }
116
+ ```
117
+
118
+ ### ABAC (Attribute-Based Access Control)
119
+ ```
120
+ Policy: user.department === resource.department AND user.clearance >= resource.classification
121
+
122
+ // More flexible than RBAC, but harder to audit
123
+ const allowed = evaluatePolicy(user.attributes, resource.attributes, action);
124
+ ```
125
+
126
+ ### Hybrid (RBAC + ABAC)
127
+ - Use RBAC for coarse-grained access (can this user access this module?).
128
+ - Use ABAC for fine-grained rules (can this user edit THIS specific resource?).
129
+
130
+ ## Anti-patterns to avoid
131
+ - Storing JWT in localStorage (XSS vulnerable — use httpOnly cookies or memory).
132
+ - Checking roles instead of permissions in application code.
133
+ - Long-lived access tokens without refresh rotation.
134
+ - MFA bypass via direct API calls (always enforce server-side).
135
+ - Shared secrets in client-side code.
136
+ - Missing auth on internal/admin routes ("it's internal" is not security).
137
+
138
+ ## Self-check before task completion
139
+
140
+ Before marking a task done when this skill was active:
141
+
142
+ - [ ] No plain-text credentials stored anywhere?
143
+ - [ ] Access tokens are short-lived (≤15 min)?
144
+ - [ ] Refresh token rotation implemented and reuse detected?
145
+ - [ ] Permissions checked in code (not roles)?
146
+ - [ ] Every protected route has auth middleware?
147
+ - [ ] Auth failures logged with sufficient context?
148
+ - [ ] MFA cannot be bypassed via API?
@@ -0,0 +1,218 @@
1
+ ---
2
+ name: autonomous-agent-harness
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.0.6
5
+ status: stable
6
+ triggers: autonomous harness, persistent agent, background agent, scheduled execution, agent cron, task queue agent, self-monitoring agent, persistent memory agent, long-running agent, agent daemon, agent lifecycle, always-on agent
7
+ ---
8
+
9
+ # Skill — Autonomous Agent Harness
10
+
11
+ ## When this skill activates
12
+
13
+ When designing, implementing, or operating agents that persist beyond single
14
+ conversation sessions. Use when building infrastructure for agents that run on
15
+ schedules, maintain state across invocations, process task queues, self-monitor
16
+ their health, or operate as background daemons.
17
+
18
+ This skill covers the architecture layer between "single-shot agent conversation"
19
+ and "production autonomous system" — the harness that manages lifecycle, memory,
20
+ scheduling, and self-regulation.
21
+
22
+ ## Mandatory actions when this skill is active
23
+
24
+ ### Before designing the harness
25
+
26
+ 1. **Define the autonomy level:**
27
+
28
+ | Level | Description | Human oversight | Example |
29
+ |-------|-------------|-----------------|---------|
30
+ | L1 — Scheduled | Runs on cron, reports results | Review output post-run | Daily code review bot |
31
+ | L2 — Reactive | Triggers on events, acts within bounds | Alert on anomaly | PR auto-labeler |
32
+ | L3 — Proactive | Identifies tasks, proposes actions | Approve before execute | Dependency updater |
33
+ | L4 — Autonomous | Full loop with self-correction | Exception-only review | Incident responder |
34
+
35
+ 2. **Identify persistence requirements:**
36
+ - What state must survive between sessions? (task history, learned patterns, config)
37
+ - What is the acceptable data loss window? (none, last hour, last day)
38
+ - What is the memory format? (markdown files, SQLite, MCP server, JSON)
39
+ - How large will accumulated state grow over time?
40
+
41
+ 3. **Define boundaries and kill switches:**
42
+ - Maximum actions per invocation (prevent runaway loops)
43
+ - Maximum cost per session (token budget ceiling)
44
+ - Forbidden actions list (no force-push, no production deploys without approval)
45
+ - Human escalation triggers (confidence < threshold, high-impact decisions)
46
+ - Emergency stop mechanism (file-based kill switch, API endpoint)
47
+
48
+ ### During harness implementation
49
+
50
+ **Core architecture components:**
51
+
52
+ ```
53
+ +------------------+ +------------------+ +------------------+
54
+ | Scheduler |---->| Task Queue |---->| Agent Core |
55
+ | (cron/events) | | (FIFO+priority) | | (LLM session) |
56
+ +------------------+ +------------------+ +------------------+
57
+ |
58
+ +------------------+ |
59
+ | Self-Monitor |<-----------+
60
+ | (health/budget) | |
61
+ +------------------+ v
62
+ +------------------+
63
+ +------------------+ | Persistent |
64
+ | Kill Switch | | Memory |
65
+ | (emergency stop)| | (MCP/markdown) |
66
+ +------------------+ +------------------+
67
+ ```
68
+
69
+ **1. Persistent Memory System:**
70
+ ```
71
+ .agent-harness/
72
+ memory/
73
+ knowledge-base.md # Accumulated learnings and patterns
74
+ task-history.jsonl # Every task executed with outcome
75
+ config.json # Runtime configuration
76
+ state.json # Current operational state
77
+ queues/
78
+ pending.jsonl # Tasks awaiting execution
79
+ in-progress.jsonl # Currently executing tasks
80
+ completed.jsonl # Finished tasks (rotate after 30 days)
81
+ dead-letter.jsonl # Failed tasks after max retries
82
+ ```
83
+
84
+ - Knowledge base uses markdown for human-readable, agent-writable state
85
+ - Task history is append-only JSONL for auditability
86
+ - State file tracks: last run time, current task, health metrics, budget remaining
87
+ - Integration with MindForge memory: read from `.mindforge/memory/`, write learnings back
88
+
89
+ **2. Scheduled Execution:**
90
+ ```json
91
+ {
92
+ "schedules": [
93
+ {
94
+ "name": "daily-review",
95
+ "cron": "0 9 * * 1-5",
96
+ "task": "review-open-prs",
97
+ "timeout_minutes": 30,
98
+ "max_retries": 2
99
+ },
100
+ {
101
+ "name": "continuous-monitor",
102
+ "interval_minutes": 15,
103
+ "task": "check-deployments",
104
+ "timeout_minutes": 5,
105
+ "max_retries": 1
106
+ }
107
+ ]
108
+ }
109
+ ```
110
+
111
+ - Cron expressions for periodic tasks
112
+ - Interval-based polling for monitoring
113
+ - Event-triggered execution (webhook, file watcher, git hook)
114
+ - Each schedule entry defines timeout and retry policy independently
115
+
116
+ **3. Task Queue:**
117
+ ```json
118
+ {
119
+ "id": "task-uuid",
120
+ "created_at": "ISO-8601",
121
+ "priority": 1,
122
+ "type": "review-pr",
123
+ "payload": { "pr_number": 42, "repo": "org/project" },
124
+ "status": "pending",
125
+ "attempts": 0,
126
+ "max_attempts": 3,
127
+ "timeout_seconds": 1800,
128
+ "dead_letter_after": 3
129
+ }
130
+ ```
131
+
132
+ - FIFO within same priority level; higher priority preempts
133
+ - Retry with exponential backoff: 1min, 5min, 25min
134
+ - Dead letter queue for tasks that exceed max attempts
135
+ - Idempotency keys prevent duplicate execution
136
+
137
+ **4. Self-Monitoring:**
138
+ ```json
139
+ {
140
+ "health": {
141
+ "last_heartbeat": "ISO-8601",
142
+ "consecutive_failures": 0,
143
+ "token_budget_remaining": 45000,
144
+ "token_budget_period": "daily",
145
+ "drift_score": 0.12,
146
+ "uptime_minutes": 1440
147
+ },
148
+ "alerts": [
149
+ {
150
+ "condition": "consecutive_failures > 3",
151
+ "action": "pause_and_notify"
152
+ },
153
+ {
154
+ "condition": "token_budget_remaining < 5000",
155
+ "action": "enter_low_power_mode"
156
+ },
157
+ {
158
+ "condition": "drift_score > 0.5",
159
+ "action": "request_human_review"
160
+ }
161
+ ]
162
+ }
163
+ ```
164
+
165
+ - Heartbeat every execution cycle (detect stalls)
166
+ - Token budget tracking with low-power mode (reduce scope, not stop)
167
+ - Drift detection: compare recent outputs to baseline patterns
168
+ - Alert escalation: log → notify → pause → kill
169
+
170
+ **5. Lifecycle Management:**
171
+
172
+ ```
173
+ STARTUP → RUNNING → IDLE → WAKE → RUNNING → ... → SHUTDOWN
174
+ | | ^
175
+ | +------- ERROR -----> RECOVERING ---------+
176
+ | |
177
+ +--- BLOCKED (kill switch) ----------+
178
+ ```
179
+
180
+ - **Startup:** Load config, validate memory integrity, check kill switch, announce ready
181
+ - **Running:** Process task queue, update heartbeat, track budget
182
+ - **Idle:** No pending tasks, reduce polling frequency, maintain heartbeat
183
+ - **Wake:** New task arrived or schedule triggered, resume full operation
184
+ - **Recovering:** After error, attempt self-repair, reload state, retry last task
185
+ - **Shutdown:** Graceful — complete current task, flush state, log final report
186
+ - **Blocked:** Kill switch active — cease all operations, preserve state, await unblock
187
+
188
+ ### After harness deployment
189
+
190
+ 1. **Operational verification:**
191
+ - Run a canary task through the full pipeline (schedule → queue → execute → report)
192
+ - Verify memory persistence across restarts
193
+ - Test kill switch responsiveness (must halt within 1 execution cycle)
194
+ - Confirm dead letter queue captures failed tasks correctly
195
+ - Validate budget tracking accuracy
196
+
197
+ 2. **Monitoring setup:**
198
+ - Dashboard showing: queue depth, success rate, token spend, last heartbeat
199
+ - Alerts for: stall (no heartbeat in 2x interval), budget exhaustion, error spike
200
+ - Weekly summary: tasks completed, failures, cost, learnings accumulated
201
+
202
+ 3. **Maintenance cadence:**
203
+ - Daily: review dead letter queue, check for stale tasks
204
+ - Weekly: rotate completed task log, prune knowledge base, verify budget projections
205
+ - Monthly: review drift trends, update boundaries, assess autonomy level appropriateness
206
+
207
+ ## Self-check before task completion
208
+
209
+ Before marking an autonomous harness task done:
210
+
211
+ - [ ] Did I define the autonomy level and appropriate human oversight?
212
+ - [ ] Did I implement all 5 core components (memory, scheduler, queue, monitor, lifecycle)?
213
+ - [ ] Did I define explicit boundaries (max actions, budget ceiling, forbidden actions)?
214
+ - [ ] Did I implement a kill switch that halts within one execution cycle?
215
+ - [ ] Did I set up retry logic with dead letter queue for failed tasks?
216
+ - [ ] Did I configure self-monitoring with escalating alert thresholds?
217
+ - [ ] Did I test the full lifecycle (startup through shutdown)?
218
+ - [ ] Did I integrate with MindForge's existing memory and autonomous engine?
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: autonomous-agents
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.5.0
5
+ status: stable
6
+ triggers: autonomous agent design, agent loop architecture, tool use orchestration, AI planning system, agent self-correction, agentic workflow, agent reasoning loop, multi-agent collaboration, agent task decomposition, agent goal pursuit, agent reflection pattern, autonomous decision making
7
+ compose:
8
+ - agent-orchestration-patterns
9
+ ---
10
+
11
+ # Autonomous Agents & Reasoning Loops
12
+
13
+ ## When this skill activates
14
+
15
+ This skill activates when building autonomous agents that pursue goals independently, implement planning and reasoning loops, use tools dynamically, self-correct errors, or coordinate across multiple agents. It applies to systems where AI must operate with minimal human intervention across multi-step tasks.
16
+
17
+ ## Mandatory actions when this skill is active
18
+
19
+ ### Before writing any code
20
+
21
+ 1. **Define agent scope and boundaries** — Specify what the agent can do (available tools, permitted actions) and cannot do (restricted tools, human approval required). Define goal structure: explicit goals (user-provided task), implicit goals (system constraints, safety rules), and emergent goals (agent-discovered subgoals). Unbounded agents are dangerous.
22
+ 2. **Design the reasoning loop** — Choose loop architecture: ReAct (Reasoning + Acting), Plan-Act-Reflect, or Chain-of-Thought with Tool Use. Define loop termination conditions: goal achieved, max iterations reached (prevent infinite loops), error threshold exceeded, or human intervention requested. Document loop explicitly.
23
+ 3. **Select tool inventory** — Identify tools the agent can use: APIs (web search, database queries), code execution (sandboxed interpreters), file operations (read/write), external services (send email, create tickets). For each tool, define input schema, output schema, error modes, and safety constraints (rate limits, authorization).
24
+ 4. **Establish self-correction mechanisms** — Agents make mistakes (hallucinations, tool errors, reasoning failures). Design self-correction: validation (check outputs against constraints), reflection (analyze failures and adjust strategy), and retry logic (re-attempt with modified approach). Define max retry count to prevent infinite loops.
25
+
26
+ ### During implementation
27
+
28
+ - **Implement explicit planning phase** — Before acting, the agent should decompose the goal into subtasks (task decomposition), estimate feasibility, and select tools. Plan structure: {goal, subtasks: [{action, tool, expected_outcome}], constraints, success_criteria}. Plans must be inspectable and modifiable by humans.
29
+ - **Design tool calling with error handling** — Wrap every tool call in try-catch with explicit error handling: retry on transient errors (network failures, rate limits), escalate on permanent errors (invalid credentials, malformed inputs), and degrade gracefully (skip optional steps, use fallback tools). Log all tool calls with inputs, outputs, and errors.
30
+ - **Build reflection and self-critique loops** — After each action or subtask completion, the agent should reflect: "Did this action achieve the expected outcome? If not, why? What should I try next?" Use structured reflection prompts: {action_taken, expected_outcome, actual_outcome, error_analysis, next_action}. Reflection improves multi-step task success rates by 20-40%.
31
+ - **Implement goal-state tracking** — Maintain explicit state: current goal, progress toward goal (% complete, subtasks finished), blockers (errors, missing information), and next planned action. State must be serializable and resumable (agent can pause and resume later). Use structured state representations (JSON, database records).
32
+ - **Design safety constraints** — Prevent harmful actions via pre-execution checks: validate tool inputs against safety rules (no file deletion without confirmation, no email to external addresses without review), enforce rate limits (max N API calls per minute), and require human approval for high-risk actions (financial transactions, data deletion).
33
+ - **Implement multi-agent coordination** — When multiple agents collaborate, define communication protocols: message passing (agents send structured messages), shared state (agents read/write common store), or supervisor coordination (central agent dispatches tasks). Avoid race conditions and deadlocks: use locks, optimistic concurrency, or single-writer patterns.
34
+
35
+ ### After implementation
36
+
37
+ - **Validate goal completion accuracy** — Test the agent on a suite of goals with known correct solutions. Measure success rate (% of goals fully achieved), partial success rate (% of goals partially achieved), and failure modes (why did the agent fail?). Target: >80% success rate for well-defined goals.
38
+ - **Measure loop efficiency** — Track iterations per goal (how many reasoning steps until completion). More iterations = higher cost and latency. Target: <10 iterations for most tasks. If higher, improve planning quality or provide better tools.
39
+ - **Test self-correction effectiveness** — Simulate tool errors (API returns invalid data, file not found, timeout) and validate that the agent recovers gracefully. Measure recovery rate (% of errors successfully handled without human intervention). Target: >70% recovery rate.
40
+ - **Audit for infinite loops and runaway costs** — Test with adversarial goals designed to trigger infinite loops (unsolvable tasks, circular dependencies). Validate that termination conditions activate (max iterations, timeout, error threshold). Monitor token usage and cost per goal in production.
41
+
42
+ ## Self-check before task completion
43
+
44
+ - [ ] Agent scope is defined with explicit permitted and restricted tools
45
+ - [ ] Goal structure includes explicit (user-provided), implicit (system constraints), and emergent goals
46
+ - [ ] Reasoning loop architecture (ReAct/Plan-Act-Reflect/CoT+Tools) is selected and documented
47
+ - [ ] Loop termination conditions prevent infinite loops (max iterations, timeout, error threshold)
48
+ - [ ] Tool inventory is documented with input/output schemas and error modes per tool
49
+ - [ ] Self-correction mechanisms include validation, reflection, and retry logic with max retry limits
50
+ - [ ] Planning phase decomposes goals into subtasks with feasibility estimates
51
+ - [ ] Tool calls are wrapped with error handling (retry transient, escalate permanent, degrade gracefully)
52
+ - [ ] Reflection loops analyze action outcomes and adjust strategy ({action, expected, actual, error_analysis, next})
53
+ - [ ] Goal-state tracking maintains serializable, resumable state (progress, blockers, next action)
54
+ - [ ] Safety constraints validate tool inputs pre-execution and enforce rate limits
55
+ - [ ] Multi-agent coordination uses message passing, shared state, or supervisor patterns without race conditions
56
+ - [ ] Goal completion accuracy is validated at >80% success rate on test suite
57
+ - [ ] Loop efficiency is measured (target <10 iterations per task)
58
+ - [ ] Self-correction effectiveness is tested with simulated tool errors (target >70% recovery rate)
59
+ - [ ] Infinite loop prevention is validated with adversarial goals and termination condition testing
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: build-system-optimization
3
+ version: 1.0.0
4
+ min_mindforge_version: 10.7.0
5
+ status: stable
6
+ triggers: build system optimization, build cache architecture, incremental build design, remote build execution, dependency graph optimization, build farm design, Bazel Buck optimization, build time reduction, distributed build, build artifact caching, hermetic build, build reproducibility
7
+ ---
8
+
9
+ # Skill — Build System Optimization
10
+
11
+ ## When this skill activates
12
+
13
+ This skill activates when the user is optimizing build systems for speed and reliability. This includes build cache architecture, incremental builds, remote build execution, dependency graph optimization, build farm design, Bazel/Buck/Gradle optimization, build time reduction, distributed builds, artifact caching, hermetic builds, and build reproducibility.
14
+
15
+ ## Mandatory actions when this skill is active
16
+
17
+ ### Before writing any code
18
+
19
+ 1. Establish baseline build times: clean build (no cache), incremental build (single file change), and CI build. Measure p50, p95, p99.
20
+ 2. Profile the build to identify bottlenecks: dependency resolution, compilation, linking, testing, packaging. Use build system profiling tools (Gradle Build Scan, Bazel analyze-profile).
21
+ 3. Audit dependency graph: identify unnecessary dependencies, circular dependencies, and overly-coupled modules.
22
+ 4. Assess cache hit rates: local cache, remote cache, CI cache. Identify cache invalidation causes (non-deterministic inputs, timestamp dependencies).
23
+ 5. Determine build reproducibility: same source + same toolchain = identical binary. Test by building twice and comparing checksums.
24
+
25
+ ### During implementation
26
+
27
+ - **Incremental Builds:** Only rebuild changed modules and their dependents. Requires accurate dependency tracking. Bazel and Buck are incremental by design. Gradle requires careful task input/output declaration. Target: single-file change rebuild in under 30 seconds.
28
+ - **Build Caching:** Layer caching at multiple levels: local (developer machine), shared (team), remote (CI). Use content-addressable storage (hash inputs to determine cache key). Cache should serve 80%+ of CI builds from cache.
29
+ - **Remote Build Execution:** Offload compilation and tests to remote workers (Bazel Remote Execution, BuildBuddy, Gradle Enterprise). Provides massive parallelism (100+ workers). Requires hermetic builds.
30
+ - **Dependency Graph Optimization:** Reduce fan-out (modules with many dependents). Split large modules into smaller ones. Use interface modules to break circular dependencies. Visualize graph with Bazel query or Gradle's dependency graph plugin.
31
+ - **Hermetic Builds:** All inputs (source, toolchain, dependencies) must be explicit. No reliance on global state (env vars, system tools, internet access during build). Hermetic builds enable reproducibility and remote caching.
32
+ - **Build Artifact Caching:** Cache compiled binaries, test results, and packaged artifacts. Use content-addressable storage (Artifactory, Nexus, S3). Artifacts should be immutable (never overwrite).
33
+ - **Parallelization:** Build independent modules in parallel. Bazel parallelizes by default. Gradle requires `org.gradle.parallel=true`. Monitor CPU utilization (target: 80%+ during build).
34
+ - **Build Farm Design:** Centralized build cluster with auto-scaling workers. Use spot instances for cost savings. Workers should be stateless and ephemeral. Monitor queue depth and scale workers accordingly.
35
+ - **Build Time Reduction Targets:** Clean build under 10 minutes. Incremental build under 1 minute. CI build (with cache) under 5 minutes.
36
+
37
+ ### After implementation
38
+
39
+ - Verify incremental builds only rebuild changed modules and dependents (use build system logs to confirm).
40
+ - Confirm cache hit rates exceed 80% in CI and 90% for developers (for incremental builds).
41
+ - Validate remote build execution distributes work across workers (monitor parallelism and CPU utilization).
42
+ - Ensure builds are hermetic by building in a clean container and comparing output checksums.
43
+ - Check that build artifact cache is content-addressable and serves artifacts in under 2 seconds.
44
+
45
+ ## Self-check before task completion
46
+
47
+ - [ ] Baseline build times are measured (clean, incremental, CI) and tracked over time.
48
+ - [ ] Incremental builds only rebuild changed modules (verified via build logs).
49
+ - [ ] Build caching achieves 80%+ cache hit rate in CI.
50
+ - [ ] Remote build execution distributes work across workers with 80%+ CPU utilization.
51
+ - [ ] Dependency graph is optimized (reduced fan-out, no circular dependencies).
52
+ - [ ] Builds are hermetic (no reliance on global state or internet access).
53
+ - [ ] Build artifacts are cached in content-addressable storage and immutable.
54
+ - [ ] Build time targets are met: clean <10min, incremental <1min, CI <5min.