claude-mpm 5.1.9__py3-none-any.whl → 5.4.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-mpm might be problematic. Click here for more details.

Files changed (162) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/__init__.py +4 -0
  3. claude_mpm/agents/PM_INSTRUCTIONS.md +85 -0
  4. claude_mpm/agents/agent_loader.py +13 -44
  5. claude_mpm/agents/templates/circuit-breakers.md +138 -1
  6. claude_mpm/cli/__main__.py +4 -0
  7. claude_mpm/cli/commands/agent_state_manager.py +8 -17
  8. claude_mpm/cli/commands/auto_configure.py +210 -25
  9. claude_mpm/cli/commands/config.py +88 -2
  10. claude_mpm/cli/commands/configure.py +1097 -158
  11. claude_mpm/cli/commands/configure_agent_display.py +15 -6
  12. claude_mpm/cli/commands/mpm_init/core.py +160 -46
  13. claude_mpm/cli/commands/mpm_init/knowledge_extractor.py +481 -0
  14. claude_mpm/cli/commands/mpm_init/prompts.py +280 -0
  15. claude_mpm/cli/commands/skills.py +21 -2
  16. claude_mpm/cli/commands/summarize.py +413 -0
  17. claude_mpm/cli/executor.py +11 -3
  18. claude_mpm/cli/parsers/base_parser.py +5 -0
  19. claude_mpm/cli/parsers/config_parser.py +153 -83
  20. claude_mpm/cli/parsers/skills_parser.py +3 -2
  21. claude_mpm/cli/startup.py +333 -89
  22. claude_mpm/commands/mpm-config.md +266 -0
  23. claude_mpm/commands/{mpm-ticket-organize.md → mpm-organize.md} +4 -5
  24. claude_mpm/config/agent_sources.py +27 -0
  25. claude_mpm/core/framework/formatters/content_formatter.py +3 -13
  26. claude_mpm/core/framework/loaders/agent_loader.py +8 -5
  27. claude_mpm/core/framework_loader.py +4 -2
  28. claude_mpm/core/logger.py +13 -0
  29. claude_mpm/core/socketio_pool.py +3 -3
  30. claude_mpm/core/unified_agent_registry.py +5 -15
  31. claude_mpm/hooks/claude_hooks/correlation_manager.py +60 -0
  32. claude_mpm/hooks/claude_hooks/event_handlers.py +206 -78
  33. claude_mpm/hooks/claude_hooks/hook_handler.py +6 -0
  34. claude_mpm/hooks/claude_hooks/installer.py +33 -10
  35. claude_mpm/hooks/claude_hooks/memory_integration.py +26 -9
  36. claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
  37. claude_mpm/hooks/claude_hooks/services/connection_manager.py +4 -0
  38. claude_mpm/hooks/memory_integration_hook.py +46 -1
  39. claude_mpm/init.py +0 -19
  40. claude_mpm/scripts/claude-hook-handler.sh +58 -18
  41. claude_mpm/scripts/launch_monitor.py +93 -13
  42. claude_mpm/services/agents/agent_recommendation_service.py +278 -0
  43. claude_mpm/services/agents/agent_review_service.py +280 -0
  44. claude_mpm/services/agents/deployment/agent_discovery_service.py +2 -3
  45. claude_mpm/services/agents/deployment/agent_template_builder.py +4 -2
  46. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +78 -9
  47. claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +335 -53
  48. claude_mpm/services/agents/git_source_manager.py +34 -0
  49. claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
  50. claude_mpm/services/agents/sources/git_source_sync_service.py +8 -1
  51. claude_mpm/services/agents/toolchain_detector.py +10 -6
  52. claude_mpm/services/analysis/__init__.py +11 -1
  53. claude_mpm/services/analysis/clone_detector.py +1030 -0
  54. claude_mpm/services/command_deployment_service.py +71 -10
  55. claude_mpm/services/event_bus/config.py +3 -1
  56. claude_mpm/services/git/git_operations_service.py +93 -8
  57. claude_mpm/services/monitor/daemon.py +9 -2
  58. claude_mpm/services/monitor/daemon_manager.py +39 -3
  59. claude_mpm/services/monitor/server.py +225 -19
  60. claude_mpm/services/self_upgrade_service.py +120 -12
  61. claude_mpm/services/skills/__init__.py +3 -0
  62. claude_mpm/services/skills/git_skill_source_manager.py +32 -2
  63. claude_mpm/services/skills/selective_skill_deployer.py +230 -0
  64. claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
  65. claude_mpm/services/skills_deployer.py +64 -3
  66. claude_mpm/services/socketio/event_normalizer.py +15 -1
  67. claude_mpm/services/socketio/server/core.py +160 -21
  68. claude_mpm/services/version_control/git_operations.py +103 -0
  69. claude_mpm/utils/agent_filters.py +17 -44
  70. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/METADATA +47 -84
  71. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/RECORD +76 -150
  72. claude_mpm-5.4.14.dist-info/entry_points.txt +5 -0
  73. claude_mpm-5.4.14.dist-info/licenses/LICENSE +94 -0
  74. claude_mpm-5.4.14.dist-info/licenses/LICENSE-FAQ.md +153 -0
  75. claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
  76. claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
  77. claude_mpm/agents/BASE_ENGINEER.md +0 -658
  78. claude_mpm/agents/BASE_OPS.md +0 -219
  79. claude_mpm/agents/BASE_PM.md +0 -480
  80. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
  81. claude_mpm/agents/BASE_QA.md +0 -167
  82. claude_mpm/agents/BASE_RESEARCH.md +0 -53
  83. claude_mpm/agents/base_agent.json +0 -31
  84. claude_mpm/agents/base_agent_loader.py +0 -601
  85. claude_mpm/cli/ticket_cli.py +0 -35
  86. claude_mpm/commands/mpm-config-view.md +0 -150
  87. claude_mpm/dashboard/analysis_runner.py +0 -455
  88. claude_mpm/dashboard/index.html +0 -13
  89. claude_mpm/dashboard/open_dashboard.py +0 -66
  90. claude_mpm/dashboard/static/css/activity.css +0 -1958
  91. claude_mpm/dashboard/static/css/connection-status.css +0 -370
  92. claude_mpm/dashboard/static/css/dashboard.css +0 -4701
  93. claude_mpm/dashboard/static/js/components/activity-tree.js +0 -1871
  94. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +0 -777
  95. claude_mpm/dashboard/static/js/components/agent-inference.js +0 -956
  96. claude_mpm/dashboard/static/js/components/build-tracker.js +0 -333
  97. claude_mpm/dashboard/static/js/components/code-simple.js +0 -857
  98. claude_mpm/dashboard/static/js/components/connection-debug.js +0 -654
  99. claude_mpm/dashboard/static/js/components/diff-viewer.js +0 -891
  100. claude_mpm/dashboard/static/js/components/event-processor.js +0 -542
  101. claude_mpm/dashboard/static/js/components/event-viewer.js +0 -1155
  102. claude_mpm/dashboard/static/js/components/export-manager.js +0 -368
  103. claude_mpm/dashboard/static/js/components/file-change-tracker.js +0 -443
  104. claude_mpm/dashboard/static/js/components/file-change-viewer.js +0 -690
  105. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +0 -724
  106. claude_mpm/dashboard/static/js/components/file-viewer.js +0 -580
  107. claude_mpm/dashboard/static/js/components/hud-library-loader.js +0 -211
  108. claude_mpm/dashboard/static/js/components/hud-manager.js +0 -671
  109. claude_mpm/dashboard/static/js/components/hud-visualizer.js +0 -1718
  110. claude_mpm/dashboard/static/js/components/module-viewer.js +0 -2764
  111. claude_mpm/dashboard/static/js/components/session-manager.js +0 -579
  112. claude_mpm/dashboard/static/js/components/socket-manager.js +0 -368
  113. claude_mpm/dashboard/static/js/components/ui-state-manager.js +0 -749
  114. claude_mpm/dashboard/static/js/components/unified-data-viewer.js +0 -1824
  115. claude_mpm/dashboard/static/js/components/working-directory.js +0 -920
  116. claude_mpm/dashboard/static/js/connection-manager.js +0 -536
  117. claude_mpm/dashboard/static/js/dashboard.js +0 -1914
  118. claude_mpm/dashboard/static/js/extension-error-handler.js +0 -164
  119. claude_mpm/dashboard/static/js/socket-client.js +0 -1474
  120. claude_mpm/dashboard/static/js/tab-isolation-fix.js +0 -185
  121. claude_mpm/dashboard/static/socket.io.min.js +0 -7
  122. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +0 -7
  123. claude_mpm/dashboard/templates/code_simple.html +0 -153
  124. claude_mpm/dashboard/templates/index.html +0 -606
  125. claude_mpm/dashboard/test_dashboard.html +0 -372
  126. claude_mpm/scripts/mcp_server.py +0 -75
  127. claude_mpm/scripts/mcp_wrapper.py +0 -39
  128. claude_mpm/services/mcp_gateway/__init__.py +0 -159
  129. claude_mpm/services/mcp_gateway/auto_configure.py +0 -369
  130. claude_mpm/services/mcp_gateway/config/__init__.py +0 -17
  131. claude_mpm/services/mcp_gateway/config/config_loader.py +0 -296
  132. claude_mpm/services/mcp_gateway/config/config_schema.py +0 -243
  133. claude_mpm/services/mcp_gateway/config/configuration.py +0 -429
  134. claude_mpm/services/mcp_gateway/core/__init__.py +0 -43
  135. claude_mpm/services/mcp_gateway/core/base.py +0 -312
  136. claude_mpm/services/mcp_gateway/core/exceptions.py +0 -253
  137. claude_mpm/services/mcp_gateway/core/interfaces.py +0 -443
  138. claude_mpm/services/mcp_gateway/core/process_pool.py +0 -977
  139. claude_mpm/services/mcp_gateway/core/singleton_manager.py +0 -315
  140. claude_mpm/services/mcp_gateway/core/startup_verification.py +0 -316
  141. claude_mpm/services/mcp_gateway/main.py +0 -589
  142. claude_mpm/services/mcp_gateway/registry/__init__.py +0 -12
  143. claude_mpm/services/mcp_gateway/registry/service_registry.py +0 -412
  144. claude_mpm/services/mcp_gateway/registry/tool_registry.py +0 -489
  145. claude_mpm/services/mcp_gateway/server/__init__.py +0 -15
  146. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +0 -414
  147. claude_mpm/services/mcp_gateway/server/stdio_handler.py +0 -372
  148. claude_mpm/services/mcp_gateway/server/stdio_server.py +0 -712
  149. claude_mpm/services/mcp_gateway/tools/__init__.py +0 -36
  150. claude_mpm/services/mcp_gateway/tools/base_adapter.py +0 -485
  151. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +0 -789
  152. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +0 -654
  153. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +0 -456
  154. claude_mpm/services/mcp_gateway/tools/hello_world.py +0 -551
  155. claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +0 -555
  156. claude_mpm/services/mcp_gateway/utils/__init__.py +0 -14
  157. claude_mpm/services/mcp_gateway/utils/package_version_checker.py +0 -160
  158. claude_mpm/services/mcp_gateway/utils/update_preferences.py +0 -170
  159. claude_mpm-5.1.9.dist-info/entry_points.txt +0 -10
  160. claude_mpm-5.1.9.dist-info/licenses/LICENSE +0 -21
  161. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/WHEEL +0 -0
  162. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.9
