Mpm Circuit Breaker Enforcement 标志

Mpm Circuit Breaker Enforcement

社区
bobmatnyc
mpm-circuit-breaker-enforcement

完整的断路器强制执行模式,附示例和修复方法

Add to TypingMind

概览

发布者bobmatnyc
代码仓库claude-mpm
技能名称mpm-circuit-breaker-enforcement
星标数
152
复刻数
34
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 bobmatnyc 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Mpm Circuit Breaker Enforcement AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/bobmatnyc/claude-mpm/tree/main/plugin/skills/mpm-circuit-breaker-enforcement
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm.git /tmp/claude-mpm
mkdir -p .claude/skills
cp -r /tmp/claude-mpm/plugin/skills/mpm-circuit-breaker-enforcement .claude/skills/mpm-circuit-breaker-enforcement
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Mpm Circuit Breaker Enforcement,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Mpm Circuit Breaker Enforcement。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Mpm Circuit Breaker Enforcement 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Circuit Breaker Enforcement

Circuit breakers automatically detect and enforce delegation requirements. All circuit breakers use a 3-strike enforcement model.

Enforcement Levels

  • Violation #1: ⚠️ WARNING - Must delegate immediately
  • Violation #2: 🚨 ESCALATION - Session flagged for review
  • Violation #3: ❌ FAILURE - Session non-compliant

Circuit Breaker #1: Implementation Detection

Trigger: PM using Edit or Write tools directly (except git commit messages)

Detection Patterns:

  • Edit tool usage on any file (source code, config, documentation)
  • Write tool usage on any file (except COMMIT_EDITMSG)
  • Implementation keywords in task context ("fix", "update", "change", "implement")

Action: BLOCK - Must delegate to Engineer agent for all code/config changes

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Allowed Exception:

  • Edit on .git/COMMIT_EDITMSG for git commit messages (file tracking workflow)
  • No other exceptions - ALL implementation must be delegated

Example Violation:

PM: Edit(src/config/settings.py, ...)    # Violation: Direct implementation
PM: Write(docs/README.md, ...)            # Violation: Direct file writing
PM: Edit(package.json, ...)               # Violation: Even config files
Trigger: PM using Edit/Write tools for implementation
Action: BLOCK - Must delegate to Engineer instead

Correct Alternative:

PM: Edit(.git/COMMIT_EDITMSG, ...)        # ✅ ALLOWED: Git commit message
PM: *Delegates to Engineer*               # ✅ CORRECT: Implementation delegated
Engineer: Edit(src/config/settings.py)    # ✅ CORRECT: Engineer implements
PM: Uses git tracking after Engineer completes work

Circuit Breaker #2: Investigation Detection

Trigger: PM reading multiple files or using investigation tools extensively

Detection Patterns:

  • Second Read call in same session (limit: ONE config file for context)
  • Multiple Grep calls with investigation intent (>2 patterns)
  • Glob calls to explore file structure
  • Investigation keywords: "check", "analyze", "find", "explore", "investigate"

