claude-mpm 4.6.1__py3-none-any.whl → 4.7.0__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 (111) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +206 -48
  3. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +787 -0
  4. claude_mpm/agents/base_agent_loader.py +3 -1
  5. claude_mpm/agents/templates/engineer.json +10 -4
  6. claude_mpm/agents/templates/prompt-engineer.json +517 -87
  7. claude_mpm/cli/commands/cleanup.py +1 -1
  8. claude_mpm/cli/commands/mcp_setup_external.py +2 -2
  9. claude_mpm/cli/commands/memory.py +1 -1
  10. claude_mpm/cli/commands/mpm_init.py +5 -4
  11. claude_mpm/cli/commands/run.py +4 -4
  12. claude_mpm/cli/shared/argument_patterns.py +18 -11
  13. claude_mpm/cli/shared/base_command.py +1 -1
  14. claude_mpm/config/experimental_features.py +3 -3
  15. claude_mpm/config/socketio_config.py +1 -1
  16. claude_mpm/core/cache.py +2 -2
  17. claude_mpm/core/claude_runner.py +5 -7
  18. claude_mpm/core/container.py +10 -4
  19. claude_mpm/core/file_utils.py +10 -8
  20. claude_mpm/core/framework/formatters/context_generator.py +3 -2
  21. claude_mpm/core/framework/loaders/agent_loader.py +11 -7
  22. claude_mpm/core/injectable_service.py +11 -8
  23. claude_mpm/core/interactive_session.py +5 -4
  24. claude_mpm/core/oneshot_session.py +3 -2
  25. claude_mpm/core/pm_hook_interceptor.py +15 -9
  26. claude_mpm/core/unified_paths.py +6 -5
  27. claude_mpm/dashboard/api/simple_directory.py +16 -17
  28. claude_mpm/hooks/claude_hooks/event_handlers.py +3 -2
  29. claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +2 -2
  30. claude_mpm/hooks/claude_hooks/hook_handler_original.py +2 -2
  31. claude_mpm/hooks/claude_hooks/installer.py +10 -10
  32. claude_mpm/hooks/claude_hooks/response_tracking.py +3 -2
  33. claude_mpm/hooks/claude_hooks/services/state_manager.py +3 -2
  34. claude_mpm/hooks/tool_call_interceptor.py +6 -3
  35. claude_mpm/models/agent_session.py +3 -1
  36. claude_mpm/scripts/mcp_server.py +3 -5
  37. claude_mpm/services/agents/agent_builder.py +4 -4
  38. claude_mpm/services/agents/deployment/deployment_type_detector.py +10 -14
  39. claude_mpm/services/agents/deployment/local_template_deployment.py +6 -3
  40. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +15 -11
  41. claude_mpm/services/agents/deployment/system_instructions_deployer.py +9 -6
  42. claude_mpm/services/agents/loading/agent_profile_loader.py +1 -2
  43. claude_mpm/services/agents/memory/agent_memory_manager.py +27 -27
  44. claude_mpm/services/agents/memory/content_manager.py +9 -4
  45. claude_mpm/services/claude_session_logger.py +5 -8
  46. claude_mpm/services/cli/memory_crud_service.py +1 -1
  47. claude_mpm/services/cli/memory_output_formatter.py +1 -1
  48. claude_mpm/services/cli/startup_checker.py +13 -10
  49. claude_mpm/services/cli/unified_dashboard_manager.py +10 -6
  50. claude_mpm/services/command_deployment_service.py +9 -7
  51. claude_mpm/services/core/path_resolver.py +8 -5
  52. claude_mpm/services/diagnostics/checks/agent_check.py +4 -7
  53. claude_mpm/services/diagnostics/checks/installation_check.py +19 -16
  54. claude_mpm/services/diagnostics/checks/mcp_services_check.py +30 -28
  55. claude_mpm/services/diagnostics/checks/startup_log_check.py +5 -3
  56. claude_mpm/services/events/core.py +2 -3
  57. claude_mpm/services/framework_claude_md_generator/content_validator.py +2 -2
  58. claude_mpm/services/hook_installer_service.py +2 -3
  59. claude_mpm/services/hook_service.py +5 -6
  60. claude_mpm/services/mcp_gateway/auto_configure.py +4 -5
  61. claude_mpm/services/mcp_gateway/main.py +7 -4
  62. claude_mpm/services/mcp_gateway/server/stdio_server.py +3 -4
  63. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +1 -2
  64. claude_mpm/services/mcp_service_verifier.py +18 -17
  65. claude_mpm/services/memory/builder.py +1 -2
  66. claude_mpm/services/memory/indexed_memory.py +1 -1
  67. claude_mpm/services/memory/optimizer.py +1 -2
  68. claude_mpm/services/monitor/daemon_manager.py +3 -3
  69. claude_mpm/services/monitor/handlers/file.py +5 -4
  70. claude_mpm/services/monitor/management/lifecycle.py +1 -1
  71. claude_mpm/services/monitor/server.py +14 -12
  72. claude_mpm/services/project/architecture_analyzer.py +5 -5
  73. claude_mpm/services/project/metrics_collector.py +4 -4
  74. claude_mpm/services/project/project_organizer.py +4 -4
  75. claude_mpm/services/project/registry.py +9 -3
  76. claude_mpm/services/shared/config_service_base.py +2 -3
  77. claude_mpm/services/socketio/handlers/file.py +5 -4
  78. claude_mpm/services/socketio/handlers/git.py +7 -7
  79. claude_mpm/services/socketio/server/core.py +10 -10
  80. claude_mpm/services/subprocess_launcher_service.py +5 -10
  81. claude_mpm/services/ticket_services/formatter_service.py +1 -1
  82. claude_mpm/services/ticket_services/validation_service.py +5 -5
  83. claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +5 -5
  84. claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +4 -4
  85. claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +4 -4
  86. claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +4 -4
  87. claude_mpm/services/unified/config_strategies/error_handling_strategy.py +4 -4
  88. claude_mpm/services/unified/config_strategies/file_loader_strategy.py +6 -2
  89. claude_mpm/services/unified/config_strategies/unified_config_service.py +24 -13
  90. claude_mpm/services/version_control/conflict_resolution.py +6 -2
  91. claude_mpm/services/version_control/git_operations.py +1 -1
  92. claude_mpm/services/version_control/version_parser.py +1 -1
  93. claude_mpm/storage/state_storage.py +3 -3
  94. claude_mpm/tools/__main__.py +1 -1
  95. claude_mpm/tools/code_tree_analyzer.py +17 -14
  96. claude_mpm/tools/socketio_debug.py +7 -7
  97. claude_mpm/utils/common.py +6 -2
  98. claude_mpm/utils/config_manager.py +9 -3
  99. claude_mpm/utils/database_connector.py +4 -4
  100. claude_mpm/utils/dependency_strategies.py +1 -1
  101. claude_mpm/utils/environment_context.py +3 -2
  102. claude_mpm/utils/file_utils.py +1 -2
  103. claude_mpm/utils/path_operations.py +3 -1
  104. claude_mpm/utils/robust_installer.py +3 -4
  105. claude_mpm/validation/frontmatter_validator.py +4 -4
  106. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/METADATA +1 -1
  107. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/RECORD +111 -110
  108. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/WHEEL +0 -0
  109. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/entry_points.txt +0 -0
  110. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/licenses/LICENSE +0 -0
  111. {claude_mpm-4.6.1.dist-info → claude_mpm-4.7.0.dist-info}/top_level.txt +0 -0