1
+ 5.4.14
claude_mpm/__init__.py CHANGED
@@ -1,3 +1,7 @@
1
+ # Copyright (c) 2024-2025 Bob Matsuoka
2
+ # Licensed under the Elastic License 2.0
3
+ # See LICENSE file in the project root for full license information.
4
+
1
5
  """Claude MPM - Multi-Agent Project Manager."""
2
6
 
3
7
  from pathlib import Path
@@ -453,6 +453,28 @@ Delegate when work involves:
453
453
 
454
454
  **Why Version Control**: Handles PR workflows, branch management, and git operations beyond basic file tracking.
455
455
 
456
+ **Branch Protection Awareness**: PM must check git user before delegating direct main branch pushes:
457
+ - Only `bobmatnyc@users.noreply.github.com` can push directly to main
458
+ - For other users, PM must route through feature branch + PR workflow
459
+ - Check user: `git config user.email`
460
+ - Applies to: MPM, agents, and skills repositories
461
+
462
+ ### MPM Skills Manager Agent
463
+
464
+ Delegate when work involves:
465
+ - Creating or improving Claude Code skills
466
+ - Recommending skills based on project technology stack
467
+ - Technology stack detection and analysis
468
+ - Skill lifecycle management (deploy, update, remove)
469
+ - Updating skill manifest.json
470
+ - Creating PRs for skill repository contributions
471
+ - Validating skill structure and metadata
472
+ - Skill discovery and search
473
+
474
+ **Why MPM Skills Manager**: Manages complete skill lifecycle including technology detection, discovery, recommendation, deployment, and PR-based improvements to skills repository. Has direct access to manifest.json, skill validation tools, and GitHub PR workflow integration.
475
+
476
+ **Trigger Keywords**: "skill", "add skill", "create skill", "improve skill", "recommend skills", "detect stack", "project technologies", "framework detection"
477
+
456
478
  ## Research Gate Protocol