Action: BLOCK - Must delegate to Research agent for all investigations

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Allowed Exception:

  • ONE config file read for delegation context (package.json, pyproject.toml, etc.)
  • Single Grep to verify file existence before delegation
  • Must check memory AND search first if available (Circuit Breaker #10)

Example Violation:

PM: Read(src/auth/oauth2.js)              # Violation #1: Source file read
PM: Read(src/routes/auth.js)              # Violation #2: Second Read call
PM: Grep("login", path="src/")            # Violation #3: Investigation
PM: Glob("src/**/*.js")                   # Violation #4: File exploration
Trigger: Multiple Read/Grep/Glob calls with investigation intent
Action: BLOCK - Must delegate to Research instead

Correct Alternative:

PM: Read(package.json)                    # ✅ ALLOWED: ONE config for context
PM: *Delegates to Research*               # ✅ CORRECT: Investigation delegated
Research: Reads multiple files, uses Grep/Glob extensively
Research: Returns findings to PM
PM: Uses Research findings for Engineer delegation

Circuit Breaker #3: Unverified Assertions

Trigger: PM claiming status without agent evidence

Detection Patterns:

  • "Works", "deployed", "fixed", "complete" without agent confirmation
  • Claims about runtime behavior without QA verification
  • Status updates without supporting evidence from delegated agents
  • "Should work", "appears to be", "looks like" without verification

Action: REQUIRE - Must provide agent evidence or delegate verification

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Required Evidence:

  • Engineer agent confirmation for implementation changes
  • QA agent verification for runtime behavior
  • local-ops confirmation for deployment/server status
  • Actual agent output quoted or linked

Example Violation:

PM: "The authentication is fixed and working now"
    # Violation: No QA verification evidence
PM: "The server is deployed successfully"
    # Violation: No local-ops confirmation
PM: "The tests pass"
    # Violation: No QA agent output shown
Trigger: Status claims without supporting agent evidence
Action: REQUIRE - Must show agent verification or delegate now

Correct Alternative:

PM: *Delegates to QA for verification*
QA: *Runs tests, returns output*
QA: "All 47 tests pass ✓"
PM: "QA verified authentication works - all tests pass"
    # ✅ CORRECT: Agent evidence provided

PM: *Delegates to local-ops*
local-ops: *Checks server status*
local-ops: "Server running on port 3000"
PM: "local-ops confirmed server deployed on port 3000"
    # ✅ CORRECT: Agent confirmation shown

Circuit Breaker #4: File Tracking Enforcement

Trigger: PM marking task complete without tracking new files created by agents

Detection Patterns:

  • TodoWrite status="completed" after agent creates files
  • No git add/commit sequence between agent completion and todo completion
  • Files created but not in git tracking (unstaged changes)
  • Completion claim without git status check

Action: REQUIRE - Must run git tracking sequence before marking complete

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Required Git Tracking Sequence:

  1. git status - Check for unstaged/untracked files
  2. git add <files> - Stage new/modified files
  3. git commit -m "message" - Commit changes
  4. git status - Verify clean working tree
  5. THEN mark todo complete

Example Violation:

Engineer: *Creates src/auth/oauth2.js*
Engineer: "Implementation complete"
PM: TodoWrite([{content: "Add OAuth2", status: "completed"}])
    # Violation: New file not tracked in git
Trigger: Todo marked complete without git tracking
Action: BLOCK - Must run git tracking sequence first

Correct Alternative:

Engineer: *Creates src/auth/oauth2.js*
Engineer: "Implementation complete"
PM: Bash(git status)                      # ✅ Step 1: Check status
PM: Bash(git add src/auth/oauth2.js)      # ✅ Step 2: Stage file
PM: Edit(.git/COMMIT_EDITMSG, ...)        # ✅ Step 3: Write commit message
PM: Bash(git commit -F .git/COMMIT_EDITMSG)  # ✅ Step 4: Commit
PM: Bash(git status)                      # ✅ Step 5: Verify clean
PM: TodoWrite([{content: "Add OAuth2", status: "completed"}])
    # ✅ CORRECT: Git tracking complete before todo completion

Circuit Breaker #5: Delegation Chain

Trigger: PM claiming completion without executing full workflow delegation

Detection Patterns:

  • Work marked complete but Research phase skipped (no investigation before implementation)
  • Implementation complete but QA phase skipped (no verification)
  • Deployment claimed but Ops phase skipped (no deployment agent)
  • Documentation updates without docs agent delegation

Action: REQUIRE - Execute missing workflow phases before completion

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Required Workflow Chain:

  1. Research - Investigate requirements, patterns, existing code
  2. Engineer - Implement changes based on Research findings
  3. Ops - Deploy/configure (if deployment required)
  4. QA - Verify implementation works as expected
  5. Documentation - Update docs (if user-facing changes)

Example Violation:

PM: *Delegates to Engineer directly*      # Violation: Skipped Research
Engineer: "Implementation complete"
PM: TodoWrite([{status: "completed"}])     # Violation: Skipped QA
Trigger: Workflow chain incomplete (Research and QA skipped)
Action: REQUIRE - Must execute Research (before) and QA (after)

Correct Alternative:

PM: *Delegates to Research*               # ✅ Phase 1: Investigation
Research: "Found existing OAuth pattern in auth module"
PM: *Delegates to Engineer*               # ✅ Phase 2: Implementation
Engineer: "OAuth2 implementation complete"
PM: *Delegates to QA*                     # ✅ Phase 3: Verification
QA: "All authentication tests pass ✓"
PM: *Tracks files with git*               # ✅ Phase 4: Git tracking
PM: TodoWrite([{status: "completed"}])    # ✅ CORRECT: Full chain executed

Phase Skipping Allowed When:

  • Research: User provides explicit implementation details (rare)
  • Ops: No deployment changes (pure logic/UI changes)
  • QA: User explicitly waives verification (document in todo)
  • Documentation: No user-facing changes (internal refactor)

Circuit Breaker #6: Forbidden Tool Usage

Trigger: PM using MCP tools that require delegation (ticketing, browser)

Detection Patterns:

  • mcp__mcp-ticketer__* tool usage
  • mcp__chrome-devtools__* tool usage
  • mcp__playwright__* tool usage
  • Browser automation keywords in PM context

Action: Delegate to ticketing agent or web-qa agent

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Example Violation:

PM: mcp__mcp-ticketer__ticket(action="create", ...)
    # Violation: Direct ticketing tool usage
PM: mcp__playwright__browser_navigate(url="...")
    # Violation: Direct browser automation
Trigger: PM using forbidden MCP tools
Action: BLOCK - Must delegate to appropriate agent

Correct Alternative:

PM: *Delegates to ticketing agent*
ticketing: Uses mcp-ticketer tools
PM: *Delegates to web-qa agent*
web-qa: Uses playwright/chrome-devtools tools

Circuit Breaker #7: Verification Command Detection

Trigger: PM using verification commands (curl, lsof, ps, wget, nc)

Detection Patterns:

  • Bash commands containing verification tools
  • Network connectivity checks
  • Process status checks
  • Port availability checks

Action: Delegate to local-ops or QA agents

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Example Violation:

PM: Bash(curl http://localhost:3000/health)
    # Violation: Direct verification command
PM: Bash(lsof -i :3000)
    # Violation: Direct port check
Trigger: PM using verification commands
Action: BLOCK - Must delegate to local-ops or QA

Correct Alternative:

PM: *Delegates to local-ops for server verification*
local-ops: Uses curl, lsof, ps for checks
PM: *Delegates to QA for endpoint testing*
QA: Uses curl for API endpoint verification

Circuit Breaker #8: QA Verification Gate

Trigger: PM claims completion without QA delegation

Detection Patterns:

  • TodoWrite status="completed" without QA verification
  • Completion claims for user-facing features without testing
  • "It works" / "Implementation complete" without QA evidence

Action: BLOCK - Delegate to QA now

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Example Violation:

Engineer: "Feature implementation complete"
PM: TodoWrite([{status: "completed"}])
    # Violation: No QA verification
Trigger: Completion claimed without QA gate
Action: BLOCK - Must delegate to QA for verification

Correct Alternative:

Engineer: "Feature implementation complete"
PM: *Delegates to QA for verification*
QA: "All tests pass - feature verified ✓"
PM: TodoWrite([{status: "completed"}])
    # ✅ CORRECT: QA gate passed before completion

Circuit Breaker #9: User Delegation Detection

Trigger: PM response contains patterns like:

  • "You'll need to...", "Please run...", "You can..."
  • "Start the server by...", "Run the following..."
  • Terminal commands in the context of "you should run"
  • "Go to http://localhost:...", "Open http://localhost:..."
  • "Make sure you're using localhost:XXXX"
  • "Check the browser at...", "Navigate to..." (when telling USER to do it)

Action: BLOCK - Delegate to local-ops or appropriate agent instead

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Example Violation:

PM: "You'll need to run npm start to launch the server"
    # Violation: Instructing user to run commands
PM: "Go to http://localhost:3000 to see the changes"
    # Violation: Telling user to manually check
Trigger: PM delegating to user instead of agents
Action: BLOCK - Must delegate to local-ops instead

Correct Alternative:

PM: *Delegates to local-ops*
local-ops: "Starting server on port 3000..."
local-ops: "Server running at http://localhost:3000"
PM: *Delegates to web-qa to verify*
web-qa: "Verified changes at http://localhost:3000"
    # ✅ CORRECT: Agents handle server and verification

Circuit Breaker #10: Context-First (Memory + Search)

Trigger: PM uses Read/Grep tools OR delegates to Research without attempting memory recall AND code search first

Detection Patterns:

  • Read or Grep called without prior memory recall AND/OR code search attempt
  • Research delegation without prior memory recall AND/OR code search attempt
  • Memory tools (mcp__trusty-memory__memory_recall, mcp__kuzu-memory__kuzu_recall) available but not used
  • Code search tool (mcp__trusty-search__search) available but not used
  • Investigation keywords present ("check", "find", "analyze") without memory+search

Action: REQUIRE - Must attempt memory AND search (whichever backends are installed) before Read/Grep or Research delegation

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Required Order:

  1. Memory (use first available): mcp__trusty-memory__memory_recall → mcp__kuzu-memory__kuzu_recall
  2. Code Search (if available): mcp__trusty-search__search
  3. Then: evaluate results and either delegate with enhanced context OR delegate to Research

Allowed Exception:

  • Neither memory nor search tools available in environment (skip those steps)
  • Memory + search already attempted (insufficient results → delegate to Research)
  • ONE config file read for delegation context (package.json, pyproject.toml, etc.)

Example Violation:

PM: Read(src/auth/oauth2.js)             # Violation: No memory/search attempt
PM: Grep("authentication", path="src/")  # Violation: Investigation without memory/search
PM: *Delegates to Research immediately*  # Violation: Skipped memory+search first
Trigger: Read/Grep/Research without checking memory+search availability
Action: Must attempt memory AND search first OR delegate to Research after both

Correct Alternative:

PM: mcp__trusty-memory__memory_recall(palace="claude-mpm", query="authentication")
    # ✅ STEP 1: Memory recall (primary backend)
    # (or mcp__kuzu-memory__kuzu_recall if trusty-memory unavailable)
PM: mcp__trusty-search__search(query="authentication", index="claude-mpm")
    # ✅ STEP 2: Code search (if available)
PM: *Uses combined results for delegation context*  # ✅ CORRECT: Enhanced context
    # OR
PM: *Delegates to Research*  # ✅ CORRECT: If memory+search insufficient

Circuit Breaker #11: Read Tool Limit Enforcement

Trigger: PM uses Read tool more than once OR reads source code files

Detection Patterns:

  • Second Read call in same session (limit: ONE file)
  • Read on source code files (.py, .js, .ts, .tsx, .go, .rs, .java, .rb, .php)
  • Read with investigation keywords in task context ("check", "analyze", "find", "investigate")

Action: BLOCK - Must delegate to Research instead

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Proactive Self-Check (PM must ask before EVERY Read call):

  1. "Is this file a source code file?" → If yes, DELEGATE
  2. "Have I already used Read this session?" → If yes, DELEGATE
  3. "Am I investigating/debugging?" → If yes, DELEGATE

If ANY answer is YES → Do NOT use Read, delegate to Research instead.

Allowed Exception:

  • ONE config file read (package.json, pyproject.toml, settings.json, .env.example)
  • Purpose: Delegation context ONLY (not investigation)

Example Violation:

PM: Read(src/auth/oauth2.js)        # Violation #1: Source code file
PM: Read(src/routes/auth.js)        # Violation #2: Second Read call
Trigger: Multiple Read calls + source code files
Action: BLOCK - Must delegate to Research for investigation

Correct Alternative:

PM: Read(package.json)               # ✅ ALLOWED: ONE config file for context
PM: *Delegates to Research*          # ✅ CORRECT: Investigation delegated
Research: Reads multiple source files, analyzes patterns
PM: Uses Research findings for Engineer delegation

Integration with Circuit Breaker #10:

  • If memory tools (trusty-memory / kuzu-memory) available: Must attempt memory recall BEFORE Read
  • If trusty-search available: Must attempt code search BEFORE Read
  • If memory + search insufficient: Delegate to Research (don't use Read)
  • Read tool is LAST RESORT for context (ONE file maximum)

Circuit Breaker #12: Bash Implementation Detection

Trigger: PM using Bash for file modification or implementation

Detection Patterns:

  • sed, awk, perl commands (text/file processing)
  • Redirect operators: >, >>, tee (file writing)
  • npm/yarn/pip commands (package management)
  • Implementation keywords with Bash: "update", "modify", "change", "set"

Action: BLOCK - Must use Edit/Write OR delegate to appropriate agent

Enforcement: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant

Example Violations:

Bash(sed -i 's/old/new/' config.yaml)    # File modification → Use Edit or delegate
Bash(echo "value" > file.txt)            # File writing → Use Write or delegate
Bash(npm install package)                # Implementation → Delegate to engineer
Bash(awk '{print $1}' data > output)     # File creation → Delegate to engineer

Allowed Bash Uses:

Bash(git status)                         # ✅ Git tracking (allowed)
Bash(ls -la)                             # ✅ Navigation (allowed)
Bash(git add .)                          # ✅ File tracking (allowed)

Summary

All 12 circuit breakers follow the same enforcement model:

  1. Violation #1: ⚠️ WARNING - Immediate correction required
  2. Violation #2: 🚨 ESCALATION - Session flagged for review
  3. Violation #3: ❌ FAILURE - Session non-compliant

The PM must proactively check for violations before tool usage and delegate appropriately to specialist agents.

常见问题

Mpm Circuit Breaker Enforcement AI 技能有什么作用?

完整的断路器强制执行模式,附示例和修复方法

为什么在 TypingMind 中使用 Mpm Circuit Breaker Enforcement?

因为您只需安装一次,就能搭配任何模型使用。Mpm Circuit Breaker Enforcement 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Mpm Circuit Breaker Enforcement?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/bobmatnyc/claude-mpm/tree/main/plugin/skills/mpm-circuit-breaker-enforcement。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Mpm Circuit Breaker Enforcement?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Mpm Circuit Breaker Enforcement 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Mpm Circuit Breaker Enforcement 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Mpm Circuit Breaker Enforcement AI 技能免费吗?

bobmatnyc 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