@monoes/monomindcli 2.16.4 → 2.16.5
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.
- package/.claude/agents/github/repo-architect.md +1 -1
- package/.claude/agents/specialists/integration-architect.md +9 -13
- package/.claude/commands/agents/agent-capabilities.md +1 -0
- package/.claude/commands/agents/agent-coordination.md +1 -0
- package/.claude/commands/agents/agent-spawning.md +1 -0
- package/.claude/commands/agents/agent-types.md +1 -0
- package/.claude/commands/analysis/bottleneck-detect.md +1 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +1 -0
- package/.claude/commands/analysis/performance-report.md +1 -0
- package/.claude/commands/analysis/token-usage.md +1 -0
- package/.claude/commands/automation/README.md +1 -1
- package/.claude/commands/automation/auto-agent.md +1 -0
- package/.claude/commands/automation/self-healing.md +1 -0
- package/.claude/commands/automation/session-memory.md +1 -0
- package/.claude/commands/automation/smart-agents.md +1 -0
- package/.claude/commands/automation/smart-spawn.md +1 -0
- package/.claude/commands/automation/workflow-select.md +22 -27
- package/.claude/commands/coordination/README.md +2 -2
- package/.claude/commands/coordination/agent-spawn.md +1 -0
- package/.claude/commands/coordination/monoswarm-init.md +9 -8
- package/.claude/commands/coordination/task-orchestrate.md +6 -5
- package/.claude/commands/github/README.md +1 -1
- package/.claude/commands/github/github-modes.md +1 -0
- package/.claude/commands/github/issue-tracker.md +1 -0
- package/.claude/commands/github/pr-manager.md +1 -0
- package/.claude/commands/github/release-manager.md +1 -2
- package/.claude/commands/github/repo-architect.md +1 -0
- package/.claude/commands/github/sync-coordinator.md +1 -0
- package/.claude/commands/hooks/overview.md +1 -0
- package/.claude/commands/hooks/post-edit.md +1 -0
- package/.claude/commands/hooks/post-task.md +1 -0
- package/.claude/commands/hooks/pre-edit.md +1 -0
- package/.claude/commands/hooks/pre-task.md +1 -0
- package/.claude/commands/hooks/session-end.md +1 -0
- package/.claude/commands/hooks/setup.md +1 -0
- package/.claude/commands/mastermind/adr.md +3 -1
- package/.claude/commands/mastermind/brain.md +3 -1
- package/.claude/commands/mastermind/budget.md +3 -1
- package/.claude/commands/mastermind/code-review.md +3 -1
- package/.claude/commands/mastermind/content.md +3 -1
- package/.claude/commands/mastermind/createorg.md +3 -1
- package/.claude/commands/mastermind/createtask.md +6 -4
- package/.claude/commands/mastermind/debug.md +3 -1
- package/.claude/commands/mastermind/design.md +3 -1
- package/.claude/commands/mastermind/do.md +5 -3
- package/.claude/commands/mastermind/execute.md +3 -1
- package/.claude/commands/mastermind/finance.md +3 -1
- package/.claude/commands/mastermind/graph-status.md +3 -1
- package/.claude/commands/mastermind/help.md +12 -9
- package/.claude/commands/mastermind/idea.md +3 -1
- package/.claude/commands/mastermind/ideate.md +4 -2
- package/.claude/commands/mastermind/improve.md +4 -2
- package/.claude/commands/mastermind/loops.md +3 -1
- package/.claude/commands/mastermind/marketing.md +3 -1
- package/.claude/commands/mastermind/master.md +3 -1
- package/.claude/commands/mastermind/memory.md +8 -36
- package/.claude/commands/mastermind/monoswarm.md +3 -2
- package/.claude/commands/mastermind/okf-export.md +3 -1
- package/.claude/commands/mastermind/okf-import.md +3 -1
- package/.claude/commands/mastermind/ops.md +3 -1
- package/.claude/commands/mastermind/orgs.md +3 -1
- package/.claude/commands/mastermind/orgstatus.md +3 -1
- package/.claude/commands/mastermind/plan.md +3 -1
- package/.claude/commands/mastermind/receive-review.md +3 -1
- package/.claude/commands/mastermind/release.md +3 -1
- package/.claude/commands/mastermind/repeat.md +3 -1
- package/.claude/commands/mastermind/research.md +3 -1
- package/.claude/commands/mastermind/review.md +3 -1
- package/.claude/commands/mastermind/runorg.md +3 -1
- package/.claude/commands/mastermind/sales.md +3 -1
- package/.claude/commands/mastermind/skill-builder.md +3 -1
- package/.claude/commands/mastermind/specialagents.md +3 -1
- package/.claude/commands/mastermind/stoporg.md +3 -1
- package/.claude/commands/mastermind/techport.md +3 -1
- package/.claude/commands/mastermind/topology.md +4 -3
- package/.claude/commands/mastermind/understand.md +3 -1
- package/.claude/commands/mastermind/worktree.md +3 -1
- package/.claude/commands/memory/memory-search.md +1 -0
- package/.claude/commands/monitoring/README.md +1 -1
- package/.claude/commands/monitoring/agent-metrics.md +1 -0
- package/.claude/commands/monitoring/agents.md +1 -0
- package/.claude/commands/monitoring/status.md +1 -0
- package/.claude/commands/monoswarm/README.md +3 -3
- package/.claude/commands/monoswarm/analysis.md +2 -2
- package/.claude/commands/monoswarm/consensus.md +1 -0
- package/.claude/commands/monoswarm/development.md +3 -3
- package/.claude/commands/monoswarm/examples.md +4 -4
- package/.claude/commands/monoswarm/init.md +2 -1
- package/.claude/commands/monoswarm/maintenance.md +2 -2
- package/.claude/commands/monoswarm/memory.md +1 -0
- package/.claude/commands/monoswarm/monoswarm.md +5 -5
- package/.claude/commands/monoswarm/optimization.md +2 -2
- package/.claude/commands/monoswarm/research.md +2 -2
- package/.claude/commands/monoswarm/spawn.md +1 -0
- package/.claude/commands/monoswarm/status.md +2 -1
- package/.claude/commands/monoswarm/stop.md +2 -1
- package/.claude/commands/monoswarm/testing.md +2 -2
- package/.claude/commands/pair/README.md +8 -9
- package/.claude/commands/pair/examples.md +3 -4
- package/.claude/commands/pair/session.md +1 -1
- package/.claude/commands/workflows/README.md +45 -40
- package/.claude/commands/workflows/development.md +42 -55
- package/.claude/commands/workflows/research.md +41 -57
- package/.claude/commands/workflows/workflow-create.md +43 -45
- package/.claude/commands/workflows/workflow-execute.md +58 -68
- package/.claude/commands/workflows/workflow-export.md +37 -63
- package/.claude/helpers/build-skill-registry.cjs +10 -6
- package/.claude/helpers/handlers/pick-core.cjs +35 -24
- package/.claude/helpers/handlers/route-handler.cjs +11 -3
- package/.claude/helpers/hook-handler.cjs +4 -2
- package/.claude/helpers/jev-catalog.cjs +7 -3
- package/.claude/helpers/jev-picker.cjs +49 -7
- package/.claude/helpers/pick-rank.cjs +95 -3
- package/.claude/helpers/pick-stats.cjs +86 -2
- package/.claude/skills/agentic-jujutsu/SKILL.md +2 -3
- package/.claude/skills/github-toolkit/SKILL.md +1 -1
- package/.claude/skills/hooks-automation/SKILL.md +243 -938
- package/.claude/skills/mastermind-agent-detail/SKILL.md +1 -1
- package/.claude/skills/mastermind-agent-select/SKILL.md +16 -1
- package/.claude/skills/mastermind-inbox/SKILL.md +1 -1
- package/.claude/skills/mastermind-plugins/SKILL.md +1 -1
- package/.claude/skills/mastermind-release/SKILL.md +9 -1
- package/.claude/skills/mastermind-research/SKILL.md +9 -1
- package/.claude/skills/mastermind-review/SKILL.md +9 -1
- package/.claude/skills/mastermind-routine-detail/SKILL.md +1 -1
- package/.claude/skills/monodesign/SKILL.md +257 -0
- package/.claude/skills/monodesign/adapt.md +53 -0
- package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +100 -0
- package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +103 -0
- package/.claude/skills/monodesign/animate.md +65 -0
- package/.claude/skills/monodesign/audit.md +89 -0
- package/.claude/skills/monodesign/bolder.md +50 -0
- package/.claude/skills/monodesign/clarify.md +64 -0
- package/.claude/skills/monodesign/colorize.md +68 -0
- package/.claude/skills/monodesign/craft.md +51 -0
- package/.claude/skills/monodesign/critique.md +66 -0
- package/.claude/skills/monodesign/delight.md +47 -0
- package/.claude/skills/monodesign/distill.md +56 -0
- package/.claude/skills/monodesign/document.md +83 -0
- package/.claude/skills/monodesign/extract.md +74 -0
- package/.claude/skills/monodesign/harden.md +65 -0
- package/.claude/skills/monodesign/init.md +30 -0
- package/.claude/skills/monodesign/layout.md +36 -0
- package/.claude/skills/monodesign/live.md +34 -0
- package/.claude/skills/monodesign/onboard.md +50 -0
- package/.claude/skills/monodesign/optimize.md +64 -0
- package/.claude/skills/monodesign/overdrive.md +56 -0
- package/.claude/skills/monodesign/polish.md +68 -0
- package/.claude/skills/monodesign/quieter.md +57 -0
- package/.claude/skills/monodesign/reference/adapt.md +312 -0
- package/.claude/skills/monodesign/reference/adapt.native.md +58 -0
- package/.claude/skills/monodesign/reference/android.md +40 -0
- package/.claude/skills/monodesign/reference/animate.md +203 -0
- package/.claude/skills/monodesign/reference/antipatterns-catalog.md +410 -0
- package/.claude/skills/monodesign/reference/audit.md +135 -0
- package/.claude/skills/monodesign/reference/audit.native.md +139 -0
- package/.claude/skills/monodesign/reference/bolder.md +120 -0
- package/.claude/skills/monodesign/reference/brand-workflow.md +180 -0
- package/.claude/skills/monodesign/reference/brand.md +108 -0
- package/.claude/skills/monodesign/reference/clarify.md +288 -0
- package/.claude/skills/monodesign/reference/codex.md +105 -0
- package/.claude/skills/monodesign/reference/cognitive-load.md +106 -0
- package/.claude/skills/monodesign/reference/color-and-contrast.md +105 -0
- package/.claude/skills/monodesign/reference/colorize.md +257 -0
- package/.claude/skills/monodesign/reference/component-specs.md +260 -0
- package/.claude/skills/monodesign/reference/component-states.md +274 -0
- package/.claude/skills/monodesign/reference/component-system.md +358 -0
- package/.claude/skills/monodesign/reference/copy-formulas.md +160 -0
- package/.claude/skills/monodesign/reference/craft.md +123 -0
- package/.claude/skills/monodesign/reference/critique.md +780 -0
- package/.claude/skills/monodesign/reference/delight.md +302 -0
- package/.claude/skills/monodesign/reference/design-principles.md +246 -0
- package/.claude/skills/monodesign/reference/distill.md +111 -0
- package/.claude/skills/monodesign/reference/document.md +429 -0
- package/.claude/skills/monodesign/reference/extract.md +69 -0
- package/.claude/skills/monodesign/reference/harden.md +347 -0
- package/.claude/skills/monodesign/reference/heuristics-scoring.md +234 -0
- package/.claude/skills/monodesign/reference/hooks.md +92 -0
- package/.claude/skills/monodesign/reference/image-prompts.md +130 -0
- package/.claude/skills/monodesign/reference/init.md +221 -0
- package/.claude/skills/monodesign/reference/interaction-design.md +189 -0
- package/.claude/skills/monodesign/reference/ios.md +45 -0
- package/.claude/skills/monodesign/reference/layout.md +185 -0
- package/.claude/skills/monodesign/reference/live.md +710 -0
- package/.claude/skills/monodesign/reference/motion-design.md +109 -0
- package/.claude/skills/monodesign/reference/onboard.md +234 -0
- package/.claude/skills/monodesign/reference/optimize.md +258 -0
- package/.claude/skills/monodesign/reference/overdrive.md +130 -0
- package/.claude/skills/monodesign/reference/personas.md +179 -0
- package/.claude/skills/monodesign/reference/polish.md +241 -0
- package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +108 -0
- package/.claude/skills/monodesign/reference/product.md +60 -0
- package/.claude/skills/monodesign/reference/quieter.md +99 -0
- package/.claude/skills/monodesign/reference/responsive-design.md +114 -0
- package/.claude/skills/monodesign/reference/shape.md +165 -0
- package/.claude/skills/monodesign/reference/spatial-design.md +100 -0
- package/.claude/skills/monodesign/reference/teach.md +10 -0
- package/.claude/skills/monodesign/reference/token-architecture.md +222 -0
- package/.claude/skills/monodesign/reference/typeset.md +301 -0
- package/.claude/skills/monodesign/reference/typography.md +159 -0
- package/.claude/skills/monodesign/reference/ux-research.md +143 -0
- package/.claude/skills/monodesign/reference/ux-rules.md +211 -0
- package/.claude/skills/monodesign/reference/ux-writing.md +107 -0
- package/.claude/skills/monodesign/scripts/command-metadata.json +94 -0
- package/.claude/skills/monodesign/scripts/context-signals.mjs +260 -0
- package/.claude/skills/monodesign/scripts/context.mjs +1065 -0
- package/.claude/skills/monodesign/scripts/critique-storage.mjs +416 -0
- package/.claude/skills/monodesign/scripts/detect-csp.mjs +193 -0
- package/.claude/skills/monodesign/scripts/detect.mjs +33 -0
- package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +1960 -0
- package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +321 -0
- package/.claude/skills/monodesign/scripts/detector/design-system.mjs +814 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +5628 -0
- package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +50 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +259 -0
- package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +339 -0
- package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +636 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +1016 -0
- package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +253 -0
- package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +198 -0
- package/.claude/skills/monodesign/scripts/detector/findings.mjs +12 -0
- package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +181 -0
- package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +373 -0
- package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +426 -0
- package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +198 -0
- package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +166 -0
- package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +563 -0
- package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +3024 -0
- package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +124 -0
- package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +101 -0
- package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +30 -0
- package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +148 -0
- package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +7 -0
- package/.claude/skills/monodesign/scripts/hook-admin.mjs +694 -0
- package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +516 -0
- package/.claude/skills/monodesign/scripts/hook-lib.mjs +1785 -0
- package/.claude/skills/monodesign/scripts/hook.mjs +61 -0
- package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +809 -0
- package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +69 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +640 -0
- package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +129 -0
- package/.claude/skills/monodesign/scripts/lib/provider.mjs +4 -0
- package/.claude/skills/monodesign/scripts/lib/target-args.mjs +42 -0
- package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +50 -0
- package/.claude/skills/monodesign/scripts/live/completion.mjs +19 -0
- package/.claude/skills/monodesign/scripts/live/event-validation.mjs +137 -0
- package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +458 -0
- package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +939 -0
- package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +357 -0
- package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +152 -0
- package/.claude/skills/monodesign/scripts/live/session-store.mjs +293 -0
- package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +826 -0
- package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +279 -0
- package/.claude/skills/monodesign/scripts/live/ui-core.mjs +180 -0
- package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +36 -0
- package/.claude/skills/monodesign/scripts/live-accept.mjs +812 -0
- package/.claude/skills/monodesign/scripts/live-browser-dom.js +147 -0
- package/.claude/skills/monodesign/scripts/live-browser-session.js +124 -0
- package/.claude/skills/monodesign/scripts/live-browser.js +11213 -0
- package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +1241 -0
- package/.claude/skills/monodesign/scripts/live-complete.mjs +75 -0
- package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +683 -0
- package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +51 -0
- package/.claude/skills/monodesign/scripts/live-inject.mjs +596 -0
- package/.claude/skills/monodesign/scripts/live-insert.mjs +272 -0
- package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +363 -0
- package/.claude/skills/monodesign/scripts/live-poll.mjs +384 -0
- package/.claude/skills/monodesign/scripts/live-resume.mjs +94 -0
- package/.claude/skills/monodesign/scripts/live-server.mjs +1210 -0
- package/.claude/skills/monodesign/scripts/live-status.mjs +61 -0
- package/.claude/skills/monodesign/scripts/live-target.mjs +30 -0
- package/.claude/skills/monodesign/scripts/live-wrap.mjs +884 -0
- package/.claude/skills/monodesign/scripts/live.mjs +297 -0
- package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +14 -0
- package/.claude/skills/monodesign/scripts/palette.mjs +635 -0
- package/.claude/skills/monodesign/scripts/pin.mjs +221 -0
- package/.claude/skills/monodesign/shape.md +71 -0
- package/.claude/skills/monodesign/teach.md +18 -0
- package/.claude/skills/monodesign/typeset.md +59 -0
- package/.claude/skills/monolean-audit/SKILL.md +4 -6
- package/.claude/skills/monolean-help/SKILL.md +0 -1
- package/.claude/skills/monoswarm/SKILL.md +17 -17
- package/.claude/skills/pair-programming/SKILL.md +127 -1100
- package/README.md +1 -1
- package/dist/src/agents/registry-builder.d.ts +1 -1
- package/dist/src/commands/doctor-pick-checks.d.ts +20 -3
- package/dist/src/commands/doctor-pick-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-pick-checks.js +132 -7
- package/dist/src/commands/doctor-pick-checks.js.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts +2 -2
- package/dist/src/commands/doctor-project-checks.d.ts.map +1 -1
- package/dist/src/commands/doctor-project-checks.js +14 -12
- package/dist/src/commands/doctor-project-checks.js.map +1 -1
- package/dist/src/commands/doctor.d.ts.map +1 -1
- package/dist/src/commands/doctor.js +6 -4
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/init-upgrade.d.ts.map +1 -1
- package/dist/src/commands/init-upgrade.js +6 -0
- package/dist/src/commands/init-upgrade.js.map +1 -1
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +11 -0
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/pick.d.ts.map +1 -1
- package/dist/src/commands/pick.js +4 -3
- package/dist/src/commands/pick.js.map +1 -1
- package/dist/src/decision/jev.d.ts +16 -0
- package/dist/src/decision/jev.d.ts.map +1 -1
- package/dist/src/decision/jev.js +12 -0
- package/dist/src/decision/jev.js.map +1 -1
- package/dist/src/decision/pick-eval.d.ts +23 -0
- package/dist/src/decision/pick-eval.d.ts.map +1 -1
- package/dist/src/decision/pick-eval.js +24 -1
- package/dist/src/decision/pick-eval.js.map +1 -1
- package/dist/src/decision/picks.d.ts +5 -0
- package/dist/src/decision/picks.d.ts.map +1 -1
- package/dist/src/decision/picks.js +33 -11
- package/dist/src/decision/picks.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts.map +1 -1
- package/dist/src/init/claudemd-generator.js +1 -0
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/copy-assets.d.ts.map +1 -1
- package/dist/src/init/copy-assets.js +17 -9
- package/dist/src/init/copy-assets.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +26 -4
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/file-guard.d.ts +93 -0
- package/dist/src/init/file-guard.d.ts.map +1 -0
- package/dist/src/init/file-guard.js +239 -0
- package/dist/src/init/file-guard.js.map +1 -0
- package/dist/src/init/helpers-generator.d.ts +7 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +9 -0
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/init-memory.d.ts +10 -0
- package/dist/src/init/init-memory.d.ts.map +1 -1
- package/dist/src/init/init-memory.js +44 -1
- package/dist/src/init/init-memory.js.map +1 -1
- package/dist/src/init/managed-block.d.ts +3 -1
- package/dist/src/init/managed-block.d.ts.map +1 -1
- package/dist/src/init/managed-block.js +9 -2
- package/dist/src/init/managed-block.js.map +1 -1
- package/dist/src/init/mcp-generator.d.ts +9 -0
- package/dist/src/init/mcp-generator.d.ts.map +1 -1
- package/dist/src/init/mcp-generator.js +28 -0
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/runtime-config-merge.d.ts +21 -0
- package/dist/src/init/runtime-config-merge.d.ts.map +1 -0
- package/dist/src/init/runtime-config-merge.js +88 -0
- package/dist/src/init/runtime-config-merge.js.map +1 -0
- package/dist/src/init/settings-generator.js +1 -1
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/shared-instructions-generator.d.ts +3 -1
- package/dist/src/init/shared-instructions-generator.d.ts.map +1 -1
- package/dist/src/init/shared-instructions-generator.js +14 -39
- package/dist/src/init/shared-instructions-generator.js.map +1 -1
- package/dist/src/init/shared.d.ts +10 -0
- package/dist/src/init/shared.d.ts.map +1 -1
- package/dist/src/init/shared.js +32 -1
- package/dist/src/init/shared.js.map +1 -1
- package/dist/src/init/types.d.ts +9 -0
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/init/upgrade.d.ts +4 -0
- package/dist/src/init/upgrade.d.ts.map +1 -1
- package/dist/src/init/upgrade.js +39 -42
- package/dist/src/init/upgrade.js.map +1 -1
- package/dist/src/init/write-antigravity.d.ts.map +1 -1
- package/dist/src/init/write-antigravity.js +9 -3
- package/dist/src/init/write-antigravity.js.map +1 -1
- package/dist/src/init/write-claude.d.ts.map +1 -1
- package/dist/src/init/write-claude.js +40 -19
- package/dist/src/init/write-claude.js.map +1 -1
- package/dist/src/init/write-kimicode.d.ts +27 -0
- package/dist/src/init/write-kimicode.d.ts.map +1 -1
- package/dist/src/init/write-kimicode.js +119 -92
- package/dist/src/init/write-kimicode.js.map +1 -1
- package/dist/src/init/write-opencode.d.ts.map +1 -1
- package/dist/src/init/write-opencode.js +45 -6
- package/dist/src/init/write-opencode.js.map +1 -1
- package/dist/src/init/write-runtime-config.d.ts.map +1 -1
- package/dist/src/init/write-runtime-config.js +108 -81
- package/dist/src/init/write-runtime-config.js.map +1 -1
- package/dist/src/knowledge/eval/golden-set.js +0 -15
- package/dist/src/knowledge/eval/golden-set.js.map +1 -1
- package/dist/src/mcp-tools/org-skill-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/org-skill-tools.js +6 -2
- package/dist/src/mcp-tools/org-skill-tools.js.map +1 -1
- package/dist/src/mcp-tools/pick-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/pick-tools.js +13 -4
- package/dist/src/mcp-tools/pick-tools.js.map +1 -1
- package/dist/src/platform-adapters/merge.d.ts +4 -3
- package/dist/src/platform-adapters/merge.d.ts.map +1 -1
- package/dist/src/platform-adapters/merge.js +18 -8
- package/dist/src/platform-adapters/merge.js.map +1 -1
- package/dist/src/platform-adapters/mutation.d.ts +6 -1
- package/dist/src/platform-adapters/mutation.d.ts.map +1 -1
- package/dist/src/platform-adapters/mutation.js +9 -3
- package/dist/src/platform-adapters/mutation.js.map +1 -1
- package/dist/src/platform-adapters/operations.d.ts.map +1 -1
- package/dist/src/platform-adapters/operations.js +14 -6
- package/dist/src/platform-adapters/operations.js.map +1 -1
- package/dist/src/platform-adapters/types.d.ts +5 -0
- package/dist/src/platform-adapters/types.d.ts.map +1 -1
- package/dist/src/routing/agent-pick.d.ts +9 -7
- package/dist/src/routing/agent-pick.d.ts.map +1 -1
- package/dist/src/routing/agent-pick.js +17 -17
- package/dist/src/routing/agent-pick.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/.claude/skills/github-issue-triage/SKILL.md +0 -354
- package/.claude/skills/github-repo-recap/SKILL.md +0 -207
|
@@ -1,61 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hooks-automation
|
|
3
|
-
description: Automated coordination
|
|
3
|
+
description: Automated coordination and learning from Claude Code operations using the monomind hooks system. Covers pre/post edit, command and task hooks, session persistence, routing, pattern logging, background workers, Claude Code settings.json wiring, and Git hook integration.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Hooks Automation
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Coordinate, validate, and learn from Claude Code operations through the `monomind hooks` command group and the hook handlers that `monomind init` installs into `.claude/settings.json`.
|
|
9
9
|
|
|
10
10
|
## What This Skill Does
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
The hooks system records what happens during a session (edits, commands, tasks) and uses that history to suggest agents, assess command risk, and persist session state. It enables:
|
|
13
13
|
|
|
14
|
-
**
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **Neural Training**: Continuous learning from successful patterns
|
|
21
|
-
- **MCP Integration**: Seamless coordination with swarm tools
|
|
14
|
+
- **Pre-operation hooks**: context and agent suggestions before an edit, risk assessment before a command, agent suggestions before a task
|
|
15
|
+
- **Post-operation hooks**: record edit, command, and task outcomes so routing can learn from them
|
|
16
|
+
- **Session management**: persist state at session end and restore it later
|
|
17
|
+
- **Routing**: route a task to the best agent (or model) and explain the decision
|
|
18
|
+
- **Pattern store**: log trajectories and search stored patterns (`hooks intelligence`); `hooks pretrain` consolidates hook activity into JSON state — no model is trained
|
|
19
|
+
- **Background workers**: run `@monoes/hooks` workers in-process
|
|
22
20
|
|
|
23
21
|
## Prerequisites
|
|
24
22
|
|
|
25
23
|
**Required:**
|
|
26
|
-
- Monomind CLI
|
|
27
|
-
- Claude Code with hooks enabled
|
|
28
|
-
- `.claude/settings.json` with hook configurations
|
|
24
|
+
- Monomind CLI (`npm install -g monomind@latest`, or use `npx monomind`)
|
|
25
|
+
- Claude Code with hooks enabled in `.claude/settings.json`
|
|
29
26
|
|
|
30
27
|
**Optional:**
|
|
31
|
-
- Git repository for
|
|
32
|
-
-
|
|
28
|
+
- Git repository (for the Git hook examples)
|
|
29
|
+
- A test framework (for quality gates)
|
|
33
30
|
|
|
34
31
|
## Quick Start
|
|
35
32
|
|
|
36
|
-
### Initialize Hooks
|
|
33
|
+
### Initialize Hooks
|
|
37
34
|
|
|
38
35
|
```bash
|
|
39
|
-
#
|
|
40
|
-
npx monomind init
|
|
36
|
+
# Write the hooks configuration into .claude/settings.json
|
|
37
|
+
npx monomind init hooks
|
|
38
|
+
|
|
39
|
+
# Only the essential hooks
|
|
40
|
+
npx monomind init hooks --minimal
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
This
|
|
44
|
-
- `.claude/settings.json` with pre-configured hooks
|
|
45
|
-
- Hook command documentation in `.claude/commands/hooks/`
|
|
46
|
-
- Default hook handlers for common operations
|
|
43
|
+
This wires Claude Code's `PreToolUse`, `PostToolUse`, and session events to the helper `.claude/helpers/hook-handler.cjs` (installed by `monomind init`), which handles pre-bash, pre-search (Grep/Glob), pre-agent, post-edit, session-restore, session-end, and related events.
|
|
47
44
|
|
|
48
45
|
### Basic Hook Usage
|
|
49
46
|
|
|
50
47
|
```bash
|
|
51
|
-
#
|
|
52
|
-
npx monomind
|
|
48
|
+
# Record task start and get agent suggestions
|
|
49
|
+
npx monomind hooks pre-task --description "Implement authentication"
|
|
53
50
|
|
|
54
|
-
#
|
|
55
|
-
npx monomind
|
|
51
|
+
# Record an edit outcome
|
|
52
|
+
npx monomind hooks post-edit --file "src/auth.js" --success true
|
|
56
53
|
|
|
57
|
-
#
|
|
58
|
-
npx monomind
|
|
54
|
+
# End the session and persist state
|
|
55
|
+
npx monomind hooks session-end
|
|
59
56
|
```
|
|
60
57
|
|
|
61
58
|
---
|
|
@@ -64,379 +61,210 @@ npx monomind hook session-end --session-id "dev-session" --export-metrics
|
|
|
64
61
|
|
|
65
62
|
### Available Hooks
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Hooks that execute BEFORE operations to prepare and validate:
|
|
70
|
-
|
|
71
|
-
**pre-edit** - Validate and assign agents before file modifications
|
|
72
|
-
```bash
|
|
73
|
-
npx monomind hook pre-edit [options]
|
|
74
|
-
|
|
75
|
-
Options:
|
|
76
|
-
--file, -f <path> File path to be edited
|
|
77
|
-
--auto-assign-agent Automatically assign best agent (default: true)
|
|
78
|
-
--validate-syntax Pre-validate syntax before edit
|
|
79
|
-
--check-conflicts Check for merge conflicts
|
|
80
|
-
--backup-file Create backup before editing
|
|
64
|
+
Run `npx monomind hooks --help` for the full list and `npx monomind hooks <sub> --help` for each subcommand's flags.
|
|
81
65
|
|
|
82
|
-
|
|
83
|
-
npx monomind hook pre-edit --file "src/auth/login.js"
|
|
84
|
-
npx monomind hook pre-edit -f "config/db.js" --validate-syntax
|
|
85
|
-
npx monomind hook pre-edit -f "production.env" --backup-file --check-conflicts
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Features:**
|
|
89
|
-
- Auto agent assignment based on file type
|
|
90
|
-
- Syntax validation to prevent broken code
|
|
91
|
-
- Conflict detection for concurrent edits
|
|
92
|
-
- Automatic file backups for safety
|
|
66
|
+
#### Pre-Operation Hooks
|
|
93
67
|
|
|
94
|
-
**pre-
|
|
68
|
+
**pre-edit** - Get context and agent suggestions before editing a file
|
|
95
69
|
```bash
|
|
96
|
-
npx monomind
|
|
70
|
+
npx monomind hooks pre-edit [options]
|
|
97
71
|
|
|
98
72
|
Options:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
--
|
|
102
|
-
--require-confirmation Request user confirmation for risky commands
|
|
73
|
+
-f, --file <path> File path to edit
|
|
74
|
+
-o, --operation <type> create | update | delete | refactor (default: update)
|
|
75
|
+
-c, --context <text> Additional context about the edit
|
|
103
76
|
|
|
104
77
|
Examples:
|
|
105
|
-
npx monomind
|
|
106
|
-
npx monomind
|
|
78
|
+
npx monomind hooks pre-edit --file "src/auth/login.js"
|
|
79
|
+
npx monomind hooks pre-edit -f "src/db.ts" -o refactor -c "split connection pool"
|
|
107
80
|
```
|
|
108
81
|
|
|
109
|
-
**
|
|
110
|
-
- Command safety validation
|
|
111
|
-
- Resource requirement estimation
|
|
112
|
-
- Destructive command confirmation
|
|
113
|
-
- Permission checks
|
|
114
|
-
|
|
115
|
-
**pre-task** - Auto-spawn agents and prepare for complex tasks
|
|
82
|
+
**pre-command** (alias: `pre-bash`) - Assess risk before executing a command
|
|
116
83
|
```bash
|
|
117
|
-
npx monomind
|
|
84
|
+
npx monomind hooks pre-command --command <cmd>
|
|
118
85
|
|
|
119
86
|
Options:
|
|
120
|
-
|
|
121
|
-
--
|
|
122
|
-
--load-memory Load relevant memory from previous sessions
|
|
123
|
-
--optimize-topology Select optimal swarm topology
|
|
124
|
-
--estimate-complexity Analyze task complexity
|
|
87
|
+
-c, --command <cmd> Command to execute (required)
|
|
88
|
+
-d, --dry-run Only analyze, do not execute (default: true)
|
|
125
89
|
|
|
126
90
|
Examples:
|
|
127
|
-
npx monomind
|
|
128
|
-
npx monomind
|
|
129
|
-
npx monomind hook pre-task -d "Refactor codebase" --optimize-topology
|
|
91
|
+
npx monomind hooks pre-command -c "rm -rf ./build"
|
|
92
|
+
npx monomind hooks pre-bash --command "docker build ."
|
|
130
93
|
```
|
|
131
94
|
|
|
132
|
-
**
|
|
133
|
-
- Automatic agent spawning based on task analysis
|
|
134
|
-
- Memory loading for context continuity
|
|
135
|
-
- Topology optimization for task structure
|
|
136
|
-
- Complexity estimation and time prediction
|
|
137
|
-
|
|
138
|
-
**pre-search** - Prepare and optimize search operations
|
|
95
|
+
**pre-task** - Record task start and get agent suggestions
|
|
139
96
|
```bash
|
|
140
|
-
npx monomind
|
|
97
|
+
npx monomind hooks pre-task [options]
|
|
141
98
|
|
|
142
99
|
Options:
|
|
143
|
-
|
|
144
|
-
--
|
|
145
|
-
--
|
|
100
|
+
-d, --description <text> Task description (required)
|
|
101
|
+
-i, --task-id <id> Task identifier (auto-generated if omitted)
|
|
102
|
+
-a, --auto-spawn Auto-spawn suggested agents (default: false)
|
|
146
103
|
|
|
147
104
|
Examples:
|
|
148
|
-
npx monomind
|
|
105
|
+
npx monomind hooks pre-task --description "Implement user authentication"
|
|
106
|
+
npx monomind hooks pre-task -d "Refactor codebase" -i refactor-1
|
|
149
107
|
```
|
|
150
108
|
|
|
151
|
-
|
|
152
|
-
- Cache checking for faster results
|
|
153
|
-
- Query optimization
|
|
154
|
-
- Search pattern improvement
|
|
109
|
+
There is no `pre-search` CLI subcommand. Search-time context (for Grep/Glob) is handled by the installed helper (`hook-handler.cjs pre-search`) that `monomind init hooks` wires up.
|
|
155
110
|
|
|
156
111
|
#### Post-Operation Hooks
|
|
157
112
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
**post-edit** - Auto-format, validate, and update memory
|
|
113
|
+
**post-edit** - Record editing outcome for learning
|
|
161
114
|
```bash
|
|
162
|
-
npx monomind
|
|
115
|
+
npx monomind hooks post-edit [options]
|
|
163
116
|
|
|
164
117
|
Options:
|
|
165
|
-
--file
|
|
166
|
-
--
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
--validate-output Validate edited file
|
|
118
|
+
-f, --file <path> File path that was edited
|
|
119
|
+
-s, --success Whether the edit was successful
|
|
120
|
+
-o, --outcome <text> Outcome description
|
|
121
|
+
-m, --metrics <list> Performance metrics (e.g. "time:500ms,quality:0.95")
|
|
170
122
|
|
|
171
123
|
Examples:
|
|
172
|
-
npx monomind
|
|
173
|
-
npx monomind
|
|
174
|
-
npx monomind hook post-edit -f "utils/helpers.ts" --train-patterns
|
|
124
|
+
npx monomind hooks post-edit --file "src/components/Button.jsx" --success true
|
|
125
|
+
npx monomind hooks post-edit -f "api/auth.js" -s true -o "added token refresh"
|
|
175
126
|
```
|
|
176
127
|
|
|
177
|
-
|
|
178
|
-
- Language-specific auto-formatting (Prettier, Black, gofmt)
|
|
179
|
-
- Memory storage for edit context and decisions
|
|
180
|
-
- Neural pattern training for continuous improvement
|
|
181
|
-
- Output validation with linting
|
|
128
|
+
The hook records the outcome; it does not format code. Run your formatter (Prettier, Black, gofmt) as its own hook command if you want auto-formatting.
|
|
182
129
|
|
|
183
|
-
**post-
|
|
130
|
+
**post-command** (alias: `post-bash`) - Record command execution outcome
|
|
184
131
|
```bash
|
|
185
|
-
npx monomind
|
|
132
|
+
npx monomind hooks post-command --command <cmd>
|
|
186
133
|
|
|
187
134
|
Options:
|
|
188
|
-
--command
|
|
189
|
-
|
|
190
|
-
--
|
|
191
|
-
|
|
135
|
+
-c, --command <cmd> Command that was executed (required)
|
|
136
|
+
-s, --success Whether the command succeeded
|
|
137
|
+
-e, --exit-code <n> Command exit code (default: 0)
|
|
138
|
+
-d, --duration <ms> Execution duration in milliseconds
|
|
192
139
|
|
|
193
140
|
Examples:
|
|
194
|
-
npx monomind
|
|
141
|
+
npx monomind hooks post-command -c "npm test" --success true --duration 4200
|
|
195
142
|
```
|
|
196
143
|
|
|
197
|
-
**
|
|
198
|
-
- Command execution logging
|
|
199
|
-
- Performance metric tracking
|
|
200
|
-
- Result storage for analysis
|
|
201
|
-
- Error pattern detection
|
|
202
|
-
|
|
203
|
-
**post-task** - Performance analysis and decision storage
|
|
144
|
+
**post-task** - Record task completion for learning
|
|
204
145
|
```bash
|
|
205
|
-
npx monomind
|
|
146
|
+
npx monomind hooks post-task [options]
|
|
206
147
|
|
|
207
148
|
Options:
|
|
208
|
-
--task-id
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
--
|
|
149
|
+
-i, --task-id <id> Task identifier (required)
|
|
150
|
+
-s, --success Whether the task succeeded
|
|
151
|
+
-d, --duration <ms> Task duration in milliseconds
|
|
152
|
+
-o, --outcome <text> Outcome description
|
|
153
|
+
-r, --route-id <id> Route ID from a prior `hooks route` call (joins recommendation to outcome)
|
|
213
154
|
|
|
214
155
|
Examples:
|
|
215
|
-
npx monomind
|
|
216
|
-
npx monomind
|
|
217
|
-
npx monomind hook post-task -t "bug-fix-123" --store-decisions
|
|
156
|
+
npx monomind hooks post-task --task-id "auth-implementation" --success true
|
|
157
|
+
npx monomind hooks post-task -i "bug-fix-123" -s false -o "flaky test, needs follow-up"
|
|
218
158
|
```
|
|
219
159
|
|
|
220
|
-
|
|
221
|
-
- Execution time and token usage measurement
|
|
222
|
-
- Decision and implementation choice recording
|
|
223
|
-
- Neural learning pattern export
|
|
224
|
-
- Completion report generation
|
|
160
|
+
#### Session Hooks
|
|
225
161
|
|
|
226
|
-
**
|
|
162
|
+
**session-restore** - Restore a previous session
|
|
227
163
|
```bash
|
|
228
|
-
npx monomind
|
|
164
|
+
npx monomind hooks session-restore [options]
|
|
229
165
|
|
|
230
166
|
Options:
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
--
|
|
234
|
-
--train-patterns Improve search patterns
|
|
167
|
+
-i, --session-id <id> Session to restore ("latest" for most recent; default: latest)
|
|
168
|
+
-a, --restore-agents Restore spawned agents (default: true)
|
|
169
|
+
-t, --restore-tasks Restore active tasks (default: true)
|
|
235
170
|
|
|
236
171
|
Examples:
|
|
237
|
-
npx monomind
|
|
172
|
+
npx monomind hooks session-restore
|
|
173
|
+
npx monomind hooks session-restore --session-id "feature-auth"
|
|
238
174
|
```
|
|
239
175
|
|
|
240
|
-
|
|
241
|
-
- Result caching for faster subsequent searches
|
|
242
|
-
- Search pattern improvement
|
|
243
|
-
- Relevance scoring
|
|
244
|
-
|
|
245
|
-
#### MCP Integration Hooks
|
|
246
|
-
|
|
247
|
-
Hooks that coordinate with MCP swarm tools:
|
|
248
|
-
|
|
249
|
-
**mcp-initialized** - Persist swarm configuration
|
|
250
|
-
```bash
|
|
251
|
-
npx monomind hook mcp-initialized --swarm-id <id>
|
|
252
|
-
|
|
253
|
-
Features:
|
|
254
|
-
- Save swarm topology and configuration
|
|
255
|
-
- Store agent roster in memory
|
|
256
|
-
- Initialize coordination namespace
|
|
257
|
-
```
|
|
176
|
+
`session-start` still exists but is deprecated in favor of `session-restore`.
|
|
258
177
|
|
|
259
|
-
**
|
|
178
|
+
**session-end** - End current session and persist state
|
|
260
179
|
```bash
|
|
261
|
-
npx monomind
|
|
180
|
+
npx monomind hooks session-end [options]
|
|
262
181
|
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
- Update agent roster
|
|
266
|
-
- Initialize agent-specific memory namespace
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
**task-orchestrated** - Monitor task progress
|
|
270
|
-
```bash
|
|
271
|
-
npx monomind hook task-orchestrated --task-id <id>
|
|
272
|
-
|
|
273
|
-
Features:
|
|
274
|
-
- Track task progress through memory
|
|
275
|
-
- Monitor agent assignments
|
|
276
|
-
- Update coordination state
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
**neural-trained** - Save pattern improvements
|
|
280
|
-
```bash
|
|
281
|
-
npx monomind hook neural-trained --pattern <name>
|
|
282
|
-
|
|
283
|
-
Features:
|
|
284
|
-
- Export trained neural patterns
|
|
285
|
-
- Update coordination models
|
|
286
|
-
- Share learning across agents
|
|
182
|
+
Options:
|
|
183
|
+
-s, --save-state Save session state for later restoration (default: true)
|
|
287
184
|
```
|
|
288
185
|
|
|
289
|
-
|
|
186
|
+
For named checkpoints, use the `session` command group: `npx monomind session save --name "feature-auth"`, `npx monomind session list`, `npx monomind session restore <id>`.
|
|
290
187
|
|
|
291
|
-
**
|
|
188
|
+
**notify** - Send a notification message (logged to the session)
|
|
292
189
|
```bash
|
|
293
|
-
|
|
294
|
-
- Validate memory key format
|
|
295
|
-
- Update cross-agent indexes
|
|
296
|
-
- Trigger dependent hooks
|
|
297
|
-
- Notify subscribed agents
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
**memory-read** - Triggered when agents read from coordination memory
|
|
301
|
-
```bash
|
|
302
|
-
Features:
|
|
303
|
-
- Log access patterns
|
|
304
|
-
- Update popularity metrics
|
|
305
|
-
- Preload related data
|
|
306
|
-
- Track usage statistics
|
|
307
|
-
```
|
|
190
|
+
npx monomind hooks notify --message <msg>
|
|
308
191
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
192
|
+
Options:
|
|
193
|
+
-m, --message <text> Notification message (required)
|
|
194
|
+
-l, --level <level> info | warn | error (default: info)
|
|
195
|
+
-c, --channel <name> Only "console" is implemented (default: console)
|
|
312
196
|
|
|
313
|
-
|
|
314
|
-
-
|
|
315
|
-
- Resolve conflicts
|
|
316
|
-
- Propagate updates
|
|
317
|
-
- Maintain consistency
|
|
197
|
+
Examples:
|
|
198
|
+
npx monomind hooks notify -m "Task completed" --level info
|
|
318
199
|
```
|
|
319
200
|
|
|
320
|
-
####
|
|
201
|
+
#### Routing and Learning
|
|
321
202
|
|
|
322
|
-
**session-start** - Initialize new session
|
|
323
203
|
```bash
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
Options:
|
|
327
|
-
--session-id, -s <id> Session identifier
|
|
328
|
-
--load-context Load context from previous session
|
|
329
|
-
--init-agents Initialize required agents
|
|
330
|
-
|
|
331
|
-
Features:
|
|
332
|
-
- Create session directory
|
|
333
|
-
- Initialize metrics tracking
|
|
334
|
-
- Load previous context
|
|
335
|
-
- Set up coordination namespace
|
|
336
|
-
```
|
|
204
|
+
# Route a task to the best agent (top 3 suggestions by default)
|
|
205
|
+
npx monomind hooks route --task "Fix authentication bug" --top-k 3
|
|
337
206
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
npx monomind hook session-restore --session-id <id>
|
|
207
|
+
# Explain a routing decision
|
|
208
|
+
npx monomind hooks explain --task "Fix authentication bug" --verbose
|
|
341
209
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
--restore-agents Restore agent configurations
|
|
210
|
+
# Route to a Claude model (haiku/sonnet/opus) by complexity
|
|
211
|
+
npx monomind hooks model-route --task "Rename a variable" --prefer-cost
|
|
212
|
+
npx monomind hooks model-stats
|
|
346
213
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
npx monomind hook session-restore -s "feature-auth" --restore-memory
|
|
350
|
-
```
|
|
214
|
+
# Route based on test coverage gaps
|
|
215
|
+
npx monomind hooks coverage-gaps --critical-only
|
|
351
216
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
- Restore memory state and decisions
|
|
355
|
-
- Reconfigure agents to previous state
|
|
356
|
-
- Resume in-progress tasks
|
|
217
|
+
# Consolidate hook activity into JSON state (no model is trained)
|
|
218
|
+
npx monomind hooks pretrain --depth shallow
|
|
357
219
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
npx monomind
|
|
220
|
+
# Pattern store: ingest history, list/search patterns
|
|
221
|
+
npx monomind hooks intelligence train
|
|
222
|
+
npx monomind hooks intelligence patterns --query "auth" --limit 5
|
|
223
|
+
npx monomind hooks intelligence status
|
|
361
224
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
--save-state Save current session state (default: true)
|
|
365
|
-
--export-metrics Export session metrics
|
|
366
|
-
--generate-summary Create session summary
|
|
367
|
-
--cleanup-temp Remove temporary files
|
|
225
|
+
# Copy learned patterns from another local project
|
|
226
|
+
npx monomind hooks transfer from-project --source ../other-project
|
|
368
227
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
npx monomind hook session-end -s "quick-fix" --cleanup-temp
|
|
228
|
+
# Metrics dashboard
|
|
229
|
+
npx monomind hooks metrics --period 7d
|
|
230
|
+
npx monomind hooks metrics --v1-dashboard
|
|
373
231
|
```
|
|
374
232
|
|
|
375
|
-
|
|
376
|
-
- Save current context and progress
|
|
377
|
-
- Export session metrics (duration, commands, tokens, files)
|
|
378
|
-
- Generate work summary with decisions and next steps
|
|
379
|
-
- Cleanup temporary files and optimize storage
|
|
233
|
+
#### Background Workers and Utilities
|
|
380
234
|
|
|
381
|
-
**notify** - Custom notifications with swarm status
|
|
382
235
|
```bash
|
|
383
|
-
npx monomind
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
--level <level> Notification level (info|warning|error)
|
|
388
|
-
--swarm-status Include swarm status (default: true)
|
|
389
|
-
--broadcast Send to all agents
|
|
390
|
-
|
|
391
|
-
Examples:
|
|
392
|
-
npx monomind hook notify -m "Task completed" --level info
|
|
393
|
-
npx monomind hook notify -m "Critical error" --level error --broadcast
|
|
236
|
+
npx monomind hooks list # registered hooks
|
|
237
|
+
npx monomind hooks worker list # available background workers
|
|
238
|
+
npx monomind hooks worker run --name <worker>
|
|
239
|
+
npx monomind hooks statusline --compact
|
|
394
240
|
```
|
|
395
241
|
|
|
396
|
-
**Features:**
|
|
397
|
-
- Send notifications to coordination system
|
|
398
|
-
- Include swarm status and metrics
|
|
399
|
-
- Broadcast to all agents
|
|
400
|
-
- Log important events
|
|
401
|
-
|
|
402
242
|
### Configuration
|
|
403
243
|
|
|
404
|
-
####
|
|
244
|
+
#### Generated Configuration
|
|
405
245
|
|
|
406
|
-
|
|
246
|
+
`npx monomind init hooks` writes the recommended configuration. Each entry runs the installed helper, which reads Claude Code's hook input JSON from stdin:
|
|
407
247
|
|
|
408
248
|
```json
|
|
409
249
|
{
|
|
410
250
|
"hooks": {
|
|
411
251
|
"PreToolUse": [
|
|
412
252
|
{
|
|
413
|
-
"matcher": "
|
|
253
|
+
"matcher": "Bash",
|
|
414
254
|
"hooks": [{
|
|
415
255
|
"type": "command",
|
|
416
|
-
"command": "
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
"matcher": "^Bash$",
|
|
421
|
-
"hooks": [{
|
|
422
|
-
"type": "command",
|
|
423
|
-
"command": "npx monomind hook pre-bash --command '${tool.params.command}'"
|
|
256
|
+
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" pre-bash",
|
|
257
|
+
"timeout": 5
|
|
424
258
|
}]
|
|
425
259
|
}
|
|
426
260
|
],
|
|
427
261
|
"PostToolUse": [
|
|
428
262
|
{
|
|
429
|
-
"matcher": "
|
|
263
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
430
264
|
"hooks": [{
|
|
431
265
|
"type": "command",
|
|
432
|
-
"command": "
|
|
433
|
-
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
"matcher": "^Bash$",
|
|
437
|
-
"hooks": [{
|
|
438
|
-
"type": "command",
|
|
439
|
-
"command": "npx monomind hook post-bash --command '${tool.params.command}' --update-metrics"
|
|
266
|
+
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/helpers/hook-handler.cjs\" post-edit",
|
|
267
|
+
"timeout": 10
|
|
440
268
|
}]
|
|
441
269
|
}
|
|
442
270
|
]
|
|
@@ -444,749 +272,226 @@ Edit `.claude/settings.json` to configure hooks:
|
|
|
444
272
|
}
|
|
445
273
|
```
|
|
446
274
|
|
|
447
|
-
|
|
275
|
+
(The generated commands also walk up the directory tree to find `.claude/helpers`; the version above is simplified.)
|
|
276
|
+
|
|
277
|
+
#### Calling the CLI Directly
|
|
448
278
|
|
|
449
|
-
|
|
279
|
+
Claude Code passes hook input as JSON on stdin (for example `tool_input.file_path`, `tool_input.command`). To call `monomind hooks` subcommands directly, extract the fields with `jq`:
|
|
450
280
|
|
|
451
281
|
```json
|
|
452
282
|
{
|
|
453
283
|
"hooks": {
|
|
454
|
-
"enabled": true,
|
|
455
|
-
"debug": false,
|
|
456
|
-
"timeout": 5000,
|
|
457
|
-
|
|
458
284
|
"PreToolUse": [
|
|
459
285
|
{
|
|
460
|
-
"matcher": "
|
|
461
|
-
"hooks": [
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
"continueOnError": true
|
|
467
|
-
}
|
|
468
|
-
]
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"matcher": "^Task$",
|
|
472
|
-
"hooks": [
|
|
473
|
-
{
|
|
474
|
-
"type": "command",
|
|
475
|
-
"command": "npx monomind hook pre-task --description '${tool.params.task}' --auto-spawn-agents --load-memory",
|
|
476
|
-
"async": true
|
|
477
|
-
}
|
|
478
|
-
]
|
|
286
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
287
|
+
"hooks": [{
|
|
288
|
+
"type": "command",
|
|
289
|
+
"command": "sh -c 'f=$(jq -r .tool_input.file_path); npx monomind hooks pre-edit --file \"$f\"'",
|
|
290
|
+
"timeout": 10
|
|
291
|
+
}]
|
|
479
292
|
},
|
|
480
293
|
{
|
|
481
|
-
"matcher": "
|
|
482
|
-
"hooks": [
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
]
|
|
294
|
+
"matcher": "Bash",
|
|
295
|
+
"hooks": [{
|
|
296
|
+
"type": "command",
|
|
297
|
+
"command": "sh -c 'c=$(jq -r .tool_input.command); npx monomind hooks pre-command --command \"$c\"'",
|
|
298
|
+
"timeout": 10
|
|
299
|
+
}]
|
|
488
300
|
}
|
|
489
301
|
],
|
|
490
|
-
|
|
491
302
|
"PostToolUse": [
|
|
492
303
|
{
|
|
493
|
-
"matcher": "
|
|
494
|
-
"hooks": [
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
]
|
|
501
|
-
},
|
|
502
|
-
{
|
|
503
|
-
"matcher": "^Task$",
|
|
504
|
-
"hooks": [
|
|
505
|
-
{
|
|
506
|
-
"type": "command",
|
|
507
|
-
"command": "npx monomind hook post-task --task-id '${result.task_id}' --analyze-performance --store-decisions --export-learnings",
|
|
508
|
-
"async": true
|
|
509
|
-
}
|
|
510
|
-
]
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
"matcher": "^Grep$",
|
|
514
|
-
"hooks": [
|
|
515
|
-
{
|
|
516
|
-
"type": "command",
|
|
517
|
-
"command": "npx monomind hook post-search --query '${tool.params.pattern}' --cache-results --train-patterns"
|
|
518
|
-
}
|
|
519
|
-
]
|
|
520
|
-
}
|
|
521
|
-
],
|
|
522
|
-
|
|
523
|
-
"SessionStart": [
|
|
524
|
-
{
|
|
525
|
-
"hooks": [
|
|
526
|
-
{
|
|
527
|
-
"type": "command",
|
|
528
|
-
"command": "npx monomind hook session-start --session-id '${session.id}' --load-context"
|
|
529
|
-
}
|
|
530
|
-
]
|
|
304
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
305
|
+
"hooks": [{
|
|
306
|
+
"type": "command",
|
|
307
|
+
"command": "sh -c 'f=$(jq -r .tool_input.file_path); npx monomind hooks post-edit --file \"$f\" --success true'",
|
|
308
|
+
"timeout": 10
|
|
309
|
+
}]
|
|
531
310
|
}
|
|
532
311
|
],
|
|
533
|
-
|
|
534
312
|
"SessionEnd": [
|
|
535
313
|
{
|
|
536
|
-
"hooks": [
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
]
|
|
314
|
+
"hooks": [{
|
|
315
|
+
"type": "command",
|
|
316
|
+
"command": "npx monomind hooks session-end"
|
|
317
|
+
}]
|
|
542
318
|
}
|
|
543
319
|
]
|
|
544
320
|
}
|
|
545
321
|
}
|
|
546
322
|
```
|
|
547
323
|
|
|
548
|
-
|
|
324
|
+
`npx` startup adds latency to every tool call; the helper-based configuration is faster.
|
|
549
325
|
|
|
550
|
-
|
|
326
|
+
#### Enforcement Gates
|
|
551
327
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
{
|
|
557
|
-
"matcher": "^(Write|Edit|MultiEdit)$",
|
|
558
|
-
"hooks": [
|
|
559
|
-
{
|
|
560
|
-
"type": "command",
|
|
561
|
-
"command": "npx monomind hook check-protected --file '${tool.params.file_path}'"
|
|
562
|
-
}
|
|
563
|
-
]
|
|
564
|
-
}
|
|
565
|
-
]
|
|
566
|
-
}
|
|
567
|
-
}
|
|
328
|
+
To block destructive commands and secret leaks, wire the guidance gates into the same hooks:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
npx monomind guidance setup
|
|
568
332
|
```
|
|
569
333
|
|
|
570
334
|
#### Automatic Testing
|
|
571
335
|
|
|
572
|
-
Run tests after file modifications:
|
|
336
|
+
Run tests after file modifications (plain shell, no monomind command needed):
|
|
573
337
|
|
|
574
338
|
```json
|
|
575
339
|
{
|
|
576
340
|
"hooks": {
|
|
577
341
|
"PostToolUse": [
|
|
578
342
|
{
|
|
579
|
-
"matcher": "
|
|
580
|
-
"hooks": [
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
"continueOnError": true
|
|
585
|
-
}
|
|
586
|
-
]
|
|
343
|
+
"matcher": "Write",
|
|
344
|
+
"hooks": [{
|
|
345
|
+
"type": "command",
|
|
346
|
+
"command": "sh -c 'f=$(jq -r .tool_input.file_path); t=\"${f%.js}.test.js\"; [ -f \"$t\" ] && npm test -- \"$t\" || true'"
|
|
347
|
+
}]
|
|
587
348
|
}
|
|
588
349
|
]
|
|
589
350
|
}
|
|
590
351
|
}
|
|
591
352
|
```
|
|
592
353
|
|
|
593
|
-
### MCP Tool
|
|
594
|
-
|
|
595
|
-
Hooks automatically integrate with MCP tools for coordination:
|
|
596
|
-
|
|
597
|
-
#### Pre-Task Hook with Agent Spawning
|
|
598
|
-
|
|
599
|
-
```javascript
|
|
600
|
-
// Hook command
|
|
601
|
-
npx monomind hook pre-task --description "Build REST API"
|
|
602
|
-
|
|
603
|
-
// Internally calls MCP tools:
|
|
604
|
-
mcp__monomind__agent_spawn {
|
|
605
|
-
type: "Backend Architect",
|
|
606
|
-
capabilities: ["api", "database", "testing"]
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
mcp__monomind__memory_pattern-store {
|
|
610
|
-
action: "store",
|
|
611
|
-
key: "swarm/task/api-build/context",
|
|
612
|
-
namespace: "coordination",
|
|
613
|
-
value: JSON.stringify({
|
|
614
|
-
description: "Build REST API",
|
|
615
|
-
agents: ["Backend Architect"],
|
|
616
|
-
started: Date.now()
|
|
617
|
-
})
|
|
618
|
-
}
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
#### Post-Edit Hook with Memory Storage
|
|
622
|
-
|
|
623
|
-
```javascript
|
|
624
|
-
// Hook command
|
|
625
|
-
npx monomind hook post-edit --file "api/auth.js"
|
|
626
|
-
|
|
627
|
-
// Internally calls MCP tools:
|
|
628
|
-
mcp__monomind__memory_pattern-store {
|
|
629
|
-
action: "store",
|
|
630
|
-
key: "swarm/edits/api/auth.js",
|
|
631
|
-
namespace: "coordination",
|
|
632
|
-
value: JSON.stringify({
|
|
633
|
-
file: "api/auth.js",
|
|
634
|
-
timestamp: Date.now(),
|
|
635
|
-
changes: { added: 45, removed: 12 },
|
|
636
|
-
formatted: true,
|
|
637
|
-
linted: true
|
|
638
|
-
})
|
|
639
|
-
}
|
|
640
|
-
```
|
|
641
|
-
|
|
642
|
-
#### Session End Hook with State Persistence
|
|
643
|
-
|
|
644
|
-
```javascript
|
|
645
|
-
// Hook command
|
|
646
|
-
npx monomind hook session-end --session-id "dev-2024"
|
|
647
|
-
|
|
648
|
-
// Internally calls MCP tools:
|
|
649
|
-
// npx monomind session save --session-id "dev-2024"
|
|
650
|
-
|
|
651
|
-
mcp__monomind__swarm_status {
|
|
652
|
-
swarmId: "current"
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
// Generates metrics and summary
|
|
656
|
-
```
|
|
657
|
-
|
|
658
|
-
### Memory Coordination Protocol
|
|
354
|
+
### MCP Tool Equivalents
|
|
659
355
|
|
|
660
|
-
|
|
356
|
+
The core hooks are also exposed as MCP tools, so agents can call them without a shell: `mcp__monomind__hooks_pre-task`, `mcp__monomind__hooks_post-task`, `mcp__monomind__hooks_pre-edit`, `mcp__monomind__hooks_post-edit`, `mcp__monomind__hooks_pre-command`, `mcp__monomind__hooks_post-command`, `mcp__monomind__hooks_route`, `mcp__monomind__hooks_explain`.
|
|
661
357
|
|
|
662
|
-
|
|
358
|
+
To share context between agents, store it explicitly in memory:
|
|
663
359
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
action: "store",
|
|
668
|
-
key: "swarm/hooks/pre-edit/status",
|
|
669
|
-
namespace: "coordination",
|
|
670
|
-
value: JSON.stringify({
|
|
671
|
-
status: "running",
|
|
672
|
-
hook: "pre-edit",
|
|
673
|
-
file: "src/auth.js",
|
|
674
|
-
timestamp: Date.now()
|
|
675
|
-
})
|
|
676
|
-
}
|
|
677
|
-
```
|
|
678
|
-
|
|
679
|
-
**Phase 2: PROGRESS** - Hook processes
|
|
680
|
-
```javascript
|
|
681
|
-
mcp__monomind__memory_pattern-store {
|
|
682
|
-
action: "store",
|
|
683
|
-
key: "swarm/hooks/pre-edit/progress",
|
|
684
|
-
namespace: "coordination",
|
|
685
|
-
value: JSON.stringify({
|
|
686
|
-
progress: 50,
|
|
687
|
-
action: "validating syntax",
|
|
688
|
-
file: "src/auth.js"
|
|
689
|
-
})
|
|
690
|
-
}
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
**Phase 3: COMPLETE** - Hook finishes
|
|
694
|
-
```javascript
|
|
695
|
-
mcp__monomind__memory_pattern-store {
|
|
696
|
-
action: "store",
|
|
697
|
-
key: "swarm/hooks/pre-edit/complete",
|
|
698
|
-
namespace: "coordination",
|
|
699
|
-
value: JSON.stringify({
|
|
700
|
-
status: "complete",
|
|
701
|
-
result: "success",
|
|
702
|
-
agent_assigned: "Backend Architect",
|
|
703
|
-
syntax_valid: true,
|
|
704
|
-
backup_created: true
|
|
705
|
-
})
|
|
706
|
-
}
|
|
707
|
-
```
|
|
708
|
-
|
|
709
|
-
### Hook Response Format
|
|
710
|
-
|
|
711
|
-
Hooks return JSON responses to control operation flow:
|
|
712
|
-
|
|
713
|
-
#### Continue Response
|
|
714
|
-
```json
|
|
715
|
-
{
|
|
716
|
-
"continue": true,
|
|
717
|
-
"reason": "All validations passed",
|
|
718
|
-
"metadata": {
|
|
719
|
-
"agent_assigned": "Backend Architect",
|
|
720
|
-
"syntax_valid": true,
|
|
721
|
-
"file": "src/auth.js"
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
```
|
|
725
|
-
|
|
726
|
-
#### Block Response
|
|
727
|
-
```json
|
|
728
|
-
{
|
|
729
|
-
"continue": false,
|
|
730
|
-
"reason": "Protected file - manual review required",
|
|
731
|
-
"metadata": {
|
|
732
|
-
"file": ".env.production",
|
|
733
|
-
"protection_level": "high",
|
|
734
|
-
"requires": "manual_approval"
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
```
|
|
738
|
-
|
|
739
|
-
#### Warning Response
|
|
740
|
-
```json
|
|
741
|
-
{
|
|
742
|
-
"continue": true,
|
|
743
|
-
"reason": "Syntax valid but complexity high",
|
|
744
|
-
"warnings": [
|
|
745
|
-
"Cyclomatic complexity: 15 (threshold: 10)",
|
|
746
|
-
"Consider refactoring for better maintainability"
|
|
747
|
-
],
|
|
748
|
-
"metadata": {
|
|
749
|
-
"complexity": 15,
|
|
750
|
-
"threshold": 10
|
|
751
|
-
}
|
|
752
|
-
}
|
|
360
|
+
```bash
|
|
361
|
+
npx monomind memory store --key "swarm/backend/auth-api" --value "JWT, refresh via /auth/refresh" --namespace coordination
|
|
362
|
+
npx monomind memory search --query "auth api" --namespace coordination
|
|
753
363
|
```
|
|
754
364
|
|
|
755
365
|
### Git Integration
|
|
756
366
|
|
|
757
|
-
Hooks can integrate with Git operations for quality control:
|
|
758
|
-
|
|
759
367
|
#### Pre-Commit Hook
|
|
760
368
|
```bash
|
|
761
|
-
# Add to .git/hooks/pre-commit or use husky
|
|
762
|
-
|
|
763
369
|
#!/bin/bash
|
|
764
|
-
#
|
|
370
|
+
# .git/hooks/pre-commit (or via husky)
|
|
765
371
|
|
|
766
|
-
#
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
for FILE in $FILES; do
|
|
770
|
-
# Run pre-edit hook for validation
|
|
771
|
-
npx monomind hook pre-edit --file "$FILE" --validate-syntax
|
|
772
|
-
|
|
773
|
-
if [ $? -ne 0 ]; then
|
|
774
|
-
echo "Validation failed for $FILE"
|
|
775
|
-
exit 1
|
|
776
|
-
fi
|
|
777
|
-
|
|
778
|
-
# Run post-edit hook for formatting
|
|
779
|
-
npx monomind hook post-edit --file "$FILE" --auto-format
|
|
780
|
-
done
|
|
372
|
+
# Risk assessment of the working-tree change against HEAD (informational)
|
|
373
|
+
npx monomind analyze diff --risk --classify
|
|
781
374
|
|
|
782
375
|
# Run tests
|
|
783
|
-
npm test
|
|
784
|
-
|
|
785
|
-
exit $?
|
|
376
|
+
npm test || exit 1
|
|
786
377
|
```
|
|
787
378
|
|
|
788
379
|
#### Post-Commit Hook
|
|
789
380
|
```bash
|
|
790
|
-
# Add to .git/hooks/post-commit
|
|
791
|
-
|
|
792
381
|
#!/bin/bash
|
|
793
|
-
#
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
COMMIT_MSG=$(git log -1 --pretty=%B)
|
|
797
|
-
|
|
798
|
-
npx monomind hook notify \
|
|
799
|
-
--message "Commit completed: $COMMIT_MSG" \
|
|
800
|
-
--level info \
|
|
801
|
-
--swarm-status
|
|
382
|
+
# .git/hooks/post-commit
|
|
383
|
+
COMMIT_MSG=$(git log -1 --pretty=%s)
|
|
384
|
+
npx monomind hooks notify --message "Commit completed: $COMMIT_MSG" --level info
|
|
802
385
|
```
|
|
803
386
|
|
|
804
387
|
#### Pre-Push Hook
|
|
805
388
|
```bash
|
|
806
|
-
# Add to .git/hooks/pre-push
|
|
807
|
-
|
|
808
389
|
#!/bin/bash
|
|
809
|
-
#
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
npm run test:all
|
|
813
|
-
|
|
814
|
-
# Run quality checks
|
|
815
|
-
npx monomind hook session-end \
|
|
816
|
-
--generate-report \
|
|
817
|
-
--export-metrics
|
|
818
|
-
|
|
819
|
-
# Verify quality thresholds
|
|
820
|
-
TRUTH_SCORE=$(npx monomind metrics score --format json | jq -r '.truth_score')
|
|
821
|
-
|
|
822
|
-
if (( $(echo "$TRUTH_SCORE < 0.95" | bc -l) )); then
|
|
823
|
-
echo "Truth score below threshold: $TRUTH_SCORE < 0.95"
|
|
824
|
-
exit 1
|
|
825
|
-
fi
|
|
826
|
-
|
|
827
|
-
exit 0
|
|
390
|
+
# .git/hooks/pre-push
|
|
391
|
+
npm test || exit 1
|
|
392
|
+
npx monomind hooks session-end
|
|
828
393
|
```
|
|
829
394
|
|
|
830
395
|
### Agent Coordination Workflow
|
|
831
396
|
|
|
832
|
-
How agents use hooks for coordination:
|
|
833
|
-
|
|
834
|
-
#### Agent Workflow Example
|
|
835
|
-
|
|
836
397
|
```bash
|
|
837
398
|
# Agent 1: Backend Developer
|
|
838
|
-
|
|
839
|
-
npx monomind
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
# STEP 2: Work begins - pre-edit validation
|
|
845
|
-
npx monomind hook pre-edit \
|
|
846
|
-
--file "api/auth.js" \
|
|
847
|
-
--auto-assign-agent \
|
|
848
|
-
--validate-syntax
|
|
849
|
-
|
|
850
|
-
# STEP 3: Edit file (via Claude Code Edit tool)
|
|
851
|
-
# ... code changes ...
|
|
852
|
-
|
|
853
|
-
# STEP 4: Post-edit processing
|
|
854
|
-
npx monomind hook post-edit \
|
|
855
|
-
--file "api/auth.js" \
|
|
856
|
-
--memory-key "swarm/backend/auth-api" \
|
|
857
|
-
--auto-format \
|
|
858
|
-
--train-patterns
|
|
859
|
-
|
|
860
|
-
# STEP 5: Notify coordination system
|
|
861
|
-
npx monomind hook notify \
|
|
862
|
-
--message "Auth API implementation complete" \
|
|
863
|
-
--swarm-status \
|
|
864
|
-
--broadcast
|
|
865
|
-
|
|
866
|
-
# STEP 6: Task completion
|
|
867
|
-
npx monomind hook post-task \
|
|
868
|
-
--task-id "auth-api" \
|
|
869
|
-
--analyze-performance \
|
|
870
|
-
--store-decisions \
|
|
871
|
-
--export-learnings
|
|
872
|
-
```
|
|
873
|
-
|
|
874
|
-
```bash
|
|
875
|
-
# Agent 2: Test Engineer (receives notification)
|
|
876
|
-
# STEP 1: Check memory for API details
|
|
877
|
-
npx monomind hook session-restore \
|
|
878
|
-
--session-id "swarm-current" \
|
|
879
|
-
--restore-memory
|
|
880
|
-
|
|
881
|
-
# Memory contains: swarm/backend/auth-api with implementation details
|
|
882
|
-
|
|
883
|
-
# STEP 2: Generate tests
|
|
884
|
-
npx monomind hook pre-task \
|
|
885
|
-
--description "Write tests for auth API" \
|
|
886
|
-
--load-memory
|
|
887
|
-
|
|
888
|
-
# STEP 3: Create test file
|
|
889
|
-
npx monomind hook post-edit \
|
|
890
|
-
--file "api/auth.test.js" \
|
|
891
|
-
--memory-key "swarm/testing/auth-api-tests" \
|
|
892
|
-
--train-patterns
|
|
893
|
-
|
|
894
|
-
# STEP 4: Share test results
|
|
895
|
-
npx monomind hook notify \
|
|
896
|
-
--message "Auth API tests complete - 100% coverage" \
|
|
897
|
-
--broadcast
|
|
898
|
-
```
|
|
899
|
-
|
|
900
|
-
### Custom Hook Creation
|
|
901
|
-
|
|
902
|
-
Create custom hooks for specific workflows:
|
|
903
|
-
|
|
904
|
-
#### Custom Hook Template
|
|
905
|
-
|
|
906
|
-
```javascript
|
|
907
|
-
// .claude/hooks/custom-quality-check.js
|
|
908
|
-
|
|
909
|
-
module.exports = {
|
|
910
|
-
name: 'custom-quality-check',
|
|
911
|
-
type: 'pre',
|
|
912
|
-
matcher: /\.(ts|js)$/,
|
|
913
|
-
|
|
914
|
-
async execute(context) {
|
|
915
|
-
const { file, content } = context;
|
|
916
|
-
|
|
917
|
-
// Custom validation logic
|
|
918
|
-
const complexity = await analyzeComplexity(content);
|
|
919
|
-
const securityIssues = await scanSecurity(content);
|
|
920
|
-
|
|
921
|
-
// Store in memory
|
|
922
|
-
await storeInMemory({
|
|
923
|
-
key: `quality/${file}`,
|
|
924
|
-
value: { complexity, securityIssues }
|
|
925
|
-
});
|
|
926
|
-
|
|
927
|
-
// Return decision
|
|
928
|
-
if (complexity > 15 || securityIssues.length > 0) {
|
|
929
|
-
return {
|
|
930
|
-
continue: false,
|
|
931
|
-
reason: 'Quality checks failed',
|
|
932
|
-
warnings: [
|
|
933
|
-
`Complexity: ${complexity} (max: 15)`,
|
|
934
|
-
`Security issues: ${securityIssues.length}`
|
|
935
|
-
]
|
|
936
|
-
};
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
return {
|
|
940
|
-
continue: true,
|
|
941
|
-
reason: 'Quality checks passed',
|
|
942
|
-
metadata: { complexity, securityIssues: 0 }
|
|
943
|
-
};
|
|
944
|
-
}
|
|
945
|
-
};
|
|
946
|
-
```
|
|
947
|
-
|
|
948
|
-
#### Register Custom Hook
|
|
399
|
+
npx monomind hooks pre-task --description "Implement user authentication API" --task-id auth-api
|
|
400
|
+
npx monomind hooks pre-edit --file "api/auth.js"
|
|
401
|
+
# ... edit via Claude Code Edit tool ...
|
|
402
|
+
npx monomind hooks post-edit --file "api/auth.js" --success true
|
|
403
|
+
npx monomind memory store --key "swarm/backend/auth-api" --value "endpoints: /login, /refresh" --namespace coordination
|
|
404
|
+
npx monomind hooks post-task --task-id auth-api --success true
|
|
949
405
|
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
"matcher": "^(Write|Edit)$",
|
|
956
|
-
"hooks": [
|
|
957
|
-
{
|
|
958
|
-
"type": "script",
|
|
959
|
-
"script": ".claude/hooks/custom-quality-check.js"
|
|
960
|
-
}
|
|
961
|
-
]
|
|
962
|
-
}
|
|
963
|
-
]
|
|
964
|
-
}
|
|
965
|
-
}
|
|
406
|
+
# Agent 2: Test Engineer
|
|
407
|
+
npx monomind memory retrieve --key "swarm/backend/auth-api" --namespace coordination
|
|
408
|
+
npx monomind hooks pre-task --description "Write tests for auth API" --task-id auth-tests
|
|
409
|
+
npx monomind hooks post-edit --file "api/auth.test.js" --success true
|
|
410
|
+
npx monomind hooks post-task --task-id auth-tests --success true
|
|
966
411
|
```
|
|
967
412
|
|
|
968
413
|
### Real-World Examples
|
|
969
414
|
|
|
970
|
-
#### Example 1: Full-Stack
|
|
415
|
+
#### Example 1: Full-Stack Feature
|
|
971
416
|
|
|
972
417
|
```bash
|
|
973
|
-
|
|
974
|
-
npx monomind
|
|
975
|
-
|
|
976
|
-
# Pre-task planning
|
|
977
|
-
npx monomind hook pre-task \
|
|
978
|
-
--description "Build user profile feature - frontend + backend + tests" \
|
|
979
|
-
--auto-spawn-agents \
|
|
980
|
-
--optimize-topology
|
|
418
|
+
npx monomind hooks session-restore
|
|
419
|
+
npx monomind hooks route --task "Build user profile feature - frontend + backend + tests"
|
|
420
|
+
npx monomind hooks pre-task --description "Build user profile feature" --task-id profile
|
|
981
421
|
|
|
982
|
-
|
|
983
|
-
npx monomind hook pre-edit --file "api/profile.js"
|
|
422
|
+
npx monomind hooks pre-edit --file "api/profile.js"
|
|
984
423
|
# ... implement backend ...
|
|
985
|
-
npx monomind
|
|
986
|
-
--file "api/profile.js" \
|
|
987
|
-
--memory-key "profile/backend" \
|
|
988
|
-
--train-patterns
|
|
424
|
+
npx monomind hooks post-edit --file "api/profile.js" --success true
|
|
989
425
|
|
|
990
|
-
|
|
991
|
-
npx monomind hook pre-edit --file "components/Profile.jsx"
|
|
426
|
+
npx monomind hooks pre-edit --file "components/Profile.jsx"
|
|
992
427
|
# ... implement frontend ...
|
|
993
|
-
npx monomind
|
|
994
|
-
--file "components/Profile.jsx" \
|
|
995
|
-
--memory-key "profile/frontend" \
|
|
996
|
-
--train-patterns
|
|
997
|
-
|
|
998
|
-
# Testing (reads both backend and frontend from memory)
|
|
999
|
-
npx monomind hook pre-task \
|
|
1000
|
-
--description "Test profile feature" \
|
|
1001
|
-
--load-memory
|
|
1002
|
-
|
|
1003
|
-
# Session end - export everything
|
|
1004
|
-
npx monomind hook session-end \
|
|
1005
|
-
--session-id "fullstack-feature" \
|
|
1006
|
-
--export-metrics \
|
|
1007
|
-
--generate-summary
|
|
1008
|
-
```
|
|
1009
|
-
|
|
1010
|
-
#### Example 2: Debugging with Hooks
|
|
428
|
+
npx monomind hooks post-edit --file "components/Profile.jsx" --success true
|
|
1011
429
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
npx monomind hook session-start --session-id "debug-memory-leak"
|
|
1015
|
-
|
|
1016
|
-
# Pre-task: analyze issue
|
|
1017
|
-
npx monomind hook pre-task \
|
|
1018
|
-
--description "Debug memory leak in event handlers" \
|
|
1019
|
-
--load-memory \
|
|
1020
|
-
--estimate-complexity
|
|
1021
|
-
|
|
1022
|
-
# Search for event emitters
|
|
1023
|
-
npx monomind hook pre-search --query "EventEmitter"
|
|
1024
|
-
# ... search executes ...
|
|
1025
|
-
npx monomind hook post-search \
|
|
1026
|
-
--query "EventEmitter" \
|
|
1027
|
-
--cache-results
|
|
1028
|
-
|
|
1029
|
-
# Fix the issue
|
|
1030
|
-
npx monomind hook pre-edit \
|
|
1031
|
-
--file "services/events.js" \
|
|
1032
|
-
--backup-file
|
|
1033
|
-
# ... fix code ...
|
|
1034
|
-
npx monomind hook post-edit \
|
|
1035
|
-
--file "services/events.js" \
|
|
1036
|
-
--memory-key "debug/memory-leak-fix" \
|
|
1037
|
-
--validate-output
|
|
1038
|
-
|
|
1039
|
-
# Verify fix
|
|
1040
|
-
npx monomind hook post-task \
|
|
1041
|
-
--task-id "memory-leak-fix" \
|
|
1042
|
-
--analyze-performance \
|
|
1043
|
-
--generate-report
|
|
1044
|
-
|
|
1045
|
-
# End session
|
|
1046
|
-
npx monomind hook session-end \
|
|
1047
|
-
--session-id "debug-memory-leak" \
|
|
1048
|
-
--export-metrics
|
|
430
|
+
npx monomind hooks post-task --task-id profile --success true
|
|
431
|
+
npx monomind hooks session-end
|
|
1049
432
|
```
|
|
1050
433
|
|
|
1051
|
-
#### Example
|
|
434
|
+
#### Example 2: Debugging
|
|
1052
435
|
|
|
1053
436
|
```bash
|
|
1054
|
-
|
|
1055
|
-
npx monomind
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
# Agent 1: Code Analyzer
|
|
1061
|
-
npx monomind hook pre-task --description "Analyze code complexity"
|
|
1062
|
-
# ... analysis ...
|
|
1063
|
-
npx monomind hook post-task \
|
|
1064
|
-
--task-id "analysis" \
|
|
1065
|
-
--store-decisions
|
|
1066
|
-
|
|
1067
|
-
# Agent 2: Refactoring (reads analysis from memory)
|
|
1068
|
-
npx monomind hook session-restore \
|
|
1069
|
-
--session-id "swarm-refactor" \
|
|
1070
|
-
--restore-memory
|
|
1071
|
-
|
|
1072
|
-
for file in src/**/*.js; do
|
|
1073
|
-
npx monomind hook pre-edit --file "$file" --backup-file
|
|
1074
|
-
# ... refactor ...
|
|
1075
|
-
npx monomind hook post-edit \
|
|
1076
|
-
--file "$file" \
|
|
1077
|
-
--memory-key "refactor/$file" \
|
|
1078
|
-
--auto-format \
|
|
1079
|
-
--train-patterns
|
|
1080
|
-
done
|
|
1081
|
-
|
|
1082
|
-
# Agent 3: Testing (reads refactored code from memory)
|
|
1083
|
-
npx monomind hook pre-task \
|
|
1084
|
-
--description "Generate tests for refactored code" \
|
|
1085
|
-
--load-memory
|
|
1086
|
-
|
|
1087
|
-
# Broadcast completion
|
|
1088
|
-
npx monomind hook notify \
|
|
1089
|
-
--message "Refactoring complete - all tests passing" \
|
|
1090
|
-
--broadcast
|
|
437
|
+
npx monomind hooks pre-task --description "Debug memory leak in event handlers" --task-id leak
|
|
438
|
+
npx monomind hooks pre-edit --file "services/events.js" --operation update -c "remove listener leak"
|
|
439
|
+
# ... fix code ...
|
|
440
|
+
npx monomind hooks post-edit --file "services/events.js" --success true -o "listeners removed on dispose"
|
|
441
|
+
npx monomind hooks post-command --command "npm test" --success true
|
|
442
|
+
npx monomind hooks post-task --task-id leak --success true
|
|
1091
443
|
```
|
|
1092
444
|
|
|
1093
|
-
### Performance Tips
|
|
1094
|
-
|
|
1095
|
-
1. **Keep Hooks Lightweight** - Target < 100ms execution time
|
|
1096
|
-
2. **Use Async for Heavy Operations** - Don't block the main flow
|
|
1097
|
-
3. **Cache Aggressively** - Store frequently accessed data
|
|
1098
|
-
4. **Batch Related Operations** - Combine multiple actions
|
|
1099
|
-
5. **Use Memory Wisely** - Set appropriate TTLs
|
|
1100
|
-
6. **Monitor Hook Performance** - Track execution times
|
|
1101
|
-
7. **Parallelize When Possible** - Run independent hooks concurrently
|
|
1102
|
-
|
|
1103
445
|
### Debugging Hooks
|
|
1104
446
|
|
|
1105
|
-
Enable debug mode for troubleshooting:
|
|
1106
|
-
|
|
1107
447
|
```bash
|
|
1108
|
-
#
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
# Test specific hook with verbose output
|
|
1112
|
-
npx monomind hook pre-edit --file "test.js" --debug
|
|
448
|
+
# Verbose output
|
|
449
|
+
npx monomind hooks pre-edit --file "test.js" --verbose
|
|
1113
450
|
|
|
1114
|
-
#
|
|
1115
|
-
|
|
451
|
+
# Registered hooks and learning state
|
|
452
|
+
npx monomind hooks list
|
|
453
|
+
npx monomind hooks metrics
|
|
1116
454
|
|
|
1117
|
-
#
|
|
1118
|
-
npx monomind
|
|
455
|
+
# Overall health, including hook configuration
|
|
456
|
+
npx monomind doctor
|
|
1119
457
|
```
|
|
1120
458
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
- **Automatic Agent Assignment**: Right agent for every file type
|
|
1124
|
-
- **Consistent Code Formatting**: Language-specific formatters
|
|
1125
|
-
- **Continuous Learning**: Neural patterns improve over time
|
|
1126
|
-
- **Cross-Session Memory**: Context persists between sessions
|
|
1127
|
-
- **Performance Tracking**: Comprehensive metrics and analytics
|
|
1128
|
-
- **Automatic Coordination**: Agents sync via memory
|
|
1129
|
-
- **Smart Agent Spawning**: Task-based agent selection
|
|
1130
|
-
- **Quality Gates**: Pre-commit validation and verification
|
|
1131
|
-
- **Error Prevention**: Syntax validation before edits
|
|
1132
|
-
- **Knowledge Sharing**: Decisions stored and shared
|
|
1133
|
-
- **Reduced Manual Work**: Automation of repetitive tasks
|
|
1134
|
-
- **Better Collaboration**: Seamless multi-agent coordination
|
|
459
|
+
`MONOMIND_HOOK_QUIET=1` (set in `.claude/settings.json` `env`) silences hook output in Claude Code.
|
|
1135
460
|
|
|
1136
461
|
### Best Practices
|
|
1137
462
|
|
|
1138
|
-
1. **
|
|
1139
|
-
2. **
|
|
1140
|
-
3. **
|
|
1141
|
-
4. **
|
|
1142
|
-
5. **
|
|
1143
|
-
6. **
|
|
1144
|
-
7. **Document Custom Hooks** - Maintain hook documentation
|
|
1145
|
-
8. **Set Appropriate Timeouts** - Prevent hanging operations
|
|
1146
|
-
9. **Handle Errors Gracefully** - Use continueOnError when appropriate
|
|
1147
|
-
10. **Review Metrics Regularly** - Optimize based on usage patterns
|
|
463
|
+
1. **Initialize early** - run `monomind init hooks` when setting up a project
|
|
464
|
+
2. **Keep hooks lightweight** - prefer the helper over `npx` in hot paths; set `timeout`
|
|
465
|
+
3. **Record outcomes** - `post-edit`, `post-command`, and `post-task` feed routing
|
|
466
|
+
4. **Join routes to outcomes** - pass `--route-id` from `hooks route` to `hooks post-task`
|
|
467
|
+
5. **Use clear memory namespaces** - e.g. `coordination`, `swarm/<role>/<topic>`
|
|
468
|
+
6. **Review metrics** - `hooks metrics` and `hooks model-stats`
|
|
1148
469
|
|
|
1149
470
|
### Troubleshooting
|
|
1150
471
|
|
|
1151
472
|
#### Hooks Not Executing
|
|
1152
|
-
- Verify `.claude/settings.json` syntax
|
|
1153
|
-
- Check hook
|
|
1154
|
-
-
|
|
1155
|
-
-
|
|
1156
|
-
- Ensure monomind CLI is in PATH
|
|
473
|
+
- Verify `.claude/settings.json` syntax and matcher patterns
|
|
474
|
+
- Check that `.claude/helpers/hook-handler.cjs` exists (`monomind init hooks` / `monomind init upgrade`)
|
|
475
|
+
- Ensure `monomind` is resolvable via `npx`
|
|
476
|
+
- Run `npx monomind doctor`
|
|
1157
477
|
|
|
1158
478
|
#### Hook Timeouts
|
|
1159
|
-
- Increase timeout
|
|
1160
|
-
-
|
|
1161
|
-
- Optimize hook logic
|
|
1162
|
-
- Check network connectivity for MCP tools
|
|
1163
|
-
|
|
1164
|
-
#### Memory Issues
|
|
1165
|
-
- Set appropriate TTLs for memory keys
|
|
1166
|
-
- Clean up old memory entries
|
|
1167
|
-
- Use memory namespaces effectively
|
|
1168
|
-
- Monitor memory usage
|
|
1169
|
-
|
|
1170
|
-
#### Performance Problems
|
|
1171
|
-
- Profile hook execution times
|
|
1172
|
-
- Use caching for repeated operations
|
|
1173
|
-
- Batch operations when possible
|
|
1174
|
-
- Reduce hook complexity
|
|
479
|
+
- Increase `timeout` for the hook entry
|
|
480
|
+
- Use the helper instead of `npx` for frequent events
|
|
1175
481
|
|
|
1176
482
|
### Related Commands
|
|
1177
483
|
|
|
1178
|
-
- `npx monomind init
|
|
1179
|
-
- `npx monomind
|
|
1180
|
-
- `npx monomind
|
|
1181
|
-
- `npx monomind memory
|
|
1182
|
-
- `npx monomind
|
|
1183
|
-
- `npx monomind
|
|
484
|
+
- `npx monomind init hooks` - Initialize hooks configuration
|
|
485
|
+
- `npx monomind hooks list` - List registered hooks
|
|
486
|
+
- `npx monomind hooks <sub> --help` - Flags for a specific hook
|
|
487
|
+
- `npx monomind memory store|search|retrieve` - Shared memory
|
|
488
|
+
- `npx monomind session save|list|restore` - Session checkpoints
|
|
489
|
+
- `npx monomind agent spawn -t <type>` - Spawn agents
|
|
490
|
+
- `npx monomind monoswarm init` - Initialize a monoswarm
|
|
1184
491
|
|
|
1185
492
|
### Integration with Other Skills
|
|
1186
493
|
|
|
1187
|
-
|
|
1188
|
-
- **
|
|
1189
|
-
- **
|
|
1190
|
-
- **
|
|
1191
|
-
- **Performance Analysis** - Metrics collection in hooks
|
|
1192
|
-
- **Swarm Advanced** - Multi-agent coordination via hooks
|
|
494
|
+
- **Pair Programming** - record outcomes during pairing sessions
|
|
495
|
+
- **Verification Quality** - quality gates alongside hooks
|
|
496
|
+
- **GitHub Toolkit** - Git and PR workflows
|
|
497
|
+
- **Performance Analysis** - metrics collection
|