@@ -257,7 +257,9 @@ def load_base_agent_instructions(force_reload: bool = False) -> Optional[str]:
257
257
  logger.debug(f"Loading base agent instructions from: {base_agent_file}")
258
258
 
259
259
  # Load JSON and extract instructions
260
- with open(base_agent_file, encoding="utf-8") as f:
260
+ with Path(base_agent_file).open(
261
+ encoding="utf-8",
262
+ ) as f:
261
263
  base_agent_data = json.load(f)
262
264
 
263
265
  # Extract instructions from the JSON structure
@@ -70,25 +70,31 @@
70
70
  ]
71
71
  }
72
72
  },
73
- "instructions": "You are an expert software engineer with deep expertise across multiple programming paradigms, languages, and architectural patterns. Your approach combines technical excellence with pragmatic problem-solving to deliver robust, scalable solutions.\n\n**Core Responsibilities:**\n\nYou will analyze requirements and implement solutions that prioritize:\n- Clean, readable, and maintainable code following established best practices\n- Appropriate design patterns and architectural decisions for the problem domain\n- Performance optimization without premature optimization\n- Comprehensive error handling and edge case management\n- Security considerations and input validation\n- Testability and modularity\n\n**Development Methodology:**\n\nWhen implementing solutions, you will:\n\n1. **Understand Requirements**: Carefully analyze the problem statement, identifying both explicit requirements and implicit constraints. Ask clarifying questions when specifications are ambiguous.\n\n2. **Design Before Coding**: Plan your approach by:\n - Identifying the appropriate data structures and algorithms\n - Considering scalability and performance implications\n - Evaluating trade-offs between different implementation strategies\n - Ensuring alignment with existing codebase patterns and standards\n\n3. **Write Quality Code**: Implement solutions that:\n - Follow language-specific idioms and conventions\n - Include clear, purposeful comments for complex logic\n - Use descriptive variable and function names\n - Maintain consistent formatting and style\n - Implement proper separation of concerns\n\n4. **Consider Edge Cases**: Proactively handle:\n - Boundary conditions and null/empty inputs\n - Concurrent access and race conditions where applicable\n - Resource management and cleanup\n - Graceful degradation and fallback strategies\n\n5. **Optimize Thoughtfully**: Balance performance with maintainability by:\n - Profiling before optimizing\n - Choosing appropriate data structures for the use case\n - Implementing caching strategies where beneficial\n - Avoiding premature optimization\n\n**Quality Assurance:**\n\nYou will ensure code quality through:\n- Self-review for logic errors and potential bugs\n- Consideration of test cases and test coverage\n- Documentation of complex algorithms or business logic\n- Verification that the solution meets all stated requirements\n- Validation of assumptions about external dependencies\n\n**Communication Style:**\n\nWhen presenting solutions, you will:\n- Explain your architectural decisions and trade-offs\n- Highlight any assumptions made during implementation\n- Suggest areas for future improvement or optimization\n- Provide clear documentation for API interfaces\n- Include usage examples when implementing libraries or utilities\n\n**Technology Adaptation:**\n\nYou will adapt your approach based on:\n- The specific programming language and its ecosystem\n- Framework conventions and established patterns\n- Team coding standards and style guides\n- Performance requirements and constraints\n- Deployment environment considerations\n\n**Continuous Improvement:**\n\nYou will actively:\n- Suggest refactoring opportunities when working with existing code\n- Identify technical debt and propose remediation strategies\n- Recommend modern best practices and patterns\n- Consider long-term maintainability in all decisions\n- Balance innovation with stability\n\nYour goal is to deliver code that not only solves the immediate problem but also serves as a solid foundation for future development. Every line of code you write should be purposeful, tested, and maintainable.",
73
+ "instructions": "Follow BASE_ENGINEER.md for all engineering protocols. Priority sequence: (1) Code minimization - target zero net new lines, (2) Duplicate elimination - search before implementing, (3) Debug-first - root cause before optimization. Specialization: Clean architecture with dependency injection, SOLID principles, and aggressive code reduction.",
74
74
  "knowledge": {
75
+ "base_instructions_file": "BASE_ENGINEER.md",
76
+ "instruction_precedence": "BASE_ENGINEER.md overrides instructions field",
75
77
  "domain_expertise": [
78
+ "Code minimization and refactoring",
79
+ "Duplicate detection and consolidation",
80
+ "Clean architecture and SOLID principles",
76
81
  "SOLID principles in production",
77
- "Clean architecture patterns",
78
- "Code reduction techniques",
79
82
  "Dependency injection patterns",
80
83
  "Modularization strategies",
81
84
  "Refactoring for legacy code",
82
85
  "Semantic code search for pattern discovery"
83
86
  ],
84
87
  "best_practices": [
88
+ "Execute vector search + grep before writing new code",
89
+ "Target zero net new lines per feature",
90
+ "Consolidate functions with >80% similarity",
91
+ "Report LOC delta with every change",
85
92
  "Use mcp__mcp-vector-search__search_code FIRST to find existing solutions",
86
93
  "Use mcp__mcp-vector-search__search_similar to find reusable patterns",
87
94
  "Search for code to DELETE first",
88
95
  "Apply dependency injection as default",
89
96
  "Enforce 800-line file limit",
90
97
  "Extract code appearing 2+ times",
91
- "Consolidate similar functions",
92
98
  "Use built-in features over custom",
93
99
  "Plan modularization at 600 lines"
94
100
  ],