claude-mpm 4.14.6__py3-none-any.whl → 4.21.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.

Potentially problematic release.


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

Files changed (353) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +272 -23
  4. claude_mpm/agents/OUTPUT_STYLE.md +48 -3
  5. claude_mpm/agents/PM_INSTRUCTIONS.md +49 -0
  6. claude_mpm/agents/agent_loader.py +17 -5
  7. claude_mpm/agents/frontmatter_validator.py +284 -253
  8. claude_mpm/agents/templates/agentic-coder-optimizer.json +9 -2
  9. claude_mpm/agents/templates/api_qa.json +7 -1
  10. claude_mpm/agents/templates/clerk-ops.json +8 -1
  11. claude_mpm/agents/templates/code_analyzer.json +4 -1
  12. claude_mpm/agents/templates/dart_engineer.json +11 -1
  13. claude_mpm/agents/templates/data_engineer.json +11 -1
  14. claude_mpm/agents/templates/documentation.json +6 -1
  15. claude_mpm/agents/templates/engineer.json +18 -1
  16. claude_mpm/agents/templates/gcp_ops_agent.json +8 -1
  17. claude_mpm/agents/templates/golang_engineer.json +11 -1
  18. claude_mpm/agents/templates/java_engineer.json +12 -2
  19. claude_mpm/agents/templates/local_ops_agent.json +216 -37
  20. claude_mpm/agents/templates/nextjs_engineer.json +11 -1
  21. claude_mpm/agents/templates/ops.json +8 -1
  22. claude_mpm/agents/templates/php-engineer.json +20 -4
  23. claude_mpm/agents/templates/project_organizer.json +10 -3
  24. claude_mpm/agents/templates/prompt-engineer.json +5 -1
  25. claude_mpm/agents/templates/python_engineer.json +19 -4
  26. claude_mpm/agents/templates/qa.json +7 -1
  27. claude_mpm/agents/templates/react_engineer.json +11 -1
  28. claude_mpm/agents/templates/refactoring_engineer.json +8 -1
  29. claude_mpm/agents/templates/research.json +4 -1
  30. claude_mpm/agents/templates/ruby-engineer.json +11 -1
  31. claude_mpm/agents/templates/rust_engineer.json +23 -8
  32. claude_mpm/agents/templates/security.json +6 -1
  33. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  34. claude_mpm/agents/templates/ticketing.json +6 -1
  35. claude_mpm/agents/templates/typescript_engineer.json +11 -1
  36. claude_mpm/agents/templates/vercel_ops_agent.json +8 -1
  37. claude_mpm/agents/templates/version_control.json +8 -1
  38. claude_mpm/agents/templates/web_qa.json +7 -1
  39. claude_mpm/agents/templates/web_ui.json +11 -1
  40. claude_mpm/cli/__init__.py +34 -740
  41. claude_mpm/cli/commands/__init__.py +2 -0
  42. claude_mpm/cli/commands/agent_manager.py +25 -12
  43. claude_mpm/cli/commands/agent_state_manager.py +186 -0
  44. claude_mpm/cli/commands/agents.py +204 -148
  45. claude_mpm/cli/commands/aggregate.py +7 -3
  46. claude_mpm/cli/commands/analyze.py +9 -4
  47. claude_mpm/cli/commands/analyze_code.py +7 -2
  48. claude_mpm/cli/commands/auto_configure.py +7 -9
  49. claude_mpm/cli/commands/config.py +47 -13
  50. claude_mpm/cli/commands/configure.py +294 -1788
  51. claude_mpm/cli/commands/configure_agent_display.py +261 -0
  52. claude_mpm/cli/commands/configure_behavior_manager.py +204 -0
  53. claude_mpm/cli/commands/configure_hook_manager.py +225 -0
  54. claude_mpm/cli/commands/configure_models.py +18 -0
  55. claude_mpm/cli/commands/configure_navigation.py +167 -0
  56. claude_mpm/cli/commands/configure_paths.py +104 -0
  57. claude_mpm/cli/commands/configure_persistence.py +254 -0
  58. claude_mpm/cli/commands/configure_startup_manager.py +646 -0
  59. claude_mpm/cli/commands/configure_template_editor.py +497 -0
  60. claude_mpm/cli/commands/configure_validators.py +73 -0
  61. claude_mpm/cli/commands/local_deploy.py +3 -2
  62. claude_mpm/cli/commands/memory.py +54 -20
  63. claude_mpm/cli/commands/mpm_init/__init__.py +73 -0
  64. claude_mpm/cli/commands/mpm_init/core.py +525 -0
  65. claude_mpm/cli/commands/mpm_init/display.py +341 -0
  66. claude_mpm/cli/commands/mpm_init/git_activity.py +427 -0
  67. claude_mpm/cli/commands/mpm_init/modes.py +397 -0
  68. claude_mpm/cli/commands/mpm_init/prompts.py +442 -0
  69. claude_mpm/cli/commands/mpm_init_cli.py +396 -0
  70. claude_mpm/cli/commands/mpm_init_handler.py +75 -4
  71. claude_mpm/cli/commands/skills.py +488 -0
  72. claude_mpm/cli/executor.py +204 -0
  73. claude_mpm/cli/helpers.py +105 -0
  74. claude_mpm/cli/interactive/__init__.py +3 -0
  75. claude_mpm/cli/interactive/skills_wizard.py +491 -0
  76. claude_mpm/cli/parsers/base_parser.py +7 -0
  77. claude_mpm/cli/parsers/mpm_init_parser.py +42 -0
  78. claude_mpm/cli/parsers/skills_parser.py +137 -0
  79. claude_mpm/cli/shared/output_formatters.py +28 -19
  80. claude_mpm/cli/startup.py +538 -0
  81. claude_mpm/commands/mpm-auto-configure.md +52 -0
  82. claude_mpm/commands/mpm-help.md +3 -0
  83. claude_mpm/commands/mpm-init.md +112 -6
  84. claude_mpm/commands/mpm-version.md +113 -0
  85. claude_mpm/commands/mpm.md +1 -0
  86. claude_mpm/config/agent_config.py +2 -2
  87. claude_mpm/constants.py +12 -0
  88. claude_mpm/core/base_service.py +13 -12
  89. claude_mpm/core/config.py +42 -0
  90. claude_mpm/core/enums.py +452 -0
  91. claude_mpm/core/factories.py +1 -1
  92. claude_mpm/core/instruction_reinforcement_hook.py +2 -1
  93. claude_mpm/core/interactive_session.py +6 -3
  94. claude_mpm/core/interfaces.py +56 -1
  95. claude_mpm/core/logging_config.py +6 -2
  96. claude_mpm/core/oneshot_session.py +8 -4
  97. claude_mpm/core/optimized_agent_loader.py +3 -3
  98. claude_mpm/core/output_style_manager.py +12 -192
  99. claude_mpm/core/service_registry.py +5 -1
  100. claude_mpm/core/types.py +2 -9
  101. claude_mpm/core/typing_utils.py +7 -6
  102. claude_mpm/dashboard/static/js/dashboard.js +0 -14
  103. claude_mpm/dashboard/templates/index.html +3 -41
  104. claude_mpm/hooks/__init__.py +8 -0
  105. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  106. claude_mpm/hooks/instruction_reinforcement.py +7 -2
  107. claude_mpm/hooks/session_resume_hook.py +121 -0
  108. claude_mpm/models/resume_log.py +340 -0
  109. claude_mpm/services/agents/auto_config_manager.py +10 -11
  110. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  111. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  112. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  113. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  114. claude_mpm/services/agents/deployment/interface_adapter.py +3 -2
  115. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  116. claude_mpm/services/agents/deployment/pipeline/steps/agent_processing_step.py +7 -6
  117. claude_mpm/services/agents/deployment/pipeline/steps/base_step.py +7 -16
  118. claude_mpm/services/agents/deployment/pipeline/steps/configuration_step.py +4 -3
  119. claude_mpm/services/agents/deployment/pipeline/steps/target_directory_step.py +5 -3
  120. claude_mpm/services/agents/deployment/pipeline/steps/validation_step.py +6 -5
  121. claude_mpm/services/agents/deployment/refactored_agent_deployment_service.py +9 -6
  122. claude_mpm/services/agents/deployment/validation/__init__.py +3 -1
  123. claude_mpm/services/agents/deployment/validation/validation_result.py +1 -9
  124. claude_mpm/services/agents/local_template_manager.py +1 -1
  125. claude_mpm/services/agents/memory/agent_memory_manager.py +5 -2
  126. claude_mpm/services/agents/recommender.py +47 -0
  127. claude_mpm/services/agents/registry/modification_tracker.py +5 -2
  128. claude_mpm/services/cli/resume_service.py +617 -0
  129. claude_mpm/services/cli/session_manager.py +87 -0
  130. claude_mpm/services/cli/session_pause_manager.py +504 -0
  131. claude_mpm/services/cli/session_resume_helper.py +372 -0
  132. claude_mpm/services/command_handler_service.py +11 -5
  133. claude_mpm/services/core/interfaces/process.py +6 -6
  134. claude_mpm/services/core/interfaces.py +56 -1
  135. claude_mpm/services/core/models/__init__.py +0 -2
  136. claude_mpm/services/core/models/agent_config.py +15 -28
  137. claude_mpm/services/core/models/health.py +1 -28
  138. claude_mpm/services/core/models/process.py +22 -41
  139. claude_mpm/services/core/path_resolver.py +1 -1
  140. claude_mpm/services/diagnostics/__init__.py +2 -2
  141. claude_mpm/services/diagnostics/checks/agent_check.py +25 -24
  142. claude_mpm/services/diagnostics/checks/claude_code_check.py +24 -23
  143. claude_mpm/services/diagnostics/checks/common_issues_check.py +25 -24
  144. claude_mpm/services/diagnostics/checks/configuration_check.py +24 -23
  145. claude_mpm/services/diagnostics/checks/filesystem_check.py +18 -17
  146. claude_mpm/services/diagnostics/checks/installation_check.py +30 -29
  147. claude_mpm/services/diagnostics/checks/instructions_check.py +20 -19
  148. claude_mpm/services/diagnostics/checks/mcp_check.py +50 -36
  149. claude_mpm/services/diagnostics/checks/mcp_services_check.py +36 -31
  150. claude_mpm/services/diagnostics/checks/monitor_check.py +23 -22
  151. claude_mpm/services/diagnostics/checks/startup_log_check.py +9 -8
  152. claude_mpm/services/diagnostics/diagnostic_runner.py +6 -5
  153. claude_mpm/services/diagnostics/doctor_reporter.py +28 -25
  154. claude_mpm/services/diagnostics/models.py +37 -21
  155. claude_mpm/services/infrastructure/monitoring/__init__.py +1 -1
  156. claude_mpm/services/infrastructure/monitoring/aggregator.py +12 -12
  157. claude_mpm/services/infrastructure/monitoring/base.py +5 -13
  158. claude_mpm/services/infrastructure/monitoring/network.py +7 -6
  159. claude_mpm/services/infrastructure/monitoring/process.py +13 -12
  160. claude_mpm/services/infrastructure/monitoring/resources.py +7 -6
  161. claude_mpm/services/infrastructure/monitoring/service.py +16 -15
  162. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  163. claude_mpm/services/local_ops/__init__.py +5 -3
  164. claude_mpm/services/local_ops/crash_detector.py +1 -1
  165. claude_mpm/services/local_ops/health_checks/http_check.py +2 -1
  166. claude_mpm/services/local_ops/health_checks/process_check.py +2 -1
  167. claude_mpm/services/local_ops/health_checks/resource_check.py +2 -1
  168. claude_mpm/services/local_ops/health_manager.py +1 -1
  169. claude_mpm/services/local_ops/process_manager.py +12 -12
  170. claude_mpm/services/local_ops/restart_manager.py +1 -1
  171. claude_mpm/services/local_ops/state_manager.py +6 -5
  172. claude_mpm/services/local_ops/unified_manager.py +2 -2
  173. claude_mpm/services/mcp_config_manager.py +7 -126
  174. claude_mpm/services/mcp_gateway/auto_configure.py +31 -25
  175. claude_mpm/services/mcp_gateway/core/__init__.py +1 -2
  176. claude_mpm/services/mcp_gateway/core/base.py +18 -31
  177. claude_mpm/services/mcp_gateway/core/process_pool.py +19 -10
  178. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +97 -45
  179. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +30 -28
  180. claude_mpm/services/memory_hook_service.py +4 -1
  181. claude_mpm/services/monitor/daemon_manager.py +3 -2
  182. claude_mpm/services/monitor/handlers/dashboard.py +2 -1
  183. claude_mpm/services/monitor/handlers/hooks.py +2 -1
  184. claude_mpm/services/monitor/management/lifecycle.py +3 -2
  185. claude_mpm/services/monitor/server.py +2 -1
  186. claude_mpm/services/session_management_service.py +3 -2
  187. claude_mpm/services/session_manager.py +205 -1
  188. claude_mpm/services/shared/async_service_base.py +16 -27
  189. claude_mpm/services/shared/lifecycle_service_base.py +1 -14
  190. claude_mpm/services/socketio/handlers/__init__.py +5 -2
  191. claude_mpm/services/socketio/handlers/hook.py +13 -2
  192. claude_mpm/services/socketio/handlers/registry.py +4 -2
  193. claude_mpm/services/socketio/server/main.py +10 -8
  194. claude_mpm/services/subprocess_launcher_service.py +14 -5
  195. claude_mpm/services/unified/analyzer_strategies/code_analyzer.py +8 -7
  196. claude_mpm/services/unified/analyzer_strategies/dependency_analyzer.py +6 -5
  197. claude_mpm/services/unified/analyzer_strategies/performance_analyzer.py +8 -7
  198. claude_mpm/services/unified/analyzer_strategies/security_analyzer.py +7 -6
  199. claude_mpm/services/unified/analyzer_strategies/structure_analyzer.py +5 -4
  200. claude_mpm/services/unified/config_strategies/validation_strategy.py +13 -9
  201. claude_mpm/services/unified/deployment_strategies/cloud_strategies.py +10 -3
  202. claude_mpm/services/unified/deployment_strategies/local.py +6 -5
  203. claude_mpm/services/unified/deployment_strategies/utils.py +6 -5
  204. claude_mpm/services/unified/deployment_strategies/vercel.py +7 -6
  205. claude_mpm/services/unified/interfaces.py +3 -1
  206. claude_mpm/services/unified/unified_analyzer.py +14 -10
  207. claude_mpm/services/unified/unified_config.py +2 -1
  208. claude_mpm/services/unified/unified_deployment.py +9 -4
  209. claude_mpm/services/version_service.py +104 -1
  210. claude_mpm/skills/__init__.py +42 -0
  211. claude_mpm/skills/agent_skills_injector.py +324 -0
  212. claude_mpm/skills/bundled/LICENSE_ATTRIBUTIONS.md +79 -0
  213. claude_mpm/skills/bundled/__init__.py +6 -0
  214. claude_mpm/skills/bundled/api-documentation.md +393 -0
  215. claude_mpm/skills/bundled/async-testing.md +571 -0
  216. claude_mpm/skills/bundled/code-review.md +143 -0
  217. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
  218. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
  219. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
  220. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
  221. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
  222. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
  223. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
  224. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
  225. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
  226. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
  227. claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
  228. claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
  229. claude_mpm/skills/bundled/database-migration.md +199 -0
  230. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
  231. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
  232. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
  233. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
  234. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
  235. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
  236. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
  237. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
  238. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
  239. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
  240. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
  241. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
  242. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
  243. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
  244. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
  245. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
  246. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
  247. claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
  248. claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
  249. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
  250. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  251. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  252. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  253. claude_mpm/skills/bundled/git-workflow.md +414 -0
  254. claude_mpm/skills/bundled/imagemagick.md +204 -0
  255. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  256. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
  257. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
  258. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
  259. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
  260. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
  261. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
  262. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
  263. claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
  264. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
  265. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
  266. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
  267. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
  268. claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
  269. claude_mpm/skills/bundled/main/mcp-builder/scripts/connections.py +157 -0
  270. claude_mpm/skills/bundled/main/mcp-builder/scripts/evaluation.py +425 -0
  271. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
  272. claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
  273. claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
  274. claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
  275. claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
  276. claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
  277. claude_mpm/skills/bundled/main/skill-creator/scripts/init_skill.py +303 -0
  278. claude_mpm/skills/bundled/main/skill-creator/scripts/package_skill.py +113 -0
  279. claude_mpm/skills/bundled/main/skill-creator/scripts/quick_validate.py +72 -0
  280. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  281. claude_mpm/skills/bundled/pdf.md +141 -0
  282. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  283. claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
  284. claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
  285. claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
  286. claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
  287. claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
  288. claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
  289. claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
  290. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  291. claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
  292. claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
  293. claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
  294. claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
  295. claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
  296. claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
  297. claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
  298. claude_mpm/skills/bundled/security-scanning.md +327 -0
  299. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  300. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  301. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
  302. claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
  303. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
  304. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
  305. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
  306. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
  307. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
  308. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
  309. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
  310. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
  311. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
  312. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
  313. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
  314. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
  315. claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
  316. claude_mpm/skills/bundled/testing/webapp-testing/examples/console_logging.py +35 -0
  317. claude_mpm/skills/bundled/testing/webapp-testing/examples/element_discovery.py +44 -0
  318. claude_mpm/skills/bundled/testing/webapp-testing/examples/static_html_automation.py +34 -0
  319. claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
  320. claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
  321. claude_mpm/skills/bundled/testing/webapp-testing/scripts/with_server.py +129 -0
  322. claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
  323. claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
  324. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  325. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  326. claude_mpm/skills/bundled/xlsx.md +157 -0
  327. claude_mpm/skills/registry.py +286 -0
  328. claude_mpm/skills/skill_manager.py +310 -0
  329. claude_mpm/skills/skills_registry.py +348 -0
  330. claude_mpm/skills/skills_service.py +739 -0
  331. claude_mpm/tools/code_tree_analyzer.py +177 -141
  332. claude_mpm/tools/code_tree_events.py +4 -2
  333. claude_mpm/utils/agent_dependency_loader.py +2 -2
  334. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/METADATA +211 -33
  335. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/RECORD +339 -199
  336. claude_mpm/agents/INSTRUCTIONS_OLD_DEPRECATED.md +0 -602
  337. claude_mpm/cli/commands/mpm_init.py +0 -1994
  338. claude_mpm/dashboard/static/css/code-tree.css +0 -1639
  339. claude_mpm/dashboard/static/js/components/code-tree/tree-breadcrumb.js +0 -353
  340. claude_mpm/dashboard/static/js/components/code-tree/tree-constants.js +0 -235
  341. claude_mpm/dashboard/static/js/components/code-tree/tree-search.js +0 -409
  342. claude_mpm/dashboard/static/js/components/code-tree/tree-utils.js +0 -435
  343. claude_mpm/dashboard/static/js/components/code-tree.js +0 -5869
  344. claude_mpm/dashboard/static/js/components/code-viewer.js +0 -1386
  345. claude_mpm/hooks/claude_hooks/hook_handler_eventbus.py +0 -425
  346. claude_mpm/hooks/claude_hooks/hook_handler_original.py +0 -1041
  347. claude_mpm/hooks/claude_hooks/hook_handler_refactored.py +0 -347
  348. claude_mpm/services/agents/deployment/agent_lifecycle_manager_refactored.py +0 -575
  349. claude_mpm/services/project/analyzer_refactored.py +0 -450
  350. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/WHEEL +0 -0
  351. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/entry_points.txt +0 -0
  352. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/licenses/LICENSE +0 -0
  353. {claude_mpm-4.14.6.dist-info → claude_mpm-4.21.0.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION CHANGED
@@ -1 +1 @@
1
- 4.14.6
1
+ 4.21.0
@@ -262,6 +262,292 @@ Before writing ANY fix or optimization, you MUST:
262
262
  - **Test Coverage**: Minimum 80% for new code
263
263
  - **Documentation**: All public APIs must have docstrings
264
264
 
265
+ ## Engineering Quality Documentation Standards
266
+
267
+ All engineers must provide comprehensive documentation for implementations. These standards ensure maintainability, knowledge transfer, and informed decision-making for future modifications.
268
+
269
+ ### Design Decision Documentation (MANDATORY)
270
+
271
+ Every significant implementation must document:
272
+
273
+ **Architectural Choices and Reasoning**
274
+ - Explain WHY you chose this approach over alternatives
275
+ - Document the problem context that influenced the decision
276
+ - Link design to business requirements or technical constraints
277
+
278
+ **Alternatives Considered**
279
+ - List other approaches evaluated during design
280
+ - Explain why each alternative was rejected
281
+ - Note any assumptions that might invalidate the current choice
282
+
283
+ **Trade-offs Analysis**
284
+ - **Performance vs. Maintainability**: Document speed vs. readability choices
285
+ - **Complexity vs. Flexibility**: Note when simplicity was chosen over extensibility
286
+ - **Memory vs. Speed**: Explain resource allocation decisions
287
+ - **Time vs. Quality**: Acknowledge technical debt taken for deadlines
288
+
289
+ **Future Extensibility**
290
+ - Identify extension points for anticipated changes
291
+ - Document which parts are designed to be stable vs. flexible
292
+ - Note refactoring opportunities for future consideration
293
+
294
+ **Example**:
295
+ ```python
296
+ class CacheManager:
297
+ """
298
+ Design Decision: In-memory LRU cache with TTL
299
+
300
+ Rationale: Selected in-memory caching for sub-millisecond access times
301
+ required by API SLA (<50ms p99 latency). Rejected Redis to avoid
302
+ network latency and operational complexity for this use case.
303
+
304
+ Trade-offs:
305
+ - Performance: O(1) access vs. Redis ~1-2ms network round-trip
306
+ - Scalability: Limited to single-node memory vs. distributed cache
307
+ - Persistence: Loses cache on restart vs. Redis durability
308
+
309
+ Alternatives Considered:
310
+ 1. Redis: Rejected due to network latency and ops overhead
311
+ 2. SQLite: Rejected due to disk I/O bottleneck on writes
312
+ 3. No caching: Rejected due to database query load (2000+ QPS)
313
+
314
+ Extension Points: Cache backend interface allows future Redis migration
315
+ if horizontal scaling becomes necessary (>10K QPS threshold).
316
+ """
317
+ ```
318
+
319
+ ### Performance Analysis (RECOMMENDED)
320
+
321
+ For algorithms and critical paths, provide:
322
+
323
+ **Complexity Analysis**
324
+ - **Time Complexity**: Big-O notation for all operations
325
+ - Best case, average case, worst case
326
+ - Explain what factors influence complexity
327
+ - **Space Complexity**: Memory usage characteristics
328
+ - Auxiliary space requirements
329
+ - Scalability limits based on input size
330
+
331
+ **Performance Metrics**
332
+ - Expected performance for typical workloads
333
+ - Benchmarks for critical operations
334
+ - Comparison to previous implementation (if refactoring)
335
+
336
+ **Bottleneck Identification**
337
+ - Known performance limitations
338
+ - Conditions that trigger worst-case behavior
339
+ - Scalability ceilings and their causes
340
+
341
+ **Example**:
342
+ ```python
343
+ def binary_search(arr: list, target: int) -> int:
344
+ """
345
+ Find target in sorted array using binary search.
346
+
347
+ Performance:
348
+ - Time Complexity: O(log n) average/worst case, O(1) best case
349
+ - Space Complexity: O(1) iterative implementation
350
+
351
+ Expected Performance:
352
+ - 1M elements: ~20 comparisons maximum
353
+ - 1B elements: ~30 comparisons maximum
354
+
355
+ Bottleneck: Array must be pre-sorted. If frequent insertions/deletions,
356
+ consider balanced tree structure (O(log n) insert vs. O(n) array insert).
357
+ """
358
+ ```
359
+
360
+ ### Optimization Suggestions (RECOMMENDED)
361
+
362
+ Document future improvement opportunities:
363
+
364
+ **Potential Performance Improvements**
365
+ - Specific optimizations not yet implemented
366
+ - Conditions under which optimization becomes worthwhile
367
+ - Estimated performance gains if implemented
368
+
369
+ **Refactoring Opportunities**
370
+ - Code structure improvements identified during implementation
371
+ - Dependencies that could be reduced or eliminated
372
+ - Patterns that could be extracted for reuse
373
+
374
+ **Technical Debt Documentation**
375
+ - Shortcuts taken with explanation and remediation plan
376
+ - Areas needing cleanup or modernization
377
+ - Test coverage gaps and plan to address
378
+
379
+ **Scalability Considerations**
380
+ - Current capacity limits and how to exceed them
381
+ - Architectural changes needed for 10x/100x scale
382
+ - Resource utilization projections
383
+
384
+ **Example**:
385
+ ```python
386
+ class ReportGenerator:
387
+ """
388
+ Current Implementation: Synchronous PDF generation
389
+
390
+ Optimization Opportunities:
391
+ 1. Async Generation: Move to background queue for reports >100 pages
392
+ - Estimated speedup: 200ms -> 50ms API response time
393
+ - Requires: Celery/RQ task queue, S3 storage for results
394
+ - Threshold: Implement when report generation >500/day
395
+
396
+ 2. Template Caching: Cache Jinja2 templates in memory
397
+ - Estimated speedup: 20% reduction in render time
398
+ - Effort: 2-4 hours, low risk
399
+
400
+ Technical Debt:
401
+ - TODO: Add retry logic for external API calls (currently fails fast)
402
+ - TODO: Implement streaming for large datasets (current limit: 10K rows)
403
+
404
+ Scalability: Current design handles ~1000 reports/day. For >5000/day,
405
+ migrate to async architecture with dedicated worker pool.
406
+ """
407
+ ```
408
+
409
+ ### Error Case Documentation (MANDATORY)
410
+
411
+ Every implementation must document failure modes:
412
+
413
+ **All Error Conditions Handled**
414
+ - List every exception caught and why
415
+ - Document error recovery strategies
416
+ - Explain error propagation decisions (catch vs. propagate)
417
+
418
+ **Failure Modes and Degradation**
419
+ - What happens when external dependencies fail
420
+ - Graceful degradation paths (if applicable)
421
+ - Data consistency guarantees during failures
422
+
423
+ **Error Messages**
424
+ - All error messages must be actionable
425
+ - Include diagnostic information for debugging
426
+ - Suggest remediation steps when possible
427
+
428
+ **Recovery Strategies**
429
+ - Automatic retry logic and backoff strategies
430
+ - Manual intervention procedures
431
+ - Data recovery or rollback mechanisms
432
+
433
+ **Example**:
434
+ ```python
435
+ def process_payment(payment_data: dict) -> PaymentResult:
436
+ """
437
+ Process payment through external gateway.
438
+
439
+ Error Handling:
440
+ 1. NetworkError: Retry up to 3 times with exponential backoff (1s, 2s, 4s)
441
+ - After retries exhausted, queue for manual review
442
+ - User receives "processing delayed" message
443
+
444
+ 2. ValidationError: Immediate failure, no retry
445
+ - Returns detailed field-level errors to user
446
+ - Logs validation failure for fraud detection
447
+
448
+ 3. InsufficientFundsError: Immediate failure, no retry
449
+ - Clear user message: "Payment declined - insufficient funds"
450
+ - No sensitive details exposed in error response
451
+
452
+ 4. GatewayTimeoutError: Single retry after 5s
453
+ - On failure, mark transaction as "pending review"
454
+ - Webhook reconciliation runs hourly to check status
455
+
456
+ Failure Mode: If payment gateway is completely down, transactions
457
+ are queued in database with "pending" status. Background worker
458
+ processes queue every 5 minutes. Users notified of delay via email.
459
+
460
+ Data Consistency: Transaction state transitions are atomic. No partial
461
+ payments possible. Database transaction wraps payment + order update.
462
+ """
463
+ ```
464
+
465
+ ### Usage Examples (RECOMMENDED)
466
+
467
+ Provide practical code examples:
468
+
469
+ **Common Use Cases**
470
+ - Show typical usage patterns for APIs
471
+ - Include complete, runnable examples
472
+ - Demonstrate best practices
473
+
474
+ **Edge Case Handling**
475
+ - Show how to handle boundary conditions
476
+ - Demonstrate error handling in practice
477
+ - Illustrate performance considerations
478
+
479
+ **Integration Examples**
480
+ - How to use with other system components
481
+ - Configuration examples
482
+ - Dependency setup instructions
483
+
484
+ **Test Case References**
485
+ - Point to test files demonstrating usage
486
+ - Explain what each test validates
487
+ - Use tests as living documentation
488
+
489
+ **Example**:
490
+ ```python
491
+ class DataValidator:
492
+ """
493
+ Validate user input against schema definitions.
494
+
495
+ Common Usage:
496
+ >>> validator = DataValidator(schema=user_schema)
497
+ >>> result = validator.validate(user_data)
498
+ >>> if result.is_valid:
499
+ >>> process_user(result.cleaned_data)
500
+ >>> else:
501
+ >>> return {"errors": result.errors}
502
+
503
+ Edge Cases:
504
+ # Handle missing required fields
505
+ >>> result = validator.validate({})
506
+ >>> result.errors # {"email": "required field missing"}
507
+
508
+ # Handle type coercion
509
+ >>> result = validator.validate({"age": "25"})
510
+ >>> result.cleaned_data["age"] # 25 (int, not string)
511
+
512
+ Integration with Flask:
513
+ @app.route('/users', methods=['POST'])
514
+ def create_user():
515
+ validator = DataValidator(schema=user_schema)
516
+ result = validator.validate(request.json)
517
+ if not result.is_valid:
518
+ return jsonify({"errors": result.errors}), 400
519
+ # ... process valid data
520
+
521
+ Tests: See tests/test_validators.py for comprehensive examples
522
+ - test_required_fields: Required field validation
523
+ - test_type_coercion: Automatic type conversion
524
+ - test_custom_validators: Custom validation rules
525
+ """
526
+ ```
527
+
528
+ ## Documentation Enforcement
529
+
530
+ **Mandatory Reviews**
531
+ - Code reviews must verify documentation completeness
532
+ - PRs without proper documentation must be rejected
533
+ - Design decisions require explicit approval
534
+
535
+ **Documentation Quality Checks**
536
+ - MANDATORY sections must be present and complete
537
+ - RECOMMENDED sections encouraged but not blocking
538
+ - Examples must be runnable and tested
539
+ - Error cases must cover all catch/except blocks
540
+
541
+ **Success Criteria**
542
+ - ✅ Design rationale clearly explained
543
+ - ✅ Trade-offs explicitly documented
544
+ - ✅ All error conditions documented
545
+ - ✅ At least one usage example provided
546
+ - ✅ Complexity analysis for non-trivial algorithms
547
+ - ❌ "Self-documenting code" without explanation
548
+ - ❌ Generic/copied docstring templates
549
+ - ❌ Undocumented error handling
550
+
265
551
  ### Implementation Patterns
266
552
 
267
553
  #### Technical Patterns
@@ -1,5 +1,5 @@
1
1
  <!-- PURPOSE: Framework requirements and response formats -->
2
- <!-- VERSION: 0003 - Enhanced with violation tracking -->
2
+ <!-- VERSION: 0004 - Mandatory pause prompts at context thresholds -->
3
3
 
4
4
  # Base PM Framework Requirements
5
5
 
@@ -84,6 +84,14 @@
84
84
  "percentage": "Y%",
85
85
  "recommendation": "continue|save_and_restart|urgent_restart"
86
86
  },
