mindforge-cc 11.3.1 → 11.5.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 (475) hide show
  1. package/.agent/CLAUDE.md +13 -0
  2. package/.agent/hooks/lib/hook-flags.js +78 -0
  3. package/.agent/hooks/lib/pretooluse-visible-output.js +46 -0
  4. package/.agent/hooks/mindforge-block-no-verify.js +552 -0
  5. package/.agent/hooks/mindforge-config-protection.js +144 -0
  6. package/.agent/hooks/run-with-flags.js +207 -0
  7. package/.agent/mindforge/checkpoint.md +76 -0
  8. package/.agent/mindforge/harness-audit.md +59 -0
  9. package/.agent/mindforge/instinct.md +46 -0
  10. package/.agent/mindforge/orch-add-feature.md +43 -0
  11. package/.agent/mindforge/orch-build-mvp.md +48 -0
  12. package/.agent/mindforge/orch-change-feature.md +45 -0
  13. package/.agent/mindforge/orch-fix-defect.md +43 -0
  14. package/.agent/mindforge/orch-refine-code.md +43 -0
  15. package/.agent/skills/mindforge-add-backlog/SKILL.md +2 -2
  16. package/.agent/skills/mindforge-add-phase/SKILL.md +2 -2
  17. package/.agent/skills/mindforge-add-tests/SKILL.md +2 -2
  18. package/.agent/skills/mindforge-add-todo/SKILL.md +2 -2
  19. package/.agent/skills/mindforge-audit-milestone/SKILL.md +2 -2
  20. package/.agent/skills/mindforge-audit-uat/SKILL.md +2 -2
  21. package/.agent/skills/mindforge-autonomous/SKILL.md +2 -2
  22. package/.agent/skills/mindforge-brainstorming/SKILL.md +1 -1
  23. package/.agent/skills/mindforge-check-todos/SKILL.md +2 -2
  24. package/.agent/skills/mindforge-cleanup/SKILL.md +2 -2
  25. package/.agent/skills/mindforge-complete-milestone/SKILL.md +2 -2
  26. package/.agent/skills/mindforge-debug/SKILL.md +2 -2
  27. package/.agent/skills/mindforge-debug_extended/SKILL.md +2 -2
  28. package/.agent/skills/mindforge-discuss-phase/SKILL.md +2 -2
  29. package/.agent/skills/mindforge-do/SKILL.md +2 -2
  30. package/.agent/skills/mindforge-execute-phase/SKILL.md +2 -2
  31. package/.agent/skills/mindforge-execute-phase_extended/SKILL.md +2 -2
  32. package/.agent/skills/mindforge-fast/SKILL.md +2 -2
  33. package/.agent/skills/mindforge-forensics/SKILL.md +2 -2
  34. package/.agent/skills/mindforge-health/SKILL.md +2 -2
  35. package/.agent/skills/mindforge-help/SKILL.md +2 -2
  36. package/.agent/skills/mindforge-insert-phase/SKILL.md +2 -2
  37. package/.agent/skills/mindforge-join-discord/SKILL.md +2 -2
  38. package/.agent/skills/mindforge-list-phase-assumptions/SKILL.md +2 -2
  39. package/.agent/skills/mindforge-list-workspaces/SKILL.md +2 -2
  40. package/.agent/skills/mindforge-manager/SKILL.md +2 -2
  41. package/.agent/skills/mindforge-map-codebase/SKILL.md +2 -2
  42. package/.agent/skills/mindforge-milestone-summary/SKILL.md +2 -2
  43. package/.agent/skills/mindforge-neural-orchestrator/SKILL.md +2 -2
  44. package/.agent/skills/mindforge-new-milestone/SKILL.md +2 -2
  45. package/.agent/skills/mindforge-new-project/SKILL.md +2 -2
  46. package/.agent/skills/mindforge-new-workspace/SKILL.md +2 -2
  47. package/.agent/skills/mindforge-next/SKILL.md +2 -2
  48. package/.agent/skills/mindforge-note/SKILL.md +2 -2
  49. package/.agent/skills/mindforge-parallel-mesh_extended/SKILL.md +2 -2
  50. package/.agent/skills/mindforge-pause-work/SKILL.md +2 -2
  51. package/.agent/skills/mindforge-plan-milestone-gaps/SKILL.md +2 -2
  52. package/.agent/skills/mindforge-plan-phase/SKILL.md +2 -2
  53. package/.agent/skills/mindforge-plan-phase_extended/SKILL.md +2 -2
  54. package/.agent/skills/mindforge-plant-seed/SKILL.md +2 -2
  55. package/.agent/skills/mindforge-pr-branch/SKILL.md +2 -2
  56. package/.agent/skills/mindforge-profile-user/SKILL.md +2 -2
  57. package/.agent/skills/mindforge-progress/SKILL.md +2 -2
  58. package/.agent/skills/mindforge-quick/SKILL.md +2 -2
  59. package/.agent/skills/mindforge-reapply-patches/SKILL.md +2 -2
  60. package/.agent/skills/mindforge-remove-phase/SKILL.md +2 -2
  61. package/.agent/skills/mindforge-remove-workspace/SKILL.md +2 -2
  62. package/.agent/skills/mindforge-research-phase/SKILL.md +2 -2
  63. package/.agent/skills/mindforge-resume-work/SKILL.md +2 -2
  64. package/.agent/skills/mindforge-review/SKILL.md +2 -2
  65. package/.agent/skills/mindforge-review-backlog/SKILL.md +2 -2
  66. package/.agent/skills/mindforge-review-inbound/SKILL.md +2 -2
  67. package/.agent/skills/mindforge-review-request/SKILL.md +2 -2
  68. package/.agent/skills/mindforge-session-report/SKILL.md +2 -2
  69. package/.agent/skills/mindforge-set-profile/SKILL.md +2 -2
  70. package/.agent/skills/mindforge-settings/SKILL.md +2 -2
  71. package/.agent/skills/mindforge-ship/SKILL.md +2 -2
  72. package/.agent/skills/mindforge-ship_extended/SKILL.md +2 -2
  73. package/.agent/skills/mindforge-skill-creation/SKILL.md +2 -2
  74. package/.agent/skills/mindforge-stats/SKILL.md +2 -2
  75. package/.agent/skills/mindforge-swarm-execution/SKILL.md +2 -2
  76. package/.agent/skills/mindforge-system-architecture/SKILL.md +2 -2
  77. package/.agent/skills/mindforge-tdd/SKILL.md +2 -2
  78. package/.agent/skills/mindforge-tdd_extended/SKILL.md +2 -2
  79. package/.agent/skills/mindforge-thread/SKILL.md +2 -2
  80. package/.agent/skills/mindforge-ui-phase/SKILL.md +2 -2
  81. package/.agent/skills/mindforge-ui-review/SKILL.md +2 -2
  82. package/.agent/skills/mindforge-update/SKILL.md +2 -2
  83. package/.agent/skills/mindforge-validate-phase/SKILL.md +2 -2
  84. package/.agent/skills/mindforge-verify-work/SKILL.md +2 -2
  85. package/.agent/skills/mindforge-verify-work_extended/SKILL.md +2 -2
  86. package/.agent/skills/mindforge-workspace-isolated/SKILL.md +2 -2
  87. package/.agent/skills/mindforge-workstreams/SKILL.md +2 -2
  88. package/.claude/CLAUDE.md +13 -0
  89. package/.claude/commands/mindforge/add-backlog.md +2 -2
  90. package/.claude/commands/mindforge/agent-deploy.md +1 -1
  91. package/.claude/commands/mindforge/agent-design.md +1 -1
  92. package/.claude/commands/mindforge/agent.md +2 -2
  93. package/.claude/commands/mindforge/ai-cost.md +1 -1
  94. package/.claude/commands/mindforge/ai-safety.md +1 -1
  95. package/.claude/commands/mindforge/approve.md +1 -1
  96. package/.claude/commands/mindforge/audit.md +1 -1
  97. package/.claude/commands/mindforge/auto.md +1 -1
  98. package/.claude/commands/mindforge/benchmark.md +1 -1
  99. package/.claude/commands/mindforge/browse.md +1 -1
  100. package/.claude/commands/mindforge/build-opt.md +1 -1
  101. package/.claude/commands/mindforge/cache.md +1 -1
  102. package/.claude/commands/mindforge/causal.md +1 -1
  103. package/.claude/commands/mindforge/cdn.md +1 -1
  104. package/.claude/commands/mindforge/change.md +1 -1
  105. package/.claude/commands/mindforge/checkpoint.md +76 -0
  106. package/.claude/commands/mindforge/cli.md +1 -1
  107. package/.claude/commands/mindforge/cluster-instincts.md +1 -1
  108. package/.claude/commands/mindforge/communicate.md +1 -1
  109. package/.claude/commands/mindforge/complete-milestone.md +1 -1
  110. package/.claude/commands/mindforge/compliance.md +1 -1
  111. package/.claude/commands/mindforge/consult.md +1 -1
  112. package/.claude/commands/mindforge/contract-test.md +1 -1
  113. package/.claude/commands/mindforge/cost-report.md +1 -1
  114. package/.claude/commands/mindforge/costs.md +1 -1
  115. package/.claude/commands/mindforge/council.md +1 -1
  116. package/.claude/commands/mindforge/create-skill.md +1 -1
  117. package/.claude/commands/mindforge/cross-review.md +1 -1
  118. package/.claude/commands/mindforge/dashboard.md +1 -1
  119. package/.claude/commands/mindforge/data-mesh.md +1 -1
  120. package/.claude/commands/mindforge/data-pipeline.md +1 -1
  121. package/.claude/commands/mindforge/de-slop.md +1 -1
  122. package/.claude/commands/mindforge/debug.md +1 -1
  123. package/.claude/commands/mindforge/degrade.md +1 -1
  124. package/.claude/commands/mindforge/delegate.md +1 -1
  125. package/.claude/commands/mindforge/deploy.md +1 -1
  126. package/.claude/commands/mindforge/discuss-phase.md +1 -1
  127. package/.claude/commands/mindforge/dmux.md +1 -1
  128. package/.claude/commands/mindforge/do.md +2 -2
  129. package/.claude/commands/mindforge/ecommerce.md +1 -1
  130. package/.claude/commands/mindforge/edge.md +1 -1
  131. package/.claude/commands/mindforge/edtech.md +1 -1
  132. package/.claude/commands/mindforge/embeddings.md +1 -1
  133. package/.claude/commands/mindforge/environments.md +1 -1
  134. package/.claude/commands/mindforge/eval.md +1 -1
  135. package/.claude/commands/mindforge/events.md +1 -1
  136. package/.claude/commands/mindforge/evolve-skills.md +1 -1
  137. package/.claude/commands/mindforge/execute-phase.md +48 -7
  138. package/.claude/commands/mindforge/feature-flags.md +1 -1
  139. package/.claude/commands/mindforge/feature-store.md +1 -1
  140. package/.claude/commands/mindforge/finops.md +1 -1
  141. package/.claude/commands/mindforge/fintech.md +1 -1
  142. package/.claude/commands/mindforge/flutter.md +1 -1
  143. package/.claude/commands/mindforge/gaming.md +1 -1
  144. package/.claude/commands/mindforge/graphql.md +1 -1
  145. package/.claude/commands/mindforge/harness-audit.md +59 -0
  146. package/.claude/commands/mindforge/health.md +1 -1
  147. package/.claude/commands/mindforge/healthcare.md +1 -1
  148. package/.claude/commands/mindforge/help.md +1 -1
  149. package/.claude/commands/mindforge/hire.md +1 -1
  150. package/.claude/commands/mindforge/i18n.md +1 -1
  151. package/.claude/commands/mindforge/idempotent.md +1 -1
  152. package/.claude/commands/mindforge/init-org.md +1 -1
  153. package/.claude/commands/mindforge/init-project.md +1 -1
  154. package/.claude/commands/mindforge/install-skill.md +1 -1
  155. package/.claude/commands/mindforge/instinct.md +46 -0
  156. package/.claude/commands/mindforge/introspect.md +1 -1
  157. package/.claude/commands/mindforge/iot.md +1 -1
  158. package/.claude/commands/mindforge/knowledge-graph.md +1 -1
  159. package/.claude/commands/mindforge/lakehouse.md +1 -1
  160. package/.claude/commands/mindforge/lead.md +1 -1
  161. package/.claude/commands/mindforge/learn-instinct.md +1 -1
  162. package/.claude/commands/mindforge/learn.md +1 -1
  163. package/.claude/commands/mindforge/learning.md +1 -1
  164. package/.claude/commands/mindforge/llm-route.md +1 -1
  165. package/.claude/commands/mindforge/load-test.md +1 -1
  166. package/.claude/commands/mindforge/logistics.md +1 -1
  167. package/.claude/commands/mindforge/map-codebase.md +1 -1
  168. package/.claude/commands/mindforge/marketplace.md +1 -1
  169. package/.claude/commands/mindforge/meeting-design.md +1 -1
  170. package/.claude/commands/mindforge/metrics.md +1 -1
  171. package/.claude/commands/mindforge/migrate.md +1 -1
  172. package/.claude/commands/mindforge/migration-mgmt.md +1 -1
  173. package/.claude/commands/mindforge/milestone.md +1 -1
  174. package/.claude/commands/mindforge/mobile.md +1 -1
  175. package/.claude/commands/mindforge/monorepo.md +1 -1
  176. package/.claude/commands/mindforge/multi-tenant.md +1 -1
  177. package/.claude/commands/mindforge/multimodal.md +1 -1
  178. package/.claude/commands/mindforge/new-runtime.md +1 -1
  179. package/.claude/commands/mindforge/next.md +1 -1
  180. package/.claude/commands/mindforge/note.md +2 -2
  181. package/.claude/commands/mindforge/observability-platform.md +1 -1
  182. package/.claude/commands/mindforge/offline.md +1 -1
  183. package/.claude/commands/mindforge/onboard.md +1 -1
  184. package/.claude/commands/mindforge/orch-add-feature.md +43 -0
  185. package/.claude/commands/mindforge/orch-build-mvp.md +48 -0
  186. package/.claude/commands/mindforge/orch-change-feature.md +45 -0
  187. package/.claude/commands/mindforge/orch-fix-defect.md +43 -0
  188. package/.claude/commands/mindforge/orch-refine-code.md +43 -0
  189. package/.claude/commands/mindforge/plan-phase.md +1 -1
  190. package/.claude/commands/mindforge/plan-write.md +11 -0
  191. package/.claude/commands/mindforge/plant-seed.md +2 -2
  192. package/.claude/commands/mindforge/platform.md +1 -1
  193. package/.claude/commands/mindforge/plugins.md +1 -1
  194. package/.claude/commands/mindforge/pr-review.md +1 -1
  195. package/.claude/commands/mindforge/privacy-eng.md +1 -1
  196. package/.claude/commands/mindforge/product-spec.md +76 -0
  197. package/.claude/commands/mindforge/profile-team.md +1 -1
  198. package/.claude/commands/mindforge/publish-skill.md +1 -1
  199. package/.claude/commands/mindforge/push-notify.md +1 -1
  200. package/.claude/commands/mindforge/pwa.md +1 -1
  201. package/.claude/commands/mindforge/qa.md +1 -1
  202. package/.claude/commands/mindforge/quality-audit.md +1 -1
  203. package/.claude/commands/mindforge/queue.md +1 -1
  204. package/.claude/commands/mindforge/quick.md +1 -1
  205. package/.claude/commands/mindforge/rag.md +1 -1
  206. package/.claude/commands/mindforge/rate-limit.md +1 -1
  207. package/.claude/commands/mindforge/react-native.md +1 -1
  208. package/.claude/commands/mindforge/realtime-analytics.md +1 -1
  209. package/.claude/commands/mindforge/record-learning.md +1 -1
  210. package/.claude/commands/mindforge/release.md +1 -1
  211. package/.claude/commands/mindforge/remember.md +1 -1
  212. package/.claude/commands/mindforge/research.md +1 -1
  213. package/.claude/commands/mindforge/retrospective.md +1 -1
  214. package/.claude/commands/mindforge/review-backlog.md +2 -2
  215. package/.claude/commands/mindforge/review.md +1 -1
  216. package/.claude/commands/mindforge/rfc.md +1 -1
  217. package/.claude/commands/mindforge/santa.md +1 -1
  218. package/.claude/commands/mindforge/secrets-mgmt.md +1 -1
  219. package/.claude/commands/mindforge/secrets.md +1 -1
  220. package/.claude/commands/mindforge/security-scan.md +1 -1
  221. package/.claude/commands/mindforge/serverless.md +1 -1
  222. package/.claude/commands/mindforge/session-report.md +2 -2
  223. package/.claude/commands/mindforge/ship.md +1 -1
  224. package/.claude/commands/mindforge/skills.md +1 -1
  225. package/.claude/commands/mindforge/status.md +1 -1
  226. package/.claude/commands/mindforge/steer.md +1 -1
  227. package/.claude/commands/mindforge/stream.md +1 -1
  228. package/.claude/commands/mindforge/sync-confluence.md +1 -1
  229. package/.claude/commands/mindforge/sync-jira.md +1 -1
  230. package/.claude/commands/mindforge/tech-debt.md +1 -1
  231. package/.claude/commands/mindforge/threat-model.md +1 -1
  232. package/.claude/commands/mindforge/tokens.md +1 -1
  233. package/.claude/commands/mindforge/ui-phase.md +2 -2
  234. package/.claude/commands/mindforge/ui-review.md +2 -2
  235. package/.claude/commands/mindforge/update.md +1 -1
  236. package/.claude/commands/mindforge/validate-phase.md +2 -2
  237. package/.claude/commands/mindforge/verify-loop.md +1 -1
  238. package/.claude/commands/mindforge/verify-phase.md +1 -1
  239. package/.claude/commands/mindforge/vibe-check.md +1 -1
  240. package/.claude/commands/mindforge/workspace.md +1 -1
  241. package/.claude/commands/mindforge/workstreams.md +2 -2
  242. package/.claude/commands/mindforge/zero-trust.md +1 -1
  243. package/.mindforge/config.json +2 -2
  244. package/.mindforge/engine/instincts/instinct-schema.md +17 -9
  245. package/.mindforge/imported-agents.jsonl +10 -0
  246. package/.mindforge/manifests/install-components.json +36 -0
  247. package/.mindforge/manifests/install-modules.json +193 -0
  248. package/.mindforge/manifests/install-profiles.json +57 -0
  249. package/.mindforge/memory/sync-manifest.json +1 -1
  250. package/.mindforge/personas/gan-evaluator.md +226 -0
  251. package/.mindforge/personas/gan-generator.md +151 -0
  252. package/.mindforge/personas/gan-planner.md +118 -0
  253. package/.mindforge/personas/harness-optimizer.md +55 -0
  254. package/.mindforge/personas/loop-operator.md +58 -0
  255. package/.mindforge/schemas/hooks.schema.json +199 -0
  256. package/.mindforge/schemas/install-modules.schema.json +44 -0
  257. package/.mindforge/schemas/install-state.schema.json +95 -0
  258. package/.mindforge/schemas/plugin.schema.json +75 -0
  259. package/.mindforge/schemas/provenance.schema.json +31 -0
  260. package/.mindforge/skills/agent-architecture-audit/SKILL.md +272 -0
  261. package/.mindforge/skills/continuous-learning/SKILL.md +16 -0
  262. package/.mindforge/skills/orch-pipeline/SKILL.md +284 -0
  263. package/.mindforge/skills/writing-plans/SKILL.md +76 -0
  264. package/CHANGELOG.md +111 -0
  265. package/MINDFORGE.md +3 -3
  266. package/README.md +25 -3
  267. package/RELEASENOTES.md +131 -1
  268. package/SECURITY.md +16 -0
  269. package/bin/autonomous/auto-runner.js +46 -5
  270. package/bin/autonomous/handoff-schema.js +114 -0
  271. package/bin/autonomous/session-guardian.sh +138 -0
  272. package/bin/autonomous/supervisor.js +98 -0
  273. package/bin/change-classifier.js +19 -5
  274. package/bin/governance/approve.js +61 -28
  275. package/bin/governance/config-manager.js +3 -1
  276. package/bin/governance/rbac-manager.js +14 -6
  277. package/bin/harness-audit.js +520 -0
  278. package/bin/hooks/instinct-capture-hook.js +16 -1
  279. package/bin/hooks/lib/detect-project.js +72 -0
  280. package/bin/installer/harness-adapter-compliance.js +321 -0
  281. package/bin/installer/install-manifests.js +200 -0
  282. package/bin/installer/install-state.js +243 -0
  283. package/bin/installer-core.js +1 -1
  284. package/bin/learning/instinct-cli.js +359 -0
  285. package/bin/learning/lib/ssrf-guard.js +252 -0
  286. package/bin/memory/eis-client.js +31 -10
  287. package/bin/models/llm-errors.js +79 -0
  288. package/bin/models/model-client.js +39 -4
  289. package/bin/models/ollama-provider.js +115 -0
  290. package/bin/models/openai-provider.js +40 -9
  291. package/bin/models/profiles-loader.js +147 -0
  292. package/bin/models/provider-registry.js +59 -0
  293. package/bin/revops/market-evaluator.js +23 -2
  294. package/bin/revops/router-steering-v2.js +17 -2
  295. package/bin/security/trust-boundaries.js +15 -3
  296. package/bin/utils/readiness-gate.js +169 -0
  297. package/bin/worktree/engine.js +497 -0
  298. package/docs/getting-started.md +1 -1
  299. package/docs/troubleshooting.md +1 -1
  300. package/docs/user-guide.md +1 -1
  301. package/package.json +8 -2
  302. package/subagents/categories/01-core-development/.claude-plugin/plugin.json +2 -2
  303. package/subagents/categories/01-core-development/api-designer-cc.md +1 -1
  304. package/subagents/categories/01-core-development/backend-developer.md +1 -1
  305. package/subagents/categories/01-core-development/design-bridge.md +1 -1
  306. package/subagents/categories/01-core-development/electron-pro.md +1 -1
  307. package/subagents/categories/01-core-development/frontend-developer.md +1 -1
  308. package/subagents/categories/01-core-development/fullstack-developer.md +1 -1
  309. package/subagents/categories/01-core-development/graphql-architect.md +1 -1
  310. package/subagents/categories/01-core-development/microservices-architect.md +1 -1
  311. package/subagents/categories/01-core-development/mobile-developer.md +1 -1
  312. package/subagents/categories/01-core-development/ui-designer.md +1 -1
  313. package/subagents/categories/01-core-development/websocket-engineer.md +1 -1
  314. package/subagents/categories/02-language-specialists/.claude-plugin/plugin.json +2 -2
  315. package/subagents/categories/02-language-specialists/angular-architect.md +1 -1
  316. package/subagents/categories/02-language-specialists/cpp-pro.md +1 -1
  317. package/subagents/categories/02-language-specialists/csharp-developer.md +1 -1
  318. package/subagents/categories/02-language-specialists/django-developer.md +1 -1
  319. package/subagents/categories/02-language-specialists/dotnet-core-expert.md +1 -1
  320. package/subagents/categories/02-language-specialists/dotnet-framework-48-expert.md +1 -1
  321. package/subagents/categories/02-language-specialists/elixir-expert.md +1 -1
  322. package/subagents/categories/02-language-specialists/expo-react-native-expert.md +1 -1
  323. package/subagents/categories/02-language-specialists/fastapi-developer.md +1 -1
  324. package/subagents/categories/02-language-specialists/flutter-expert.md +1 -1
  325. package/subagents/categories/02-language-specialists/golang-pro.md +1 -1
  326. package/subagents/categories/02-language-specialists/java-architect.md +1 -1
  327. package/subagents/categories/02-language-specialists/javascript-pro.md +1 -1
  328. package/subagents/categories/02-language-specialists/kotlin-specialist.md +1 -1
  329. package/subagents/categories/02-language-specialists/laravel-specialist.md +1 -1
  330. package/subagents/categories/02-language-specialists/nextjs-developer.md +1 -1
  331. package/subagents/categories/02-language-specialists/node-specialist.md +1 -1
  332. package/subagents/categories/02-language-specialists/php-pro.md +1 -1
  333. package/subagents/categories/02-language-specialists/powershell-51-expert.md +1 -1
  334. package/subagents/categories/02-language-specialists/powershell-7-expert.md +1 -1
  335. package/subagents/categories/02-language-specialists/python-pro.md +1 -1
  336. package/subagents/categories/02-language-specialists/rails-expert.md +1 -1
  337. package/subagents/categories/02-language-specialists/react-specialist-cc.md +1 -1
  338. package/subagents/categories/02-language-specialists/rust-engineer.md +1 -1
  339. package/subagents/categories/02-language-specialists/spring-boot-engineer.md +1 -1
  340. package/subagents/categories/02-language-specialists/sql-pro.md +1 -1
  341. package/subagents/categories/02-language-specialists/swift-expert.md +1 -1
  342. package/subagents/categories/02-language-specialists/symfony-specialist.md +1 -1
  343. package/subagents/categories/02-language-specialists/typescript-pro.md +1 -1
  344. package/subagents/categories/02-language-specialists/vue-expert.md +1 -1
  345. package/subagents/categories/03-infrastructure/.claude-plugin/plugin.json +5 -5
  346. package/subagents/categories/03-infrastructure/azure-infra-engineer.md +1 -1
  347. package/subagents/categories/03-infrastructure/cloud-architect-cc.md +1 -1
  348. package/subagents/categories/03-infrastructure/database-administrator.md +1 -1
  349. package/subagents/categories/03-infrastructure/deployment-engineer.md +1 -1
  350. package/subagents/categories/03-infrastructure/devops-engineer-cc.md +1 -1
  351. package/subagents/categories/03-infrastructure/devops-incident-responder.md +1 -1
  352. package/subagents/categories/03-infrastructure/docker-expert.md +1 -1
  353. package/subagents/categories/03-infrastructure/incident-responder.md +1 -1
  354. package/subagents/categories/03-infrastructure/kubernetes-specialist.md +1 -1
  355. package/subagents/categories/03-infrastructure/network-engineer.md +1 -1
  356. package/subagents/categories/03-infrastructure/platform-engineer-cc.md +1 -1
  357. package/subagents/categories/03-infrastructure/security-engineer.md +1 -1
  358. package/subagents/categories/03-infrastructure/sre-engineer.md +1 -1
  359. package/subagents/categories/03-infrastructure/terraform-engineer.md +1 -1
  360. package/subagents/categories/03-infrastructure/terragrunt-expert.md +2 -2
  361. package/subagents/categories/03-infrastructure/windows-infra-admin.md +1 -1
  362. package/subagents/categories/04-quality-security/.claude-plugin/plugin.json +15 -5
  363. package/subagents/categories/04-quality-security/accessibility-tester-cc.md +1 -1
  364. package/subagents/categories/04-quality-security/ad-security-reviewer.md +1 -1
  365. package/subagents/categories/04-quality-security/ai-writing-auditor.md +1 -1
  366. package/subagents/categories/04-quality-security/architect-reviewer.md +1 -1
  367. package/subagents/categories/04-quality-security/chaos-engineer-cc.md +1 -1
  368. package/subagents/categories/04-quality-security/code-reviewer.md +1 -1
  369. package/subagents/categories/04-quality-security/compliance-auditor-cc.md +1 -1
  370. package/subagents/categories/04-quality-security/debugger-cc.md +1 -1
  371. package/subagents/categories/04-quality-security/error-detective.md +1 -1
  372. package/subagents/categories/04-quality-security/gdpr-ccpa-compliance.md +2 -2
  373. package/subagents/categories/04-quality-security/go-build-resolver.md +105 -0
  374. package/subagents/categories/04-quality-security/go-reviewer.md +87 -0
  375. package/subagents/categories/04-quality-security/penetration-tester.md +1 -1
  376. package/subagents/categories/04-quality-security/performance-engineer.md +1 -1
  377. package/subagents/categories/04-quality-security/powershell-security-hardening.md +1 -1
  378. package/subagents/categories/04-quality-security/python-reviewer.md +109 -0
  379. package/subagents/categories/04-quality-security/qa-expert.md +1 -1
  380. package/subagents/categories/04-quality-security/react-build-resolver.md +215 -0
  381. package/subagents/categories/04-quality-security/react-reviewer.md +167 -0
  382. package/subagents/categories/04-quality-security/rust-build-resolver.md +159 -0
  383. package/subagents/categories/04-quality-security/rust-reviewer.md +105 -0
  384. package/subagents/categories/04-quality-security/security-auditor.md +1 -1
  385. package/subagents/categories/04-quality-security/silent-failure-hunter.md +67 -0
  386. package/subagents/categories/04-quality-security/test-automator.md +1 -1
  387. package/subagents/categories/04-quality-security/type-design-analyzer.md +58 -0
  388. package/subagents/categories/04-quality-security/typescript-reviewer.md +126 -0
  389. package/subagents/categories/04-quality-security/ui-ux-tester.md +1 -1
  390. package/subagents/categories/05-data-ai/.claude-plugin/plugin.json +4 -4
  391. package/subagents/categories/05-data-ai/ai-engineer.md +1 -1
  392. package/subagents/categories/05-data-ai/data-analyst.md +1 -1
  393. package/subagents/categories/05-data-ai/data-engineer-cc.md +1 -1
  394. package/subagents/categories/05-data-ai/data-scientist.md +1 -1
  395. package/subagents/categories/05-data-ai/database-optimizer.md +1 -1
  396. package/subagents/categories/05-data-ai/llm-architect.md +1 -1
  397. package/subagents/categories/05-data-ai/machine-learning-engineer.md +1 -1
  398. package/subagents/categories/05-data-ai/ml-engineer-cc.md +1 -1
  399. package/subagents/categories/05-data-ai/mlops-engineer.md +1 -1
  400. package/subagents/categories/05-data-ai/nlp-engineer.md +1 -1
  401. package/subagents/categories/05-data-ai/postgres-pro.md +1 -1
  402. package/subagents/categories/05-data-ai/prompt-engineer-cc.md +1 -1
  403. package/subagents/categories/05-data-ai/reinforcement-learning-engineer.md +1 -1
  404. package/subagents/categories/06-developer-experience/.claude-plugin/plugin.json +2 -2
  405. package/subagents/categories/06-developer-experience/build-engineer-cc.md +1 -1
  406. package/subagents/categories/06-developer-experience/cli-developer.md +1 -1
  407. package/subagents/categories/06-developer-experience/dependency-manager.md +1 -1
  408. package/subagents/categories/06-developer-experience/documentation-engineer.md +1 -1
  409. package/subagents/categories/06-developer-experience/dx-optimizer.md +1 -1
  410. package/subagents/categories/06-developer-experience/git-workflow-manager.md +1 -1
  411. package/subagents/categories/06-developer-experience/legacy-modernizer.md +1 -1
  412. package/subagents/categories/06-developer-experience/mcp-developer.md +1 -1
  413. package/subagents/categories/06-developer-experience/powershell-module-architect.md +1 -1
  414. package/subagents/categories/06-developer-experience/powershell-ui-architect.md +1 -1
  415. package/subagents/categories/06-developer-experience/readme-generator.md +1 -1
  416. package/subagents/categories/06-developer-experience/refactoring-specialist.md +1 -1
  417. package/subagents/categories/06-developer-experience/slack-expert.md +1 -1
  418. package/subagents/categories/06-developer-experience/tooling-engineer.md +1 -1
  419. package/subagents/categories/06-developer-experience/visual-asset-generator.md +1 -1
  420. package/subagents/categories/07-specialized-domains/.claude-plugin/plugin.json +2 -2
  421. package/subagents/categories/07-specialized-domains/api-documenter.md +1 -1
  422. package/subagents/categories/07-specialized-domains/blockchain-developer.md +1 -1
  423. package/subagents/categories/07-specialized-domains/embedded-systems.md +1 -1
  424. package/subagents/categories/07-specialized-domains/fintech-engineer.md +1 -1
  425. package/subagents/categories/07-specialized-domains/game-developer.md +1 -1
  426. package/subagents/categories/07-specialized-domains/healthcare-admin.md +1 -1
  427. package/subagents/categories/07-specialized-domains/hipaa-compliance.md +2 -2
  428. package/subagents/categories/07-specialized-domains/iot-engineer.md +1 -1
  429. package/subagents/categories/07-specialized-domains/m365-admin.md +1 -1
  430. package/subagents/categories/07-specialized-domains/mobile-app-developer.md +1 -1
  431. package/subagents/categories/07-specialized-domains/payment-integration.md +1 -1
  432. package/subagents/categories/07-specialized-domains/quant-analyst.md +1 -1
  433. package/subagents/categories/07-specialized-domains/risk-manager.md +1 -1
  434. package/subagents/categories/07-specialized-domains/seo-specialist-cc.md +1 -1
  435. package/subagents/categories/08-business-product/.claude-plugin/plugin.json +3 -3
  436. package/subagents/categories/08-business-product/assumption-mapping.md +2 -2
  437. package/subagents/categories/08-business-product/backlog-grooming.md +2 -2
  438. package/subagents/categories/08-business-product/business-analyst-cc.md +1 -1
  439. package/subagents/categories/08-business-product/content-marketer.md +1 -1
  440. package/subagents/categories/08-business-product/content-quality-editor.md +1 -1
  441. package/subagents/categories/08-business-product/customer-success-manager.md +1 -1
  442. package/subagents/categories/08-business-product/growth-loops.md +2 -2
  443. package/subagents/categories/08-business-product/legal-advisor.md +1 -1
  444. package/subagents/categories/08-business-product/license-engineer.md +1 -1
  445. package/subagents/categories/08-business-product/product-manager-cc.md +1 -1
  446. package/subagents/categories/08-business-product/project-manager.md +1 -1
  447. package/subagents/categories/08-business-product/sales-engineer.md +1 -1
  448. package/subagents/categories/08-business-product/scrum-master.md +1 -1
  449. package/subagents/categories/08-business-product/technical-writer.md +1 -1
  450. package/subagents/categories/08-business-product/ux-researcher.md +1 -1
  451. package/subagents/categories/08-business-product/wordpress-master.md +1 -1
  452. package/subagents/categories/09-meta-orchestration/.claude-plugin/plugin.json +1 -1
  453. package/subagents/categories/09-meta-orchestration/agent-installer.md +1 -1
  454. package/subagents/categories/09-meta-orchestration/agent-organizer.md +1 -1
  455. package/subagents/categories/09-meta-orchestration/codebase-orchestrator.md +1 -1
  456. package/subagents/categories/09-meta-orchestration/context-manager.md +1 -1
  457. package/subagents/categories/09-meta-orchestration/error-coordinator.md +1 -1
  458. package/subagents/categories/09-meta-orchestration/it-ops-orchestrator.md +1 -1
  459. package/subagents/categories/09-meta-orchestration/knowledge-synthesizer.md +1 -1
  460. package/subagents/categories/09-meta-orchestration/multi-agent-coordinator.md +1 -1
  461. package/subagents/categories/09-meta-orchestration/performance-monitor.md +1 -1
  462. package/subagents/categories/09-meta-orchestration/task-distributor.md +1 -1
  463. package/subagents/categories/09-meta-orchestration/workflow-orchestrator.md +1 -1
  464. package/subagents/categories/10-research-analysis/.claude-plugin/plugin.json +1 -1
  465. package/subagents/categories/10-research-analysis/ab-test-analysis.md +2 -2
  466. package/subagents/categories/10-research-analysis/cohort-analysis.md +2 -2
  467. package/subagents/categories/10-research-analysis/competitive-analyst.md +1 -1
  468. package/subagents/categories/10-research-analysis/data-researcher.md +1 -1
  469. package/subagents/categories/10-research-analysis/first-principles-thinking.md +2 -2
  470. package/subagents/categories/10-research-analysis/market-researcher.md +1 -1
  471. package/subagents/categories/10-research-analysis/project-idea-validator.md +1 -1
  472. package/subagents/categories/10-research-analysis/research-analyst.md +1 -1
  473. package/subagents/categories/10-research-analysis/scientific-literature-researcher.md +1 -1
  474. package/subagents/categories/10-research-analysis/search-specialist.md +1 -1
  475. package/subagents/categories/10-research-analysis/trend-analyst.md +1 -1
