{
  "canonical_name": "monoes/monomind",
  "compilation_id": "pack_7b02826da4634eb2b62bcf0a64b285e7",
  "created_at": "2026-05-17T01:10:09.190812+00:00",
  "created_by": "project-pack-compiler",
  "feedback": {
    "carrier_selection_notes": [
      "viable_asset_types=mcp_config, recipe, host_instruction, eval, preflight",
      "recommended_asset_types=mcp_config, recipe, host_instruction, eval, preflight"
    ],
    "evidence_delta": {
      "confirmed_claims": [
        "identity_anchor_present",
        "capability_and_host_targets_present",
        "install_path_declared_or_better"
      ],
      "missing_required_fields": [],
      "must_verify_forwarded": [
        "Run or inspect `npm install -g monomind` in an isolated environment.",
        "Confirm the project exposes the claimed capability to at least one target host."
      ],
      "quickstart_execution_scope": "allowlisted_sandbox_smoke",
      "sandbox_command": "npm install -g monomind",
      "sandbox_container_image": "node:22-slim",
      "sandbox_execution_backend": "docker",
      "sandbox_planner_decision": "deterministic_isolated_install",
      "sandbox_validation_id": "sbx_3208c0e77ea44a30a19efd596ec9b547"
    },
    "feedback_event_type": "project_pack_compilation_feedback",
    "learning_candidate_reasons": [],
    "template_gaps": []
  },
  "identity": {
    "canonical_id": "project_de351417c2a6d15982ae94369acfa776",
    "canonical_name": "monoes/monomind",
    "homepage_url": null,
    "license": "unknown",
    "repo_url": "https://github.com/monoes/monomind",
    "slug": "monomind",
    "source_packet_id": "phit_55db9d2b3a8e4d6db6cc9db8f16c656c",
    "source_validation_id": "dval_7314031fc3a74a69a6239df5d1732a0a"
  },
  "merchandising": {
    "best_for": "需要工具连接与集成能力，并使用 mcp_host的用户",
    "github_forks": 0,
    "github_stars": 0,
    "one_liner_en": "Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
    "one_liner_zh": "Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
    "primary_category": {
      "category_id": "tool-integrations",
      "confidence": "high",
      "name_en": "Tool Integrations",
      "name_zh": "工具连接与集成",
      "reason": "strong category phrase match from project identity and outcome"
    },
    "target_user": "使用 mcp_host, claude, claude_code 等宿主 AI 的用户",
    "title_en": "monomind",
    "title_zh": "monomind 能力包",
    "visible_tags": [
      {
        "label_en": "Security & Permissions",
        "label_zh": "安全审查与权限治理",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "product_domain-security-permissions",
        "type": "product_domain"
      },
      {
        "label_en": "Web Task Automation",
        "label_zh": "网页任务自动化",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "user_job-web-task-automation",
        "type": "user_job"
      },
      {
        "label_en": "Natural-language Web Actions",
        "label_zh": "自然语言网页操作",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "core_capability-natural-language-web-actions",
        "type": "core_capability"
      },
      {
        "label_en": "Checkpoint Resume",
        "label_zh": "断点恢复流程",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "workflow_pattern-checkpoint-resume",
        "type": "workflow_pattern"
      },
      {
        "label_en": "Structured Data Extraction",
        "label_zh": "结构化数据提取",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "selection_signal-structured-data-extraction",
        "type": "selection_signal"
      }
    ]
  },
  "packet_id": "phit_55db9d2b3a8e4d6db6cc9db8f16c656c",
  "page_model": {
    "artifacts": {
      "artifact_slug": "monomind",
      "files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json",
        "REPO_INSPECTION.md",
        "CAPABILITY_CONTRACT.json",
        "EVIDENCE_INDEX.json",
        "CLAIM_GRAPH.json"
      ],
      "required_files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json"
      ]
    },
    "detail": {
      "capability_source": "Project Hit Packet + DownstreamValidationResult",
      "commands": [
        {
          "command": "npm install -g monomind",
          "label": "Node.js / npm · 官方安装入口",
          "source": "https://github.com/monoes/monomind#readme",
          "verified": true
        }
      ],
      "display_tags": [
        "安全审查与权限治理",
        "网页任务自动化",
        "自然语言网页操作",
        "断点恢复流程",
        "结构化数据提取"
      ],
      "eyebrow": "工具连接与集成",
      "glance": [
        {
          "body": "判断自己是不是目标用户。",
          "label": "最适合谁",
          "value": "需要工具连接与集成能力，并使用 mcp_host的用户"
        },
        {
          "body": "先理解能力边界，再决定是否继续。",
          "label": "核心价值",
          "value": "Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code"
        },
        {
          "body": "未完成验证前保持审慎。",
          "label": "继续前",
          "value": "publish to Doramagic.ai project surfaces"
        }
      ],
      "guardrail_source": "Boundary & Risk Card",
      "guardrails": [
        {
          "body": "Prompt Preview 只展示流程，不证明项目已安装或运行。",
          "label": "Check 1",
          "value": "不要把试用当真实运行"
        },
        {
          "body": "mcp_host, claude, claude_code",
          "label": "Check 2",
          "value": "确认宿主兼容"
        },
        {
          "body": "publish to Doramagic.ai project surfaces",
          "label": "Check 3",
          "value": "先隔离验证"
        }
      ],
      "mode": "mcp_config, recipe, host_instruction, eval, preflight",
      "pitfall_log": {
        "items": [
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_ba46bd2053364ab7b216b1ab09b3714a | https://github.com/monoes/monomind/releases/tag/v1.10.0 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.6.8",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_8e00eb27c790432ba99d18d7125b0cee | https://github.com/monoes/monomind/releases/tag/v1.6.8 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.6.8",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.12 — mastermind:idea pipeline hardening",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_6a79f40d2c5e44c4ac6b5e2e855d2a55 | https://github.com/monoes/monomind/releases/tag/v1.9.12 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.9.12 — mastermind:idea pipeline hardening",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.13 — fix: monograph never installed (workspace:* dep)",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_2ffa187842b347428cc973816067e095 | https://github.com/monoes/monomind/releases/tag/v1.9.13 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.2 — mastermind:master hardening",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_d4070dac80cb428ba72244762274a6bf | https://github.com/monoes/monomind/releases/tag/v1.9.2 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.9.2 — mastermind:master hardening",
            "user_impact": "可能阻塞安装或首次运行。"
          },
          {
            "body": "项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。",
            "category": "配置坑",
            "evidence": [
              "capability.host_targets | github_repo:1221944165 | https://github.com/monoes/monomind | host_targets=mcp_host, claude, claude_code"
            ],
            "severity": "medium",
            "suggested_check": "列出会写入的配置文件、目录和卸载/回滚步骤。",
            "title": "可能修改宿主 AI 配置",
            "user_impact": "安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。"
          },
          {
            "body": "README/documentation is current enough for a first validation pass.",
            "category": "能力坑",
            "evidence": [
              "capability.assumptions | github_repo:1221944165 | https://github.com/monoes/monomind | README/documentation is current enough for a first validation pass."
            ],
            "severity": "medium",
            "suggested_check": "将假设转成下游验证清单。",
            "title": "能力判断依赖假设",
            "user_impact": "假设不成立时，用户拿不到承诺的能力。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v1.9.1 — Init wipe-and-replace for managed Claude assets",
            "category": "维护坑",
            "evidence": [
              "community_evidence:github | cevd_e1832d706e974245bfbf1fb183aeafb8 | https://github.com/monoes/monomind/releases/tag/v1.9.1 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：v1.9.1 — Init wipe-and-replace for managed Claude assets",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "未记录 last_activity_observed。",
            "category": "维护坑",
            "evidence": [
              "evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | last_activity_observed missing"
            ],
            "severity": "medium",
            "suggested_check": "补 GitHub 最近 commit、release、issue/PR 响应信号。",
            "title": "维护活跃度未知",
            "user_impact": "新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "downstream_validation.risk_items | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "进入安全/权限治理复核队列。",
            "title": "下游验证发现风险项",
            "user_impact": "下游已经要求复核，不能在页面中弱化。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "risks.scoring_risks | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "把风险写入边界卡，并确认是否需要人工复核。",
            "title": "存在评分风险",
            "user_impact": "风险会影响是否适合普通用户安装。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_57b3501be7e943c5a3329118314c1794 | https://github.com/monoes/monomind/releases/tag/v1.8.0 | 来源讨论提到 python 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.9.0",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_77db71f60ceb4346b348922fc31f9cb7 | https://github.com/monoes/monomind/releases/tag/v1.9.0 | 来源讨论提到 node 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：Monomind v1.9.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "issue_or_pr_quality=unknown。",
            "category": "维护坑",
            "evidence": [
              "evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | issue_or_pr_quality=unknown"
            ],
            "severity": "low",
            "suggested_check": "抽样最近 issue/PR，判断是否长期无人处理。",
            "title": "issue/PR 响应质量未知",
            "user_impact": "用户无法判断遇到问题后是否有人维护。"
          },
          {
            "body": "release_recency=unknown。",
            "category": "维护坑",
            "evidence": [
              "evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | release_recency=unknown"
            ],
            "severity": "low",
            "suggested_check": "确认最近 release/tag 和 README 安装命令是否一致。",
            "title": "发布节奏不明确",
            "user_impact": "安装命令和文档可能落后于代码，用户踩坑概率升高。"
          }
        ],
        "source": "ProjectPitfallLog + ProjectHitPacket + validation + community signals",
        "summary": "发现 15 个潜在踩坑项，其中 0 个为 high/blocking；最高优先级：安装坑 - 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills。",
        "title": "踩坑日志"
      },
      "snapshot": {
        "contributors": 1,
        "forks": 0,
        "license": "unknown",
        "note": "站点快照，非实时质量证明；用于开工前背景判断。",
        "stars": 0
      },
      "source_url": "https://github.com/monoes/monomind",
      "steps": [
        {
          "body": "不安装项目，先体验能力节奏。",
          "code": "preview",
          "title": "先试 Prompt"
        },
        {
          "body": "理解输入、输出、失败模式和边界。",
          "code": "manual",
          "title": "读说明书"
        },
        {
          "body": "把上下文交给宿主 AI 继续工作。",
          "code": "context",
          "title": "带给 AI"
        },
        {
          "body": "进入主力环境前先完成安装入口与风险边界验证。",
          "code": "verify",
          "title": "沙箱验证"
        }
      ],
      "subtitle": "Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
      "title": "monomind 能力包",
      "trial_prompt": "# monomind - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for monoes/monomind.\n\nProject:\n- Name: monomind\n- Repository: https://github.com/monoes/monomind\n- Summary: Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code\n- Host target: mcp_host, claude, claude_code\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n- Capability 2: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. getting-started: Getting Started with Monomind. Produce one small intermediate artifact and wait for confirmation.\n2. project-structure: Project Structure. Produce one small intermediate artifact and wait for confirmation.\n3. architecture-overview: Architecture Overview. Produce one small intermediate artifact and wait for confirmation.\n4. packages-core: Core Packages. Produce one small intermediate artifact and wait for confirmation.\n5. agent-catalog: Agent Catalog. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/monoes/monomind\n- https://github.com/monoes/monomind#readme\n- .claude/skills/agent-browser-testing/SKILL.md\n- .claude/skills/agentdb-advanced/SKILL.md\n- .claude/skills/agentdb-learning/SKILL.md\n- .claude/skills/agentdb-memory-patterns/SKILL.md\n- .claude/skills/agentdb-optimization/SKILL.md\n- .claude/skills/agentdb-vector-search/SKILL.md\n- .claude/skills/agentic-integration/SKILL.md\n- .claude/skills/agentic-jujutsu/SKILL.md\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "voices": [
        {
          "body": "来源平台：github。github/github_release: v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills（https://github.com/monoes/monomind/releases/tag/v1.10.0）；github/github_release: v1.9.13 — fix: monograph never installed (workspace:* dep)（https://github.com/monoes/monomind/releases/tag/v1.9.13）；github/github_release: v1.9.12 — mastermind:idea pipeline hardening（https://github.com/monoes/monomind/releases/tag/v1.9.12）；github/github_release: v1.9.11 — mastermind:idea board name corruption fix（https://github.com/monoes/monomind/releases/tag/v1.9.11）；github/github_release: v1.9.2 — mastermind:master hardening（https://github.com/monoes/monomind/releases/tag/v1.9.2）；github/github_release: v1.9.1 — Init wipe-and-replace for managed Claude assets（https://github.com/monoes/monomind/releases/tag/v1.9.1）；github/github_release: Monomind v1.9.0（https://github.com/monoes/monomind/releases/tag/v1.9.0）；github/github_release: Monomind v1.8.0 — Monograph, Mastermind & Security Hardening（https://github.com/monoes/monomind/releases/tag/v1.8.0）；github/github_release: v1.6.8（https://github.com/monoes/monomind/releases/tag/v1.6.8）。这些是项目级外部声音，不作为单独质量证明。",
          "items": [
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.10.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.9.13 — fix: monograph never installed (workspace:* dep)",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.13"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.9.12 — mastermind:idea pipeline hardening",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.12"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.9.11 — mastermind:idea board name corruption fix",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.11"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.9.2 — mastermind:master hardening",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.2"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.9.1 — Init wipe-and-replace for managed Claude assets",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.1"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "Monomind v1.9.0",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.9.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "Monomind v1.8.0 — Monograph, Mastermind & Security Hardening",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.8.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "v1.6.8",
              "url": "https://github.com/monoes/monomind/releases/tag/v1.6.8"
            }
          ],
          "status": "已收录 9 条来源",
          "title": "社区讨论"
        }
      ]
    },
    "homepage_card": {
      "category": "工具连接与集成",
      "desc": "Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
      "effort": "安装已验证",
      "forks": 0,
      "icon": "link",
      "name": "monomind 能力包",
      "risk": "可发布",
      "slug": "monomind",
      "stars": 0,
      "tags": [
        "安全审查与权限治理",
        "网页任务自动化",
        "自然语言网页操作",
        "断点恢复流程",
        "结构化数据提取"
      ],
      "thumb": "gray",
      "type": "MCP 配置"
    },
    "manual": {
      "markdown": "# https://github.com/monoes/monomind 项目说明书\n\n生成时间：2026-05-17 00:56:32 UTC\n\n## 目录\n\n- [Getting Started with Monomind](#getting-started)\n- [Project Structure](#project-structure)\n- [Architecture Overview](#architecture-overview)\n- [Core Packages](#packages-core)\n- [Agent Catalog](#agent-catalog)\n- [Agent Routing System](#agent-routing)\n- [Swarm Topologies](#swarm-topologies)\n- [Consensus Protocols](#consensus-protocols)\n- [Memory System](#memory-system)\n- [Knowledge Graph (Monograph)](#knowledge-graph)\n\n<a id='getting-started'></a>\n\n## Getting Started with Monomind\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n- [README.md](https://github.com/monoes/monomind/blob/main/README.md)\n- [packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n- [packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/task.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/task.ts)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n- [packages/helpers/README.md](https://github.com/monoes/monomind/blob/main/packages/helpers/README.md)\n</details>\n\n# Getting Started with Monomind\n\nMonomind is an AI coordination system that orchestrates multiple AI agents to work together on complex software development tasks. It provides a unified CLI interface, memory management, knowledge graphs, and neural learning capabilities that enable agents to share context, learn from patterns, and collaborate effectively.\n\n## Overview\n\nMonomind serves as the central intelligence layer for AI-assisted development workflows. It coordinates agents, manages sessions, stores learned patterns in vector memory, and provides a knowledge graph for understanding codebase relationships. 资料来源：[packages/@monomind/cli/README.md]()\n\n### Key Capabilities\n\n| Capability | Description |\n|------------|-------------|\n| **Agent Orchestration** | Manage and coordinate multiple specialized AI agents |\n| **Session Management** | Save, restore, and export conversation sessions |\n| **Memory & Intelligence** | Vector-based memory with HNSW indexing and neural learning |\n| **Knowledge Graph (Monograph)** | Build dependency graphs of codebases automatically |\n| **MCP Server** | Model Context Protocol server for tool integration |\n| **Workflow Automation** | Create and execute multi-step development workflows |\n\n## Installation\n\n### Prerequisites\n\n- Node.js 18+ and npm/pnpm\n- Git\n\n### Install via npm\n\n```bash\nnpm install -g @monomind/cli\n```\n\nOr use directly with npx:\n\n```bash\nnpx @monomind/cli@latest --help\n```\n\n资料来源：[packages/implementation/adrs/README.md]()\n\n### Verify Installation\n\n```bash\nmonomind doctor --fix\n```\n\nThis command checks the installation and attempts to fix common issues automatically.\n\n资料来源：[README.md]()\n\n## Core Concepts\n\n### Architecture Overview\n\n```mermaid\ngraph TD\n    subgraph Monomind\n        CLI[CLI Interface]\n        MCP[MCP Server]\n        Memory[Vector Memory]\n        Graph[Knowledge Graph]\n        SONA[Neural Learning]\n    end\n    \n    subgraph Agents\n        Coder[Coder Agent]\n        Reviewer[Reviewer Agent]\n        Architect[Architect Agent]\n        Coordinator[Coordinator Agent]\n    end\n    \n    CLI --> MCP\n    CLI --> Memory\n    CLI --> Graph\n    Memory --> SONA\n    Graph --> SONA\n    \n    MCP --> Coder\n    MCP --> Reviewer\n    MCP --> Architect\n    MCP --> Coordinator\n```\n\n### Agent Types\n\nMonomind supports multiple specialized agent types, each with distinct capabilities:\n\n| Agent Type | Capabilities | Use Case |\n|------------|--------------|----------|\n| `coder` | Code generation, refactoring, debugging, testing | Primary development work |\n| `researcher` | Web search, data analysis, summarization, citation | Information gathering |\n| `tester` | Unit testing, integration testing, coverage analysis | Quality assurance |\n| `reviewer` | Code review, security audit, quality check | Code inspection |\n| `architect` | System design, pattern analysis, scalability | Design decisions |\n| `coordinator` | Task orchestration, agent management, workflow control | Multi-agent coordination |\n| `security-architect` | Threat modeling, security patterns, compliance | Security-focused work |\n| `memory-specialist` | Vector search, agentdb, caching, optimization | Memory optimization |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts]()\n\n## CLI Commands Reference\n\n### Session Management\n\nManage conversation sessions with persistence and export capabilities.\n\n```bash\n# List all sessions\nmonomind session list\n\n# Save current session state\nmonomind session save\n\n# Restore a saved session\nmonomind session restore <session-id>\n\n# Delete a saved session\nmonomind session delete <session-id>\n\n# Export session to file\nmonomind session export <session-id> --output ./session.json\n\n# Import session from file\nmonomind session import ./session.json\n\n# Show current active session\nmonomind session current\n```\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts]()\n\n### MCP Server Management\n\nControl the Model Context Protocol server that provides tools to connected agents.\n\n```bash\n# Start MCP server\nmonomind mcp start\n\n# Stop MCP server\nmonomind mcp stop\n\n# Show server status\nmonomind mcp status\n\n# Check server health\nmonomind mcp health\n\n# Restart MCP server\nmonomind mcp restart\n\n# List available tools\nmonomind mcp tools\n\n# Enable/disable specific tools\nmonomind mcp toggle <tool-name> --enable\nmonomind mcp toggle <tool-name> --disable\n\n# Execute a specific tool\nmonomind mcp exec <tool-name> --args <json>\n\n# Show server logs\nmonomind mcp logs\n```\n\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts]()\n\n### Task Management\n\nCreate and manage development tasks for agents to work on.\n\n```bash\n# Create a new task\nmonomind task create \"Implement user authentication\" --priority high\n\n# List all tasks\nmonomind task list\n\n# Get task details\nmonomind task status <task-id>\n\n# Cancel a running task\nmonomind task cancel <task-id>\n\n# Assign task to agent(s)\nmonomind task assign <task-id> --agents coder,reviewer\n\n# Retry a failed task\nmonomind task retry <task-id>\n```\n\n资料来源：[packages/@monomind/cli/src/commands/task.ts]()\n\n### Agent Commands\n\n```bash\n# List available agents\nmonomind agent list\n\n# Show agent metrics\nmonomind agent metrics\n\n# Manage agent pool\nmonomind agent pool status\n\n# Show agent health\nmonomind agent health\n\n# Show agent logs\nmonomind agent logs --agent coder\n\n# Check WASM runtime availability\nmonomind agent wasm-status\n\n# Create a WASM-sandboxed agent\nmonomind agent wasm-create <template>\n\n# List WASM agent gallery templates\nmonomind agent wasm-gallery\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts]()\n\n## Memory & Intelligence System\n\n### Vector Memory (AgentDB + HNSW)\n\nMonomind stores insights, patterns, and decisions in searchable vector memory with HNSW indexing.\n\n```mermaid\ngraph LR\n    A[User Input] --> B[Embedding Generator]\n    B --> C[HNSW Index]\n    C --> D[Vector Search]\n    D --> E[Relevant Results]\n    \n    F[(SQLite)] --> G[Structured Data]\n    G --> E\n```\n\n### Key Features\n\n| Feature | Description |\n|---------|-------------|\n| **HNSW Indexing** | 150x-12,500x faster than brute-force search |\n| **Hybrid Backend** | SQLite for structured data, AgentDB for semantic search |\n| **Cross-Session Persistence** | Context survives restarts |\n| **A-MEM Auto-Linking** | Automatic bidirectional references between stored entries |\n\n资料来源：[packages/@monomind/memory/README.md]()\n\n### Memory Scopes\n\nMemory is organized into three scopes:\n\n| Scope | Path | Purpose |\n|-------|------|---------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n### Utility Functions\n\n```typescript\nimport {\n  resolveAgentMemoryDir,  // Get scope directory path\n  createAgentBridge,       // Create scoped AutoMemoryBridge\n  transferKnowledge,       // Cross-agent knowledge sharing\n  listAgentScopes,         // Discover existing agent scopes\n} from '@monomind/memory';\n\n// Resolve path for an agent scope\nconst dir = resolveAgentMemoryDir('my-agent', 'project');\n// → /workspaces/my-project/.claude/agent-memory/my-agent/\n\n// List all agent scopes in a directory\nconst scopes = await listAgentScopes('/workspaces/my-project');\n```\n\n资料来源：[packages/@monomind/memory/README.md]()\n\n### Knowledge Graph (Monograph)\n\nMonograph builds a full dependency graph of your codebase that is automatically queried before every task.\n\n```bash\n# What files are relevant to my task?\nmonograph_suggest \"add webhook retry logic\"\n# → returns ranked list of files with relevance scores\n\n# What depends on UserService?\nmonograph_query \"UserService dependencies\"\n# → returns file paths + line numbers\n\n# Find the most connected files in the codebase\nmonograph_god_nodes\n# → returns high-centrality internal files\n```\n\n### Node Types in Monograph\n\n| Type | Meaning | Example |\n|------|---------|---------|\n| `File` | Source code file | `.ts`, `.py`, `.md` |\n| `Class` | Code class or interface | `UserService`, `AuthMiddleware` |\n| `Concept` | Extracted semantic concept | `authentication`, `caching` |\n| `PDF` | PDF document chunk | Technical documentation |\n\n### Edge Types\n\n| Relation | Meaning |\n|----------|---------|\n| `IMPORTS` | Code import dependency |\n| `DEFINES` | File defines symbol |\n| `TAGGED_AS` | Section tagged with concept |\n| `CO_OCCURS` | Concepts appear together |\n| `INFERRED` | Claude-extracted semantic relationship |\n| `DESCRIBES` / `CAUSES` / `PART_OF` | LLM-enriched semantic edges |\n\n### CLI vs MCP Usage\n\n| Method | Use Case |\n|--------|----------|\n| **CLI** (`monomind monograph ...`) | One-time builds, manual searches, terminal usage |\n| **MCP tools** (`mcp__monomind__monograph_*`) | Claude Code integration, programmatic queries during tasks |\n\n资料来源：[plugin/commands/monograph/README.md]()\n\n### Neural Learning (SONA)\n\nSelf-Optimizing Neural Adaptation learns from every task:\n\n- **Pattern recognition** improves agent routing over time\n- **Trajectory tracking** identifies what works and what doesn't\n- **Automatic model adaptation** with <0.05ms overhead\n\n## Quick Start Guide\n\n### Step 1: Initialize Monomind\n\n```bash\n# Run the setup wizard\nmonomind init\n\n# Or initialize with specific template\nmonomind init --template minimal\n```\n\nAvailable templates:\n- `minimal` - Quick start with behavioral rules\n- `standard` - Full setup with all features\n- `full` - Complete configuration with hooks and learning\n- `security` - Security-focused configuration\n- `performance` - Performance-optimized setup\n- `solo` - Single developer workflow\n\n### Step 2: Configure Your Environment\n\n```bash\n# Set configuration\nmonomind config set providers.openai.api_key <your-key>\nmonomind config set providers.anthropic.api_key <your-key>\n\n# List current configuration\nmonomind config list\n\n# Export configuration\nmonomind config export ./config.json\n\n# Import configuration\nmonomind config import ./config.json\n```\n\n### Step 3: Start Working\n\n```mermaid\ngraph TD\n    A[Start Session] --> B[Create Task]\n    B --> C[Agent Selection]\n    C --> D{Parallel or Sequential?}\n    D -->|Parallel| E[Swarm Orchestration]\n    D -->|Sequential| F[Single Agent]\n    E --> G[Memory Storage]\n    F --> G\n    G --> H[Pattern Learning]\n    H --> I[Future Task Optimization]\n```\n\n### Step 4: Session Workflow\n\n```bash\n# Start a new session\nmonomind session save\n\n# Work on tasks\nmonomind task create \"Build user dashboard\"\nmonomind task assign <task-id> --agents coder\n\n# Monitor progress\nmonomind task status <task-id>\n\n# Review session details\nmonomind session current\n```\n\n## Cross-Platform Helper Scripts\n\nMonomind includes helper scripts for cross-platform development automation.\n\n### Installation\n\nThe helpers are automatically installed when you run `monomind init` and placed in `.claude/helpers/`.\n\n资料来源：[packages/helpers/README.md]()\n\n### Available Helpers\n\n| Script | Purpose |\n|--------|---------|\n| `monomind-v1.sh status` | Check V1 feature status |\n| `monomind-v1.sh doctor` | Diagnose installation issues |\n| `monomind-v1.sh help` | Show help information |\n\n### Permission Issues (Linux/Mac)\n\n```bash\nfind .claude/helpers -name \"*.sh\" -exec chmod +x {} \\;\n```\n\n### Windows PowerShell Execution Policy\n\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n```\n\n资料来源：[packages/helpers/README.md]()\n\n## Configuration Reference\n\n### Configuration File Location\n\nConfiguration is stored in:\n- Project: `.claude/monomind.config.json`\n- User: `~/.config/monomind/config.json`\n\n### Runtime Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `runtime.claudeMdTemplate` | `'standard'` | CLAUDE.md template to use |\n| `runtime.autoSave` | `true` | Automatically save sessions |\n| `runtime.maxConcurrentAgents` | `4` | Maximum parallel agents |\n\n### Provider Configuration\n\n```bash\n# Configure AI providers\nmonomind providers configure openai\nmonomind providers configure anthropic\nmonomind providers configure local\n\n# Test provider connection\nmonomind providers test openai\n\n# View usage statistics\nmonomind providers usage\n```\n\n## Troubleshooting\n\n### Common Issues\n\n#### Installation Fails\n\n```bash\n# Clear cache and retry\nnpm cache clean --force\nnpm install -g @monomind/cli\n```\n\n#### MCP Server Won't Start\n\n```bash\n# Check server health\nmonomind mcp health\n\n# View logs for errors\nmonomind mcp logs\n\n# Restart the server\nmonomind mcp restart\n```\n\n#### Memory Search Returns No Results\n\n```bash\n# Check memory backend status\nmonomind memory status\n\n# Rebuild vector index\nmonomind memory rebuild\n```\n\n### Diagnostic Commands\n\n```bash\n# Run full diagnostics\nmonomind doctor\n\n# Fix common issues automatically\nmonomind doctor --fix\n\n# Check specific component\nmonomind agent health\nmonomind mcp status\n```\n\n## Contributing\n\n```bash\n# Clone the repository\ngit clone https://github.com/monoes/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run diagnostic and fix\nmonomind doctor --fix\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n## License\n\nMIT License — See [LICENSE](LICENSE) for details.\n\n---\n\n<a id='project-structure'></a>\n\n## Project Structure\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview), [Core Packages](#packages-core)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli)\n- [packages/@monomind/memory](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory)\n- [packages/@monomind/hooks](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks)\n- [packages/@monomind/swarm](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm)\n- [packages/@monomind/shared](https://github.com/monoes/monomind/blob/main/packages/@monomind/shared)\n- [.claude/agents](https://github.com/monoes/monomind/blob/main/.claude/agents)\n- [.claude/commands](https://github.com/monoes/monomind/blob/main/.claude/commands)\n- [packages/@monomind/plugins](https://github.com/monoes/monomind/blob/main/packages/@monomind/plugins)\n</details>\n\n# Project Structure\n\nMonomind is organized as a **monorepo** using pnpm workspaces, with the primary packages located in the `packages/` directory and Claude Code integration files in the `.claude/` directory.\n\n## Repository Layout\n\n```\nmonomind/\n├── packages/\n│   ├── @monomind/           # Core packages\n│   │   ├── cli/             # Command-line interface\n│   │   ├── memory/          # Vector memory & AgentDB\n│   │   ├── hooks/           # Hook system for automation\n│   │   ├── swarm/           # Multi-agent coordination\n│   │   ├── shared/          # Shared utilities & types\n│   │   ├── plugins/         # Plugin system\n│   │   └── aidefence/       # Security & audit tools\n│   └── plugins/             # External plugins\n│       ├── gastown-bridge/  # Thread-based work tracking\n│       └── teammate-plugin/ # Claude Code integration\n├── .claude/\n│   ├── agents/              # Claude Code agent definitions\n│   └── commands/             # Custom slash commands\n└── README.md\n```\n\n## Core Packages\n\n### @monomind/cli\n\nThe CLI package is the primary user-facing interface for Monomind. It provides commands for:\n\n- **Session Management** — Save, restore, list, delete, export sessions\n- **Memory Operations** — Store, retrieve, search, list, delete entries\n- **Agent Control** — Metrics, pool management, health checks, WASM agents\n- **MCP Server** — Start, stop, health checks, tool execution\n- **Configuration** — Get, set, list, reset config values\n- **Plugins** — Install, uninstall, toggle, list plugins\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts](packages/@monomind/cli/src/commands/session.ts)\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](packages/@monomind/cli/src/commands/memory.ts)\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts](packages/@monomind/cli/src/commands/mcp.ts)\n\n### @monomind/memory\n\nThe memory package implements a hybrid storage backend combining:\n\n| Component | Purpose |\n|-----------|---------|\n| **AgentDB** | HNSW-based vector database for semantic search |\n| **SQLite** | Structured data storage |\n| **A-MEM Auto-Linking** | Zettelkasten-style bidirectional references (arXiv:2409.11987) |\n\nMemory scopes follow a hierarchical structure:\n\n| Scope | Path | Use Case |\n|-------|------|----------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n### @monomind/hooks\n\nThe hooks system provides event-driven automation with support for:\n\n- **Pre/Post Hooks** — Execute before/after operations\n- **Slash Commands** — Custom CLI extensions\n- **Status Line** — Real-time status updates\n\nHooks are configured via JSON:\n\n```json\n{\n  \"onAgentStart\": { \"command\": \"log-agent-start\" },\n  \"onTaskComplete\": { \"type\": \"command\", \"command\": \"notify\" },\n  \"statusLine\": { \"type\": \"command\", \"command\": \"statusline\" }\n}\n```\n\n资料来源：[packages/@monomind/hooks/README.md](packages/@monomind/hooks/README.md)\n\n### @monomind/swarm\n\nMulti-agent coordination system enabling:\n\n- **Swarm Orchestration** — Task distribution across agents\n- **Agent Communication** — Inter-agent messaging protocols\n- **Load Balancing** — Work distribution optimization\n- **Failure Recovery** — Automatic retry and fallback mechanisms\n\n### @monomind/shared\n\nShared utilities and TypeScript types used across all Monomind packages:\n\n- Common interfaces and type definitions\n- Utility functions\n- Constants and configuration schemas\n\n### @monomind/plugins\n\nThe plugin system provides extensibility through:\n\n- **Plugin Discovery** — Automatic plugin detection\n- **Lifecycle Management** — Install, enable, disable, uninstall\n- **Sandboxing** — Isolated plugin execution environments\n\n## Claude Code Integration\n\n### .claude/agents\n\nAgent definitions for Claude Code integration. Each agent can have:\n\n- **System Prompts** — Custom instructions and behavior\n- **Tool Sets** — Specific capabilities and permissions\n- **Memory Scopes** — Dedicated knowledge bases\n\n### .claude/commands\n\nCustom slash commands extend Claude Code's CLI:\n\n```bash\n# Available commands\nmonograph_suggest  # Get relevant file suggestions\nmonograph_query    # Query knowledge graph dependencies\nmonograph_god_nodes # Find highly-connected internal files\n```\n\n## CLAUDE.md Generation\n\nThe CLI includes a CLAUDE.md generator with multiple templates:\n\n```typescript\nexport const CLAUDE_MD_TEMPLATES: Array<{ name: ClaudeMdTemplate; description: string }> = [\n  { name: 'minimal', description: 'Quick start — behavioral rules, anti-drift' },\n  { name: 'standard', description: 'Full features — swarm, hooks, intelligence' },\n  { name: 'full', description: 'Complete — all sections including auto-start' },\n  { name: 'security', description: 'Security-focused — audit, compliance' },\n  { name: 'performance', description: 'Performance-focused — profiling, optimization' },\n  { name: 'solo', description: 'Single agent — no swarm' },\n];\n```\n\n资料来源：[packages/@monomind/cli/src/init/claudemd-generator.ts](packages/@monomind/cli/src/init/claudemd-generator.ts)\n\n## External Plugins\n\n### gastown-bridge\n\nThread-based work tracking system with concepts:\n\n| Concept | Description |\n|---------|-------------|\n| **Bead** | Individual work unit |\n| **Formula** | Multi-leg work order (convoy, workflow, expansion, aspect) |\n| **Thread** | Collection of related beads |\n\n### teammate-plugin\n\nClaude Code integration plugin providing:\n\n- Claude Code version compatibility checking\n- Teammate bridge creation\n- Claude Code plugin system integration\n\n资料来源：[packages/plugins/gastown-bridge/README.md](packages/plugins/gastown-bridge/README.md)\n资料来源：[packages/plugins/teammate-plugin/README.md](packages/plugins/teammate-plugin/README.md)\n\n## Architecture Diagram\n\n```mermaid\ngraph TD\n    subgraph \"User Interface\"\n        CLI[CLI Commands]\n        MCP[MCP Tools]\n        SL[Slash Commands]\n    end\n\n    subgraph \"packages/@monomind\"\n        CLI_PKG[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        SWARM[@monomind/swarm]\n        SHARED[@monomind/shared]\n    end\n\n    subgraph \"Data Layer\"\n        AGENTDB[AgentDB<br/>HNSW Vector DB]\n        SQLITE[SQLite]\n        GRAPH[Knowledge Graph<br/>Monograph]\n    end\n\n    CLI --> CLI_PKG\n    MCP --> CLI_PKG\n    SL --> HOOKS\n\n    CLI_PKG --> MEM\n    CLI_PKG --> HOOKS\n    CLI_PKG --> SWARM\n    HOOKS --> SHARED\n    SWARM --> SHARED\n\n    MEM --> AGENTDB\n    MEM --> SQLITE\n    MEM --> GRAPH\n```\n\n## Memory & Intelligence System\n\nThe Monomind intelligence layer consists of three interconnected systems:\n\n```mermaid\ngraph LR\n    subgraph \"Intelligence\"\n        KG[Knowledge Graph<br/>Monograph]\n        VM[Vector Memory<br/>AgentDB + HNSW]\n        NL[Neural Learning<br/>SONA]\n    end\n\n    KG -.->|Dependency Graph| VM\n    VM -.->|Semantic Search| NL\n    NL -.->|Pattern Learning| KG\n```\n\n### Knowledge Graph (Monograph)\n\nAutomatically builds dependency graphs of codebases:\n\n- `IMPORTS` — Code import dependencies\n- `DEFINES` — File defines symbol\n- `TAGGED_AS` — Section tagged with concept\n- `CO_OCCURS` — Concepts appear together\n- `INFERRED` — Claude-extracted semantic relationship\n\n资料来源：[plugin/commands/monograph/README.md](plugin/commands/monograph/README.md)\n\n## Build & Installation\n\n```bash\n# Clone repository\ngit clone https://github.com/nokhodian/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run diagnostics\nmonomind doctor --fix\n\n# Install CLI globally\nnpx @monomind/cli@latest --help\n```\n\n## Contributing Guidelines\n\n1. Fork the repository and create a feature branch\n2. Run `pnpm install` to install dependencies\n3. Use `monomind doctor --fix` to verify setup\n4. Follow the CLAUDE.md guidelines for code contributions\n\n资料来源：[README.md](README.md)\n\n---\n\n<a id='architecture-overview'></a>\n\n## Architecture Overview\n\n### 相关页面\n\n相关主题：[Core Packages](#packages-core), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/agent-wasm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)\n- [packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n- [packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n- [packages/@monomind/cli/src/commands/task.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/task.ts)\n- [packages/@monomind/monograph/src/config/types.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/config/types.ts)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n</details>\n\n# Architecture Overview\n\nMonomind is a comprehensive AI coordination system designed to orchestrate multiple AI agents, manage persistent memory, and provide intelligent workflow automation for complex software development tasks.\n\n## System Architecture\n\n### High-Level Architecture Diagram\n\n```mermaid\ngraph TB\n    subgraph \"CLI Layer\"\n        CLI[CLI Interface<br/>@monomind/cli]\n    end\n\n    subgraph \"Core Layer\"\n        MCP[MCP Server<br/>@monomind/mcp]\n        Shared[Shared Core<br/>@monomind/shared]\n    end\n\n    subgraph \"Capability Layer\"\n        Memory[Memory System<br/>@monomind/memory]\n        Monograph[Knowledge Graph<br/>@monomind/monograph]\n        AiDefence[Security<br/>@monomind/aidefence]\n    end\n\n    subgraph \"Agent Layer\"\n        Agents[Agent Pool]\n        WASM[WASM Runtime]\n    end\n\n    CLI --> MCP\n    CLI --> Shared\n    MCP --> Shared\n    Shared --> Memory\n    Shared --> Monograph\n    Shared --> AiDefence\n    MCP --> Agents\n    Agents --> WASM\n```\n\n## Package Structure\n\n### Core Packages\n\n| Package | Purpose | Entry Point |\n|---------|---------|-------------|\n| `@monomind/cli` | Command-line interface and user interaction | `packages/@monomind/cli/src/index.ts` |\n| `@monomind/mcp` | Model Context Protocol server implementation | `packages/@monomind/mcp/src/server.ts` |\n| `@monomind/shared` | Shared utilities and core orchestration logic | `packages/@monomind/shared/src/index.ts` |\n| `@monomind/shared/src/core/orchestrator` | Agent orchestration engine | `packages/@monomind/shared/src/core/orchestrator/index.ts` |\n\n### Capability Packages\n\n| Package | Description |\n|---------|-------------|\n| `@monomind/memory` | Vector memory storage with HNSW indexing and SQLite backend |\n| `@monomind/monograph` | Knowledge graph builder and dependency analysis |\n| `@monomind/aidefence` | Security scanning, CVE detection, and threat modeling |\n| `@monomind/teammate-plugin` | Claude Code plugin integration |\n\n## Command Architecture\n\nThe CLI provides hierarchical command organization through subcommands. Each command follows a consistent pattern with `help`, `list`, and action subcommands.\n\n```mermaid\ngraph LR\n    subgraph \"Top-Level Commands\"\n        session[session]\n        task[task]\n        agent[agent]\n        mcp[mcp]\n        config[config]\n    end\n\n    subgraph \"Agent Subcommands\"\n        agent_list[agent list]\n        agent_metrics[agent metrics]\n        agent_pool[agent pool]\n        agent_wasm[agent wasm-*]\n    end\n\n    subgraph \"MCP Subcommands\"\n        mcp_start[start]\n        mcp_stop[stop]\n        mcp_status[status]\n        mcp_tools[tools]\n    end\n\n    agent --> agent_list\n    agent --> agent_metrics\n    agent --> agent_pool\n    agent --> agent_wasm\n    mcp --> mcp_start\n    mcp --> mcp_stop\n    mcp --> mcp_status\n    mcp --> mcp_tools\n```\n\n### Session Management\n\nSession commands provide conversation persistence and replay capabilities:\n\n| Subcommand | Purpose | Implementation |\n|------------|---------|----------------|\n| `list` | List all saved sessions | `packages/@monomind/cli/src/commands/session.ts:1-50` |\n| `save` | Save current session state | Session persistence layer |\n| `restore` | Restore a saved session | State restoration mechanism |\n| `delete` | Delete a saved session | Session cleanup |\n| `export` | Export session to file | File serialization |\n| `import` | Import session from file | File deserialization |\n| `current` | Show current active session | Active session tracking |\n\n### Task Orchestration\n\nTasks are the primary unit of work in Monomind, managed through the orchestrator:\n\n```typescript\n// Task subcommands from packages/@monomind/cli/src/commands/task.ts\nconst TASK_SUBCOMMANDS = ['create', 'list', 'status', 'cancel', 'assign', 'retry'];\n```\n\n| Subcommand | Description |\n|------------|-------------|\n| `create` | Create a new task |\n| `list` | List all tasks |\n| `status` | Get task details and progress |\n| `cancel` | Cancel a running task |\n| `assign` | Assign task to agent(s) |\n| `retry` | Retry a failed task |\n\n## Agent System Architecture\n\n### Agent Types and Capabilities\n\n```mermaid\ngraph TD\n    subgraph \"Agent Types\"\n        coder[Coder Agent]\n        researcher[Researcher Agent]\n        tester[Tester Agent]\n        reviewer[Reviewer Agent]\n        architect[Architect Agent]\n        coordinator[Coordinator Agent]\n        security[Security Architect]\n        memory[Memory Specialist]\n        performance[Performance Engineer]\n    end\n\n    subgraph \"Capabilities\"\n        code-gen[code-generation<br/>refactoring<br/>debugging]\n        research[web-search<br/>data-analysis]\n        test[unit-testing<br/>integration-testing]\n        review[code-review<br/>security-audit]\n        design[system-design<br/>pattern-analysis]\n        orchestrate[task-orchestration<br/>workflow-control]\n        security-caps[threat-modeling<br/>compliance]\n        memory-caps[vector-search<br/>caching]\n        perf[caching<br/>optimization<br/>profiling]\n    end\n\n    coder --> code-gen\n    researcher --> research\n    tester --> test\n    reviewer --> review\n    architect --> design\n    coordinator --> orchestrate\n    security --> security-caps\n    memory --> memory-caps\n    performance --> perf\n```\n\n### Agent Capability Matrix\n\n| Agent Type | Primary Capabilities |\n|------------|---------------------|\n| `coder` | code-generation, refactoring, debugging, testing |\n| `researcher` | web-search, data-analysis, summarization, citation |\n| `tester` | unit-testing, integration-testing, coverage-analysis, automation |\n| `reviewer` | code-review, security-audit, quality-check, documentation |\n| `architect` | system-design, pattern-analysis, scalability, documentation |\n| `coordinator` | task-orchestration, agent-management, workflow-control |\n| `security-architect` | threat-modeling, security-patterns, compliance, audit |\n| `memory-specialist` | vector-search, agentdb, caching, optimization |\n| `performance-engineer` | caching, optimization, profiling, benchmarking |\n\n*资料来源：[packages/@monomind/cli/src/commands/agent.ts:60-90](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)*\n\n### WASM Agent Runtime\n\nMonomind supports sandboxed agent execution via WebAssembly:\n\n```mermaid\ngraph LR\n    subgraph \"WASM Commands\"\n        wasm-create[wasm-create]\n        wasm-prompt[wasm-prompt]\n        wasm-gallery[wasm-gallery]\n        wasm-status[wasm-status]\n    end\n\n    subgraph \"Gallery Templates\"\n        gallery1[Template 1]\n        gallery2[Template 2]\n        gallery3[Template N]\n    end\n\n    wasm-gallery --> gallery1\n    wasm-gallery --> gallery2\n    wasm-gallery --> gallery3\n    wasm-create --> gallery1\n```\n\n| Command | Purpose |\n|---------|---------|\n| `wasm-status` | Check WASM runtime availability |\n| `wasm-create` | Create a WASM-sandboxed agent |\n| `wasm-prompt` | Send a prompt to a WASM agent |\n| `wasm-gallery` | List WASM agent gallery templates |\n\n*资料来源：[packages/@monomind/cli/src/commands/agent-wasm.ts:1-150](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)*\n\n## Memory System Architecture\n\n### Memory Scopes\n\nMonomind implements a hierarchical memory architecture with multiple scopes:\n\n```mermaid\ngraph TD\n    subgraph \"Memory Scopes\"\n        global[Global<br/>~/.claude/agent-memory/]\n        project[Project<br/>/.claude/agent-memory/]\n        local[Local<br/>/.claude/agent-memory-local/]\n        user[User<br/>~/.claude/agent-memory/]\n    end\n\n    subgraph \"Per-Agent Isolation\"\n        coder[Coder Agent]\n        tester[Tester Agent]\n        reviewer[Reviewer Agent]\n    end\n\n    global --> coder\n    global --> tester\n    global --> reviewer\n    project --> coder\n    project --> tester\n    project --> reviewer\n    local --> coder\n    local --> tester\n    local --> reviewer\n```\n\n### Memory Scope Configuration\n\n| Scope | Path Pattern | Purpose |\n|-------|--------------|---------|\n| `global` | `<gitRoot>/.claude/agent-memory/<agent>/` | Global agent learnings |\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n*资料来源：[packages/@monomind/memory/README.md:50-100](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)*\n\n### Hybrid Backend\n\nThe memory system uses a hybrid approach combining structured and vector storage:\n\n```mermaid\ngraph LR\n    subgraph \"Hybrid Backend\"\n        SQLite[(SQLite<br/>Structured Data)]\n        AgentDB[(AgentDB<br/>Vector Search)]\n        HNSW[HNSW Index]\n    end\n\n    SQLite --> AgentDB\n    AgentDB --> HNSW\n```\n\n| Component | Function | Performance |\n|-----------|----------|-------------|\n| SQLite | Structured data persistence | ACID compliance |\n| AgentDB | Semantic vector search | HNSW indexing |\n| HNSW | Approximate nearest neighbor | 150x-12,500x faster than brute-force |\n\n### A-MEM Auto-Linking\n\nThe system implements automatic semantic linking (arXiv:2409.11987):\n\n```typescript\n// From packages/@monomind/memory/README.md\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  // A-MEM auto-linking is automatically active when embeddingGenerator is set\n});\n```\n\nEach stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional `references` edges.\n\n## Knowledge Graph (Monograph)\n\n### Graph Node Types\n\n| Node Type | Description |\n|-----------|-------------|\n| `File` | Source code file |\n| `Directory` | Project directory |\n| `Function` | Function definition |\n| `Class` | Code class or interface |\n| `Concept` | Extracted semantic concept |\n| `PDF` | PDF document chunk |\n\n### Graph Edge Types\n\n| Relation | Meaning |\n|----------|---------|\n| `IMPORTS` | Code import dependency |\n| `DEFINES` | File defines symbol |\n| `TAGGED_AS` | Section tagged with concept |\n| `CO_OCCURS` | Concepts appear together |\n| `INFERRED` | Claude-extracted semantic relationship |\n| `DESCRIBES` | LLM-enriched semantic edge |\n| `CAUSES` | LLM-enriched semantic edge |\n| `PART_OF` | LLM-enriched semantic edge |\n\n*资料来源：[plugin/commands/monograph/README.md:50-80](https://github.com/monoes/monomind/blob/main/plugin/commands/monograph/README.md)*\n\n### Monograph Configuration\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts\ninterface MonographConfig {\n  root: string;\n  entry: string[];\n  production: boolean;\n  detection: 'default' | 'extended';\n  project?: string;\n  ignore: string[];\n  overrides: OverrideConfig[];\n  regression: RegressionConfig;\n  audit: AuditConfig;\n  normalization: NormalizationConfig;\n  boundaries: BoundaryConfig;\n  resolve: ResolveConfig;\n  health: HealthConfig;\n  ownership: OwnershipConfig;\n  plugins: string[];\n}\n```\n\n### Default Configuration\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts:40-60\nexport const DEFAULT_MONOGRAPH_CONFIG: ResolvedMonographConfig = {\n  root: '.',\n  entry: [],\n  production: true,\n  detection: 'default',\n  project: undefined,\n  ignore: [],\n  overrides: [],\n  regression: { tolerance: 0, baselinePath: '.monograph/regression-baseline.json' },\n  audit: { gate: 'error', includeHealthGate: false },\n  normalization: { \n    stripComments: true, \n    normalizeWhitespace: true, \n    normalizeIdentifiers: false \n  },\n  boundaries: {},\n  resolve: { \n    paths: {}, \n    alias: {}, \n    conditions: [], \n    extensions: ['.ts', '.tsx', '.mts', '.cts'] \n  },\n  health: { \n    cyclomaticThreshold: 10, \n    cognitiveThreshold: 15, \n    crapThreshold: 30, \n    minLines: 5 \n  },\n  ownership: { emailMode: 'fullEmail' },\n  plugins: [],\n};\n```\n\n## MCP Server Architecture\n\n### Server Capabilities\n\n```mermaid\ngraph TB\n    subgraph \"MCP Server\"\n        server[MCP Server<br/>packages/@monomind/mcp/src/server.ts]\n        tools[Tool Handlers]\n        resources[Resource Handlers]\n    end\n\n    subgraph \"Tools\"\n        monograph_tools[Monograph Tools<br/>mcp__monomind__monograph_*]\n        memory_tools[Memory Tools<br/>mcp__monomind__memory_*]\n        agent_tools[Agent Tools<br/>mcp__monomind__agent_*]\n    end\n\n    server --> tools\n    server --> resources\n    tools --> monograph_tools\n    tools --> memory_tools\n    tools --> agent_tools\n```\n\n### MCP Subcommands\n\n| Subcommand | Purpose |\n|------------|---------|\n| `start` | Start MCP server |\n| `stop` | Stop MCP server |\n| `status` | Show server status |\n| `health` | Check server health |\n| `restart` | Restart MCP server |\n| `tools` | List available tools |\n| `toggle` | Enable/disable tools |\n| `exec` | Execute a tool |\n| `logs` | Show server logs |\n\n*资料来源：[packages/@monomind/cli/src/commands/mcp.ts:20-45](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)*\n\n## Neural Learning (SONA)\n\nSelf-Optimizing Neural Adaptation provides:\n\n- **Pattern Recognition**: Improves agent routing over time\n- **Trajectory Tracking**: Identifies what works and what doesn't\n- **Automatic Model Adaptation**: <0.05ms overhead per decision\n\n```mermaid\ngraph LR\n    subgraph \"SONA System\"\n        input[Task Input]\n        pattern[Pattern Recognition]\n        route[Agent Routing]\n        track[Trajectory Tracking]\n        adapt[Model Adaptation]\n        output[Optimized Output]\n    end\n\n    input --> pattern\n    pattern --> route\n    route --> output\n    output --> track\n    track --> adapt\n    adapt --> pattern\n```\n\n## Command Suggestion System\n\nThe CLI includes a fuzzy matching system for typo correction:\n\n```mermaid\ngraph TD\n    input[User Input]\n    input --> levenshtein[Levenshtein Distance]\n    input --> similarity[Similarity Score]\n    levenshtein --> threshold[Threshold Check]\n    similarity --> threshold\n    threshold --> suggestions[Suggestions]\n```\n\n| Component | Function |\n|-----------|----------|\n| `levenshteinDistance` | Calculate edit distance between strings |\n| `similarityScore` | Compute similarity ratio |\n| `findSimilar` | Find commands within similarity threshold |\n| `suggestCommand` | Generate command suggestions |\n| `COMMON_TYPOS` | Predefined typo mappings |\n\n*资料来源：[packages/@monomind/cli/src/suggest.ts:1-80](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/suggest.ts)*\n\n## Data Flow Architecture\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant MCP\n    participant Shared\n    participant Memory\n    participant Monograph\n\n    User->>CLI: Execute command\n    CLI->>MCP: Route to MCP server\n    MCP->>Shared: Core orchestration\n    Shared->>Memory: Store/retrieve\n    Shared->>Monograph: Query graph\n    Memory-->>Shared: Results\n    Monograph-->>Shared: Dependencies\n    Shared-->>MCP: Processed data\n    MCP-->>CLI: Response\n    CLI-->>User: Output\n```\n\n## Extended Configuration\n\nThe Monograph system supports extended configuration for enterprise use:\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts:70-90\nexport interface ExtendedMonographConfig extends MonographConfig {\n  extends?: string[];\n  sealed?: boolean;\n  includeEntryExports?: boolean;\n  publicPackages?: string[];\n  dynamicallyLoaded?: string[];\n  codeowners?: string;\n  ignoreDependencies?: string[];\n  ignoreExportsUsedInFile?: boolean | { \n    interface?: boolean; \n    typeAlias?: boolean \n  };\n  usedClassMembers?: Array<string | { \n    extends?: string[]; \n    implements?: string[]; \n    members: string[] \n  }>;\n  duplicates?: DuplicatesConfig;\n}\n```\n\n## Summary\n\nMonomind's architecture is built on a modular, layered approach:\n\n1. **CLI Layer**: User-facing command interface with subcommands for all major features\n2. **Core Layer**: Shared orchestration logic and MCP protocol implementation\n3. **Capability Layer**: Specialized systems for memory, knowledge graphs, and security\n4. **Agent Layer**: Pluggable agent pool with WASM sandboxing support\n\nThe architecture supports horizontal scaling through agent pooling and vertical optimization through dedicated WASM runtime execution for sensitive operations.\n\n---\n\n<a id='packages-core'></a>\n\n## Core Packages\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n- [packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n- [packages/@monomind/embeddings/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/embeddings/README.md)\n- [packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n- [packages/@monomind/cli/src/init/claudemd-generator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/init/claudemd-generator.ts)\n- [packages/@monomind/aidefence/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/aidefence/README.md)\n</details>\n\n# Core Packages\n\nMonomind is organized as a monorepo with specialized packages that work together to provide AI coordination, memory management, neural learning, and multi-agent orchestration. The core packages form the foundation of this ecosystem, enabling Claude Code and other AI systems to maintain context, learn patterns, and coordinate complex tasks across sessions.\n\n## Architecture Overview\n\n```mermaid\ngraph TD\n    subgraph \"Core Packages\"\n        CLI[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        EMBED[@monomind/embeddings]\n        NEURAL[@monomind/neural]\n        SHARED[@monomind/shared]\n    end\n    \n    CLI --> SHARED\n    MEM --> EMBED\n    HOOKS --> SHARED\n    EMBED --> NEURAL\n    NEURAL --> SHARED\n    \n    CLI --> MEM\n    CLI --> HOOKS\n```\n\nThe core packages follow a layered architecture where the `shared` package provides common utilities and types that all other packages depend on, while specialized packages handle specific concerns like memory storage, embedding generation, neural learning, and command execution.\n\n## @monomind/cli\n\nThe CLI package is the primary command-line interface for Monomind, providing a unified entry point for all operations. It serves as the orchestration layer that coordinates memory, hooks, neural learning, and multi-agent capabilities.\n\n### Command Structure\n\nThe CLI exposes commands organized by functional domain:\n\n| Command | Description | Status |\n|---------|-------------|--------|\n| `agent` | Agent management, metrics, pool, WASM runtime | ✅ Complete |\n| `task` | Task creation, status, list, completion | ✅ Complete |\n| `session` | Session save, restore, list, export/import | ✅ Complete |\n| `config` | Configuration get, set, list, reset | ✅ Complete |\n| `memory` | Store, retrieve, list, delete, search | ✅ Complete |\n| `workflow` | Create, execute, list, status, delete | ✅ Complete |\n| `mcp` | MCP server start, stop, status, tools | ✅ Complete |\n| `neural` | Neural pattern training, MoE, Flash Attention | Advanced |\n| `security` | Security scanning, CVE detection, threat modeling | Advanced |\n| `performance` | Performance profiling, benchmarking | Advanced |\n| `providers` | AI provider management, models, configurations | Advanced |\n| `plugins` | Plugin management, installation, lifecycle | Advanced |\n| `deployment` | Deployment management, environments, rollbacks | Advanced |\n| `claims` | Claims-based authorization, access control | Advanced |\n| `embeddings` | Embedding management, models, cache | Advanced |\n\n资料来源：[packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n\n### CLAUDE.md Generation\n\nThe CLI includes a sophisticated CLAUDE.md generator that creates project-specific configuration files for Claude Code. The generator supports multiple templates with varying levels of detail:\n\n```typescript\nexport const CLAUDE_MD_TEMPLATES: Array<{ name: ClaudeMdTemplate; description: string }> = [\n  { name: 'minimal', description: 'Quick start — behavioral rules, anti-drift' },\n  { name: 'standard', description: 'Full documentation with all sections' },\n  { name: 'full', description: 'Complete including hooks and learning' },\n  { name: 'security', description: 'Security-focused template' },\n  { name: 'performance', description: 'Performance-optimized template' },\n  { name: 'solo', description: 'Single-agent workflow template' }\n];\n```\n\nEach template includes different combinations of sections such as behavioral rules, coding principles, file organization, project architecture, build and test instructions, security rules, concurrency rules, swarm orchestration, and intelligence system configuration.\n\n资料来源：[packages/@monomind/cli/src/init/claudemd-generator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/init/claudemd-generator.ts)\n\n### Session Management\n\nThe session command provides comprehensive session state management:\n\n```bash\nmonomind session list      # List all saved sessions\nmonomind session save      # Save current session state\nmonomind session restore   # Restore a saved session\nmonomind session delete    # Delete a saved session\nmonomind session export    # Export session to file\nmonomind session import    # Import session from file\nmonomind session current   # Show current active session\n```\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n\n### Agent Capabilities\n\nThe CLI supports multiple agent types, each with specialized capabilities:\n\n| Agent Type | Capabilities |\n|------------|--------------|\n| `coder` | code-generation, refactoring, debugging, testing |\n| `researcher` | web-search, data-analysis, summarization, citation |\n| `tester` | unit-testing, integration-testing, coverage-analysis |\n| `reviewer` | code-review, security-audit, quality-check |\n| `architect` | system-design, pattern-analysis, scalability |\n| `coordinator` | task-orchestration, agent-management, workflow-control |\n| `security-architect` | threat-modeling, security-patterns, compliance |\n| `memory-specialist` | vector-search, agentdb, caching, optimization |\n| `performance-engineer` | profiling, benchmarking, optimization |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n\n### MCP Server Management\n\n```bash\nmonomind mcp start     # Start MCP server\nmonomind mcp stop      # Stop MCP server\nmonomind mcp status    # Show server status\nmonomind mcp health    # Check server health\nmonomind mcp restart   # Restart MCP server\nmonomind mcp tools     # List available tools\nmonomind mcp toggle    # Enable/disable tools\nmonomind mcp exec      # Execute a tool\nmonomind mcp logs      # Show server logs\n```\n\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n\n## @monomind/memory\n\nThe memory package provides a sophisticated memory system for AI agents, combining structured storage with semantic vector search capabilities.\n\n### HybridBackend Architecture\n\nThe memory system uses a HybridBackend that combines SQLite for structured data with AgentDB for semantic search:\n\n```typescript\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  // A-MEM auto-linking is automatically active when embeddingGenerator is set\n});\n```\n\n资料来源：[packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n\n### A-MEM Auto-Linking\n\nWhen configured with an embedding generator, the HybridBackend implements A-MEM (arxiv:2409.11987) auto-linking. Every stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional references edges, implementing the Zettelkasten note-linking structure.\n\n### Agent Memory Scopes\n\nThe memory system supports multiple scope levels for different use cases:\n\n| Scope | Path | Use Case |\n|-------|------|----------|\n| `system` | `<gitRoot>/.claude/agent-memory-system/<agent>/` | System-wide learnings |\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n### Memory Utilities\n\n```typescript\nimport {\n  resolveAgentMemoryDir,  // Get scope directory path\n  createAgentBridge,       // Create scoped AutoMemoryBridge\n  transferKnowledge,       // Cross-agent knowledge sharing\n  listAgentScopes,         // Discover existing agent scopes\n} from '@monomind/memory';\n\n// Resolve path for an agent scope\nconst dir = resolveAgentMemoryDir('my-agent', 'project');\n// → /workspaces/my-project/.claude/agent-memory/my-agent/\n\n// List all agent scopes in a directory\nconst scopes = await listAgentScopes('/workspaces/my-project');\n```\n\n资料来源：[packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n\n### Memory Commands\n\n```bash\nmonomind memory init         # Initialize memory database (sql.js)\nmonomind memory store        # Store data in memory\nmonomind memory edit         # Edit an entry\nmonomind memory retrieve     # Retrieve data from memory\nmonomind memory search       # Semantic/vector search\nmonomind memory list         # List memory entries\nmonomind memory delete       # Delete an entry\nmonomind memory templates    # Show best-practice entry templates\nmonomind memory stats        # Show statistics\nmonomind memory configure    # Configure backend\nmonomind memory cleanup      # Clean expired entries\nmonomind memory compress     # Compress database\nmonomind memory export       # Export memory to file\nmonomind memory import       # Import from file\n```\n\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/memory.ts)\n\n## @monomind/hooks\n\nThe hooks package provides an event-driven system for extending and customizing Monomind behavior.\n\n### Hook Configuration\n\nHooks are configured in `monomind.config.json` with support for both external scripts and built-in commands:\n\n```json\n{\n  \"hooks\": {\n    \"preCommand\": \"/path/to/pre-command-hook.sh\",\n    \"postCommand\": \"/path/to/post-command-hook.sh\"\n  },\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"statusline\"\n  }\n}\n```\n\n资料来源：[packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n\n### Hook Types\n\n| Hook Type | Purpose | Trigger Point |\n|-----------|---------|---------------|\n| `preCommand` | Run before command execution | Before any CLI command |\n| `postCommand` | Run after command execution | After any CLI command |\n| `statusLine` | Custom status display | During active sessions |\n| `preAgent` | Pre-processing for agent tasks | Before agent dispatch |\n| `postAgent` | Post-processing for agent results | After agent completion |\n\n### Package Dependencies\n\nThe hooks system depends on and integrates with:\n\n- `@monomind/shared` - Shared utilities and types\n- `@monomind/neural` - Neural network and SONA learning\n- `@monomind/swarm` - Multi-agent coordination\n- `@monomind/memory` - AgentDB memory system\n\n资料来源：[packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n\n## @monomind/embeddings\n\nThe embeddings package provides embedding generation, caching, and transformation capabilities.\n\n### Features\n\n| Feature | Description |\n|---------|-------------|\n| Persistent Cache | SQLite-based cache with configurable TTL (default: 30 days) |\n| Normalization | L2 normalization for consistent vector comparisons |\n| Hyperbolic Conversion | Transform embeddings to Poincaré ball model |\n| Neural Operations | Drift detection, storage, and recall |\n\n### Cache Configuration\n\n```typescript\nconst service = createEmbeddingService({\n  provider: \"openai\",\n  apiKey: process.env.OPENAI_API_KEY!,\n  persistentCache: {\n    enabled: true,\n    dbPath: \"./cache/embeddings.db\",\n    maxSize: 50000,\n    ttlMs: 30 * 24 * 60 * 60 * 1000, // 30 days\n  },\n  normalization: \"l2\",\n});\n```\n\n### Embeddings CLI Commands\n\n```bash\n# Document chunking\nmonomind embeddings chunk document.txt --strategy sentence --max-size 512\n\n# Normalize embedding file\nmonomind embeddings normalize embeddings.json --type l2 -o normalized.json\n\n# Convert to hyperbolic\nmonomind embeddings hyperbolic embeddings.json -o poincare.json\n\n# Neural operations\nmonomind embeddings neural drift --baseline \"context\" --input \"check this\"\nmonomind embeddings neural store --id mem-1 --content \"data\"\nmonomind embeddings neural recall \"query\" --top-k 5\n\n# List/download models\nmonomind embeddings models list\nmonomind embeddings models download all-MiniLM-L6-v2\n\n# Cache management\nmonomind embeddings cache stats\nmonomind embeddings cache clear --older-than 7d\n```\n\n资料来源：[packages/@monomind/embeddings/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/embeddings/README.md)\n\n### Related Packages\n\n- `@monomind/memory` - HNSW indexing and vector storage\n- `@monomind/providers` - Multi-LLM provider system\n- `@monomind/neural` - SONA learning system\n\n## @monomind/aidefence\n\nThe aidefence package provides security and AI safety features for the Monomind ecosystem.\n\n### Capabilities\n\nThe package includes patterns for detecting and preventing various security issues and inappropriate AI behaviors. It integrates with the CLI for security scanning operations.\n\n### Related Packages\n\n- `@monomind/cli` - CLI with security commands\n- `agentdb` - HNSW vector database\n- `monomind` - Full AI coordination system\n\n资料来源：[packages/@monomind/aidefence/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/aidefence/README.md)\n\n## @monomind/shared\n\nThe shared package contains common utilities, types, and interfaces used across all Monomind packages.\n\n### Responsibilities\n\n- Type definitions shared across packages\n- Common utility functions\n- Interface contracts for package integration\n- Configuration schemas and validation\n\n### Dependencies\n\nOther core packages depend on `@monomind/shared` for common functionality, ensuring consistent types and utilities across the ecosystem.\n\n## Package Relationships\n\n```mermaid\ngraph TD\n    CLI -->|depends on| SHARED\n    MEM -->|depends on| SHARED\n    HOOKS -->|depends on| SHARED\n    EMBED -->|depends on| NEURAL\n    NEURAL -->|depends on| SHARED\n    \n    CLI -->|coordinates| MEM\n    CLI -->|coordinates| HOOKS\n    CLI -->|uses| EMBED\n    \n    MEM -->|uses| EMBED\n    \n    subgraph \"Core Packages\"\n        CLI[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        EMBED[@monomind/embeddings]\n        NEURAL[@monomind/neural]\n        SHARED[@monomind/shared]\n    end\n```\n\n## Installation and Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/monoes/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run health check and auto-fix\nmonomind doctor --fix\n```\n\n## Development Workflow\n\nThe monorepo uses pnpm workspaces with the following structure:\n\n```\nmonomind/\n├── packages/\n│   ├── @monomind/\n│   │   ├── cli/\n│   │   ├── memory/\n│   │   ├── hooks/\n│   │   ├── embeddings/\n│   │   ├── neural/\n│   │   ├── shared/\n│   │   ├── aidefence/\n│   │   └── ...\n│   ├── plugins/\n│   └── implementation/\n```\n\n## Version Compatibility\n\nThe Monomind packages follow semantic versioning with alpha releases for new features. The current CLI version is `@monomind/cli@3.0.0-alpha.11` (2026-01-07) with complete support for all core commands including session, task, config, memory, and workflow management.\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n---\n\n<a id='agent-catalog'></a>\n\n## Agent Catalog\n\n### 相关页面\n\n相关主题：[Agent Routing System](#agent-routing), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/agent-wasm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)\n- [packages/@monomind/cli/src/agents/registry-builder.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/agents/registry-builder.ts)\n- [packages/@monomind/cli/src/agents/managed-agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/agents/managed-agent.ts)\n- [packages/@monomind/swarm/src/workers/worker-dispatch.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/workers/worker-dispatch.ts)\n</details>\n\n# Agent Catalog\n\n## Overview\n\nThe Agent Catalog is a comprehensive system within Monomind that manages, organizes, and provides access to a diverse collection of specialized AI agents. It serves as the central registry and management hub for all agent types, capabilities, and configurations within the platform.\n\nThe catalog provides:\n- A unified registry of agent types with their specific capabilities\n- Dynamic agent management including creation, monitoring, and lifecycle control\n- WASM-based sandboxed agent execution\n- Worker dispatch and trigger configurations for autonomous task handling\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:1-50]()\n\n## Agent Types and Capabilities\n\nMonomind's Agent Catalog defines multiple specialized agent types, each with distinct capabilities optimized for specific tasks.\n\n### Core Agent Types\n\n| Agent Type | Capabilities | Primary Use Case |\n|------------|--------------|------------------|\n| `coder` | code-generation, refactoring, debugging, testing | Software development tasks |\n| `researcher` | web-search, data-analysis, summarization, citation | Information gathering and analysis |\n| `tester` | unit-testing, integration-testing, coverage-analysis, automation | Quality assurance |\n| `reviewer` | code-review, security-audit, quality-check, documentation | Code inspection and review |\n| `architect` | system-design, pattern-analysis, scalability, documentation | System architecture planning |\n| `coordinator` | task-orchestration, agent-management, workflow-control | Multi-agent coordination |\n| `security-architect` | threat-modeling, security-patterns, compliance, audit | Security-focused design |\n| `memory-specialist` | vector-search, agentdb, caching, optimization | Memory and knowledge management |\n| `performance-engineer` | performance-analysis, optimization, benchmarking, profiling | Performance tuning |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:45-80]()\n\n### Agent Commands\n\nThe CLI provides several commands for agent management:\n\n```bash\nmonomind agent <subcommand>\n\nSubcommands:\n  metrics      - Show agent metrics\n  pool         - Manage agent pool\n  health       - Show agent health\n  logs         - Show agent logs\n  wasm-status  - Check WASM runtime availability\n  wasm-create  - Create a WASM-sandboxed agent\n  wasm-prompt  - Send a prompt to a WASM agent\n  wasm-gallery - List WASM agent gallery templates\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:20-30]()\n\n## Agent Registry System\n\nThe Agent Registry is the core component that maintains agent definitions, configurations, and metadata.\n\n### Registry Architecture\n\n```mermaid\ngraph TD\n    A[Agent Request] --> B[Registry Builder]\n    B --> C[Agent Registry]\n    C --> D[Agent Type Resolution]\n    D --> E[Managed Agent Instance]\n    E --> F[Execution Context]\n    F --> G[Response/Metrics]\n```\n\n### Registry Builder\n\nThe `RegistryBuilder` class constructs and manages the agent registry, providing methods to register, retrieve, and manage agent configurations.\n\n**Key Responsibilities:**\n- Build agent registry from configuration sources\n- Validate agent type definitions\n- Provide lookup and discovery mechanisms\n- Support dynamic agent registration\n\n资料来源：[packages/@monomind/cli/src/agents/registry-builder.ts:1-50]()\n\n## Managed Agents\n\nManaged Agents provide a structured runtime environment for agent execution with integrated lifecycle management, monitoring, and resource allocation.\n\n### Managed Agent Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> Initializing\n    Initializing --> Ready: Initialization Complete\n    Ready --> Running: Task Assigned\n    Running --> Ready: Task Complete\n    Running --> Paused: Suspend Request\n    Paused --> Running: Resume Request\n    Ready --> Terminated: Shutdown\n    Running --> Terminated: Force Shutdown\n    Terminated --> [*]\n```\n\n### Agent Management Features\n\n| Feature | Description |\n|---------|-------------|\n| Lifecycle Control | Start, pause, resume, and terminate agents |\n| Health Monitoring | Track agent health status and metrics |\n| Pool Management | Manage agent pools for scaling |\n| Log Aggregation | Collect and store agent execution logs |\n| Resource Allocation | Assign CPU, memory, and execution quotas |\n\n资料来源：[packages/@monomind/cli/src/agents/managed-agent.ts:1-60]()\n\n## WASM Agent Gallery\n\nThe WASM Agent system provides sandboxed agent execution using WebAssembly, offering enhanced security and portability.\n\n### WASM Agent Commands\n\n```bash\n# Check WASM runtime status\nmonomind agent wasm-status\n\n# List available templates\nmonomind agent wasm-gallery\n\n# Create a new WASM agent\nmonomind agent wasm-create -t <template-id>\n\n# Send prompt to WASM agent\nmonomind agent wasm-prompt <agent-id> <prompt>\n```\n\n### Gallery Template Structure\n\nTemplates in the gallery include:\n- **id**: Unique template identifier\n- **name**: Human-readable name\n- **category**: Template category (coding, research, security, etc.)\n- **description**: Brief description of capabilities\n- **version**: Template version\n\n```typescript\ninterface WASMTemplate {\n  id: string;\n  name: string;\n  category: string;\n  description: string;\n  version: string;\n}\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent-wasm.ts:1-80]()\n\n## Worker Dispatch System\n\nThe Agent Catalog integrates with a worker dispatch system for autonomous task handling based on trigger patterns.\n\n### Trigger Categories\n\n| Category | Trigger Patterns | Priority |\n|----------|------------------|----------|\n| `codebase` | explore codebase, project structure, dependency graph | high |\n| `preload` | preload, cache ahead, prefetch, warm cache | normal |\n| `deepdive` | deep dive, analyze thoroughly, in-depth analysis | normal |\n| `document` | document, generate docs, add documentation, write readme | low |\n| `refactor` | refactor, clean up code, improve code quality | normal |\n| `benchmark` | benchmark, performance test, measure speed | normal |\n| `testgaps` | test coverage, missing tests, untested code | normal |\n\n### Trigger Configuration\n\n```typescript\nconst TRIGGER_CONFIGS = {\n  ultralearn: {\n    description: 'Deep knowledge acquisition and learning',\n    priority: 'normal',\n  },\n  preload: {\n    description: 'Resource preloading for faster access',\n    priority: 'normal',\n  },\n  deepdive: {\n    description: 'Thorough code analysis',\n    priority: 'normal',\n  },\n  document: {\n    description: 'Documentation generation',\n    priority: 'low',\n  },\n  refactor: {\n    description: 'Code refactoring suggestions',\n    priority: 'normal',\n  },\n  benchmark: {\n    description: 'Performance benchmarking',\n    priority: 'normal',\n  },\n  testgaps: {\n    description: 'Test coverage analysis',\n    priority: 'normal',\n  },\n};\n```\n\n资料来源：[packages/@monomind/swarm/src/workers/worker-dispatch.ts:1-100]()\n\n## Agent Pool Management\n\nThe Agent Catalog supports managing pools of agents for scalable task processing.\n\n### Pool Operations\n\n```bash\n# View pool status\nmonomind agent pool status\n\n# Scale pool\nmonomind agent pool scale <agent-type> <count>\n\n# Release idle agents\nmonomind agent pool cleanup\n```\n\n### Pool Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `minSize` | number | 1 | Minimum pool size |\n| `maxSize` | number | 10 | Maximum pool size |\n| `idleTimeout` | number | 300000 | Idle timeout in milliseconds |\n| `scaleUpThreshold` | number | 0.8 | Scale up utilization threshold |\n| `scaleDownThreshold` | number | 0.2 | Scale down utilization threshold |\n\n## Health Monitoring\n\nAgents in the catalog are continuously monitored for health status.\n\n### Health Check Response\n\n```typescript\ninterface HealthCheckResponse {\n  status: 'healthy' | 'degraded' | 'unhealthy';\n  agentId: string;\n  uptime: number;\n  lastTask: string;\n  metrics: {\n    cpu: number;\n    memory: number;\n    tasksCompleted: number;\n    errors: number;\n  };\n}\n```\n\n### CLI Health Command\n\n```bash\nmonomind agent health <agent-id>\n```\n\n## CLI Integration\n\nThe Agent Catalog is accessible through the Monomind CLI with the following command structure:\n\n```bash\nmonomind agent <command> [options]\n```\n\n### Available Commands Summary\n\n| Command | Description |\n|---------|-------------|\n| `metrics` | Display agent performance metrics |\n| `pool` | Manage agent pool operations |\n| `health` | Show agent health status |\n| `logs` | Display agent execution logs |\n| `wasm-status` | Check WASM runtime availability |\n| `wasm-create` | Create new WASM-sandboxed agent |\n| `wasm-prompt` | Send prompt to WASM agent |\n| `wasm-gallery` | List available WASM templates |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:15-35]()\n\n## See Also\n\n- [Memory System](../memory/) - Vector memory and knowledge storage\n- [Hooks System](../hooks/) - Intelligent automation hooks\n- [Monograph](../monograph/) - Knowledge graph analysis\n- [Swarm Orchestration](../swarm/) - Multi-agent coordination\n\n---\n\n<a id='agent-routing'></a>\n\n## Agent Routing System\n\n### 相关页面\n\n相关主题：[Agent Catalog](#agent-catalog), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/routing/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/index.ts)\n- [packages/@monomind/routing/src/route-layer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/route-layer.ts)\n- [packages/@monomind/routing/src/capability-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/capability-index.ts)\n- [packages/@monomind/routing/src/llm-fallback.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/llm-fallback.ts)\n- [packages/@monomind/routing/src/routes/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/routes/index.ts)\n- [packages/@monomind/cli/src/commands/guidance.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/guidance.ts)\n- [packages/@monomind/cli/src/mcp-tools/guidance-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/guidance-tools.ts)\n</details>\n\n# Agent Routing System\n\n## Overview\n\nThe Agent Routing System is a core subsystem within Monomind that intelligently directs tasks to the most appropriate specialized agent based on task characteristics, agent capabilities, historical performance, and contextual information. It serves as the orchestration brain that enables multi-agent coordination across the entire platform.\n\nThe routing system operates with dual-mode intelligence:\n\n- **LLM-powered routing** for complex task understanding: <2s response time\n- **Keyword-based fallback** for rapid classification: <5ms response time\n\n资料来源：[README.md](https://github.com/monoes/monomind/blob/main/README.md)\n\n## Architecture\n\nThe routing system follows a layered architecture that separates concerns between capability matching, route resolution, and intelligence fallback mechanisms.\n\n```mermaid\ngraph TD\n    A[Task Input] --> B[Route Layer]\n    B --> C{Capability Index Match?}\n    C -->|High Confidence| D[Direct Route]\n    C -->|Low Confidence| E[LLM Fallback]\n    C -->|Exact Match| F[Keyword Fallback]\n    E --> G[Seraphine Routing Patterns]\n    G --> H[Agent Spawn]\n    D --> H\n    F --> H\n```\n\n### Core Components\n\n| Component | Location | Responsibility |\n|-----------|----------|----------------|\n| Route Layer | `packages/@monomind/routing/src/route-layer.ts` | Central orchestration, request dispatch |\n| Capability Index | `packages/@monomind/routing/src/capability-index.ts` | Agent capability registry and matching |\n| LLM Fallback | `packages/@monomind/routing/src/llm-fallback.ts` | Semantic routing via LLM inference |\n| Routing Patterns | `packages/@monomind/cli/src/transfer/models/seraphine.ts` | Predefined task-to-agent mappings |\n| Guidance Commands | `packages/@monomind/cli/src/commands/guidance.ts` | CLI integration layer |\n| MCP Tools | `packages/@monomind/cli/src/mcp-tools/guidance-tools.ts` | Model Context Protocol integration |\n\n资料来源：[packages/@monomind/routing/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/index.ts)\n\n## Routing Pattern System\n\n### Seraphine Routing Patterns\n\nThe system defines comprehensive routing patterns through the `SERAPHINE_ROUTING_PATTERNS` array. Each pattern contains:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `id` | string | Unique pattern identifier |\n| `trigger` | string | Regex or keyword pattern for task matching |\n| `action` | string | Command to execute (e.g., \"spawn coder agent\") |\n| `confidence` | number | Base confidence score (0-1) |\n| `usageCount` | number | Historical execution count |\n| `successRate` | number | Historical success rate (0-1) |\n| `context` | object | Additional metadata (category, priority) |\n\n资料来源：[packages/@monomind/cli/src/transfer/models/seraphine.ts:15-80](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/transfer/models/seraphine.ts)\n\n### Default Routing Patterns\n\n| Pattern ID | Trigger Keywords | Action | Confidence | Success Rate |\n|------------|------------------|--------|------------|--------------|\n| `route-code-to-coder` | implement, code, write, create function, build feature | Spawn coder agent | 0.95 | 0.92 |\n| `route-test-to-tester` | test, validate, verify, check, ensure quality | Spawn tester agent | 0.93 | 0.89 |\n| `route-review-to-reviewer` | review, audit, analyze code, check security | Spawn reviewer agent | 0.91 | 0.87 |\n| `route-research-to-researcher` | research, investigate, explore, find, search codebase | Spawn researcher agent | 0.94 | 0.88 |\n\n资料来源：[packages/@monomind/cli/src/transfer/models/seraphine.ts:25-70](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/transfer/models/seraphine.ts)\n\n## Capability Index\n\nThe Capability Index maintains a registry of all available agents and their documented capabilities, enabling efficient matching between incoming tasks and suitable agents.\n\n### Data Model\n\n```typescript\ninterface CapabilityEntry {\n  agentType: string;\n  capabilities: string[];\n  specializations: string[];\n  supportedLanguages: string[];\n  framework: string;\n  lastUpdated: Date;\n}\n```\n\n### Matching Algorithm\n\n1. **Exact Match**: Task keywords directly match capability keywords\n2. **Fuzzy Match**: LLM-based semantic similarity scoring\n3. **Fallback Match**: Keyword-based pattern matching with reduced confidence\n\n资料来源：[packages/@monomind/routing/src/capability-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/capability-index.ts)\n\n## LLM Fallback System\n\nWhen the capability index cannot confidently match a task, the system escalates to LLM-powered routing. This module handles the fallback mechanism.\n\n### Configuration Parameters\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| `timeout` | 2000ms | Maximum time for LLM inference |\n| `maxRetries` | 3 | Retry attempts on failure |\n| `confidenceThreshold` | 0.7 | Minimum confidence to accept LLM decision |\n| `fallbackToKeyword` | true | Enable keyword fallback on LLM failure |\n\n### Workflow\n\n```mermaid\ngraph LR\n    A[Task] --> B{Confidence >= Threshold?}\n    B -->|Yes| C[Return Route]\n    B -->|No| D[LLM Inference]\n    D --> E{Result Valid?}\n    E -->|Yes| F[Update Patterns]\n    E -->|No| G[Keyword Fallback]\n    F --> C\n    G --> H[Default Agent]\n```\n\n资料来源：[packages/@monomind/routing/src/llm-fallback.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/llm-fallback.ts)\n\n## CLI Integration\n\n### Route Command\n\n```bash\n# Basic routing\nmonomind hooks route --task \"fix bug\"\n\n# Q-Learning enhanced routing (requires ruvector)\nmonomind route \"task\" --q-learning\n\n# Coverage-aware routing\nmonomind route \"task\" --coverage-aware\n```\n\n### Guidance Commands\n\nThe guidance subsystem provides additional routing intelligence through CLI commands:\n\n```bash\n# Display guidance help\nmonomind guidance --help\n\n# Show routing status\nmonomind guidance status\n\n# Analyze task complexity\nmonomind guidance analyze --task \"implement webhook retry logic\"\n```\n\n资料来源：[packages/@monomind/cli/src/commands/guidance.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/guidance.ts)\n\n## MCP Tools Integration\n\nThe routing system exposes functionality through the Model Context Protocol (MCP), enabling programmatic access for external integrations.\n\n### Available Tools\n\n| Tool | Handler | Description |\n|------|---------|-------------|\n| `hooks/route` | `routeTool.handler` | Execute task routing with explanation |\n| `hooks/routeWithContext` | `routeWithContextTool.handler` | Route with additional context |\n| `guidance/analyze` | `analyzeTool.handler` | Analyze task complexity |\n\n### Usage Example\n\n```typescript\nimport { hooksMCPTools, getHooksTool } from '@monomind/hooks';\n\nconst routeTool = getHooksTool('hooks/route');\nconst result = await routeTool.handler({\n  task: 'Implement user authentication',\n  includeExplanation: true,\n});\n\nconsole.log(`Recommended agent: ${result.recommendedAgent}`);\nconsole.log(`Confidence: ${result.confidence}%`);\n```\n\n资料来源：[packages/@monomind/cli/src/mcp-tools/guidance-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/guidance-tools.ts)\n\n## Advanced Routing Features\n\n### Q-Learning Router (ruvector Integration)\n\nFor production environments requiring advanced routing decisions, the system integrates with ruvector for Q-learning-based agent selection:\n\n- Learns from historical routing decisions\n- Optimizes for task completion rate\n- Adapts to team-specific patterns\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n### Coverage-Aware Routing\n\nRoutes tasks based on code coverage analysis, directing work to agents with relevant file expertise:\n\n```bash\nmonomind route \"task\" --coverage-aware\n```\n\n### AST Analysis Routing\n\nFor code modification tasks, the routing system can leverage AST (Abstract Syntax Tree) analysis to match agents with expertise in the relevant code structure:\n\n```bash\nmonomind analyze ast src/\n```\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n## Performance Characteristics\n\n| Metric | Value | Mode |\n|--------|-------|------|\n| Agent routing (LLM) | <2s | Full semantic understanding |\n| Agent routing (keyword) | <5ms | Pattern matching fallback |\n| Pattern lookup | <1ms | In-memory index |\n| Capability matching | <2ms | Optimized trie search |\n\n资料来源：[README.md](https://github.com/monoes/monomind/blob/main/README.md)\n\n## Extending the Routing System\n\n### Adding Custom Patterns\n\nTo extend routing capabilities, add new patterns to the Seraphine configuration:\n\n```typescript\nimport { SERAPHINE_ROUTING_PATTERNS } from './models/seraphine';\n\nconst customPattern: RoutingPattern = {\n  id: 'route-custom-task',\n  trigger: 'your-trigger-keywords',\n  action: 'spawn your-agent',\n  confidence: 0.85,\n  usageCount: 0,\n  successRate: 0.0,\n  context: {\n    category: 'custom',\n    priority: 'medium',\n  },\n};\n\nSERAPHINE_ROUTING_PATTERNS.push(customPattern);\n```\n\n### Custom Capability Index\n\nFor specialized agent registries:\n\n```typescript\nimport { CapabilityIndex } from '@monomind/routing';\n\nconst customIndex = new CapabilityIndex({\n  includeBuiltIn: true,\n  customAgents: [...],\n  scoringWeights: {\n    keyword: 0.4,\n    semantic: 0.4,\n    historical: 0.2,\n  },\n});\n```\n\n## Summary\n\nThe Agent Routing System provides intelligent, adaptive task-to-agent matching through a multi-tier architecture:\n\n1. **Capability Index** for fast, accurate matching of known patterns\n2. **LLM Fallback** for semantic understanding of novel tasks\n3. **Keyword Fallback** for guaranteed routing with minimal latency\n4. **Seraphine Patterns** for configurable, business-specific routing rules\n5. **MCP Integration** for programmatic and external system access\n\nThis design ensures the routing system scales from simple keyword matching to complex semantic analysis while maintaining predictable performance characteristics.\n\n---\n\n<a id='swarm-topologies'></a>\n\n## Swarm Topologies\n\n### 相关页面\n\n相关主题：[Consensus Protocols](#consensus-protocols), [Agent Catalog](#agent-catalog)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/swarm/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/index.ts)\n- [packages/@monomind/swarm/src/unified-coordinator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/unified-coordinator.ts)\n- [packages/@monomind/swarm/src/attention-coordinator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/attention-coordinator.ts)\n- [packages/@monomind/swarm/src/coordination/swarm-hub.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/coordination/swarm-hub.ts)\n- [packages/@monomind/swarm/src/coordination/task-orchestrator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/coordination/task-orchestrator.ts)\n- [packages/@monomind/swarm/src/topology-manager.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/topology-manager.ts)\n- [packages/@monomind/cli/src/commands/swarm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/swarm.ts)\n- [packages/@monomind/cli/src/swarm/communication-graph.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/swarm/communication-graph.ts)\n- [packages/@monomind/cli/src/swarm/flow-enforcer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/swarm/flow-enforcer.ts)\n</details>\n\n# Swarm Topologies\n\n## Overview\n\nSwarm Topologies define the structural organization and communication patterns between agents in the Monomind multi-agent orchestration system. These topologies determine how agents connect, collaborate, share information, and coordinate tasks within a swarm.\n\nThe topology system provides flexible, pluggable architectures that can adapt to different task requirements—from simple linear workflows to complex hierarchical structures with consensus-based decision making.\n\n资料来源：[packages/@monomind/swarm/src/topology-manager.ts]()\n\n## Architecture Overview\n\n### Core Topology Components\n\nThe swarm topology system consists of several interconnected components:\n\n```mermaid\ngraph TD\n    TM[Topology Manager] --> SH[Swarm Hub]\n    TM --> TO[Task Orchestrator]\n    TM --> AC[Attention Coordinator]\n    TM --> UC[Unified Coordinator]\n    \n    SH --> CG[Communication Graph]\n    SH --> FE[Flow Enforcer]\n    \n    TO --> Agents[Agent Pool]\n    AC --> Memory[Memory System]\n    UC --> Hooks[Hooks System]\n```\n\n### Component Responsibilities\n\n| Component | Purpose |\n|-----------|---------|\n| **Topology Manager** | Central registry and factory for managing different topology types |\n| **Swarm Hub** | Central coordination point for inter-agent communication |\n| **Task Orchestrator** | Manages task distribution and workflow execution |\n| **Attention Coordinator** | Manages agent focus and priority-based task routing |\n| **Unified Coordinator** | Provides unified interface for all coordination operations |\n| **Communication Graph** | Tracks and enforces communication patterns between agents |\n| **Flow Enforcer** | Validates and enforces workflow constraints |\n\n资料来源：[packages/@monomind/swarm/src/coordination/swarm-hub.ts]()\n资料来源：[packages/@monomind/swarm/src/coordination/task-orchestrator.ts]()\n\n## Topology Types\n\n### Linear Topology (Pipeline)\n\nAgents are arranged in a sequential chain where output from one agent becomes input for the next. Best suited for tasks requiring strict sequential processing.\n\n```mermaid\ngraph LR\n    A[Agent 1] --> B[Agent 2]\n    B --> C[Agent 3]\n    C --> D[Agent 4]\n```\n\n### Hierarchical Topology\n\nAgents are organized in parent-child relationships with clear authority chains. Specialized sub-agents report to coordinator agents.\n\n```mermaid\ngraph TD\n    Root[Root Coordinator]\n    Root --> C1[Coordinator 1]\n    Root --> C2[Coordinator 2]\n    C1 --> S1[Specialist 1.1]\n    C1 --> S2[Specialist 1.2]\n    C2 --> S3[Specialist 2.1]\n    C2 --> S4[Specialist 2.2]\n```\n\n### Mesh Topology\n\nAgents can communicate directly with any other agent. Provides maximum flexibility but requires careful flow enforcement.\n\n```mermaid\ngraph TD\n    A[Agent A] <--> B[Agent B]\n    A <--> C[Agent C]\n    A <--> D[Agent D]\n    B <--> C\n    B <--> D\n    C <--> D\n```\n\n### Star Topology\n\nA central coordinator agent mediates all communication. All other agents communicate exclusively through the hub.\n\n```mermaid\ngraph TD\n    Hub[Central Hub]\n    Hub --> A[Agent A]\n    Hub --> B[Agent B]\n    Hub --> C[Agent C]\n    Hub --> D[Agent D]\n```\n\n### Hive-Mind Topology\n\nDistributed consensus-based topology where agents share a collective decision-making mechanism. All agents contribute to decisions through weighted voting or consensus algorithms.\n\n资料来源：[packages/implementation/adrs/README.md]()\n资料来源：[packages/@monomind/cli/src/commands/swarm.ts]()\n\n## Swarm Hub\n\nThe Swarm Hub serves as the central orchestration point for the swarm topology. It manages:\n\n### Communication Management\n\n- Agent registration and deregistration\n- Message routing between agents\n- Broadcasting messages to agent groups\n- Direct agent-to-agent communication channels\n\n```typescript\ninterface HubConfig {\n  topology: TopologyType;\n  maxAgents: number;\n  communicationGraph: CommunicationGraph;\n  flowEnforcer: FlowEnforcer;\n}\n```\n\n### Flow Enforcement\n\nThe Flow Enforcer component validates that communications follow the defined topology constraints:\n\n```typescript\ninterface FlowEnforcer {\n  validateConnection(source: AgentId, target: AgentId): boolean;\n  enforceDirection(agent: AgentId, direction: 'upstream' | 'downstream'): boolean;\n  validateMessageFlow(message: Message): ValidationResult;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/coordination/swarm-hub.ts]()\n资料来源：[packages/@monomind/cli/src/swarm/flow-enforcer.ts]()\n\n## Communication Graph\n\nThe Communication Graph tracks the relationships and communication patterns between agents within the topology.\n\n### Graph Structure\n\n```typescript\ninterface CommunicationNode {\n  agentId: AgentId;\n  role: AgentRole;\n  connections: Connection[];\n  metrics: AgentMetrics;\n}\n\ninterface Connection {\n  target: AgentId;\n  type: ConnectionType; // 'direct' | 'mediated' | 'broadcast'\n  weight: number;\n  lastActivity: Timestamp;\n}\n```\n\n### Graph Operations\n\n| Operation | Description |\n|-----------|-------------|\n| `addNode(agent)` | Register new agent in the graph |\n| `removeNode(agentId)` | Unregister agent and update connections |\n| `addEdge(source, target, type)` | Create communication link |\n| `removeEdge(source, target)` | Remove communication link |\n| `getPath(source, target)` | Find shortest communication path |\n| `getNeighbors(agentId)` | Get all connected agents |\n\n资料来源：[packages/@monomind/cli/src/swarm/communication-graph.ts]()\n\n## Task Orchestration\n\nThe Task Orchestrator distributes and manages tasks across the topology based on the current topology structure.\n\n### Task Distribution Strategies\n\n| Strategy | Topology Suitability | Description |\n|----------|---------------------|-------------|\n| **Sequential** | Linear, Pipeline | Tasks flow through agents in order |\n| **Parallel** | Mesh, Star | Tasks distributed to multiple agents simultaneously |\n| **Hierarchical** | Hierarchical | Tasks delegated down the authority chain |\n| **Broadcast** | Star, Mesh | Tasks sent to all relevant agents |\n| **Consensus** | Hive-Mind | Tasks require collective approval |\n\n### Task Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> Pending: Task Created\n    Pending --> Assigned: Orchestrator Routes\n    Assigned --> InProgress: Agent Accepts\n    InProgress --> Completed: Execution Done\n    InProgress --> Blocked: Awaiting Dependencies\n    Blocked --> InProgress: Dependencies Met\n    Completed --> [*]\n```\n\n资料来源：[packages/@monomind/swarm/src/coordination/task-orchestrator.ts]()\n\n## Attention Coordinator\n\nThe Attention Coordinator manages agent focus and priority-based routing, ensuring efficient resource utilization across the topology.\n\n### Priority Management\n\nAgents receive attention scores based on:\n\n- Current task priority\n- Agent specialization match\n- Availability and load\n- Historical performance metrics\n\n```typescript\ninterface AttentionMetrics {\n  focusScore: number;\n  priority: number;\n  specializationMatch: number;\n  availabilityScore: number;\n  performanceHistory: number;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/attention-coordinator.ts]()\n\n## Unified Coordinator\n\nThe Unified Coordinator provides a single interface for interacting with all topology components, simplifying complex swarm operations.\n\n### API Surface\n\n```typescript\ninterface UnifiedSwarmCoordinator {\n  // Topology Management\n  setTopology(type: TopologyType, config?: TopologyConfig): void;\n  getTopology(): TopologyInfo;\n  \n  // Agent Management\n  spawnAgent(type: AgentType, role?: AgentRole): AgentId;\n  terminateAgent(agentId: AgentId): void;\n  getActiveAgents(): AgentInfo[];\n  \n  // Communication\n  sendMessage(from: AgentId, to: AgentId, message: Message): void;\n  broadcast(from: AgentId, message: Message): void;\n  \n  // Task Management\n  submitTask(task: Task): TaskId;\n  getTaskStatus(taskId: TaskId): TaskStatus;\n  cancelTask(taskId: TaskId): void;\n  \n  // Coordination\n  achieveConsensus(agents: AgentId[], proposal: Proposal): ConsensusResult;\n  delegateTask(task: Task, agent: AgentId): void;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/unified-coordinator.ts]()\n\n## CLI Integration\n\nThe Monomind CLI provides commands for managing and visualizing swarm topologies:\n\n### Available Commands\n\n```bash\n# Initialize a swarm with specified topology\nmonomind swarm init --topology hierarchical\n\n# Set topology type\nmonomind swarm topology set --type mesh\n\n# Show current topology\nmonomind swarm topology show\n\n# List agents in swarm\nmonomind swarm agents list\n\n# View swarm status\nmonomind swarm status\n\n# Initialize mesh topology\nmonomind swarm init mesh\n\n# Spawn agent in swarm\nmonomind swarm agent spawn --type coder\n```\n\n### Swarm Subcommands\n\n| Command | Description |\n|---------|-------------|\n| `swarm init` | Initialize a new swarm |\n| `swarm init mesh` | Initialize mesh topology swarm |\n| `swarm status` | Display swarm health and metrics |\n| `swarm topology` | Manage topology settings |\n| `swarm agents` | List and manage swarm agents |\n| `swarm connect` | Connect to existing swarm |\n\n资料来源：[packages/@monomind/cli/src/commands/swarm.ts]()\n\n## Configuration\n\n### Topology Configuration Options\n\n```typescript\ninterface TopologyConfig {\n  type: TopologyType;\n  \n  // General settings\n  maxAgents: number;\n  agentTimeout: number;\n  \n  // Topology-specific settings\n  mesh?: {\n    maxConnectionsPerAgent: number;\n    connectionStrategy: 'random' | 'specialized' | 'full';\n  };\n  \n  hierarchical?: {\n    maxChildrenPerCoordinator: number;\n    delegationDepth: number;\n  };\n  \n  hiveMind?: {\n    consensusThreshold: number;\n    votingPeriod: number;\n    minParticipants: number;\n  };\n}\n```\n\n### Initialization Options\n\n```typescript\ninterface SwarmInitOptions {\n  topology: TopologyType;\n  maxAgents?: number;\n  defaultAgentType?: AgentType;\n  enableConsensus?: boolean;\n  communicationGraph?: {\n    trackMetrics: boolean;\n    retentionPeriod: number;\n  };\n  flowEnforcer?: {\n    strictMode: boolean;\n    allowedPatterns: CommunicationPattern[];\n  };\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/topology-manager.ts]()\n\n## Best Practices\n\n### Topology Selection Guidelines\n\n| Use Case | Recommended Topology |\n|----------|---------------------|\n| Simple sequential processing | Linear/Pipeline |\n| Complex multi-domain tasks | Hierarchical |\n| Highly collaborative workflows | Mesh |\n| Centralized control scenarios | Star |\n| Collective decision-making | Hive-Mind |\n\n### Performance Considerations\n\n1. **Mesh topologies** offer maximum parallelism but increase coordination overhead\n2. **Hierarchical topologies** reduce communication complexity but may create bottlenecks\n3. **Hive-Mind topologies** ensure consistent decisions but require more round-trips\n4. **Star topologies** provide clear authority but concentrate load on the hub\n\n### Flow Enforcement\n\nAlways enable the Flow Enforcer when using restricted topologies to prevent:\n\n- Unauthorized agent-to-agent communication\n- Circular dependencies\n- Task routing violations\n- Priority inversion attacks\n\n资料来源：[packages/@monomind/cli/src/swarm/flow-enforcer.ts]()\n\n## Related Documentation\n\n- [Agent Management](../cli/agent.md) - Agent spawning and lifecycle\n- [Task Orchestration](./task-orchestration.md) - Advanced task routing\n- [Memory System](../memory/README.md) - Cross-agent memory sharing\n- [Hooks System](../hooks/README.md) - Event-driven coordination\n\n---\n\n<a id='consensus-protocols'></a>\n\n## Consensus Protocols\n\n### 相关页面\n\n相关主题：[Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/swarm/src/consensus/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/index.ts)\n- [packages/@monomind/swarm/src/consensus/raft.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/raft.ts)\n- [packages/@monomind/swarm/src/consensus/byzantine.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/byzantine.ts)\n- [packages/@monomind/swarm/src/consensus/gossip.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/gossip.ts)\n- [packages/@monomind/cli/src/consensus/audit-writer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/consensus/audit-writer.ts)\n- [packages/@monomind/cli/src/consensus/vote-signer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/consensus/vote-signer.ts)\n</details>\n\n# Consensus Protocols\n\n## Overview\n\nThe Consensus Protocols module in Monomind provides a robust, multi-strategy approach to achieving agreement among distributed agents in a swarm coordination system. This module is critical for maintaining consistency, reliability, and fault tolerance when multiple autonomous agents must reach agreement on decisions, state changes, or leadership elections.\n\nThe consensus subsystem is architected to support three primary consensus paradigms, each optimized for different operational requirements and threat models:\n\n| Protocol | Use Case | Fault Tolerance | Performance |\n|----------|----------|-----------------|-------------|\n| **Raft** | Leader election, state replication | Crash fault tolerance | High throughput |\n| **Byzantine** | Adversarial environments, security-critical decisions | Byzantine fault tolerance | Medium throughput |\n| **Gossip** | Event propagation, eventual consistency | Partial network partitions | Highest throughput |\n\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts]()\n\n## Architecture\n\nThe consensus module follows a layered architecture that separates protocol implementation from coordination logic. The `UnifiedSwarmCoordinator` acts as the primary consumer of consensus services, while individual protocol implementations handle the algorithmic specifics.\n\n```mermaid\ngraph TD\n    A[UnifiedSwarmCoordinator] --> B[ConsensusService]\n    B --> C[RaftConsensus]\n    B --> D[ByzantineConsensus]\n    B --> E[GossipProtocol]\n    \n    F[CLI Audit Commands] --> G[AuditWriter]\n    H[Vote Signing] --> I[VoteSigner]\n    \n    G --> B\n    I --> C\n    I --> D\n    \n    J[Network Transport] --> C\n    J --> D\n    J --> E\n```\n\n### Core Interfaces\n\nThe consensus module exposes a unified interface through the main entry point:\n\n```typescript\n// packages/@monomind/swarm/src/consensus/index.ts\nexport interface ConsensusProtocol {\n  propose(value: ConsensusValue): Promise<ConsensusResult>;\n  join(nodeId: string): Promise<void>;\n  leave(nodeId: string): Promise<void>;\n  getState(): ConsensusState;\n  getMetrics(): ConsensusMetrics;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts:1-50]()\n\n## Raft Consensus Implementation\n\nThe Raft implementation provides crash fault tolerance for leader election and log replication within the swarm. This protocol is selected by default when strong consistency is required without the overhead of Byzantine fault tolerance.\n\n### Leader Election\n\nRaft in Monomind uses a three-state machine model: **Follower**, **Candidate**, and **Leader**. The election process is triggered when a follower node does not receive a heartbeat from the current leader within the election timeout.\n\n```mermaid\nstateDiagram-v2\n    [*] --> Follower\n    Follower --> Candidate : Election timeout\n    Candidate --> Leader : Votes received (majority)\n    Candidate --> Follower : Higher term discovered\n    Leader --> Follower : Higher term discovered\n    Follower --> Follower : Heartbeat received\n    Candidate --> Candidate : Election timeout (re-election)\n```\n\n### Log Replication\n\nOnce a leader is elected, it replicates log entries to followers using the `proposeConsensus` method exposed through the coordinator interface. Entries are committed only after receiving acknowledgment from a majority of nodes.\n\n资料来源：[packages/@monomind/swarm/src/consensus/raft.ts]()\n\n## Byzantine Fault Tolerance\n\nThe Byzantine consensus implementation is designed for scenarios where agents may exhibit arbitrary or malicious behavior. This is particularly relevant in open multi-agent systems where not all participants can be trusted.\n\n### Byzantine Generals Problem\n\nByzantine consensus tolerates up to *f* faulty nodes in a system of *3f + 1* total nodes, making it suitable for security-critical swarm operations such as:\n\n- Vote signing and verification\n- Access control decisions\n- Resource allocation agreements\n- Cross-agent transaction validation\n\n```mermaid\ngraph LR\n    A[Propose] --> B[Pre-Prepare]\n    B --> C[Prepare]\n    C --> D[Commit]\n    D --> E[Reply]\n    \n    F[F+1 Distinct Signatures] --> E\n```\n\n资料来源：[packages/@monomind/swarm/src/consensus/byzantine.ts]()\n\n## Gossip Protocol\n\nThe Gossip protocol provides eventual consistency with minimal coordination overhead. Unlike Raft and Byzantine consensus, gossip is designed for high-throughput scenarios where strict consistency is not required.\n\n### Message Propagation\n\nNodes periodically select random peers to exchange state information. Over time, the entire swarm converges to a consistent state through epidemic propagation.\n\n| Property | Value |\n|----------|-------|\n| Convergence Time | O(log n) rounds |\n| Message Complexity | O(n log n) total messages |\n| Network Efficiency | High fan-out, low latency |\n\n### Fan-Out Strategy\n\nThe gossip implementation uses an adaptive fan-out factor based on network conditions and swarm size, optimizing message delivery while minimizing redundant transmissions.\n\n资料来源：[packages/@monomind/swarm/src/consensus/gossip.ts]()\n\n## CLI Integration\n\nThe Monomind CLI provides commands for managing and auditing consensus operations across the swarm.\n\n### Audit Writer\n\nThe `audit-writer` module enables operators to record and verify consensus decisions for compliance and debugging purposes.\n\n```bash\n# Record consensus decision\nmonomind consensus audit record --tx-id <transaction> --decision <choice>\n\n# Export audit trail\nmonomind consensus audit export --format json --since 2024-01-01\n```\n\n资料来源：[packages/@monomind/cli/src/consensus/audit-writer.ts]()\n\n### Vote Signing\n\nVote signing provides cryptographic verification of consensus participation, ensuring that only authorized agents can influence swarm decisions.\n\n```bash\n# Sign a vote\nmonomind consensus vote sign --proposal <id> --node <node-id>\n\n# Verify vote signatures\nmonomind consensus vote verify --proposal <id> --signatures <path>\n```\n\n资料来源：[packages/@monomind/cli/src/consensus/vote-signer.ts]()\n\n## Usage Patterns\n\n### Choosing the Right Protocol\n\n| Scenario | Recommended Protocol | Justification |\n|----------|---------------------|---------------|\n| Single datacenter, trusted agents | Raft | Highest performance, sufficient fault tolerance |\n| Multi-region deployment | Gossip | Partition tolerant, eventual consistency |\n| Open network, untrusted agents | Byzantine | Security-first, tolerates malicious behavior |\n| Mixed trust environment | Hybrid (Raft + Byzantine) | Use Byzantine for security-critical, Raft for operational |\n\n### Configuration Example\n\n```typescript\nimport { createConsensusService } from '@monomind/swarm';\n\nconst consensus = createConsensusService({\n  protocol: 'raft',\n  peers: ['agent-1:9001', 'agent-2:9001', 'agent-3:9001'],\n  electionTimeout: 500,\n  heartbeatInterval: 150,\n});\n\n// Propose a value\nconst result = await consensus.propose({\n  type: 'leader_decision',\n  value: { action: 'spawn_agent', config: agentConfig },\n  timeout: 5000,\n});\n```\n\n## API Reference\n\n### ConsensusService\n\n| Method | Parameters | Returns | Description |\n|--------|------------|---------|-------------|\n| `propose` | `value: ConsensusValue` | `Promise<ConsensusResult>` | Submit a value for consensus |\n| `join` | `nodeId: string` | `Promise<void>` | Join the consensus group |\n| `leave` | `nodeId: string` | `Promise<void>` | Leave the consensus group |\n| `getState` | — | `ConsensusState` | Get current consensus state |\n| `getMetrics` | — | `ConsensusMetrics` | Get performance metrics |\n\n### ConsensusResult\n\n```typescript\ninterface ConsensusResult {\n  success: boolean;\n  value?: unknown;\n  quorum?: string[];\n  term?: number;\n  signature?: string;\n  timestamp: number;\n  latency: number;\n}\n```\n\n## Performance Targets\n\nThe consensus module is designed to meet the following performance benchmarks:\n\n| Metric | Target |\n|--------|--------|\n| Coordination Latency | < 100ms |\n| Throughput | > 10,000 ops/sec |\n| Recovery Time | < 5 seconds |\n| Memory Overhead | < 50MB per agent |\n\n资料来源：[packages/@monomind/swarm/README.md]()\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts]()\n\n## Related Documentation\n\n- [Swarm Coordination](../swarm/README.md) - Higher-level swarm management\n- [UnifiedSwarmCoordinator](../swarm/src/coordinator.ts) - Primary coordinator implementation\n- [CLI Commands](../cli/src/consensus/) - Command-line consensus tools\n\n---\n\n<a id='memory-system'></a>\n\n## Memory System\n\n### 相关页面\n\n相关主题：[Knowledge Graph (Monograph)](#knowledge-graph)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/memory/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/index.ts)\n- [packages/@monomind/memory/src/agentdb-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/agentdb-backend.ts)\n- [packages/@monomind/memory/src/hnsw-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/hnsw-index.ts)\n- [packages/@monomind/memory/src/hybrid-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/hybrid-backend.ts)\n- [packages/@monomind/memory/src/sqlite-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/sqlite-backend.ts)\n- [packages/@monomind/memory/src/sqljs-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/sqljs-backend.ts)\n- [packages/@monomind/neural/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/index.ts)\n- [packages/@monomind/neural/src/sona-integration.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/sona-integration.ts)\n- [packages/@monomind/neural/src/pattern-learner.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/pattern-learner.ts)\n- [packages/@monomind/memory/src/learning-bridge.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/learning-bridge.ts)\n</details>\n\n# Memory System\n\nThe Memory System is a core component of Monomind that provides persistent, searchable storage for agent insights, patterns, and learned knowledge. It implements a hybrid architecture combining SQLite for structured data persistence with HNSW-based vector indexing for high-performance semantic search.\n\n## Overview\n\nThe Memory System serves as the long-term knowledge repository for the Monomind AI coordination platform. It enables agents to:\n\n- **Persist insights** across sessions with confidence-weighted storage\n- **Search semantically** using vector embeddings and HNSW indexing\n- **Link knowledge** automatically using A-MEM auto-linking mechanisms\n- **Learn patterns** through SONA neural integration\n- **Sync with files** via AutoMemoryBridge for CLAUDE.md integration\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Architecture\n\n```mermaid\ngraph TB\n    subgraph \"Memory System Architecture\"\n        AMB[\"AutoMemoryBridge\"]\n        \n        subgraph \"Backends\"\n            HB[\"HybridBackend\"]\n            AB[\"AgentDB Backend\"]\n            SB[\"SQLite Backend\"]\n            HNSW[\"HNSW Index\"]\n        end\n        \n        subgraph \"Neural Integration\"\n            NL[\"Neural Learning\"]\n            PL[\"Pattern Learner\"]\n            SONA[\"SONA Integration\"]\n        end\n        \n        LB[\"LearningBridge\"]\n    end\n    \n    AMB --> HB\n    HB --> AB\n    HB --> SB\n    HB --> HNSW\n    LB --> NL\n    LB --> PL\n    NL --> SONA\n    AMB --> LB\n```\n\n### Component Overview\n\n| Component | Purpose | Data Type |\n|-----------|---------|-----------|\n| `HybridBackend` | Unified interface combining multiple backends | All memory entries |\n| `AgentDB Backend` | Vector semantic search with HNSW | Embeddings, insights |\n| `SQLite Backend` | Structured relational storage | Metadata, configurations |\n| `HNSW Index` | High-performance approximate nearest neighbor search | Vector embeddings |\n| `AutoMemoryBridge` | File sync and session management | Markdown files |\n| `LearningBridge` | Neural pattern learning integration | Learned patterns |\n\n资料来源：[packages/@monomind/memory/src/hybrid-backend.ts](packages/@monomind/memory/src/hybrid-backend.ts)\n\n## Backends\n\n### HybridBackend\n\nThe `HybridBackend` serves as the primary interface, combining structured storage with semantic search capabilities. It coordinates between AgentDB and SQLite backends while maintaining data consistency.\n\n```typescript\ninterface HybridBackendConfig {\n  embeddingGenerator?: EmbeddingGenerator;\n  storageDir?: string;\n  enableAutoLinking?: boolean;\n  maxAutoLinkReferences?: number;\n}\n```\n\n**Key Features:**\n- Automatic embedding generation for stored entries\n- A-MEM auto-linking with configurable neighbor count\n- Bidirectional reference management\n- Cross-session persistence\n\n资料来源：[packages/@monomind/memory/src/hybrid-backend.ts](packages/@monomind/memory/src/hybrid-backend.ts)\n\n### AgentDB Backend\n\nThe AgentDB backend provides vector storage and semantic search capabilities using HNSW (Hierarchical Navigable Small World) indexing.\n\n```typescript\ninterface AgentDBConfig {\n  dimension: number;\n  storagePath?: string;\n  m?: number;        // HNSW M parameter\n  efConstruction?: number;\n  efSearch?: number;\n}\n```\n\n**Performance Characteristics:**\n- **150x-12,500x faster** than brute-force search\n- Supports up to millions of vectors\n- Configurable HNSW parameters for accuracy/speed tradeoffs\n\n资料来源：[packages/@monomind/memory/src/agentdb-backend.ts](packages/@monomind/memory/src/agentdb-backend.ts)\n\n### SQLite Backend\n\nProvides structured data storage for metadata, configurations, and entries requiring relational queries.\n\n```typescript\ninterface SQLiteConfig {\n  storagePath?: string;\n  enableWAL?: boolean;\n  cacheSize?: number;\n}\n```\n\n资料来源：[packages/@monomind/memory/src/sqlite-backend.ts](packages/@monomind/memory/src/sqlite-backend.ts)\n\n### SQL.js Backend\n\nAn in-browser compatible SQLite implementation using WebAssembly, useful for environments without native SQLite support.\n\n```typescript\ninterface SqlJsConfig {\n  locateFile?: (file: string) => string;\n  memoryGrowth?: boolean;\n}\n```\n\n资料来源：[packages/@monomind/memory/src/sqljs-backend.ts](packages/@monomind/memory/src/sqljs-backend.ts)\n\n## HNSW Index\n\nThe HNSW (Hierarchical Navigable Small World) index provides the core vector search functionality.\n\n```mermaid\ngraph LR\n    A[\"Query Vector\"] --> B[\"Search Layer L\"]\n    B --> C[\"Search Layer L-1\"]\n    C --> D[\"Search Layer L-2\"]\n    D --> E[\"Bottom Layer\"]\n    E --> F[\"Results\"]\n```\n\n### Configuration Parameters\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| `m` | 16 | Max connections per node |\n| `efConstruction` | 200 | Construction time search breadth |\n| `efSearch` | 100 | Search time search breadth |\n| `dimension` | 1536 | Embedding vector dimension |\n\n资料来源：[packages/@monomind/memory/src/hnsw-index.ts](packages/@monomind/memory/src/hnsw-index.ts)\n\n## AutoMemoryBridge\n\nThe `AutoMemoryBridge` synchronizes between the in-memory vector database and persistent markdown files for CLAUDE.md integration.\n\n```typescript\nimport { AutoMemoryBridge } from '@monomind/memory';\n\nconst bridge = new AutoMemoryBridge(memoryBackend, {\n  workingDir: '/workspaces/my-project',\n  syncMode: 'on-session-end',\n  pruneStrategy: 'confidence-weighted',\n});\n```\n\n### Sync Modes\n\n| Mode | Behavior | Use Case |\n|------|----------|----------|\n| `on-write` | Immediate file writes | Critical data persistence |\n| `on-session-end` | Buffer and flush on session close | Efficient batch operations |\n| `periodic` | Configurable interval sync | Long-running sessions |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n### Scope Directories\n\n```mermaid\ngraph TD\n    A[\"Agent Request\"] --> B[\"Scope Selection\"]\n    B --> C1[\"project\"]\n    B --> C2[\"local\"]\n    B --> C3[\"user\"]\n    \n    C1 --> D1[\"<gitRoot>/.claude/agent-memory/<agent>/\"]\n    C2 --> D2[\"<gitRoot>/.claude/agent-memory-local/<agent>/\"]\n    C3 --> D3[\"~/.claude/agent-memory/<agent>/\"]\n```\n\n| Scope | Path Pattern | Description |\n|-------|--------------|-------------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Insight Categories\n\n| Category | Topic File | Description |\n|----------|-----------|-------------|\n| `project-patterns` | `patterns.md` | Reusable code patterns |\n| `architecture` | `architecture.md` | System design decisions |\n| `debugging` | `debugging.md` | Bug fixes and workarounds |\n| `decisions` | `decisions.md` | ADR and rationale |\n| `api-contracts` | `api-contracts.md` | Interface definitions |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Neural Learning Integration\n\n### Pattern Learning\n\nThe Pattern Learning system extracts and stores reusable patterns from agent interactions.\n\n```typescript\nimport { PatternLearner } from '@monomind/neural';\n\nconst learner = new PatternLearner({\n  extractionThreshold: 0.7,\n  consolidationWindow: 100,\n});\n```\n\n资料来源：[packages/@monomind/neural/src/pattern-learner.ts](packages/@monomind/neural/src/pattern-learner.ts)\n\n### SONA Integration\n\nSONA (Self-Optimizing Neural Adaptation) enables the memory system to learn from patterns and improve agent routing over time.\n\n```mermaid\ngraph TD\n    A[\"Memory Entry\"] --> B[\"Pattern Extraction\"]\n    B --> C[\"SONA Weight Update\"]\n    C --> D[\"Agent Routing Optimization\"]\n    D --> E[\"Performance Metrics\"]\n    E --> B\n```\n\n**Features:**\n- Pattern recognition improves agent routing\n- Trajectory tracking identifies effective strategies\n- Automatic model adaptation with <0.05ms overhead\n\n资料来源：[packages/@monomind/neural/src/sona-integration.ts](packages/@monomind/neural/src/sona-integration.ts)\n\n### LearningBridge\n\nThe `LearningBridge` connects the memory system with neural learning capabilities, enabling bidirectional flow of insights and learned patterns.\n\n```typescript\nconst bridge = new LearningBridge({\n  memoryBackend: hybridBackend,\n  neuralBackend: sonaBackend,\n  syncInterval: 60000,\n});\n```\n\n资料来源：[packages/@monomind/memory/src/learning-bridge.ts](packages/@monomind/memory/src/learning-bridge.ts)\n\n## Memory Operations\n\n### Store and Retrieve\n\n```typescript\n// Store an insight\nawait bridge.recordInsight({\n  category: 'debugging',\n  summary: 'HNSW index requires initialization before search',\n  source: 'agent:tester',\n  confidence: 0.95,\n});\n\n// Semantic search\nconst results = await backend.search('HNSW initialization', { topK: 5 });\n\n// Sync to files\nawait bridge.syncToAutoMemory();\n```\n\n### Memory CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `memory init` | Initialize memory database |\n| `memory store` | Store data in memory |\n| `memory retrieve` | Retrieve data from memory |\n| `memory search` | Semantic/vector search |\n| `memory list` | List memory entries |\n| `memory delete` | Delete an entry |\n| `memory stats` | Show statistics |\n\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](packages/@monomind/cli/src/commands/memory.ts)\n\n## A-MEM Auto-Linking\n\nWhen `HybridBackend` is configured with an `embeddingGenerator`, every stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional `references` edges—implementing the Zettelkasten note-linking structure.\n\n```typescript\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  maxAutoLinkReferences: 3,\n  enableAutoLinking: true,\n});\n```\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Quick Start\n\n```typescript\nimport { \n  AutoMemoryBridge,\n  HybridBackend,\n  createAgentBridge,\n  resolveAgentMemoryDir,\n} from '@monomind/memory';\n\n// Create backend with embedding support\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => embeddings.embed(text),\n});\n\n// Create bridge for file sync\nconst bridge = new AutoMemoryBridge(backend, {\n  workingDir: '/workspaces/my-project',\n  syncMode: 'on-session-end',\n});\n\n// Record insights\nawait bridge.recordInsight({\n  category: 'architecture',\n  summary: 'Use HybridBackend for production workloads',\n  confidence: 0.92,\n});\n\n// Sync to CLAUDE.md files\nawait bridge.syncToAutoMemory();\n```\n\n资料来源：[packages/@monomind/memory/src/index.ts](packages/@monomind/memory/src/index.ts)\n\n## Related Packages\n\n| Package | Purpose |\n|---------|---------|\n| `agentdb` | HNSW vector database |\n| `@monomind/neural` | Neural network and SONA learning |\n| `@monomind/cli` | CLI with memory commands |\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n<a id='knowledge-graph'></a>\n\n## Knowledge Graph (Monograph)\n\n### 相关页面\n\n相关主题：[Memory System](#memory-system)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/monograph/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/index.ts)\n- [packages/@monomind/monograph/src/pipeline/runner.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/pipeline/runner.ts)\n- [packages/@monomind/monograph/src/graph/explain.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/explain.ts)\n- [packages/@monomind/monograph/src/graph/hotspots.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/hotspots.ts)\n- [packages/@monomind/monograph/src/graph/reachability.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/reachability.ts)\n- [packages/@monomind/graph/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/index.ts)\n- [packages/@monomind/graph/src/build.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/build.ts)\n- [packages/@monomind/graph/src/extract/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/extract/index.ts)\n- [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/monograph-tools.ts)\n</details>\n\n# Knowledge Graph (Monograph)\n\nMonograph is the knowledge graph subsystem of Monomind, designed to build, maintain, and query a semantic dependency graph of your codebase, documentation, and PDFs. It serves as the foundational intelligence layer that automatically maps relationships between code symbols, documents, and concepts before every task execution.\n\n## Overview\n\nMonograph creates a unified graph representation that captures both structural dependencies (imports, definitions) and semantic relationships (concepts, co-occurrences). This graph is automatically queried by hooks and slash commands, enabling agents to understand the codebase topology before making decisions.\n\n```mermaid\ngraph TD\n    A[Codebase + Docs + PDFs] --> B[Graph Builder]\n    B --> C[Monograph Graph DB]\n    C --> D[Query Engine]\n    D --> E[monograph_suggest]\n    D --> F[monograph_query]\n    D --> G[monograph_god_nodes]\n    E --> H[Claude Code Agent]\n    F --> H\n    G --> H\n```\n\n**资料来源：** [packages/@monomind/monograph/src/index.ts]()\n\n## Core Concepts\n\n### Graph Structure\n\nThe Monograph graph consists of two primary elements: **nodes** and **edges**.\n\n#### Node Types\n\n| Node Type | Description | Example |\n|-----------|-------------|---------|\n| `File` | Source file or document | `src/auth/login.ts` |\n| `Function` | Function or method definition | `authenticateUser()` |\n| `Class` | Class or interface definition | `UserService` |\n| `Concept` | Extracted semantic concept | `authentication-flow` |\n| `PDF` | PDF document chunk | `architecture.pdf:42-58` |\n| `Section` | Documentation section | API Reference, README |\n| `Interface` | TypeScript interface | `AuthProvider` |\n| `TypeAlias` | Type alias or union type | `UserId` |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n#### Edge Types\n\n| Relation | Meaning | Direction |\n|----------|---------|-----------|\n| `IMPORTS` | Code import dependency | File → File |\n| `DEFINES` | Symbol defined in file | File → Symbol |\n| `TAGGED_AS` | Section tagged with concept | Section → Concept |\n| `CO_OCCURS` | Concepts appear together | Concept → Concept |\n| `INFERRED` | Claude-extracted semantic relationship | Any → Any |\n| `DESCRIBES` | LLM-enriched relationship | Concept → Concept |\n| `CAUSES` | LLM-enriched relationship | Concept → Concept |\n| `PART_OF` | LLM-enriched relationship | Concept → Concept |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n### Graph Analysis Capabilities\n\nMonograph provides several analysis modes for examining the codebase:\n\n```mermaid\ngraph TD\n    subgraph Analysis Modes\n        A[reachability] --> A1[Upstream dependencies]\n        A --> A2[Downstream dependents]\n        B[hotspots] --> B1[High change frequency]\n        B --> B2[Cyclomatic complexity]\n        C[explain] --> C1[Dependency paths]\n        C --> C2[Impact analysis]\n    end\n```\n\n#### Reachability Analysis\n\nDetermines which files and symbols can reach or be reached from a given node. This is useful for understanding the blast radius of changes.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/reachability.ts]()\n\n#### Hotspots Detection\n\nIdentifies high-complexity or frequently-changing areas of the codebase that may need attention.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/hotspots.ts]()\n\n#### Explanation Engine\n\nProvides natural language explanations of dependency paths and relationships between code elements.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/explain.ts]()\n\n## CLI Commands\n\nThe `monomind monograph` command provides the primary interface for building and querying the knowledge graph.\n\n### Command Reference\n\n| Subcommand | Description |\n|------------|-------------|\n| `monograph build` | Build knowledge graph from code + docs + PDFs |\n| `monograph wiki` | Scan all docs and PDFs into a searchable knowledge graph |\n| `monograph search` | Search the graph (BM25 / semantic / hybrid) |\n| `monograph stats` | Show node/edge counts and top concepts |\n| `monograph watch` | Watch for file changes and rebuild incrementally |\n\n**资料来源：** [packages/@monomind/cli/src/commands/monograph.ts]()\n\n### Quick Start\n\n```bash\n# First-time build (code + all docs)\nnpx monomind monograph build\n\n# Doc/wiki-focused build with Claude semantic extraction\nnpx monomind monograph wiki --llm\n\n# Search\nnpx monomind monograph search -q \"authentication flow\"\nnpx monomind monograph search -q \"pipeline\" --mode semantic --label Section\n\n# Stats\nnpx monomind monograph stats --top 20\n\n# Auto-rebuild on changes\nnpx monomind monograph watch\n```\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n### Search Modes\n\n| Mode | Description | Use Case |\n|------|-------------|----------|\n| `bm25` | Traditional keyword-based search | Exact matches |\n| `semantic` | Vector-based similarity search | Conceptual matches |\n| `hybrid` | Combined BM25 + semantic | Balanced results |\n\n**资料来源：** [packages/@monomind/cli/src/commands/monograph.ts]()\n\n## MCP Tools\n\nMonograph exposes tools via the Model Context Protocol for programmatic integration with Claude Code and other MCP-compatible clients.\n\n### Available Tools\n\n| Tool Name | Description |\n|-----------|-------------|\n| `monograph_graphify` | Convert workspace files to graph representation |\n| `monograph_stats` | Get node/edge statistics and graph health |\n| `monograph_boundary_check` | Check for cross-zone import violations |\n| `monograph_suggest` | Find relevant files for a task |\n| `monograph_query` | Query specific dependency relationships |\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n### Usage Example\n\n```typescript\n// Using MCP tool in Claude Code\n{\n  tool: 'monograph_suggest',\n  arguments: {\n    query: \"add webhook retry logic\",\n    role: \"code\"  // Optional: filter by role (code, test, docs)\n  }\n}\n```\n\n### Graphify Tool\n\nThe `monograph_graphify` tool provides detailed graph analysis:\n\n```mermaid\ngraph TD\n    A[graphify request] --> B{role filter}\n    B -->|unreachable| C[Dead code candidates]\n    B -->|test| D[Test utilities]\n    B -->|code| E[Source files]\n    B -->|all| F[Complete graph]\n    C --> G[Dependency stats]\n    D --> G\n    E --> G\n    F --> G\n```\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n## Configuration\n\nMonograph is configured via `.monographrc.json` in the project root.\n\n### Configuration Schema\n\n```typescript\ninterface MonographConfig {\n  root: string;              // Project root directory\n  entry: string[];           // Entry points for analysis\n  ignore: string[];          // Patterns to exclude\n  production: boolean;      // Enable production checks\n  detection: string;        // Detection mode\n  regression: {\n    tolerance: number;\n    baselinePath: string;\n  };\n  health: {\n    cyclomaticThreshold: number;\n    cognitiveThreshold: number;\n    crapThreshold: number;\n    minLines: number;\n  };\n  boundaries?: BoundaryConfig;  // Zone-based boundary rules\n  plugins: string[];\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n### Boundary Configuration\n\nBoundaries define architectural zones with allowed import rules:\n\n```json\n{\n  \"zones\": [\n    {\n      \"name\": \"core\",\n      \"patterns\": [\"src/core/**\"],\n      \"allowedImports\": [\"src/utils/**\"]\n    }\n  ]\n}\n```\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n### Default Configuration\n\n```typescript\nconst DEFAULT_MONOGRAPH_CONFIG = {\n  root: '.',\n  entry: [],\n  production: true,\n  detection: 'default',\n  project: undefined,\n  ignore: [],\n  overrides: [],\n  regression: { tolerance: 0, baselinePath: '.monograph/regression-baseline.json' },\n  audit: { gate: 'error', includeHealthGate: false },\n  normalization: {\n    stripComments: true,\n    normalizeWhitespace: true,\n    normalizeIdentifiers: false\n  },\n  boundaries: {},\n  resolve: {\n    paths: {},\n    alias: {},\n    conditions: [],\n    extensions: ['.ts', '.tsx', '.mts', '.cts']\n  },\n  health: {\n    cyclomaticThreshold: 10,\n    cognitiveThreshold: 15,\n    crapThreshold: 30,\n    minLines: 5\n  },\n  ownership: { emailMode: 'fullEmail' },\n  plugins: [],\n};\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## Pipeline Architecture\n\nThe Monograph pipeline processes code and documents through multiple stages:\n\n```mermaid\ngraph LR\n    A[Source Files] --> B[Parser]\n    B --> C[AST Analysis]\n    C --> D[Symbol Extractor]\n    D --> E[Graph Builder]\n    E --> F[Edge Resolver]\n    F --> G[Graph Database]\n    G --> H[Query Interface]\n    \n    I[Documents] --> J[Chunker]\n    J --> K[Embedding Generator]\n    K --> L[Vector Index]\n    L --> G\n```\n\n### Pipeline Runner\n\nThe pipeline runner orchestrates the graph construction process:\n\n```typescript\ninterface PipelineResult {\n  nodes: number;      // Total nodes created\n  edges: number;      // Total edges created\n  duration: number;   // Processing time in ms\n  errors: string[];   // Any processing errors\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/pipeline/runner.ts]()\n\n### Extraction Pipeline\n\nThe extraction pipeline handles both code symbols and documentation:\n\n```typescript\ninterface ExtractOptions {\n  includeTypes: boolean;      // Include type definitions\n  includeDocs: boolean;       // Include JSDoc comments\n  includeConcepts: boolean;   // Extract semantic concepts\n  useLLM: boolean;           // Use LLM for semantic extraction\n}\n```\n\n**资料来源：** [packages/@monomind/graph/src/extract/index.ts]()\n\n## Graph Query Operations\n\n### monograph_query\n\nQuery specific relationships in the graph:\n\n```bash\n# Find what depends on UserService\nmonograph_query \"UserService dependencies\"\n\n# Find files that define authentication\nmonograph_query \"authentication\" --label DEFINES\n```\n\n### monograph_suggest\n\nGet ranked file suggestions for a task:\n\n```bash\n# Find relevant files for a feature\nmonograph_suggest \"add webhook retry logic\"\n# → returns ranked list with relevance scores\n```\n\n### monograph_god_nodes\n\nIdentify high-centrality files (most connected in the graph):\n\n```bash\n# Find the most connected internal files\nmonograph_god_nodes\n# → excludes external dependencies and test files\n```\n\n**资料来源：** [README.md]()\n\n## Integration with Intelligence System\n\nMonograph integrates with Monomind's intelligence system to provide context-aware assistance:\n\n```mermaid\ngraph TD\n    A[User Task] --> B[Monograph Query]\n    B --> C[Relevant Files]\n    C --> D[SONA Learning]\n    D --> E[Pattern Recognition]\n    E --> F[Agent Routing]\n    F --> G[Task Execution]\n    G --> H[Trajectory Tracking]\n    H --> D\n```\n\n### Hooks Integration\n\nMonograph tools are called automatically by hooks before task execution, ensuring agents always have relevant context.\n\n**资料来源：** [README.md]()\n\n## Extended Configuration\n\nMonograph supports extended configuration for advanced use cases:\n\n```typescript\ninterface ExtendedMonographConfig extends MonographConfig {\n  extends?: string[];                    // Extend other configs\n  sealed?: boolean;                       // Prevent further extension\n  includeEntryExports?: boolean;         // Include entry point exports\n  publicPackages?: string[];             // Public package boundaries\n  dynamicallyLoaded?: string[];          // Dynamic import patterns\n  codeowners?: string;                   // CODEOWNERS file path\n  ignoreDependencies?: string[];         // Ignore certain imports\n  ignoreExportsUsedInFile?: boolean | {\n    interface?: boolean;\n    typeAlias?: boolean;\n  };\n  usedClassMembers?: Array<string | {\n    extends?: string[];\n    implements?: string[];\n    members: string[];\n  }>;\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## Health Checks\n\nMonograph includes code health analysis capabilities:\n\n| Metric | Threshold | Description |\n|--------|-----------|-------------|\n| Cyclomatic Complexity | 10 | Maximum allowed branching |\n| Cognitive Complexity | 15 | Maximum cognitive load |\n| CRAP Index | 30 | Change Risk Anti-Patterns |\n| Minimum Lines | 5 | Minimum function/file size |\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## CLI vs MCP Usage\n\n| Aspect | CLI | MCP Tools |\n|--------|-----|-----------|\n| **Use Case** | One-time builds, manual searches | Claude Code integration |\n| **Invocation** | Terminal commands | Programmatic queries |\n| **Real-time** | With `watch` command | During task execution |\n| **Output** | Formatted text | JSON structured data |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n## See Also\n\n- `memory` — Vector memory storage (separate from graph)\n- `hooks intelligence` — Pattern learning\n- CLAUDE.md Knowledge Graph section — workflow guidance for multi-file tasks\n\n---\n\n---\n\n## Doramagic 踩坑日志\n\n项目：monoes/monomind\n\n摘要：发现 15 个潜在踩坑项，其中 0 个为 high/blocking；最高优先级：安装坑 - 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills。\n\n## 1. 安装坑 · 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_ba46bd2053364ab7b216b1ab09b3714a | https://github.com/monoes/monomind/releases/tag/v1.10.0 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：v1.6.8\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.6.8\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8e00eb27c790432ba99d18d7125b0cee | https://github.com/monoes/monomind/releases/tag/v1.6.8 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：v1.9.12 — mastermind:idea pipeline hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.12 — mastermind:idea pipeline hardening\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6a79f40d2c5e44c4ac6b5e2e855d2a55 | https://github.com/monoes/monomind/releases/tag/v1.9.12 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 4. 安装坑 · 来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.13 — fix: monograph never installed (workspace:* dep)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2ffa187842b347428cc973816067e095 | https://github.com/monoes/monomind/releases/tag/v1.9.13 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 5. 安装坑 · 来源证据：v1.9.2 — mastermind:master hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.2 — mastermind:master hardening\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_d4070dac80cb428ba72244762274a6bf | https://github.com/monoes/monomind/releases/tag/v1.9.2 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 可能修改宿主 AI 配置\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。\n- 对用户的影响：安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。\n- 建议检查：列出会写入的配置文件、目录和卸载/回滚步骤。\n- 防护动作：涉及宿主配置目录时必须给回滚路径，不能只给安装命令。\n- 证据：capability.host_targets | github_repo:1221944165 | https://github.com/monoes/monomind | host_targets=mcp_host, claude, claude_code\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1221944165 | https://github.com/monoes/monomind | README/documentation is current enough for a first validation pass.\n\n## 8. 维护坑 · 来源证据：v1.9.1 — Init wipe-and-replace for managed Claude assets\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v1.9.1 — Init wipe-and-replace for managed Claude assets\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e1832d706e974245bfbf1fb183aeafb8 | https://github.com/monoes/monomind/releases/tag/v1.9.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | last_activity_observed missing\n\n## 10. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 11. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 12. 安全/权限坑 · 来源证据：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_57b3501be7e943c5a3329118314c1794 | https://github.com/monoes/monomind/releases/tag/v1.8.0 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. 安全/权限坑 · 来源证据：Monomind v1.9.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.9.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_77db71f60ceb4346b348922fc31f9cb7 | https://github.com/monoes/monomind/releases/tag/v1.9.0 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 14. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | issue_or_pr_quality=unknown\n\n## 15. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | release_recency=unknown\n\n<!-- canonical_name: monoes/monomind; human_manual_source: deepwiki_human_wiki -->\n",
      "markdown_key": "monomind",
      "pages": "draft",
      "source_refs": [
        {
          "evidence_id": "github_repo:1221944165",
          "kind": "repo",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/monoes/monomind"
        },
        {
          "evidence_id": "art_ba2c81bdcee142908ac00e903354c3e7",
          "kind": "docs",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/monoes/monomind#readme"
        }
      ],
      "summary": "DeepWiki/Human Wiki 完整输出，末尾追加 Discovery Agent 踩坑日志。",
      "title": "monomind 说明书",
      "toc": [
        "https://github.com/monoes/monomind 项目说明书",
        "目录",
        "Getting Started with Monomind",
        "Overview",
        "Installation",
        "Core Concepts",
        "CLI Commands Reference",
        "List all sessions",
        "Doramagic 踩坑日志"
      ]
    }
  },
  "quality_gate": {
    "blocking_gaps": [],
    "category_confidence": "medium",
    "compile_status": "ready_for_review",
    "five_assets_present": true,
    "install_sandbox_verified": true,
    "missing_evidence": [],
    "next_action": "publish to Doramagic.ai project surfaces",
    "prompt_preview_boundary_ok": true,
    "publish_status": "publishable",
    "quick_start_verified": true,
    "repo_clone_verified": true,
    "repo_commit": "76718e6d821b0c3e1c54bc05c7928c6bcde1ab70",
    "repo_inspection_error": null,
    "repo_inspection_files": [
      "pnpm-lock.yaml",
      "package.json",
      "README.md",
      "docs/CHANGES-v1.10.md",
      "packages/tsconfig.base.json",
      "packages/package-lock.json",
      "packages/vitest.config.ts",
      "packages/pnpm-lock.yaml",
      "packages/pnpm-workspace.yaml",
      "packages/package.json",
      "packages/README.md",
      "packages/tsconfig.json",
      "packages/CHANGELOG.md",
      "packages/bunfig.toml",
      "packages/plugins/SECURITY-AUDIT.md",
      "packages/__tests__/setup.ts",
      "packages/implementation/README.md",
      "packages/implementation/PLUGIN_INTEGRATION.md",
      "packages/scripts/prepare-publish.js",
      "packages/helpers/README.md",
      "packages/docs/adr/README.md",
      "packages/docs/ddd/quality-engineering/domain-model.md",
      "packages/docs/ddd/quality-engineering/README.md",
      "packages/docs/ddd/quality-engineering/integration-points.md",
      "packages/docs/ddd/coherence-engine/domain-model.md",
      "packages/docs/ddd/coherence-engine/README.md",
      "packages/docs/ddd/coherence-engine/integration-points.md",
      "packages/plugins/ruvector-upstream/package.json",
      "packages/plugins/ruvector-upstream/README.md",
      "packages/plugins/ruvector-upstream/tsconfig.json",
      "packages/plugins/prime-radiant/package-lock.json",
      "packages/plugins/prime-radiant/vitest.config.ts",
      "packages/plugins/prime-radiant/plugin.yaml",
      "packages/plugins/prime-radiant/package.json",
      "packages/plugins/prime-radiant/README.md",
      "packages/plugins/prime-radiant/tsconfig.json",
      "packages/plugins/agentic-qe/vitest.config.ts",
      "packages/plugins/agentic-qe/plugin.yaml",
      "packages/plugins/agentic-qe/package.json",
      "packages/plugins/agentic-qe/README.md"
    ],
    "repo_inspection_verified": true,
    "review_reasons": [],
    "tag_count_ok": true,
    "unsupported_claims": []
  },
  "schema_version": "0.1",
  "user_assets": {
    "ai_context_pack": {
      "asset_id": "ai_context_pack",
      "filename": "AI_CONTEXT_PACK.md",
      "markdown": "# monomind - Doramagic AI Context Pack\n\n> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。\n\n## 充分原则\n\n- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。\n- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。\n\n## 给宿主 AI 的使用方式\n\n你正在读取 Doramagic 为 monomind 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。\n\n## Claim 消费规则\n\n- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。\n- **事实最低状态**：`supported`\n- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。\n- `weak`：只能作为低置信度线索，必须要求用户继续核实。\n- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。\n- `unverified`：不得作为事实使用，应明确说证据不足。\n- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。\n\n## 它最适合谁\n\n- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0004` supported 0.86\n- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.claude/skills/agent-browser-testing/SKILL.md`, `.claude/skills/agentdb-advanced/SKILL.md`, `.claude/skills/agentdb-learning/SKILL.md`, `.claude/skills/agentdb-memory-patterns/SKILL.md` 等 Claim：`clm_0005` supported 0.86\n\n## 它能做什么\n\n- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.claude/skills/agent-browser-testing/SKILL.md`, `.claude/skills/agentdb-advanced/SKILL.md`, `.claude/skills/agentdb-learning/SKILL.md`, `.claude/skills/agentdb-memory-patterns/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **多宿主安装与分发**（需要安装后验证）：项目包含插件或 marketplace 配置，说明它面向一个或多个 AI 宿主的安装和分发。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `plugin/.claude-plugin/plugin.json` Claim：`clm_0002` unverified 0.25\n- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md`, `packages/@monomind/aidefence/README.md`, `packages/@monomind/claims/README.md`, `packages/@monomind/cli/src/ruvector/README.md` Claim：`clm_0003` supported 0.86\n\n## 怎么开始\n\n- `npm install -g monomind` 证据：`README.md` Claim：`clm_0006` supported 0.86\n- `claude mcp add monomind npx monomind mcp start` 证据：`README.md` Claim：`clm_0007` supported 0.86\n- `git clone https://github.com/nokhodian/monomind.git` 证据：`README.md` Claim：`clm_0008` supported 0.86\n- `npm install @monomind/aidefence` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0009` supported 0.86\n- `pnpm add @monomind/aidefence` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0010` supported 0.86\n- `yarn add @monomind/aidefence` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0011` supported 0.86\n- `npm install agentdb` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0012` supported 0.86\n- `npx monomind security defend -i \"ignore previous instructions\"` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0013` supported 0.86\n- `npx monomind security defend -f ./user-prompts.txt` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0014` supported 0.86\n- `npx monomind security defend -i \"some text\" --quick` 证据：`packages/@monomind/aidefence/README.md` Claim：`clm_0015` supported 0.86\n\n## 继续前判断卡\n\n- **当前建议**：先做流程沙盒试用\n- **为什么**：这个项目会改变宿主 AI 的开发流程和规则，值得继续试，但不要直接装进主力 Claude/Cursor/Codex；先用临时宿主或隔离目录验证。\n\n### 30 秒判断\n\n- **现在怎么做**：先做流程沙盒试用\n- **最小安全下一步**：先用 Prompt Preview 感受流程约束；满意后再临时宿主试装\n- **先别相信**：这套流程是否适合你的工作方式不能直接相信。\n- **继续会触碰**：宿主行为改变、命令执行、宿主 AI 配置\n\n### 现在可以相信\n\n- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0004` supported 0.86\n- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.claude/skills/agent-browser-testing/SKILL.md`, `.claude/skills/agentdb-advanced/SKILL.md`, `.claude/skills/agentdb-learning/SKILL.md`, `.claude/skills/agentdb-memory-patterns/SKILL.md` 等 Claim：`clm_0005` supported 0.86\n- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.claude/skills/agent-browser-testing/SKILL.md`, `.claude/skills/agentdb-advanced/SKILL.md`, `.claude/skills/agentdb-learning/SKILL.md`, `.claude/skills/agentdb-memory-patterns/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md`, `packages/@monomind/aidefence/README.md`, `packages/@monomind/claims/README.md`, `packages/@monomind/cli/src/ruvector/README.md` Claim：`clm_0003` supported 0.86\n- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0006` supported 0.86\n\n### 现在还不能相信\n\n- **这套流程是否适合你的工作方式不能直接相信。**（unverified）：流程型 Skill 可能强约束 AI 行为；它能提升纪律，也可能拖慢你当前任务节奏。 证据：`.claude-plugin/hooks/hooks.json`, `.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.claude/skills/agent-browser-testing/SKILL.md` 等\n- **不会和你已有 Claude/Cursor/Codex 规则冲突，不能直接相信。**（inferred）：开发流程 Skill 会改变澄清、计划、测试、验证等默认行为，必须在临时宿主里试。 证据：`.claude-plugin/hooks/hooks.json`, `.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.claude/skills/agent-browser-testing/SKILL.md` 等\n- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。\n- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。\n- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.claude-plugin/hooks/hooks.json`, `.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.claude/skills/agent-browser-testing/SKILL.md` 等\n- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。\n- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `plugin/.claude-plugin/plugin.json`\n- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。\n\n### 继续会触碰什么\n\n- **宿主行为改变**：澄清、计划、TDD、验证、收尾等默认开发节奏。 原因：这类 Skill 的价值和风险都来自强约束流程；必须先确认你愿意被它改变工作方式。 证据：`.claude-plugin/hooks/hooks.json`, `.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.claude/skills/agent-browser-testing/SKILL.md` 等\n- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`, `packages/@monomind/aidefence/README.md`, `packages/@monomind/claims/README.md`, `packages/@monomind/cli/src/ruvector/README.md`\n- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.claude-plugin/hooks/hooks.json`, `.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.claude/skills/agent-browser-testing/SKILL.md` 等\n- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `README.md`, `packages/@monomind/aidefence/README.md` 等\n- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。\n\n### 最小安全下一步\n\n- **先跑 Prompt Preview**：先感受它会怎样改变 AI 的开发节奏，再决定是否让它进入真实宿主。（适用：任何项目都适用，尤其是输出质量未知时。）\n- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）\n- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）\n- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）\n\n### 退出方式\n\n- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。\n- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。\n- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。\n- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。\n\n## 哪些只能预览\n\n- 解释项目适合谁和能做什么\n- 基于项目文档演示典型对话流程\n- 帮助用户判断是否值得安装或继续研究\n\n## 哪些必须安装后验证\n\n- 真实安装 Skill、插件或 CLI\n- 执行脚本、修改本地文件或访问外部服务\n- 验证真实输出质量、性能和兼容性\n\n## 边界与风险判断卡\n\n- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0030` inferred 0.45\n- **宿主 AI 插件或 Skill 规则冲突**：新规则可能改变用户现有宿主 AI 的工作方式。 处理方式：安装前先检查插件 manifest 和 Skill 文件，必要时隔离测试。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `plugin/.claude-plugin/plugin.json` Claim：`clm_0031` inferred 0.45\n- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md`, `packages/@monomind/aidefence/README.md`, `packages/@monomind/claims/README.md`, `packages/@monomind/cli/src/ruvector/README.md` Claim：`clm_0032` supported 0.86, `clm_0045` contradicted 0.20\n- **源文档冲突：skill_count**：项目文档中存在数量表述不一致，AI Context Pack 必须提示用户不要把单一数字当作已验证事实。 处理方式：在 Human Manual 和 AI Context Pack 中共同标记为待核实，而不是强行选择一个数字。 证据：`packages/implementation/integration/AGENTS-SKILLS-COMMANDS-HOOKS.md`, `packages/implementation/adrs/ADR-071-guidance-tools-mcp-fixes.md`, `.claude/skills/skill-builder/SKILL.md` Claim：`clm_0033` supported 0.86, `clm_0044` contradicted 0.20\n- **源文档冲突：agent_count**：项目文档中存在数量表述不一致，AI Context Pack 必须提示用户不要把单一数字当作已验证事实。 处理方式：在 Human Manual 和 AI Context Pack 中共同标记为待核实，而不是强行选择一个数字。 证据：`packages/implementation/migration/v3-migration-roadmap.md`, `features/tagline.md`, `packages/implementation/optimization/V1-OPTIMIZATION-ROADMAP.md`, `packages/implementation/swarm-plans/AGENT-SPECIFICATIONS.md` 等 Claim：`clm_0034` inferred 0.45\n- **源文件冲突 skill_count**：发现多个值 `28, 37, 100`，应在真实使用前核实。\n- **源文件冲突 agent_count**：发现多个值 `10, 15, 54, 58, 76, 100, 107, 230`，应在真实使用前核实。\n- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。\n- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。\n- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。\n\n## 开工前工作上下文\n\n### 加载顺序\n\n- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。\n- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。\n- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。\n- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。\n- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。\n\n### 任务路由\n\n- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.claude/skills/agent-browser-testing/SKILL.md`, `.claude/skills/agentdb-advanced/SKILL.md`, `.claude/skills/agentdb-learning/SKILL.md`, `.claude/skills/agentdb-memory-patterns/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **多宿主安装与分发**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `plugin/.claude-plugin/plugin.json`\n- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md`, `packages/@monomind/aidefence/README.md`, `packages/@monomind/claims/README.md`, `packages/@monomind/cli/src/ruvector/README.md` Claim：`clm_0003` supported 0.86\n\n### 上下文规模\n\n- 文件总数：2656\n- 重要文件覆盖：40/2656\n- 证据索引条目：117\n- 角色 / Skill 条目：37\n\n### 证据不足时的处理\n\n- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。\n- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。\n- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。\n- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。\n\n## Prompt Recipes\n\n### 适配判断\n\n- 目标：判断这个项目是否适合用户当前任务。\n- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。\n\n```text\n请基于 monomind 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。\n```\n\n### 安装前体验\n\n- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。\n- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。\n\n```text\n请把 monomind 当作安装前体验资产，而不是已安装工具或真实运行环境。\n\n请严格输出四段：\n1. 先问我 3 个必要问题。\n2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。\n3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。\n4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。\n\n硬性边界：\n- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。\n- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。\n- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。\n- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。\n- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。\n- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。\n\n```\n\n### 角色 / Skill 选择\n\n- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。\n- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。\n\n```text\n请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。\n```\n\n### 风险预检\n\n- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。\n- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。\n\n```text\n请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。\n```\n\n### 宿主 AI 开工指令\n\n- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。\n- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。\n\n```text\n请基于 monomind 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。\n```\n\n\n## 角色 / Skill 索引\n\n- 共索引 37 个角色 / Skill / 项目文档条目。\n\n- **agent-browser-testing**（skill）：UI testing and task walkthrough using agent-browser — install, navigate, test golden paths, report issues, and help users accomplish tasks through any web UI 激活提示：当用户任务与“agent-browser-testing”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agent-browser-testing/SKILL.md`\n- **agentdb-advanced**（skill）：Master advanced AgentDB features including QUIC synchronization, multi-database management, custom distance metrics, hybrid search, and distributed systems integration. Use when building distributed AI systems, multi-agent coordination, or advanced vector search applications. 激活提示：当用户任务与“agentdb-advanced”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentdb-advanced/SKILL.md`\n- **agentdb-learning**（skill）：Create and train AI learning plugins with AgentDB's 9 reinforcement learning algorithms. Includes Decision Transformer, Q-Learning, SARSA, Actor-Critic, and more. Use when building self-learning agents, implementing RL, or optimizing agent behavior through experience. 激活提示：当用户任务与“agentdb-learning”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentdb-learning/SKILL.md`\n- **agentdb-memory-patterns**（skill）：Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use when building stateful agents, chat systems, or intelligent assistants. 激活提示：当用户任务与“agentdb-memory-patterns”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentdb-memory-patterns/SKILL.md`\n- **agentdb-optimization**（skill）：Optimize AgentDB performance with quantization 4-32x memory reduction , HNSW indexing 150x faster search , caching, and batch operations. Use when optimizing memory usage, improving search speed, or scaling to millions of vectors. 激活提示：当用户任务与“agentdb-optimization”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentdb-optimization/SKILL.md`\n- **agentdb-vector-search**（skill）：Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG systems, semantic search engines, or intelligent knowledge bases. 激活提示：当用户任务与“agentdb-vector-search”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentdb-vector-search/SKILL.md`\n- **agentic-integration**（skill）：Code deduplication architecture implementing ADR-001. Eliminates 10,000+ duplicate lines by consolidating overlapping coordination systems using SONA, Flash Attention, and AgentDB. 激活提示：当用户任务与“agentic-integration”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentic-integration/SKILL.md`\n- **agentic-jujutsu**（skill）： 激活提示：当用户任务与“agentic-jujutsu”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/agentic-jujutsu/SKILL.md`\n- **cli-modernization**（skill）：CLI modernization and hooks system enhancement for monomind. Implements interactive prompts, command decomposition, enhanced hooks integration, and intelligent workflow automation. 激活提示：当用户任务与“cli-modernization”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/cli-modernization/SKILL.md`\n- **core-implementation**（skill）：Core module implementation for monomind. Implements DDD domains, clean architecture patterns, dependency injection, and modular TypeScript codebase with comprehensive testing. 激活提示：当用户任务与“core-implementation”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/core-implementation/SKILL.md`\n- **ddd-architecture**（skill）：Domain-Driven Design architecture for monomind. Implements modular, bounded context architecture with clean separation of concerns and microkernel pattern. 激活提示：当用户任务与“ddd-architecture”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/ddd-architecture/SKILL.md`\n- **github-code-review**（skill）：Comprehensive GitHub code review with AI-powered swarm coordination 激活提示：当用户任务与“github-code-review”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/github-code-review/SKILL.md`\n- **github-multi-repo**（skill）： 激活提示：当用户任务与“github-multi-repo”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/github-multi-repo/SKILL.md`\n- **github-project-management**（skill）： 激活提示：当用户任务与“github-project-management”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/github-project-management/SKILL.md`\n- **github-release-management**（skill）： 激活提示：当用户任务与“github-release-management”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/github-release-management/SKILL.md`\n- **github-workflow-automation**（skill）： 激活提示：当用户任务与“github-workflow-automation”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/github-workflow-automation/SKILL.md`\n- **hive-mind-advanced**（skill）： 激活提示：当用户任务与“hive-mind-advanced”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/hive-mind-advanced/SKILL.md`\n- **hooks-automation**（skill）：Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows. 激活提示：当用户任务与“hooks-automation”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/hooks-automation/SKILL.md`\n- **mcp-optimization**（skill）：MCP server optimization and transport layer enhancement for monomind. Implements connection pooling, load balancing, tool registry optimization, and performance monitoring for sub-100ms response times. 激活提示：当用户任务与“mcp-optimization”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/mcp-optimization/SKILL.md`\n- **memory-unification**（skill）：Unify 6+ memory systems into AgentDB with HNSW indexing for 150x-12,500x search improvements. Implements ADR-006 Unified Memory Service and ADR-009 Hybrid Memory Backend . 激活提示：当用户任务与“memory-unification”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/memory-unification/SKILL.md`\n- **monodesign**（skill）：Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, research users, build a component system, generate design images, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy… 激活提示：当用户任务与“monodesign”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/monodesign/SKILL.md`\n- **monomotion**（skill）：HTML-native animation system using GSAP — timeline-driven, API-controllable animations that run in the browser without video rendering or React. Covers timeline control, WebSocket/REST-driven playback, effects, and sequencing. 激活提示：当用户任务与“monomotion”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/monomotion/SKILL.md`\n- **pair-programming**（skill）：AI-assisted pair programming with multiple modes driver/navigator/switch , real-time verification, quality monitoring, and comprehensive testing. Supports TDD, debugging, refactoring, and learning sessions. Features automatic role switching, continuous code review, security scanning, and performance optimization with truth-score verification. 激活提示：当用户任务与“pair-programming”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/pair-programming/SKILL.md`\n- **performance-analysis**（skill）： 激活提示：当用户任务与“performance-analysis”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/performance-analysis/SKILL.md`\n- **performance-optimization**（skill）：Achieve aggressive performance targets: 2.49x-7.47x Flash Attention speedup, 150x-12,500x search improvements, 50-75% memory reduction. Comprehensive benchmarking and optimization suite. 激活提示：当用户任务与“performance-optimization”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/performance-optimization/SKILL.md`\n- **reasoningbank-agentdb**（skill）：Implement ReasoningBank adaptive learning with AgentDB's 150x faster vector database. Includes trajectory tracking, verdict judgment, memory distillation, and pattern recognition. Use when building self-learning agents, optimizing decision-making, or implementing experience replay systems. 激活提示：当用户任务与“reasoningbank-agentdb”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/reasoningbank-agentdb/SKILL.md`\n- **reasoningbank-intelligence**（skill）：Implement adaptive learning with ReasoningBank for pattern recognition, strategy optimization, and continuous improvement. Use when building self-learning agents, optimizing workflows, or implementing meta-cognitive systems. 激活提示：当用户任务与“reasoningbank-intelligence”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/reasoningbank-intelligence/SKILL.md`\n- **security-hardening**（skill）：Complete security architecture hardening for monomind. Addresses critical CVEs CVE-1, CVE-2, CVE-3 and implements secure-by-default patterns. Use for security-first implementation. 激活提示：当用户任务与“security-hardening”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/security-hardening/SKILL.md`\n- **skill-builder**（skill）：Create new Claude Code Skills with proper YAML frontmatter, progressive disclosure structure, and complete directory organization. Use when you need to build custom skills for specific workflows, generate skill templates, or understand the Claude Skills specification. 激活提示：当用户任务与“skill-builder”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/skill-builder/SKILL.md`\n- **sparc-methodology**（skill）： 激活提示：当用户任务与“sparc-methodology”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/sparc-methodology/SKILL.md`\n- **specialagent**（skill）：Find the single best specialized agent from the full 160+ agent roster using two-stage LLM domain→agent selection 激活提示：当用户任务与“specialagent”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/specialagent/SKILL.md`\n- **stop-slop**（skill）：Remove AI writing patterns from prose. Use when drafting, editing, or reviewing any text to eliminate predictable AI tells — phrases, structural clichés, false agency, passive voice. 激活提示：当用户任务与“stop-slop”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/stop-slop/SKILL.md`\n- **stream-chain**（skill）：Stream-JSON chaining for multi-agent pipelines, data transformation, and sequential workflows 激活提示：当用户任务与“stream-chain”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/stream-chain/SKILL.md`\n- **swarm-advanced**（skill）： 激活提示：当用户任务与“swarm-advanced”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/swarm-advanced/SKILL.md`\n- **swarm-coordination**（skill）：15-agent hierarchical mesh coordination for complex implementations. Orchestrates parallel execution across security, core, and integration domains following 10 ADRs with 14-week timeline. 激活提示：当用户任务与“swarm-coordination”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/swarm-coordination/SKILL.md`\n- **swarm-orchestration**（skill）：Orchestrate multi-agent swarms with monomind for parallel task execution, dynamic topology, and intelligent coordination. Use when scaling beyond single agents, implementing complex workflows, or building distributed AI systems. 激活提示：当用户任务与“swarm-orchestration”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/swarm-orchestration/SKILL.md`\n- **verification-quality**（skill）： 激活提示：当用户任务与“verification-quality”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.claude/skills/verification-quality/SKILL.md`\n\n## 证据索引\n\n- 共索引 117 条证据。\n\n- **Monomind v1 - Architecture Decision Records**（documentation）：Monomind v1 - Architecture Decision Records 证据：`packages/docs/adr/README.md`\n- **Coherence Engine Domain**（documentation）：The Coherence Engine domain provides mathematical AI interpretability capabilities for Monomind v1 through the prime-radiant plugin. It enables rigorous coherence validation, spectral stability analysis, and causal reasoning using advanced mathematical frameworks including Sheaf Cohomology, Spectral Graph Theory, and Do-Calculus. 证据：`packages/docs/ddd/coherence-engine/README.md`\n- **Quality Engineering Domain**（documentation）：The Quality Engineering QE domain provides comprehensive automated testing, quality assessment, and continuous validation capabilities for Monomind v1. It is implemented as the @monomind/quality-engineering plugin with 51 specialized QE agents organized across 12 Domain-Driven Design bounded contexts. 证据：`packages/docs/ddd/quality-engineering/README.md`\n- **🚀 Monomind Plugin - Complete Enterprise AI Agent Orchestration**（documentation）：🚀 Monomind Plugin - Complete Enterprise AI Agent Orchestration 证据：`.claude-plugin/README.md`\n- **Claude Code Configuration - Monomind v1.5**（documentation）：Claude Code Configuration - Monomind v1.5 证据：`CLAUDE.md`\n- **Why Monomind?**（documentation）：The orchestration layer that turns Claude Code into an autonomous engineering team. 证据：`README.md`\n- **Monomind V1**（documentation）：Modular AI Agent Coordination System - A complete reimagining of Monomind with 15-agent hierarchical mesh swarm coordination. 证据：`packages/README.md`\n- **Agents Commands**（documentation）：Commands for agents operations in Monomind. 证据：`.claude/commands/agents/README.md`\n- **Analysis Commands**（documentation）：Commands and guidance for performance analysis and token optimization in Monomind. 证据：`.claude/commands/analysis/README.md`\n- **Automation Commands**（documentation）：Commands and guidance for agent automation, self-healing, and session management in Monomind. 证据：`.claude/commands/automation/README.md`\n- **Coordination Commands**（documentation）：Commands and guidance for swarm coordination and task orchestration in Monomind. 证据：`.claude/commands/coordination/README.md`\n- **GitHub Commands**（documentation）：Commands and guidance for GitHub workflow automation in Monomind. All GitHub operations use the gh CLI and real monomind MCP tools — there is no monomind github CLI command group. 证据：`.claude/commands/github/README.md`\n- **Hive-Mind Commands**（documentation）：Queen-led consensus-based multi-agent coordination system. All operations use the mcp monomind hive-mind MCP tools. 证据：`.claude/commands/hive-mind/README.md`\n- **Hooks Commands**（documentation）：Self-learning hooks system for intelligent workflow automation. Invoked as npx monomind hooks . 证据：`.claude/commands/hooks/README.md`\n- **Memory Commands**（documentation）：Commands for the AgentDB memory system — vector search, namespaced storage, HNSW indexing, and cross-session persistence. 证据：`.claude/commands/memory/README.md`\n- **Monitoring Commands**（documentation）：Commands for monitoring Monomind system health — swarm status, agents, tasks, memory, and performance metrics. 证据：`.claude/commands/monitoring/README.md`\n- **status agents**（documentation）：Show detailed agent status — ID, type, current task, uptime, and success rate for all running agents. 证据：`.claude/commands/monitoring/agents.md`\n- **Monograph Commands**（documentation）：Knowledge graph for code and documents — build, search, and explore relationships across your entire codebase and documentation. 证据：`.claude/commands/monograph/README.md`\n- **Optimization Commands**（documentation）：Guides and commands for optimizing Monomind performance — swarm topology, parallel execution, and system-level tuning. 证据：`.claude/commands/optimization/README.md`\n- **Pair Programming with Claude Code**（documentation）：Collaborative development using Claude Code as your AI pair partner. No special CLI needed — Claude Code IS the pair partner. 证据：`.claude/commands/pair/README.md`\n- **Swarm Skills**（documentation）：Multi-agent swarm coordination for Monomind. 证据：`.claude/commands/swarm/README.md`\n- **Training Skills**（documentation）：Neural network training, pattern learning, and agent specialization for Monomind. 证据：`.claude/commands/training/README.md`\n- **Workflows Skills**（documentation）：Skills for running and managing multi-agent workflows in Monomind. 证据：`.claude/commands/workflows/README.md`\n- **MonoMind v1 Helpers**（documentation）：This directory contains helper scripts and utilities for v1 development. 证据：`.claude/helpers/README.md`\n- **Mastermind Agents**（documentation）：This skill is invoked by mastermind:agents or directly via /mastermind:agents . 证据：`.claude/skills/mastermind/agents.md`\n- **@monomind/aidefence**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/aidefence?color=blue&label=npm https://www.npmjs.com/package/@monomind/aidefence ! npm downloads https://img.shields.io/npm/dm/@monomind/aidefence?color=green https://www.npmjs.com/package/@monomind/aidefence ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.3+-blue.svg https://www.typescriptlang.org/ ! Node.js https://img.shields.io/badge/Node.js-18+-green.svg https://nodejs.org/ 证据：`packages/@monomind/aidefence/README.md`\n- **@monomind/claims**（documentation）：Issue claiming and work coordination for human-agent collaboration. 证据：`packages/@monomind/claims/README.md`\n- **Claude Code Configuration - Monomind v1.5**（documentation）：Claude Code Configuration - Monomind v1.5 证据：`packages/@monomind/cli/CLAUDE.md`\n- **Why Monomind?**（documentation）：The orchestration layer that turns Claude Code into an autonomous engineering team. 证据：`packages/@monomind/cli/README.md`\n- **CLI Module Tests**（documentation）：This directory contains comprehensive tests for the V1 CLI module using Vitest. 证据：`packages/@monomind/cli/__tests__/README.md`\n- **RuVector NPM Package API Documentation**（documentation）：RuVector NPM Package API Documentation 证据：`packages/@monomind/cli/src/ruvector/README.md`\n- **@monomind/embeddings**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/embeddings.svg https://www.npmjs.com/package/@monomind/embeddings ! npm downloads https://img.shields.io/npm/dm/@monomind/embeddings.svg https://www.npmjs.com/package/@monomind/embeddings ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! Performance https://img.shields.io/badge/Performance-<5ms-brightgreen.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/embeddings/README.md`\n- **@monomind/guidance**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/guidance.svg?style=flat-square&label=npm https://www.npmjs.com/package/@monomind/guidance ! npm downloads https://img.shields.io/npm/dm/@monomind/guidance.svg?style=flat-square&label=downloads https://www.npmjs.com/package/@monomind/guidance ! license https://img.shields.io/npm/l/@monomind/guidance.svg?style=flat-square https://github.com/nokhodian/monomind/blob/main/LICENSE ! tests https://img.shields.io/badge/tests-1%2C328%20passing-brightgreen?style=flat-square https://github.com/nokhodian/monomind ! node https://img.shields.io/badge/node-%3E%3D20-blue?style=flat-square https://nodejs.org ! TypeScript https://img.shields.io/badge/TypeS… 证据：`packages/@monomind/guidance/README.md`\n- **@monomind/hooks**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/hooks.svg https://www.npmjs.com/package/@monomind/hooks ! npm downloads https://img.shields.io/npm/dm/@monomind/hooks.svg https://www.npmjs.com/package/@monomind/hooks ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.3+-blue.svg https://www.typescriptlang.org/ ! Node.js https://img.shields.io/badge/Node.js-20+-green.svg https://nodejs.org/ 证据：`packages/@monomind/hooks/README.md`\n- **Claude Code Configuration - Monomind v1.5**（documentation）：Claude Code Configuration - Monomind v1.5 证据：`packages/@monomind/mcp/CLAUDE.md`\n- **@monomind/mcp**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/mcp.svg https://www.npmjs.com/package/@monomind/mcp ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! MCP 2025-11-25 https://img.shields.io/badge/MCP-2025--11--25-blue.svg https://modelcontextprotocol.io ! Standalone https://img.shields.io/badge/Module-Standalone-green.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/mcp/README.md`\n- **@monomind/memory**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/memory.svg https://www.npmjs.com/package/@monomind/memory ! npm downloads https://img.shields.io/npm/dm/@monomind/memory.svg https://www.npmjs.com/package/@monomind/memory ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! Performance https://img.shields.io/badge/Performance-150x--12500x%20Faster-brightgreen.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/memory/README.md`\n- **@monomind/neural**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/neural.svg https://www.npmjs.com/package/@monomind/neural ! npm downloads https://img.shields.io/npm/dm/@monomind/neural.svg https://www.npmjs.com/package/@monomind/neural ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! AI Learning https://img.shields.io/badge/AI-Self--Learning-purple.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/neural/README.md`\n- **Neural Module Test Suite**（documentation）：Comprehensive test coverage for the V1 neural module with 106 tests across 3 test files. 证据：`packages/@monomind/neural/__tests__/README.md`\n- **@monomind/performance**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/performance.svg https://www.npmjs.com/package/@monomind/performance ! npm downloads https://img.shields.io/npm/dm/@monomind/performance.svg https://www.npmjs.com/package/@monomind/performance ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! Benchmarks https://img.shields.io/badge/Benchmarks-Vitest-green.svg https://vitest.dev/ 证据：`packages/@monomind/performance/README.md`\n- **Performance Module Test Suite**（documentation）：Comprehensive test coverage for the @monomind/performance module, focusing on Flash Attention optimization and benchmark validation. 证据：`packages/@monomind/performance/__tests__/README.md`\n- **@monomind/plugins**（documentation）：A comprehensive plugin development framework providing workers, hooks, providers, and security utilities for building Monomind extensions. 证据：`packages/@monomind/plugins/README.md`\n- **RuVector PostgreSQL Bridge Examples**（documentation）：RuVector PostgreSQL Bridge Examples 证据：`packages/@monomind/plugins/examples/ruvector/README.md`\n- **@monomind/security**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/security.svg https://www.npmjs.com/package/@monomind/security ! npm downloads https://img.shields.io/npm/dm/@monomind/security.svg https://www.npmjs.com/package/@monomind/security ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! Security Audit https://img.shields.io/badge/Security-Audited-green.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/security/README.md`\n- **@monomind/shared**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/shared.svg https://www.npmjs.com/package/@monomind/shared ! npm downloads https://img.shields.io/npm/dm/@monomind/shared.svg https://www.npmjs.com/package/@monomind/shared ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! Core https://img.shields.io/badge/Module-Core-blue.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/shared/README.md`\n- **Hooks System**（documentation）：Extensible hook points for tool execution, file operations, and lifecycle events. Integrates with the event bus for coordination and monitoring. 证据：`packages/@monomind/shared/src/hooks/README.md`\n- **@monomind/swarm**（documentation）：! npm version https://img.shields.io/npm/v/@monomind/swarm.svg https://www.npmjs.com/package/@monomind/swarm ! npm downloads https://img.shields.io/npm/dm/@monomind/swarm.svg https://www.npmjs.com/package/@monomind/swarm ! License: MIT https://img.shields.io/badge/License-MIT-yellow.svg https://opensource.org/licenses/MIT ! TypeScript https://img.shields.io/badge/TypeScript-5.0+-blue.svg https://www.typescriptlang.org/ ! ADR-003 https://img.shields.io/badge/ADR--003-Compliant-green.svg https://github.com/nokhodian/monomind ! Agents https://img.shields.io/badge/Agents-Up%20to%20100+-orange.svg https://github.com/nokhodian/monomind 证据：`packages/@monomind/swarm/README.md`\n- **Integration Test Suite**（documentation）：Comprehensive cross-module integration tests for monomind V1 architecture. 证据：`packages/__tests__/integration/README.md`\n- **Monomind V1 Helper System**（documentation）：The V1 Helper System provides cross-platform automation and development tools for monomind v1 users. These helpers enable automatic progress tracking, checkpointing, GitHub integration, and development workflow automation. 证据：`packages/helpers/README.md`\n- **Implementation Documentation**（documentation）：This directory contains all implementation documentation, planning, and research for Monomind V1. 证据：`packages/implementation/README.md`\n- **Architecture Decision Records ADRs**（documentation）：Note: This index covers ADR-001 through approximately ADR-015. For ADR-016 onward, see v3-adrs.md. The two files together form the complete ADR index. 证据：`packages/implementation/adrs/README.md`\n- **Hooks System Implementation**（documentation）：The V1 Hooks System provides a comprehensive event-driven architecture for intercepting, modifying, and recording operations throughout the monomind lifecycle. It integrates with the ReasoningBank neural learning system to enable self-improving agent behaviors. 证据：`packages/implementation/hooks/README.md`\n- **Init System**（documentation）：Comprehensive initialization system for Claude Code integration with monomind V1. 证据：`packages/implementation/init/README.md`\n- **Monomind V1 Plugin System**（documentation）：Domain-Driven Design Plugin-Based Architecture ADR-004 证据：`packages/implementation/plugins/README.md`\n- **@monomind/plugin-agentic-qe**（documentation）：AI-powered quality engineering that writes tests, finds bugs, and breaks things safely so your users don't have to. 证据：`packages/plugins/agentic-qe/README.md`\n- **@monomind/plugin-gastown-bridge**（documentation）：WASM-Accelerated Bridge to Steve Yegge's Gas Town Multi-Agent Orchestrator 证据：`packages/plugins/gastown-bridge/README.md`\n- **@monomind/plugin-prime-radiant**（documentation）：Mathematical AI that catches contradictions, verifies consensus, and prevents hallucinations before they cause problems. 证据：`packages/plugins/prime-radiant/README.md`\n- **RuVector Upstream WASM Packages**（documentation）：This directory contains references and integration bridges for upstream RuVector WASM packages used by Monomind plugins. 证据：`packages/plugins/ruvector-upstream/README.md`\n- **@monomind/teammate-plugin**（documentation）：Native TeammateTool integration plugin for Monomind. Bridges Claude Code v2.1.19+ multi-agent orchestration capabilities with Monomind's swarm system. 证据：`packages/plugins/teammate-plugin/README.md`\n- **Monomind Deep Regression Test Suite**（documentation）：Monomind Deep Regression Test Suite 证据：`tests/docker-regression/README.md`\n- 其余 57 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。\n\n## 宿主 AI 必须遵守的规则\n\n- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`packages/docs/adr/README.md`, `packages/docs/ddd/coherence-engine/README.md`, `packages/docs/ddd/quality-engineering/README.md`\n- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`packages/docs/adr/README.md`, `packages/docs/ddd/coherence-engine/README.md`, `packages/docs/ddd/quality-engineering/README.md`\n\n## 用户开工前应该回答的问题\n\n- 你准备在哪个宿主 AI 或本地环境中使用它？\n- 你只是想先体验工作流，还是准备真实安装？\n- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？\n\n## 验收标准\n\n- 所有能力声明都能回指到 evidence_refs 中的文件路径。\n- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。\n- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。\n\n---\n\n## Doramagic Context Augmentation\n\n下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。\n\n## Human Manual 骨架\n\n使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。\n\n宿主 AI 硬性规则：\n- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。\n- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。\n- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。\n\n- **Getting Started with Monomind**：importance `high`\n  - source_paths: README.md, CLAUDE.md, CLAUDE.local.md, package.json, packages/package.json\n- **Project Structure**：importance `high`\n  - source_paths: packages/@monomind/cli, packages/@monomind/memory, packages/@monomind/hooks, packages/@monomind/swarm, packages/@monomind/shared\n- **Architecture Overview**：importance `high`\n  - source_paths: packages/@monomind/cli/src/index.ts, packages/@monomind/mcp/src/server.ts, packages/@monomind/shared/src/index.ts, packages/@monomind/shared/src/core/orchestrator/index.ts\n- **Core Packages**：importance `high`\n  - source_paths: packages/@monomind/cli/README.md, packages/@monomind/memory/README.md, packages/@monomind/hooks/README.md, packages/@monomind/swarm/README.md, packages/@monomind/mcp/README.md\n- **Agent Catalog**：importance `high`\n  - source_paths: .claude/agents/core/coder.md, .claude/agents/core/planner.md, .claude/agents/core/researcher.md, .claude/agents/engineering/engineering-backend-architect.md, .claude/agents/engineering/engineering-security-engineer.md\n- **Agent Routing System**：importance `high`\n  - source_paths: packages/@monomind/routing/src/index.ts, packages/@monomind/routing/src/route-layer.ts, packages/@monomind/routing/src/capability-index.ts, packages/@monomind/routing/src/llm-fallback.ts, packages/@monomind/routing/src/routes/index.ts\n- **Swarm Topologies**：importance `high`\n  - source_paths: packages/@monomind/swarm/src/index.ts, packages/@monomind/swarm/src/unified-coordinator.ts, packages/@monomind/swarm/src/attention-coordinator.ts, packages/@monomind/swarm/src/coordination/swarm-hub.ts, packages/@monomind/swarm/src/coordination/task-orchestrator.ts\n- **Consensus Protocols**：importance `medium`\n  - source_paths: packages/@monomind/swarm/src/consensus/index.ts, packages/@monomind/swarm/src/consensus/raft.ts, packages/@monomind/swarm/src/consensus/byzantine.ts, packages/@monomind/swarm/src/consensus/gossip.ts, packages/@monomind/cli/src/consensus/audit-writer.ts\n\n## Repo Inspection Evidence / 源码检查证据\n\n- repo_clone_verified: true\n- repo_inspection_verified: true\n- repo_commit: `76718e6d821b0c3e1c54bc05c7928c6bcde1ab70`\n- inspected_files: `pnpm-lock.yaml`, `package.json`, `README.md`, `docs/CHANGES-v1.10.md`, `packages/tsconfig.base.json`, `packages/package-lock.json`, `packages/vitest.config.ts`, `packages/pnpm-lock.yaml`, `packages/pnpm-workspace.yaml`, `packages/package.json`, `packages/README.md`, `packages/tsconfig.json`, `packages/CHANGELOG.md`, `packages/bunfig.toml`, `packages/plugins/SECURITY-AUDIT.md`, `packages/__tests__/setup.ts`, `packages/implementation/README.md`, `packages/implementation/PLUGIN_INTEGRATION.md`, `packages/scripts/prepare-publish.js`, `packages/helpers/README.md`\n\n宿主 AI 硬性规则：\n- 没有 repo_clone_verified=true 时，不得声称已经读过源码。\n- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。\n- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。\n\n## Doramagic Pitfall Constraints / 踩坑约束\n\n这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。\n\n### Constraint 1: 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_ba46bd2053364ab7b216b1ab09b3714a | https://github.com/monoes/monomind/releases/tag/v1.10.0 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 2: 来源证据：v1.6.8\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.6.8\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_8e00eb27c790432ba99d18d7125b0cee | https://github.com/monoes/monomind/releases/tag/v1.6.8 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 3: 来源证据：v1.9.12 — mastermind:idea pipeline hardening\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.12 — mastermind:idea pipeline hardening\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_6a79f40d2c5e44c4ac6b5e2e855d2a55 | https://github.com/monoes/monomind/releases/tag/v1.9.12 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 4: 来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.13 — fix: monograph never installed (workspace:* dep)\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_2ffa187842b347428cc973816067e095 | https://github.com/monoes/monomind/releases/tag/v1.9.13 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 5: 来源证据：v1.9.2 — mastermind:master hardening\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.2 — mastermind:master hardening\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能阻塞安装或首次运行。\n- Evidence: community_evidence:github | cevd_d4070dac80cb428ba72244762274a6bf | https://github.com/monoes/monomind/releases/tag/v1.9.2 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 6: 可能修改宿主 AI 配置\n\n- Trigger: 项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。\n- Host AI rule: 列出会写入的配置文件、目录和卸载/回滚步骤。\n- Why it matters: 安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。\n- Evidence: capability.host_targets | github_repo:1221944165 | https://github.com/monoes/monomind | host_targets=mcp_host, claude, claude_code\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 7: 能力判断依赖假设\n\n- Trigger: README/documentation is current enough for a first validation pass.\n- Host AI rule: 将假设转成下游验证清单。\n- Why it matters: 假设不成立时，用户拿不到承诺的能力。\n- Evidence: capability.assumptions | github_repo:1221944165 | https://github.com/monoes/monomind | README/documentation is current enough for a first validation pass.\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 8: 来源证据：v1.9.1 — Init wipe-and-replace for managed Claude assets\n\n- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v1.9.1 — Init wipe-and-replace for managed Claude assets\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_e1832d706e974245bfbf1fb183aeafb8 | https://github.com/monoes/monomind/releases/tag/v1.9.1 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 9: 维护活跃度未知\n\n- Trigger: 未记录 last_activity_observed。\n- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。\n- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- Evidence: evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | last_activity_observed missing\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 10: 下游验证发现风险项\n\n- Trigger: no_demo\n- Host AI rule: 进入安全/权限治理复核队列。\n- Why it matters: 下游已经要求复核，不能在页面中弱化。\n- Evidence: downstream_validation.risk_items | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n",
      "summary": "给宿主 AI 的上下文和工作边界。",
      "title": "AI Context Pack / 带给我的 AI"
    },
    "boundary_risk_card": {
      "asset_id": "boundary_risk_card",
      "filename": "BOUNDARY_RISK_CARD.md",
      "markdown": "# Boundary & Risk Card / 安装前决策卡\n\n项目：monoes/monomind\n\n## Doramagic 试用结论\n\n当前结论：可以进入发布前推荐检查；首次使用仍应从最小权限、临时目录和可回滚配置开始。\n\n## 用户现在可以做\n\n- 可以先阅读 Human Manual，理解项目目的和主要工作流。\n- 可以复制 Prompt Preview 做安装前体验；这只验证交互感，不代表真实运行。\n- 可以把官方 Quick Start 命令放到隔离环境中验证，不要直接进主力环境。\n\n## 现在不要做\n\n- 不要把 Prompt Preview 当成项目实际运行结果。\n- 不要把 metadata-only validation 当成沙箱安装验证。\n- 不要把未验证能力写成“已支持、已跑通、可放心安装”。\n- 不要在首次试用时交出生产数据、私人文件、真实密钥或主力配置目录。\n\n## 安装前检查\n\n- 宿主 AI 是否匹配：mcp_host, claude, claude_code\n- 官方安装入口状态：已发现官方入口\n- 是否在临时目录、临时宿主或容器中验证：必须是\n- 是否能回滚配置改动：必须能\n- 是否需要 API Key、网络访问、读写文件或修改宿主配置：未确认前按高风险处理\n- 是否记录了安装命令、实际输出和失败日志：必须记录\n\n## 当前阻塞项\n\n- 无阻塞项。\n\n## 项目专属踩坑\n\n- 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：v1.6.8（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：v1.9.12 — mastermind:idea pipeline hardening（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：v1.9.2 — mastermind:master hardening（medium）：可能阻塞安装或首次运行。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n\n## 风险与权限提示\n\n- no_demo: medium\n\n## 证据缺口\n\n- 暂未发现结构化证据缺口。\n",
      "summary": "安装、权限、验证和推荐前风险。",
      "title": "Boundary & Risk Card / 边界与风险卡"
    },
    "human_manual": {
      "asset_id": "human_manual",
      "filename": "HUMAN_MANUAL.md",
      "markdown": "# https://github.com/monoes/monomind 项目说明书\n\n生成时间：2026-05-17 00:56:32 UTC\n\n## 目录\n\n- [Getting Started with Monomind](#getting-started)\n- [Project Structure](#project-structure)\n- [Architecture Overview](#architecture-overview)\n- [Core Packages](#packages-core)\n- [Agent Catalog](#agent-catalog)\n- [Agent Routing System](#agent-routing)\n- [Swarm Topologies](#swarm-topologies)\n- [Consensus Protocols](#consensus-protocols)\n- [Memory System](#memory-system)\n- [Knowledge Graph (Monograph)](#knowledge-graph)\n\n<a id='getting-started'></a>\n\n## Getting Started with Monomind\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n- [README.md](https://github.com/monoes/monomind/blob/main/README.md)\n- [packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n- [packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/task.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/task.ts)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n- [packages/helpers/README.md](https://github.com/monoes/monomind/blob/main/packages/helpers/README.md)\n</details>\n\n# Getting Started with Monomind\n\nMonomind is an AI coordination system that orchestrates multiple AI agents to work together on complex software development tasks. It provides a unified CLI interface, memory management, knowledge graphs, and neural learning capabilities that enable agents to share context, learn from patterns, and collaborate effectively.\n\n## Overview\n\nMonomind serves as the central intelligence layer for AI-assisted development workflows. It coordinates agents, manages sessions, stores learned patterns in vector memory, and provides a knowledge graph for understanding codebase relationships. 资料来源：[packages/@monomind/cli/README.md]()\n\n### Key Capabilities\n\n| Capability | Description |\n|------------|-------------|\n| **Agent Orchestration** | Manage and coordinate multiple specialized AI agents |\n| **Session Management** | Save, restore, and export conversation sessions |\n| **Memory & Intelligence** | Vector-based memory with HNSW indexing and neural learning |\n| **Knowledge Graph (Monograph)** | Build dependency graphs of codebases automatically |\n| **MCP Server** | Model Context Protocol server for tool integration |\n| **Workflow Automation** | Create and execute multi-step development workflows |\n\n## Installation\n\n### Prerequisites\n\n- Node.js 18+ and npm/pnpm\n- Git\n\n### Install via npm\n\n```bash\nnpm install -g @monomind/cli\n```\n\nOr use directly with npx:\n\n```bash\nnpx @monomind/cli@latest --help\n```\n\n资料来源：[packages/implementation/adrs/README.md]()\n\n### Verify Installation\n\n```bash\nmonomind doctor --fix\n```\n\nThis command checks the installation and attempts to fix common issues automatically.\n\n资料来源：[README.md]()\n\n## Core Concepts\n\n### Architecture Overview\n\n```mermaid\ngraph TD\n    subgraph Monomind\n        CLI[CLI Interface]\n        MCP[MCP Server]\n        Memory[Vector Memory]\n        Graph[Knowledge Graph]\n        SONA[Neural Learning]\n    end\n    \n    subgraph Agents\n        Coder[Coder Agent]\n        Reviewer[Reviewer Agent]\n        Architect[Architect Agent]\n        Coordinator[Coordinator Agent]\n    end\n    \n    CLI --> MCP\n    CLI --> Memory\n    CLI --> Graph\n    Memory --> SONA\n    Graph --> SONA\n    \n    MCP --> Coder\n    MCP --> Reviewer\n    MCP --> Architect\n    MCP --> Coordinator\n```\n\n### Agent Types\n\nMonomind supports multiple specialized agent types, each with distinct capabilities:\n\n| Agent Type | Capabilities | Use Case |\n|------------|--------------|----------|\n| `coder` | Code generation, refactoring, debugging, testing | Primary development work |\n| `researcher` | Web search, data analysis, summarization, citation | Information gathering |\n| `tester` | Unit testing, integration testing, coverage analysis | Quality assurance |\n| `reviewer` | Code review, security audit, quality check | Code inspection |\n| `architect` | System design, pattern analysis, scalability | Design decisions |\n| `coordinator` | Task orchestration, agent management, workflow control | Multi-agent coordination |\n| `security-architect` | Threat modeling, security patterns, compliance | Security-focused work |\n| `memory-specialist` | Vector search, agentdb, caching, optimization | Memory optimization |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts]()\n\n## CLI Commands Reference\n\n### Session Management\n\nManage conversation sessions with persistence and export capabilities.\n\n```bash\n# List all sessions\nmonomind session list\n\n# Save current session state\nmonomind session save\n\n# Restore a saved session\nmonomind session restore <session-id>\n\n# Delete a saved session\nmonomind session delete <session-id>\n\n# Export session to file\nmonomind session export <session-id> --output ./session.json\n\n# Import session from file\nmonomind session import ./session.json\n\n# Show current active session\nmonomind session current\n```\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts]()\n\n### MCP Server Management\n\nControl the Model Context Protocol server that provides tools to connected agents.\n\n```bash\n# Start MCP server\nmonomind mcp start\n\n# Stop MCP server\nmonomind mcp stop\n\n# Show server status\nmonomind mcp status\n\n# Check server health\nmonomind mcp health\n\n# Restart MCP server\nmonomind mcp restart\n\n# List available tools\nmonomind mcp tools\n\n# Enable/disable specific tools\nmonomind mcp toggle <tool-name> --enable\nmonomind mcp toggle <tool-name> --disable\n\n# Execute a specific tool\nmonomind mcp exec <tool-name> --args <json>\n\n# Show server logs\nmonomind mcp logs\n```\n\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts]()\n\n### Task Management\n\nCreate and manage development tasks for agents to work on.\n\n```bash\n# Create a new task\nmonomind task create \"Implement user authentication\" --priority high\n\n# List all tasks\nmonomind task list\n\n# Get task details\nmonomind task status <task-id>\n\n# Cancel a running task\nmonomind task cancel <task-id>\n\n# Assign task to agent(s)\nmonomind task assign <task-id> --agents coder,reviewer\n\n# Retry a failed task\nmonomind task retry <task-id>\n```\n\n资料来源：[packages/@monomind/cli/src/commands/task.ts]()\n\n### Agent Commands\n\n```bash\n# List available agents\nmonomind agent list\n\n# Show agent metrics\nmonomind agent metrics\n\n# Manage agent pool\nmonomind agent pool status\n\n# Show agent health\nmonomind agent health\n\n# Show agent logs\nmonomind agent logs --agent coder\n\n# Check WASM runtime availability\nmonomind agent wasm-status\n\n# Create a WASM-sandboxed agent\nmonomind agent wasm-create <template>\n\n# List WASM agent gallery templates\nmonomind agent wasm-gallery\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts]()\n\n## Memory & Intelligence System\n\n### Vector Memory (AgentDB + HNSW)\n\nMonomind stores insights, patterns, and decisions in searchable vector memory with HNSW indexing.\n\n```mermaid\ngraph LR\n    A[User Input] --> B[Embedding Generator]\n    B --> C[HNSW Index]\n    C --> D[Vector Search]\n    D --> E[Relevant Results]\n    \n    F[(SQLite)] --> G[Structured Data]\n    G --> E\n```\n\n### Key Features\n\n| Feature | Description |\n|---------|-------------|\n| **HNSW Indexing** | 150x-12,500x faster than brute-force search |\n| **Hybrid Backend** | SQLite for structured data, AgentDB for semantic search |\n| **Cross-Session Persistence** | Context survives restarts |\n| **A-MEM Auto-Linking** | Automatic bidirectional references between stored entries |\n\n资料来源：[packages/@monomind/memory/README.md]()\n\n### Memory Scopes\n\nMemory is organized into three scopes:\n\n| Scope | Path | Purpose |\n|-------|------|---------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n### Utility Functions\n\n```typescript\nimport {\n  resolveAgentMemoryDir,  // Get scope directory path\n  createAgentBridge,       // Create scoped AutoMemoryBridge\n  transferKnowledge,       // Cross-agent knowledge sharing\n  listAgentScopes,         // Discover existing agent scopes\n} from '@monomind/memory';\n\n// Resolve path for an agent scope\nconst dir = resolveAgentMemoryDir('my-agent', 'project');\n// → /workspaces/my-project/.claude/agent-memory/my-agent/\n\n// List all agent scopes in a directory\nconst scopes = await listAgentScopes('/workspaces/my-project');\n```\n\n资料来源：[packages/@monomind/memory/README.md]()\n\n### Knowledge Graph (Monograph)\n\nMonograph builds a full dependency graph of your codebase that is automatically queried before every task.\n\n```bash\n# What files are relevant to my task?\nmonograph_suggest \"add webhook retry logic\"\n# → returns ranked list of files with relevance scores\n\n# What depends on UserService?\nmonograph_query \"UserService dependencies\"\n# → returns file paths + line numbers\n\n# Find the most connected files in the codebase\nmonograph_god_nodes\n# → returns high-centrality internal files\n```\n\n### Node Types in Monograph\n\n| Type | Meaning | Example |\n|------|---------|---------|\n| `File` | Source code file | `.ts`, `.py`, `.md` |\n| `Class` | Code class or interface | `UserService`, `AuthMiddleware` |\n| `Concept` | Extracted semantic concept | `authentication`, `caching` |\n| `PDF` | PDF document chunk | Technical documentation |\n\n### Edge Types\n\n| Relation | Meaning |\n|----------|---------|\n| `IMPORTS` | Code import dependency |\n| `DEFINES` | File defines symbol |\n| `TAGGED_AS` | Section tagged with concept |\n| `CO_OCCURS` | Concepts appear together |\n| `INFERRED` | Claude-extracted semantic relationship |\n| `DESCRIBES` / `CAUSES` / `PART_OF` | LLM-enriched semantic edges |\n\n### CLI vs MCP Usage\n\n| Method | Use Case |\n|--------|----------|\n| **CLI** (`monomind monograph ...`) | One-time builds, manual searches, terminal usage |\n| **MCP tools** (`mcp__monomind__monograph_*`) | Claude Code integration, programmatic queries during tasks |\n\n资料来源：[plugin/commands/monograph/README.md]()\n\n### Neural Learning (SONA)\n\nSelf-Optimizing Neural Adaptation learns from every task:\n\n- **Pattern recognition** improves agent routing over time\n- **Trajectory tracking** identifies what works and what doesn't\n- **Automatic model adaptation** with <0.05ms overhead\n\n## Quick Start Guide\n\n### Step 1: Initialize Monomind\n\n```bash\n# Run the setup wizard\nmonomind init\n\n# Or initialize with specific template\nmonomind init --template minimal\n```\n\nAvailable templates:\n- `minimal` - Quick start with behavioral rules\n- `standard` - Full setup with all features\n- `full` - Complete configuration with hooks and learning\n- `security` - Security-focused configuration\n- `performance` - Performance-optimized setup\n- `solo` - Single developer workflow\n\n### Step 2: Configure Your Environment\n\n```bash\n# Set configuration\nmonomind config set providers.openai.api_key <your-key>\nmonomind config set providers.anthropic.api_key <your-key>\n\n# List current configuration\nmonomind config list\n\n# Export configuration\nmonomind config export ./config.json\n\n# Import configuration\nmonomind config import ./config.json\n```\n\n### Step 3: Start Working\n\n```mermaid\ngraph TD\n    A[Start Session] --> B[Create Task]\n    B --> C[Agent Selection]\n    C --> D{Parallel or Sequential?}\n    D -->|Parallel| E[Swarm Orchestration]\n    D -->|Sequential| F[Single Agent]\n    E --> G[Memory Storage]\n    F --> G\n    G --> H[Pattern Learning]\n    H --> I[Future Task Optimization]\n```\n\n### Step 4: Session Workflow\n\n```bash\n# Start a new session\nmonomind session save\n\n# Work on tasks\nmonomind task create \"Build user dashboard\"\nmonomind task assign <task-id> --agents coder\n\n# Monitor progress\nmonomind task status <task-id>\n\n# Review session details\nmonomind session current\n```\n\n## Cross-Platform Helper Scripts\n\nMonomind includes helper scripts for cross-platform development automation.\n\n### Installation\n\nThe helpers are automatically installed when you run `monomind init` and placed in `.claude/helpers/`.\n\n资料来源：[packages/helpers/README.md]()\n\n### Available Helpers\n\n| Script | Purpose |\n|--------|---------|\n| `monomind-v1.sh status` | Check V1 feature status |\n| `monomind-v1.sh doctor` | Diagnose installation issues |\n| `monomind-v1.sh help` | Show help information |\n\n### Permission Issues (Linux/Mac)\n\n```bash\nfind .claude/helpers -name \"*.sh\" -exec chmod +x {} \\;\n```\n\n### Windows PowerShell Execution Policy\n\n```powershell\nSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n```\n\n资料来源：[packages/helpers/README.md]()\n\n## Configuration Reference\n\n### Configuration File Location\n\nConfiguration is stored in:\n- Project: `.claude/monomind.config.json`\n- User: `~/.config/monomind/config.json`\n\n### Runtime Options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `runtime.claudeMdTemplate` | `'standard'` | CLAUDE.md template to use |\n| `runtime.autoSave` | `true` | Automatically save sessions |\n| `runtime.maxConcurrentAgents` | `4` | Maximum parallel agents |\n\n### Provider Configuration\n\n```bash\n# Configure AI providers\nmonomind providers configure openai\nmonomind providers configure anthropic\nmonomind providers configure local\n\n# Test provider connection\nmonomind providers test openai\n\n# View usage statistics\nmonomind providers usage\n```\n\n## Troubleshooting\n\n### Common Issues\n\n#### Installation Fails\n\n```bash\n# Clear cache and retry\nnpm cache clean --force\nnpm install -g @monomind/cli\n```\n\n#### MCP Server Won't Start\n\n```bash\n# Check server health\nmonomind mcp health\n\n# View logs for errors\nmonomind mcp logs\n\n# Restart the server\nmonomind mcp restart\n```\n\n#### Memory Search Returns No Results\n\n```bash\n# Check memory backend status\nmonomind memory status\n\n# Rebuild vector index\nmonomind memory rebuild\n```\n\n### Diagnostic Commands\n\n```bash\n# Run full diagnostics\nmonomind doctor\n\n# Fix common issues automatically\nmonomind doctor --fix\n\n# Check specific component\nmonomind agent health\nmonomind mcp status\n```\n\n## Contributing\n\n```bash\n# Clone the repository\ngit clone https://github.com/monoes/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run diagnostic and fix\nmonomind doctor --fix\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.\n\n## License\n\nMIT License — See [LICENSE](LICENSE) for details.\n\n---\n\n<a id='project-structure'></a>\n\n## Project Structure\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview), [Core Packages](#packages-core)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli)\n- [packages/@monomind/memory](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory)\n- [packages/@monomind/hooks](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks)\n- [packages/@monomind/swarm](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm)\n- [packages/@monomind/shared](https://github.com/monoes/monomind/blob/main/packages/@monomind/shared)\n- [.claude/agents](https://github.com/monoes/monomind/blob/main/.claude/agents)\n- [.claude/commands](https://github.com/monoes/monomind/blob/main/.claude/commands)\n- [packages/@monomind/plugins](https://github.com/monoes/monomind/blob/main/packages/@monomind/plugins)\n</details>\n\n# Project Structure\n\nMonomind is organized as a **monorepo** using pnpm workspaces, with the primary packages located in the `packages/` directory and Claude Code integration files in the `.claude/` directory.\n\n## Repository Layout\n\n```\nmonomind/\n├── packages/\n│   ├── @monomind/           # Core packages\n│   │   ├── cli/             # Command-line interface\n│   │   ├── memory/          # Vector memory & AgentDB\n│   │   ├── hooks/           # Hook system for automation\n│   │   ├── swarm/           # Multi-agent coordination\n│   │   ├── shared/          # Shared utilities & types\n│   │   ├── plugins/         # Plugin system\n│   │   └── aidefence/       # Security & audit tools\n│   └── plugins/             # External plugins\n│       ├── gastown-bridge/  # Thread-based work tracking\n│       └── teammate-plugin/ # Claude Code integration\n├── .claude/\n│   ├── agents/              # Claude Code agent definitions\n│   └── commands/             # Custom slash commands\n└── README.md\n```\n\n## Core Packages\n\n### @monomind/cli\n\nThe CLI package is the primary user-facing interface for Monomind. It provides commands for:\n\n- **Session Management** — Save, restore, list, delete, export sessions\n- **Memory Operations** — Store, retrieve, search, list, delete entries\n- **Agent Control** — Metrics, pool management, health checks, WASM agents\n- **MCP Server** — Start, stop, health checks, tool execution\n- **Configuration** — Get, set, list, reset config values\n- **Plugins** — Install, uninstall, toggle, list plugins\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts](packages/@monomind/cli/src/commands/session.ts)\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](packages/@monomind/cli/src/commands/memory.ts)\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts](packages/@monomind/cli/src/commands/mcp.ts)\n\n### @monomind/memory\n\nThe memory package implements a hybrid storage backend combining:\n\n| Component | Purpose |\n|-----------|---------|\n| **AgentDB** | HNSW-based vector database for semantic search |\n| **SQLite** | Structured data storage |\n| **A-MEM Auto-Linking** | Zettelkasten-style bidirectional references (arXiv:2409.11987) |\n\nMemory scopes follow a hierarchical structure:\n\n| Scope | Path | Use Case |\n|-------|------|----------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n### @monomind/hooks\n\nThe hooks system provides event-driven automation with support for:\n\n- **Pre/Post Hooks** — Execute before/after operations\n- **Slash Commands** — Custom CLI extensions\n- **Status Line** — Real-time status updates\n\nHooks are configured via JSON:\n\n```json\n{\n  \"onAgentStart\": { \"command\": \"log-agent-start\" },\n  \"onTaskComplete\": { \"type\": \"command\", \"command\": \"notify\" },\n  \"statusLine\": { \"type\": \"command\", \"command\": \"statusline\" }\n}\n```\n\n资料来源：[packages/@monomind/hooks/README.md](packages/@monomind/hooks/README.md)\n\n### @monomind/swarm\n\nMulti-agent coordination system enabling:\n\n- **Swarm Orchestration** — Task distribution across agents\n- **Agent Communication** — Inter-agent messaging protocols\n- **Load Balancing** — Work distribution optimization\n- **Failure Recovery** — Automatic retry and fallback mechanisms\n\n### @monomind/shared\n\nShared utilities and TypeScript types used across all Monomind packages:\n\n- Common interfaces and type definitions\n- Utility functions\n- Constants and configuration schemas\n\n### @monomind/plugins\n\nThe plugin system provides extensibility through:\n\n- **Plugin Discovery** — Automatic plugin detection\n- **Lifecycle Management** — Install, enable, disable, uninstall\n- **Sandboxing** — Isolated plugin execution environments\n\n## Claude Code Integration\n\n### .claude/agents\n\nAgent definitions for Claude Code integration. Each agent can have:\n\n- **System Prompts** — Custom instructions and behavior\n- **Tool Sets** — Specific capabilities and permissions\n- **Memory Scopes** — Dedicated knowledge bases\n\n### .claude/commands\n\nCustom slash commands extend Claude Code's CLI:\n\n```bash\n# Available commands\nmonograph_suggest  # Get relevant file suggestions\nmonograph_query    # Query knowledge graph dependencies\nmonograph_god_nodes # Find highly-connected internal files\n```\n\n## CLAUDE.md Generation\n\nThe CLI includes a CLAUDE.md generator with multiple templates:\n\n```typescript\nexport const CLAUDE_MD_TEMPLATES: Array<{ name: ClaudeMdTemplate; description: string }> = [\n  { name: 'minimal', description: 'Quick start — behavioral rules, anti-drift' },\n  { name: 'standard', description: 'Full features — swarm, hooks, intelligence' },\n  { name: 'full', description: 'Complete — all sections including auto-start' },\n  { name: 'security', description: 'Security-focused — audit, compliance' },\n  { name: 'performance', description: 'Performance-focused — profiling, optimization' },\n  { name: 'solo', description: 'Single agent — no swarm' },\n];\n```\n\n资料来源：[packages/@monomind/cli/src/init/claudemd-generator.ts](packages/@monomind/cli/src/init/claudemd-generator.ts)\n\n## External Plugins\n\n### gastown-bridge\n\nThread-based work tracking system with concepts:\n\n| Concept | Description |\n|---------|-------------|\n| **Bead** | Individual work unit |\n| **Formula** | Multi-leg work order (convoy, workflow, expansion, aspect) |\n| **Thread** | Collection of related beads |\n\n### teammate-plugin\n\nClaude Code integration plugin providing:\n\n- Claude Code version compatibility checking\n- Teammate bridge creation\n- Claude Code plugin system integration\n\n资料来源：[packages/plugins/gastown-bridge/README.md](packages/plugins/gastown-bridge/README.md)\n资料来源：[packages/plugins/teammate-plugin/README.md](packages/plugins/teammate-plugin/README.md)\n\n## Architecture Diagram\n\n```mermaid\ngraph TD\n    subgraph \"User Interface\"\n        CLI[CLI Commands]\n        MCP[MCP Tools]\n        SL[Slash Commands]\n    end\n\n    subgraph \"packages/@monomind\"\n        CLI_PKG[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        SWARM[@monomind/swarm]\n        SHARED[@monomind/shared]\n    end\n\n    subgraph \"Data Layer\"\n        AGENTDB[AgentDB<br/>HNSW Vector DB]\n        SQLITE[SQLite]\n        GRAPH[Knowledge Graph<br/>Monograph]\n    end\n\n    CLI --> CLI_PKG\n    MCP --> CLI_PKG\n    SL --> HOOKS\n\n    CLI_PKG --> MEM\n    CLI_PKG --> HOOKS\n    CLI_PKG --> SWARM\n    HOOKS --> SHARED\n    SWARM --> SHARED\n\n    MEM --> AGENTDB\n    MEM --> SQLITE\n    MEM --> GRAPH\n```\n\n## Memory & Intelligence System\n\nThe Monomind intelligence layer consists of three interconnected systems:\n\n```mermaid\ngraph LR\n    subgraph \"Intelligence\"\n        KG[Knowledge Graph<br/>Monograph]\n        VM[Vector Memory<br/>AgentDB + HNSW]\n        NL[Neural Learning<br/>SONA]\n    end\n\n    KG -.->|Dependency Graph| VM\n    VM -.->|Semantic Search| NL\n    NL -.->|Pattern Learning| KG\n```\n\n### Knowledge Graph (Monograph)\n\nAutomatically builds dependency graphs of codebases:\n\n- `IMPORTS` — Code import dependencies\n- `DEFINES` — File defines symbol\n- `TAGGED_AS` — Section tagged with concept\n- `CO_OCCURS` — Concepts appear together\n- `INFERRED` — Claude-extracted semantic relationship\n\n资料来源：[plugin/commands/monograph/README.md](plugin/commands/monograph/README.md)\n\n## Build & Installation\n\n```bash\n# Clone repository\ngit clone https://github.com/nokhodian/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run diagnostics\nmonomind doctor --fix\n\n# Install CLI globally\nnpx @monomind/cli@latest --help\n```\n\n## Contributing Guidelines\n\n1. Fork the repository and create a feature branch\n2. Run `pnpm install` to install dependencies\n3. Use `monomind doctor --fix` to verify setup\n4. Follow the CLAUDE.md guidelines for code contributions\n\n资料来源：[README.md](README.md)\n\n---\n\n<a id='architecture-overview'></a>\n\n## Architecture Overview\n\n### 相关页面\n\n相关主题：[Core Packages](#packages-core), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/agent-wasm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)\n- [packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n- [packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n- [packages/@monomind/cli/src/commands/task.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/task.ts)\n- [packages/@monomind/monograph/src/config/types.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/config/types.ts)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n</details>\n\n# Architecture Overview\n\nMonomind is a comprehensive AI coordination system designed to orchestrate multiple AI agents, manage persistent memory, and provide intelligent workflow automation for complex software development tasks.\n\n## System Architecture\n\n### High-Level Architecture Diagram\n\n```mermaid\ngraph TB\n    subgraph \"CLI Layer\"\n        CLI[CLI Interface<br/>@monomind/cli]\n    end\n\n    subgraph \"Core Layer\"\n        MCP[MCP Server<br/>@monomind/mcp]\n        Shared[Shared Core<br/>@monomind/shared]\n    end\n\n    subgraph \"Capability Layer\"\n        Memory[Memory System<br/>@monomind/memory]\n        Monograph[Knowledge Graph<br/>@monomind/monograph]\n        AiDefence[Security<br/>@monomind/aidefence]\n    end\n\n    subgraph \"Agent Layer\"\n        Agents[Agent Pool]\n        WASM[WASM Runtime]\n    end\n\n    CLI --> MCP\n    CLI --> Shared\n    MCP --> Shared\n    Shared --> Memory\n    Shared --> Monograph\n    Shared --> AiDefence\n    MCP --> Agents\n    Agents --> WASM\n```\n\n## Package Structure\n\n### Core Packages\n\n| Package | Purpose | Entry Point |\n|---------|---------|-------------|\n| `@monomind/cli` | Command-line interface and user interaction | `packages/@monomind/cli/src/index.ts` |\n| `@monomind/mcp` | Model Context Protocol server implementation | `packages/@monomind/mcp/src/server.ts` |\n| `@monomind/shared` | Shared utilities and core orchestration logic | `packages/@monomind/shared/src/index.ts` |\n| `@monomind/shared/src/core/orchestrator` | Agent orchestration engine | `packages/@monomind/shared/src/core/orchestrator/index.ts` |\n\n### Capability Packages\n\n| Package | Description |\n|---------|-------------|\n| `@monomind/memory` | Vector memory storage with HNSW indexing and SQLite backend |\n| `@monomind/monograph` | Knowledge graph builder and dependency analysis |\n| `@monomind/aidefence` | Security scanning, CVE detection, and threat modeling |\n| `@monomind/teammate-plugin` | Claude Code plugin integration |\n\n## Command Architecture\n\nThe CLI provides hierarchical command organization through subcommands. Each command follows a consistent pattern with `help`, `list`, and action subcommands.\n\n```mermaid\ngraph LR\n    subgraph \"Top-Level Commands\"\n        session[session]\n        task[task]\n        agent[agent]\n        mcp[mcp]\n        config[config]\n    end\n\n    subgraph \"Agent Subcommands\"\n        agent_list[agent list]\n        agent_metrics[agent metrics]\n        agent_pool[agent pool]\n        agent_wasm[agent wasm-*]\n    end\n\n    subgraph \"MCP Subcommands\"\n        mcp_start[start]\n        mcp_stop[stop]\n        mcp_status[status]\n        mcp_tools[tools]\n    end\n\n    agent --> agent_list\n    agent --> agent_metrics\n    agent --> agent_pool\n    agent --> agent_wasm\n    mcp --> mcp_start\n    mcp --> mcp_stop\n    mcp --> mcp_status\n    mcp --> mcp_tools\n```\n\n### Session Management\n\nSession commands provide conversation persistence and replay capabilities:\n\n| Subcommand | Purpose | Implementation |\n|------------|---------|----------------|\n| `list` | List all saved sessions | `packages/@monomind/cli/src/commands/session.ts:1-50` |\n| `save` | Save current session state | Session persistence layer |\n| `restore` | Restore a saved session | State restoration mechanism |\n| `delete` | Delete a saved session | Session cleanup |\n| `export` | Export session to file | File serialization |\n| `import` | Import session from file | File deserialization |\n| `current` | Show current active session | Active session tracking |\n\n### Task Orchestration\n\nTasks are the primary unit of work in Monomind, managed through the orchestrator:\n\n```typescript\n// Task subcommands from packages/@monomind/cli/src/commands/task.ts\nconst TASK_SUBCOMMANDS = ['create', 'list', 'status', 'cancel', 'assign', 'retry'];\n```\n\n| Subcommand | Description |\n|------------|-------------|\n| `create` | Create a new task |\n| `list` | List all tasks |\n| `status` | Get task details and progress |\n| `cancel` | Cancel a running task |\n| `assign` | Assign task to agent(s) |\n| `retry` | Retry a failed task |\n\n## Agent System Architecture\n\n### Agent Types and Capabilities\n\n```mermaid\ngraph TD\n    subgraph \"Agent Types\"\n        coder[Coder Agent]\n        researcher[Researcher Agent]\n        tester[Tester Agent]\n        reviewer[Reviewer Agent]\n        architect[Architect Agent]\n        coordinator[Coordinator Agent]\n        security[Security Architect]\n        memory[Memory Specialist]\n        performance[Performance Engineer]\n    end\n\n    subgraph \"Capabilities\"\n        code-gen[code-generation<br/>refactoring<br/>debugging]\n        research[web-search<br/>data-analysis]\n        test[unit-testing<br/>integration-testing]\n        review[code-review<br/>security-audit]\n        design[system-design<br/>pattern-analysis]\n        orchestrate[task-orchestration<br/>workflow-control]\n        security-caps[threat-modeling<br/>compliance]\n        memory-caps[vector-search<br/>caching]\n        perf[caching<br/>optimization<br/>profiling]\n    end\n\n    coder --> code-gen\n    researcher --> research\n    tester --> test\n    reviewer --> review\n    architect --> design\n    coordinator --> orchestrate\n    security --> security-caps\n    memory --> memory-caps\n    performance --> perf\n```\n\n### Agent Capability Matrix\n\n| Agent Type | Primary Capabilities |\n|------------|---------------------|\n| `coder` | code-generation, refactoring, debugging, testing |\n| `researcher` | web-search, data-analysis, summarization, citation |\n| `tester` | unit-testing, integration-testing, coverage-analysis, automation |\n| `reviewer` | code-review, security-audit, quality-check, documentation |\n| `architect` | system-design, pattern-analysis, scalability, documentation |\n| `coordinator` | task-orchestration, agent-management, workflow-control |\n| `security-architect` | threat-modeling, security-patterns, compliance, audit |\n| `memory-specialist` | vector-search, agentdb, caching, optimization |\n| `performance-engineer` | caching, optimization, profiling, benchmarking |\n\n*资料来源：[packages/@monomind/cli/src/commands/agent.ts:60-90](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)*\n\n### WASM Agent Runtime\n\nMonomind supports sandboxed agent execution via WebAssembly:\n\n```mermaid\ngraph LR\n    subgraph \"WASM Commands\"\n        wasm-create[wasm-create]\n        wasm-prompt[wasm-prompt]\n        wasm-gallery[wasm-gallery]\n        wasm-status[wasm-status]\n    end\n\n    subgraph \"Gallery Templates\"\n        gallery1[Template 1]\n        gallery2[Template 2]\n        gallery3[Template N]\n    end\n\n    wasm-gallery --> gallery1\n    wasm-gallery --> gallery2\n    wasm-gallery --> gallery3\n    wasm-create --> gallery1\n```\n\n| Command | Purpose |\n|---------|---------|\n| `wasm-status` | Check WASM runtime availability |\n| `wasm-create` | Create a WASM-sandboxed agent |\n| `wasm-prompt` | Send a prompt to a WASM agent |\n| `wasm-gallery` | List WASM agent gallery templates |\n\n*资料来源：[packages/@monomind/cli/src/commands/agent-wasm.ts:1-150](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)*\n\n## Memory System Architecture\n\n### Memory Scopes\n\nMonomind implements a hierarchical memory architecture with multiple scopes:\n\n```mermaid\ngraph TD\n    subgraph \"Memory Scopes\"\n        global[Global<br/>~/.claude/agent-memory/]\n        project[Project<br/>/.claude/agent-memory/]\n        local[Local<br/>/.claude/agent-memory-local/]\n        user[User<br/>~/.claude/agent-memory/]\n    end\n\n    subgraph \"Per-Agent Isolation\"\n        coder[Coder Agent]\n        tester[Tester Agent]\n        reviewer[Reviewer Agent]\n    end\n\n    global --> coder\n    global --> tester\n    global --> reviewer\n    project --> coder\n    project --> tester\n    project --> reviewer\n    local --> coder\n    local --> tester\n    local --> reviewer\n```\n\n### Memory Scope Configuration\n\n| Scope | Path Pattern | Purpose |\n|-------|--------------|---------|\n| `global` | `<gitRoot>/.claude/agent-memory/<agent>/` | Global agent learnings |\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n*资料来源：[packages/@monomind/memory/README.md:50-100](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)*\n\n### Hybrid Backend\n\nThe memory system uses a hybrid approach combining structured and vector storage:\n\n```mermaid\ngraph LR\n    subgraph \"Hybrid Backend\"\n        SQLite[(SQLite<br/>Structured Data)]\n        AgentDB[(AgentDB<br/>Vector Search)]\n        HNSW[HNSW Index]\n    end\n\n    SQLite --> AgentDB\n    AgentDB --> HNSW\n```\n\n| Component | Function | Performance |\n|-----------|----------|-------------|\n| SQLite | Structured data persistence | ACID compliance |\n| AgentDB | Semantic vector search | HNSW indexing |\n| HNSW | Approximate nearest neighbor | 150x-12,500x faster than brute-force |\n\n### A-MEM Auto-Linking\n\nThe system implements automatic semantic linking (arXiv:2409.11987):\n\n```typescript\n// From packages/@monomind/memory/README.md\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  // A-MEM auto-linking is automatically active when embeddingGenerator is set\n});\n```\n\nEach stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional `references` edges.\n\n## Knowledge Graph (Monograph)\n\n### Graph Node Types\n\n| Node Type | Description |\n|-----------|-------------|\n| `File` | Source code file |\n| `Directory` | Project directory |\n| `Function` | Function definition |\n| `Class` | Code class or interface |\n| `Concept` | Extracted semantic concept |\n| `PDF` | PDF document chunk |\n\n### Graph Edge Types\n\n| Relation | Meaning |\n|----------|---------|\n| `IMPORTS` | Code import dependency |\n| `DEFINES` | File defines symbol |\n| `TAGGED_AS` | Section tagged with concept |\n| `CO_OCCURS` | Concepts appear together |\n| `INFERRED` | Claude-extracted semantic relationship |\n| `DESCRIBES` | LLM-enriched semantic edge |\n| `CAUSES` | LLM-enriched semantic edge |\n| `PART_OF` | LLM-enriched semantic edge |\n\n*资料来源：[plugin/commands/monograph/README.md:50-80](https://github.com/monoes/monomind/blob/main/plugin/commands/monograph/README.md)*\n\n### Monograph Configuration\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts\ninterface MonographConfig {\n  root: string;\n  entry: string[];\n  production: boolean;\n  detection: 'default' | 'extended';\n  project?: string;\n  ignore: string[];\n  overrides: OverrideConfig[];\n  regression: RegressionConfig;\n  audit: AuditConfig;\n  normalization: NormalizationConfig;\n  boundaries: BoundaryConfig;\n  resolve: ResolveConfig;\n  health: HealthConfig;\n  ownership: OwnershipConfig;\n  plugins: string[];\n}\n```\n\n### Default Configuration\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts:40-60\nexport const DEFAULT_MONOGRAPH_CONFIG: ResolvedMonographConfig = {\n  root: '.',\n  entry: [],\n  production: true,\n  detection: 'default',\n  project: undefined,\n  ignore: [],\n  overrides: [],\n  regression: { tolerance: 0, baselinePath: '.monograph/regression-baseline.json' },\n  audit: { gate: 'error', includeHealthGate: false },\n  normalization: { \n    stripComments: true, \n    normalizeWhitespace: true, \n    normalizeIdentifiers: false \n  },\n  boundaries: {},\n  resolve: { \n    paths: {}, \n    alias: {}, \n    conditions: [], \n    extensions: ['.ts', '.tsx', '.mts', '.cts'] \n  },\n  health: { \n    cyclomaticThreshold: 10, \n    cognitiveThreshold: 15, \n    crapThreshold: 30, \n    minLines: 5 \n  },\n  ownership: { emailMode: 'fullEmail' },\n  plugins: [],\n};\n```\n\n## MCP Server Architecture\n\n### Server Capabilities\n\n```mermaid\ngraph TB\n    subgraph \"MCP Server\"\n        server[MCP Server<br/>packages/@monomind/mcp/src/server.ts]\n        tools[Tool Handlers]\n        resources[Resource Handlers]\n    end\n\n    subgraph \"Tools\"\n        monograph_tools[Monograph Tools<br/>mcp__monomind__monograph_*]\n        memory_tools[Memory Tools<br/>mcp__monomind__memory_*]\n        agent_tools[Agent Tools<br/>mcp__monomind__agent_*]\n    end\n\n    server --> tools\n    server --> resources\n    tools --> monograph_tools\n    tools --> memory_tools\n    tools --> agent_tools\n```\n\n### MCP Subcommands\n\n| Subcommand | Purpose |\n|------------|---------|\n| `start` | Start MCP server |\n| `stop` | Stop MCP server |\n| `status` | Show server status |\n| `health` | Check server health |\n| `restart` | Restart MCP server |\n| `tools` | List available tools |\n| `toggle` | Enable/disable tools |\n| `exec` | Execute a tool |\n| `logs` | Show server logs |\n\n*资料来源：[packages/@monomind/cli/src/commands/mcp.ts:20-45](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)*\n\n## Neural Learning (SONA)\n\nSelf-Optimizing Neural Adaptation provides:\n\n- **Pattern Recognition**: Improves agent routing over time\n- **Trajectory Tracking**: Identifies what works and what doesn't\n- **Automatic Model Adaptation**: <0.05ms overhead per decision\n\n```mermaid\ngraph LR\n    subgraph \"SONA System\"\n        input[Task Input]\n        pattern[Pattern Recognition]\n        route[Agent Routing]\n        track[Trajectory Tracking]\n        adapt[Model Adaptation]\n        output[Optimized Output]\n    end\n\n    input --> pattern\n    pattern --> route\n    route --> output\n    output --> track\n    track --> adapt\n    adapt --> pattern\n```\n\n## Command Suggestion System\n\nThe CLI includes a fuzzy matching system for typo correction:\n\n```mermaid\ngraph TD\n    input[User Input]\n    input --> levenshtein[Levenshtein Distance]\n    input --> similarity[Similarity Score]\n    levenshtein --> threshold[Threshold Check]\n    similarity --> threshold\n    threshold --> suggestions[Suggestions]\n```\n\n| Component | Function |\n|-----------|----------|\n| `levenshteinDistance` | Calculate edit distance between strings |\n| `similarityScore` | Compute similarity ratio |\n| `findSimilar` | Find commands within similarity threshold |\n| `suggestCommand` | Generate command suggestions |\n| `COMMON_TYPOS` | Predefined typo mappings |\n\n*资料来源：[packages/@monomind/cli/src/suggest.ts:1-80](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/suggest.ts)*\n\n## Data Flow Architecture\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant MCP\n    participant Shared\n    participant Memory\n    participant Monograph\n\n    User->>CLI: Execute command\n    CLI->>MCP: Route to MCP server\n    MCP->>Shared: Core orchestration\n    Shared->>Memory: Store/retrieve\n    Shared->>Monograph: Query graph\n    Memory-->>Shared: Results\n    Monograph-->>Shared: Dependencies\n    Shared-->>MCP: Processed data\n    MCP-->>CLI: Response\n    CLI-->>User: Output\n```\n\n## Extended Configuration\n\nThe Monograph system supports extended configuration for enterprise use:\n\n```typescript\n// From packages/@monomind/monograph/src/config/types.ts:70-90\nexport interface ExtendedMonographConfig extends MonographConfig {\n  extends?: string[];\n  sealed?: boolean;\n  includeEntryExports?: boolean;\n  publicPackages?: string[];\n  dynamicallyLoaded?: string[];\n  codeowners?: string;\n  ignoreDependencies?: string[];\n  ignoreExportsUsedInFile?: boolean | { \n    interface?: boolean; \n    typeAlias?: boolean \n  };\n  usedClassMembers?: Array<string | { \n    extends?: string[]; \n    implements?: string[]; \n    members: string[] \n  }>;\n  duplicates?: DuplicatesConfig;\n}\n```\n\n## Summary\n\nMonomind's architecture is built on a modular, layered approach:\n\n1. **CLI Layer**: User-facing command interface with subcommands for all major features\n2. **Core Layer**: Shared orchestration logic and MCP protocol implementation\n3. **Capability Layer**: Specialized systems for memory, knowledge graphs, and security\n4. **Agent Layer**: Pluggable agent pool with WASM sandboxing support\n\nThe architecture supports horizontal scaling through agent pooling and vertical optimization through dedicated WASM runtime execution for sensitive operations.\n\n---\n\n<a id='packages-core'></a>\n\n## Core Packages\n\n### 相关页面\n\n相关主题：[Architecture Overview](#architecture-overview)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n- [packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n- [packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n- [packages/@monomind/embeddings/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/embeddings/README.md)\n- [packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n- [packages/@monomind/cli/src/init/claudemd-generator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/init/claudemd-generator.ts)\n- [packages/@monomind/aidefence/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/aidefence/README.md)\n</details>\n\n# Core Packages\n\nMonomind is organized as a monorepo with specialized packages that work together to provide AI coordination, memory management, neural learning, and multi-agent orchestration. The core packages form the foundation of this ecosystem, enabling Claude Code and other AI systems to maintain context, learn patterns, and coordinate complex tasks across sessions.\n\n## Architecture Overview\n\n```mermaid\ngraph TD\n    subgraph \"Core Packages\"\n        CLI[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        EMBED[@monomind/embeddings]\n        NEURAL[@monomind/neural]\n        SHARED[@monomind/shared]\n    end\n    \n    CLI --> SHARED\n    MEM --> EMBED\n    HOOKS --> SHARED\n    EMBED --> NEURAL\n    NEURAL --> SHARED\n    \n    CLI --> MEM\n    CLI --> HOOKS\n```\n\nThe core packages follow a layered architecture where the `shared` package provides common utilities and types that all other packages depend on, while specialized packages handle specific concerns like memory storage, embedding generation, neural learning, and command execution.\n\n## @monomind/cli\n\nThe CLI package is the primary command-line interface for Monomind, providing a unified entry point for all operations. It serves as the orchestration layer that coordinates memory, hooks, neural learning, and multi-agent capabilities.\n\n### Command Structure\n\nThe CLI exposes commands organized by functional domain:\n\n| Command | Description | Status |\n|---------|-------------|--------|\n| `agent` | Agent management, metrics, pool, WASM runtime | ✅ Complete |\n| `task` | Task creation, status, list, completion | ✅ Complete |\n| `session` | Session save, restore, list, export/import | ✅ Complete |\n| `config` | Configuration get, set, list, reset | ✅ Complete |\n| `memory` | Store, retrieve, list, delete, search | ✅ Complete |\n| `workflow` | Create, execute, list, status, delete | ✅ Complete |\n| `mcp` | MCP server start, stop, status, tools | ✅ Complete |\n| `neural` | Neural pattern training, MoE, Flash Attention | Advanced |\n| `security` | Security scanning, CVE detection, threat modeling | Advanced |\n| `performance` | Performance profiling, benchmarking | Advanced |\n| `providers` | AI provider management, models, configurations | Advanced |\n| `plugins` | Plugin management, installation, lifecycle | Advanced |\n| `deployment` | Deployment management, environments, rollbacks | Advanced |\n| `claims` | Claims-based authorization, access control | Advanced |\n| `embeddings` | Embedding management, models, cache | Advanced |\n\n资料来源：[packages/@monomind/cli/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/README.md)\n\n### CLAUDE.md Generation\n\nThe CLI includes a sophisticated CLAUDE.md generator that creates project-specific configuration files for Claude Code. The generator supports multiple templates with varying levels of detail:\n\n```typescript\nexport const CLAUDE_MD_TEMPLATES: Array<{ name: ClaudeMdTemplate; description: string }> = [\n  { name: 'minimal', description: 'Quick start — behavioral rules, anti-drift' },\n  { name: 'standard', description: 'Full documentation with all sections' },\n  { name: 'full', description: 'Complete including hooks and learning' },\n  { name: 'security', description: 'Security-focused template' },\n  { name: 'performance', description: 'Performance-optimized template' },\n  { name: 'solo', description: 'Single-agent workflow template' }\n];\n```\n\nEach template includes different combinations of sections such as behavioral rules, coding principles, file organization, project architecture, build and test instructions, security rules, concurrency rules, swarm orchestration, and intelligence system configuration.\n\n资料来源：[packages/@monomind/cli/src/init/claudemd-generator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/init/claudemd-generator.ts)\n\n### Session Management\n\nThe session command provides comprehensive session state management:\n\n```bash\nmonomind session list      # List all saved sessions\nmonomind session save      # Save current session state\nmonomind session restore   # Restore a saved session\nmonomind session delete    # Delete a saved session\nmonomind session export    # Export session to file\nmonomind session import    # Import session from file\nmonomind session current   # Show current active session\n```\n\n资料来源：[packages/@monomind/cli/src/commands/session.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/session.ts)\n\n### Agent Capabilities\n\nThe CLI supports multiple agent types, each with specialized capabilities:\n\n| Agent Type | Capabilities |\n|------------|--------------|\n| `coder` | code-generation, refactoring, debugging, testing |\n| `researcher` | web-search, data-analysis, summarization, citation |\n| `tester` | unit-testing, integration-testing, coverage-analysis |\n| `reviewer` | code-review, security-audit, quality-check |\n| `architect` | system-design, pattern-analysis, scalability |\n| `coordinator` | task-orchestration, agent-management, workflow-control |\n| `security-architect` | threat-modeling, security-patterns, compliance |\n| `memory-specialist` | vector-search, agentdb, caching, optimization |\n| `performance-engineer` | profiling, benchmarking, optimization |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n\n### MCP Server Management\n\n```bash\nmonomind mcp start     # Start MCP server\nmonomind mcp stop      # Stop MCP server\nmonomind mcp status    # Show server status\nmonomind mcp health    # Check server health\nmonomind mcp restart   # Restart MCP server\nmonomind mcp tools     # List available tools\nmonomind mcp toggle    # Enable/disable tools\nmonomind mcp exec      # Execute a tool\nmonomind mcp logs      # Show server logs\n```\n\n资料来源：[packages/@monomind/cli/src/commands/mcp.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/mcp.ts)\n\n## @monomind/memory\n\nThe memory package provides a sophisticated memory system for AI agents, combining structured storage with semantic vector search capabilities.\n\n### HybridBackend Architecture\n\nThe memory system uses a HybridBackend that combines SQLite for structured data with AgentDB for semantic search:\n\n```typescript\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  // A-MEM auto-linking is automatically active when embeddingGenerator is set\n});\n```\n\n资料来源：[packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n\n### A-MEM Auto-Linking\n\nWhen configured with an embedding generator, the HybridBackend implements A-MEM (arxiv:2409.11987) auto-linking. Every stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional references edges, implementing the Zettelkasten note-linking structure.\n\n### Agent Memory Scopes\n\nThe memory system supports multiple scope levels for different use cases:\n\n| Scope | Path | Use Case |\n|-------|------|----------|\n| `system` | `<gitRoot>/.claude/agent-memory-system/<agent>/` | System-wide learnings |\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n### Memory Utilities\n\n```typescript\nimport {\n  resolveAgentMemoryDir,  // Get scope directory path\n  createAgentBridge,       // Create scoped AutoMemoryBridge\n  transferKnowledge,       // Cross-agent knowledge sharing\n  listAgentScopes,         // Discover existing agent scopes\n} from '@monomind/memory';\n\n// Resolve path for an agent scope\nconst dir = resolveAgentMemoryDir('my-agent', 'project');\n// → /workspaces/my-project/.claude/agent-memory/my-agent/\n\n// List all agent scopes in a directory\nconst scopes = await listAgentScopes('/workspaces/my-project');\n```\n\n资料来源：[packages/@monomind/memory/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/README.md)\n\n### Memory Commands\n\n```bash\nmonomind memory init         # Initialize memory database (sql.js)\nmonomind memory store        # Store data in memory\nmonomind memory edit         # Edit an entry\nmonomind memory retrieve     # Retrieve data from memory\nmonomind memory search       # Semantic/vector search\nmonomind memory list         # List memory entries\nmonomind memory delete       # Delete an entry\nmonomind memory templates    # Show best-practice entry templates\nmonomind memory stats        # Show statistics\nmonomind memory configure    # Configure backend\nmonomind memory cleanup      # Clean expired entries\nmonomind memory compress     # Compress database\nmonomind memory export       # Export memory to file\nmonomind memory import       # Import from file\n```\n\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/memory.ts)\n\n## @monomind/hooks\n\nThe hooks package provides an event-driven system for extending and customizing Monomind behavior.\n\n### Hook Configuration\n\nHooks are configured in `monomind.config.json` with support for both external scripts and built-in commands:\n\n```json\n{\n  \"hooks\": {\n    \"preCommand\": \"/path/to/pre-command-hook.sh\",\n    \"postCommand\": \"/path/to/post-command-hook.sh\"\n  },\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"statusline\"\n  }\n}\n```\n\n资料来源：[packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n\n### Hook Types\n\n| Hook Type | Purpose | Trigger Point |\n|-----------|---------|---------------|\n| `preCommand` | Run before command execution | Before any CLI command |\n| `postCommand` | Run after command execution | After any CLI command |\n| `statusLine` | Custom status display | During active sessions |\n| `preAgent` | Pre-processing for agent tasks | Before agent dispatch |\n| `postAgent` | Post-processing for agent results | After agent completion |\n\n### Package Dependencies\n\nThe hooks system depends on and integrates with:\n\n- `@monomind/shared` - Shared utilities and types\n- `@monomind/neural` - Neural network and SONA learning\n- `@monomind/swarm` - Multi-agent coordination\n- `@monomind/memory` - AgentDB memory system\n\n资料来源：[packages/@monomind/hooks/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/hooks/README.md)\n\n## @monomind/embeddings\n\nThe embeddings package provides embedding generation, caching, and transformation capabilities.\n\n### Features\n\n| Feature | Description |\n|---------|-------------|\n| Persistent Cache | SQLite-based cache with configurable TTL (default: 30 days) |\n| Normalization | L2 normalization for consistent vector comparisons |\n| Hyperbolic Conversion | Transform embeddings to Poincaré ball model |\n| Neural Operations | Drift detection, storage, and recall |\n\n### Cache Configuration\n\n```typescript\nconst service = createEmbeddingService({\n  provider: \"openai\",\n  apiKey: process.env.OPENAI_API_KEY!,\n  persistentCache: {\n    enabled: true,\n    dbPath: \"./cache/embeddings.db\",\n    maxSize: 50000,\n    ttlMs: 30 * 24 * 60 * 60 * 1000, // 30 days\n  },\n  normalization: \"l2\",\n});\n```\n\n### Embeddings CLI Commands\n\n```bash\n# Document chunking\nmonomind embeddings chunk document.txt --strategy sentence --max-size 512\n\n# Normalize embedding file\nmonomind embeddings normalize embeddings.json --type l2 -o normalized.json\n\n# Convert to hyperbolic\nmonomind embeddings hyperbolic embeddings.json -o poincare.json\n\n# Neural operations\nmonomind embeddings neural drift --baseline \"context\" --input \"check this\"\nmonomind embeddings neural store --id mem-1 --content \"data\"\nmonomind embeddings neural recall \"query\" --top-k 5\n\n# List/download models\nmonomind embeddings models list\nmonomind embeddings models download all-MiniLM-L6-v2\n\n# Cache management\nmonomind embeddings cache stats\nmonomind embeddings cache clear --older-than 7d\n```\n\n资料来源：[packages/@monomind/embeddings/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/embeddings/README.md)\n\n### Related Packages\n\n- `@monomind/memory` - HNSW indexing and vector storage\n- `@monomind/providers` - Multi-LLM provider system\n- `@monomind/neural` - SONA learning system\n\n## @monomind/aidefence\n\nThe aidefence package provides security and AI safety features for the Monomind ecosystem.\n\n### Capabilities\n\nThe package includes patterns for detecting and preventing various security issues and inappropriate AI behaviors. It integrates with the CLI for security scanning operations.\n\n### Related Packages\n\n- `@monomind/cli` - CLI with security commands\n- `agentdb` - HNSW vector database\n- `monomind` - Full AI coordination system\n\n资料来源：[packages/@monomind/aidefence/README.md](https://github.com/monoes/monomind/blob/main/packages/@monomind/aidefence/README.md)\n\n## @monomind/shared\n\nThe shared package contains common utilities, types, and interfaces used across all Monomind packages.\n\n### Responsibilities\n\n- Type definitions shared across packages\n- Common utility functions\n- Interface contracts for package integration\n- Configuration schemas and validation\n\n### Dependencies\n\nOther core packages depend on `@monomind/shared` for common functionality, ensuring consistent types and utilities across the ecosystem.\n\n## Package Relationships\n\n```mermaid\ngraph TD\n    CLI -->|depends on| SHARED\n    MEM -->|depends on| SHARED\n    HOOKS -->|depends on| SHARED\n    EMBED -->|depends on| NEURAL\n    NEURAL -->|depends on| SHARED\n    \n    CLI -->|coordinates| MEM\n    CLI -->|coordinates| HOOKS\n    CLI -->|uses| EMBED\n    \n    MEM -->|uses| EMBED\n    \n    subgraph \"Core Packages\"\n        CLI[@monomind/cli]\n        MEM[@monomind/memory]\n        HOOKS[@monomind/hooks]\n        EMBED[@monomind/embeddings]\n        NEURAL[@monomind/neural]\n        SHARED[@monomind/shared]\n    end\n```\n\n## Installation and Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/monoes/monomind.git\ncd monomind\n\n# Install dependencies\npnpm install\n\n# Run health check and auto-fix\nmonomind doctor --fix\n```\n\n## Development Workflow\n\nThe monorepo uses pnpm workspaces with the following structure:\n\n```\nmonomind/\n├── packages/\n│   ├── @monomind/\n│   │   ├── cli/\n│   │   ├── memory/\n│   │   ├── hooks/\n│   │   ├── embeddings/\n│   │   ├── neural/\n│   │   ├── shared/\n│   │   ├── aidefence/\n│   │   └── ...\n│   ├── plugins/\n│   └── implementation/\n```\n\n## Version Compatibility\n\nThe Monomind packages follow semantic versioning with alpha releases for new features. The current CLI version is `@monomind/cli@3.0.0-alpha.11` (2026-01-07) with complete support for all core commands including session, task, config, memory, and workflow management.\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n---\n\n<a id='agent-catalog'></a>\n\n## Agent Catalog\n\n### 相关页面\n\n相关主题：[Agent Routing System](#agent-routing), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/cli/src/commands/agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent.ts)\n- [packages/@monomind/cli/src/commands/agent-wasm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/agent-wasm.ts)\n- [packages/@monomind/cli/src/agents/registry-builder.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/agents/registry-builder.ts)\n- [packages/@monomind/cli/src/agents/managed-agent.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/agents/managed-agent.ts)\n- [packages/@monomind/swarm/src/workers/worker-dispatch.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/workers/worker-dispatch.ts)\n</details>\n\n# Agent Catalog\n\n## Overview\n\nThe Agent Catalog is a comprehensive system within Monomind that manages, organizes, and provides access to a diverse collection of specialized AI agents. It serves as the central registry and management hub for all agent types, capabilities, and configurations within the platform.\n\nThe catalog provides:\n- A unified registry of agent types with their specific capabilities\n- Dynamic agent management including creation, monitoring, and lifecycle control\n- WASM-based sandboxed agent execution\n- Worker dispatch and trigger configurations for autonomous task handling\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:1-50]()\n\n## Agent Types and Capabilities\n\nMonomind's Agent Catalog defines multiple specialized agent types, each with distinct capabilities optimized for specific tasks.\n\n### Core Agent Types\n\n| Agent Type | Capabilities | Primary Use Case |\n|------------|--------------|------------------|\n| `coder` | code-generation, refactoring, debugging, testing | Software development tasks |\n| `researcher` | web-search, data-analysis, summarization, citation | Information gathering and analysis |\n| `tester` | unit-testing, integration-testing, coverage-analysis, automation | Quality assurance |\n| `reviewer` | code-review, security-audit, quality-check, documentation | Code inspection and review |\n| `architect` | system-design, pattern-analysis, scalability, documentation | System architecture planning |\n| `coordinator` | task-orchestration, agent-management, workflow-control | Multi-agent coordination |\n| `security-architect` | threat-modeling, security-patterns, compliance, audit | Security-focused design |\n| `memory-specialist` | vector-search, agentdb, caching, optimization | Memory and knowledge management |\n| `performance-engineer` | performance-analysis, optimization, benchmarking, profiling | Performance tuning |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:45-80]()\n\n### Agent Commands\n\nThe CLI provides several commands for agent management:\n\n```bash\nmonomind agent <subcommand>\n\nSubcommands:\n  metrics      - Show agent metrics\n  pool         - Manage agent pool\n  health       - Show agent health\n  logs         - Show agent logs\n  wasm-status  - Check WASM runtime availability\n  wasm-create  - Create a WASM-sandboxed agent\n  wasm-prompt  - Send a prompt to a WASM agent\n  wasm-gallery - List WASM agent gallery templates\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:20-30]()\n\n## Agent Registry System\n\nThe Agent Registry is the core component that maintains agent definitions, configurations, and metadata.\n\n### Registry Architecture\n\n```mermaid\ngraph TD\n    A[Agent Request] --> B[Registry Builder]\n    B --> C[Agent Registry]\n    C --> D[Agent Type Resolution]\n    D --> E[Managed Agent Instance]\n    E --> F[Execution Context]\n    F --> G[Response/Metrics]\n```\n\n### Registry Builder\n\nThe `RegistryBuilder` class constructs and manages the agent registry, providing methods to register, retrieve, and manage agent configurations.\n\n**Key Responsibilities:**\n- Build agent registry from configuration sources\n- Validate agent type definitions\n- Provide lookup and discovery mechanisms\n- Support dynamic agent registration\n\n资料来源：[packages/@monomind/cli/src/agents/registry-builder.ts:1-50]()\n\n## Managed Agents\n\nManaged Agents provide a structured runtime environment for agent execution with integrated lifecycle management, monitoring, and resource allocation.\n\n### Managed Agent Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> Initializing\n    Initializing --> Ready: Initialization Complete\n    Ready --> Running: Task Assigned\n    Running --> Ready: Task Complete\n    Running --> Paused: Suspend Request\n    Paused --> Running: Resume Request\n    Ready --> Terminated: Shutdown\n    Running --> Terminated: Force Shutdown\n    Terminated --> [*]\n```\n\n### Agent Management Features\n\n| Feature | Description |\n|---------|-------------|\n| Lifecycle Control | Start, pause, resume, and terminate agents |\n| Health Monitoring | Track agent health status and metrics |\n| Pool Management | Manage agent pools for scaling |\n| Log Aggregation | Collect and store agent execution logs |\n| Resource Allocation | Assign CPU, memory, and execution quotas |\n\n资料来源：[packages/@monomind/cli/src/agents/managed-agent.ts:1-60]()\n\n## WASM Agent Gallery\n\nThe WASM Agent system provides sandboxed agent execution using WebAssembly, offering enhanced security and portability.\n\n### WASM Agent Commands\n\n```bash\n# Check WASM runtime status\nmonomind agent wasm-status\n\n# List available templates\nmonomind agent wasm-gallery\n\n# Create a new WASM agent\nmonomind agent wasm-create -t <template-id>\n\n# Send prompt to WASM agent\nmonomind agent wasm-prompt <agent-id> <prompt>\n```\n\n### Gallery Template Structure\n\nTemplates in the gallery include:\n- **id**: Unique template identifier\n- **name**: Human-readable name\n- **category**: Template category (coding, research, security, etc.)\n- **description**: Brief description of capabilities\n- **version**: Template version\n\n```typescript\ninterface WASMTemplate {\n  id: string;\n  name: string;\n  category: string;\n  description: string;\n  version: string;\n}\n```\n\n资料来源：[packages/@monomind/cli/src/commands/agent-wasm.ts:1-80]()\n\n## Worker Dispatch System\n\nThe Agent Catalog integrates with a worker dispatch system for autonomous task handling based on trigger patterns.\n\n### Trigger Categories\n\n| Category | Trigger Patterns | Priority |\n|----------|------------------|----------|\n| `codebase` | explore codebase, project structure, dependency graph | high |\n| `preload` | preload, cache ahead, prefetch, warm cache | normal |\n| `deepdive` | deep dive, analyze thoroughly, in-depth analysis | normal |\n| `document` | document, generate docs, add documentation, write readme | low |\n| `refactor` | refactor, clean up code, improve code quality | normal |\n| `benchmark` | benchmark, performance test, measure speed | normal |\n| `testgaps` | test coverage, missing tests, untested code | normal |\n\n### Trigger Configuration\n\n```typescript\nconst TRIGGER_CONFIGS = {\n  ultralearn: {\n    description: 'Deep knowledge acquisition and learning',\n    priority: 'normal',\n  },\n  preload: {\n    description: 'Resource preloading for faster access',\n    priority: 'normal',\n  },\n  deepdive: {\n    description: 'Thorough code analysis',\n    priority: 'normal',\n  },\n  document: {\n    description: 'Documentation generation',\n    priority: 'low',\n  },\n  refactor: {\n    description: 'Code refactoring suggestions',\n    priority: 'normal',\n  },\n  benchmark: {\n    description: 'Performance benchmarking',\n    priority: 'normal',\n  },\n  testgaps: {\n    description: 'Test coverage analysis',\n    priority: 'normal',\n  },\n};\n```\n\n资料来源：[packages/@monomind/swarm/src/workers/worker-dispatch.ts:1-100]()\n\n## Agent Pool Management\n\nThe Agent Catalog supports managing pools of agents for scalable task processing.\n\n### Pool Operations\n\n```bash\n# View pool status\nmonomind agent pool status\n\n# Scale pool\nmonomind agent pool scale <agent-type> <count>\n\n# Release idle agents\nmonomind agent pool cleanup\n```\n\n### Pool Configuration Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `minSize` | number | 1 | Minimum pool size |\n| `maxSize` | number | 10 | Maximum pool size |\n| `idleTimeout` | number | 300000 | Idle timeout in milliseconds |\n| `scaleUpThreshold` | number | 0.8 | Scale up utilization threshold |\n| `scaleDownThreshold` | number | 0.2 | Scale down utilization threshold |\n\n## Health Monitoring\n\nAgents in the catalog are continuously monitored for health status.\n\n### Health Check Response\n\n```typescript\ninterface HealthCheckResponse {\n  status: 'healthy' | 'degraded' | 'unhealthy';\n  agentId: string;\n  uptime: number;\n  lastTask: string;\n  metrics: {\n    cpu: number;\n    memory: number;\n    tasksCompleted: number;\n    errors: number;\n  };\n}\n```\n\n### CLI Health Command\n\n```bash\nmonomind agent health <agent-id>\n```\n\n## CLI Integration\n\nThe Agent Catalog is accessible through the Monomind CLI with the following command structure:\n\n```bash\nmonomind agent <command> [options]\n```\n\n### Available Commands Summary\n\n| Command | Description |\n|---------|-------------|\n| `metrics` | Display agent performance metrics |\n| `pool` | Manage agent pool operations |\n| `health` | Show agent health status |\n| `logs` | Display agent execution logs |\n| `wasm-status` | Check WASM runtime availability |\n| `wasm-create` | Create new WASM-sandboxed agent |\n| `wasm-prompt` | Send prompt to WASM agent |\n| `wasm-gallery` | List available WASM templates |\n\n资料来源：[packages/@monomind/cli/src/commands/agent.ts:15-35]()\n\n## See Also\n\n- [Memory System](../memory/) - Vector memory and knowledge storage\n- [Hooks System](../hooks/) - Intelligent automation hooks\n- [Monograph](../monograph/) - Knowledge graph analysis\n- [Swarm Orchestration](../swarm/) - Multi-agent coordination\n\n---\n\n<a id='agent-routing'></a>\n\n## Agent Routing System\n\n### 相关页面\n\n相关主题：[Agent Catalog](#agent-catalog), [Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/routing/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/index.ts)\n- [packages/@monomind/routing/src/route-layer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/route-layer.ts)\n- [packages/@monomind/routing/src/capability-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/capability-index.ts)\n- [packages/@monomind/routing/src/llm-fallback.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/llm-fallback.ts)\n- [packages/@monomind/routing/src/routes/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/routes/index.ts)\n- [packages/@monomind/cli/src/commands/guidance.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/guidance.ts)\n- [packages/@monomind/cli/src/mcp-tools/guidance-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/guidance-tools.ts)\n</details>\n\n# Agent Routing System\n\n## Overview\n\nThe Agent Routing System is a core subsystem within Monomind that intelligently directs tasks to the most appropriate specialized agent based on task characteristics, agent capabilities, historical performance, and contextual information. It serves as the orchestration brain that enables multi-agent coordination across the entire platform.\n\nThe routing system operates with dual-mode intelligence:\n\n- **LLM-powered routing** for complex task understanding: <2s response time\n- **Keyword-based fallback** for rapid classification: <5ms response time\n\n资料来源：[README.md](https://github.com/monoes/monomind/blob/main/README.md)\n\n## Architecture\n\nThe routing system follows a layered architecture that separates concerns between capability matching, route resolution, and intelligence fallback mechanisms.\n\n```mermaid\ngraph TD\n    A[Task Input] --> B[Route Layer]\n    B --> C{Capability Index Match?}\n    C -->|High Confidence| D[Direct Route]\n    C -->|Low Confidence| E[LLM Fallback]\n    C -->|Exact Match| F[Keyword Fallback]\n    E --> G[Seraphine Routing Patterns]\n    G --> H[Agent Spawn]\n    D --> H\n    F --> H\n```\n\n### Core Components\n\n| Component | Location | Responsibility |\n|-----------|----------|----------------|\n| Route Layer | `packages/@monomind/routing/src/route-layer.ts` | Central orchestration, request dispatch |\n| Capability Index | `packages/@monomind/routing/src/capability-index.ts` | Agent capability registry and matching |\n| LLM Fallback | `packages/@monomind/routing/src/llm-fallback.ts` | Semantic routing via LLM inference |\n| Routing Patterns | `packages/@monomind/cli/src/transfer/models/seraphine.ts` | Predefined task-to-agent mappings |\n| Guidance Commands | `packages/@monomind/cli/src/commands/guidance.ts` | CLI integration layer |\n| MCP Tools | `packages/@monomind/cli/src/mcp-tools/guidance-tools.ts` | Model Context Protocol integration |\n\n资料来源：[packages/@monomind/routing/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/index.ts)\n\n## Routing Pattern System\n\n### Seraphine Routing Patterns\n\nThe system defines comprehensive routing patterns through the `SERAPHINE_ROUTING_PATTERNS` array. Each pattern contains:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `id` | string | Unique pattern identifier |\n| `trigger` | string | Regex or keyword pattern for task matching |\n| `action` | string | Command to execute (e.g., \"spawn coder agent\") |\n| `confidence` | number | Base confidence score (0-1) |\n| `usageCount` | number | Historical execution count |\n| `successRate` | number | Historical success rate (0-1) |\n| `context` | object | Additional metadata (category, priority) |\n\n资料来源：[packages/@monomind/cli/src/transfer/models/seraphine.ts:15-80](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/transfer/models/seraphine.ts)\n\n### Default Routing Patterns\n\n| Pattern ID | Trigger Keywords | Action | Confidence | Success Rate |\n|------------|------------------|--------|------------|--------------|\n| `route-code-to-coder` | implement, code, write, create function, build feature | Spawn coder agent | 0.95 | 0.92 |\n| `route-test-to-tester` | test, validate, verify, check, ensure quality | Spawn tester agent | 0.93 | 0.89 |\n| `route-review-to-reviewer` | review, audit, analyze code, check security | Spawn reviewer agent | 0.91 | 0.87 |\n| `route-research-to-researcher` | research, investigate, explore, find, search codebase | Spawn researcher agent | 0.94 | 0.88 |\n\n资料来源：[packages/@monomind/cli/src/transfer/models/seraphine.ts:25-70](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/transfer/models/seraphine.ts)\n\n## Capability Index\n\nThe Capability Index maintains a registry of all available agents and their documented capabilities, enabling efficient matching between incoming tasks and suitable agents.\n\n### Data Model\n\n```typescript\ninterface CapabilityEntry {\n  agentType: string;\n  capabilities: string[];\n  specializations: string[];\n  supportedLanguages: string[];\n  framework: string;\n  lastUpdated: Date;\n}\n```\n\n### Matching Algorithm\n\n1. **Exact Match**: Task keywords directly match capability keywords\n2. **Fuzzy Match**: LLM-based semantic similarity scoring\n3. **Fallback Match**: Keyword-based pattern matching with reduced confidence\n\n资料来源：[packages/@monomind/routing/src/capability-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/capability-index.ts)\n\n## LLM Fallback System\n\nWhen the capability index cannot confidently match a task, the system escalates to LLM-powered routing. This module handles the fallback mechanism.\n\n### Configuration Parameters\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| `timeout` | 2000ms | Maximum time for LLM inference |\n| `maxRetries` | 3 | Retry attempts on failure |\n| `confidenceThreshold` | 0.7 | Minimum confidence to accept LLM decision |\n| `fallbackToKeyword` | true | Enable keyword fallback on LLM failure |\n\n### Workflow\n\n```mermaid\ngraph LR\n    A[Task] --> B{Confidence >= Threshold?}\n    B -->|Yes| C[Return Route]\n    B -->|No| D[LLM Inference]\n    D --> E{Result Valid?}\n    E -->|Yes| F[Update Patterns]\n    E -->|No| G[Keyword Fallback]\n    F --> C\n    G --> H[Default Agent]\n```\n\n资料来源：[packages/@monomind/routing/src/llm-fallback.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/routing/src/llm-fallback.ts)\n\n## CLI Integration\n\n### Route Command\n\n```bash\n# Basic routing\nmonomind hooks route --task \"fix bug\"\n\n# Q-Learning enhanced routing (requires ruvector)\nmonomind route \"task\" --q-learning\n\n# Coverage-aware routing\nmonomind route \"task\" --coverage-aware\n```\n\n### Guidance Commands\n\nThe guidance subsystem provides additional routing intelligence through CLI commands:\n\n```bash\n# Display guidance help\nmonomind guidance --help\n\n# Show routing status\nmonomind guidance status\n\n# Analyze task complexity\nmonomind guidance analyze --task \"implement webhook retry logic\"\n```\n\n资料来源：[packages/@monomind/cli/src/commands/guidance.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/guidance.ts)\n\n## MCP Tools Integration\n\nThe routing system exposes functionality through the Model Context Protocol (MCP), enabling programmatic access for external integrations.\n\n### Available Tools\n\n| Tool | Handler | Description |\n|------|---------|-------------|\n| `hooks/route` | `routeTool.handler` | Execute task routing with explanation |\n| `hooks/routeWithContext` | `routeWithContextTool.handler` | Route with additional context |\n| `guidance/analyze` | `analyzeTool.handler` | Analyze task complexity |\n\n### Usage Example\n\n```typescript\nimport { hooksMCPTools, getHooksTool } from '@monomind/hooks';\n\nconst routeTool = getHooksTool('hooks/route');\nconst result = await routeTool.handler({\n  task: 'Implement user authentication',\n  includeExplanation: true,\n});\n\nconsole.log(`Recommended agent: ${result.recommendedAgent}`);\nconsole.log(`Confidence: ${result.confidence}%`);\n```\n\n资料来源：[packages/@monomind/cli/src/mcp-tools/guidance-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/guidance-tools.ts)\n\n## Advanced Routing Features\n\n### Q-Learning Router (ruvector Integration)\n\nFor production environments requiring advanced routing decisions, the system integrates with ruvector for Q-learning-based agent selection:\n\n- Learns from historical routing decisions\n- Optimizes for task completion rate\n- Adapts to team-specific patterns\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n### Coverage-Aware Routing\n\nRoutes tasks based on code coverage analysis, directing work to agents with relevant file expertise:\n\n```bash\nmonomind route \"task\" --coverage-aware\n```\n\n### AST Analysis Routing\n\nFor code modification tasks, the routing system can leverage AST (Abstract Syntax Tree) analysis to match agents with expertise in the relevant code structure:\n\n```bash\nmonomind analyze ast src/\n```\n\n资料来源：[packages/implementation/adrs/README.md](https://github.com/monoes/monomind/blob/main/packages/implementation/adrs/README.md)\n\n## Performance Characteristics\n\n| Metric | Value | Mode |\n|--------|-------|------|\n| Agent routing (LLM) | <2s | Full semantic understanding |\n| Agent routing (keyword) | <5ms | Pattern matching fallback |\n| Pattern lookup | <1ms | In-memory index |\n| Capability matching | <2ms | Optimized trie search |\n\n资料来源：[README.md](https://github.com/monoes/monomind/blob/main/README.md)\n\n## Extending the Routing System\n\n### Adding Custom Patterns\n\nTo extend routing capabilities, add new patterns to the Seraphine configuration:\n\n```typescript\nimport { SERAPHINE_ROUTING_PATTERNS } from './models/seraphine';\n\nconst customPattern: RoutingPattern = {\n  id: 'route-custom-task',\n  trigger: 'your-trigger-keywords',\n  action: 'spawn your-agent',\n  confidence: 0.85,\n  usageCount: 0,\n  successRate: 0.0,\n  context: {\n    category: 'custom',\n    priority: 'medium',\n  },\n};\n\nSERAPHINE_ROUTING_PATTERNS.push(customPattern);\n```\n\n### Custom Capability Index\n\nFor specialized agent registries:\n\n```typescript\nimport { CapabilityIndex } from '@monomind/routing';\n\nconst customIndex = new CapabilityIndex({\n  includeBuiltIn: true,\n  customAgents: [...],\n  scoringWeights: {\n    keyword: 0.4,\n    semantic: 0.4,\n    historical: 0.2,\n  },\n});\n```\n\n## Summary\n\nThe Agent Routing System provides intelligent, adaptive task-to-agent matching through a multi-tier architecture:\n\n1. **Capability Index** for fast, accurate matching of known patterns\n2. **LLM Fallback** for semantic understanding of novel tasks\n3. **Keyword Fallback** for guaranteed routing with minimal latency\n4. **Seraphine Patterns** for configurable, business-specific routing rules\n5. **MCP Integration** for programmatic and external system access\n\nThis design ensures the routing system scales from simple keyword matching to complex semantic analysis while maintaining predictable performance characteristics.\n\n---\n\n<a id='swarm-topologies'></a>\n\n## Swarm Topologies\n\n### 相关页面\n\n相关主题：[Consensus Protocols](#consensus-protocols), [Agent Catalog](#agent-catalog)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/swarm/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/index.ts)\n- [packages/@monomind/swarm/src/unified-coordinator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/unified-coordinator.ts)\n- [packages/@monomind/swarm/src/attention-coordinator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/attention-coordinator.ts)\n- [packages/@monomind/swarm/src/coordination/swarm-hub.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/coordination/swarm-hub.ts)\n- [packages/@monomind/swarm/src/coordination/task-orchestrator.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/coordination/task-orchestrator.ts)\n- [packages/@monomind/swarm/src/topology-manager.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/topology-manager.ts)\n- [packages/@monomind/cli/src/commands/swarm.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/commands/swarm.ts)\n- [packages/@monomind/cli/src/swarm/communication-graph.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/swarm/communication-graph.ts)\n- [packages/@monomind/cli/src/swarm/flow-enforcer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/swarm/flow-enforcer.ts)\n</details>\n\n# Swarm Topologies\n\n## Overview\n\nSwarm Topologies define the structural organization and communication patterns between agents in the Monomind multi-agent orchestration system. These topologies determine how agents connect, collaborate, share information, and coordinate tasks within a swarm.\n\nThe topology system provides flexible, pluggable architectures that can adapt to different task requirements—from simple linear workflows to complex hierarchical structures with consensus-based decision making.\n\n资料来源：[packages/@monomind/swarm/src/topology-manager.ts]()\n\n## Architecture Overview\n\n### Core Topology Components\n\nThe swarm topology system consists of several interconnected components:\n\n```mermaid\ngraph TD\n    TM[Topology Manager] --> SH[Swarm Hub]\n    TM --> TO[Task Orchestrator]\n    TM --> AC[Attention Coordinator]\n    TM --> UC[Unified Coordinator]\n    \n    SH --> CG[Communication Graph]\n    SH --> FE[Flow Enforcer]\n    \n    TO --> Agents[Agent Pool]\n    AC --> Memory[Memory System]\n    UC --> Hooks[Hooks System]\n```\n\n### Component Responsibilities\n\n| Component | Purpose |\n|-----------|---------|\n| **Topology Manager** | Central registry and factory for managing different topology types |\n| **Swarm Hub** | Central coordination point for inter-agent communication |\n| **Task Orchestrator** | Manages task distribution and workflow execution |\n| **Attention Coordinator** | Manages agent focus and priority-based task routing |\n| **Unified Coordinator** | Provides unified interface for all coordination operations |\n| **Communication Graph** | Tracks and enforces communication patterns between agents |\n| **Flow Enforcer** | Validates and enforces workflow constraints |\n\n资料来源：[packages/@monomind/swarm/src/coordination/swarm-hub.ts]()\n资料来源：[packages/@monomind/swarm/src/coordination/task-orchestrator.ts]()\n\n## Topology Types\n\n### Linear Topology (Pipeline)\n\nAgents are arranged in a sequential chain where output from one agent becomes input for the next. Best suited for tasks requiring strict sequential processing.\n\n```mermaid\ngraph LR\n    A[Agent 1] --> B[Agent 2]\n    B --> C[Agent 3]\n    C --> D[Agent 4]\n```\n\n### Hierarchical Topology\n\nAgents are organized in parent-child relationships with clear authority chains. Specialized sub-agents report to coordinator agents.\n\n```mermaid\ngraph TD\n    Root[Root Coordinator]\n    Root --> C1[Coordinator 1]\n    Root --> C2[Coordinator 2]\n    C1 --> S1[Specialist 1.1]\n    C1 --> S2[Specialist 1.2]\n    C2 --> S3[Specialist 2.1]\n    C2 --> S4[Specialist 2.2]\n```\n\n### Mesh Topology\n\nAgents can communicate directly with any other agent. Provides maximum flexibility but requires careful flow enforcement.\n\n```mermaid\ngraph TD\n    A[Agent A] <--> B[Agent B]\n    A <--> C[Agent C]\n    A <--> D[Agent D]\n    B <--> C\n    B <--> D\n    C <--> D\n```\n\n### Star Topology\n\nA central coordinator agent mediates all communication. All other agents communicate exclusively through the hub.\n\n```mermaid\ngraph TD\n    Hub[Central Hub]\n    Hub --> A[Agent A]\n    Hub --> B[Agent B]\n    Hub --> C[Agent C]\n    Hub --> D[Agent D]\n```\n\n### Hive-Mind Topology\n\nDistributed consensus-based topology where agents share a collective decision-making mechanism. All agents contribute to decisions through weighted voting or consensus algorithms.\n\n资料来源：[packages/implementation/adrs/README.md]()\n资料来源：[packages/@monomind/cli/src/commands/swarm.ts]()\n\n## Swarm Hub\n\nThe Swarm Hub serves as the central orchestration point for the swarm topology. It manages:\n\n### Communication Management\n\n- Agent registration and deregistration\n- Message routing between agents\n- Broadcasting messages to agent groups\n- Direct agent-to-agent communication channels\n\n```typescript\ninterface HubConfig {\n  topology: TopologyType;\n  maxAgents: number;\n  communicationGraph: CommunicationGraph;\n  flowEnforcer: FlowEnforcer;\n}\n```\n\n### Flow Enforcement\n\nThe Flow Enforcer component validates that communications follow the defined topology constraints:\n\n```typescript\ninterface FlowEnforcer {\n  validateConnection(source: AgentId, target: AgentId): boolean;\n  enforceDirection(agent: AgentId, direction: 'upstream' | 'downstream'): boolean;\n  validateMessageFlow(message: Message): ValidationResult;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/coordination/swarm-hub.ts]()\n资料来源：[packages/@monomind/cli/src/swarm/flow-enforcer.ts]()\n\n## Communication Graph\n\nThe Communication Graph tracks the relationships and communication patterns between agents within the topology.\n\n### Graph Structure\n\n```typescript\ninterface CommunicationNode {\n  agentId: AgentId;\n  role: AgentRole;\n  connections: Connection[];\n  metrics: AgentMetrics;\n}\n\ninterface Connection {\n  target: AgentId;\n  type: ConnectionType; // 'direct' | 'mediated' | 'broadcast'\n  weight: number;\n  lastActivity: Timestamp;\n}\n```\n\n### Graph Operations\n\n| Operation | Description |\n|-----------|-------------|\n| `addNode(agent)` | Register new agent in the graph |\n| `removeNode(agentId)` | Unregister agent and update connections |\n| `addEdge(source, target, type)` | Create communication link |\n| `removeEdge(source, target)` | Remove communication link |\n| `getPath(source, target)` | Find shortest communication path |\n| `getNeighbors(agentId)` | Get all connected agents |\n\n资料来源：[packages/@monomind/cli/src/swarm/communication-graph.ts]()\n\n## Task Orchestration\n\nThe Task Orchestrator distributes and manages tasks across the topology based on the current topology structure.\n\n### Task Distribution Strategies\n\n| Strategy | Topology Suitability | Description |\n|----------|---------------------|-------------|\n| **Sequential** | Linear, Pipeline | Tasks flow through agents in order |\n| **Parallel** | Mesh, Star | Tasks distributed to multiple agents simultaneously |\n| **Hierarchical** | Hierarchical | Tasks delegated down the authority chain |\n| **Broadcast** | Star, Mesh | Tasks sent to all relevant agents |\n| **Consensus** | Hive-Mind | Tasks require collective approval |\n\n### Task Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> Pending: Task Created\n    Pending --> Assigned: Orchestrator Routes\n    Assigned --> InProgress: Agent Accepts\n    InProgress --> Completed: Execution Done\n    InProgress --> Blocked: Awaiting Dependencies\n    Blocked --> InProgress: Dependencies Met\n    Completed --> [*]\n```\n\n资料来源：[packages/@monomind/swarm/src/coordination/task-orchestrator.ts]()\n\n## Attention Coordinator\n\nThe Attention Coordinator manages agent focus and priority-based routing, ensuring efficient resource utilization across the topology.\n\n### Priority Management\n\nAgents receive attention scores based on:\n\n- Current task priority\n- Agent specialization match\n- Availability and load\n- Historical performance metrics\n\n```typescript\ninterface AttentionMetrics {\n  focusScore: number;\n  priority: number;\n  specializationMatch: number;\n  availabilityScore: number;\n  performanceHistory: number;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/attention-coordinator.ts]()\n\n## Unified Coordinator\n\nThe Unified Coordinator provides a single interface for interacting with all topology components, simplifying complex swarm operations.\n\n### API Surface\n\n```typescript\ninterface UnifiedSwarmCoordinator {\n  // Topology Management\n  setTopology(type: TopologyType, config?: TopologyConfig): void;\n  getTopology(): TopologyInfo;\n  \n  // Agent Management\n  spawnAgent(type: AgentType, role?: AgentRole): AgentId;\n  terminateAgent(agentId: AgentId): void;\n  getActiveAgents(): AgentInfo[];\n  \n  // Communication\n  sendMessage(from: AgentId, to: AgentId, message: Message): void;\n  broadcast(from: AgentId, message: Message): void;\n  \n  // Task Management\n  submitTask(task: Task): TaskId;\n  getTaskStatus(taskId: TaskId): TaskStatus;\n  cancelTask(taskId: TaskId): void;\n  \n  // Coordination\n  achieveConsensus(agents: AgentId[], proposal: Proposal): ConsensusResult;\n  delegateTask(task: Task, agent: AgentId): void;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/unified-coordinator.ts]()\n\n## CLI Integration\n\nThe Monomind CLI provides commands for managing and visualizing swarm topologies:\n\n### Available Commands\n\n```bash\n# Initialize a swarm with specified topology\nmonomind swarm init --topology hierarchical\n\n# Set topology type\nmonomind swarm topology set --type mesh\n\n# Show current topology\nmonomind swarm topology show\n\n# List agents in swarm\nmonomind swarm agents list\n\n# View swarm status\nmonomind swarm status\n\n# Initialize mesh topology\nmonomind swarm init mesh\n\n# Spawn agent in swarm\nmonomind swarm agent spawn --type coder\n```\n\n### Swarm Subcommands\n\n| Command | Description |\n|---------|-------------|\n| `swarm init` | Initialize a new swarm |\n| `swarm init mesh` | Initialize mesh topology swarm |\n| `swarm status` | Display swarm health and metrics |\n| `swarm topology` | Manage topology settings |\n| `swarm agents` | List and manage swarm agents |\n| `swarm connect` | Connect to existing swarm |\n\n资料来源：[packages/@monomind/cli/src/commands/swarm.ts]()\n\n## Configuration\n\n### Topology Configuration Options\n\n```typescript\ninterface TopologyConfig {\n  type: TopologyType;\n  \n  // General settings\n  maxAgents: number;\n  agentTimeout: number;\n  \n  // Topology-specific settings\n  mesh?: {\n    maxConnectionsPerAgent: number;\n    connectionStrategy: 'random' | 'specialized' | 'full';\n  };\n  \n  hierarchical?: {\n    maxChildrenPerCoordinator: number;\n    delegationDepth: number;\n  };\n  \n  hiveMind?: {\n    consensusThreshold: number;\n    votingPeriod: number;\n    minParticipants: number;\n  };\n}\n```\n\n### Initialization Options\n\n```typescript\ninterface SwarmInitOptions {\n  topology: TopologyType;\n  maxAgents?: number;\n  defaultAgentType?: AgentType;\n  enableConsensus?: boolean;\n  communicationGraph?: {\n    trackMetrics: boolean;\n    retentionPeriod: number;\n  };\n  flowEnforcer?: {\n    strictMode: boolean;\n    allowedPatterns: CommunicationPattern[];\n  };\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/topology-manager.ts]()\n\n## Best Practices\n\n### Topology Selection Guidelines\n\n| Use Case | Recommended Topology |\n|----------|---------------------|\n| Simple sequential processing | Linear/Pipeline |\n| Complex multi-domain tasks | Hierarchical |\n| Highly collaborative workflows | Mesh |\n| Centralized control scenarios | Star |\n| Collective decision-making | Hive-Mind |\n\n### Performance Considerations\n\n1. **Mesh topologies** offer maximum parallelism but increase coordination overhead\n2. **Hierarchical topologies** reduce communication complexity but may create bottlenecks\n3. **Hive-Mind topologies** ensure consistent decisions but require more round-trips\n4. **Star topologies** provide clear authority but concentrate load on the hub\n\n### Flow Enforcement\n\nAlways enable the Flow Enforcer when using restricted topologies to prevent:\n\n- Unauthorized agent-to-agent communication\n- Circular dependencies\n- Task routing violations\n- Priority inversion attacks\n\n资料来源：[packages/@monomind/cli/src/swarm/flow-enforcer.ts]()\n\n## Related Documentation\n\n- [Agent Management](../cli/agent.md) - Agent spawning and lifecycle\n- [Task Orchestration](./task-orchestration.md) - Advanced task routing\n- [Memory System](../memory/README.md) - Cross-agent memory sharing\n- [Hooks System](../hooks/README.md) - Event-driven coordination\n\n---\n\n<a id='consensus-protocols'></a>\n\n## Consensus Protocols\n\n### 相关页面\n\n相关主题：[Swarm Topologies](#swarm-topologies)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/swarm/src/consensus/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/index.ts)\n- [packages/@monomind/swarm/src/consensus/raft.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/raft.ts)\n- [packages/@monomind/swarm/src/consensus/byzantine.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/byzantine.ts)\n- [packages/@monomind/swarm/src/consensus/gossip.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/swarm/src/consensus/gossip.ts)\n- [packages/@monomind/cli/src/consensus/audit-writer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/consensus/audit-writer.ts)\n- [packages/@monomind/cli/src/consensus/vote-signer.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/consensus/vote-signer.ts)\n</details>\n\n# Consensus Protocols\n\n## Overview\n\nThe Consensus Protocols module in Monomind provides a robust, multi-strategy approach to achieving agreement among distributed agents in a swarm coordination system. This module is critical for maintaining consistency, reliability, and fault tolerance when multiple autonomous agents must reach agreement on decisions, state changes, or leadership elections.\n\nThe consensus subsystem is architected to support three primary consensus paradigms, each optimized for different operational requirements and threat models:\n\n| Protocol | Use Case | Fault Tolerance | Performance |\n|----------|----------|-----------------|-------------|\n| **Raft** | Leader election, state replication | Crash fault tolerance | High throughput |\n| **Byzantine** | Adversarial environments, security-critical decisions | Byzantine fault tolerance | Medium throughput |\n| **Gossip** | Event propagation, eventual consistency | Partial network partitions | Highest throughput |\n\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts]()\n\n## Architecture\n\nThe consensus module follows a layered architecture that separates protocol implementation from coordination logic. The `UnifiedSwarmCoordinator` acts as the primary consumer of consensus services, while individual protocol implementations handle the algorithmic specifics.\n\n```mermaid\ngraph TD\n    A[UnifiedSwarmCoordinator] --> B[ConsensusService]\n    B --> C[RaftConsensus]\n    B --> D[ByzantineConsensus]\n    B --> E[GossipProtocol]\n    \n    F[CLI Audit Commands] --> G[AuditWriter]\n    H[Vote Signing] --> I[VoteSigner]\n    \n    G --> B\n    I --> C\n    I --> D\n    \n    J[Network Transport] --> C\n    J --> D\n    J --> E\n```\n\n### Core Interfaces\n\nThe consensus module exposes a unified interface through the main entry point:\n\n```typescript\n// packages/@monomind/swarm/src/consensus/index.ts\nexport interface ConsensusProtocol {\n  propose(value: ConsensusValue): Promise<ConsensusResult>;\n  join(nodeId: string): Promise<void>;\n  leave(nodeId: string): Promise<void>;\n  getState(): ConsensusState;\n  getMetrics(): ConsensusMetrics;\n}\n```\n\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts:1-50]()\n\n## Raft Consensus Implementation\n\nThe Raft implementation provides crash fault tolerance for leader election and log replication within the swarm. This protocol is selected by default when strong consistency is required without the overhead of Byzantine fault tolerance.\n\n### Leader Election\n\nRaft in Monomind uses a three-state machine model: **Follower**, **Candidate**, and **Leader**. The election process is triggered when a follower node does not receive a heartbeat from the current leader within the election timeout.\n\n```mermaid\nstateDiagram-v2\n    [*] --> Follower\n    Follower --> Candidate : Election timeout\n    Candidate --> Leader : Votes received (majority)\n    Candidate --> Follower : Higher term discovered\n    Leader --> Follower : Higher term discovered\n    Follower --> Follower : Heartbeat received\n    Candidate --> Candidate : Election timeout (re-election)\n```\n\n### Log Replication\n\nOnce a leader is elected, it replicates log entries to followers using the `proposeConsensus` method exposed through the coordinator interface. Entries are committed only after receiving acknowledgment from a majority of nodes.\n\n资料来源：[packages/@monomind/swarm/src/consensus/raft.ts]()\n\n## Byzantine Fault Tolerance\n\nThe Byzantine consensus implementation is designed for scenarios where agents may exhibit arbitrary or malicious behavior. This is particularly relevant in open multi-agent systems where not all participants can be trusted.\n\n### Byzantine Generals Problem\n\nByzantine consensus tolerates up to *f* faulty nodes in a system of *3f + 1* total nodes, making it suitable for security-critical swarm operations such as:\n\n- Vote signing and verification\n- Access control decisions\n- Resource allocation agreements\n- Cross-agent transaction validation\n\n```mermaid\ngraph LR\n    A[Propose] --> B[Pre-Prepare]\n    B --> C[Prepare]\n    C --> D[Commit]\n    D --> E[Reply]\n    \n    F[F+1 Distinct Signatures] --> E\n```\n\n资料来源：[packages/@monomind/swarm/src/consensus/byzantine.ts]()\n\n## Gossip Protocol\n\nThe Gossip protocol provides eventual consistency with minimal coordination overhead. Unlike Raft and Byzantine consensus, gossip is designed for high-throughput scenarios where strict consistency is not required.\n\n### Message Propagation\n\nNodes periodically select random peers to exchange state information. Over time, the entire swarm converges to a consistent state through epidemic propagation.\n\n| Property | Value |\n|----------|-------|\n| Convergence Time | O(log n) rounds |\n| Message Complexity | O(n log n) total messages |\n| Network Efficiency | High fan-out, low latency |\n\n### Fan-Out Strategy\n\nThe gossip implementation uses an adaptive fan-out factor based on network conditions and swarm size, optimizing message delivery while minimizing redundant transmissions.\n\n资料来源：[packages/@monomind/swarm/src/consensus/gossip.ts]()\n\n## CLI Integration\n\nThe Monomind CLI provides commands for managing and auditing consensus operations across the swarm.\n\n### Audit Writer\n\nThe `audit-writer` module enables operators to record and verify consensus decisions for compliance and debugging purposes.\n\n```bash\n# Record consensus decision\nmonomind consensus audit record --tx-id <transaction> --decision <choice>\n\n# Export audit trail\nmonomind consensus audit export --format json --since 2024-01-01\n```\n\n资料来源：[packages/@monomind/cli/src/consensus/audit-writer.ts]()\n\n### Vote Signing\n\nVote signing provides cryptographic verification of consensus participation, ensuring that only authorized agents can influence swarm decisions.\n\n```bash\n# Sign a vote\nmonomind consensus vote sign --proposal <id> --node <node-id>\n\n# Verify vote signatures\nmonomind consensus vote verify --proposal <id> --signatures <path>\n```\n\n资料来源：[packages/@monomind/cli/src/consensus/vote-signer.ts]()\n\n## Usage Patterns\n\n### Choosing the Right Protocol\n\n| Scenario | Recommended Protocol | Justification |\n|----------|---------------------|---------------|\n| Single datacenter, trusted agents | Raft | Highest performance, sufficient fault tolerance |\n| Multi-region deployment | Gossip | Partition tolerant, eventual consistency |\n| Open network, untrusted agents | Byzantine | Security-first, tolerates malicious behavior |\n| Mixed trust environment | Hybrid (Raft + Byzantine) | Use Byzantine for security-critical, Raft for operational |\n\n### Configuration Example\n\n```typescript\nimport { createConsensusService } from '@monomind/swarm';\n\nconst consensus = createConsensusService({\n  protocol: 'raft',\n  peers: ['agent-1:9001', 'agent-2:9001', 'agent-3:9001'],\n  electionTimeout: 500,\n  heartbeatInterval: 150,\n});\n\n// Propose a value\nconst result = await consensus.propose({\n  type: 'leader_decision',\n  value: { action: 'spawn_agent', config: agentConfig },\n  timeout: 5000,\n});\n```\n\n## API Reference\n\n### ConsensusService\n\n| Method | Parameters | Returns | Description |\n|--------|------------|---------|-------------|\n| `propose` | `value: ConsensusValue` | `Promise<ConsensusResult>` | Submit a value for consensus |\n| `join` | `nodeId: string` | `Promise<void>` | Join the consensus group |\n| `leave` | `nodeId: string` | `Promise<void>` | Leave the consensus group |\n| `getState` | — | `ConsensusState` | Get current consensus state |\n| `getMetrics` | — | `ConsensusMetrics` | Get performance metrics |\n\n### ConsensusResult\n\n```typescript\ninterface ConsensusResult {\n  success: boolean;\n  value?: unknown;\n  quorum?: string[];\n  term?: number;\n  signature?: string;\n  timestamp: number;\n  latency: number;\n}\n```\n\n## Performance Targets\n\nThe consensus module is designed to meet the following performance benchmarks:\n\n| Metric | Target |\n|--------|--------|\n| Coordination Latency | < 100ms |\n| Throughput | > 10,000 ops/sec |\n| Recovery Time | < 5 seconds |\n| Memory Overhead | < 50MB per agent |\n\n资料来源：[packages/@monomind/swarm/README.md]()\n资料来源：[packages/@monomind/swarm/src/consensus/index.ts]()\n\n## Related Documentation\n\n- [Swarm Coordination](../swarm/README.md) - Higher-level swarm management\n- [UnifiedSwarmCoordinator](../swarm/src/coordinator.ts) - Primary coordinator implementation\n- [CLI Commands](../cli/src/consensus/) - Command-line consensus tools\n\n---\n\n<a id='memory-system'></a>\n\n## Memory System\n\n### 相关页面\n\n相关主题：[Knowledge Graph (Monograph)](#knowledge-graph)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/memory/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/index.ts)\n- [packages/@monomind/memory/src/agentdb-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/agentdb-backend.ts)\n- [packages/@monomind/memory/src/hnsw-index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/hnsw-index.ts)\n- [packages/@monomind/memory/src/hybrid-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/hybrid-backend.ts)\n- [packages/@monomind/memory/src/sqlite-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/sqlite-backend.ts)\n- [packages/@monomind/memory/src/sqljs-backend.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/sqljs-backend.ts)\n- [packages/@monomind/neural/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/index.ts)\n- [packages/@monomind/neural/src/sona-integration.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/sona-integration.ts)\n- [packages/@monomind/neural/src/pattern-learner.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/neural/src/pattern-learner.ts)\n- [packages/@monomind/memory/src/learning-bridge.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/memory/src/learning-bridge.ts)\n</details>\n\n# Memory System\n\nThe Memory System is a core component of Monomind that provides persistent, searchable storage for agent insights, patterns, and learned knowledge. It implements a hybrid architecture combining SQLite for structured data persistence with HNSW-based vector indexing for high-performance semantic search.\n\n## Overview\n\nThe Memory System serves as the long-term knowledge repository for the Monomind AI coordination platform. It enables agents to:\n\n- **Persist insights** across sessions with confidence-weighted storage\n- **Search semantically** using vector embeddings and HNSW indexing\n- **Link knowledge** automatically using A-MEM auto-linking mechanisms\n- **Learn patterns** through SONA neural integration\n- **Sync with files** via AutoMemoryBridge for CLAUDE.md integration\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Architecture\n\n```mermaid\ngraph TB\n    subgraph \"Memory System Architecture\"\n        AMB[\"AutoMemoryBridge\"]\n        \n        subgraph \"Backends\"\n            HB[\"HybridBackend\"]\n            AB[\"AgentDB Backend\"]\n            SB[\"SQLite Backend\"]\n            HNSW[\"HNSW Index\"]\n        end\n        \n        subgraph \"Neural Integration\"\n            NL[\"Neural Learning\"]\n            PL[\"Pattern Learner\"]\n            SONA[\"SONA Integration\"]\n        end\n        \n        LB[\"LearningBridge\"]\n    end\n    \n    AMB --> HB\n    HB --> AB\n    HB --> SB\n    HB --> HNSW\n    LB --> NL\n    LB --> PL\n    NL --> SONA\n    AMB --> LB\n```\n\n### Component Overview\n\n| Component | Purpose | Data Type |\n|-----------|---------|-----------|\n| `HybridBackend` | Unified interface combining multiple backends | All memory entries |\n| `AgentDB Backend` | Vector semantic search with HNSW | Embeddings, insights |\n| `SQLite Backend` | Structured relational storage | Metadata, configurations |\n| `HNSW Index` | High-performance approximate nearest neighbor search | Vector embeddings |\n| `AutoMemoryBridge` | File sync and session management | Markdown files |\n| `LearningBridge` | Neural pattern learning integration | Learned patterns |\n\n资料来源：[packages/@monomind/memory/src/hybrid-backend.ts](packages/@monomind/memory/src/hybrid-backend.ts)\n\n## Backends\n\n### HybridBackend\n\nThe `HybridBackend` serves as the primary interface, combining structured storage with semantic search capabilities. It coordinates between AgentDB and SQLite backends while maintaining data consistency.\n\n```typescript\ninterface HybridBackendConfig {\n  embeddingGenerator?: EmbeddingGenerator;\n  storageDir?: string;\n  enableAutoLinking?: boolean;\n  maxAutoLinkReferences?: number;\n}\n```\n\n**Key Features:**\n- Automatic embedding generation for stored entries\n- A-MEM auto-linking with configurable neighbor count\n- Bidirectional reference management\n- Cross-session persistence\n\n资料来源：[packages/@monomind/memory/src/hybrid-backend.ts](packages/@monomind/memory/src/hybrid-backend.ts)\n\n### AgentDB Backend\n\nThe AgentDB backend provides vector storage and semantic search capabilities using HNSW (Hierarchical Navigable Small World) indexing.\n\n```typescript\ninterface AgentDBConfig {\n  dimension: number;\n  storagePath?: string;\n  m?: number;        // HNSW M parameter\n  efConstruction?: number;\n  efSearch?: number;\n}\n```\n\n**Performance Characteristics:**\n- **150x-12,500x faster** than brute-force search\n- Supports up to millions of vectors\n- Configurable HNSW parameters for accuracy/speed tradeoffs\n\n资料来源：[packages/@monomind/memory/src/agentdb-backend.ts](packages/@monomind/memory/src/agentdb-backend.ts)\n\n### SQLite Backend\n\nProvides structured data storage for metadata, configurations, and entries requiring relational queries.\n\n```typescript\ninterface SQLiteConfig {\n  storagePath?: string;\n  enableWAL?: boolean;\n  cacheSize?: number;\n}\n```\n\n资料来源：[packages/@monomind/memory/src/sqlite-backend.ts](packages/@monomind/memory/src/sqlite-backend.ts)\n\n### SQL.js Backend\n\nAn in-browser compatible SQLite implementation using WebAssembly, useful for environments without native SQLite support.\n\n```typescript\ninterface SqlJsConfig {\n  locateFile?: (file: string) => string;\n  memoryGrowth?: boolean;\n}\n```\n\n资料来源：[packages/@monomind/memory/src/sqljs-backend.ts](packages/@monomind/memory/src/sqljs-backend.ts)\n\n## HNSW Index\n\nThe HNSW (Hierarchical Navigable Small World) index provides the core vector search functionality.\n\n```mermaid\ngraph LR\n    A[\"Query Vector\"] --> B[\"Search Layer L\"]\n    B --> C[\"Search Layer L-1\"]\n    C --> D[\"Search Layer L-2\"]\n    D --> E[\"Bottom Layer\"]\n    E --> F[\"Results\"]\n```\n\n### Configuration Parameters\n\n| Parameter | Default | Description |\n|-----------|---------|-------------|\n| `m` | 16 | Max connections per node |\n| `efConstruction` | 200 | Construction time search breadth |\n| `efSearch` | 100 | Search time search breadth |\n| `dimension` | 1536 | Embedding vector dimension |\n\n资料来源：[packages/@monomind/memory/src/hnsw-index.ts](packages/@monomind/memory/src/hnsw-index.ts)\n\n## AutoMemoryBridge\n\nThe `AutoMemoryBridge` synchronizes between the in-memory vector database and persistent markdown files for CLAUDE.md integration.\n\n```typescript\nimport { AutoMemoryBridge } from '@monomind/memory';\n\nconst bridge = new AutoMemoryBridge(memoryBackend, {\n  workingDir: '/workspaces/my-project',\n  syncMode: 'on-session-end',\n  pruneStrategy: 'confidence-weighted',\n});\n```\n\n### Sync Modes\n\n| Mode | Behavior | Use Case |\n|------|----------|----------|\n| `on-write` | Immediate file writes | Critical data persistence |\n| `on-session-end` | Buffer and flush on session close | Efficient batch operations |\n| `periodic` | Configurable interval sync | Long-running sessions |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n### Scope Directories\n\n```mermaid\ngraph TD\n    A[\"Agent Request\"] --> B[\"Scope Selection\"]\n    B --> C1[\"project\"]\n    B --> C2[\"local\"]\n    B --> C3[\"user\"]\n    \n    C1 --> D1[\"<gitRoot>/.claude/agent-memory/<agent>/\"]\n    C2 --> D2[\"<gitRoot>/.claude/agent-memory-local/<agent>/\"]\n    C3 --> D3[\"~/.claude/agent-memory/<agent>/\"]\n```\n\n| Scope | Path Pattern | Description |\n|-------|--------------|-------------|\n| `project` | `<gitRoot>/.claude/agent-memory/<agent>/` | Project-specific learnings |\n| `local` | `<gitRoot>/.claude/agent-memory-local/<agent>/` | Machine-local data |\n| `user` | `~/.claude/agent-memory/<agent>/` | Cross-project user knowledge |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Insight Categories\n\n| Category | Topic File | Description |\n|----------|-----------|-------------|\n| `project-patterns` | `patterns.md` | Reusable code patterns |\n| `architecture` | `architecture.md` | System design decisions |\n| `debugging` | `debugging.md` | Bug fixes and workarounds |\n| `decisions` | `decisions.md` | ADR and rationale |\n| `api-contracts` | `api-contracts.md` | Interface definitions |\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Neural Learning Integration\n\n### Pattern Learning\n\nThe Pattern Learning system extracts and stores reusable patterns from agent interactions.\n\n```typescript\nimport { PatternLearner } from '@monomind/neural';\n\nconst learner = new PatternLearner({\n  extractionThreshold: 0.7,\n  consolidationWindow: 100,\n});\n```\n\n资料来源：[packages/@monomind/neural/src/pattern-learner.ts](packages/@monomind/neural/src/pattern-learner.ts)\n\n### SONA Integration\n\nSONA (Self-Optimizing Neural Adaptation) enables the memory system to learn from patterns and improve agent routing over time.\n\n```mermaid\ngraph TD\n    A[\"Memory Entry\"] --> B[\"Pattern Extraction\"]\n    B --> C[\"SONA Weight Update\"]\n    C --> D[\"Agent Routing Optimization\"]\n    D --> E[\"Performance Metrics\"]\n    E --> B\n```\n\n**Features:**\n- Pattern recognition improves agent routing\n- Trajectory tracking identifies effective strategies\n- Automatic model adaptation with <0.05ms overhead\n\n资料来源：[packages/@monomind/neural/src/sona-integration.ts](packages/@monomind/neural/src/sona-integration.ts)\n\n### LearningBridge\n\nThe `LearningBridge` connects the memory system with neural learning capabilities, enabling bidirectional flow of insights and learned patterns.\n\n```typescript\nconst bridge = new LearningBridge({\n  memoryBackend: hybridBackend,\n  neuralBackend: sonaBackend,\n  syncInterval: 60000,\n});\n```\n\n资料来源：[packages/@monomind/memory/src/learning-bridge.ts](packages/@monomind/memory/src/learning-bridge.ts)\n\n## Memory Operations\n\n### Store and Retrieve\n\n```typescript\n// Store an insight\nawait bridge.recordInsight({\n  category: 'debugging',\n  summary: 'HNSW index requires initialization before search',\n  source: 'agent:tester',\n  confidence: 0.95,\n});\n\n// Semantic search\nconst results = await backend.search('HNSW initialization', { topK: 5 });\n\n// Sync to files\nawait bridge.syncToAutoMemory();\n```\n\n### Memory CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `memory init` | Initialize memory database |\n| `memory store` | Store data in memory |\n| `memory retrieve` | Retrieve data from memory |\n| `memory search` | Semantic/vector search |\n| `memory list` | List memory entries |\n| `memory delete` | Delete an entry |\n| `memory stats` | Show statistics |\n\n资料来源：[packages/@monomind/cli/src/commands/memory.ts](packages/@monomind/cli/src/commands/memory.ts)\n\n## A-MEM Auto-Linking\n\nWhen `HybridBackend` is configured with an `embeddingGenerator`, every stored entry automatically discovers its top-3 semantic neighbors and creates bidirectional `references` edges—implementing the Zettelkasten note-linking structure.\n\n```typescript\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => myEmbeddingModel.embed(text),\n  maxAutoLinkReferences: 3,\n  enableAutoLinking: true,\n});\n```\n\n资料来源：[packages/@monomind/memory/README.md](packages/@monomind/memory/README.md)\n\n## Quick Start\n\n```typescript\nimport { \n  AutoMemoryBridge,\n  HybridBackend,\n  createAgentBridge,\n  resolveAgentMemoryDir,\n} from '@monomind/memory';\n\n// Create backend with embedding support\nconst backend = new HybridBackend({\n  embeddingGenerator: async (text) => embeddings.embed(text),\n});\n\n// Create bridge for file sync\nconst bridge = new AutoMemoryBridge(backend, {\n  workingDir: '/workspaces/my-project',\n  syncMode: 'on-session-end',\n});\n\n// Record insights\nawait bridge.recordInsight({\n  category: 'architecture',\n  summary: 'Use HybridBackend for production workloads',\n  confidence: 0.92,\n});\n\n// Sync to CLAUDE.md files\nawait bridge.syncToAutoMemory();\n```\n\n资料来源：[packages/@monomind/memory/src/index.ts](packages/@monomind/memory/src/index.ts)\n\n## Related Packages\n\n| Package | Purpose |\n|---------|---------|\n| `agentdb` | HNSW vector database |\n| `@monomind/neural` | Neural network and SONA learning |\n| `@monomind/cli` | CLI with memory commands |\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n---\n\n<a id='knowledge-graph'></a>\n\n## Knowledge Graph (Monograph)\n\n### 相关页面\n\n相关主题：[Memory System](#memory-system)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [packages/@monomind/monograph/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/index.ts)\n- [packages/@monomind/monograph/src/pipeline/runner.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/pipeline/runner.ts)\n- [packages/@monomind/monograph/src/graph/explain.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/explain.ts)\n- [packages/@monomind/monograph/src/graph/hotspots.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/hotspots.ts)\n- [packages/@monomind/monograph/src/graph/reachability.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/monograph/src/graph/reachability.ts)\n- [packages/@monomind/graph/src/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/index.ts)\n- [packages/@monomind/graph/src/build.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/build.ts)\n- [packages/@monomind/graph/src/extract/index.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/graph/src/extract/index.ts)\n- [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts](https://github.com/monoes/monomind/blob/main/packages/@monomind/cli/src/mcp-tools/monograph-tools.ts)\n</details>\n\n# Knowledge Graph (Monograph)\n\nMonograph is the knowledge graph subsystem of Monomind, designed to build, maintain, and query a semantic dependency graph of your codebase, documentation, and PDFs. It serves as the foundational intelligence layer that automatically maps relationships between code symbols, documents, and concepts before every task execution.\n\n## Overview\n\nMonograph creates a unified graph representation that captures both structural dependencies (imports, definitions) and semantic relationships (concepts, co-occurrences). This graph is automatically queried by hooks and slash commands, enabling agents to understand the codebase topology before making decisions.\n\n```mermaid\ngraph TD\n    A[Codebase + Docs + PDFs] --> B[Graph Builder]\n    B --> C[Monograph Graph DB]\n    C --> D[Query Engine]\n    D --> E[monograph_suggest]\n    D --> F[monograph_query]\n    D --> G[monograph_god_nodes]\n    E --> H[Claude Code Agent]\n    F --> H\n    G --> H\n```\n\n**资料来源：** [packages/@monomind/monograph/src/index.ts]()\n\n## Core Concepts\n\n### Graph Structure\n\nThe Monograph graph consists of two primary elements: **nodes** and **edges**.\n\n#### Node Types\n\n| Node Type | Description | Example |\n|-----------|-------------|---------|\n| `File` | Source file or document | `src/auth/login.ts` |\n| `Function` | Function or method definition | `authenticateUser()` |\n| `Class` | Class or interface definition | `UserService` |\n| `Concept` | Extracted semantic concept | `authentication-flow` |\n| `PDF` | PDF document chunk | `architecture.pdf:42-58` |\n| `Section` | Documentation section | API Reference, README |\n| `Interface` | TypeScript interface | `AuthProvider` |\n| `TypeAlias` | Type alias or union type | `UserId` |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n#### Edge Types\n\n| Relation | Meaning | Direction |\n|----------|---------|-----------|\n| `IMPORTS` | Code import dependency | File → File |\n| `DEFINES` | Symbol defined in file | File → Symbol |\n| `TAGGED_AS` | Section tagged with concept | Section → Concept |\n| `CO_OCCURS` | Concepts appear together | Concept → Concept |\n| `INFERRED` | Claude-extracted semantic relationship | Any → Any |\n| `DESCRIBES` | LLM-enriched relationship | Concept → Concept |\n| `CAUSES` | LLM-enriched relationship | Concept → Concept |\n| `PART_OF` | LLM-enriched relationship | Concept → Concept |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n### Graph Analysis Capabilities\n\nMonograph provides several analysis modes for examining the codebase:\n\n```mermaid\ngraph TD\n    subgraph Analysis Modes\n        A[reachability] --> A1[Upstream dependencies]\n        A --> A2[Downstream dependents]\n        B[hotspots] --> B1[High change frequency]\n        B --> B2[Cyclomatic complexity]\n        C[explain] --> C1[Dependency paths]\n        C --> C2[Impact analysis]\n    end\n```\n\n#### Reachability Analysis\n\nDetermines which files and symbols can reach or be reached from a given node. This is useful for understanding the blast radius of changes.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/reachability.ts]()\n\n#### Hotspots Detection\n\nIdentifies high-complexity or frequently-changing areas of the codebase that may need attention.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/hotspots.ts]()\n\n#### Explanation Engine\n\nProvides natural language explanations of dependency paths and relationships between code elements.\n\n**资料来源：** [packages/@monomind/monograph/src/graph/explain.ts]()\n\n## CLI Commands\n\nThe `monomind monograph` command provides the primary interface for building and querying the knowledge graph.\n\n### Command Reference\n\n| Subcommand | Description |\n|------------|-------------|\n| `monograph build` | Build knowledge graph from code + docs + PDFs |\n| `monograph wiki` | Scan all docs and PDFs into a searchable knowledge graph |\n| `monograph search` | Search the graph (BM25 / semantic / hybrid) |\n| `monograph stats` | Show node/edge counts and top concepts |\n| `monograph watch` | Watch for file changes and rebuild incrementally |\n\n**资料来源：** [packages/@monomind/cli/src/commands/monograph.ts]()\n\n### Quick Start\n\n```bash\n# First-time build (code + all docs)\nnpx monomind monograph build\n\n# Doc/wiki-focused build with Claude semantic extraction\nnpx monomind monograph wiki --llm\n\n# Search\nnpx monomind monograph search -q \"authentication flow\"\nnpx monomind monograph search -q \"pipeline\" --mode semantic --label Section\n\n# Stats\nnpx monomind monograph stats --top 20\n\n# Auto-rebuild on changes\nnpx monomind monograph watch\n```\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n### Search Modes\n\n| Mode | Description | Use Case |\n|------|-------------|----------|\n| `bm25` | Traditional keyword-based search | Exact matches |\n| `semantic` | Vector-based similarity search | Conceptual matches |\n| `hybrid` | Combined BM25 + semantic | Balanced results |\n\n**资料来源：** [packages/@monomind/cli/src/commands/monograph.ts]()\n\n## MCP Tools\n\nMonograph exposes tools via the Model Context Protocol for programmatic integration with Claude Code and other MCP-compatible clients.\n\n### Available Tools\n\n| Tool Name | Description |\n|-----------|-------------|\n| `monograph_graphify` | Convert workspace files to graph representation |\n| `monograph_stats` | Get node/edge statistics and graph health |\n| `monograph_boundary_check` | Check for cross-zone import violations |\n| `monograph_suggest` | Find relevant files for a task |\n| `monograph_query` | Query specific dependency relationships |\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n### Usage Example\n\n```typescript\n// Using MCP tool in Claude Code\n{\n  tool: 'monograph_suggest',\n  arguments: {\n    query: \"add webhook retry logic\",\n    role: \"code\"  // Optional: filter by role (code, test, docs)\n  }\n}\n```\n\n### Graphify Tool\n\nThe `monograph_graphify` tool provides detailed graph analysis:\n\n```mermaid\ngraph TD\n    A[graphify request] --> B{role filter}\n    B -->|unreachable| C[Dead code candidates]\n    B -->|test| D[Test utilities]\n    B -->|code| E[Source files]\n    B -->|all| F[Complete graph]\n    C --> G[Dependency stats]\n    D --> G\n    E --> G\n    F --> G\n```\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n## Configuration\n\nMonograph is configured via `.monographrc.json` in the project root.\n\n### Configuration Schema\n\n```typescript\ninterface MonographConfig {\n  root: string;              // Project root directory\n  entry: string[];           // Entry points for analysis\n  ignore: string[];          // Patterns to exclude\n  production: boolean;      // Enable production checks\n  detection: string;        // Detection mode\n  regression: {\n    tolerance: number;\n    baselinePath: string;\n  };\n  health: {\n    cyclomaticThreshold: number;\n    cognitiveThreshold: number;\n    crapThreshold: number;\n    minLines: number;\n  };\n  boundaries?: BoundaryConfig;  // Zone-based boundary rules\n  plugins: string[];\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n### Boundary Configuration\n\nBoundaries define architectural zones with allowed import rules:\n\n```json\n{\n  \"zones\": [\n    {\n      \"name\": \"core\",\n      \"patterns\": [\"src/core/**\"],\n      \"allowedImports\": [\"src/utils/**\"]\n    }\n  ]\n}\n```\n\n**资料来源：** [packages/@monomind/cli/src/mcp-tools/monograph-tools.ts]()\n\n### Default Configuration\n\n```typescript\nconst DEFAULT_MONOGRAPH_CONFIG = {\n  root: '.',\n  entry: [],\n  production: true,\n  detection: 'default',\n  project: undefined,\n  ignore: [],\n  overrides: [],\n  regression: { tolerance: 0, baselinePath: '.monograph/regression-baseline.json' },\n  audit: { gate: 'error', includeHealthGate: false },\n  normalization: {\n    stripComments: true,\n    normalizeWhitespace: true,\n    normalizeIdentifiers: false\n  },\n  boundaries: {},\n  resolve: {\n    paths: {},\n    alias: {},\n    conditions: [],\n    extensions: ['.ts', '.tsx', '.mts', '.cts']\n  },\n  health: {\n    cyclomaticThreshold: 10,\n    cognitiveThreshold: 15,\n    crapThreshold: 30,\n    minLines: 5\n  },\n  ownership: { emailMode: 'fullEmail' },\n  plugins: [],\n};\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## Pipeline Architecture\n\nThe Monograph pipeline processes code and documents through multiple stages:\n\n```mermaid\ngraph LR\n    A[Source Files] --> B[Parser]\n    B --> C[AST Analysis]\n    C --> D[Symbol Extractor]\n    D --> E[Graph Builder]\n    E --> F[Edge Resolver]\n    F --> G[Graph Database]\n    G --> H[Query Interface]\n    \n    I[Documents] --> J[Chunker]\n    J --> K[Embedding Generator]\n    K --> L[Vector Index]\n    L --> G\n```\n\n### Pipeline Runner\n\nThe pipeline runner orchestrates the graph construction process:\n\n```typescript\ninterface PipelineResult {\n  nodes: number;      // Total nodes created\n  edges: number;      // Total edges created\n  duration: number;   // Processing time in ms\n  errors: string[];   // Any processing errors\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/pipeline/runner.ts]()\n\n### Extraction Pipeline\n\nThe extraction pipeline handles both code symbols and documentation:\n\n```typescript\ninterface ExtractOptions {\n  includeTypes: boolean;      // Include type definitions\n  includeDocs: boolean;       // Include JSDoc comments\n  includeConcepts: boolean;   // Extract semantic concepts\n  useLLM: boolean;           // Use LLM for semantic extraction\n}\n```\n\n**资料来源：** [packages/@monomind/graph/src/extract/index.ts]()\n\n## Graph Query Operations\n\n### monograph_query\n\nQuery specific relationships in the graph:\n\n```bash\n# Find what depends on UserService\nmonograph_query \"UserService dependencies\"\n\n# Find files that define authentication\nmonograph_query \"authentication\" --label DEFINES\n```\n\n### monograph_suggest\n\nGet ranked file suggestions for a task:\n\n```bash\n# Find relevant files for a feature\nmonograph_suggest \"add webhook retry logic\"\n# → returns ranked list with relevance scores\n```\n\n### monograph_god_nodes\n\nIdentify high-centrality files (most connected in the graph):\n\n```bash\n# Find the most connected internal files\nmonograph_god_nodes\n# → excludes external dependencies and test files\n```\n\n**资料来源：** [README.md]()\n\n## Integration with Intelligence System\n\nMonograph integrates with Monomind's intelligence system to provide context-aware assistance:\n\n```mermaid\ngraph TD\n    A[User Task] --> B[Monograph Query]\n    B --> C[Relevant Files]\n    C --> D[SONA Learning]\n    D --> E[Pattern Recognition]\n    E --> F[Agent Routing]\n    F --> G[Task Execution]\n    G --> H[Trajectory Tracking]\n    H --> D\n```\n\n### Hooks Integration\n\nMonograph tools are called automatically by hooks before task execution, ensuring agents always have relevant context.\n\n**资料来源：** [README.md]()\n\n## Extended Configuration\n\nMonograph supports extended configuration for advanced use cases:\n\n```typescript\ninterface ExtendedMonographConfig extends MonographConfig {\n  extends?: string[];                    // Extend other configs\n  sealed?: boolean;                       // Prevent further extension\n  includeEntryExports?: boolean;         // Include entry point exports\n  publicPackages?: string[];             // Public package boundaries\n  dynamicallyLoaded?: string[];          // Dynamic import patterns\n  codeowners?: string;                   // CODEOWNERS file path\n  ignoreDependencies?: string[];         // Ignore certain imports\n  ignoreExportsUsedInFile?: boolean | {\n    interface?: boolean;\n    typeAlias?: boolean;\n  };\n  usedClassMembers?: Array<string | {\n    extends?: string[];\n    implements?: string[];\n    members: string[];\n  }>;\n}\n```\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## Health Checks\n\nMonograph includes code health analysis capabilities:\n\n| Metric | Threshold | Description |\n|--------|-----------|-------------|\n| Cyclomatic Complexity | 10 | Maximum allowed branching |\n| Cognitive Complexity | 15 | Maximum cognitive load |\n| CRAP Index | 30 | Change Risk Anti-Patterns |\n| Minimum Lines | 5 | Minimum function/file size |\n\n**资料来源：** [packages/@monomind/monograph/src/config/types.ts]()\n\n## CLI vs MCP Usage\n\n| Aspect | CLI | MCP Tools |\n|--------|-----|-----------|\n| **Use Case** | One-time builds, manual searches | Claude Code integration |\n| **Invocation** | Terminal commands | Programmatic queries |\n| **Real-time** | With `watch` command | During task execution |\n| **Output** | Formatted text | JSON structured data |\n\n**资料来源：** [plugin/commands/monograph/README.md]()\n\n## See Also\n\n- `memory` — Vector memory storage (separate from graph)\n- `hooks intelligence` — Pattern learning\n- CLAUDE.md Knowledge Graph section — workflow guidance for multi-file tasks\n\n---\n\n---\n\n## Doramagic 踩坑日志\n\n项目：monoes/monomind\n\n摘要：发现 15 个潜在踩坑项，其中 0 个为 high/blocking；最高优先级：安装坑 - 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills。\n\n## 1. 安装坑 · 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_ba46bd2053364ab7b216b1ab09b3714a | https://github.com/monoes/monomind/releases/tag/v1.10.0 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：v1.6.8\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.6.8\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8e00eb27c790432ba99d18d7125b0cee | https://github.com/monoes/monomind/releases/tag/v1.6.8 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：v1.9.12 — mastermind:idea pipeline hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.12 — mastermind:idea pipeline hardening\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6a79f40d2c5e44c4ac6b5e2e855d2a55 | https://github.com/monoes/monomind/releases/tag/v1.9.12 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 4. 安装坑 · 来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.13 — fix: monograph never installed (workspace:* dep)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2ffa187842b347428cc973816067e095 | https://github.com/monoes/monomind/releases/tag/v1.9.13 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 5. 安装坑 · 来源证据：v1.9.2 — mastermind:master hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.2 — mastermind:master hardening\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_d4070dac80cb428ba72244762274a6bf | https://github.com/monoes/monomind/releases/tag/v1.9.2 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 可能修改宿主 AI 配置\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。\n- 对用户的影响：安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。\n- 建议检查：列出会写入的配置文件、目录和卸载/回滚步骤。\n- 防护动作：涉及宿主配置目录时必须给回滚路径，不能只给安装命令。\n- 证据：capability.host_targets | github_repo:1221944165 | https://github.com/monoes/monomind | host_targets=mcp_host, claude, claude_code\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1221944165 | https://github.com/monoes/monomind | README/documentation is current enough for a first validation pass.\n\n## 8. 维护坑 · 来源证据：v1.9.1 — Init wipe-and-replace for managed Claude assets\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v1.9.1 — Init wipe-and-replace for managed Claude assets\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e1832d706e974245bfbf1fb183aeafb8 | https://github.com/monoes/monomind/releases/tag/v1.9.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | last_activity_observed missing\n\n## 10. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 11. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 12. 安全/权限坑 · 来源证据：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_57b3501be7e943c5a3329118314c1794 | https://github.com/monoes/monomind/releases/tag/v1.8.0 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. 安全/权限坑 · 来源证据：Monomind v1.9.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.9.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_77db71f60ceb4346b348922fc31f9cb7 | https://github.com/monoes/monomind/releases/tag/v1.9.0 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 14. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | issue_or_pr_quality=unknown\n\n## 15. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | release_recency=unknown\n\n<!-- canonical_name: monoes/monomind; human_manual_source: deepwiki_human_wiki -->\n",
      "summary": "DeepWiki/Human Wiki 完整输出，末尾追加 Discovery Agent 踩坑日志。",
      "title": "Human Manual / 人类版说明书"
    },
    "pitfall_log": {
      "asset_id": "pitfall_log",
      "filename": "PITFALL_LOG.md",
      "markdown": "# Pitfall Log / 踩坑日志\n\n项目：monoes/monomind\n\n摘要：发现 15 个潜在踩坑项，其中 0 个为 high/blocking；最高优先级：安装坑 - 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills。\n\n## 1. 安装坑 · 来源证据：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.10.0 — Full Paperclip Port: 55 New Mastermind Skills\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_ba46bd2053364ab7b216b1ab09b3714a | https://github.com/monoes/monomind/releases/tag/v1.10.0 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：v1.6.8\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.6.8\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8e00eb27c790432ba99d18d7125b0cee | https://github.com/monoes/monomind/releases/tag/v1.6.8 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：v1.9.12 — mastermind:idea pipeline hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.12 — mastermind:idea pipeline hardening\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6a79f40d2c5e44c4ac6b5e2e855d2a55 | https://github.com/monoes/monomind/releases/tag/v1.9.12 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 4. 安装坑 · 来源证据：v1.9.13 — fix: monograph never installed (workspace:* dep)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.13 — fix: monograph never installed (workspace:* dep)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2ffa187842b347428cc973816067e095 | https://github.com/monoes/monomind/releases/tag/v1.9.13 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。\n\n## 5. 安装坑 · 来源证据：v1.9.2 — mastermind:master hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：v1.9.2 — mastermind:master hardening\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_d4070dac80cb428ba72244762274a6bf | https://github.com/monoes/monomind/releases/tag/v1.9.2 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 可能修改宿主 AI 配置\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。\n- 对用户的影响：安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。\n- 建议检查：列出会写入的配置文件、目录和卸载/回滚步骤。\n- 防护动作：涉及宿主配置目录时必须给回滚路径，不能只给安装命令。\n- 证据：capability.host_targets | github_repo:1221944165 | https://github.com/monoes/monomind | host_targets=mcp_host, claude, claude_code\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1221944165 | https://github.com/monoes/monomind | README/documentation is current enough for a first validation pass.\n\n## 8. 维护坑 · 来源证据：v1.9.1 — Init wipe-and-replace for managed Claude assets\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：v1.9.1 — Init wipe-and-replace for managed Claude assets\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e1832d706e974245bfbf1fb183aeafb8 | https://github.com/monoes/monomind/releases/tag/v1.9.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | last_activity_observed missing\n\n## 10. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 11. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1221944165 | https://github.com/monoes/monomind | no_demo; severity=medium\n\n## 12. 安全/权限坑 · 来源证据：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.8.0 — Monograph, Mastermind & Security Hardening\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_57b3501be7e943c5a3329118314c1794 | https://github.com/monoes/monomind/releases/tag/v1.8.0 | 来源讨论提到 python 相关条件，需在安装/试用前复核。\n\n## 13. 安全/权限坑 · 来源证据：Monomind v1.9.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Monomind v1.9.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_77db71f60ceb4346b348922fc31f9cb7 | https://github.com/monoes/monomind/releases/tag/v1.9.0 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 14. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | issue_or_pr_quality=unknown\n\n## 15. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1221944165 | https://github.com/monoes/monomind | release_recency=unknown\n",
      "summary": "用户实践前最可能遇到的身份、安装、配置、运行和安全坑。",
      "title": "Pitfall Log / 踩坑日志"
    },
    "prompt_preview": {
      "asset_id": "prompt_preview",
      "filename": "PROMPT_PREVIEW.md",
      "markdown": "# monomind - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for monoes/monomind.\n\nProject:\n- Name: monomind\n- Repository: https://github.com/monoes/monomind\n- Summary: Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code\n- Host target: mcp_host, claude, claude_code\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: Enterprise AI agent orchestration platform — 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n- Capability 2: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. getting-started: Getting Started with Monomind. Produce one small intermediate artifact and wait for confirmation.\n2. project-structure: Project Structure. Produce one small intermediate artifact and wait for confirmation.\n3. architecture-overview: Architecture Overview. Produce one small intermediate artifact and wait for confirmation.\n4. packages-core: Core Packages. Produce one small intermediate artifact and wait for confirmation.\n5. agent-catalog: Agent Catalog. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/monoes/monomind\n- https://github.com/monoes/monomind#readme\n- .claude/skills/agent-browser-testing/SKILL.md\n- .claude/skills/agentdb-advanced/SKILL.md\n- .claude/skills/agentdb-learning/SKILL.md\n- .claude/skills/agentdb-memory-patterns/SKILL.md\n- .claude/skills/agentdb-optimization/SKILL.md\n- .claude/skills/agentdb-vector-search/SKILL.md\n- .claude/skills/agentic-integration/SKILL.md\n- .claude/skills/agentic-jujutsu/SKILL.md\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "summary": "不安装项目也能感受能力节奏的安全试用 Prompt。",
      "title": "Prompt Preview / 安装前试用 Prompt"
    },
    "quick_start": {
      "asset_id": "quick_start",
      "filename": "QUICK_START.md",
      "markdown": "# Quick Start / 官方入口\n\n项目：monoes/monomind\n\n## 官方安装入口\n\n### Node.js / npm · 官方安装入口\n\n```bash\nnpm install -g monomind\n```\n\n来源：https://github.com/monoes/monomind#readme\n\n## 来源\n\n- repo: https://github.com/monoes/monomind\n- docs: https://github.com/monoes/monomind#readme\n",
      "summary": "从项目官方 README 或安装文档提取的开工入口。",
      "title": "Quick Start / 官方入口"
    }
  },
  "validation_id": "dval_7314031fc3a74a69a6239df5d1732a0a"
}