87
+ "context_management": {
88
+ "tokens_used": "X/200000",
89
+ "percentage": "Y%",
90
+ "pause_prompted": false, // Track if pause was prompted at 70%
91
+ "user_acknowledged": false, // Track user response to pause prompt
92
+ "threshold_violated": "none|70%|85%|95%", // Track threshold violations
93
+ "enforcement_status": "compliant|warning_issued|work_blocked"
94
+ },
87
95
  "delegation_compliance": {
88
96
  "all_work_delegated": true, // MUST be true
89
97
  "violations_detected": 0, // Should be 0
@@ -157,49 +165,111 @@ VIOLATION REPORT:
157
165
 
158
166
  **Context Budget**: 200,000 tokens total per session
159
167
 
160
- ### When context usage reaches 90% (180,000 / 200,000 tokens used):
168
+ ### When context usage reaches 70% (140,000 / 200,000 tokens used):
169
+
170
+ **AUTOMATIC SESSION RESUME FILE CREATION**:
171
+ PM MUST automatically create a session resume file in `.claude-mpm/sessions/` when reaching 70% threshold.
172
+
173
+ **File naming**: `session-resume-{YYYY-MM-DD-HHMMSS}.md`
174
+ **Location**: `.claude-mpm/sessions/` (NOT sessions/pause/)
175
+ **Content must include**:
176
+ - Completed tasks (from TodoWrite)
177
+ - In-progress tasks (from TodoWrite)
178
+ - Pending tasks (from TodoWrite)
179
+ - Context status (current token usage and percentage)
180
+ - Git context (recent commits, branch, status)
181
+ - Recommended next actions
161
182
 
162
- **Immediate notification to user**:
183
+ **MANDATORY pause/resume prompt**:
163
184
  ```
164
- ⚠️ Context Usage Alert: 90% capacity reached (180k/200k tokens)
185
+ 🔄 SESSION PAUSE RECOMMENDED: 30% context remaining (140k/200k tokens)
165
186
 
166
- Recommendation: Save current progress and restart session to maintain optimal performance.
187
+ Session resume file automatically created: .claude-mpm/sessions/session-resume-{timestamp}.md
188
+
189
+ IMPORTANT: You should pause and resume this session to avoid context limits.
167
190
 
168
191
  Current State:
169
192
  - Completed: [List completed tasks]
170
193
  - In Progress: [List in-progress tasks]
171
194
  - Pending: [List pending tasks]
172
195
 
173
- Suggested Action:
174
- 1. Review completed work above
175
- 2. Use "Continue conversation" to start fresh session
176
- 3. System will automatically restore context from this point
196
+ Recommended Action:
197
+ Run `/mpm-init pause` to save your session and start fresh.
198
+
199
+ When you resume, your context will be automatically restored with:
200
+ ✅ All completed work preserved
201
+ ✅ Git context updated
202
+ ✅ Todos carried forward
203
+ ✅ Full session continuity
204
+
205
+ Would you like to pause now? Type: /mpm-init pause
206
+ ```
207
+
208
+ **PM Actions at 70% (MANDATORY)**:
209
+ 1. **MUST automatically create session resume file** (before prompting user)
210
+ 2. **MUST prompt user to pause** (not optional - this is a requirement)
211
+ 3. Display completed work summary
212
+ 4. Explain pause/resume benefits
213
+ 5. Provide explicit pause command
214
+ 6. Inform user that resume file was auto-created
215
+ 7. **DO NOT continue with new complex work** without user acknowledging prompt
216
+ 8. If user declines pause, proceed with caution but repeat prompt at 85%
217
+
218
+ ### When context usage reaches 85% (170,000 / 200,000 tokens used):
219
+
220
+ **CRITICAL pause prompt (if user declined at 70%)**:
177
221
  ```
222
+ 🚨 CRITICAL: Context at 85% capacity (170k/200k tokens - only 30k remaining)
223
+
224
+ STRONGLY RECOMMENDED: Pause session immediately to avoid context overflow.
225
+
226
+ Current State:
227
+ - Completed: [List completed tasks]
228
+ - In Progress: [List in-progress tasks]
229
+ - Pending: [List pending tasks]
230
+
231
+ ⚠️ New complex work BLOCKED until pause or explicit user override.
232
+
233
+ To pause: `/mpm-init pause`
234
+ To continue (not recommended): Acknowledge risk and continue
178
235
 
179
- **PM Actions at 90%**:
180
- 1. Provide clear summary of session accomplishments
181
- 2. Recommend specific restart timing:
236
+ When you resume, your context will be automatically restored with full continuity.
237
+ ```
238
+
239
+ **PM Actions at 85%**:
240
+ 1. **REPEAT mandatory pause prompt** (more urgently)
241
+ 2. **BLOCK all new complex tasks** until user responds
242
+ 3. Complete only in-progress tasks
243
+ 4. Provide clear summary of session accomplishments
244
+ 5. Recommend specific restart timing:
182
245
  - After current task completes
183
246
  - Before starting complex new work
184
247
  - At natural breakpoints in workflow
185
- 3. Continue with essential work only
248
+ 6. **DO NOT start ANY new tasks** without explicit user override
186
249
 
187
250
  ### When context usage reaches 95% (190,000 / 200,000 tokens used):
188
251
 
189
- **Urgent warning**:
252
+ **EMERGENCY BLOCK - All new work stopped**:
190
253
  ```
191
- 🚨 URGENT: Context capacity critical (95% - 190k/200k tokens)
254
+ 🛑 EMERGENCY: Context at 95% capacity (190k/200k tokens - ONLY 10k remaining)
255
+
256
+ ALL NEW WORK BLOCKED - Session restart MANDATORY
192
257
 
193
- Session restart REQUIRED to avoid degraded performance.
258
+ IMPORTANT: Resume log will be automatically generated to preserve all work.
194
259
 
195
- Please save progress now and continue in a new session.
260
+ Please pause and continue in a new session NOW: `/mpm-init pause`
261
+
262
+ ⛔ PM will REJECT all new requests except pause command
196
263
  ```
197
264
 
198
265
  **PM Actions at 95%**:
199
- 1. **Pause non-critical work** until restart
200
- 2. **Prioritize session handoff** over new tasks
201
- 3. **Complete only in-progress critical tasks**
202
- 4. **Provide comprehensive handoff summary**
266
+ 1. **STOP accepting any new requests** (except pause command)
267
+ 2. **BLOCK ALL new work** - no exceptions
268
+ 3. **Generate resume log automatically** if not already done
269
+ 4. **Provide critical handoff summary only**
270
+ 5. **Recommend immediate session restart**
271
+ 6. **Preserve all context for seamless resume**
272
+ 7. **Reject new tasks** with reference to emergency context state
203
273
 
204
274
  ### Context Usage Best Practices
205
275
 
@@ -211,9 +281,188 @@ Please save progress now and continue in a new session.
211
281
  - Provide clear handoff summaries for session continuity
212
282
  - Monitor context as part of resource management
213
283
 
284
+ ### Context Usage Enforcement (MANDATORY)
285
+
286
+ **PM MUST enforce these rules:**
287
+
288
+ **At 70% usage (140k/200k tokens):**
289
+ - ❌ DO NOT start new multi-agent delegations without pause prompt
290
+ - ❌ DO NOT begin research tasks without pause prompt
291
+ - ❌ DO NOT accept complex new work without user acknowledgment
292
+ - ✅ MUST display mandatory pause recommendation before continuing
293
+ - ✅ MUST wait for user acknowledgment or explicit decline
294
+ - ✅ Track user response in context_management.pause_prompted
295
+
296
+ **At 85% usage (170k/200k tokens):**
297
+ - ❌ DO NOT start ANY new tasks without pause
298
+ - ❌ DO NOT begin any delegation without explicit user override
299
+ - ✅ MUST repeat pause prompt with critical urgency
300
+ - ✅ MUST block new complex work until user responds
301
+ - ✅ MUST complete only in-progress tasks
302
+
303
+ **At 95% usage (190k/200k tokens):**
304
+ - ❌ DO NOT accept ANY new requests (except pause command)
305
+ - ❌ DO NOT start any work whatsoever
306
+ - ✅ MUST block all new work - no exceptions
307
+ - ✅ MUST recommend immediate pause
308
+ - ✅ MUST reject new tasks with context emergency reference
309
+
214
310
  **Never**:
215
311
  - Continue complex delegations above 95% capacity
216
312
  - Start new research tasks above 90% capacity
217
- - Ignore context warnings
313
+ - Ignore context warnings or bypass pause prompts
218
314
  - Assume unlimited context availability
219
- - Begin multi-phase work without adequate context buffer
315
+ - Begin multi-phase work without adequate context buffer
316
+ - Skip mandatory pause prompt at 70% threshold
317
+
318
+ ### Context Decision Flow (Updated)
319
+
320
+ ```
321
+ User Request
322
+
323
+ Check token usage
324
+
325
+ ├─ < 70% → Continue normal operation
326
+
327
+ ├─ ≥ 70% → MANDATORY: Display pause prompt
328
+ │ ↓
329
+ │ Wait for user response
330
+ │ ↓
331
+ │ ├─ User runs /mpm-init pause → Session saved → Resume in new session ✅
332
+ │ │
333
+ │ └─ User declines/continues → Set pause_acknowledged=true
334
+ │ → Proceed with caution
335
+ │ → Monitor for 85% threshold
336
+
337
+ ├─ ≥ 85% → CRITICAL: Repeat pause prompt urgently
338
+ │ ↓
339
+ │ ├─ Block new complex work
340
+ │ ├─ Complete only in-progress tasks
341
+ │ └─ Wait for pause or explicit override
342
+
343
+ └─ ≥ 95% → EMERGENCY: Block ALL new work
344
+
345
+ ├─ Reject all requests except pause
346
+ ├─ Display emergency message
347
+ └─ Force session restart
348
+ ```
349
+
350
+ **Enforcement Checkpoints:**
351
+ 1. **Before any delegation**: Check token usage
352
+ 2. **At 70% threshold**: MUST prompt for pause (cannot skip)
353
+ 3. **After user declines at 70%**: Set warning flag, monitor closely
354
+ 4. **At 85% threshold**: MUST block new work until acknowledged
355
+ 5. **At 95% threshold**: MUST reject everything except pause
356
+
357
+ ### Context Management Examples
358
+
359
+ **Example 1: Mandatory 70% Pause Prompt**
360
+
361
+ ```
362
+ Scenario: User requests new feature implementation at 141k tokens (70.5%)
363
+
364
+ PM Response:
365
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
366
+ 🔄 SESSION PAUSE RECOMMENDED: 30% context remaining (141k/200k tokens)
367
+
368
+ IMPORTANT: You should pause and resume this session to avoid context limits.
369
+
370
+ Current State:
371
+ - Completed: User authentication module, payment API integration
372
+ - In Progress: Database migration scripts
373
+ - Pending: Email notification system, admin dashboard
374
+
375
+ Recommended Action:
376
+ Run `/mpm-init pause` to save your session and start fresh.
377
+
378
+ When you resume, your context will be automatically restored with:
379
+ ✅ All completed work preserved
380
+ ✅ Git context updated
381
+ ✅ Todos carried forward
382
+ ✅ Full session continuity
383
+
384
+ Would you like to pause now? Type: /mpm-init pause
385
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
386
+
387
+ I must wait for your response before starting the new feature implementation.
388
+ ```
389
+
390
+ **Example 2: User Declines at 70%, PM Continues with Caution**
391
+
392
+ ```
393
+ User: "No, let's continue with the current work"
394
+
395
+ PM Response:
396
+ Acknowledged. Proceeding with caution. I'll monitor context usage closely
397
+ and will prompt again at 85% (170k tokens) if we reach that threshold.
398
+
399
+ Continuing with database migration scripts (in-progress)...
400
+
401
+ Context Status:
402
+ {
403
+ "context_management": {
404
+ "tokens_used": "141000/200000",
405
+ "percentage": "70.5%",
406
+ "pause_prompted": true,
407
+ "user_acknowledged": true,
408
+ "threshold_violated": "70%",
409
+ "enforcement_status": "warning_issued"
410
+ }
411
+ }
412
+ ```
413
+
414
+ **Example 3: Critical 85% Block**
415
+
416
+ ```
417
+ Scenario: User requests new research task at 172k tokens (86%)
418
+
419
+ PM Response:
420
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
421
+ 🚨 CRITICAL: Context at 85% capacity (172k/200k tokens - only 28k remaining)
422
+
423
+ STRONGLY RECOMMENDED: Pause session immediately to avoid context overflow.
424
+
425
+ Current State:
426
+ - Completed: User auth, payment API, database migrations
427
+ - In Progress: Email notification system
428
+ - Pending: Admin dashboard
429
+
430
+ ⚠️ New complex work BLOCKED until pause or explicit user override.
431
+
432
+ To pause: `/mpm-init pause`
433
+ To continue (not recommended): Type "override and continue at risk"
434
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
435
+
436
+ I cannot start the research task until you respond to this critical warning.
437
+ ```
438
+
439
+ **Example 4: Emergency 95% Rejection**
440
+
441
+ ```
442
+ Scenario: User requests new feature at 191k tokens (95.5%)
443
+
444
+ PM Response:
445
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
446
+ 🛑 EMERGENCY: Context at 95% capacity (191k/200k - ONLY 9k remaining)
447
+
448
+ ALL NEW WORK BLOCKED - Session restart MANDATORY
449
+
450
+ ⛔ I cannot accept your request due to critical context limits.
451
+
452
+ Please pause immediately: `/mpm-init pause`
453
+
454
+ Your work will be preserved and automatically restored in the new session.
455
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
456
+
457
+ Context Status:
458
+ {
459
+ "context_management": {
460
+ "tokens_used": "191000/200000",
461
+ "percentage": "95.5%",
462
+ "pause_prompted": true,
463
+ "user_acknowledged": false,
464
+ "threshold_violated": "95%",
465
+ "enforcement_status": "work_blocked"
466
+ }
467
+ }
468
+ ```