claude-mpm 4.1.0__py3-none-any.whl → 4.1.2__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 (358) hide show
  1. claude_mpm/BUILD_NUMBER +1 -1
  2. claude_mpm/VERSION +1 -1
  3. claude_mpm/__main__.py +1 -1
  4. claude_mpm/agents/BASE_PM.md +74 -46
  5. claude_mpm/agents/INSTRUCTIONS.md +11 -153
  6. claude_mpm/agents/WORKFLOW.md +61 -321
  7. claude_mpm/agents/__init__.py +11 -11
  8. claude_mpm/agents/agent_loader.py +23 -20
  9. claude_mpm/agents/agent_loader_integration.py +1 -1
  10. claude_mpm/agents/agents_metadata.py +27 -0
  11. claude_mpm/agents/async_agent_loader.py +5 -8
  12. claude_mpm/agents/base_agent_loader.py +36 -25
  13. claude_mpm/agents/frontmatter_validator.py +6 -6
  14. claude_mpm/agents/schema/agent_schema.json +1 -1
  15. claude_mpm/agents/system_agent_config.py +9 -9
  16. claude_mpm/agents/templates/api_qa.json +47 -2
  17. claude_mpm/agents/templates/imagemagick.json +256 -0
  18. claude_mpm/agents/templates/qa.json +41 -2
  19. claude_mpm/agents/templates/ticketing.json +5 -5
  20. claude_mpm/agents/templates/web_qa.json +133 -58
  21. claude_mpm/agents/templates/web_ui.json +3 -3
  22. claude_mpm/cli/__init__.py +51 -46
  23. claude_mpm/cli/__main__.py +1 -1
  24. claude_mpm/cli/commands/__init__.py +10 -12
  25. claude_mpm/cli/commands/agent_manager.py +186 -181
  26. claude_mpm/cli/commands/agents.py +271 -268
  27. claude_mpm/cli/commands/aggregate.py +30 -29
  28. claude_mpm/cli/commands/cleanup.py +50 -44
  29. claude_mpm/cli/commands/cleanup_orphaned_agents.py +25 -25
  30. claude_mpm/cli/commands/config.py +162 -127
  31. claude_mpm/cli/commands/doctor.py +52 -62
  32. claude_mpm/cli/commands/info.py +37 -25
  33. claude_mpm/cli/commands/mcp.py +3 -7
  34. claude_mpm/cli/commands/mcp_command_router.py +14 -18
  35. claude_mpm/cli/commands/mcp_install_commands.py +28 -23
  36. claude_mpm/cli/commands/mcp_pipx_config.py +58 -49
  37. claude_mpm/cli/commands/mcp_server_commands.py +23 -17
  38. claude_mpm/cli/commands/memory.py +192 -141
  39. claude_mpm/cli/commands/monitor.py +117 -88
  40. claude_mpm/cli/commands/run.py +120 -84
  41. claude_mpm/cli/commands/run_config_checker.py +4 -5
  42. claude_mpm/cli/commands/socketio_monitor.py +17 -19
  43. claude_mpm/cli/commands/tickets.py +92 -92
  44. claude_mpm/cli/parser.py +1 -5
  45. claude_mpm/cli/parsers/__init__.py +1 -1
  46. claude_mpm/cli/parsers/agent_manager_parser.py +50 -98
  47. claude_mpm/cli/parsers/agents_parser.py +2 -3
  48. claude_mpm/cli/parsers/base_parser.py +7 -5
  49. claude_mpm/cli/parsers/mcp_parser.py +4 -2
  50. claude_mpm/cli/parsers/monitor_parser.py +26 -18
  51. claude_mpm/cli/shared/__init__.py +10 -10
  52. claude_mpm/cli/shared/argument_patterns.py +57 -71
  53. claude_mpm/cli/shared/base_command.py +61 -53
  54. claude_mpm/cli/shared/error_handling.py +62 -58
  55. claude_mpm/cli/shared/output_formatters.py +78 -77
  56. claude_mpm/cli/startup_logging.py +204 -172
  57. claude_mpm/cli/utils.py +10 -11
  58. claude_mpm/cli_module/__init__.py +1 -1
  59. claude_mpm/cli_module/args.py +1 -1
  60. claude_mpm/cli_module/migration_example.py +5 -5
  61. claude_mpm/config/__init__.py +9 -9
  62. claude_mpm/config/agent_config.py +15 -14
  63. claude_mpm/config/experimental_features.py +4 -4
  64. claude_mpm/config/paths.py +0 -1
  65. claude_mpm/config/socketio_config.py +5 -6
  66. claude_mpm/constants.py +1 -2
  67. claude_mpm/core/__init__.py +8 -8
  68. claude_mpm/core/agent_name_normalizer.py +1 -1
  69. claude_mpm/core/agent_registry.py +20 -23
  70. claude_mpm/core/agent_session_manager.py +3 -3
  71. claude_mpm/core/base_service.py +7 -15
  72. claude_mpm/core/cache.py +4 -6
  73. claude_mpm/core/claude_runner.py +85 -113
  74. claude_mpm/core/config.py +43 -28
  75. claude_mpm/core/config_aliases.py +0 -9
  76. claude_mpm/core/config_constants.py +52 -30
  77. claude_mpm/core/constants.py +0 -1
  78. claude_mpm/core/container.py +18 -27
  79. claude_mpm/core/exceptions.py +2 -2
  80. claude_mpm/core/factories.py +10 -12
  81. claude_mpm/core/framework_loader.py +581 -280
  82. claude_mpm/core/hook_manager.py +26 -22
  83. claude_mpm/core/hook_performance_config.py +58 -47
  84. claude_mpm/core/injectable_service.py +1 -1
  85. claude_mpm/core/interactive_session.py +61 -152
  86. claude_mpm/core/interfaces.py +1 -100
  87. claude_mpm/core/lazy.py +5 -5
  88. claude_mpm/core/log_manager.py +587 -0
  89. claude_mpm/core/logger.py +125 -8
  90. claude_mpm/core/logging_config.py +15 -15
  91. claude_mpm/core/minimal_framework_loader.py +5 -8
  92. claude_mpm/core/oneshot_session.py +15 -33
  93. claude_mpm/core/optimized_agent_loader.py +4 -6
  94. claude_mpm/core/optimized_startup.py +2 -1
  95. claude_mpm/core/output_style_manager.py +147 -106
  96. claude_mpm/core/pm_hook_interceptor.py +0 -1
  97. claude_mpm/core/service_registry.py +11 -8
  98. claude_mpm/core/session_manager.py +1 -2
  99. claude_mpm/core/shared/__init__.py +1 -1
  100. claude_mpm/core/shared/config_loader.py +101 -97
  101. claude_mpm/core/shared/path_resolver.py +72 -68
  102. claude_mpm/core/shared/singleton_manager.py +56 -50
  103. claude_mpm/core/socketio_pool.py +26 -6
  104. claude_mpm/core/tool_access_control.py +4 -5
  105. claude_mpm/core/typing_utils.py +50 -59
  106. claude_mpm/core/unified_agent_registry.py +14 -19
  107. claude_mpm/core/unified_config.py +4 -6
  108. claude_mpm/core/unified_paths.py +197 -109
  109. claude_mpm/dashboard/open_dashboard.py +2 -4
  110. claude_mpm/experimental/cli_enhancements.py +51 -36
  111. claude_mpm/generators/agent_profile_generator.py +2 -4
  112. claude_mpm/hooks/base_hook.py +1 -2
  113. claude_mpm/hooks/claude_hooks/connection_pool.py +72 -26
  114. claude_mpm/hooks/claude_hooks/event_handlers.py +93 -38
  115. claude_mpm/hooks/claude_hooks/hook_handler.py +130 -76
  116. claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +104 -77
  117. claude_mpm/hooks/claude_hooks/memory_integration.py +2 -4
  118. claude_mpm/hooks/claude_hooks/response_tracking.py +15 -11
  119. claude_mpm/hooks/claude_hooks/tool_analysis.py +12 -18
  120. claude_mpm/hooks/memory_integration_hook.py +5 -5
  121. claude_mpm/hooks/tool_call_interceptor.py +1 -1
  122. claude_mpm/hooks/validation_hooks.py +4 -4
  123. claude_mpm/init.py +4 -9
  124. claude_mpm/models/__init__.py +2 -2
  125. claude_mpm/models/agent_session.py +11 -14
  126. claude_mpm/scripts/mcp_server.py +20 -11
  127. claude_mpm/scripts/mcp_wrapper.py +5 -5
  128. claude_mpm/scripts/mpm_doctor.py +321 -0
  129. claude_mpm/scripts/socketio_daemon.py +28 -25
  130. claude_mpm/scripts/socketio_daemon_hardened.py +298 -258
  131. claude_mpm/scripts/socketio_server_manager.py +116 -95
  132. claude_mpm/services/__init__.py +49 -49
  133. claude_mpm/services/agent_capabilities_service.py +12 -18
  134. claude_mpm/services/agents/__init__.py +22 -22
  135. claude_mpm/services/agents/agent_builder.py +140 -119
  136. claude_mpm/services/agents/deployment/__init__.py +3 -3
  137. claude_mpm/services/agents/deployment/agent_config_provider.py +9 -9
  138. claude_mpm/services/agents/deployment/agent_configuration_manager.py +19 -20
  139. claude_mpm/services/agents/deployment/agent_definition_factory.py +1 -5
  140. claude_mpm/services/agents/deployment/agent_deployment.py +136 -106
  141. claude_mpm/services/agents/deployment/agent_discovery_service.py +4 -8
  142. claude_mpm/services/agents/deployment/agent_environment_manager.py +2 -7
  143. claude_mpm/services/agents/deployment/agent_filesystem_manager.py +6 -10
  144. claude_mpm/services/agents/deployment/agent_format_converter.py +11 -15
  145. claude_mpm/services/agents/deployment/agent_frontmatter_validator.py +2 -3
  146. claude_mpm/services/agents/deployment/agent_lifecycle_manager.py +5 -5
  147. claude_mpm/services/agents/deployment/agent_metrics_collector.py +13 -19
  148. claude_mpm/services/agents/deployment/agent_restore_handler.py +0 -1
  149. claude_mpm/services/agents/deployment/agent_template_builder.py +26 -35
  150. claude_mpm/services/agents/deployment/agent_validator.py +0 -1
  151. claude_mpm/services/agents/deployment/agent_version_manager.py +7 -9
  152. claude_mpm/services/agents/deployment/agent_versioning.py +3 -3
  153. claude_mpm/services/agents/deployment/agents_directory_resolver.py +6 -7
  154. claude_mpm/services/agents/deployment/async_agent_deployment.py +51 -38
  155. claude_mpm/services/agents/deployment/config/__init__.py +1 -1
  156. claude_mpm/services/agents/deployment/config/deployment_config.py +7 -8
  157. claude_mpm/services/agents/deployment/deployment_type_detector.py +1 -1
  158. claude_mpm/services/agents/deployment/deployment_wrapper.py +18 -18
  159. claude_mpm/services/agents/deployment/facade/__init__.py +1 -1
  160. claude_mpm/services/agents/deployment/facade/deployment_executor.py +0 -3
  161. claude_mpm/services/agents/deployment/facade/deployment_facade.py +3 -4
  162. claude_mpm/services/agents/deployment/interface_adapter.py +5 -7
  163. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +345 -276
  164. claude_mpm/services/agents/deployment/pipeline/__init__.py +2 -2
  165. claude_mpm/services/agents/deployment/pipeline/pipeline_builder.py +1 -1
  166. claude_mpm/services/agents/deployment/pipeline/pipeline_context.py +6 -4
  167. claude_mpm/services/agents/deployment/pipeline/pipeline_executor.py +3 -3
  168. claude_mpm/services/agents/deployment/pipeline/steps/__init__.py +2 -2
  169. claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +14 -13
  170. claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +0 -1
  171. claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +1 -1
  172. claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +8 -9
  173. claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +1 -1
  174. claude_mpm/services/agents/deployment/processors/__init__.py +1 -1
  175. claude_mpm/services/agents/deployment/processors/agent_processor.py +20 -16
  176. claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +5 -12
  177. claude_mpm/services/agents/deployment/results/__init__.py +1 -1
  178. claude_mpm/services/agents/deployment/results/deployment_result_builder.py +1 -1
  179. claude_mpm/services/agents/deployment/strategies/__init__.py +2 -2
  180. claude_mpm/services/agents/deployment/strategies/base_strategy.py +1 -7
  181. claude_mpm/services/agents/deployment/strategies/project_strategy.py +1 -4
  182. claude_mpm/services/agents/deployment/strategies/system_strategy.py +2 -3
  183. claude_mpm/services/agents/deployment/strategies/user_strategy.py +3 -7
  184. claude_mpm/services/agents/deployment/validation/__init__.py +1 -1
  185. claude_mpm/services/agents/deployment/validation/agent_validator.py +1 -1
  186. claude_mpm/services/agents/deployment/validation/template_validator.py +2 -2
  187. claude_mpm/services/agents/deployment/validation/validation_result.py +2 -6
  188. claude_mpm/services/agents/loading/__init__.py +1 -1
  189. claude_mpm/services/agents/loading/agent_profile_loader.py +6 -12
  190. claude_mpm/services/agents/loading/base_agent_manager.py +5 -5
  191. claude_mpm/services/agents/loading/framework_agent_loader.py +2 -4
  192. claude_mpm/services/agents/management/__init__.py +1 -1
  193. claude_mpm/services/agents/management/agent_capabilities_generator.py +1 -3
  194. claude_mpm/services/agents/management/agent_management_service.py +5 -9
  195. claude_mpm/services/agents/memory/__init__.py +4 -4
  196. claude_mpm/services/agents/memory/agent_memory_manager.py +280 -160
  197. claude_mpm/services/agents/memory/agent_persistence_service.py +0 -2
  198. claude_mpm/services/agents/memory/content_manager.py +44 -38
  199. claude_mpm/services/agents/memory/template_generator.py +4 -6
  200. claude_mpm/services/agents/registry/__init__.py +10 -6
  201. claude_mpm/services/agents/registry/deployed_agent_discovery.py +30 -27
  202. claude_mpm/services/agents/registry/modification_tracker.py +3 -6
  203. claude_mpm/services/async_session_logger.py +1 -2
  204. claude_mpm/services/claude_session_logger.py +1 -2
  205. claude_mpm/services/command_deployment_service.py +173 -0
  206. claude_mpm/services/command_handler_service.py +20 -22
  207. claude_mpm/services/core/__init__.py +25 -25
  208. claude_mpm/services/core/base.py +0 -5
  209. claude_mpm/services/core/interfaces/__init__.py +32 -32
  210. claude_mpm/services/core/interfaces/agent.py +0 -21
  211. claude_mpm/services/core/interfaces/communication.py +0 -27
  212. claude_mpm/services/core/interfaces/infrastructure.py +0 -56
  213. claude_mpm/services/core/interfaces/service.py +0 -29
  214. claude_mpm/services/diagnostics/__init__.py +1 -1
  215. claude_mpm/services/diagnostics/checks/__init__.py +6 -6
  216. claude_mpm/services/diagnostics/checks/agent_check.py +89 -80
  217. claude_mpm/services/diagnostics/checks/base_check.py +12 -16
  218. claude_mpm/services/diagnostics/checks/claude_desktop_check.py +84 -81
  219. claude_mpm/services/diagnostics/checks/common_issues_check.py +99 -91
  220. claude_mpm/services/diagnostics/checks/configuration_check.py +82 -77
  221. claude_mpm/services/diagnostics/checks/filesystem_check.py +67 -68
  222. claude_mpm/services/diagnostics/checks/installation_check.py +254 -94
  223. claude_mpm/services/diagnostics/checks/mcp_check.py +90 -88
  224. claude_mpm/services/diagnostics/checks/monitor_check.py +75 -76
  225. claude_mpm/services/diagnostics/checks/startup_log_check.py +67 -73
  226. claude_mpm/services/diagnostics/diagnostic_runner.py +67 -59
  227. claude_mpm/services/diagnostics/doctor_reporter.py +107 -70
  228. claude_mpm/services/diagnostics/models.py +21 -19
  229. claude_mpm/services/event_aggregator.py +10 -17
  230. claude_mpm/services/event_bus/__init__.py +1 -1
  231. claude_mpm/services/event_bus/config.py +54 -35
  232. claude_mpm/services/event_bus/event_bus.py +76 -71
  233. claude_mpm/services/event_bus/relay.py +74 -64
  234. claude_mpm/services/events/__init__.py +11 -11
  235. claude_mpm/services/events/consumers/__init__.py +3 -3
  236. claude_mpm/services/events/consumers/dead_letter.py +71 -63
  237. claude_mpm/services/events/consumers/logging.py +39 -37
  238. claude_mpm/services/events/consumers/metrics.py +56 -57
  239. claude_mpm/services/events/consumers/socketio.py +82 -81
  240. claude_mpm/services/events/core.py +110 -99
  241. claude_mpm/services/events/interfaces.py +56 -72
  242. claude_mpm/services/events/producers/__init__.py +1 -1
  243. claude_mpm/services/events/producers/hook.py +38 -38
  244. claude_mpm/services/events/producers/system.py +46 -44
  245. claude_mpm/services/exceptions.py +81 -80
  246. claude_mpm/services/framework_claude_md_generator/__init__.py +2 -4
  247. claude_mpm/services/framework_claude_md_generator/content_assembler.py +3 -5
  248. claude_mpm/services/framework_claude_md_generator/content_validator.py +1 -1
  249. claude_mpm/services/framework_claude_md_generator/deployment_manager.py +4 -4
  250. claude_mpm/services/framework_claude_md_generator/section_generators/__init__.py +0 -1
  251. claude_mpm/services/framework_claude_md_generator/section_generators/agents.py +0 -2
  252. claude_mpm/services/framework_claude_md_generator/version_manager.py +4 -5
  253. claude_mpm/services/hook_service.py +6 -9
  254. claude_mpm/services/infrastructure/__init__.py +1 -1
  255. claude_mpm/services/infrastructure/context_preservation.py +8 -12
  256. claude_mpm/services/infrastructure/monitoring.py +21 -23
  257. claude_mpm/services/mcp_gateway/__init__.py +37 -37
  258. claude_mpm/services/mcp_gateway/auto_configure.py +95 -103
  259. claude_mpm/services/mcp_gateway/config/__init__.py +1 -1
  260. claude_mpm/services/mcp_gateway/config/config_loader.py +23 -25
  261. claude_mpm/services/mcp_gateway/config/config_schema.py +5 -5
  262. claude_mpm/services/mcp_gateway/config/configuration.py +9 -6
  263. claude_mpm/services/mcp_gateway/core/__init__.py +10 -10
  264. claude_mpm/services/mcp_gateway/core/base.py +0 -3
  265. claude_mpm/services/mcp_gateway/core/interfaces.py +1 -38
  266. claude_mpm/services/mcp_gateway/core/process_pool.py +99 -93
  267. claude_mpm/services/mcp_gateway/core/singleton_manager.py +65 -62
  268. claude_mpm/services/mcp_gateway/core/startup_verification.py +75 -74
  269. claude_mpm/services/mcp_gateway/main.py +2 -1
  270. claude_mpm/services/mcp_gateway/registry/service_registry.py +5 -8
  271. claude_mpm/services/mcp_gateway/registry/tool_registry.py +1 -1
  272. claude_mpm/services/mcp_gateway/server/__init__.py +1 -1
  273. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +12 -19
  274. claude_mpm/services/mcp_gateway/server/stdio_handler.py +4 -3
  275. claude_mpm/services/mcp_gateway/server/stdio_server.py +79 -71
  276. claude_mpm/services/mcp_gateway/tools/__init__.py +2 -2
  277. claude_mpm/services/mcp_gateway/tools/base_adapter.py +5 -6
  278. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +13 -22
  279. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +79 -78
  280. claude_mpm/services/mcp_gateway/tools/hello_world.py +12 -14
  281. claude_mpm/services/mcp_gateway/tools/ticket_tools.py +42 -49
  282. claude_mpm/services/mcp_gateway/tools/unified_ticket_tool.py +51 -55
  283. claude_mpm/services/memory/__init__.py +3 -3
  284. claude_mpm/services/memory/builder.py +3 -6
  285. claude_mpm/services/memory/cache/__init__.py +1 -1
  286. claude_mpm/services/memory/cache/shared_prompt_cache.py +3 -5
  287. claude_mpm/services/memory/cache/simple_cache.py +1 -1
  288. claude_mpm/services/memory/indexed_memory.py +5 -7
  289. claude_mpm/services/memory/optimizer.py +7 -10
  290. claude_mpm/services/memory/router.py +8 -9
  291. claude_mpm/services/memory_hook_service.py +48 -34
  292. claude_mpm/services/monitor_build_service.py +77 -73
  293. claude_mpm/services/port_manager.py +130 -108
  294. claude_mpm/services/project/analyzer.py +12 -10
  295. claude_mpm/services/project/registry.py +11 -11
  296. claude_mpm/services/recovery_manager.py +10 -19
  297. claude_mpm/services/response_tracker.py +0 -1
  298. claude_mpm/services/runner_configuration_service.py +19 -20
  299. claude_mpm/services/session_management_service.py +7 -11
  300. claude_mpm/services/shared/__init__.py +1 -1
  301. claude_mpm/services/shared/async_service_base.py +58 -50
  302. claude_mpm/services/shared/config_service_base.py +73 -67
  303. claude_mpm/services/shared/lifecycle_service_base.py +82 -78
  304. claude_mpm/services/shared/manager_base.py +94 -82
  305. claude_mpm/services/shared/service_factory.py +96 -98
  306. claude_mpm/services/socketio/__init__.py +3 -3
  307. claude_mpm/services/socketio/client_proxy.py +5 -5
  308. claude_mpm/services/socketio/event_normalizer.py +199 -181
  309. claude_mpm/services/socketio/handlers/__init__.py +3 -3
  310. claude_mpm/services/socketio/handlers/base.py +5 -4
  311. claude_mpm/services/socketio/handlers/connection.py +163 -136
  312. claude_mpm/services/socketio/handlers/file.py +13 -14
  313. claude_mpm/services/socketio/handlers/git.py +12 -7
  314. claude_mpm/services/socketio/handlers/hook.py +49 -44
  315. claude_mpm/services/socketio/handlers/memory.py +0 -1
  316. claude_mpm/services/socketio/handlers/project.py +0 -1
  317. claude_mpm/services/socketio/handlers/registry.py +37 -19
  318. claude_mpm/services/socketio/migration_utils.py +98 -84
  319. claude_mpm/services/socketio/server/__init__.py +1 -1
  320. claude_mpm/services/socketio/server/broadcaster.py +81 -87
  321. claude_mpm/services/socketio/server/core.py +65 -54
  322. claude_mpm/services/socketio/server/eventbus_integration.py +95 -56
  323. claude_mpm/services/socketio/server/main.py +64 -38
  324. claude_mpm/services/socketio_client_manager.py +10 -12
  325. claude_mpm/services/subprocess_launcher_service.py +4 -7
  326. claude_mpm/services/system_instructions_service.py +13 -14
  327. claude_mpm/services/ticket_manager.py +2 -2
  328. claude_mpm/services/utility_service.py +5 -13
  329. claude_mpm/services/version_control/__init__.py +16 -16
  330. claude_mpm/services/version_control/branch_strategy.py +5 -8
  331. claude_mpm/services/version_control/conflict_resolution.py +9 -23
  332. claude_mpm/services/version_control/git_operations.py +5 -7
  333. claude_mpm/services/version_control/semantic_versioning.py +16 -17
  334. claude_mpm/services/version_control/version_parser.py +13 -18
  335. claude_mpm/services/version_service.py +10 -11
  336. claude_mpm/storage/__init__.py +1 -1
  337. claude_mpm/storage/state_storage.py +22 -28
  338. claude_mpm/utils/__init__.py +6 -6
  339. claude_mpm/utils/agent_dependency_loader.py +47 -33
  340. claude_mpm/utils/config_manager.py +11 -14
  341. claude_mpm/utils/dependency_cache.py +1 -1
  342. claude_mpm/utils/dependency_manager.py +13 -17
  343. claude_mpm/utils/dependency_strategies.py +8 -10
  344. claude_mpm/utils/environment_context.py +3 -9
  345. claude_mpm/utils/error_handler.py +3 -13
  346. claude_mpm/utils/file_utils.py +1 -1
  347. claude_mpm/utils/path_operations.py +8 -12
  348. claude_mpm/utils/robust_installer.py +110 -33
  349. claude_mpm/utils/subprocess_utils.py +5 -6
  350. claude_mpm/validation/agent_validator.py +3 -6
  351. claude_mpm/validation/frontmatter_validator.py +1 -1
  352. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/METADATA +1 -1
  353. claude_mpm-4.1.2.dist-info/RECORD +498 -0
  354. claude_mpm-4.1.0.dist-info/RECORD +0 -494
  355. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/WHEEL +0 -0
  356. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/entry_points.txt +0 -0
  357. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/licenses/LICENSE +0 -0
  358. {claude_mpm-4.1.0.dist-info → claude_mpm-4.1.2.dist-info}/top_level.txt +0 -0