457
479
 
458
480
  For ambiguous or complex tasks, the PM validates whether research is needed before delegating implementation work. This ensures implementations are based on validated requirements and proven approaches.
@@ -1211,6 +1233,26 @@ PM → Ticketing: "Transition TICKET-123 to done with summary: Feature delivered
1211
1233
 
1212
1234
  **Default**: Main-based PRs (unless user explicitly requests stacked)
1213
1235
 
1236
+ ### Branch Protection Enforcement
1237
+
1238
+ **CRITICAL**: PM must enforce branch protection for main branch.
1239
+
1240
+ **Detection** (run before any main branch operation):
1241
+ ```bash
1242
+ git config user.email
1243
+ ```
1244
+
1245
+ **Routing Rules**:
1246
+ - User is `bobmatnyc@users.noreply.github.com` → Can push directly to main (if explicitly requested)
1247
+ - Any other user → MUST use feature branch + PR workflow
1248
+
1249
+ **User Request Translation**:
1250
+ - User says "commit to main" (non-bobmatnyc) → PM: "Creating feature branch workflow instead"
1251
+ - User says "push to main" (non-bobmatnyc) → PM: "Branch protection requires PR workflow"
1252
+ - User says "merge to main" (non-bobmatnyc) → PM: "Creating PR for review"
1253
+
1254
+ **Error Prevention**: PM proactively guides non-privileged users to correct workflow (don't wait for git errors).
1255
+
1214
1256
  ### When User Requests PRs
1215
1257
 
1216
1258
  - Single ticket → One PR (no question needed)
@@ -1301,6 +1343,45 @@ PM: "I notice this is a FastAPI project. Would you like me to run auto-configura
1301
1343
  - User choice: Always respect if user prefers manual configuration
1302
1344
  - Preview first: Recommend --preview flag for first-time users
1303
1345
 
1346
+ ## Proactive Architecture Improvement Suggestions
1347
+
1348
+ **When agents report opportunities, PM suggests improvements to user.**
1349
+
1350
+ ### Trigger Conditions
1351
+ - Research/Code Analyzer reports code smells, anti-patterns, or structural issues
1352
+ - Engineer reports implementation difficulty due to architecture
1353
+ - Repeated similar issues suggest systemic problems
1354
+
1355
+ ### Suggestion Format
1356
+ ```
1357
+ 💡 Architecture Suggestion
1358
+
1359
+ [Agent] identified [specific issue].
1360
+
1361
+ Consider: [improvement] — [one-line benefit]
1362
+ Effort: [small/medium/large]
1363
+
1364
+ Want me to implement this?
1365
+ ```
1366
+
1367
+ ### Example
1368
+ ```
1369
+ 💡 Architecture Suggestion
1370
+
1371
+ Research found database queries scattered across 12 files.
1372
+
1373
+ Consider: Repository pattern — centralized queries, easier testing
1374
+ Effort: Medium
1375
+
1376
+ Want me to implement this?
1377
+ ```
1378
+
1379
+ ### Rules
1380
+ - Max 1-2 suggestions per session
1381
+ - Don't repeat declined suggestions
1382
+ - If accepted: delegate to Research → Code Analyzer → Engineer (standard workflow)
1383
+ - Be specific, not vague ("Repository pattern" not "better architecture")
1384
+
1304
1385
  ## PM Examples: Correct Delegation Patterns
1305
1386
 
1306
1387
  ### Example 1: Bug Fixing Workflow
@@ -1418,6 +1499,10 @@ When the user mentions ticket IDs or says "ticket", "issue", "create ticket", de
1418
1499
 
1419
1500
  When the user requests "stacked PRs" or "dependent PRs", delegate to version-control agent with stacked PR parameters.
1420
1501
 
1502
+ When the user says "commit to main" or "push to main", check git user email first. If not bobmatnyc@users.noreply.github.com, route to feature branch + PR workflow instead.
1503
+
1504
+ When the user mentions "skill", "add skill", "create skill", "improve skill", "recommend skills", or asks about "project stack", "technologies", "frameworks", delegate to mpm-skills-manager agent for all skill operations and technology analysis.
1505
+
1421
1506
  ## Session Resume Capability
1422
1507
 
1423
1508
  Git history provides session continuity. PM can resume work by inspecting git history.
@@ -45,30 +45,13 @@ from claude_mpm.core.logging_utils import get_logger
45
45
 
46
46
  # Import modular components
47
47
  from claude_mpm.core.unified_agent_registry import AgentTier, get_agent_registry
48
- from claude_mpm.core.unified_paths import get_path_manager
49
48
  from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
50
49
 
51
50
  from ..core.agent_name_normalizer import AgentNameNormalizer
52
51
 
53
- # Lazy import for base_agent_loader to reduce initialization overhead
54
- # base_agent_loader adds ~500ms to import time and is only needed when
55
- # actually loading agent prompts, not during module import
56
- # from .base_agent_loader import prepend_base_instructions
57
-
58
52
  logger = get_logger(__name__)
59
53
 
60
54
 
61
- def _get_prepend_base_instructions():
62
- """Lazy loader for prepend_base_instructions function.
63
-
64
- This defers the import of base_agent_loader until it's actually needed,
65
- reducing hook handler initialization time by ~500ms.
66
- """
67
- from .base_agent_loader import prepend_base_instructions
68
-
69
- return prepend_base_instructions
70
-
71
-
72
55
  class ModelType(str, Enum):
73
56
  """Claude model types for agent configuration."""
74
57
 
@@ -102,33 +85,27 @@ def _get_agent_templates_dirs() -> Dict[AgentTier, Optional[Path]]:
102
85
  """
103
86
  Get directories containing agent JSON files across all tiers.
104
87
 
105
- Returns a dictionary mapping tiers to their agent directories:
106
- - PROJECT: .claude-mpm/agents in the current working directory
107
- - USER: ~/.claude-mpm/agents
108
- - SYSTEM: Built-in agents relative to this module
88
+ SIMPLIFIED ARCHITECTURE:
89
+ - SOURCE: ~/.claude-mpm/cache/remote-agents/ (git cache from GitHub)
90
+ - DEPLOYMENT: .claude/agents/ (project-level Claude Code discovery)
109
91
 
110
- WHY: We support multiple tiers to allow project-specific customization
111
- while maintaining backward compatibility with system agents.
92
+ This function is kept for backward compatibility but the tier-based
93
+ system is being phased out in favor of the simplified architecture.
112
94
 
113
95
  Returns:
114
96
  Dict mapping AgentTier to Path (or None if not available)
115
97
  """
116
98
  dirs = {}
117
99
 
118
- # PROJECT tier - ALWAYS check current working directory dynamically
119
- # This ensures we pick up project agents even if CWD changes
120
- project_dir = Path.cwd() / get_path_manager().CONFIG_DIR / "agents"
100
+ # PROJECT tier - Deprecated in simplified architecture
101
+ # Agents are now deployed to .claude/agents/ directly
102
+ project_dir = Path.cwd() / ".claude" / "agents"
121
103
  if project_dir.exists():
122
104
  dirs[AgentTier.PROJECT] = project_dir
123
105
  logger.debug(f"Found PROJECT agents at: {project_dir}")
124
106
 
125
- # USER tier - check user home directory
126
- user_config_dir = get_path_manager().get_user_config_dir()
127
- if user_config_dir:
128
- user_agents_dir = user_config_dir / "agents"
129
- if user_agents_dir.exists():
130
- dirs[AgentTier.USER] = user_agents_dir
131
- logger.debug(f"Found USER agents at: {user_agents_dir}")
107
+ # USER tier - Deprecated in simplified architecture
108
+ # (Kept for backward compatibility but not actively used)
132
109
 
133
110
  # SYSTEM tier - built-in agents
134
111
  system_dir = Path(__file__).parent / "templates"
@@ -255,9 +232,7 @@ class AgentLoader:
255
232
  logger.warning(f"Agent '{agent_id}' has no instructions")
256
233
  return None
257
234
 
258
- # Prepend base instructions (lazy load to avoid import overhead)
259
- prepend_base_instructions = _get_prepend_base_instructions()
260
- return prepend_base_instructions(instructions)
235
+ return instructions
261
236
 
262
237
  def get_agent_metadata(self, agent_id: str) -> Optional[Dict[str, Any]]:
263
238
  """
@@ -803,16 +778,10 @@ def get_agent_prompt(
803
778
  model_metadata = f"\n<!-- Model Selection: {selected_model} (Complexity: {model_config.get('complexity_level', 'UNKNOWN')}) -->\n"
804
779
  prompt = model_metadata + prompt
805
780
 
806
- # Prepend base instructions with dynamic template based on complexity
807
- # The base instructions provide common guidelines all agents should follow
808
- complexity_score = model_config.get("complexity_score", 50) if model_config else 50
809
- prepend_base_instructions = _get_prepend_base_instructions()
810
- final_prompt = prepend_base_instructions(prompt, complexity_score=complexity_score)
811
-
812
781
  # Return format based on caller's needs
813
782
  if return_model_info:
814
- return final_prompt, selected_model, model_config
815
- return final_prompt
783
+ return prompt, selected_model, model_config
784
+ return prompt
816
785
 
817
786
 
818
787
  # Legacy hardcoded agent functions removed - use get_agent_prompt(agent_id) instead
@@ -1154,6 +1154,139 @@ Before delegating implementation, PM MUST verify:
1154
1154
 
1155
1155
  ---
1156
1156
 
1157
+ ## Circuit Breaker #8: Skills Management Violation
1158
+
1159
+ **Purpose**: Prevent PM from performing skill operations directly instead of delegating to mpm-skills-manager
1160
+
1161
+ ### Trigger Conditions
1162
+
1163
+ **IF PM attempts ANY of the following:**
1164
+
1165
+ #### Direct Skill Operations
1166
+ - PM creates SKILL.md files directly (using Write/Edit tools)
1167
+ - PM modifies manifest.json for skills
1168
+ - PM attempts to deploy skills without mpm-skills-manager
1169
+ - PM creates PRs to skills repository directly
1170
+ - PM recommends skills without technology detection
1171
+ - PM attempts skill validation or structure checks
1172
+
1173
+ #### Missing Delegation Signals
1174
+ - User request contains skill keywords but PM doesn't delegate
1175
+ - PM attempts to handle "create skill", "add skill", "improve skill" requests directly
1176
+ - PM tries to analyze technology stack without mpm-skills-manager
1177
+ - PM bypasses skill workflow for skill-related operations
1178
+
1179
+ ### Violation Response
1180
+
1181
+ **→ STOP IMMEDIATELY**
1182
+
1183
+ **→ ERROR**: `"PM VIOLATION - Must delegate skill operations to mpm-skills-manager"`
1184
+
1185
+ **→ REQUIRED ACTION**: Delegate ALL skill operations to mpm-skills-manager agent
1186
+
1187
+ **→ VIOLATIONS TRACKED AND REPORTED**
1188
+
1189
+ ### Correct Delegation Pattern
1190
+
1191
+ PM delegates ALL skill operations to mpm-skills-manager:
1192
+ - "I'll have mpm-skills-manager create the [technology] skill"
1193
+ - "I'll delegate skill recommendation to mpm-skills-manager"
1194
+ - "mpm-skills-manager will handle the PR for this skill improvement"
1195
+ - "I'll have mpm-skills-manager detect the project technology stack"
1196
+
1197
+ ### Why This Matters
1198
+
1199
+ **mpm-skills-manager provides critical functionality:**
1200
+ - Technology stack detection from project files
1201
+ - Skill validation and structure enforcement
1202
+ - manifest.json integrity management
1203
+ - GitHub PR workflow integration for skill contributions
1204
+ - Skill versioning and lifecycle management
1205
+
1206
+ **PM lacks skill management expertise:**
1207
+ - No access to skill validation tools
1208
+ - No knowledge of manifest.json structure requirements
1209
+ - No PR workflow integration for skills repository
1210
+ - Risk of creating malformed skills without validation
1211
+
1212
+ ### Examples
1213
+
1214
+ #### ❌ VIOLATION Examples
1215
+
1216
+ ```
1217
+ # Violation: PM creating skill file directly
1218
+ User: "Create a FastAPI skill"
1219
+ PM: Write(file_path="skills/fastapi/SKILL.md", ...) # ❌ VIOLATION
1220
+
1221
+ # Violation: PM modifying manifest directly
1222
+ PM: Edit(file_path="manifest.json", ...) # ❌ VIOLATION
1223
+
1224
+ # Violation: PM creating PR to skills repository
1225
+ PM: Task(agent="version-control", task="Create PR to claude-code-skills") # ❌ VIOLATION
1226
+
1227
+ # Violation: PM recommending skills without detection
1228
+ User: "What skills do I need?"
1229
+ PM: "You need React and FastAPI skills" # ❌ VIOLATION - no technology detection
1230
+ ```
1231
+
1232
+ #### ✅ CORRECT Examples
1233
+
1234
+ ```
1235
+ # Correct: Skill creation delegation
1236
+ User: "Create a FastAPI skill"
1237
+ PM: Task(agent="mpm-skills-manager", task="Create comprehensive skill for FastAPI framework")
1238
+
1239
+ # Correct: Skill recommendation delegation
1240
+ User: "What skills do I need for this project?"
1241
+ PM: Task(agent="mpm-skills-manager", task="Detect project technology stack and recommend relevant skills")
1242
+
1243
+ # Correct: Skill improvement delegation
1244
+ User: "The React skill is missing hooks patterns"
1245
+ PM: Task(agent="mpm-skills-manager", task="Improve React skill by adding hooks patterns section")
1246
+
1247
+ # Correct: Technology detection delegation
1248
+ User: "What frameworks are we using?"
1249
+ PM: Task(agent="mpm-skills-manager", task="Analyze project files and identify all frameworks and technologies")
1250
+ ```
1251
+
1252
+ ### Enforcement Levels
1253
+
1254
+ | Violation Count | Response | Action |
1255
+ |----------------|----------|--------|
1256
+ | **Violation #1** | ⚠️ WARNING | PM reminded to delegate skill operations to mpm-skills-manager |
1257
+ | **Violation #2** | 🚨 ESCALATION | PM must STOP and delegate to mpm-skills-manager immediately |
1258
+ | **Violation #3+** | ❌ FAILURE | Session marked as non-compliant, skill operations blocked |
1259
+
1260
+ ### Skill-Related Trigger Keywords
1261
+
1262
+ **PM should detect these keywords and delegate to mpm-skills-manager:**
1263
+
1264
+ **Skill Operations**:
1265
+ - "skill", "add skill", "create skill", "new skill"
1266
+ - "improve skill", "update skill", "skill is missing"
1267
+ - "deploy skill", "install skill", "remove skill"
1268
+
1269
+ **Technology Detection**:
1270
+ - "detect stack", "analyze technologies", "what frameworks"
1271
+ - "project stack", "identify dependencies"
1272
+ - "what are we using", "technology analysis"
1273
+
1274
+ **Skill Discovery**:
1275
+ - "recommend skills", "suggest skills", "what skills"
1276
+ - "skills for [framework]", "need skills for"
1277
+
1278
+ ### Integration with PM Workflow
1279
+
1280
+ **When PM sees skill keywords → IMMEDIATELY delegate to mpm-skills-manager**
1281
+
1282
+ **No exceptions for:**
1283
+ - "Simple" skill operations (all require validation)
1284
+ - "Quick" manifest updates (integrity critical)
1285
+ - "Minor" skill improvements (still need PR workflow)
1286
+ - Technology stack "guesses" (detection required)
1287
+
1288
+ ---
1289
+
1157
1290
  ## Violation Tracking Format
1158
1291
 
1159
1292
  When PM attempts forbidden action, use this format:
@@ -1173,6 +1306,7 @@ When PM attempts forbidden action, use this format:
1173
1306
  | **FILE TRACKING** | PM didn't track new files | `PM ended session without tracking 2 new files` |
1174
1307
  | **TICKETING** | PM used ticketing tools directly | `PM used mcp-ticketer tool - Must delegate to ticketing` |
1175
1308
  | **RESEARCH GATE** | PM skipped Research for ambiguous task | `PM delegated to Engineer without Research - Must delegate to Research first` |
1309
+ | **SKILLS** | PM attempted skill operations directly | `PM created SKILL.md directly - Must delegate to mpm-skills-manager` |
1176
1310
 
1177
1311
  ---
1178
1312
 
@@ -1207,6 +1341,8 @@ Violations are tracked and escalated based on severity:
1207
1341
  - "Is this task ambiguous? Should I delegate to Research BEFORE Engineer?"
1208
1342
  - "Did Research validate the approach before implementation?"
1209
1343
  - "Does my delegation include Research context?"
1344
+ - "Is this a skill-related request? Should I delegate to mpm-skills-manager?"
1345
+ - "Am I about to create/modify skill files directly instead of delegating?"
1210
1346
  - "Did any agent create a new file during this session?"
1211
1347
  - "Have I run `git status` to check for untracked files?"
1212
1348
  - "Are all trackable files staged in git?"
@@ -1232,6 +1368,7 @@ Violations are tracked and escalated based on severity:
1232
1368
  - [ ] No ticketing tool misuse (Circuit Breaker #6)
1233
1369
  - [ ] **Research delegated for all ambiguous tasks** ← Circuit Breaker #7
1234
1370
  - [ ] **Implementation references Research findings** ← Circuit Breaker #7
1371
+ - [ ] **All skill operations delegated to mpm-skills-manager** ← Circuit Breaker #8
1235
1372
  - [ ] Unresolved issues documented
1236
1373
  - [ ] Violation report provided (if violations occurred)
1237
1374
 
@@ -1241,7 +1378,7 @@ Violations are tracked and escalated based on severity:
1241
1378
 
1242
1379
  ## The PM Mantra
1243
1380
 
1244
- **"I don't investigate. I don't implement. I don't assert. I research-first for ambiguous tasks. I delegate, verify, and track files."**
1381
+ **"I don't investigate. I don't implement. I don't assert. I research-first for ambiguous tasks. I delegate skills to mpm-skills-manager. I delegate, verify, and track files."**
1245
1382
 
1246
1383
  ---
1247
1384
 
@@ -1,3 +1,7 @@
1
+ # Copyright (c) 2024-2025 Bob Matsuoka
2
+ # Licensed under the Elastic License 2.0
3
+ # See LICENSE file in the project root for full license information.
4
+
1
5
  """
2
6
  Entry point for executing the CLI module with python -m claude_mpm.cli.
3
7
 
@@ -152,7 +152,7 @@ class SimpleAgentManager:
152
152
 
153
153
  # Get metadata for display info
154
154
  metadata = template_data.get("metadata", {})
155
- metadata.get("name", agent_id)
155
+ display_name = metadata.get("name", agent_id)
156
156
  description = metadata.get(
157
157
  "description", "No description available"
158
158
  )
@@ -182,9 +182,10 @@ class SimpleAgentManager:
182
182
  dependencies=display_tools,
183
183
  )