@@ -0,0 +1,520 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * MindForge Harness Audit — deterministic 0-10/category scorecard.
6
+ *
7
+ * Adapted from ECC (scripts/harness-audit.js): the scoring ENGINE is kept
8
+ * verbatim (category normalization, buildReport, the JSON contract:
9
+ * overall_score / max_score / applicable_categories / rubric_version /
10
+ * top_actions, and the 0/1 exit). The ~25 check PREDICATES are re-authored for
11
+ * MindForge's real layout: .agent/skills, the .mindforge engine skills
12
+ * (SKILL.md per dir), .claude/commands/mindforge, .agent/hooks + bin/,
13
+ * subagents/categories, MINDFORGE.md, SOUL.md, AUDIT.jsonl.
14
+ *
15
+ * This is the DETERMINISTIC layer behind /mindforge:health — it complements
16
+ * (does not replace) the LLM soft-signal layer. CI-gateable via --format json.
17
+ *
18
+ * Usage:
19
+ * node bin/harness-audit.js # text scorecard for repo scope
20
+ * node bin/harness-audit.js --format json # machine-readable
21
+ * node bin/harness-audit.js --scope security
22
+ * node bin/harness-audit.js --root /path/to/checkout
23
+ */
24
+
25
+ const fs = require('fs');
26
+ const path = require('path');
27
+
28
+ const CATEGORIES = [
29
+ 'Tool Coverage',
30
+ 'Context Efficiency',
31
+ 'Quality Gates',
32
+ 'Memory & Learning',
33
+ 'Eval Coverage',
34
+ 'Security Guardrails',
35
+ 'Cost Efficiency',
36
+ 'Governance & Identity',
37
+ ];
38
+
39
+ const RUBRIC_VERSION = '2026-06-10';
40
+
41
+ const SCOPES = ['repo', 'hooks', 'skills', 'commands', 'agents', 'security'];
42
+
43
+ function normalizeScope(scope) {
44
+ const value = (scope || 'repo').toLowerCase();
45
+ if (!SCOPES.includes(value)) {
46
+ throw new Error(`Invalid scope: ${scope}. Use one of ${SCOPES.join(', ')}.`);
47
+ }
48
+ return value;
49
+ }
50
+
51
+ function parseArgs(argv) {
52
+ const args = argv.slice(2);
53
+ const parsed = {
54
+ scope: 'repo',
55
+ format: 'text',
56
+ help: false,
57
+ root: path.resolve(process.env.AUDIT_ROOT || process.cwd()),
58
+ };
59
+
60
+ for (let index = 0; index < args.length; index += 1) {
61
+ const arg = args[index];
62
+
63
+ if (arg === '--help' || arg === '-h') { parsed.help = true; continue; }
64
+ if (arg === '--format') { parsed.format = (args[index + 1] || '').toLowerCase(); index += 1; continue; }
65
+ if (arg === '--scope') { parsed.scope = normalizeScope(args[index + 1]); index += 1; continue; }
66
+ if (arg === '--root') { parsed.root = path.resolve(args[index + 1] || process.cwd()); index += 1; continue; }
67
+ if (arg.startsWith('--format=')) { parsed.format = arg.split('=')[1].toLowerCase(); continue; }
68
+ if (arg.startsWith('--scope=')) { parsed.scope = normalizeScope(arg.split('=')[1]); continue; }
69
+ if (arg.startsWith('--root=')) { parsed.root = path.resolve(arg.slice('--root='.length)); continue; }
70
+ if (arg.startsWith('-')) { throw new Error(`Unknown argument: ${arg}`); }
71
+ parsed.scope = normalizeScope(arg);
72
+ }
73
+
74
+ if (!['text', 'json'].includes(parsed.format)) {
75
+ throw new Error(`Invalid format: ${parsed.format}. Use text or json.`);
76
+ }
77
+
78
+ return parsed;
79
+ }
80
+
81
+ function fileExists(rootDir, relativePath) {
82
+ return fs.existsSync(path.join(rootDir, relativePath));
83
+ }
84
+
85
+ function readText(rootDir, relativePath) {
86
+ return fs.readFileSync(path.join(rootDir, relativePath), 'utf8');
87
+ }
88
+
89
+ function safeRead(rootDir, relativePath) {
90
+ try { return readText(rootDir, relativePath); } catch (_error) { return ''; }
91
+ }
92
+
93
+ function safeParseJson(text) {
94
+ if (!text || !text.trim()) return null;
95
+ try { return JSON.parse(text); } catch (_error) { return null; }
96
+ }
97
+
98
+ function countFiles(rootDir, relativeDir, extension) {
99
+ const dirPath = path.join(rootDir, relativeDir);
100
+ if (!fs.existsSync(dirPath)) return 0;
101
+
102
+ const stack = [dirPath];
103
+ let count = 0;
104
+ while (stack.length > 0) {
105
+ const current = stack.pop();
106
+ const entries = fs.readdirSync(current, { withFileTypes: true });
107
+ for (const entry of entries) {
108
+ const nextPath = path.join(current, entry.name);
109
+ if (entry.isDirectory()) {
110
+ stack.push(nextPath);
111
+ } else if (!extension || entry.name.endsWith(extension)) {
112
+ count += 1;
113
+ }
114
+ }
115
+ }
116
+ return count;
117
+ }
118
+
119
+ function hasFileWithExtension(rootDir, relativeDir, extensions) {
120
+ const dirPath = path.join(rootDir, relativeDir);
121
+ if (!fs.existsSync(dirPath)) return false;
122
+
123
+ const allowed = Array.isArray(extensions) ? extensions : [extensions];
124
+ const stack = [dirPath];
125
+ while (stack.length > 0) {
126
+ const current = stack.pop();
127
+ const entries = fs.readdirSync(current, { withFileTypes: true });
128
+ for (const entry of entries) {
129
+ const nextPath = path.join(current, entry.name);
130
+ if (entry.isDirectory()) { stack.push(nextPath); continue; }
131
+ if (allowed.some(extension => entry.name.endsWith(extension))) return true;
132
+ }
133
+ }
134
+ return false;
135
+ }
136
+
137
+ /**
138
+ * MindForge harness checks. Re-authored from ECC's getRepoChecks for the actual
139
+ * MindForge tree. Each check: { id, category, points, scopes, path, description,
140
+ * pass, fix }.
141
+ */
142
+ function getChecks(rootDir) {
143
+ const packageJson = safeParseJson(safeRead(rootDir, 'package.json'));
144
+ const claudeSettings = safeRead(rootDir, '.claude/settings.json');
145
+ const agentSettings = safeRead(rootDir, '.agent/settings.json');
146
+ const mindforgeMd = safeRead(rootDir, 'MINDFORGE.md');
147
+ const config = safeParseJson(safeRead(rootDir, '.mindforge/config.json'));
148
+
149
+ return [
150
+ // ── Tool Coverage ──────────────────────────────────────────────────────
151
+ {
152
+ id: 'tool-commands',
153
+ category: 'Tool Coverage', points: 3, scopes: ['repo', 'commands'],
154
+ path: '.claude/commands/mindforge/',
155
+ description: 'At least 50 mindforge slash-commands exist',
156
+ pass: countFiles(rootDir, '.claude/commands/mindforge', '.md') >= 50,
157
+ fix: 'Restore mindforge command definitions under .claude/commands/mindforge/.',
158
+ },
159
+ {
160
+ id: 'tool-command-mirror',
161
+ category: 'Tool Coverage', points: 2, scopes: ['repo', 'commands'],
162
+ path: '.agent/mindforge/',
163
+ description: 'Gemini-mirror command set exists under .agent/mindforge/',
164
+ pass: countFiles(rootDir, '.agent/mindforge', '.md') >= 50,
165
+ fix: 'Keep the .agent/mindforge mirror in sync with .claude/commands/mindforge.',
166
+ },
167
+ {
168
+ id: 'tool-engine-skills',
169
+ category: 'Tool Coverage', points: 2, scopes: ['repo', 'skills'],
170
+ path: '.agent/skills/',
171
+ description: 'At least 40 mindforge-* skills exist',
172
+ pass: countFiles(rootDir, '.agent/skills', 'SKILL.md') >= 40,
173
+ fix: 'Restore mindforge-* skills under .agent/skills/.',
174
+ },
175
+ {
176
+ id: 'tool-subagents',
177
+ category: 'Tool Coverage', points: 2, scopes: ['repo', 'agents'],
178
+ path: 'subagents/categories/',
179
+ description: 'At least 100 subagents are indexed',
180
+ pass: countFiles(rootDir, 'subagents/categories', '.md') >= 100,
181
+ fix: 'Import subagents into subagents/categories/ and rebuild the index.',
182
+ },
183
+ {
184
+ id: 'tool-subagent-index',
185
+ category: 'Tool Coverage', points: 2, scopes: ['repo', 'agents'],
186
+ path: '.mindforge/imported-agents.jsonl',
187
+ description: 'Subagent JSONL index is present',
188
+ pass: fileExists(rootDir, '.mindforge/imported-agents.jsonl'),
189
+ fix: 'Run node scripts/build-subagent-index.js to regenerate the index.',
190
+ },
191
+
192
+ // ── Context Efficiency ─────────────────────────────────────────────────
193
+ {
194
+ id: 'context-monitor-hook',
195
+ category: 'Context Efficiency', points: 3, scopes: ['repo', 'hooks'],
196
+ path: '.agent/hooks/mindforge-context-monitor.js',
197
+ description: 'Context-monitor hook exists',
198
+ pass: fileExists(rootDir, '.agent/hooks/mindforge-context-monitor.js'),
199
+ fix: 'Implement .agent/hooks/mindforge-context-monitor.js for context-pressure tracking.',
200
+ },
201
+ {
202
+ id: 'context-sharding',
203
+ category: 'Context Efficiency', points: 3, scopes: ['repo'],
204
+ path: 'bin/shard-helper.js',
205
+ description: 'Sharded-memory helper exists',
206
+ pass: fileExists(rootDir, 'bin/shard-helper.js'),
207
+ fix: 'Add bin/shard-helper.js for the Tri-Tier sharded-memory loop.',
208
+ },
209
+ {
210
+ id: 'context-llm-route',
211
+ category: 'Context Efficiency', points: 2, scopes: ['repo', 'commands'],
212
+ path: '.claude/commands/mindforge/llm-route.md',
213
+ description: 'Model-routing command exists',
214
+ pass: fileExists(rootDir, '.claude/commands/mindforge/llm-route.md'),
215
+ fix: 'Add the llm-route command for complexity-aware routing.',
216
+ },
217
+
218
+ // ── Quality Gates ──────────────────────────────────────────────────────
219
+ {
220
+ id: 'quality-test-runner',
221
+ category: 'Quality Gates', points: 3, scopes: ['repo'],
222
+ path: 'tests/',
223
+ description: 'A test entrypoint exists (tests/run-all.js or npm test)',
224
+ pass: fileExists(rootDir, 'tests/run-all.js') || typeof packageJson?.scripts?.test === 'string',
225
+ fix: 'Add tests/run-all.js or a package.json test script.',
226
+ },
227
+ {
228
+ id: 'quality-test-count',
229
+ category: 'Quality Gates', points: 2, scopes: ['repo'],
230
+ path: 'tests/',
231
+ description: 'At least 20 test files exist',
232
+ pass: countFiles(rootDir, 'tests', '.test.js') >= 20,
233
+ fix: 'Increase automated test coverage under tests/.',
234
+ },
235
+ {
236
+ id: 'quality-skill-validator',
237
+ category: 'Quality Gates', points: 2, scopes: ['repo'],
238
+ path: 'bin/skill-validator.js',
239
+ description: 'Skill validator exists',
240
+ pass: fileExists(rootDir, 'bin/skill-validator.js'),
241
+ fix: 'Add bin/skill-validator.js to certify skills.',
242
+ },
243
+ {
244
+ id: 'quality-harness-audit',
245
+ category: 'Quality Gates', points: 2, scopes: ['repo'],
246
+ path: 'bin/harness-audit.js',
247
+ description: 'Deterministic harness-audit scorecard exists',
248
+ pass: fileExists(rootDir, 'bin/harness-audit.js'),
249
+ fix: 'Add bin/harness-audit.js (this file) and wire harness:audit npm script.',
250
+ },
251
+
252
+ // ── Memory & Learning ──────────────────────────────────────────────────
253
+ {
254
+ id: 'memory-instinct-capture',
255
+ category: 'Memory & Learning', points: 3, scopes: ['repo', 'hooks'],
256
+ path: 'bin/hooks/instinct-capture-hook.js',
257
+ description: 'Instinct-capture hook exists',
258
+ pass: fileExists(rootDir, 'bin/hooks/instinct-capture-hook.js'),
259
+ fix: 'Add bin/hooks/instinct-capture-hook.js for auto-capture of instincts.',
260
+ },
261
+ {
262
+ id: 'memory-continuous-learning',
263
+ category: 'Memory & Learning', points: 3, scopes: ['repo', 'skills'],
264
+ path: '.mindforge/skills/continuous-learning/SKILL.md',
265
+ description: 'Continuous-learning skill exists',
266
+ pass: fileExists(rootDir, '.mindforge/skills/continuous-learning/SKILL.md'),
267
+ fix: 'Add .mindforge/skills/continuous-learning/SKILL.md.',
268
+ },
269
+ {
270
+ id: 'memory-instinct-config',
271
+ category: 'Memory & Learning', points: 2, scopes: ['repo'],
272
+ path: '.mindforge/config.json',
273
+ description: 'Instinct engine is configured',
274
+ pass: Boolean(config?.instincts?.store_path),
275
+ fix: 'Configure the instincts block in .mindforge/config.json.',
276
+ },
277
+
278
+ // ── Eval Coverage ──────────────────────────────────────────────────────
279
+ {
280
+ id: 'eval-harness-skill',
281
+ category: 'Eval Coverage', points: 4, scopes: ['repo', 'skills'],
282
+ path: '.mindforge/skills/eval-harness/SKILL.md',
283
+ description: 'Eval-harness skill exists',
284
+ pass: fileExists(rootDir, '.mindforge/skills/eval-harness/SKILL.md'),
285
+ fix: 'Add .mindforge/skills/eval-harness/SKILL.md for pass/fail regression evaluation.',
286
+ },
287
+ {
288
+ id: 'eval-verification-loop',
289
+ category: 'Eval Coverage', points: 3, scopes: ['repo', 'skills'],
290
+ path: '.mindforge/skills/verification-loop/SKILL.md',
291
+ description: 'Verification-loop skill exists',
292
+ pass: fileExists(rootDir, '.mindforge/skills/verification-loop/SKILL.md'),
293
+ fix: 'Add .mindforge/skills/verification-loop/SKILL.md to standardize verify gates.',
294
+ },
295
+ {
296
+ id: 'eval-engine',
297
+ category: 'Eval Coverage', points: 2, scopes: ['repo'],
298
+ path: 'bin/eval/',
299
+ description: 'Eval engine exists under bin/',
300
+ pass: fileExists(rootDir, 'bin/eval'),
301
+ fix: 'Add the eval engine under bin/eval/.',
302
+ },
303
+
304
+ // ── Security Guardrails ────────────────────────────────────────────────
305
+ {
306
+ id: 'security-trust-gate',
307
+ category: 'Security Guardrails', points: 3, scopes: ['repo', 'hooks', 'security'],
308
+ path: 'bin/security/trust-gate-hook.js',
309
+ description: 'TrustGate Bash guard exists',
310
+ pass: fileExists(rootDir, 'bin/security/trust-gate-hook.js') && fileExists(rootDir, 'bin/security/trust-boundaries.js'),
311
+ fix: 'Restore bin/security/trust-gate-hook.js + trust-boundaries.js.',
312
+ },
313
+ {
314
+ id: 'security-block-no-verify',
315
+ category: 'Security Guardrails', points: 2, scopes: ['repo', 'hooks', 'security'],
316
+ path: '.agent/hooks/mindforge-block-no-verify.js',
317
+ description: 'Git-hook-bypass guard exists',
318
+ pass: fileExists(rootDir, '.agent/hooks/mindforge-block-no-verify.js'),
319
+ fix: 'Add .agent/hooks/mindforge-block-no-verify.js to block --no-verify.',
320
+ },
321
+ {
322
+ id: 'security-deny-baseline',
323
+ category: 'Security Guardrails', points: 3, scopes: ['repo', 'security'],
324
+ path: '.claude/settings.json',
325
+ description: 'permissions.deny baseline protects secret-bearing paths',
326
+ pass: claudeSettings.includes('"deny"') && claudeSettings.includes('.ssh'),
327
+ fix: 'Add a permissions.deny baseline to .claude/settings.json (see MINDFORGE-AGENTIC-SECURITY.md).',
328
+ },
329
+ {
330
+ id: 'security-bash-guard-both',
331
+ category: 'Security Guardrails', points: 2, scopes: ['repo', 'hooks', 'security'],
332
+ path: '.agent/settings.json',
333
+ description: 'Bash guards wired in BOTH .claude and the .agent Gemini mirror',
334
+ pass: claudeSettings.includes('trust-gate-hook') && agentSettings.includes('trust-gate-hook'),
335
+ fix: 'Wire trust-gate + block-no-verify into both .claude/settings.json and .agent/settings.json.',
336
+ },
337
+ {
338
+ id: 'security-threat-model',
339
+ category: 'Security Guardrails', points: 2, scopes: ['repo', 'security'],
340
+ path: 'MINDFORGE-AGENTIC-SECURITY.md',
341
+ description: 'Agentic-harness threat model is documented',
342
+ pass: fileExists(rootDir, 'MINDFORGE-AGENTIC-SECURITY.md'),
343
+ fix: 'Add MINDFORGE-AGENTIC-SECURITY.md (outward harness threat model).',
344
+ },
345
+ {
346
+ id: 'security-scan-command',
347
+ category: 'Security Guardrails', points: 1, scopes: ['repo', 'commands', 'security'],
348
+ path: '.claude/commands/mindforge/security-scan.md',
349
+ description: 'Security-scan command exists',
350
+ pass: fileExists(rootDir, '.claude/commands/mindforge/security-scan.md'),
351
+ fix: 'Add the security-scan command.',
352
+ },
353
+
354
+ // ── Cost Efficiency ────────────────────────────────────────────────────
355
+ {
356
+ id: 'cost-routing-config',
357
+ category: 'Cost Efficiency', points: 3, scopes: ['repo'],
358
+ path: '.mindforge/config.json',
359
+ description: 'Cost-routing with budget caps is configured',
360
+ pass: Boolean(config?.cost_routing?.budget?.session_hard_limit_usd),
361
+ fix: 'Configure cost_routing.budget in .mindforge/config.json.',
362
+ },
363
+ {
364
+ id: 'cost-revops-engine',
365
+ category: 'Cost Efficiency', points: 3, scopes: ['repo'],
366
+ path: 'bin/revops/',
367
+ description: 'RevOps cost engine exists',
368
+ pass: fileExists(rootDir, 'bin/revops'),
369
+ fix: 'Add the RevOps cost engine under bin/revops/.',
370
+ },
371
+ {
372
+ id: 'cost-model-registry',
373
+ category: 'Cost Efficiency', points: 2, scopes: ['repo'],
374
+ path: '.mindforge/config.json',
375
+ description: 'Model market-registry with per-model pricing exists',
376
+ pass: Boolean(config?.revops?.market_registry),
377
+ fix: 'Populate revops.market_registry with per-model cost/benchmark data.',
378
+ },
379
+
380
+ // ── Governance & Identity ──────────────────────────────────────────────
381
+ {
382
+ id: 'gov-param-registry',
383
+ category: 'Governance & Identity', points: 3, scopes: ['repo'],
384
+ path: 'MINDFORGE.md',
385
+ description: 'Parameter registry (MINDFORGE.md) with non-overridable gates exists',
386
+ pass: mindforgeMd.includes('NON-OVERRIDABLE') && mindforgeMd.includes('MIN_SOUL_SCORE'),
387
+ fix: 'Restore MINDFORGE.md with the non-overridable governance section.',
388
+ },
389
+ {
390
+ id: 'gov-sovereign-identity',
391
+ category: 'Governance & Identity', points: 2, scopes: ['repo'],
392
+ path: 'SOUL.md',
393
+ description: 'Sovereign identity + prompt-defense baseline present',
394
+ pass: fileExists(rootDir, 'SOUL.md') && safeRead(rootDir, 'SOUL.md').includes('Prompt-Defense Baseline'),
395
+ fix: 'Add the prompt-defense baseline to SOUL.md (scoped to untrusted content).',
396
+ },
397
+ {
398
+ id: 'gov-engine',
399
+ category: 'Governance & Identity', points: 3, scopes: ['repo'],
400
+ path: 'bin/governance/',
401
+ description: 'Governance engine exists',
402
+ pass: fileExists(rootDir, 'bin/governance'),
403
+ fix: 'Restore the governance engine under bin/governance/.',
404
+ },
405
+ {
406
+ id: 'gov-audit-trail',
407
+ category: 'Governance & Identity', points: 2, scopes: ['repo'],
408
+ path: '.mindforge/audit/',
409
+ description: 'Merkle-linked audit trail directory exists',
410
+ pass: fileExists(rootDir, '.mindforge/audit') || fileExists(rootDir, '.planning'),
411
+ fix: 'Ensure the audit-trail directory (.mindforge/audit/) is present.',
412
+ },
413
+ ];
414
+ }
415
+
416
+ function summarizeCategoryScores(checks) {
417
+ const scores = {};
418
+ for (const category of CATEGORIES) {
419
+ const inCategory = checks.filter(check => check.category === category);
420
+ const max = inCategory.reduce((sum, check) => sum + check.points, 0);
421
+ const earned = inCategory.filter(check => check.pass).reduce((sum, check) => sum + check.points, 0);
422
+ const normalized = max === 0 ? 0 : Math.round((earned / max) * 10);
423
+ scores[category] = { score: normalized, earned, max };
424
+ }
425
+ return scores;
426
+ }
427
+
428
+ function buildReport(scope, options = {}) {
429
+ const rootDir = path.resolve(options.rootDir || process.cwd());
430
+ const checks = getChecks(rootDir).filter(check => check.scopes.includes(scope));
431
+ const categoryScores = summarizeCategoryScores(checks);
432
+ const maxScore = checks.reduce((sum, check) => sum + check.points, 0);
433
+ const overallScore = checks.filter(check => check.pass).reduce((sum, check) => sum + check.points, 0);
434
+ const applicableCategories = CATEGORIES.filter(name => categoryScores[name]?.max > 0);
435
+
436
+ const topActions = checks
437
+ .filter(check => !check.pass)
438
+ .sort((left, right) => right.points - left.points)
439
+ .slice(0, 3)
440
+ .map(check => ({ action: check.fix, path: check.path, category: check.category, points: check.points }));
441
+
442
+ return {
443
+ scope,
444
+ root_dir: rootDir,
445
+ deterministic: true,
446
+ rubric_version: RUBRIC_VERSION,
447
+ overall_score: overallScore,
448
+ max_score: maxScore,
449
+ categories: categoryScores,
450
+ applicable_categories: applicableCategories,
451
+ category_count: applicableCategories.length,
452
+ checks: checks.map(check => ({
453
+ id: check.id,
454
+ category: check.category,
455
+ points: check.points,
456
+ path: check.path,
457
+ description: check.description,
458
+ pass: check.pass,
459
+ })),
460
+ top_actions: topActions,
461
+ };
462
+ }
463
+
464
+ function printText(report) {
465
+ console.log(`MindForge Harness Audit (${report.scope}): ${report.overall_score}/${report.max_score}`);
466
+ console.log(`Root: ${report.root_dir}`);
467
+ console.log('');
468
+
469
+ for (const category of CATEGORIES) {
470
+ const data = report.categories[category];
471
+ if (!data || data.max === 0) continue;
472
+ console.log(`- ${category}: ${data.score}/10 (${data.earned}/${data.max} pts)`);
473
+ }
474
+
475
+ const failed = report.checks.filter(check => !check.pass);
476
+ console.log('');
477
+ console.log(`Checks: ${report.checks.length} total, ${failed.length} failing`);
478
+
479
+ if (failed.length > 0) {
480
+ console.log('');
481
+ console.log('Top 3 Actions:');
482
+ report.top_actions.forEach((action, index) => {
483
+ console.log(`${index + 1}) [${action.category}] ${action.action} (${action.path})`);
484
+ });
485
+ }
486
+ }
487
+
488
+ function showHelp(exitCode = 0) {
489
+ console.log(`
490
+ Usage: node bin/harness-audit.js [scope] [--scope <${SCOPES.join('|')}>] [--format <text|json>] [--root <path>]
491
+
492
+ Deterministic MindForge harness audit based on explicit file/config checks.
493
+ Audits the current working directory by default.
494
+ `);
495
+ process.exit(exitCode);
496
+ }
497
+
498
+ function main() {
499
+ try {
500
+ const args = parseArgs(process.argv);
501
+ if (args.help) { showHelp(0); return; }
502
+
503
+ const report = buildReport(args.scope, { rootDir: args.root });
504
+
505
+ if (args.format === 'json') {
506
+ console.log(JSON.stringify(report, null, 2));
507
+ } else {
508
+ printText(report);
509
+ }
510
+ } catch (error) {
511
+ console.error(`Error: ${error.message}`);
512
+ process.exit(1);
513
+ }
514
+ }
515
+
516
+ if (require.main === module) {
517
+ main();
518
+ }
519
+
520
+ module.exports = { buildReport, parseArgs, getChecks, CATEGORIES, RUBRIC_VERSION };
@@ -14,6 +14,7 @@ const fs = require('fs');
14
14
  const path = require('path');