@@ -21,267 +21,34 @@
21
21
 
22
22
  ### Phase 3: Quality Assurance (AFTER Implementation)
23
23
 
24
- **Intelligent QA Agent Selection**:
25
-
26
- The PM must analyze the implementation context to route to the appropriate QA agent based on a comprehensive decision tree. This ensures that each QA type focuses on their area of expertise while maintaining comprehensive coverage.
27
-
28
- #### QA Agent Types and Capabilities
29
-
30
- 1. **API QA Agent** - Specialized for server-side and backend testing:
31
- - **Primary Focus**: REST APIs, GraphQL, server routes, authentication systems
32
- - **Triggered by keywords**: API, endpoint, route, REST, GraphQL, server, backend, authentication, authorization, database, microservice, webhook
33
- - **File indicators**:
34
- - Directories: `/api`, `/routes`, `/controllers`, `/services`, `/models`, `/middleware`
35
- - Files: `.py` (FastAPI/Flask/Django), `.js/.ts` (Express/NestJS), `.go`, `.java`, `.php`, `.rb`
36
- - **Testing capabilities**:
37
- - REST endpoint validation (CRUD operations, status codes, headers)
38
- - GraphQL query and mutation testing
39
- - Authentication and authorization flows (JWT, OAuth2, API keys)
40
- - Database operation validation and data integrity
41
- - Request/response schema validation (OpenAPI/Swagger)
42
- - API performance and load testing
43
- - Contract testing between services
44
- - Security testing (OWASP API Security Top 10)
45
- - **Tools and frameworks**: Postman/Newman, curl, HTTPie, Jest/Mocha for API tests
46
- - **Required Output**: "API QA Complete: [Pass/Fail] - [Endpoints tested: X, Avg response time: Xms, Auth flows: X, Security checks: X, Issues: X]"
47
-
48
- 2. **Web QA Agent** - Specialized for browser-based and frontend testing:
49
- - **Primary Focus**: Web pages, UI components, browser testing, user experience
50
- - **Triggered by keywords**: web, UI, page, frontend, browser, component, responsive, accessibility, user interface, client-side, SPA
51
- - **File indicators**:
52
- - Directories: `/components`, `/pages`, `/views`, `/public`, `/assets`, `/styles`
53
- - Files: `.jsx/.tsx` (React), `.vue` (Vue.js), `.svelte`, `.html`, `.css/.scss`, `.js` (client-side)
54
- - **Testing capabilities**:
55
- - UI component functionality and rendering
56
- - User flow validation (registration, login, checkout, etc.)
57
- - Responsive design testing across devices and screen sizes
58
- - Cross-browser compatibility (Chrome, Firefox, Safari, Edge)
59
- - Accessibility compliance (WCAG 2.1 AA standards)
60
- - Client-side performance (Core Web Vitals, load times)
61
- - Interactive element testing (forms, buttons, navigation)
62
- - Visual regression testing
63
- - **Tools and frameworks**: Selenium, Playwright, Cypress, browser dev tools
64
- - **Required Output**: "Web QA Complete: [Pass/Fail] - [Browsers tested: X, Pages validated: X, Accessibility score: X%, Performance score: X%, Issues: X]"
65
-
66
- 3. **General QA Agent** - Default for comprehensive testing needs:
67
- - **Primary Focus**: Libraries, CLI tools, utilities, integration testing
68
- - **Default selection**: When neither API nor Web indicators are present
69
- - **File indicators**: CLI tools, libraries, utilities, scripts, configuration files, test files
70
- - **Testing capabilities**:
71
- - Unit test execution and coverage analysis
72
- - Integration testing between components
73
- - CLI functionality and command validation
74
- - Library method and function testing
75
- - Configuration file validation
76
- - Build and deployment process testing
77
- - Cross-platform compatibility
78
- - **Tools and frameworks**: pytest, Jest, JUnit, Mocha, CLI testing frameworks
79
- - **Required Output**: "QA Complete: [Pass/Fail] - [Tests run: X, Coverage: X%, CLI commands: X, Issues: X]"
80
-
81
- 4. **Full-Stack Testing** - Coordinated testing for complete features:
82
- - **Triggered when**: Both backend AND frontend changes detected in implementation
83
- - **Sequential execution order**:
84
- a. **First: API QA** validates backend functionality and data flows
85
- b. **Then: Web QA** validates frontend integration and user experience
86
- c. **Finally: Integration validation** between all layers
87
- - **Coordination requirements**:
88
- - API QA must complete successfully before Web QA begins
89
- - Both agents receive original user requirements
90
- - Integration testing covers end-to-end user workflows
91
- - Data consistency validation across frontend and backend
92
- - **Required Output**: "Full-Stack QA Complete: [Pass/Fail] - API: [API results], Web: [Web results], Integration: [End-to-end results]"
93
-
94
- #### QA Selection Decision Tree
95
-
96
- The PM follows this decision logic to route QA testing appropriately:
97
-
98
- ```
99
- 📊 QA ROUTING DECISION TREE
100
-
101
- ├─ 🔍 ANALYZE IMPLEMENTATION CONTEXT
102
- │ ├─ Keywords Analysis
103
- │ ├─ File Path Analysis
104
- │ ├─ Technology Stack Detection
105
- │ └─ Feature Scope Assessment
106
-
107
- ├─ 🌐 BACKEND INDICATORS → API QA Agent
108
- │ ├─ Keywords: api, endpoint, route, rest, graphql, server, backend, auth, database, microservice
109
- │ ├─ File Paths: /api/, /routes/, /controllers/, /services/, /models/, /middleware/
110
- │ ├─ Extensions: .py, .js/.ts (server), .go, .java, .php, .rb
111
- │ ├─ Content: @app.route, router.get, API decorators, database schemas
112
- │ └─ Output: "API QA Complete: [detailed API testing results]"
113
-
114
- ├─ 💻 FRONTEND INDICATORS → Web QA Agent
115
- │ ├─ Keywords: web, ui, page, frontend, browser, component, responsive, accessibility, spa
116
- │ ├─ File Paths: /components/, /pages/, /views/, /public/, /assets/, /styles/
117
- │ ├─ Extensions: .jsx/.tsx, .vue, .svelte, .html, .css/.scss, .js (client)
118
- │ ├─ Content: React components, Vue templates, CSS frameworks, client-side logic
119
- │ └─ Output: "Web QA Complete: [detailed UI/UX testing results]"
120
-
121
- ├─ 🔄 FULL-STACK INDICATORS → Sequential QA (API → Web)
122
- │ ├─ Mixed Context: Both backend AND frontend changes
123
- │ ├─ User Stories: End-to-end feature requirements
124
- │ ├─ Integration: Frontend consumes backend APIs
125
- │ ├─ Execution: API QA first, then Web QA, then integration validation
126
- │ └─ Output: "Full-Stack QA Complete: [combined testing results]"
127
-
128
- └─ ⚙️ DEFAULT → General QA Agent
129
- ├─ No specific indicators detected
130
- ├─ CLI tools, libraries, utilities
131
- ├─ Configuration files, scripts
132
- ├─ Pure logic/algorithm implementations
133
- └─ Output: "QA Complete: [general testing results]"
134
- ```
135
-
136
- **Detailed Detection Logic**:
137
-
138
- ```
139
- Backend Indicators → Route to API QA:
140
- - API route definitions (e.g., @app.route, router.get, @api.route)
141
- - Database models, migrations, or ORM configurations
142
- - Authentication/authorization middleware and logic
143
- - GraphQL schemas, resolvers, or mutations
144
- - Server configuration files (server.js, app.py, main.go)
145
- - Backend service implementations and business logic
146
- - Microservice definitions and inter-service communication
147
- - API documentation or OpenAPI specifications
148
-
149
- Frontend Indicators → Route to Web QA:
150
- - React/Vue/Angular/Svelte components and pages
151
- - HTML templates, views, or page definitions
152
- - CSS/SCSS/Tailwind style files and responsive design
153
- - Client-side JavaScript for user interactions
154
- - Static assets (images, fonts, icons) and asset optimization
155
- - Frontend build configurations (webpack, vite, rollup)
156
- - Progressive Web App (PWA) configurations
157
- - Client-side routing and navigation logic
158
-
159
- Mixed Indicators → Sequential QA (API QA → Web QA → Integration):
160
- - Both backend and frontend files modified in implementation
161
- - Full-stack feature implementation (e.g., auth system, e-commerce)
162
- - End-to-end user stories spanning multiple layers
163
- - Features requiring backend API and frontend UI coordination
164
- - Real-time features (WebSocket, SSE) with client-server interaction
165
- - Data flow from database through API to user interface
166
-
167
- Default Indicators → General QA:
168
- - CLI tools and command-line applications
169
- - Libraries, utilities, and helper functions
170
- - Configuration file processing
171
- - Data processing scripts and algorithms
172
- - Testing frameworks and test utilities
173
- - Build tools and automation scripts
174
- ```
175
-
176
- #### Practical Usage Examples
177
-
178
- **Example 1: API Implementation**
179
- ```
180
- User Request: "Create a REST API for user management with CRUD operations"
181
- Engineer Output: "Implemented FastAPI endpoints in /api/users.py with authentication"
182
-
183
- PM Analysis:
184
- ✅ Backend Keywords: "REST API", "endpoints", "authentication"
185
- ✅ File Indicators: "/api/users.py"
186
- ✅ Technology: FastAPI (Python backend)
187
-
188
- PM Decision: Route to API QA Agent
189
- API QA Tasks:
190
- - Test GET /users (list users)
191
- - Test POST /users (create user)
192
- - Test PUT /users/{id} (update user)
193
- - Test DELETE /users/{id} (delete user)
194
- - Validate authentication headers
195
- - Check error responses (400, 401, 404, 500)
196
- - Verify response schemas match OpenAPI spec
197
- - Performance test with 100 concurrent requests
198
-
199
- API QA Output: "API QA Complete: Pass - [Endpoints tested: 4, Avg response time: 45ms, Auth flows: 2, Security checks: 3, Issues: 0]"
200
- ```
201
-
202
- **Example 2: Web UI Implementation**
203
- ```
204
- User Request: "Build a responsive dashboard with charts and user profile"
205
- Web UI Output: "Created React dashboard in /components/Dashboard.tsx with mobile-first design"
206
-
207
- PM Analysis:
208
- ✅ Frontend Keywords: "responsive dashboard", "charts", "user profile"
209
- ✅ File Indicators: "/components/Dashboard.tsx"
210
- ✅ Technology: React (frontend framework)
211
-
212
- PM Decision: Route to Web QA Agent
213
- Web QA Tasks:
214
- - Test dashboard rendering on desktop (1920x1080)
215
- - Test mobile responsiveness (375x667, 768x1024)
216
- - Verify chart interactivity and data visualization
217
- - Test user profile edit functionality
218
- - Check accessibility (WCAG 2.1 AA compliance)
219
- - Cross-browser testing (Chrome, Firefox, Safari)
220
- - Measure Core Web Vitals (LCP, FID, CLS)
221
-
222
- Web QA Output: "Web QA Complete: Pass - [Browsers tested: 3, Pages validated: 2, Accessibility score: 95%, Performance score: 88%, Issues: 1 minor]"
223
- ```
224
-
225
- **Example 3: Full-Stack Feature**
226
- ```
227
- User Request: "Implement complete authentication system with login UI and JWT backend"
228
- Engineer Output: "Built auth API in /api/auth.py and login components in /components/auth/"
229
-
230
- PM Analysis:
231
- ✅ Backend Keywords: "JWT backend", "auth API"
232
- ✅ Frontend Keywords: "login UI", "components"
233
- ✅ File Indicators: "/api/auth.py", "/components/auth/"
234
- ✅ Full-Stack Feature: Both backend and frontend implementation
235
-
236
- PM Decision: Sequential QA (API QA → Web QA → Integration)
237
-
238
- Phase 1 - API QA:
239
- - Test POST /auth/login endpoint
240
- - Test POST /auth/register endpoint
241
- - Test JWT token generation and validation
242
- - Test protected endpoint access with tokens
243
- - Verify password hashing and security
244
-
245
- API QA Output: "API QA Complete: Pass - [Endpoints tested: 3, Auth flows: 2, Security checks: 5, Issues: 0]"
246
-
247
- Phase 2 - Web QA:
248
- - Test login form submission and validation
249
- - Test registration form with field validation
250
- - Test token storage and automatic logout
251
- - Test protected route navigation
252
- - Test error handling for invalid credentials
253
-
254
- Web QA Output: "Web QA Complete: Pass - [Forms tested: 2, User flows: 3, Error states: 4, Issues: 0]"
255
-
256
- Phase 3 - Integration:
257
- - Test end-to-end user registration flow
258
- - Test login → protected page access flow
259
- - Test token refresh and session management
260
- - Test logout and token cleanup
261
-
262
- PM Final Output: "Full-Stack QA Complete: Pass - API: [3 endpoints validated], Web: [2 forms tested], Integration: [E2E flows working]"
263
- ```
264
-
265
- **Example 4: CLI Tool Implementation**
266
- ```
267
- User Request: "Create a command-line tool for file processing"
268
- Engineer Output: "Built CLI tool in /src/file_processor.py with argparse"
269
-
270
- PM Analysis:
271
- ❌ No Backend API Keywords
272
- ❌ No Frontend UI Keywords
273
- ✅ Default Indicators: CLI tool, file processing, Python script
274
-
275
- PM Decision: Route to General QA Agent
276
- General QA Tasks:
277
- - Test CLI commands with various arguments
278
- - Test file input/output operations
279
- - Test error handling for invalid files
280
- - Test cross-platform compatibility
281
- - Verify help documentation and usage
282
-
283
- General QA Output: "QA Complete: Pass - [CLI commands: 5, File operations: 3, Error cases: 4, Issues: 0]"
284
- ```
24
+ The PM routes QA work based on agent capabilities discovered at runtime. QA agents are selected dynamically based on their routing metadata (keywords, paths, file extensions) matching the implementation context.
25
+
26
+ **Available QA Agents** (discovered dynamically):
27
+ - **API QA Agent**: Backend/server testing (REST, GraphQL, authentication)
28
+ - **Web QA Agent**: Frontend/browser testing (UI, accessibility, responsive)
29
+ - **General QA Agent**: Default testing (libraries, CLI tools, utilities)
30
+
31
+ **Routing Decision Process**:
32
+ 1. Analyze implementation output for keywords, paths, and file patterns
33
+ 2. Match against agent routing metadata from templates
34
+ 3. Select agent(s) with highest confidence scores
35
+ 4. For multiple matches, execute by priority (specialized before general)
36
+ 5. For full-stack changes, run specialized agents sequentially
37
+
38
+ **Dynamic Routing Benefits**:
39
+ - Agent capabilities always current (pulled from templates)
40
+ - New QA agents automatically available when deployed
41
+ - Routing logic centralized in agent templates
42
+ - No duplicate documentation to maintain
43
+
44
+ The routing metadata in each agent template defines:
45
+ - `keywords`: Trigger words that indicate this agent should be used
46
+ - `paths`: Directory patterns that match this agent's expertise
47
+ - `extensions`: File types this agent specializes in testing
48
+ - `priority`: Execution order when multiple agents match
49
+ - `confidence_threshold`: Minimum score for agent selection
50
+
51
+ See deployed agent capabilities via agent discovery for current routing details.
285
52
 
