Mpm agents skills

From bobmatnyc/claude-mpm · View interactive version

Mpm agents skills is an AI agent skill from the GitHub repository bobmatnyc/claude-mpm. Agent and skill deployment mechanics for MPM system architecture

How to use this skill

Skill file

MPM Agents & Skills Deployment Mechanics

Category: Core Knowledge/PM Education

Purpose: Explain agent and skill deployment mechanics to PM

Triggers: When PM needs to understand system architecture

Overview

This skill provides comprehensive understanding of how Claude MPM's agents and skills actually work under the hood. Essential for PM decision-making about delegation, configuration, and troubleshooting.

Agent Deployment Mechanics

Where Agents Live

Agent Sources (Priority Order):

  1. Project agents - .claude/agents/ (highest priority)
  2. User agents - ~/.claude-mpm/agents/ (user-created)
  3. System agents - Built-in MPM templates (cached)
  4. Git sources - Remote repositories (configured)

Directory Structure:

.claude/
└── agents/
    ├── engineer.md        # Claude Code expects flat .md files
    ├── researcher.md
    └── qa.md

.claude-mpm/
└── cache/
    └── agents/            # Git sources cached here
        ├── engineer.md
        └── templates/

Agent Discovery & Loading Process

1. Cache Sync (Git Sources)

2. Agent Deployment

3. Multi-Source Resolution

Agent Configuration Relationships

configuration.yaml (User Preferences):

agents:
  auto_discover: true          # Find agents automatically
  enabled: ["engineer", "qa"]  # Specific agents to deploy
  excluded_agents: ["debug"]  # Agents to skip/remove
  precedence: ["project", "user", "system"]  # Resolution order

auto_config.yaml (Deployment Metadata):

# Generated by auto-configure process
toolchain_detected: python
recommended_agents: ["engineer", "testing"]
last_scan: "2024-02-25T10:30:00Z"
deployment_version: "5.9.32"

Key Distinction:

Agent Lifecycle

Creation:

  1. Template exists in source (Git repo or bundled)
  2. AgentTemplateBuilder combines base_agent.md + template
  3. Frontmatter added with version, source info
  4. Written to .claude/agents/ as markdown file

Version Management:

Cleanup:

Skill Deployment Mechanics

Where Skills Live

Skill Sources:

  1. Deployed skills - ~/.claude/skills/ (Claude Code scans here)
  2. Cached skills - .claude-mpm/cache/skills/system/
  3. Bundled skills - Built into MPM installation
  4. Git sources - Remote skill repositories

Structure Transformation:

# Git Repository Structure (Nested):
collaboration/
  dispatching-parallel-agents/SKILL.md
  brainstorming/SKILL.md

# Deployed Structure (Flat):
~/.claude/skills/
├── collaboration-dispatching-parallel-agents/SKILL.md
├── collaboration-brainstorming/SKILL.md

Skill Discovery & Deployment

1. Git Source Sync

2. Skill Deployment

3. Selective Deployment

Skill Configuration

No Direct Configuration:

Deployment Tracking:

// ~/.claude/skills/.mpm-deployed-skills.json
{
  "deployed_skills": {
    "systematic-debugging": {
      "collection": "claude-mpm-skills",
      "deployed_at": "2024-02-25T10:30:00Z"
    }
  },
  "last_sync": "2024-02-25T10:30:00Z"
}

Configuration File Relationships

Primary Configuration Files

1. .claude-mpm/configuration.yaml

2. .claude-mpm/auto_config.yaml

3. .claude-mpm/config/agent_sources.yaml

Configuration Hierarchy

Loading Order:

  1. Built-in defaults
  2. Global config (~/.claude-mpm/configuration.yaml)
  3. Project config (./claude-mpm/configuration.yaml)
  4. Environment variables
  5. Command-line arguments (highest priority)

Precedence Rules:

Startup Process Deep Dive

1. Configuration Loading

# ConfigService loads in this order:
def load_configuration():
    config = DefaultConfig()
    config.merge(load_global_config())      # ~/.claude-mpm/
    config.merge(load_project_config())     # ./.claude-mpm/
    config.merge(environment_variables())   # CLAUDE_MPM_*
    return config

2. Agent Deployment

def startup_agent_deployment():
    # 1. Sync git sources to cache
    git_sync_service.sync_agents()

    # 2. Deploy enabled agents to .claude/agents/
    deployment_service.deploy_agents(
        deployment_mode="update",  # Skip unchanged
        config=loaded_config
    )

    # 3. Remove excluded agents
    reconciler.remove_excluded_agents()

3. Skill Deployment

def startup_skill_deployment():
    # 1. Analyze deployed agents for skill requirements
    required_skills = agent_analyzer.get_required_skills()

    # 2. Deploy only required skills (with cleanup)
    skill_manager.deploy_skills(
        skill_filter=required_skills,  # Selective deployment
        force=False
    )

4. Service Initialization

Commands vs Skills: When to Use What

CLI Commands

Use for:

Characteristics:

Skills (via `/skill-name`)

Use for:

Characteristics:

Mapping Examples:

Common PM Misconceptions (Corrected)

❌ "Auto-configure creates agent files"

✅ Truth: Auto-configure only updates auto_config.yaml with recommendations. Actual deployment happens during claude-mpm run or explicit deploy commands.

❌ "Configuration.yaml controls agent deployment directly"

✅ Truth: It specifies preferences. The deployment service reads these preferences and deploys accordingly. The files are still copied from cache to .claude/agents/.

❌ "Skills are configured like agents"

✅ Truth: Skills have no user configuration. They're deployed based on agent requirements analysis, not user preferences.

❌ "All agents from Git sources are deployed"

✅ Truth: Only enabled agents (after filtering by excluded_agents list) are deployed. Multi-source resolution happens first.

❌ ".claude/ directory is just cache"

✅ Truth: .claude/ is the active deployment directory that Claude Code scans. .claude-mpm/cache/ is the actual cache.

Decision Trees for PM

Should I deploy this agent?

Is agent needed for current project? → Yes
  ├─ Is it in enabled list or auto_discover=true? → Yes
  │   ├─ Is it in excluded_agents list? → No
  │   │   └─ ✅ Deploy via configuration
  │   └─ Yes → ❌ Remove from excluded list first
  └─ No → ❌ Add to excluded_agents to clean up

How to troubleshoot deployment issues?

Agent not appearing in .claude/agents/?
  ├─ Check cache: `.claude-mpm/cache/agents/` exists? → No
  │   └─ Run: claude-mpm agents sync
  ├─ Check config: In excluded_agents list? → Yes
  │   └─ Run: claude-mpm configure (remove exclusion)
  └─ Check logs: deployment_service.log for errors

Should I use command or skill?

Need to change system state? → Yes
  └─ Use CLI command (claude-mpm ...)
Need guidance or information? → Yes
  └─ Use skill (/skill-name)
Need to understand how something works? → Yes
  └─ Use this skill (/mpm-agents-skills)

Quick Reference

Key Directories

Key Services

Essential Commands

Remember

This architecture ensures clean separation between user intent (configuration) and system state (deployment) while maintaining flexibility for different deployment scenarios.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.