claude-mpm 5.4.96__py3-none-any.whl → 5.6.3__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.
Files changed (155) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/{CLAUDE_MPM_FOUNDERS_OUTPUT_STYLE.md → CLAUDE_MPM_RESEARCH_OUTPUT_STYLE.md} +14 -6
  3. claude_mpm/agents/PM_INSTRUCTIONS.md +36 -7
  4. claude_mpm/agents/WORKFLOW.md +2 -0
  5. claude_mpm/agents/templates/circuit-breakers.md +26 -17
  6. claude_mpm/cli/commands/autotodos.py +45 -5
  7. claude_mpm/cli/commands/commander.py +46 -0
  8. claude_mpm/cli/commands/hook_errors.py +60 -60
  9. claude_mpm/cli/commands/run.py +35 -3
  10. claude_mpm/cli/executor.py +32 -17
  11. claude_mpm/cli/parsers/base_parser.py +17 -0
  12. claude_mpm/cli/parsers/commander_parser.py +83 -0
  13. claude_mpm/cli/parsers/run_parser.py +10 -0
  14. claude_mpm/cli/startup.py +20 -2
  15. claude_mpm/cli/utils.py +7 -3
  16. claude_mpm/commander/__init__.py +72 -0
  17. claude_mpm/commander/adapters/__init__.py +31 -0
  18. claude_mpm/commander/adapters/base.py +191 -0
  19. claude_mpm/commander/adapters/claude_code.py +361 -0
  20. claude_mpm/commander/adapters/communication.py +366 -0
  21. claude_mpm/commander/api/__init__.py +16 -0
  22. claude_mpm/commander/api/app.py +105 -0
  23. claude_mpm/commander/api/errors.py +112 -0
  24. claude_mpm/commander/api/routes/__init__.py +8 -0
  25. claude_mpm/commander/api/routes/events.py +184 -0
  26. claude_mpm/commander/api/routes/inbox.py +171 -0
  27. claude_mpm/commander/api/routes/messages.py +148 -0
  28. claude_mpm/commander/api/routes/projects.py +271 -0
  29. claude_mpm/commander/api/routes/sessions.py +215 -0
  30. claude_mpm/commander/api/routes/work.py +260 -0
  31. claude_mpm/commander/api/schemas.py +182 -0
  32. claude_mpm/commander/chat/__init__.py +7 -0
  33. claude_mpm/commander/chat/cli.py +107 -0
  34. claude_mpm/commander/chat/commands.py +96 -0
  35. claude_mpm/commander/chat/repl.py +310 -0
  36. claude_mpm/commander/config.py +49 -0
  37. claude_mpm/commander/config_loader.py +115 -0
  38. claude_mpm/commander/daemon.py +398 -0
  39. claude_mpm/commander/events/__init__.py +26 -0
  40. claude_mpm/commander/events/manager.py +332 -0
  41. claude_mpm/commander/frameworks/__init__.py +12 -0
  42. claude_mpm/commander/frameworks/base.py +143 -0
  43. claude_mpm/commander/frameworks/claude_code.py +58 -0
  44. claude_mpm/commander/frameworks/mpm.py +62 -0
  45. claude_mpm/commander/inbox/__init__.py +16 -0
  46. claude_mpm/commander/inbox/dedup.py +128 -0
  47. claude_mpm/commander/inbox/inbox.py +224 -0
  48. claude_mpm/commander/inbox/models.py +70 -0
  49. claude_mpm/commander/instance_manager.py +337 -0
  50. claude_mpm/commander/llm/__init__.py +6 -0
  51. claude_mpm/commander/llm/openrouter_client.py +167 -0
  52. claude_mpm/commander/llm/summarizer.py +70 -0
  53. claude_mpm/commander/models/__init__.py +18 -0
  54. claude_mpm/commander/models/events.py +121 -0
  55. claude_mpm/commander/models/project.py +162 -0
  56. claude_mpm/commander/models/work.py +214 -0
  57. claude_mpm/commander/parsing/__init__.py +20 -0
  58. claude_mpm/commander/parsing/extractor.py +132 -0
  59. claude_mpm/commander/parsing/output_parser.py +270 -0
  60. claude_mpm/commander/parsing/patterns.py +100 -0
  61. claude_mpm/commander/persistence/__init__.py +11 -0
  62. claude_mpm/commander/persistence/event_store.py +274 -0
  63. claude_mpm/commander/persistence/state_store.py +309 -0
  64. claude_mpm/commander/persistence/work_store.py +164 -0
  65. claude_mpm/commander/polling/__init__.py +13 -0
  66. claude_mpm/commander/polling/event_detector.py +104 -0
  67. claude_mpm/commander/polling/output_buffer.py +49 -0
  68. claude_mpm/commander/polling/output_poller.py +153 -0
  69. claude_mpm/commander/project_session.py +268 -0
  70. claude_mpm/commander/proxy/__init__.py +12 -0
  71. claude_mpm/commander/proxy/formatter.py +89 -0
  72. claude_mpm/commander/proxy/output_handler.py +191 -0
  73. claude_mpm/commander/proxy/relay.py +155 -0
  74. claude_mpm/commander/registry.py +404 -0
  75. claude_mpm/commander/runtime/__init__.py +10 -0
  76. claude_mpm/commander/runtime/executor.py +191 -0
  77. claude_mpm/commander/runtime/monitor.py +316 -0
  78. claude_mpm/commander/session/__init__.py +6 -0
  79. claude_mpm/commander/session/context.py +81 -0
  80. claude_mpm/commander/session/manager.py +59 -0
  81. claude_mpm/commander/tmux_orchestrator.py +361 -0
  82. claude_mpm/commander/web/__init__.py +1 -0
  83. claude_mpm/commander/work/__init__.py +30 -0
  84. claude_mpm/commander/work/executor.py +189 -0
  85. claude_mpm/commander/work/queue.py +405 -0
  86. claude_mpm/commander/workflow/__init__.py +27 -0
  87. claude_mpm/commander/workflow/event_handler.py +219 -0
  88. claude_mpm/commander/workflow/notifier.py +146 -0
  89. claude_mpm/commands/mpm-config.md +8 -0
  90. claude_mpm/commands/mpm-doctor.md +8 -0
  91. claude_mpm/commands/mpm-help.md +8 -0
  92. claude_mpm/commands/mpm-init.md +8 -0
  93. claude_mpm/commands/mpm-monitor.md +8 -0
  94. claude_mpm/commands/mpm-organize.md +8 -0
  95. claude_mpm/commands/mpm-postmortem.md +8 -0
  96. claude_mpm/commands/mpm-session-resume.md +8 -0
  97. claude_mpm/commands/mpm-status.md +8 -0
  98. claude_mpm/commands/mpm-ticket-view.md +8 -0
  99. claude_mpm/commands/mpm-version.md +8 -0
  100. claude_mpm/commands/mpm.md +8 -0
  101. claude_mpm/config/agent_presets.py +8 -7
  102. claude_mpm/core/config.py +5 -0
  103. claude_mpm/core/logger.py +26 -9
  104. claude_mpm/core/logging_utils.py +35 -11
  105. claude_mpm/core/output_style_manager.py +15 -5
  106. claude_mpm/core/unified_config.py +10 -6
  107. claude_mpm/core/unified_paths.py +68 -80
  108. claude_mpm/experimental/cli_enhancements.py +2 -1
  109. claude_mpm/hooks/claude_hooks/event_handlers.py +39 -1
  110. claude_mpm/hooks/claude_hooks/hook_handler.py +81 -88
  111. claude_mpm/hooks/claude_hooks/hook_wrapper.sh +6 -11
  112. claude_mpm/hooks/claude_hooks/installer.py +75 -8
  113. claude_mpm/hooks/claude_hooks/memory_integration.py +22 -11
  114. claude_mpm/hooks/claude_hooks/services/connection_manager_http.py +14 -77
  115. claude_mpm/scripts/claude-hook-handler.sh +39 -12
  116. claude_mpm/services/agents/agent_recommendation_service.py +8 -8
  117. claude_mpm/services/agents/loading/framework_agent_loader.py +75 -2
  118. claude_mpm/services/event_log.py +8 -0
  119. claude_mpm/services/pm_skills_deployer.py +84 -6
  120. claude_mpm/services/skills/git_skill_source_manager.py +51 -2
  121. claude_mpm/services/skills/skill_discovery_service.py +57 -3
  122. claude_mpm/skills/bundled/pm/mpm/SKILL.md +38 -0
  123. claude_mpm/skills/bundled/pm/mpm-config/SKILL.md +29 -0
  124. claude_mpm/skills/bundled/pm/mpm-doctor/SKILL.md +53 -0
  125. claude_mpm/skills/bundled/pm/mpm-help/SKILL.md +35 -0
  126. claude_mpm/skills/bundled/pm/mpm-init/SKILL.md +125 -0
  127. claude_mpm/skills/bundled/pm/mpm-monitor/SKILL.md +32 -0
  128. claude_mpm/skills/bundled/pm/mpm-organize/SKILL.md +121 -0
  129. claude_mpm/skills/bundled/pm/mpm-postmortem/SKILL.md +22 -0
  130. claude_mpm/skills/bundled/pm/mpm-session-resume/SKILL.md +31 -0
  131. claude_mpm/skills/bundled/pm/mpm-status/SKILL.md +37 -0
  132. claude_mpm/skills/bundled/pm/mpm-ticket-view/SKILL.md +110 -0
  133. claude_mpm/skills/bundled/pm/mpm-version/SKILL.md +21 -0
  134. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/METADATA +18 -4
  135. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/RECORD +140 -68
  136. claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
  137. claude_mpm/hooks/claude_hooks/__pycache__/auto_pause_handler.cpython-311.pyc +0 -0
  138. claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
  139. claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
  140. claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
  141. claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
  142. claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
  143. claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
  144. claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
  145. claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
  146. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc +0 -0
  147. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
  148. claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
  149. claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
  150. claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
  151. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/WHEEL +0 -0
  152. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/entry_points.txt +0 -0
  153. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/licenses/LICENSE +0 -0
  154. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/licenses/LICENSE-FAQ.md +0 -0
  155. {claude_mpm-5.4.96.dist-info → claude_mpm-5.6.3.dist-info}/top_level.txt +0 -0