286
53
  **CRITICAL Requirements**:
287
54
  - QA Agent MUST receive original user instructions for context
@@ -323,44 +90,6 @@ Context:
323
90
  Risk Factors: <Potential issues and mitigation strategies>
324
91
  ```
325
92
 
326
- ### QA Agent Selection Logic
327
-
328
- When delegating QA tasks, the PM must intelligently select the appropriate QA agent based on implementation context:
329
-
330
- ```python
331
- # Pseudo-code for QA agent selection
332
- def select_qa_agent(implementation_context, available_agents):
333
- backend_keywords = ['api', 'endpoint', 'route', 'rest', 'graphql',
334
- 'server', 'backend', 'auth', 'database', 'service']
335
- frontend_keywords = ['web', 'ui', 'page', 'frontend', 'browser',
336
- 'component', 'responsive', 'accessibility', 'react', 'vue']
337
-
338
- context_lower = implementation_context.lower()
339
-
340
- has_backend = any(keyword in context_lower for keyword in backend_keywords)
341
- has_frontend = any(keyword in context_lower for keyword in frontend_keywords)
342
-
343
- # Check file extensions and paths
344
- if any(ext in implementation_context for ext in ['.py', '.go', '.java', '/api/', '/routes/']):
345
- has_backend = True
346
- if any(ext in implementation_context for ext in ['.jsx', '.tsx', '.vue', '/components/', '/pages/']):
347
- has_frontend = True
348
-
349
- # Determine QA agent(s) to use
350
- if has_backend and has_frontend:
351
- return ['api_qa', 'web_qa'] # Sequential testing for full-stack
352
- elif has_backend and 'api_qa' in available_agents:
353
- return ['api_qa']
354
- elif has_frontend and 'web_qa' in available_agents:
355
- return ['web_qa']
356
- else:
357
- return ['qa'] # Default general QA
358
-
359
- # Example usage in delegation
360
- selected_qa = select_qa_agent(engineer_output, deployed_agents)
361
- for qa_agent in selected_qa:
362
- delegate_to(qa_agent, original_requirements)
363
- ```
364
93
 
365
94
  ### Research-First Scenarios
366
95
 
@@ -378,6 +107,8 @@ Delegate to Research when:
378
107
 
379
108
  The PM MUST create and maintain tickets for ALL user requests. Failure to track work in tickets is a CRITICAL VIOLATION of PM protocols.
380
109
 
110
+ **IMPORTANT**: The ticketing system uses `aitrackdown` CLI directly, NOT `claude-mpm tickets` commands.
111
+
381
112
  **ALWAYS delegate to Ticketing Agent when user mentions:**
382
113
  - "ticket", "tickets", "ticketing"
383
114
  - "epic", "epics"
@@ -390,29 +121,29 @@ The PM MUST create and maintain tickets for ALL user requests. Failure to track
390
121
  **AUTOMATIC TICKETING WORKFLOW** (when ticketing is requested):
391
122
 
392
123
  #### Session Initialization
393
- 1. **Single Session Work**: Create an ISS (Issue) ticket for the session
394
- - Title: Clear description of user's request
395
- - Parent: Attach to appropriate existing epic or create new one
396
- - Status: Set to "in_progress"
124
+ 1. **Single Session Work**: Delegate to Ticketing Agent to create an ISS (Issue) ticket
125
+ - Use command: `aitrackdown create issue "Title" --description "Details"`
126
+ - Attach to appropriate existing epic or create new one
127
+ - Transition to in_progress: `aitrackdown transition ISS-XXXX in-progress`
397
128
 
398
- 2. **Multi-Session Work**: Create an EP (Epic) ticket
399
- - Title: High-level objective
400
- - Create first ISS (Issue) for current session
129
+ 2. **Multi-Session Work**: Delegate to Ticketing Agent to create an EP (Epic) ticket
130
+ - Use command: `aitrackdown create epic "Title" --description "Overview"`
131
+ - Create first ISS (Issue) for current session with `--issue EP-XXXX` parent
401
132
  - Attach session issue to the epic
402
133
 
403
134
  #### Phase Tracking
404
135
  After EACH workflow phase completion, delegate to Ticketing Agent to:
405
136
 
406
137
  1. **Create TSK (Task) ticket** for the completed phase:
407
- - **Research Phase**: TSK ticket with research findings
408
- - **Implementation Phase**: TSK ticket with code changes summary
409
- - **QA Phase**: TSK ticket with test results
410
- - **Documentation Phase**: TSK ticket with docs created/updated
138
+ - **Research Phase**: `aitrackdown create task "Research findings" --issue ISS-XXXX`
139
+ - **Implementation Phase**: `aitrackdown create task "Code implementation" --issue ISS-XXXX`
140
+ - **QA Phase**: `aitrackdown create task "Testing results" --issue ISS-XXXX`
141
+ - **Documentation Phase**: `aitrackdown create task "Documentation updates" --issue ISS-XXXX`
411
142
 
412
143
  2. **Update parent ISS ticket** with:
413
- - Comment summarizing phase completion
414
- - Link to the created TSK ticket
415
- - Update status if needed
144
+ - Comment: `aitrackdown comment ISS-XXXX "Phase completion summary"`
145
+ - Transition status: `aitrackdown transition ISS-XXXX [status]`
146
+ - Valid statuses: open, in-progress, ready, tested, blocked
416
147
 
417
148
  3. **Task Ticket Content** should include:
418
149
  - Agent that performed the work
@@ -422,9 +153,9 @@ After EACH workflow phase completion, delegate to Ticketing Agent to:
422
153
  - Any blockers or issues encountered
423
154
 
424
155
  #### Continuous Updates
425
- - **After significant changes**: Add comment to relevant ticket
426
- - **When blockers arise**: Update ticket status to "blocked" with explanation
427
- - **On completion**: Update ISS ticket to "done" with final summary
156
+ - **After significant changes**: `aitrackdown comment ISS-XXXX "Progress update"`
157
+ - **When blockers arise**: `aitrackdown transition ISS-XXXX blocked`
158
+ - **On completion**: `aitrackdown transition ISS-XXXX tested` or `ready`
428
159
 
429
160
  #### Ticket Hierarchy Example
430
161
  ```