15
15
  const crypto = require('crypto');
16
16
  const os = require('os');
17
+ const { detectProject } = require('./lib/detect-project');
17
18
 
18
19
  // ── Configuration ────────────────────────────────────────────────────────────
19
20
 
@@ -147,6 +148,19 @@ function main() {
147
148
  process.exit(0);
148
149
  }
149
150
 
151
+ // Detect the current project so instincts are scoped per-repo (no cross-project
152
+ // leak). Falls back to 'global' outside a git repo. project_id is the portable
153
+ // git-remote hash; project is the human-readable name.
154
+ let projectId = 'global';
155
+ let projectName = 'global';
156
+ try {
157
+ const detected = detectProject(process.cwd());
158
+ projectId = detected.id;
159
+ projectName = detected.name;
160
+ } catch {
161
+ // Non-fatal — keep defaults; hooks must never block.
162
+ }
163
+
150
164
  // Build instinct entry
151
165
  const entry = {
152
166
  id: `inst-${crypto.randomUUID()}`,
@@ -158,7 +172,8 @@ function main() {
158
172
  times_applied: 0,
159
173
  times_succeeded: 0,
160
174
  times_failed: 0,
161
- project: 'mindforge',
175
+ project: projectName,
176
+ project_id: projectId,
162
177
  tags: [],
163
178
  status: 'active',
164
179
  promoted_to_skill: null,
@@ -0,0 +1,72 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Project detection for instinct scoping.
5
+ *
6
+ * Ported from ECC's detect-project.sh (continuous-learning-v2). Produces a
7
+ * stable project id so instincts captured in repo A never leak into repo B —
8
+ * fixing the long-standing invariant violation where the capture hook hardcoded
9
+ * project: 'mindforge' for every project (instinct-schema.md line 44 claims no
10
+ * cross-project leak; this makes that true).
11
+ *
12
+ * Detection priority (matches ECC):
13
+ * 1. git remote URL (credential-stripped + normalized, SHA256 -> 12 chars)
14
+ * — portable across machines/clones of the same repo.
15
+ * 2. git repo root path (SHA256 -> 12 chars) — machine-specific fallback.
16
+ * 3. "global" — no git context.
17
+ *
18
+ * Returns { id, name, root }.
19
+ */
20
+
21
+ const crypto = require('crypto');
22
+ const { spawnSync } = require('child_process');
23
+ const path = require('path');
24
+
25
+ function git(cwd, args) {
26
+ const r = spawnSync('git', ['-C', cwd, ...args], { encoding: 'utf8' });
27
+ return r.status === 0 ? (r.stdout || '').trim() : '';
28
+ }
29
+
30
+ function sha12(input) {
31
+ return crypto.createHash('sha256').update(input, 'utf8').digest('hex').slice(0, 12);
32
+ }
33
+
34
+ /**
35
+ * Normalize a git remote URL so the same repo hashes identically across
36
+ * https/ssh/scp forms: strip credentials, scheme, user@host:, .git suffix,
37
+ * trailing slashes; lowercase network URLs.
38
+ */
39
+ function normalizeRemoteUrl(url) {
40
+ if (!url) return '';
41
+ const isNetwork = /^[A-Za-z][A-Za-z0-9+.-]*:\/\//.test(url) && !url.startsWith('file://')
42
+ || /^[^@/:]+@[^:/]+:/.test(url);
43
+
44
+ let u = url
45
+ .replace(/:\/\/[^@]+@/, '://') // strip creds in scheme://user@
46
+ .replace(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//, '') // strip scheme
47
+ .replace(/^[^@/:]+@([^:/]+):/, '$1/') // scp form git@host:path -> host/path
48
+ .replace(/\.git\/?$/, '') // drop .git
49
+ .replace(/\/+$/, ''); // drop trailing slashes
50
+
51
+ return isNetwork ? u.toLowerCase() : u;
52
+ }
53
+
54
+ function detectProject(cwd = process.cwd()) {
55
+ // Resolve repo root
56
+ const root = git(cwd, ['rev-parse', '--show-toplevel']);
57
+ if (!root) {
58
+ return { id: 'global', name: 'global', root: '' };
59
+ }
60
+
61
+ const name = path.basename(root.replace(/\\/g, '/'));
62
+
63
+ // Prefer remote URL hash (portable); fall back to root path hash.
64
+ let remote = git(root, ['remote', 'get-url', 'origin']);
65
+ if (remote) remote = remote.replace(/:\/\/[^@]+@/, '://'); // strip creds
66
+ const normalized = remote ? normalizeRemoteUrl(remote) : '';
67
+ const hashInput = normalized || remote || root;
68
+
69
+ return { id: sha12(hashInput), name, root };
70
+ }
71
+
72
+ module.exports = { detectProject, normalizeRemoteUrl, sha12 };