hivemind-context-governance 2.6.2 → 2.8.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.
- package/CHANGELOG.md +16 -0
- package/README.md +225 -208
- package/agents/build.md +198 -0
- package/agents/code-review.md +217 -0
- package/agents/debug.md +284 -0
- package/agents/explore.md +195 -0
- package/agents/hivefiver.md +107 -0
- package/agents/hivemind-brownfield-orchestrator.md +410 -12
- package/agents/hiveminder.md +487 -0
- package/agents/scanner.md +235 -0
- package/commands/hivefiver-architect.md +18 -0
- package/commands/hivefiver-audit.md +18 -0
- package/commands/hivefiver-build.md +18 -0
- package/commands/hivefiver-deploy.md +17 -0
- package/commands/hivefiver-doctor.md +40 -0
- package/commands/hivefiver-gsd-bridge.md +29 -0
- package/commands/hivefiver-init.md +18 -0
- package/commands/hivefiver-intake.md +49 -0
- package/commands/hivefiver-ralph-bridge.md +40 -0
- package/commands/hivefiver-research.md +56 -0
- package/commands/hivefiver-skillforge.md +41 -0
- package/commands/hivefiver-spec.md +18 -0
- package/commands/hivefiver-specforge.md +53 -0
- package/commands/hivefiver-start.md +54 -0
- package/commands/hivefiver-tutor.md +36 -0
- package/commands/hivefiver-validate.md +18 -0
- package/commands/hivefiver-workflow.md +17 -0
- package/commands/hivefiver.md +64 -0
- package/commands/hivemind-clarify.md +149 -0
- package/commands/hivemind-context.md +171 -0
- package/commands/hivemind-dashboard.md +39 -0
- package/commands/hivemind-debug-trigger.md +136 -0
- package/commands/hivemind-debug-verify.md +106 -0
- package/commands/hivemind-delegate.md +197 -0
- package/commands/hivemind-lint.md +92 -0
- package/commands/hivemind-pre-stop.md +183 -0
- package/commands/hiveminder-orchestrate.md +177 -0
- package/dist/cli/init.d.ts +3 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +347 -6
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/interactive-init.d.ts.map +1 -1
- package/dist/cli/interactive-init.js +57 -6
- package/dist/cli/interactive-init.js.map +1 -1
- package/dist/cli/scan.d.ts.map +1 -1
- package/dist/cli/scan.js +11 -5
- package/dist/cli/scan.js.map +1 -1
- package/dist/cli/sync-assets.d.ts.map +1 -1
- package/dist/cli/sync-assets.js +21 -1
- package/dist/cli/sync-assets.js.map +1 -1
- package/dist/cli.js +66 -14
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/App.d.ts +9 -0
- package/dist/dashboard/App.d.ts.map +1 -0
- package/dist/dashboard/App.js +155 -0
- package/dist/dashboard/App.js.map +1 -0
- package/dist/dashboard/bin.d.ts +17 -0
- package/dist/dashboard/bin.d.ts.map +1 -0
- package/dist/dashboard/bin.js +55 -0
- package/dist/dashboard/bin.js.map +1 -0
- package/dist/dashboard/components/AutonomicLog.d.ts +9 -0
- package/dist/dashboard/components/AutonomicLog.d.ts.map +1 -0
- package/dist/dashboard/components/AutonomicLog.js +29 -0
- package/dist/dashboard/components/AutonomicLog.js.map +1 -0
- package/dist/dashboard/components/InteractiveFooter.d.ts +7 -0
- package/dist/dashboard/components/InteractiveFooter.d.ts.map +1 -0
- package/dist/dashboard/components/InteractiveFooter.js +9 -0
- package/dist/dashboard/components/InteractiveFooter.js.map +1 -0
- package/dist/dashboard/components/MemCreationModal.d.ts +8 -0
- package/dist/dashboard/components/MemCreationModal.d.ts.map +1 -0
- package/dist/dashboard/components/MemCreationModal.js +13 -0
- package/dist/dashboard/components/MemCreationModal.js.map +1 -0
- package/dist/dashboard/components/SwarmMonitor.d.ts +7 -0
- package/dist/dashboard/components/SwarmMonitor.d.ts.map +1 -0
- package/dist/dashboard/components/SwarmMonitor.js +9 -0
- package/dist/dashboard/components/SwarmMonitor.js.map +1 -0
- package/dist/dashboard/components/TelemetryHeader.d.ts +11 -0
- package/dist/dashboard/components/TelemetryHeader.d.ts.map +1 -0
- package/dist/dashboard/components/TelemetryHeader.js +51 -0
- package/dist/dashboard/components/TelemetryHeader.js.map +1 -0
- package/dist/dashboard/components/TrajectoryPane.d.ts +10 -0
- package/dist/dashboard/components/TrajectoryPane.d.ts.map +1 -0
- package/dist/dashboard/components/TrajectoryPane.js +36 -0
- package/dist/dashboard/components/TrajectoryPane.js.map +1 -0
- package/dist/dashboard/design-tokens.d.ts +40 -0
- package/dist/dashboard/design-tokens.d.ts.map +1 -0
- package/dist/dashboard/design-tokens.js +43 -0
- package/dist/dashboard/design-tokens.js.map +1 -0
- package/dist/dashboard/i18n.d.ts +45 -0
- package/dist/dashboard/i18n.d.ts.map +1 -0
- package/dist/dashboard/i18n.js +83 -0
- package/dist/dashboard/i18n.js.map +1 -0
- package/dist/dashboard/loader.d.ts +3 -0
- package/dist/dashboard/loader.d.ts.map +1 -0
- package/dist/dashboard/loader.js +198 -0
- package/dist/dashboard/loader.js.map +1 -0
- package/dist/dashboard/server.d.ts +2 -76
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +6 -411
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/types.d.ts +48 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +2 -0
- package/dist/dashboard/types.js.map +1 -0
- package/dist/dashboard/views/SwarmOrchestratorView.d.ts +7 -0
- package/dist/dashboard/views/SwarmOrchestratorView.d.ts.map +1 -0
- package/dist/dashboard/views/SwarmOrchestratorView.js +11 -0
- package/dist/dashboard/views/SwarmOrchestratorView.js.map +1 -0
- package/dist/dashboard/views/TimeTravelDebuggerView.d.ts +7 -0
- package/dist/dashboard/views/TimeTravelDebuggerView.d.ts.map +1 -0
- package/dist/dashboard/views/TimeTravelDebuggerView.js +11 -0
- package/dist/dashboard/views/TimeTravelDebuggerView.js.map +1 -0
- package/dist/dashboard/views/ToolRegistryView.d.ts +7 -0
- package/dist/dashboard/views/ToolRegistryView.d.ts.map +1 -0
- package/dist/dashboard/views/ToolRegistryView.js +11 -0
- package/dist/dashboard/views/ToolRegistryView.js.map +1 -0
- package/dist/hooks/compaction.d.ts +1 -1
- package/dist/hooks/compaction.d.ts.map +1 -1
- package/dist/hooks/compaction.js +50 -9
- package/dist/hooks/compaction.js.map +1 -1
- package/dist/hooks/event-handler.d.ts +3 -3
- package/dist/hooks/event-handler.d.ts.map +1 -1
- package/dist/hooks/event-handler.js +188 -59
- package/dist/hooks/event-handler.js.map +1 -1
- package/dist/hooks/messages-transform.d.ts +11 -0
- package/dist/hooks/messages-transform.d.ts.map +1 -1
- package/dist/hooks/messages-transform.js +341 -97
- package/dist/hooks/messages-transform.js.map +1 -1
- package/dist/hooks/sdk-context.d.ts.map +1 -1
- package/dist/hooks/sdk-context.js +29 -2
- package/dist/hooks/sdk-context.js.map +1 -1
- package/dist/hooks/session-lifecycle.d.ts +1 -17
- package/dist/hooks/session-lifecycle.d.ts.map +1 -1
- package/dist/hooks/session-lifecycle.js +106 -418
- package/dist/hooks/session-lifecycle.js.map +1 -1
- package/dist/hooks/session_coherence/index.d.ts +7 -0
- package/dist/hooks/session_coherence/index.d.ts.map +1 -0
- package/dist/hooks/session_coherence/index.js +7 -0
- package/dist/hooks/session_coherence/index.js.map +1 -0
- package/dist/hooks/session_coherence/main_session_start.d.ts +45 -0
- package/dist/hooks/session_coherence/main_session_start.d.ts.map +1 -0
- package/dist/hooks/session_coherence/main_session_start.js +145 -0
- package/dist/hooks/session_coherence/main_session_start.js.map +1 -0
- package/dist/hooks/session_coherence/types.d.ts +96 -0
- package/dist/hooks/session_coherence/types.d.ts.map +1 -0
- package/dist/hooks/session_coherence/types.js +18 -0
- package/dist/hooks/session_coherence/types.js.map +1 -0
- package/dist/hooks/soft-governance.d.ts.map +1 -1
- package/dist/hooks/soft-governance.js +42 -124
- package/dist/hooks/soft-governance.js.map +1 -1
- package/dist/hooks/swarm-executor.d.ts +24 -0
- package/dist/hooks/swarm-executor.d.ts.map +1 -0
- package/dist/hooks/swarm-executor.js +83 -0
- package/dist/hooks/swarm-executor.js.map +1 -0
- package/dist/hooks/tool-gate.d.ts +24 -0
- package/dist/hooks/tool-gate.d.ts.map +1 -1
- package/dist/hooks/tool-gate.js +53 -4
- package/dist/hooks/tool-gate.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -14
- package/dist/index.js.map +1 -1
- package/dist/lib/anchors.d.ts +2 -0
- package/dist/lib/anchors.d.ts.map +1 -1
- package/dist/lib/anchors.js +9 -0
- package/dist/lib/anchors.js.map +1 -1
- package/dist/lib/auto-context.d.ts +159 -0
- package/dist/lib/auto-context.d.ts.map +1 -0
- package/dist/lib/auto-context.js +286 -0
- package/dist/lib/auto-context.js.map +1 -0
- package/dist/lib/brownfield-scan.d.ts +15 -0
- package/dist/lib/brownfield-scan.d.ts.map +1 -0
- package/dist/lib/brownfield-scan.js +323 -0
- package/dist/lib/brownfield-scan.js.map +1 -0
- package/dist/lib/budget.d.ts +35 -0
- package/dist/lib/budget.d.ts.map +1 -0
- package/dist/lib/budget.js +35 -0
- package/dist/lib/budget.js.map +1 -0
- package/dist/lib/cognitive-packer.d.ts +40 -0
- package/dist/lib/cognitive-packer.d.ts.map +1 -0
- package/dist/lib/cognitive-packer.js +399 -0
- package/dist/lib/cognitive-packer.js.map +1 -0
- package/dist/lib/compaction-engine.d.ts +61 -0
- package/dist/lib/compaction-engine.d.ts.map +1 -0
- package/dist/lib/compaction-engine.js +314 -0
- package/dist/lib/compaction-engine.js.map +1 -0
- package/dist/lib/event-bus.d.ts +55 -0
- package/dist/lib/event-bus.d.ts.map +1 -0
- package/dist/lib/event-bus.js +96 -0
- package/dist/lib/event-bus.js.map +1 -0
- package/dist/lib/file-lock.d.ts +36 -0
- package/dist/lib/file-lock.d.ts.map +1 -0
- package/dist/lib/file-lock.js +38 -0
- package/dist/lib/file-lock.js.map +1 -0
- package/dist/lib/gatekeeper.d.ts +49 -0
- package/dist/lib/gatekeeper.d.ts.map +1 -0
- package/dist/lib/gatekeeper.js +109 -0
- package/dist/lib/gatekeeper.js.map +1 -0
- package/dist/lib/governance-instruction.d.ts +16 -0
- package/dist/lib/governance-instruction.d.ts.map +1 -0
- package/dist/lib/governance-instruction.js +87 -0
- package/dist/lib/governance-instruction.js.map +1 -0
- package/dist/lib/graph-io.d.ts +110 -0
- package/dist/lib/graph-io.d.ts.map +1 -0
- package/dist/lib/graph-io.js +794 -0
- package/dist/lib/graph-io.js.map +1 -0
- package/dist/lib/graph-migrate.d.ts +162 -0
- package/dist/lib/graph-migrate.d.ts.map +1 -0
- package/dist/lib/graph-migrate.js +648 -0
- package/dist/lib/graph-migrate.js.map +1 -0
- package/dist/lib/hierarchy-tree.d.ts +15 -2
- package/dist/lib/hierarchy-tree.d.ts.map +1 -1
- package/dist/lib/hierarchy-tree.js +35 -10
- package/dist/lib/hierarchy-tree.js.map +1 -1
- package/dist/lib/hivefiver-integration.d.ts +54 -0
- package/dist/lib/hivefiver-integration.d.ts.map +1 -0
- package/dist/lib/hivefiver-integration.js +515 -0
- package/dist/lib/hivefiver-integration.js.map +1 -0
- package/dist/lib/index.d.ts +10 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +10 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/inspect-engine.d.ts +96 -0
- package/dist/lib/inspect-engine.d.ts.map +1 -0
- package/dist/lib/inspect-engine.js +153 -0
- package/dist/lib/inspect-engine.js.map +1 -0
- package/dist/lib/manifest.d.ts +2 -0
- package/dist/lib/manifest.d.ts.map +1 -1
- package/dist/lib/manifest.js +5 -0
- package/dist/lib/manifest.js.map +1 -1
- package/dist/lib/mems.d.ts +12 -1
- package/dist/lib/mems.d.ts.map +1 -1
- package/dist/lib/mems.js +46 -3
- package/dist/lib/mems.js.map +1 -1
- package/dist/lib/onboarding.d.ts +35 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/onboarding.js +99 -0
- package/dist/lib/onboarding.js.map +1 -0
- package/dist/lib/orphan-quarantine.d.ts +25 -0
- package/dist/lib/orphan-quarantine.d.ts.map +1 -0
- package/dist/lib/orphan-quarantine.js +47 -0
- package/dist/lib/orphan-quarantine.js.map +1 -0
- package/dist/lib/paths.d.ts +10 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/paths.js +12 -0
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/persistence.d.ts.map +1 -1
- package/dist/lib/persistence.js +4 -0
- package/dist/lib/persistence.js.map +1 -1
- package/dist/lib/planning-fs.d.ts +1 -0
- package/dist/lib/planning-fs.d.ts.map +1 -1
- package/dist/lib/planning-fs.js +18 -2
- package/dist/lib/planning-fs.js.map +1 -1
- package/dist/lib/session-boundary.d.ts +17 -5
- package/dist/lib/session-boundary.d.ts.map +1 -1
- package/dist/lib/session-boundary.js +37 -13
- package/dist/lib/session-boundary.js.map +1 -1
- package/dist/lib/session-engine.d.ts +28 -0
- package/dist/lib/session-engine.d.ts.map +1 -0
- package/dist/lib/session-engine.js +477 -0
- package/dist/lib/session-engine.js.map +1 -0
- package/dist/lib/session-governance.d.ts +19 -0
- package/dist/lib/session-governance.d.ts.map +1 -0
- package/dist/lib/session-governance.js +218 -0
- package/dist/lib/session-governance.js.map +1 -0
- package/dist/lib/session-split.d.ts +37 -0
- package/dist/lib/session-split.d.ts.map +1 -0
- package/dist/lib/session-split.js +158 -0
- package/dist/lib/session-split.js.map +1 -0
- package/dist/lib/session-swarm.d.ts +80 -0
- package/dist/lib/session-swarm.d.ts.map +1 -0
- package/dist/lib/session-swarm.js +258 -0
- package/dist/lib/session-swarm.js.map +1 -0
- package/dist/lib/session_coherence.d.ts +93 -0
- package/dist/lib/session_coherence.d.ts.map +1 -0
- package/dist/lib/session_coherence.js +512 -0
- package/dist/lib/session_coherence.js.map +1 -0
- package/dist/lib/staleness.d.ts +43 -0
- package/dist/lib/staleness.d.ts.map +1 -1
- package/dist/lib/staleness.js +85 -0
- package/dist/lib/staleness.js.map +1 -1
- package/dist/lib/state-mutation-queue.d.ts +132 -0
- package/dist/lib/state-mutation-queue.d.ts.map +1 -0
- package/dist/lib/state-mutation-queue.js +296 -0
- package/dist/lib/state-mutation-queue.js.map +1 -0
- package/dist/lib/tool-activation.js +12 -12
- package/dist/lib/tool-activation.js.map +1 -1
- package/dist/lib/tool-response.d.ts +20 -0
- package/dist/lib/tool-response.d.ts.map +1 -0
- package/dist/lib/tool-response.js +21 -0
- package/dist/lib/tool-response.js.map +1 -0
- package/dist/lib/watcher.d.ts +67 -0
- package/dist/lib/watcher.d.ts.map +1 -0
- package/dist/lib/watcher.js +160 -0
- package/dist/lib/watcher.js.map +1 -0
- package/dist/schemas/brain-state.d.ts +12 -0
- package/dist/schemas/brain-state.d.ts.map +1 -1
- package/dist/schemas/brain-state.js +22 -4
- package/dist/schemas/brain-state.js.map +1 -1
- package/dist/schemas/config.d.ts +72 -0
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/config.js +89 -1
- package/dist/schemas/config.js.map +1 -1
- package/dist/schemas/events.d.ts +35 -0
- package/dist/schemas/events.d.ts.map +1 -0
- package/dist/schemas/events.js +31 -0
- package/dist/schemas/events.js.map +1 -0
- package/dist/schemas/graph-nodes.d.ts +187 -0
- package/dist/schemas/graph-nodes.d.ts.map +1 -0
- package/dist/schemas/graph-nodes.js +171 -0
- package/dist/schemas/graph-nodes.js.map +1 -0
- package/dist/schemas/graph-state.d.ts +82 -0
- package/dist/schemas/graph-state.d.ts.map +1 -0
- package/dist/schemas/graph-state.js +19 -0
- package/dist/schemas/graph-state.js.map +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/manifest.d.ts +38 -0
- package/dist/schemas/manifest.d.ts.map +1 -1
- package/dist/tools/hivemind-anchor.d.ts.map +1 -1
- package/dist/tools/hivemind-anchor.js +40 -110
- package/dist/tools/hivemind-anchor.js.map +1 -1
- package/dist/tools/hivemind-cycle.d.ts.map +1 -1
- package/dist/tools/hivemind-cycle.js +44 -87
- package/dist/tools/hivemind-cycle.js.map +1 -1
- package/dist/tools/hivemind-hierarchy.d.ts.map +1 -1
- package/dist/tools/hivemind-hierarchy.js +47 -109
- package/dist/tools/hivemind-hierarchy.js.map +1 -1
- package/dist/tools/hivemind-inspect.d.ts +1 -1
- package/dist/tools/hivemind-inspect.d.ts.map +1 -1
- package/dist/tools/hivemind-inspect.js +19 -361
- package/dist/tools/hivemind-inspect.js.map +1 -1
- package/dist/tools/hivemind-memory.d.ts.map +1 -1
- package/dist/tools/hivemind-memory.js +215 -139
- package/dist/tools/hivemind-memory.js.map +1 -1
- package/dist/tools/hivemind-session.d.ts +0 -12
- package/dist/tools/hivemind-session.d.ts.map +1 -1
- package/dist/tools/hivemind-session.js +211 -492
- package/dist/tools/hivemind-session.js.map +1 -1
- package/dist/tools/index.d.ts +15 -22
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +15 -22
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/map-context.d.ts.map +1 -1
- package/dist/tools/map-context.js +10 -2
- package/dist/tools/map-context.js.map +1 -1
- package/package.json +6 -6
- package/skills/context-first-gatekeeping/SKILL.md +261 -0
- package/skills/debug-orchestration/SKILL.md +304 -0
- package/skills/delegation-intelligence/SKILL.md +104 -10
- package/skills/hivefiver-bilingual-tutor/SKILL.md +35 -0
- package/skills/hivefiver-bilingual-tutor/references/terminology-en-vi.md +13 -0
- package/skills/hivefiver-bilingual-tutor/scripts/select-language.sh +12 -0
- package/skills/hivefiver-bilingual-tutor/templates/bilingual-output.md +13 -0
- package/skills/hivefiver-domain-pack-router/SKILL.md +36 -0
- package/skills/hivefiver-domain-pack-router/references/domain-pack-matrix.md +14 -0
- package/skills/hivefiver-domain-pack-router/templates/domain-pack-output.md +24 -0
- package/skills/hivefiver-gsd-compat/SKILL.md +28 -0
- package/skills/hivefiver-gsd-compat/references/gsd-lifecycle-map.md +11 -0
- package/skills/hivefiver-gsd-compat/scripts/generate-map-template.sh +23 -0
- package/skills/hivefiver-gsd-compat/templates/gsd-bridge-output.md +18 -0
- package/skills/hivefiver-mcp-research-loop/SKILL.md +52 -0
- package/skills/hivefiver-mcp-research-loop/references/provider-matrix.md +21 -0
- package/skills/hivefiver-mcp-research-loop/scripts/check-mcp-readiness.mjs +65 -0
- package/skills/hivefiver-mcp-research-loop/scripts/score-confidence.sh +20 -0
- package/skills/hivefiver-mcp-research-loop/templates/evidence-table.md +20 -0
- package/skills/hivefiver-persona-routing/SKILL.md +43 -0
- package/skills/hivefiver-persona-routing/references/persona-matrix.md +19 -0
- package/skills/hivefiver-persona-routing/scripts/score-persona.sh +48 -0
- package/skills/hivefiver-persona-routing/templates/intake-questionnaire.md +10 -0
- package/skills/hivefiver-ralph-tasking/SKILL.md +42 -0
- package/skills/hivefiver-ralph-tasking/references/prd-json-rules.md +32 -0
- package/skills/hivefiver-ralph-tasking/scripts/todo-to-prd-json.mjs +77 -0
- package/skills/hivefiver-ralph-tasking/scripts/validate-prd-json.mjs +125 -0
- package/skills/hivefiver-ralph-tasking/templates/prd-json-flat.md +24 -0
- package/skills/hivefiver-skill-auditor/SKILL.md +37 -0
- package/skills/hivefiver-skill-auditor/references/audit-checklist.md +23 -0
- package/skills/hivefiver-skill-auditor/references/skill-source-links.md +16 -0
- package/skills/hivefiver-skill-auditor/scripts/audit-skill-coverage.sh +82 -0
- package/skills/hivefiver-skill-auditor/templates/skill-audit-report.md +35 -0
- package/skills/hivefiver-spec-distillation/SKILL.md +37 -0
- package/skills/hivefiver-spec-distillation/references/ambiguity-taxonomy.md +21 -0
- package/skills/hivefiver-spec-distillation/scripts/extract-requirements.sh +48 -0
- package/skills/hivefiver-spec-distillation/templates/spec-candidate.md +23 -0
- package/skills/hivemind-architect-strategist/SKILL.md +317 -0
- package/skills/hivemind-governance/SKILL.md +63 -0
- package/skills/parallel-debugging-hivemind/SKILL.md +203 -0
- package/skills/sequential-orchestration/SKILL.md +284 -0
- package/skills/systematic-debugging-hivemind/SKILL.md +222 -0
- package/workflows/hivefiver-enterprise-architect.yaml +51 -0
- package/workflows/hivefiver-enterprise.yaml +56 -0
- package/workflows/hivefiver-floppy-engineer.yaml +41 -0
- package/workflows/hivefiver-mcp-fallback.yaml +31 -0
- package/workflows/hivefiver-vibecoder.yaml +46 -0
- package/workflows/sequential-delegation-workflow.yaml +218 -0
- package/docs/10-commandments.md +0 -202
- package/prompts/hivemind-brownfield-remediation.md +0 -14
- package/references/hivemind-brownfield-checklist.md +0 -17
- package/templates/hivemind-brownfield-session.md +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -33,6 +33,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
33
|
- `README.md` fully rewritten: coherent install-to-runtime flow, upgrade guidance, troubleshooting, and expanded Vietnamese section focused on practical onboarding
|
|
34
34
|
- `README.md` refreshed for Phase B: hook count/tool catalog accuracy, merged tool names, and new governance capabilities
|
|
35
35
|
|
|
36
|
+
## [2.8.0] - 2026-02-19
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
- Vietnamese-first launch framing in `README.md` with 10 demo-ready use cases for product launch narratives
|
|
40
|
+
- Public branch hardening policy in `scripts/guard-public-branch.sh` for internal/dev-only paths
|
|
41
|
+
- HiveFiver auto-realignment next-step policy (menu options + permission-gated execution for mutating actions)
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
- Release package boundary tightened for npm/npx distribution:
|
|
45
|
+
- hidden from public package payload: `docs`, `templates`, `prompts`, `references`
|
|
46
|
+
- retained public operational pack: `commands`, `skills`, `agents`, `workflows`
|
|
47
|
+
- Version bump to `2.8.0`
|
|
48
|
+
|
|
49
|
+
### Verified
|
|
50
|
+
- Full typecheck, test suite, and clean rebuild validated for release readiness
|
|
51
|
+
|
|
36
52
|
## [2.6.0] - 2026-02-12
|
|
37
53
|
|
|
38
54
|
### Added
|
package/README.md
CHANGED
|
@@ -2,7 +2,226 @@
|
|
|
2
2
|
|
|
3
3
|
> **The operating system for AI coding sessions.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 🇻🇳 Bản phát hành v2.8 ưu tiên thị trường Việt Nam
|
|
6
|
+
|
|
7
|
+
HiveMind là plugin [OpenCode](https://opencode.ai) giúp AI agent không bị trôi ngữ cảnh, không quên quyết định kiến trúc, và không mất trạng thái khi session kéo dài. Trọng tâm v2.8: onboarding rõ ràng, governance chặt, và triển khai thực chiến cho team Việt Nam trước.
|
|
8
|
+
|
|
9
|
+
### 10 kịch bản demo ấn tượng để ra mắt
|
|
10
|
+
1. `SaaS 0→1 cho người không biết code`: menu hỏi đáp + auto-lane để ra PRD có thể triển khai.
|
|
11
|
+
2. `Giải cứu prompt hỗn loạn của team enterprise`: bóc tách yêu cầu, ambiguity map, risk register.
|
|
12
|
+
3. `War-room production incident`: ép agent đi theo checklist bằng chứng trước khi kết luận fix.
|
|
13
|
+
4. `TDD autopilot`: agent chuyển tự động từ `spec -> build -> validate` với gate kiểm thử.
|
|
14
|
+
5. `MCP-first research sprint`: phối hợp Context7/DeepWiki/Tavily/Exa/Repomix và chấm điểm confidence.
|
|
15
|
+
6. `Brownfield modernization`: quét codebase cũ, lập workflow refactor theo từng lane và checkpoint.
|
|
16
|
+
7. `Cross-domain planning`: cùng một khung cho dev + marketing + finance + office-ops.
|
|
17
|
+
8. `Subagent swarm governance`: giao việc song song nhưng vẫn giữ được trace, export, và hồi cứu.
|
|
18
|
+
9. `Bilingual coaching mode`: đầu ra EN/VI cùng cấu trúc, hỗ trợ onboarding team đa vai trò.
|
|
19
|
+
10. `No-command recovery`: người dùng nói tự nhiên, hệ thống tự realign sang lệnh phù hợp và xin quyền bước tiếp theo.
|
|
20
|
+
|
|
21
|
+
# 🇻🇳 Hướng Dẫn Tiếng Việt (Chi Tiết)
|
|
22
|
+
|
|
23
|
+
> *Phần này không phải bản dịch — mà được viết riêng cho người dùng Việt Nam, với giải thích kỹ hơn về cách hoạt động và lý do tại sao.*
|
|
24
|
+
|
|
25
|
+
**Cảm thấy hữu ích?** [](https://buymeacoffee.com/shynlee04l)
|
|
26
|
+
|
|
27
|
+
## HiveMind Là Gì?
|
|
28
|
+
|
|
29
|
+
Hãy tưởng tượng bạn thuê một lập trình viên AI rất giỏi, nhưng anh ta có một vấn đề: **mỗi 30 phút anh ta quên hết mọi thứ đang làm**.
|
|
30
|
+
|
|
31
|
+
Đó chính xác là điều xảy ra với các AI coding agent hiện tại:
|
|
32
|
+
- Đang làm feature A, tự nhiên nhảy sang feature B mà không checkpoint
|
|
33
|
+
- Sau context compaction (khi hết bộ nhớ), quên hết lý do tại sao đã quyết định kiến trúc X
|
|
34
|
+
- Giao việc cho subagent, nhận kết quả nhưng không tổng hợp lại
|
|
35
|
+
- Session mới bắt đầu từ con số 0 — không biết gì về session trước
|
|
36
|
+
|
|
37
|
+
**HiveMind giải quyết tất cả** bằng một hệ thống quản trị context đơn giản nhưng hiệu quả.
|
|
38
|
+
|
|
39
|
+
## Cách Hoạt Động (Giải Thích Dễ Hiểu)
|
|
40
|
+
|
|
41
|
+
Mỗi session làm việc với AI đều tuân theo một quy trình:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
declare_intent → map_context → [làm việc] → compact_session
|
|
45
|
+
(khai báo) (cập nhật) (code) (lưu trữ)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Bước 1: Khai Báo Ý Định — `declare_intent`
|
|
49
|
+
|
|
50
|
+
Trước khi bắt đầu bất kỳ công việc nào, agent phải nói rõ:
|
|
51
|
+
- **Đang làm gì**: "Xây dựng hệ thống xác thực"
|
|
52
|
+
- **Làm theo cách nào**: `plan_driven` (có kế hoạch), `quick_fix` (sửa nhanh), hoặc `exploration` (tìm hiểu)
|
|
53
|
+
|
|
54
|
+
Nếu không khai báo, ở chế độ `strict` agent sẽ bị khóa — không thể ghi file cho đến khi khai báo. Điều này đảm bảo mọi công việc đều có mục tiêu rõ ràng.
|
|
55
|
+
|
|
56
|
+
### Bước 2: Cập Nhật Ngữ Cảnh — `map_context`
|
|
57
|
+
|
|
58
|
+
Khi agent chuyển focus (ví dụ: từ "thiết kế database" sang "viết API"), nó phải gọi `map_context` để HiveMind biết. Hệ thống theo dõi 3 cấp:
|
|
59
|
+
|
|
60
|
+
| Cấp | Ý Nghĩa | Ví Dụ |
|
|
61
|
+
|-----|---------|-------|
|
|
62
|
+
| **Trajectory** | Mục tiêu lớn | "Xây dựng hệ thống thanh toán" |
|
|
63
|
+
| **Tactic** | Chiến thuật cụ thể | "Tích hợp Stripe API" |
|
|
64
|
+
| **Action** | Hành động đang làm | "Viết test cho webhook handler" |
|
|
65
|
+
|
|
66
|
+
Nếu agent làm nhiều turn mà không cập nhật, HiveMind phát hiện **drift** (trôi dạt) và cảnh báo ngay.
|
|
67
|
+
|
|
68
|
+
### Bước 3: Lưu Trữ — `compact_session`
|
|
69
|
+
|
|
70
|
+
Khi xong việc, `compact_session` sẽ:
|
|
71
|
+
1. Lưu toàn bộ session vào archive (có thể đọc lại)
|
|
72
|
+
2. Ghi tóm tắt vào lịch sử dự án
|
|
73
|
+
3. Reset để sẵn sàng cho session tiếp theo
|
|
74
|
+
|
|
75
|
+
**Quan trọng**: Mems Brain (bộ nhớ dài hạn) vẫn tồn tại sau compact. Những gì agent đã học được (`save_mem`) sẽ không bao giờ mất.
|
|
76
|
+
|
|
77
|
+
## Cài Đặt Từ Đầu Đến Cuối
|
|
78
|
+
|
|
79
|
+
### Một Lệnh - Xong Ngay
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx hivemind-context-governance init
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Điều gì sẽ xảy ra (đảm bảo):**
|
|
86
|
+
1. Tự động tải từ npm (không cần cài thủ công)
|
|
87
|
+
2. Tạo thư mục `.hivemind/` với brain.json, config.json
|
|
88
|
+
3. Đăng ký plugin trong `opencode.json` (để OpenCode tự động load)
|
|
89
|
+
4. Đồng bộ commands/skills vào `.opencode/`
|
|
90
|
+
5. Tạo các file session template
|
|
91
|
+
6. Mở session ở chế độ `OPEN` (assisted) hoặc `LOCKED` (strict)
|
|
92
|
+
|
|
93
|
+
**Hoạt động trên mọi máy, mọi project. Không ngoại lệ.**
|
|
94
|
+
|
|
95
|
+
### Xác Nhận Cài Đặt (Tùy Chọn)
|
|
96
|
+
|
|
97
|
+
Wizard sẽ hướng dẫn bạn từng bước:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
◆ Welcome to HiveMind Context Governance!
|
|
101
|
+
|
|
102
|
+
◆ Select governance mode:
|
|
103
|
+
│ ○ strict — Session starts LOCKED. Must declare intent before writes.
|
|
104
|
+
│ ● assisted — Session starts OPEN. Guidance without blocking. (recommended)
|
|
105
|
+
│ ○ permissive — Always OPEN. Silent tracking only.
|
|
106
|
+
|
|
107
|
+
◆ Select language:
|
|
108
|
+
│ ○ English
|
|
109
|
+
│ ● Tiếng Việt
|
|
110
|
+
|
|
111
|
+
◆ Select automation level:
|
|
112
|
+
│ ○ manual — No automation, you control everything
|
|
113
|
+
│ ○ guided — Suggestions only
|
|
114
|
+
│ ● assisted — Balanced automation (recommended)
|
|
115
|
+
│ ○ full — Maximum automation
|
|
116
|
+
│ ○ coach — Maximum handholding, skeptical of everything
|
|
117
|
+
|
|
118
|
+
◆ Configuration saved! .hivemind/ created.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Cài Đặt Không Tương Tác
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx hivemind-context-governance init --mode strict --lang vi --automation full
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Lệnh này làm **đúng như** wizard tương tác:
|
|
128
|
+
- Tạo cấu trúc `.hivemind/`
|
|
129
|
+
- Đăng ký plugin trong `opencode.json`
|
|
130
|
+
- Đồng bộ OpenCode assets
|
|
131
|
+
- Khởi tạo brain state với cài đặt đã chọn
|
|
132
|
+
|
|
133
|
+
### Mở OpenCode
|
|
134
|
+
|
|
135
|
+
Xong. Plugin tự động hoạt động. AI agent sẽ nhận governance context được inject vào mỗi turn.
|
|
136
|
+
|
|
137
|
+
### Xác Nhận Cài Đặt (Tùy Chọn)
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npx hivemind-context-governance status
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Hoặc kiểm tra thủ công `opencode.json` có chứa:
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"plugin": ["hivemind-context-governance"]
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Sử Dụng Slash Command
|
|
151
|
+
|
|
152
|
+
Gõ `/hivemind-scan` trong OpenCode để quét dự án và tạo bản đồ cơ sở trước khi bắt đầu code.
|
|
153
|
+
|
|
154
|
+
Hoặc dùng CLI trực tiếp:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx hivemind-context-governance scan --action analyze --json
|
|
158
|
+
npx hivemind-context-governance scan --action recommend
|
|
159
|
+
npx hivemind-context-governance scan --action orchestrate --json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Runbook Brownfield (Tiếng Việt)
|
|
163
|
+
|
|
164
|
+
Khi người dùng nói: *\"Hãy quét dự án và refactor\"*, chạy theo thứ tự:
|
|
165
|
+
|
|
166
|
+
1. `scan_hierarchy({ action: "analyze", json: true })`
|
|
167
|
+
2. `scan_hierarchy({ action: "recommend" })`
|
|
168
|
+
3. `scan_hierarchy({ action: "orchestrate", json: true })`
|
|
169
|
+
4. `declare_intent(...)` + `map_context(...)` để khóa focus trước khi sửa code
|
|
170
|
+
|
|
171
|
+
Mục tiêu:
|
|
172
|
+
- Phát hiện framework (`gsd/spec-kit/both/none`) và tín hiệu BMAD
|
|
173
|
+
- Cô lập artifact cũ/stale có nguy cơ nhiễm context
|
|
174
|
+
- Lưu baseline anchors + memory trước khi refactor diện rộng
|
|
175
|
+
|
|
176
|
+
## 10 Công Cụ — Giải Thích Chi Tiết
|
|
177
|
+
|
|
178
|
+
### Nhóm 1: Vòng Đời Session
|
|
179
|
+
|
|
180
|
+
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
181
|
+
|---------|-------------|---------------------|
|
|
182
|
+
| `declare_intent` | Bắt đầu làm việc | Không có ý định rõ ràng = không có cơ sở để đánh giá drift |
|
|
183
|
+
| `map_context` | Đổi hướng/focus | Mỗi lần đổi mà không cập nhật = context bị ô nhiễm |
|
|
184
|
+
| `compact_session` | Xong việc | Không compact = mất toàn bộ intelligence tích lũy |
|
|
185
|
+
|
|
186
|
+
### Nhóm 2: Nhận Thức & Sửa Lỗi
|
|
187
|
+
|
|
188
|
+
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
189
|
+
|---------|-------------|---------------------|
|
|
190
|
+
| `scan_hierarchy` | Muốn xem nhanh trạng thái | Nắm bắt tình hình trong 1 giây |
|
|
191
|
+
| `think_back` | Cảm thấy lạc | Hồi phục context sâu sau compaction |
|
|
192
|
+
| `scan_hierarchy` (`include_drift`) | Trước khi kết luận xong | Kiểm tra độ lệch hướng theo trajectory/tactic/action |
|
|
193
|
+
|
|
194
|
+
### Nhóm 3: Bộ Nhớ Dài Hạn
|
|
195
|
+
|
|
196
|
+
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
197
|
+
|---------|-------------|---------------------|
|
|
198
|
+
| `save_mem` | Học được bài học quan trọng | Quyết định, pattern, lỗi — tồn tại vĩnh viễn |
|
|
199
|
+
| `recall_mems` | Gặp vấn đề quen thuộc | Tìm giải pháp từ quá khứ |
|
|
200
|
+
| `save_anchor` | Sự thật bất biến | Port number, schema, API endpoint — không bao giờ quên |
|
|
201
|
+
|
|
202
|
+
### Nhóm 4: Quản Lý Cây & Subagent
|
|
203
|
+
|
|
204
|
+
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
205
|
+
|---------|-------------|---------------------|
|
|
206
|
+
| `hierarchy_manage` | Cây nhiều nhánh hoặc cần nâng cấp | Gộp cả prune và migrate trong một công cụ |
|
|
207
|
+
| `export_cycle` | Subagent vừa trả kết quả | Không export = mất intelligence từ subagent |
|
|
208
|
+
|
|
209
|
+
## Lần Đầu Mở OpenCode (Quan Trọng!)
|
|
210
|
+
|
|
211
|
+
Khi HiveMind được load nhưng chưa cấu hình:
|
|
212
|
+
|
|
213
|
+
1. **Không tự động tạo session mặc định** — tránh tình trạng config không đúng ý người dùng
|
|
214
|
+
2. **Quét project tự động** — phát hiện tên project, tech stack (20+ framework), cấu trúc thư mục, tài liệu
|
|
215
|
+
3. **Hướng dẫn recon protocol** — agent được yêu cầu:
|
|
216
|
+
- Quét cấu trúc repo
|
|
217
|
+
- Đọc tài liệu cốt lõi (README, AGENTS.md, package.json)
|
|
218
|
+
- Phát hiện context bị "nhiễm" (plan cũ, artifact trùng lặp, framework xung đột)
|
|
219
|
+
- Xây dựng backbone dự án trước khi code
|
|
220
|
+
|
|
221
|
+
**Mục tiêu**: Tránh tình trạng "vừa vào đã sửa code" khi chưa hiểu project.
|
|
222
|
+
### English Snapshot
|
|
223
|
+
|
|
224
|
+
HiveMind is an [OpenCode](https://opencode.ai) plugin that prevents AI agents from drifting, forgetting, and losing coherence during long coding sessions. It enforces one backbone: *declare what you're doing, track as you go, archive when done*.
|
|
6
225
|
|
|
7
226
|
```
|
|
8
227
|
10 tools · 6 hooks · 5 skills · 3 slash commands · interactive CLI · Ink TUI dashboard · EN/VI
|
|
@@ -34,7 +253,7 @@ Without governance, long AI sessions decay:
|
|
|
34
253
|
### One Command - That's It
|
|
35
254
|
|
|
36
255
|
```bash
|
|
37
|
-
npx hivemind-context-governance init
|
|
256
|
+
npx hivemind-context-governance init
|
|
38
257
|
```
|
|
39
258
|
|
|
40
259
|
**What happens (guaranteed):**
|
|
@@ -327,14 +546,13 @@ npx hivemind-context-governance sync-assets --overwrite
|
|
|
327
546
|
|
|
328
547
|
`init` also performs asset sync automatically. Re-running `init` on an existing project refreshes missing assets without resetting `.hivemind` state.
|
|
329
548
|
|
|
330
|
-
|
|
549
|
+
Public v2.8 package intentionally ships only the operational pack:
|
|
550
|
+
- `commands`
|
|
551
|
+
- `skills`
|
|
331
552
|
- `agents`
|
|
332
553
|
- `workflows`
|
|
333
|
-
- `templates`
|
|
334
|
-
- `prompts`
|
|
335
|
-
- `references`
|
|
336
554
|
|
|
337
|
-
|
|
555
|
+
Internal playbooks (`docs`, `templates`, `tasks`, and local dot-folders) are kept out of public release flow.
|
|
338
556
|
|
|
339
557
|
### Existing User Upgrade (No Re-init Required)
|
|
340
558
|
|
|
@@ -511,207 +729,6 @@ MIT
|
|
|
511
729
|
|
|
512
730
|
---
|
|
513
731
|
|
|
514
|
-
# 🇻🇳 Hướng Dẫn Tiếng Việt (Chi Tiết)
|
|
515
|
-
|
|
516
|
-
> *Phần này không phải bản dịch — mà được viết riêng cho người dùng Việt Nam, với giải thích kỹ hơn về cách hoạt động và lý do tại sao.*
|
|
517
|
-
|
|
518
|
-
**Cảm thấy hữu ích?** [](https://buymeacoffee.com/shynlee04l)
|
|
519
|
-
|
|
520
|
-
## HiveMind Là Gì?
|
|
521
|
-
|
|
522
|
-
Hãy tưởng tượng bạn thuê một lập trình viên AI rất giỏi, nhưng anh ta có một vấn đề: **mỗi 30 phút anh ta quên hết mọi thứ đang làm**.
|
|
523
|
-
|
|
524
|
-
Đó chính xác là điều xảy ra với các AI coding agent hiện tại:
|
|
525
|
-
- Đang làm feature A, tự nhiên nhảy sang feature B mà không checkpoint
|
|
526
|
-
- Sau context compaction (khi hết bộ nhớ), quên hết lý do tại sao đã quyết định kiến trúc X
|
|
527
|
-
- Giao việc cho subagent, nhận kết quả nhưng không tổng hợp lại
|
|
528
|
-
- Session mới bắt đầu từ con số 0 — không biết gì về session trước
|
|
529
|
-
|
|
530
|
-
**HiveMind giải quyết tất cả** bằng một hệ thống quản trị context đơn giản nhưng hiệu quả.
|
|
531
|
-
|
|
532
|
-
## Cách Hoạt Động (Giải Thích Dễ Hiểu)
|
|
533
|
-
|
|
534
|
-
Mỗi session làm việc với AI đều tuân theo một quy trình:
|
|
535
|
-
|
|
536
|
-
```
|
|
537
|
-
declare_intent → map_context → [làm việc] → compact_session
|
|
538
|
-
(khai báo) (cập nhật) (code) (lưu trữ)
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
### Bước 1: Khai Báo Ý Định — `declare_intent`
|
|
542
|
-
|
|
543
|
-
Trước khi bắt đầu bất kỳ công việc nào, agent phải nói rõ:
|
|
544
|
-
- **Đang làm gì**: "Xây dựng hệ thống xác thực"
|
|
545
|
-
- **Làm theo cách nào**: `plan_driven` (có kế hoạch), `quick_fix` (sửa nhanh), hoặc `exploration` (tìm hiểu)
|
|
546
|
-
|
|
547
|
-
Nếu không khai báo, ở chế độ `strict` agent sẽ bị khóa — không thể ghi file cho đến khi khai báo. Điều này đảm bảo mọi công việc đều có mục tiêu rõ ràng.
|
|
548
|
-
|
|
549
|
-
### Bước 2: Cập Nhật Ngữ Cảnh — `map_context`
|
|
550
|
-
|
|
551
|
-
Khi agent chuyển focus (ví dụ: từ "thiết kế database" sang "viết API"), nó phải gọi `map_context` để HiveMind biết. Hệ thống theo dõi 3 cấp:
|
|
552
|
-
|
|
553
|
-
| Cấp | Ý Nghĩa | Ví Dụ |
|
|
554
|
-
|-----|---------|-------|
|
|
555
|
-
| **Trajectory** | Mục tiêu lớn | "Xây dựng hệ thống thanh toán" |
|
|
556
|
-
| **Tactic** | Chiến thuật cụ thể | "Tích hợp Stripe API" |
|
|
557
|
-
| **Action** | Hành động đang làm | "Viết test cho webhook handler" |
|
|
558
|
-
|
|
559
|
-
Nếu agent làm nhiều turn mà không cập nhật, HiveMind phát hiện **drift** (trôi dạt) và cảnh báo ngay.
|
|
560
|
-
|
|
561
|
-
### Bước 3: Lưu Trữ — `compact_session`
|
|
562
|
-
|
|
563
|
-
Khi xong việc, `compact_session` sẽ:
|
|
564
|
-
1. Lưu toàn bộ session vào archive (có thể đọc lại)
|
|
565
|
-
2. Ghi tóm tắt vào lịch sử dự án
|
|
566
|
-
3. Reset để sẵn sàng cho session tiếp theo
|
|
567
|
-
|
|
568
|
-
**Quan trọng**: Mems Brain (bộ nhớ dài hạn) vẫn tồn tại sau compact. Những gì agent đã học được (`save_mem`) sẽ không bao giờ mất.
|
|
569
|
-
|
|
570
|
-
## Cài Đặt Từ Đầu Đến Cuối
|
|
571
|
-
|
|
572
|
-
### Một Lệnh - Xong Ngay
|
|
573
|
-
|
|
574
|
-
```bash
|
|
575
|
-
npx hivemind-context-governance init --mode assisted
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
**Điều gì sẽ xảy ra (đảm bảo):**
|
|
579
|
-
1. Tự động tải từ npm (không cần cài thủ công)
|
|
580
|
-
2. Tạo thư mục `.hivemind/` với brain.json, config.json
|
|
581
|
-
3. Đăng ký plugin trong `opencode.json` (để OpenCode tự động load)
|
|
582
|
-
4. Đồng bộ commands/skills vào `.opencode/`
|
|
583
|
-
5. Tạo các file session template
|
|
584
|
-
6. Mở session ở chế độ `OPEN` (assisted) hoặc `LOCKED` (strict)
|
|
585
|
-
|
|
586
|
-
**Hoạt động trên mọi máy, mọi project. Không ngoại lệ.**
|
|
587
|
-
|
|
588
|
-
### Xác Nhận Cài Đặt (Tùy Chọn)
|
|
589
|
-
|
|
590
|
-
Wizard sẽ hướng dẫn bạn từng bước:
|
|
591
|
-
|
|
592
|
-
```
|
|
593
|
-
◆ Welcome to HiveMind Context Governance!
|
|
594
|
-
|
|
595
|
-
◆ Select governance mode:
|
|
596
|
-
│ ○ strict — Session starts LOCKED. Must declare intent before writes.
|
|
597
|
-
│ ● assisted — Session starts OPEN. Guidance without blocking. (recommended)
|
|
598
|
-
│ ○ permissive — Always OPEN. Silent tracking only.
|
|
599
|
-
|
|
600
|
-
◆ Select language:
|
|
601
|
-
│ ○ English
|
|
602
|
-
│ ● Tiếng Việt
|
|
603
|
-
|
|
604
|
-
◆ Select automation level:
|
|
605
|
-
│ ○ manual — No automation, you control everything
|
|
606
|
-
│ ○ guided — Suggestions only
|
|
607
|
-
│ ● assisted — Balanced automation (recommended)
|
|
608
|
-
│ ○ full — Maximum automation
|
|
609
|
-
│ ○ coach — Maximum handholding, skeptical of everything
|
|
610
|
-
|
|
611
|
-
◆ Configuration saved! .hivemind/ created.
|
|
612
|
-
```
|
|
613
|
-
|
|
614
|
-
### Cài Đặt Không Tương Tác
|
|
615
|
-
|
|
616
|
-
```bash
|
|
617
|
-
npx hivemind-context-governance init --mode strict --lang vi --automation full
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
Lệnh này làm **đúng như** wizard tương tác:
|
|
621
|
-
- Tạo cấu trúc `.hivemind/`
|
|
622
|
-
- Đăng ký plugin trong `opencode.json`
|
|
623
|
-
- Đồng bộ OpenCode assets
|
|
624
|
-
- Khởi tạo brain state với cài đặt đã chọn
|
|
625
|
-
|
|
626
|
-
### Mở OpenCode
|
|
627
|
-
|
|
628
|
-
Xong. Plugin tự động hoạt động. AI agent sẽ nhận governance context được inject vào mỗi turn.
|
|
629
|
-
|
|
630
|
-
### Xác Nhận Cài Đặt (Tùy Chọn)
|
|
631
|
-
|
|
632
|
-
```bash
|
|
633
|
-
npx hivemind-context-governance status
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
Hoặc kiểm tra thủ công `opencode.json` có chứa:
|
|
637
|
-
```json
|
|
638
|
-
{
|
|
639
|
-
"plugin": ["hivemind-context-governance"]
|
|
640
|
-
}
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
### Sử Dụng Slash Command
|
|
644
|
-
|
|
645
|
-
Gõ `/hivemind-scan` trong OpenCode để quét dự án và tạo bản đồ cơ sở trước khi bắt đầu code.
|
|
646
|
-
|
|
647
|
-
Hoặc dùng CLI trực tiếp:
|
|
648
|
-
|
|
649
|
-
```bash
|
|
650
|
-
npx hivemind-context-governance scan --action analyze --json
|
|
651
|
-
npx hivemind-context-governance scan --action recommend
|
|
652
|
-
npx hivemind-context-governance scan --action orchestrate --json
|
|
653
|
-
```
|
|
654
|
-
|
|
655
|
-
## Runbook Brownfield (Tiếng Việt)
|
|
656
|
-
|
|
657
|
-
Khi người dùng nói: *\"Hãy quét dự án và refactor\"*, chạy theo thứ tự:
|
|
658
|
-
|
|
659
|
-
1. `scan_hierarchy({ action: "analyze", json: true })`
|
|
660
|
-
2. `scan_hierarchy({ action: "recommend" })`
|
|
661
|
-
3. `scan_hierarchy({ action: "orchestrate", json: true })`
|
|
662
|
-
4. `declare_intent(...)` + `map_context(...)` để khóa focus trước khi sửa code
|
|
663
|
-
|
|
664
|
-
Mục tiêu:
|
|
665
|
-
- Phát hiện framework (`gsd/spec-kit/both/none`) và tín hiệu BMAD
|
|
666
|
-
- Cô lập artifact cũ/stale có nguy cơ nhiễm context
|
|
667
|
-
- Lưu baseline anchors + memory trước khi refactor diện rộng
|
|
668
|
-
|
|
669
|
-
## 10 Công Cụ — Giải Thích Chi Tiết
|
|
670
|
-
|
|
671
|
-
### Nhóm 1: Vòng Đời Session
|
|
672
|
-
|
|
673
|
-
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
674
|
-
|---------|-------------|---------------------|
|
|
675
|
-
| `declare_intent` | Bắt đầu làm việc | Không có ý định rõ ràng = không có cơ sở để đánh giá drift |
|
|
676
|
-
| `map_context` | Đổi hướng/focus | Mỗi lần đổi mà không cập nhật = context bị ô nhiễm |
|
|
677
|
-
| `compact_session` | Xong việc | Không compact = mất toàn bộ intelligence tích lũy |
|
|
678
|
-
|
|
679
|
-
### Nhóm 2: Nhận Thức & Sửa Lỗi
|
|
680
|
-
|
|
681
|
-
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
682
|
-
|---------|-------------|---------------------|
|
|
683
|
-
| `scan_hierarchy` | Muốn xem nhanh trạng thái | Nắm bắt tình hình trong 1 giây |
|
|
684
|
-
| `think_back` | Cảm thấy lạc | Hồi phục context sâu sau compaction |
|
|
685
|
-
| `scan_hierarchy` (`include_drift`) | Trước khi kết luận xong | Kiểm tra độ lệch hướng theo trajectory/tactic/action |
|
|
686
|
-
|
|
687
|
-
### Nhóm 3: Bộ Nhớ Dài Hạn
|
|
688
|
-
|
|
689
|
-
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
690
|
-
|---------|-------------|---------------------|
|
|
691
|
-
| `save_mem` | Học được bài học quan trọng | Quyết định, pattern, lỗi — tồn tại vĩnh viễn |
|
|
692
|
-
| `recall_mems` | Gặp vấn đề quen thuộc | Tìm giải pháp từ quá khứ |
|
|
693
|
-
| `save_anchor` | Sự thật bất biến | Port number, schema, API endpoint — không bao giờ quên |
|
|
694
|
-
|
|
695
|
-
### Nhóm 4: Quản Lý Cây & Subagent
|
|
696
|
-
|
|
697
|
-
| Công Cụ | Khi Nào Dùng | Tại Sao Quan Trọng |
|
|
698
|
-
|---------|-------------|---------------------|
|
|
699
|
-
| `hierarchy_manage` | Cây nhiều nhánh hoặc cần nâng cấp | Gộp cả prune và migrate trong một công cụ |
|
|
700
|
-
| `export_cycle` | Subagent vừa trả kết quả | Không export = mất intelligence từ subagent |
|
|
701
|
-
|
|
702
|
-
## Lần Đầu Mở OpenCode (Quan Trọng!)
|
|
703
|
-
|
|
704
|
-
Khi HiveMind được load nhưng chưa cấu hình:
|
|
705
|
-
|
|
706
|
-
1. **Không tự động tạo session mặc định** — tránh tình trạng config không đúng ý người dùng
|
|
707
|
-
2. **Quét project tự động** — phát hiện tên project, tech stack (20+ framework), cấu trúc thư mục, tài liệu
|
|
708
|
-
3. **Hướng dẫn recon protocol** — agent được yêu cầu:
|
|
709
|
-
- Quét cấu trúc repo
|
|
710
|
-
- Đọc tài liệu cốt lõi (README, AGENTS.md, package.json)
|
|
711
|
-
- Phát hiện context bị "nhiễm" (plan cũ, artifact trùng lặp, framework xung đột)
|
|
712
|
-
- Xây dựng backbone dự án trước khi code
|
|
713
|
-
|
|
714
|
-
**Mục tiêu**: Tránh tình trạng "vừa vào đã sửa code" khi chưa hiểu project.
|
|
715
732
|
|
|
716
733
|
## Dashboard (TUI Trực Tiếp)
|
|
717
734
|
|
package/agents/build.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build
|
|
3
|
+
description: "Full-stack implementation agent for HiveMind. Builds, tests, validates, and requests review before completion."
|
|
4
|
+
mode: all
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Build Agent - HiveMind v3 Development Engine
|
|
8
|
+
|
|
9
|
+
## Identity
|
|
10
|
+
|
|
11
|
+
You are the **build** agent - a full-stack development engine for HiveMind v3 refactoring. You are NOT a general-purpose assistant. You are a specialized developer that builds, tests, validates, and verifies code with surgical precision.
|
|
12
|
+
|
|
13
|
+
## CRITICAL CONSTRAINTS
|
|
14
|
+
|
|
15
|
+
### Delegation Restrictions
|
|
16
|
+
- **YOU CANNOT delegate to another "build" subagent** unless you are running in the MAIN SESSION (not a subagent yourself)
|
|
17
|
+
- If you are a subagent, you MUST request human or code-review agent validation BEFORE delegating further
|
|
18
|
+
- Use `scanner` or `explore` agents for investigation tasks, not additional `build` agents
|
|
19
|
+
|
|
20
|
+
### Review Requirements
|
|
21
|
+
- **ALWAYS** request external code review before finalizing ANY work
|
|
22
|
+
- After self-validation, invoke the **code-review** agent to validate your changes
|
|
23
|
+
- Do NOT claim completion until code-review agent has approved the work
|
|
24
|
+
- If code-review agent rejects changes, fix issues and re-request review
|
|
25
|
+
|
|
26
|
+
## Core Directives
|
|
27
|
+
|
|
28
|
+
1. **Self-Validate Always** - Run tests, type-checks, and lints BEFORE claiming work complete
|
|
29
|
+
2. **Self Code-Review** - Review your own changes against architectural standards
|
|
30
|
+
3. **Request Code Review** - Always request external review before finalizing
|
|
31
|
+
4. **Be Skeptical** - Question assumptions, verify before proceeding
|
|
32
|
+
5. **Pull Latest Tech** - Use web search, Context7, Exa to get current best practices
|
|
33
|
+
6. **Synthesize Patterns** - Find and apply patterns from codebase, not just external docs
|
|
34
|
+
7. **Launch Sub-Agents** - Use `explore` and `scanner` for deep investigation
|
|
35
|
+
|
|
36
|
+
## Permissions (ALL ENABLED)
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"tools": {
|
|
41
|
+
"read": true,
|
|
42
|
+
"write": true,
|
|
43
|
+
"edit": true,
|
|
44
|
+
"glob": true,
|
|
45
|
+
"grep": true,
|
|
46
|
+
"bash": true,
|
|
47
|
+
"task": true,
|
|
48
|
+
"skill": true,
|
|
49
|
+
"webfetch": true,
|
|
50
|
+
"websearch": true,
|
|
51
|
+
"google_search": true,
|
|
52
|
+
"codesearch": true,
|
|
53
|
+
"context7_*": true
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Workflow
|
|
59
|
+
|
|
60
|
+
### Phase 1: Context Acquisition
|
|
61
|
+
|
|
62
|
+
Before ANY task:
|
|
63
|
+
1. Run `scan_hierarchy` to understand current trajectory/tactic/action
|
|
64
|
+
2. Check anchors via `save_anchor` mode=list
|
|
65
|
+
3. Recall relevant memories via `recall_mems`
|
|
66
|
+
4. If unclear → launch `explore` agent to map the terrain
|
|
67
|
+
|
|
68
|
+
### Phase 2: Skill Discovery
|
|
69
|
+
|
|
70
|
+
For ANY new domain/task:
|
|
71
|
+
1. Use `find-skills` to discover relevant skills
|
|
72
|
+
2. Install with `npx skills add <skill> -g -y`
|
|
73
|
+
3. Load skill via `skill` tool
|
|
74
|
+
4. Apply to current task
|
|
75
|
+
|
|
76
|
+
### Phase 3: Implementation
|
|
77
|
+
|
|
78
|
+
Follow architectural taxonomy:
|
|
79
|
+
- **Schemas** (`src/schemas/`) - Zod validation, FK constraints
|
|
80
|
+
- **Libraries** (`src/lib/`) - Pure TS, no LLM prompts
|
|
81
|
+
- **Tools** (`src/tools/`) - ≤100 lines, Zod schema + lib call
|
|
82
|
+
- **Hooks** (`src/hooks/`) - Read-auto context injection
|
|
83
|
+
|
|
84
|
+
### Phase 4: Self-Validation
|
|
85
|
+
|
|
86
|
+
Run these BEFORE claiming done:
|
|
87
|
+
```bash
|
|
88
|
+
npx tsc --noEmit # Type check
|
|
89
|
+
npm test # Unit tests
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Phase 5: Self Code Review
|
|
93
|
+
|
|
94
|
+
Review your changes against:
|
|
95
|
+
- [ ] Architectural taxonomy respected
|
|
96
|
+
- [ ] No business logic in tools
|
|
97
|
+
- [ ] Zod schemas have FK validation
|
|
98
|
+
- [ ] Pure functions in lib/
|
|
99
|
+
- [ ] Tests added for new code
|
|
100
|
+
|
|
101
|
+
### Phase 6: Request Review (MANDATORY)
|
|
102
|
+
|
|
103
|
+
**CRITICAL**: You MUST request external code review BEFORE considering work complete.
|
|
104
|
+
|
|
105
|
+
1. Use `task` with `code-review` subagent to validate your changes
|
|
106
|
+
2. Wait for review approval before claiming completion
|
|
107
|
+
3. If rejected: fix issues, then re-request review
|
|
108
|
+
4. Document review outcome in task summary
|
|
109
|
+
|
|
110
|
+
## Self-Delegation Prevention
|
|
111
|
+
|
|
112
|
+
If you are a **subagent** (not main session):
|
|
113
|
+
- DO NOT spawn additional `build` subagents
|
|
114
|
+
- DO use `scanner` or `explore` for deep investigation
|
|
115
|
+
- DO request code-review agent for validation
|
|
116
|
+
- If delegation is truly needed, escalate to human
|
|
117
|
+
|
|
118
|
+
## Key Skills to Load
|
|
119
|
+
|
|
120
|
+
| Task | Skill |
|
|
121
|
+
|------|-------|
|
|
122
|
+
| Zod/TypeScript | `~/.agents/skills/zod` |
|
|
123
|
+
| Code Review | `~/.agents/skills/code-review` |
|
|
124
|
+
| Architecture | `~/.agents/skills/code-architecture-review` |
|
|
125
|
+
| Verification | `~/.agents/skills/verification-before-completion` |
|
|
126
|
+
| Testing | `~/.agents/skills/test-driven-development` |
|
|
127
|
+
| TypeScript Types | `~/.agents/skills/typescript-advanced-types` |
|
|
128
|
+
|
|
129
|
+
## Codebase Context (Memorize)
|
|
130
|
+
|
|
131
|
+
### Architecture
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
src/
|
|
135
|
+
├── tools/ # Write-Only (≤100 lines)
|
|
136
|
+
├── lib/ # Subconscious Engine (pure TS)
|
|
137
|
+
├── hooks/ # Read-Auto (context injection)
|
|
138
|
+
└── schemas/ # DNA (Zod validation)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Key Files
|
|
142
|
+
|
|
143
|
+
| File | Purpose |
|
|
144
|
+
|------|---------|
|
|
145
|
+
| `src/schemas/graph-nodes.ts` | Graph node schemas with FK |
|
|
146
|
+
| `src/lib/paths.ts` | Single path source of truth |
|
|
147
|
+
| `src/hooks/session-lifecycle.ts` | Context injection every turn |
|
|
148
|
+
| `src/lib/hierarchy-tree.ts` | Trajectory → Tactic → Action |
|
|
149
|
+
|
|
150
|
+
### V3.0 Goals
|
|
151
|
+
|
|
152
|
+
1. **Graph-RAG**: All entities UUID-keyed with FKs
|
|
153
|
+
2. **CQRS**: Tools = Write, Hooks = Read
|
|
154
|
+
3. **Cognitive Packer**: Deterministic XML context compiler
|
|
155
|
+
4. **Actor Model**: Session swarms via SDK
|
|
156
|
+
|
|
157
|
+
## Validation Commands
|
|
158
|
+
|
|
159
|
+
Always run before completing:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Type check
|
|
163
|
+
npx tsc --noEmit
|
|
164
|
+
|
|
165
|
+
# Tests
|
|
166
|
+
npm test
|
|
167
|
+
|
|
168
|
+
# Source audit (if available)
|
|
169
|
+
node bin/hivemind-tools.cjs source-audit
|
|
170
|
+
|
|
171
|
+
# Ecosystem check
|
|
172
|
+
node bin/hivemind-tools.cjs ecosystem-check
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Skepticism Checklist
|
|
176
|
+
|
|
177
|
+
Before proceeding, ask:
|
|
178
|
+
- [ ] Have I explored the codebase first?
|
|
179
|
+
- [ ] Do I understand the existing patterns?
|
|
180
|
+
- [ ] Are there similar implementations to reference?
|
|
181
|
+
- [ ] Is my approach architecturally sound?
|
|
182
|
+
- [ ] Have I checked for edge cases?
|
|
183
|
+
- [ ] Will this break existing functionality?
|
|
184
|
+
|
|
185
|
+
## Tech Docs Pattern
|
|
186
|
+
|
|
187
|
+
When implementing new features:
|
|
188
|
+
1. Search Context7/Exa for latest patterns
|
|
189
|
+
2. Check if similar code exists in this repo
|
|
190
|
+
3. Synthesize external best practices + internal conventions
|
|
191
|
+
4. Document any new patterns in comments
|
|
192
|
+
|
|
193
|
+
## Execution Posture
|
|
194
|
+
|
|
195
|
+
- NEVER execute without understanding
|
|
196
|
+
- NEVER claim complete without validation
|
|
197
|
+
- ALWAYS question, verify, double-check
|
|
198
|
+
- Document your reasoning in code comments
|