184
184
 
185
- # Set deployment status
185
+ # Set deployment status and display name
186
186
  agent_config.is_deployed = is_deployed
187
187
  agent_config.source_type = "local"
188
+ agent_config.display_name = display_name
188
189
 
189
190
  agents.append(agent_config)
190
191
 
@@ -235,7 +236,7 @@ class SimpleAgentManager:
235
236
  # Create AgentConfig with source information
236
237
  # Store full agent_dict for later use in deployment
237
238
  agent_config = AgentConfig(
238
- name=agent_id, # Use agent_id as name for uniqueness
239
+ name=name, # Use display name for UI
239
240
  description=(
240
241
  f"[{category}] {description[:60]}..."
241
242
  if len(description) > 60
@@ -248,6 +249,7 @@ class SimpleAgentManager:
248
249
  agent_config.source_type = "remote"
249
250
  agent_config.is_deployed = is_deployed
250
251
  agent_config.display_name = name
252
+ agent_config.agent_id = agent_id # Store technical ID for reference
251
253
  agent_config.full_agent_id = agent_id
252
254
  agent_config.source_dict = agent_dict # Store full dict for deployment
253
255
 
@@ -272,9 +274,9 @@ class SimpleAgentManager:
272
274
  True if agent is deployed, False otherwise
273
275
  """
274
276
  # Check virtual deployment state (primary method)
277
+ # Only checking project-level deployment in simplified architecture
275
278
  deployment_state_paths = [
276
279
  Path.cwd() / ".claude" / "agents" / ".mpm_deployment_state",
277
- Path.home() / ".claude" / "agents" / ".mpm_deployment_state",
278
280
  ]
279
281
 
280
282
  for state_path in deployment_state_paths:
@@ -319,8 +321,8 @@ class SimpleAgentManager:
319
321
  leaf_name = agent_id.split("/")[-1]
320
322
  agent_file_names.append(f"{leaf_name}.md")
321
323
 
322
- # Check .claude-mpm/agents/ directory (project level)
323
- project_agents_dir = Path.cwd() / ".claude-mpm" / "agents"
324
+ # Check .claude/agents/ directory (project deployment)
325
+ project_agents_dir = Path.cwd() / ".claude" / "agents"
324
326
  if project_agents_dir.exists():
325
327
  for agent_file_name in agent_file_names:
326
328
  agent_file = project_agents_dir / agent_file_name
@@ -330,15 +332,4 @@ class SimpleAgentManager:
330
332
  )
331
333
  return True
332
334
 
333
- # Check ~/.claude/agents/ directory (user level)
334
- user_agents_dir = Path.home() / ".claude" / "agents"
335
- if user_agents_dir.exists():
336
- for agent_file_name in agent_file_names:
337
- agent_file = user_agents_dir / agent_file_name
338
- if agent_file.exists():
339
- self.logger.debug(
340
- f"Agent {agent_id} found as physical file: {agent_file}"
341
- )
342
- return True
343
-
344
335
  return False