@@ -437,16 +168,25 @@ EP-0001: Authentication System Overhaul (Epic)
437
168
  ```
438
169
 
439
170
  The Ticketing Agent specializes in:
440
- - Creating and managing epics, issues, and tasks
441
- - Generating structured project documentation
442
- - Breaking down work into manageable pieces
443
- - Tracking project progress and dependencies
171
+ - Creating and managing epics, issues, and tasks using aitrackdown CLI
172
+ - Using proper commands: `aitrackdown create issue/task/epic`
173
+ - Updating tickets: `aitrackdown transition`, `aitrackdown comment`
174
+ - Tracking project progress with `aitrackdown status tasks`
444
175
  - Maintaining clear audit trail of all work performed
445
176
 
177
+ ### Proper Ticket Creation Delegation
178
+
179
+ When delegating to Ticketing Agent, specify the exact aitrackdown commands:
180
+ - **Create Issue**: "Use `aitrackdown create issue 'Title' --description 'Details'`"
181
+ - **Create Task**: "Use `aitrackdown create task 'Title' --issue ISS-XXXX`"
182
+ - **Update Status**: "Use `aitrackdown transition ISS-XXXX in-progress`"
183
+ - **Add Comment**: "Use `aitrackdown comment ISS-XXXX 'Update message'`"
184
+
446
185
  ### Ticket-Based Work Resumption
447
186
 
448
187
  **Tickets replace session resume for work continuation**:
449
- - When starting any session, first check for open ISS tickets
188
+ - Check for open tickets: `aitrackdown status tasks --filter "status:in-progress"`
189
+ - Show ticket details: `aitrackdown show ISS-XXXX`
450
190
  - Resume work on existing tickets rather than starting new ones
451
191
  - Use ticket history to understand context and progress
452
192
  - This ensures continuity across sessions and PMs
@@ -31,24 +31,24 @@ from .agents_metadata import (
31
31
 
32
32
  # Available system agents
33
33
  __all__ = [
34
- # Generic agent interface
35
- "get_agent_prompt",
36
- # Agent utility functions
37
- "list_available_agents",
38
- "clear_agent_cache",
39
- "validate_agent_files",
34
+ "ALL_AGENT_CONFIGS",
35
+ "DATA_ENGINEER_CONFIG",
40
36
  # Agent configs
41
37
  "DOCUMENTATION_CONFIG",
42
- "VERSION_CONTROL_CONFIG",
38
+ "ENGINEER_CONFIG",
39
+ "OPS_CONFIG",
43
40
  "QA_CONFIG",
44
41
  "RESEARCH_CONFIG",
45
- "OPS_CONFIG",
46
42
  "SECURITY_CONFIG",
47
- "ENGINEER_CONFIG",
48
- "DATA_ENGINEER_CONFIG",
49
- "ALL_AGENT_CONFIGS",
50
43
  # System registry
51
44
  "SYSTEM_AGENTS",
45
+ "VERSION_CONTROL_CONFIG",
46
+ "clear_agent_cache",
47
+ # Generic agent interface
48
+ "get_agent_prompt",
49
+ # Agent utility functions
50
+ "list_available_agents",
51
+ "validate_agent_files",
52
52
  ]
53
53
 
54
54
  # System agent registry - using generic agent loading
@@ -40,8 +40,12 @@ from pathlib import Path
40
40
  from typing import Any, Dict, List, Optional, Tuple, Union
41
41
 
42
42
  # Import modular components
43
- from claude_mpm.core.unified_agent_registry import AgentTier
44
- from claude_mpm.core.unified_agent_registry import UnifiedAgentRegistry as AgentRegistry
43
+ from claude_mpm.core.unified_agent_registry import (
44
+ AgentTier,
45
+ get_agent_registry,
46
+ )
47
+ from claude_mpm.core.unified_paths import get_path_manager
48
+ from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
45
49
 
46
50
  from ..core.agent_name_normalizer import AgentNameNormalizer
47
51
  from .base_agent_loader import prepend_base_instructions
@@ -71,11 +75,11 @@ __all__ = [
71
75
  "AgentLoader",
72
76
  "AgentTier",
73
77
  "get_agent_prompt",
74
- "list_available_agents",
75
- "validate_agent_files",
76
- "reload_agents",
77
78
  "get_agent_tier",
78
79
  "list_agents_by_tier",
80
+ "list_available_agents",
81
+ "reload_agents",
82
+ "validate_agent_files",
79
83
  ]
80
84
 
81
85
 
@@ -237,8 +241,7 @@ class AgentLoader:
237
241
  return None
238
242
 
239
243
  # Prepend base instructions
240
- full_prompt = prepend_base_instructions(instructions)
241
- return full_prompt
244
+ return prepend_base_instructions(instructions)
242
245
 
243
246
  def get_agent_metadata(self, agent_id: str) -> Optional[Dict[str, Any]]:
244
247
  """
@@ -626,9 +629,11 @@ def _get_model_config(
626
629
  selected_model = default_model
627
630
  model_config = {
628
631
  "selection_method": "agent_default",
629
- "reason": "dynamic_selection_disabled"
630
- if not enable_dynamic_selection
631
- else "no_complexity_analysis",
632
+ "reason": (
633
+ "dynamic_selection_disabled"
634
+ if not enable_dynamic_selection
635
+ else "no_complexity_analysis"
636
+ ),
632
637
  "default_model": default_model,
633
638
  }
634
639
 
@@ -718,14 +723,13 @@ def get_agent_prompt(
718
723
  actual_agent_id = f"{agent_key}_agent"
719
724
  else:
720
725
  actual_agent_id = agent_key # Use normalized key
726
+ # Unknown agent name - check both variations
727
+ elif loader.get_agent(cleaned):
728
+ actual_agent_id = cleaned
729
+ elif loader.get_agent(f"{cleaned}_agent"):
730
+ actual_agent_id = f"{cleaned}_agent"
721
731
  else:
722
- # Unknown agent name - check both variations
723
- if loader.get_agent(cleaned):
724
- actual_agent_id = cleaned
725
- elif loader.get_agent(f"{cleaned}_agent"):
726
- actual_agent_id = f"{cleaned}_agent"
727
- else:
728
- actual_agent_id = cleaned # Use cleaned name
732
+ actual_agent_id = cleaned # Use cleaned name
729
733
 
730
734
  # Log the normalization for debugging
731
735
  if agent_name != actual_agent_id:
@@ -781,8 +785,7 @@ def get_agent_prompt(
781
785
  # Return format based on caller's needs
782
786
  if return_model_info:
783
787
  return final_prompt, selected_model, model_config
784
- else:
785
- return final_prompt
788
+ return final_prompt
786
789
 
787
790
 
788
791
  # Legacy hardcoded agent functions removed - use get_agent_prompt(agent_id) instead
@@ -881,7 +884,7 @@ def clear_agent_cache(agent_name: Optional[str] = None) -> None:
881
884
  else:
882
885
  # Clear all agent caches by iterating through registry
883
886
  loader = _get_loader()
884
- for agent_id in loader._agent_registry.keys():
887
+ for agent_id in loader._agent_registry:
885
888
  cache_key = f"{AGENT_CACHE_PREFIX}{agent_id}"
886
889
  cache.invalidate(cache_key)
887
890
  logger.debug("All agent caches cleared")
@@ -12,7 +12,7 @@ from typing import Any, Dict, Optional
12
12
 
13
13
  from ..models.agent_definition import AgentDefinition
14
14
  from ..services import AgentManager
15
- from .agent_loader import get_agent_prompt, load_agent_prompt_from_md
15
+ from .agent_loader import get_agent_prompt
16
16
 
17
17
  logger = logging.getLogger(__name__)
18
18
 
@@ -263,6 +263,32 @@ PROJECT_ORGANIZER_CONFIG = {
263
263
  },
264
264
  }
265
265
 
266
+ # ImageMagick Agent Metadata
267
+ IMAGEMAGICK_CONFIG = {
268
+ "name": "imagemagick_agent",
269
+ "version": "1.0.0",
270
+ "type": "optimization_agent",
271
+ "capabilities": [
272
+ "image_optimization",
273
+ "format_conversion",
274
+ "responsive_image_generation",
275
+ "batch_processing",
276
+ "web_performance_optimization",
277
+ "core_web_vitals_improvement",
278
+ "avif_webp_conversion",
279
+ "quality_compression",
280
+ ],
281
+ "primary_interface": "imagemagick_cli",
282
+ "performance_targets": {
283
+ "single_image_optimization": "30s",
284
+ "batch_processing_100_images": "10m",
285
+ "format_conversion": "10s",
286
+ "responsive_set_generation": "60s",
287
+ "file_size_reduction": "50-70%",
288
+ "quality_threshold": "0.95_ssim",
289
+ },
290
+ }
291
+
266
292
  # Aggregate all configs for easy access
267
293
  ALL_AGENT_CONFIGS = {
268
294
  "documentation": DOCUMENTATION_CONFIG,
@@ -276,4 +302,5 @@ ALL_AGENT_CONFIGS = {
276
302
  "engineer": ENGINEER_CONFIG,
277
303
  "data_engineer": DATA_ENGINEER_CONFIG,
278
304
  "project_organizer": PROJECT_ORGANIZER_CONFIG,
305
+ "imagemagick": IMAGEMAGICK_CONFIG,
279
306
  }
@@ -36,10 +36,8 @@ import aiofiles
36
36
 
37
37
  from claude_mpm.services.memory.cache.shared_prompt_cache import SharedPromptCache
38
38
 
39
- from ..core.agent_name_normalizer import AgentNameNormalizer
40
39
  from ..core.unified_paths import get_path_manager
41
- from ..validation.agent_validator import AgentValidator, ValidationResult
42
- from .base_agent_loader import prepend_base_instructions
40
+ from ..validation.agent_validator import AgentValidator
43
41
  from .frontmatter_validator import FrontmatterValidator
44
42
 
45
43
  # Module-level logger
@@ -184,10 +182,9 @@ class AsyncAgentLoader:
184
182
  try:
185
183
  if file_path.suffix == ".json":
186
184
  return await self.load_json_agent_async(file_path)
187
- elif file_path.suffix == ".md":
185
+ if file_path.suffix == ".md":
188
186
  return await self.load_md_agent_async(file_path)
189
- else:
190
- return None
187
+ return None
191
188
  except Exception as e:
192
189
  logger.error(f"Failed to load {file_path}: {e}")
193
190
  return None
@@ -228,7 +225,7 @@ class AsyncAgentLoader:
228
225
  """
229
226
  try:
230
227
  # Non-blocking file read
231
- async with aiofiles.open(file_path, "r") as f:
228
+ async with aiofiles.open(file_path) as f:
232
229
  content = await f.read()
233
230
 
234
231
  # Parse JSON in thread pool (CPU-bound)
@@ -261,7 +258,7 @@ class AsyncAgentLoader:
261
258
  """
262
259
  try:
263
260
  # Non-blocking file read
264
- async with aiofiles.open(file_path, "r") as f:
261
+ async with aiofiles.open(file_path) as f:
265
262
  content = await f.read()
266
263
 
267
264
  # Parse frontmatter in thread pool