@@ -50,9 +50,16 @@ from claude_mpm.core.mixins import LoggerMixin
50
50
  # Security constants
51
51
  MAX_YAML_SIZE = 10 * 1024 * 1024 # 10MB limit to prevent YAML bombs
52
52
 
53
- # Required PM skills that MUST be deployed for PM agent to function properly
54
- # These are framework management skills that PM uses for orchestration
53
+ # Tier 1: Required PM skills that MUST be deployed for PM agent to function properly
54
+ # These are core framework management skills for basic PM operation
55
55
  REQUIRED_PM_SKILLS = [
56
+ # Core command-based skills (new consolidated CLI)
57
+ "mpm",
58
+ "mpm-init",
59
+ "mpm-status",
60
+ "mpm-help",
61
+ "mpm-doctor",
62
+ # Legacy framework management skills
56
63
  "mpm-git-file-tracking",
57
64
  "mpm-pr-workflow",
58
65
  "mpm-ticketing-integration",
@@ -66,6 +73,23 @@ REQUIRED_PM_SKILLS = [
66
73
  "mpm-session-management",
67
74
  ]
68
75
 
76
+ # Tier 2: Recommended skills (deployed with standard install)
77
+ # These provide enhanced functionality for common workflows
78
+ RECOMMENDED_PM_SKILLS = [
79
+ "mpm-config",
80
+ "mpm-ticket-view",
81
+ "mpm-session-resume",
82
+ "mpm-postmortem",
83
+ ]
84
+
85
+ # Tier 3: Optional skills (deployed with full install)
86
+ # These provide additional features for advanced use cases
87
+ OPTIONAL_PM_SKILLS = [
88
+ "mpm-monitor",
89
+ "mpm-version",
90
+ "mpm-organize",
91
+ ]
92
+
69
93
 
70
94
  @dataclass
71
95
  class PMSkillInfo:
@@ -383,17 +407,45 @@ class PMSkillsDeployerService(LoggerMixin):
383
407
  self.logger.info(f"Discovered {len(skills)} bundled PM skills")
384
408
  return skills
385
409
 
410
+ def _get_skills_for_tier(self, tier: str) -> List[str]:
411
+ """Get list of skills to deploy based on tier.
412
+
413
+ Args:
414
+ tier: Deployment tier - "minimal", "standard", or "full"
415
+
416
+ Returns:
417
+ List of skill names to deploy
418
+
419
+ Raises:
420
+ ValueError: If tier is invalid
421
+ """
422
+ if tier == "minimal":
423
+ return REQUIRED_PM_SKILLS
424
+ if tier == "standard":
425
+ return REQUIRED_PM_SKILLS + RECOMMENDED_PM_SKILLS
426
+ if tier == "full":
427
+ return REQUIRED_PM_SKILLS + RECOMMENDED_PM_SKILLS + OPTIONAL_PM_SKILLS
428
+ raise ValueError(
429
+ f"Invalid tier '{tier}'. Must be 'minimal', 'standard', or 'full'"
430
+ )
431
+
386
432
  def deploy_pm_skills(
387
433
  self,
388
434
  project_dir: Path,
389
435
  force: bool = False,
436
+ tier: str = "standard",
390
437
  progress_callback: Optional[Callable[[str, int, int], None]] = None,
391
438
  ) -> DeploymentResult:
392
- """Deploy bundled PM skills to project directory.
439
+ """Deploy bundled PM skills to project directory with tier-based selection.
393
440
 
394
441
  Copies PM skills from bundled templates to .claude/skills/{name}/SKILL.md
395
442
  and updates registry with version and checksum information.
396
443
 
444
+ Deployment Tiers:
445
+ - "minimal": Only REQUIRED_PM_SKILLS (Tier 1 - core functionality)
446
+ - "standard": REQUIRED_PM_SKILLS + RECOMMENDED_PM_SKILLS (Tier 1+2 - common workflows)
447
+ - "full": All skills (Tier 1+2+3 - advanced features)
448
+
397
449
  Conflict Resolution:
398
450
  - mpm-* skills from src WIN (overwrite existing)
399
451
  - Non-mpm-* skills in .claude/skills/ are untouched
@@ -401,16 +453,42 @@ class PMSkillsDeployerService(LoggerMixin):
401
453
  Args:
402
454
  project_dir: Project root directory
403
455
  force: If True, redeploy even if skill already exists
456
+ tier: Deployment tier - "minimal", "standard" (default), or "full"
404
457
  progress_callback: Optional callback(skill_name, current, total) for progress
405
458
 
406
459
  Returns:
407
460
  DeploymentResult with deployment status and details
408
461
 
409
462
  Example:
410
- >>> result = deployer.deploy_pm_skills(Path("/project"), force=True)
463
+ >>> # Standard deployment (Tier 1 + Tier 2)
464
+ >>> result = deployer.deploy_pm_skills(Path("/project"))
411
465
  >>> print(f"Deployed: {len(result.deployed)} to .claude/skills/")
466
+ >>>
467
+ >>> # Minimal deployment (Tier 1 only)
468
+ >>> result = deployer.deploy_pm_skills(Path("/project"), tier="minimal")
469
+ >>>
470
+ >>> # Full deployment (all tiers)
471
+ >>> result = deployer.deploy_pm_skills(Path("/project"), tier="full")
412
472
  """
413
- skills = self._discover_bundled_pm_skills()
473
+ # Get tier-based skill filter
474
+ try:
475
+ tier_skills = self._get_skills_for_tier(tier)
476
+ except ValueError as e:
477
+ return DeploymentResult(
478
+ success=False,
479
+ deployed=[],
480
+ skipped=[],
481
+ errors=[{"skill": "all", "error": str(e)}],
482
+ message=str(e),
483
+ )
484
+
485
+ # Discover all bundled skills, then filter by tier
486
+ all_skills = self._discover_bundled_pm_skills()
487
+ skills = [s for s in all_skills if s["name"] in tier_skills]
488
+
489
+ self.logger.info(
490
+ f"Deploying {len(skills)}/{len(all_skills)} skills for tier '{tier}'"
491
+ )
414
492
  deployed = []
415
493
  skipped = []
416
494
  errors = []
@@ -526,7 +604,7 @@ class PMSkillsDeployerService(LoggerMixin):
526
604
 
527
605
  success = len(errors) == 0
528
606
  message = (
529
- f"Deployed {len(deployed)} skills, skipped {len(skipped)}, "
607
+ f"Deployed {len(deployed)} skills (tier: {tier}), skipped {len(skipped)}, "
530
608
  f"{len(errors)} errors"
531
609
  )
532
610
 
@@ -682,7 +682,7 @@ class GitSkillSourceManager:
682
682
  try:
683
683
  with open(etag_cache_file, encoding="utf-8") as f:
684
684
  etag_cache = json.load(f)
685
- except Exception:
685
+ except Exception: # nosec B110 - intentional: proceed without cache on read failure
686
686
  pass
687
687
 
688
688
  cached_etag = etag_cache.get(str(local_path))
@@ -1163,6 +1163,10 @@ class GitSkillSourceManager:
1163
1163
  ) -> List[str]:
1164
1164
  """Remove skills from target directory that aren't in the filtered skill list.
1165
1165
 
1166
+ CRITICAL: Only removes MPM-managed skills (those in our cache). Custom user skills
1167
+ are preserved. This prevents accidental deletion of user-created skills that were
1168
+ never part of MPM's skill repository.
1169
+
1166
1170
  Uses fuzzy matching to handle both exact deployment names and short skill names.
1167
1171
  For example:
1168
1172
  - "toolchains-python-frameworks-flask" (deployed dir) matches "flask" (filter)
@@ -1213,6 +1217,40 @@ class GitSkillSourceManager:
1213
1217
 
1214
1218
  return False
1215
1219
 
1220
+ def is_mpm_managed_skill(skill_dir_name: str) -> bool:
1221
+ """Check if skill is managed by MPM (exists in our cache).
1222
+
1223
+ Custom user skills (not in cache) are NEVER deleted, even if not in filter.
1224
+ Only MPM-managed skills (in cache but not in filter) are candidates for removal.
1225
+
1226
+ Args:
1227
+ skill_dir_name: Name of deployed skill directory
1228
+
1229
+ Returns:
1230
+ True if skill exists in MPM cache (MPM-managed), False if custom user skill
1231
+ """
1232
+ # Check all configured skill sources for this skill
1233
+ for source in self.config.get_enabled_sources():
1234
+ cache_path = self._get_source_cache_path(source)
1235
+ if not cache_path.exists():
1236
+ continue
1237
+
1238
+ # Check if this skill directory exists anywhere in the cache
1239
+ # Use glob to find matching directories recursively
1240
+ matches = list(cache_path.rglob(f"*{skill_dir_name}*"))
1241
+ if matches:
1242
+ # Found in cache - this is MPM-managed
1243
+ self.logger.debug(
1244
+ f"Skill '{skill_dir_name}' found in cache at {matches[0]} - MPM-managed"
1245
+ )
1246
+ return True
1247
+
1248
+ # Not found in any cache - this is a custom user skill
1249
+ self.logger.debug(
1250
+ f"Skill '{skill_dir_name}' not found in cache - custom user skill, preserving"
1251
+ )
1252
+ return False
1253
+
1216
1254
  # Check each directory in target_dir
1217
1255
  if not target_dir.exists():
1218
1256
  return removed_skills
@@ -1229,6 +1267,15 @@ class GitSkillSourceManager:
1229
1267
 
1230
1268
  # Check if this skill directory should be kept (fuzzy matching)
1231
1269
  if not should_keep_skill(item.name):
1270
+ # CRITICAL: Check if this is an MPM-managed skill before deletion
1271
+ if not is_mpm_managed_skill(item.name):
1272
+ # This is a custom user skill - NEVER delete
1273
+ self.logger.debug(
1274
+ f"Preserving custom user skill (not in MPM cache): {item.name}"
1275
+ )
1276
+ continue
1277
+
1278
+ # It's MPM-managed but not in filter - safe to remove
1232
1279
  try:
1233
1280
  # Security: Validate path is within target_dir
1234
1281
  if not self._validate_safe_path(target_dir, item):
@@ -1244,7 +1291,9 @@ class GitSkillSourceManager:
1244
1291
  shutil.rmtree(item)
1245
1292
 
1246
1293
  removed_skills.append(item.name)
1247
- self.logger.info(f"Removed orphaned skill: {item.name}")
1294
+ self.logger.info(
1295
+ f"Removed orphaned MPM-managed skill: {item.name}"
1296
+ )
1248
1297
 
1249
1298
  except Exception as e:
1250
1299
  self.logger.warning(
@@ -163,10 +163,22 @@ class SkillDiscoveryService:
163
163
  skill_md_files = list(self.skills_dir.rglob("SKILL.md"))
164
164
 
165
165
  # Also find legacy *.md files in top-level directory for backward compatibility
166
+ # Exclude common non-skill documentation files
167
+ excluded_filenames = {
168
+ "skill.md", # Case variations of SKILL.md
169
+ "readme.md",
170
+ "claude.md",
171
+ "contributing.md",
172
+ "changelog.md",
173
+ "license.md",
174
+ "authors.md",
175
+ "code_of_conduct.md",
176
+ }
177
+
166
178
  legacy_md_files = [
167
179
  f
168
180
  for f in self.skills_dir.glob("*.md")
169
- if f.name != "SKILL.md" and f.name.lower() != "readme.md"
181
+ if f.name.lower() not in excluded_filenames
170
182
  ]
171
183
 
172
184
  all_skill_files = skill_md_files + legacy_md_files
@@ -255,7 +267,35 @@ class SkillDiscoveryService:
255
267
  try:
256
268
  frontmatter, body = self._extract_frontmatter(content)
257
269
  except Exception as e:
258
- self.logger.warning(f"No valid frontmatter in {skill_file.name}: {e}")
270
+ # Only log as debug for documentation files to reduce noise
271
+ # Common documentation files (CLAUDE.md, README.md) are expected to lack skill frontmatter
272
+ relative_path = (
273
+ skill_file.relative_to(self.skills_dir)
274
+ if skill_file.is_relative_to(self.skills_dir)
275
+ else skill_file
276
+ )
277
+
278
+ # Check if this looks like a documentation file
279
+ is_documentation = any(
280
+ doc_pattern in skill_file.name.lower()
281
+ for doc_pattern in [
282
+ "readme",
283
+ "claude",
284
+ "contributing",
285
+ "changelog",
286
+ "license",
287
+ ]
288
+ )
289
+
290
+ if is_documentation:
291
+ self.logger.debug(
292
+ f"Skipping documentation file {relative_path} (no skill frontmatter): {e}"
293
+ )
294
+ else:
295
+ # For actual skill files with invalid YAML, use warning level
296
+ self.logger.warning(
297
+ f"Failed to parse skill frontmatter in {relative_path}: {e}"
298
+ )
259
299
  return None
260
300
 
261
301
  # Validate required fields
@@ -354,10 +394,24 @@ class SkillDiscoveryService:
354
394
  frontmatter_text = match.group(1)
355
395
  body = match.group(2)
356
396
 
357
- # Parse YAML
397
+ # Parse YAML with improved error handling
358
398
  try:
359
399
  frontmatter = yaml.safe_load(frontmatter_text)
360
400
  except yaml.YAMLError as e:
401
+ # Provide more specific error message with context
402
+ error_line = getattr(e, "problem_mark", None)
403
+ if error_line:
404
+ line_num = error_line.line + 1
405
+ col_num = error_line.column + 1
406
+ # Extract problematic line for context
407
+ lines = frontmatter_text.split("\n")
408
+ problem_line = (
409
+ lines[error_line.line] if error_line.line < len(lines) else ""
410
+ )
411
+ raise ValueError(
412
+ f"Invalid YAML in frontmatter at line {line_num}, column {col_num}: {e.problem}\n"
413
+ f" Problematic line: {problem_line.strip()}"
414
+ ) from e
361
415
  raise ValueError(f"Invalid YAML in frontmatter: {e}") from e
362
416
 
363
417
  if not isinstance(frontmatter, dict):
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: mpm
3
+ description: Access Claude MPM functionality and manage multi-agent orchestration
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, system, pm-required]
8
+ ---
9
+
10
+ # /mpm
11
+
12
+ Access Claude MPM functionality and manage your multi-agent orchestration.
13
+
14
+ ## Available MPM Commands
15
+
16
+ - `/mpm-agents` - Show available agents and versions
17
+ - `/mpm-doctor` - Run diagnostic checks
18
+ - `/mpm-help` - Show command help
19
+ - `/mpm-status` - Show MPM status
20
+ - `/mpm-ticket` - Ticketing workflow management (organize, proceed, status, update, project)
21
+ - `/mpm-config` - Manage configuration
22
+ - `/mpm-resume` - Create session resume files
23
+ - `/mpm-version` - Display version information for project, agents, and skills
24
+
25
+ ## What is Claude MPM?
26
+
27
+ Claude MPM extends Claude Code with:
28
+ - **Multi-agent orchestration** - Delegate work to specialized agents
29
+ - **Project-specific PM instructions** - Tailored guidance for your project
30
+ - **Agent memory management** - Context-aware agent interactions
31
+ - **WebSocket monitoring** - Real-time system monitoring
32
+ - **Hook system for automation** - Automate workflows and tasks
33
+
34
+ ## Quick Start
35
+
36
+ Use `/mpm-help` to explore commands or `/mpm-status` to check system health.
37
+
38
+ For more information, use `/mpm-help [command]` for specific command details.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: mpm-config
3
+ description: Manage Claude MPM configuration
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, config, pm-recommended]
8
+ ---
9
+
10
+ # /mpm-config
11
+
12
+ Unified configuration management with auto-detection.
13
+
14
+ ## Usage
15
+ ```
16
+ /mpm-config [auto|view|validate|status] [options]
17
+ ```
18
+
19
+ **Modes:**
20
+ - `auto` (default): Auto-detect toolchain and configure agents/skills
21
+ - `view`: Display current configuration
22
+ - `validate`: Check configuration validity
23
+ - `status`: Show configuration health
24
+
25
+ **Key Options:**
26
+ - `--yes`: Auto-deploy without confirmation
27
+ - `--preview`: Show recommendations only
28
+
29
+ See docs/commands/config.md for full options.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: mpm-doctor
3
+ description: Run diagnostic checks on Claude MPM installation
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, system, pm-required, diagnostics, troubleshooting]
8
+ ---
9
+
10
+ # /mpm-doctor
11
+
12
+ Run comprehensive diagnostics on Claude MPM installation.
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /mpm-doctor [--verbose] [--fix]
18
+ ```
19
+
20
+ ## Options
21
+
22
+ - `--verbose`: Show detailed diagnostic output
23
+ - `--fix`: Attempt to automatically fix detected issues
24
+
25
+ ## What It Checks
26
+
27
+ - **Installation**: MPM package installation and version
28
+ - **Configuration**: Config file validity and required settings
29
+ - **WebSocket**: WebSocket server connectivity and health
30
+ - **Agents**: Agent availability and configuration
31
+ - **Memory**: Memory system health and accessibility
32
+ - **Hooks**: Hook system setup and functionality
33
+
34
+ ## When to Use
35
+
36
+ - After initial MPM installation (verify setup)
37
+ - When experiencing issues with commands or delegation
38
+ - Before reporting bugs (gather diagnostic information)
39
+ - After configuration changes (verify correctness)
40
+ - When WebSocket monitoring isn't working
41
+
42
+ ## Example Output
43
+
44
+ ```
45
+ ✅ MPM Installation: OK (v5.4.105)
46
+ ✅ Configuration: Valid
47
+ ⚠️ WebSocket Server: Not running (start with /mpm-monitor start)
48
+ ✅ Agents: 15 available
49
+ ✅ Memory System: Healthy
50
+ ✅ Hooks: Configured
51
+ ```
52
+
53
+ See docs/commands/doctor.md for details.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: mpm-help
3
+ description: Display help for Claude MPM commands
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, system, pm-required, documentation]
8
+ ---
9
+
10
+ # /mpm-help
11
+
12
+ Show help for MPM commands. Delegates to PM agent.
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /mpm-help [command]
18
+ ```
19
+
20
+ ## Examples
21
+
22
+ ```
23
+ /mpm-help # Show all available commands
24
+ /mpm-help mpm-init # Show detailed help for mpm-init
25
+ /mpm-help mpm-ticket # Show ticketing workflow help
26
+ ```
27
+
28
+ ## What It Provides
29
+
30
+ - **Command listing**: All available MPM commands
31
+ - **Command details**: Syntax, options, and usage examples
32
+ - **Delegation patterns**: Which agent handles which command
33
+ - **Workflow guidance**: Common command sequences and workflows
34
+
35
+ See docs/commands/help.md for full command reference.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: mpm-init
3
+ description: Initialize or update project for Claude Code and MPM
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, system, pm-required, setup]
8
+ ---
9
+
10
+ # /mpm-init
11
+
12
+ Initialize or intelligently update project for Claude Code and Claude MPM.
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /mpm-init [update|context|resume|catchup] [options]
18
+ ```
19
+
20
+ ## Core Modes
21
+
22
+ ### Project Setup
23
+
24
+ ```
25
+ /mpm-init # Auto-detect: offer update or create
26
+ /mpm-init update # Quick update (30-day git activity)
27
+ /mpm-init --update # Full documentation refresh
28
+ /mpm-init --force # Force recreate from scratch
29
+ ```
30
+
31
+ **Delegates to Agentic Coder Optimizer agent** for:
32
+ - CLAUDE.md creation/update (with priority rankings 🔴🟡🟢⚪)
33
+ - AST analysis and code structure docs
34
+ - Single-path workflows (ONE way to do ANYTHING)
35
+ - Tool configuration, memory system, gitignore management
36
+
37
+ **Smart Update Mode:** Auto-detects existing CLAUDE.md and offers update vs recreate.
38
+
39
+ ### Context Analysis
40
+
41
+ ```
42
+ /mpm-init context [--days N] # Intelligent git history analysis (default: 7 days)
43
+ /mpm-init catchup # Quick commit history (last 25 commits, no analysis)
44
+ ```
45
+
46
+ **context:** Delegates to Research agent for deep analysis of:
47
+ - Active work streams (from commit patterns)
48
+ - Intent and motivation (from messages)
49
+ - Risks and blockers
50
+ - Recommended next actions
51
+
52
+ **catchup:** Direct CLI execution, instant output.
53
+
54
+ ### Resume from Logs
55
+
56
+ ```
57
+ /mpm-init resume [--list] [--session-id ID]
58
+ ```
59
+
60
+ Reads stop event logs from `.claude-mpm/resume-logs/` and `.claude-mpm/responses/` showing:
61
+ - What was being worked on
62
+ - Tasks completed, files modified
63
+ - Next steps, stop reason, token usage
64
+ - Git context (branch, status)
65
+
66
+ ## Key Options
67
+
68
+ **Configuration:**
69
+ - `--project-type TYPE`: web, api, cli, library
70
+ - `--framework NAME`: react, django, fastapi, etc.
71
+ - `--ast-analysis` / `--no-ast-analysis`: Enable/disable code analysis
72
+ - `--comprehensive` / `--minimal`: Full setup vs CLAUDE.md only
73
+
74
+ **Organization:**
75
+ - `--organize`: Organize misplaced files
76
+ - `--preserve-custom`: Keep custom sections (default)
77
+ - `--review`: Review without changes
78
+
79
+ ## What Gets Created
80
+
81
+ **New Projects:**
82
+ - ✅ CLAUDE.md (priority-ranked instructions)
83
+ - ✅ Single-path workflows (make build/test/deploy)
84
+ - ✅ Tool configs (linting, formatting, testing)
85
+ - ✅ Memory system (.claude-mpm/memories/)
86
+ - ✅ DEVELOPER.md, CODE_STRUCTURE.md (with AST)
87
+ - ✅ .gitignore updates (auto-adds .claude-mpm/)
88
+
89
+ **Updates:**
90
+ - ✅ Smart merging (preserves custom sections)
91
+ - ✅ Automatic archival (docs/_archive/)
92
+ - ✅ Change tracking
93
+
94
+ ## Examples
95
+
96
+ ```bash
97
+ # Quick start
98
+ /mpm-init # Auto-detect mode
99
+
100
+ # Quick update (lightweight)
101
+ /mpm-init update # 30-day activity report
102
+
103
+ # Resume work
104
+ /mpm-init context --days 14 # Analyze last 2 weeks
105
+ /mpm-init resume # Show latest session from logs
106
+ /mpm-init catchup # Quick commit history
107
+
108
+ # Full configuration
109
+ /mpm-init --project-type web --framework react --comprehensive
110
+ ```
111
+
112
+ ## Implementation Notes
113
+
114
+ **Delegation patterns:**
115
+ - **Project init/update:** → Agentic Coder Optimizer agent
116
+ - **context:** → PM → Research agent (structured analysis)
117
+ - **catchup:** → Direct CLI (git log wrapper)
118
+ - **resume:** → PM (reads logs, no delegation)
119
+
120
+ **Token budgets:**
121
+ - context analysis: 10-30s processing time
122
+ - resume display: ~10-20k tokens
123
+ - catchup: instant, minimal tokens
124
+
125
+ See docs/commands/init.md for comprehensive documentation.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: mpm-monitor
3
+ description: Control monitoring server and dashboard
4
+ user-invocable: true
5
+ version: "1.0.0"
6
+ category: mpm-command
7
+ tags: [mpm-command, system, pm-optional]
8
+ ---
9
+
10
+ # /mpm-monitor
11
+
12
+ Manage Socket.IO monitoring server for real-time dashboard.
13
+
14
+ ## Usage
15
+ ```
16
+ /mpm-monitor [start|stop|restart|status|port] [options]
17
+ ```
18
+
19
+ **Subcommands:**
20
+ - `start`: Start server (auto-selects port 8765-8785)
21
+ - `stop`: Stop running server
22
+ - `status`: Show server status
23
+ - `port <PORT>`: Start on specific port
24
+
25
+ **Key Options:**
26
+ - `--port PORT`: Specific port
27
+ - `--force`: Force kill to reclaim port
28
+ - `--foreground`: Run in foreground (default: background)
29
+
30
+ Dashboard: http://localhost:8766
31
+
32
+ See docs/commands/monitor.md for details.