claude-mpm 5.1.9__py3-none-any.whl → 5.4.48__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 (248) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/__init__.py +4 -0
  3. claude_mpm/agents/BASE_AGENT.md +164 -0
  4. claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +1 -1
  5. claude_mpm/agents/MEMORY.md +1 -1
  6. claude_mpm/agents/PM_INSTRUCTIONS.md +843 -900
  7. claude_mpm/agents/WORKFLOW.md +5 -254
  8. claude_mpm/agents/agent_loader.py +13 -44
  9. claude_mpm/agents/base_agent.json +1 -1
  10. claude_mpm/agents/frontmatter_validator.py +2 -2
  11. claude_mpm/agents/templates/circuit-breakers.md +138 -1
  12. claude_mpm/cli/__main__.py +4 -0
  13. claude_mpm/cli/chrome_devtools_installer.py +175 -0
  14. claude_mpm/cli/commands/agent_state_manager.py +18 -27
  15. claude_mpm/cli/commands/agents.py +9 -40
  16. claude_mpm/cli/commands/auto_configure.py +210 -25
  17. claude_mpm/cli/commands/config.py +88 -2
  18. claude_mpm/cli/commands/configure.py +1098 -159
  19. claude_mpm/cli/commands/configure_agent_display.py +25 -6
  20. claude_mpm/cli/commands/mpm_init/core.py +225 -46
  21. claude_mpm/cli/commands/mpm_init/knowledge_extractor.py +481 -0
  22. claude_mpm/cli/commands/mpm_init/prompts.py +280 -0
  23. claude_mpm/cli/commands/postmortem.py +1 -1
  24. claude_mpm/cli/commands/profile.py +277 -0
  25. claude_mpm/cli/commands/skills.py +218 -197
  26. claude_mpm/cli/commands/summarize.py +413 -0
  27. claude_mpm/cli/executor.py +21 -3
  28. claude_mpm/cli/interactive/agent_wizard.py +2 -2
  29. claude_mpm/cli/parsers/agents_parser.py +0 -9
  30. claude_mpm/cli/parsers/auto_configure_parser.py +0 -138
  31. claude_mpm/cli/parsers/base_parser.py +12 -0
  32. claude_mpm/cli/parsers/config_parser.py +153 -83
  33. claude_mpm/cli/parsers/profile_parser.py +148 -0
  34. claude_mpm/cli/parsers/skills_parser.py +0 -5
  35. claude_mpm/cli/startup.py +876 -149
  36. claude_mpm/commands/mpm-config.md +28 -0
  37. claude_mpm/commands/mpm-doctor.md +9 -22
  38. claude_mpm/commands/mpm-help.md +5 -287
  39. claude_mpm/commands/mpm-init.md +81 -507
  40. claude_mpm/commands/mpm-monitor.md +15 -402
  41. claude_mpm/commands/mpm-organize.md +120 -0
  42. claude_mpm/commands/mpm-postmortem.md +6 -108
  43. claude_mpm/commands/mpm-session-resume.md +12 -363
  44. claude_mpm/commands/mpm-status.md +5 -69
  45. claude_mpm/commands/mpm-ticket-view.md +52 -495
  46. claude_mpm/commands/mpm-version.md +5 -107
  47. claude_mpm/config/agent_sources.py +27 -0
  48. claude_mpm/core/config.py +2 -4
  49. claude_mpm/core/framework/formatters/content_formatter.py +3 -13
  50. claude_mpm/core/framework/loaders/agent_loader.py +8 -5
  51. claude_mpm/core/framework/loaders/instruction_loader.py +52 -11
  52. claude_mpm/core/framework_loader.py +4 -2
  53. claude_mpm/core/logger.py +13 -0
  54. claude_mpm/core/optimized_startup.py +59 -0
  55. claude_mpm/core/shared/config_loader.py +1 -1
  56. claude_mpm/core/socketio_pool.py +3 -3
  57. claude_mpm/core/unified_agent_registry.py +5 -15
  58. claude_mpm/dashboard/static/svelte-build/_app/env.js +1 -0
  59. claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/0.B_FtCwCQ.css +1 -0
  60. claude_mpm/dashboard/static/svelte-build/_app/immutable/assets/2.Cl_eSA4x.css +1 -0
  61. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/BgChzWQ1.js +1 -0
  62. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CIXEwuWe.js +1 -0
  63. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/CWc5urbQ.js +1 -0
  64. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DMkZpdF2.js +2 -0
  65. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/DjhvlsAc.js +1 -0
  66. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/N4qtv3Hx.js +2 -0
  67. claude_mpm/dashboard/static/svelte-build/_app/immutable/chunks/uj46x2Wr.js +1 -0
  68. claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/app.DTL5mJO-.js +2 -0
  69. claude_mpm/dashboard/static/svelte-build/_app/immutable/entry/start.DzuEhzqh.js +1 -0
  70. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/0.CAGBuiOw.js +1 -0
  71. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/1.DFLC8jdE.js +1 -0
  72. claude_mpm/dashboard/static/svelte-build/_app/immutable/nodes/2.DPvEihJJ.js +10 -0
  73. claude_mpm/dashboard/static/svelte-build/_app/version.json +1 -0
  74. claude_mpm/dashboard/static/svelte-build/favicon.svg +7 -0
  75. claude_mpm/dashboard/static/svelte-build/index.html +36 -0
  76. claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
  77. claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
  78. claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
  79. claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
  80. claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
  81. claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
  82. claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
  83. claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
  84. claude_mpm/hooks/claude_hooks/correlation_manager.py +60 -0
  85. claude_mpm/hooks/claude_hooks/event_handlers.py +211 -78
  86. claude_mpm/hooks/claude_hooks/hook_handler.py +155 -1
  87. claude_mpm/hooks/claude_hooks/installer.py +33 -10
  88. claude_mpm/hooks/claude_hooks/memory_integration.py +26 -9
  89. claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
  90. claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
  91. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager.cpython-311.pyc +0 -0
  92. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
  93. claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
  94. claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
  95. claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
  96. claude_mpm/hooks/claude_hooks/services/connection_manager.py +30 -6
  97. claude_mpm/hooks/kuzu_memory_hook.py +5 -5
  98. claude_mpm/hooks/memory_integration_hook.py +46 -1
  99. claude_mpm/init.py +63 -19
  100. claude_mpm/models/git_repository.py +3 -3
  101. claude_mpm/scripts/claude-hook-handler.sh +58 -18
  102. claude_mpm/scripts/launch_monitor.py +93 -13
  103. claude_mpm/services/agents/agent_builder.py +3 -3
  104. claude_mpm/services/agents/agent_recommendation_service.py +278 -0
  105. claude_mpm/services/agents/agent_review_service.py +280 -0
  106. claude_mpm/services/agents/cache_git_manager.py +6 -6
  107. claude_mpm/services/agents/deployment/agent_deployment.py +29 -7
  108. claude_mpm/services/agents/deployment/agent_discovery_service.py +4 -5
  109. claude_mpm/services/agents/deployment/agent_format_converter.py +23 -13
  110. claude_mpm/services/agents/deployment/agent_template_builder.py +32 -20
  111. claude_mpm/services/agents/deployment/agents_directory_resolver.py +2 -2
  112. claude_mpm/services/agents/deployment/async_agent_deployment.py +31 -27
  113. claude_mpm/services/agents/deployment/local_template_deployment.py +3 -1
  114. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +247 -35
  115. claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +392 -87
  116. claude_mpm/services/agents/git_source_manager.py +53 -4
  117. claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
  118. claude_mpm/services/agents/recommender.py +5 -3
  119. claude_mpm/services/agents/single_tier_deployment_service.py +2 -2
  120. claude_mpm/services/agents/sources/git_source_sync_service.py +120 -7
  121. claude_mpm/services/agents/startup_sync.py +22 -2
  122. claude_mpm/services/agents/toolchain_detector.py +10 -6
  123. claude_mpm/services/analysis/__init__.py +11 -1
  124. claude_mpm/services/analysis/clone_detector.py +1030 -0
  125. claude_mpm/services/command_deployment_service.py +81 -10
  126. claude_mpm/services/diagnostics/checks/agent_check.py +2 -2
  127. claude_mpm/services/diagnostics/checks/agent_sources_check.py +1 -1
  128. claude_mpm/services/event_bus/config.py +3 -1
  129. claude_mpm/services/git/git_operations_service.py +101 -16
  130. claude_mpm/services/monitor/daemon.py +9 -2
  131. claude_mpm/services/monitor/daemon_manager.py +39 -3
  132. claude_mpm/services/monitor/management/lifecycle.py +8 -1
  133. claude_mpm/services/monitor/server.py +698 -22
  134. claude_mpm/services/pm_skills_deployer.py +711 -0
  135. claude_mpm/services/profile_manager.py +331 -0
  136. claude_mpm/services/self_upgrade_service.py +120 -12
  137. claude_mpm/services/skills/__init__.py +3 -0
  138. claude_mpm/services/skills/git_skill_source_manager.py +130 -2
  139. claude_mpm/services/skills/selective_skill_deployer.py +704 -0
  140. claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
  141. claude_mpm/services/skills_deployer.py +127 -9
  142. claude_mpm/services/socketio/dashboard_server.py +1 -0
  143. claude_mpm/services/socketio/event_normalizer.py +51 -6
  144. claude_mpm/services/socketio/server/core.py +386 -108
  145. claude_mpm/services/version_control/git_operations.py +103 -0
  146. claude_mpm/skills/skill_manager.py +92 -3
  147. claude_mpm/utils/agent_dependency_loader.py +14 -2
  148. claude_mpm/utils/agent_filters.py +17 -44
  149. claude_mpm/utils/migration.py +4 -4
  150. claude_mpm/utils/robust_installer.py +47 -3
  151. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.48.dist-info}/METADATA +53 -87
  152. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.48.dist-info}/RECORD +157 -197
  153. claude_mpm-5.4.48.dist-info/entry_points.txt +5 -0
  154. claude_mpm-5.4.48.dist-info/licenses/LICENSE +94 -0
  155. claude_mpm-5.4.48.dist-info/licenses/LICENSE-FAQ.md +153 -0
  156. claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
  157. claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
  158. claude_mpm/agents/BASE_OPS.md +0 -219
  159. claude_mpm/agents/BASE_PM.md +0 -480
  160. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
  161. claude_mpm/agents/BASE_QA.md +0 -167
  162. claude_mpm/agents/BASE_RESEARCH.md +0 -53
  163. claude_mpm/agents/base_agent_loader.py +0 -601
  164. claude_mpm/cli/commands/agents_detect.py +0 -380
  165. claude_mpm/cli/commands/agents_recommend.py +0 -309
  166. claude_mpm/cli/ticket_cli.py +0 -35
  167. claude_mpm/commands/mpm-agents-auto-configure.md +0 -278
  168. claude_mpm/commands/mpm-agents-detect.md +0 -177
  169. claude_mpm/commands/mpm-agents-list.md +0 -131
  170. claude_mpm/commands/mpm-agents-recommend.md +0 -223
  171. claude_mpm/commands/mpm-config-view.md +0 -150
  172. claude_mpm/commands/mpm-ticket-organize.md +0 -304
  173. claude_mpm/dashboard/analysis_runner.py +0 -455
  174. claude_mpm/dashboard/index.html +0 -13
  175. claude_mpm/dashboard/open_dashboard.py +0 -66
  176. claude_mpm/dashboard/static/css/activity.css +0 -1958
  177. claude_mpm/dashboard/static/css/connection-status.css +0 -370
  178. claude_mpm/dashboard/static/css/dashboard.css +0 -4701
  179. claude_mpm/dashboard/static/js/components/activity-tree.js +0 -1871
  180. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +0 -777
  181. claude_mpm/dashboard/static/js/components/agent-inference.js +0 -956
  182. claude_mpm/dashboard/static/js/components/build-tracker.js +0 -333
  183. claude_mpm/dashboard/static/js/components/code-simple.js +0 -857
  184. claude_mpm/dashboard/static/js/components/connection-debug.js +0 -654
  185. claude_mpm/dashboard/static/js/components/diff-viewer.js +0 -891
  186. claude_mpm/dashboard/static/js/components/event-processor.js +0 -542
  187. claude_mpm/dashboard/static/js/components/event-viewer.js +0 -1155
  188. claude_mpm/dashboard/static/js/components/export-manager.js +0 -368
  189. claude_mpm/dashboard/static/js/components/file-change-tracker.js +0 -443
  190. claude_mpm/dashboard/static/js/components/file-change-viewer.js +0 -690
  191. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +0 -724
  192. claude_mpm/dashboard/static/js/components/file-viewer.js +0 -580
  193. claude_mpm/dashboard/static/js/components/hud-library-loader.js +0 -211
  194. claude_mpm/dashboard/static/js/components/hud-manager.js +0 -671
  195. claude_mpm/dashboard/static/js/components/hud-visualizer.js +0 -1718
  196. claude_mpm/dashboard/static/js/components/module-viewer.js +0 -2764
  197. claude_mpm/dashboard/static/js/components/session-manager.js +0 -579
  198. claude_mpm/dashboard/static/js/components/socket-manager.js +0 -368
  199. claude_mpm/dashboard/static/js/components/ui-state-manager.js +0 -749
  200. claude_mpm/dashboard/static/js/components/unified-data-viewer.js +0 -1824
  201. claude_mpm/dashboard/static/js/components/working-directory.js +0 -920
  202. claude_mpm/dashboard/static/js/connection-manager.js +0 -536
  203. claude_mpm/dashboard/static/js/dashboard.js +0 -1914
  204. claude_mpm/dashboard/static/js/extension-error-handler.js +0 -164
  205. claude_mpm/dashboard/static/js/socket-client.js +0 -1474
  206. claude_mpm/dashboard/static/js/tab-isolation-fix.js +0 -185
  207. claude_mpm/dashboard/static/socket.io.min.js +0 -7
  208. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +0 -7
  209. claude_mpm/dashboard/templates/code_simple.html +0 -153
  210. claude_mpm/dashboard/templates/index.html +0 -606
  211. claude_mpm/dashboard/test_dashboard.html +0 -372
  212. claude_mpm/scripts/mcp_server.py +0 -75
  213. claude_mpm/scripts/mcp_wrapper.py +0 -39
  214. claude_mpm/services/mcp_gateway/__init__.py +0 -159
  215. claude_mpm/services/mcp_gateway/auto_configure.py +0 -369
  216. claude_mpm/services/mcp_gateway/config/__init__.py +0 -17
  217. claude_mpm/services/mcp_gateway/config/config_loader.py +0 -296
  218. claude_mpm/services/mcp_gateway/config/config_schema.py +0 -243
  219. claude_mpm/services/mcp_gateway/config/configuration.py +0 -429
  220. claude_mpm/services/mcp_gateway/core/__init__.py +0 -43
  221. claude_mpm/services/mcp_gateway/core/base.py +0 -312
  222. claude_mpm/services/mcp_gateway/core/exceptions.py +0 -253
  223. claude_mpm/services/mcp_gateway/core/interfaces.py +0 -443
  224. claude_mpm/services/mcp_gateway/core/process_pool.py +0 -977
  225. claude_mpm/services/mcp_gateway/core/singleton_manager.py +0 -315
  226. claude_mpm/services/mcp_gateway/core/startup_verification.py +0 -316
  227. claude_mpm/services/mcp_gateway/main.py +0 -589
  228. claude_mpm/services/mcp_gateway/registry/__init__.py +0 -12
  229. claude_mpm/services/mcp_gateway/registry/service_registry.py +0 -412
  230. claude_mpm/services/mcp_gateway/registry/tool_registry.py +0 -489
  231. claude_mpm/services/mcp_gateway/server/__init__.py +0 -15
  232. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +0 -414
  233. claude_mpm/services/mcp_gateway/server/stdio_handler.py +0 -372
  234. claude_mpm/services/mcp_gateway/server/stdio_server.py +0 -712
  235. claude_mpm/services/mcp_gateway/tools/__init__.py +0 -36
  236. claude_mpm/services/mcp_gateway/tools/base_adapter.py +0 -485
  237. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +0 -789
  238. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +0 -654
  239. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +0 -456
  240. claude_mpm/services/mcp_gateway/tools/hello_world.py +0 -551
  241. claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +0 -555
  242. claude_mpm/services/mcp_gateway/utils/__init__.py +0 -14
  243. claude_mpm/services/mcp_gateway/utils/package_version_checker.py +0 -160
  244. claude_mpm/services/mcp_gateway/utils/update_preferences.py +0 -170
  245. claude_mpm-5.1.9.dist-info/entry_points.txt +0 -10
  246. claude_mpm-5.1.9.dist-info/licenses/LICENSE +0 -21
  247. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.48.dist-info}/WHEEL +0 -0
  248. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.48.dist-info}/top_level.txt +0 -0
@@ -4,543 +4,117 @@ command: init
4
4
  aliases: [mpm-init]
5
5
  migration_target: /mpm/system:init
6
6
  category: system
7
- deprecated_aliases: []
8
- description: Initialize or update project for Claude Code and Claude MPM
7
+ description: Initialize or update project for Claude Code and MPM
9
8
  ---
10
- # /mpm-init [update]
9
+ # /mpm-init
11
10
 
12
- Initialize or intelligently update your project for optimal use with Claude Code and Claude MPM using the Agentic Coder Optimizer agent.
11
+ Initialize or intelligently update project for Claude Code and Claude MPM.
13
12
 
14
13
  ## Usage
15
-
16
14
  ```
17
- /mpm-init # Auto-detects and offers update or create
18
- /mpm-init update # Lightweight update based on recent git activity
19
- /mpm-init context # Intelligent context analysis from git history
20
- /mpm-init context --days 14 # Analyze last 14 days of git history
21
- /mpm-init resume # Resume from stop event logs (NEW)
22
- /mpm-init resume --list # List all sessions from logs
23
- /mpm-init resume --session-id ID # Resume specific session
24
- /mpm-init catchup # Quick commit history display (no analysis)
25
- /mpm-init --review # Review project state without changes
26
- /mpm-init --update # Full update of existing CLAUDE.md
27
- /mpm-init --organize # Organize project structure
28
- /mpm-init --force # Force recreate from scratch
29
- /mpm-init --project-type web --framework react
30
- /mpm-init --ast-analysis --comprehensive
15
+ /mpm-init [update|context|resume|catchup] [options]
31
16
  ```
32
17
 
33
- ## Description
34
-
35
- This command has two primary modes:
36
- - **Project initialization/updates**: Delegates to the Agentic Coder Optimizer agent for documentation, tooling, and workflow setup
37
- - **Context analysis** (context/catchup): Provides intelligent project context from git history for resuming work
38
-
39
- **Resume Modes**: The command provides two resume capabilities:
40
- - `/mpm-init resume`: Reads stop event logs from `.claude-mpm/responses/` to help resume work
41
- - `/mpm-init context`: Analyzes git history for intelligent work resumption (delegates to Research agent)
42
-
43
- **Quick Update Mode**: Running `/mpm-init update` performs a lightweight update focused on recent git activity. It analyzes recent commits, generates an activity report, and updates documentation with minimal changes. Perfect for quick refreshes after development sprints.
44
-
45
- **Smart Update Mode**: When CLAUDE.md exists, the command automatically offers to update rather than recreate, preserving your custom content while refreshing standard sections. Previous versions are archived in `docs/_archive/` for safety.
46
-
47
- ## Features
48
-
49
- - **📚 Comprehensive CLAUDE.md**: Creates AI-optimized project documentation
50
- - **🎯 Priority-based Organization**: Ranks instructions by importance (🔴🟡🟢⚪)
51
- - **🔍 AST Analysis**: Deep code structure analysis for enhanced documentation
52
- - **🚀 Single-path Workflows**: Establishes ONE way to do ANYTHING
53
- - **🧠 Memory System**: Initializes project knowledge retention
54
- - **🔧 Tool Configuration**: Sets up linting, formatting, testing
55
- - **📝 Holistic Review**: Final organization and validation pass
56
- - **🔒 GitIgnore Management**: Automatically excludes claude-mpm config directories
57
-
58
- ## Options
18
+ ## Core Modes
59
19
 
60
- ### Mode Options
61
- - `--review`: Review project state without making changes
62
- - `--update`: Update existing CLAUDE.md instead of recreating
63
- - `--force`: Force reinitialization even if project is already configured
64
-
65
- ### Configuration Options
66
- - `--project-type [type]`: Specify project type (web, api, cli, library, etc.)
67
- - `--framework [name]`: Specify framework (react, vue, django, fastapi, etc.)
68
- - `--ast-analysis`: Enable AST analysis for enhanced documentation (default: enabled)
69
- - `--no-ast-analysis`: Disable AST analysis for faster initialization
70
- - `--comprehensive`: Create comprehensive setup including CI/CD and deployment
71
- - `--minimal`: Create minimal configuration (CLAUDE.md only)
72
-
73
- ### Organization Options
74
- - `--organize`: Organize misplaced files into proper directories
75
- - `--preserve-custom`: Preserve custom sections when updating (default)
76
- - `--no-preserve-custom`: Don't preserve custom sections
77
- - `--skip-archive`: Skip archiving existing files before updating
78
-
79
- ## Context Analysis
80
-
81
- **Purpose**: Provide intelligent project context for resuming work by analyzing git history.
82
-
83
- ### Commands
84
-
85
- #### `/mpm-init context` (Primary)
86
- ```bash
87
- /mpm-init context # Analyze last 7 days of git history
88
- /mpm-init context --days 14 # Analyze last 14 days
20
+ ### Project Setup
89
21
  ```
90
-
91
- Analyzes recent git commits to identify:
92
- - **Active work streams**: What was being worked on (themes from commit patterns)
93
- - **Intent and motivation**: Why this work matters (from commit messages)
94
- - **Risks and blockers**: What needs attention (stalled work, conflicts, anti-patterns)
95
- - **Recommended next actions**: What to work on next (logical continuations)
96
-
97
- **How it works**:
98
- 1. Parses git history (default: last 7 days)
99
- 2. PM delegates to Research agent with structured prompt
100
- 3. Research analyzes work streams, intent, risks, recommendations
101
- 4. PM presents intelligent summary for seamless work resumption
102
-
103
- **NOT session state**: This does NOT save/restore conversation state like Claude Code. Instead, it reconstructs project context from git history using conventional commits and commit message analysis.
104
-
105
- #### `/mpm-init resume` (Stop Event Logs)
106
- ```bash
107
- /mpm-init resume # Show latest session from logs
108
- /mpm-init resume --list # List all sessions
109
- /mpm-init resume --session-id ID # Resume specific session
110
- /mpm-init resume --last 5 # Show last 5 sessions
111
- ```
112
-
113
- Reads from stop event logs to help resume work from previous sessions:
114
-
115
- **Data Sources** (two-tier strategy):
116
- 1. **Resume logs** (preferred): `.claude-mpm/resume-logs/*.md` - Structured 10k-token summaries
117
- 2. **Response logs** (fallback): `.claude-mpm/responses/*.json` - Raw conversation stop events
118
-
119
- **What it shows**:
120
- - When session ended (time ago)
121
- - What was being worked on (request)
122
- - Tasks completed (from PM responses)
123
- - Files modified (from PM tracking)
124
- - Next steps (from PM recommendations)
125
- - Stop reason (why session ended)
126
- - Token usage (context consumption)
127
- - Git context (branch, working directory)
128
-
129
- **How it works**:
130
- 1. Scans response logs in `.claude-mpm/responses/`
131
- 2. Groups by `session_id`
132
- 3. Parses PM response JSON for context
133
- 4. Extracts tasks, files, next steps from PM summaries
134
- 5. Displays comprehensive resume context
135
-
136
- **Use Cases**:
137
- - Resume work after context threshold pause
138
- - Review what was accomplished in previous session
139
- - Understand why session stopped (max_tokens, end_turn, etc.)
140
- - See exact files and tasks from last session
141
-
142
- **Difference from `context`**:
143
- - **resume**: Reads actual stop event logs (what PM logged)
144
- - **context**: Analyzes git commits (what was committed)
145
-
146
- ### `/mpm-init catchup` (Simple Git History)
147
- ```bash
148
- /mpm-init catchup
149
- ```
150
-
151
- Quick display of last 25 commits across all branches. No analysis - just raw git log output with authors and dates. Use this for quick "what happened recently?" checks.
152
-
153
- **Distinction**:
154
- - **catchup**: Quick commit history (instant, no analysis)
155
- - **context**: Intelligent work resumption (10-30s, deep analysis)
156
-
157
- ## What This Command Does
158
-
159
- ### Auto-Detection (NEW)
160
- When run without flags and CLAUDE.md exists:
161
- 1. Analyzes existing documentation
162
- 2. Shows current status (size, sections, priority markers)
163
- 3. Offers options:
164
- - Update (smart merge)
165
- - Recreate (fresh start)
166
- - Review (analysis only)
167
- - Cancel
168
-
169
- ### 1. Project Analysis
170
- - Scans project structure and existing configurations
171
- - Identifies project type, language, and frameworks
172
- - Checks for existing documentation and tooling
173
-
174
- ### 2. CLAUDE.md Creation/Update
175
- The command creates a well-organized CLAUDE.md with:
176
-
177
- ```markdown
178
- ## 🎯 Priority Index
179
- ### 🔴 CRITICAL Instructions
180
- - Security rules, data handling, core business logic
181
-
182
- ### 🟡 IMPORTANT Instructions
183
- - Key workflows, architecture decisions
184
-
185
- ### 🟢 STANDARD Instructions
186
- - Common operations, coding standards
187
-
188
- ### ⚪ OPTIONAL Instructions
189
- - Nice-to-have features, future enhancements
22
+ /mpm-init # Auto-detect: offer update or create
23
+ /mpm-init update # Quick update (30-day git activity)
24
+ /mpm-init --update # Full documentation refresh
25
+ /mpm-init --force # Force recreate from scratch
190
26
  ```
191
27
 
192
- ### 3. Single-Path Standards
193
- - ONE command for building: `make build`
194
- - ONE command for testing: `make test`
195
- - ONE command for deployment: `make deploy`
196
- - Clear documentation of THE way to do things
197
-
198
- ### 4. AST Analysis (Optional)
199
- When enabled, performs:
200
- - Code structure extraction (classes, functions, methods)
201
- - API documentation generation
202
- - Architecture diagram creation
203
- - Function signature and dependency mapping
204
- - Creates DEVELOPER.md with technical details
205
- - Adds CODE_STRUCTURE.md with AST insights
206
-
207
- ### 5. Tool Configuration
208
- - Linting setup and configuration
209
- - Code formatting standards
210
- - Testing framework setup
211
- - Pre-commit hooks if needed
212
-
213
- ### 6. Memory System
214
- - Creates `.claude-mpm/memories/` directory
215
- - Initializes memory files for project knowledge
216
- - Documents memory usage patterns
217
-
218
- ### 7. GitIgnore Management (Automatic)
219
- During initialization:
220
- - **Automatic Updates**: Adds `.claude-mpm/` and `.claude/agents/` to `.gitignore`
221
- - **Smart Detection**: Skips entries that already exist (no duplicates)
222
- - **Safe Operation**: Creates `.gitignore` if missing, preserves existing content
223
- - **Non-Blocking**: Continues initialization even if `.gitignore` update fails
224
-
225
- **Entries Added**:
226
- - `.claude-mpm/`: Configuration directory (sessions, logs, etc.)
227
- - `.claude/agents/`: Agent runtime files
228
-
229
- This ensures claude-mpm configuration files never get committed to version control.
230
-
231
- ### 8. Holistic Organization (Final Step)
232
- After all tasks, performs a comprehensive review:
233
- - Reorganizes content by priority
234
- - Validates completeness
235
- - Ensures single-path principle
236
- - Adds meta-instructions for maintenance
28
+ **Delegates to Agentic Coder Optimizer agent** for:
29
+ - CLAUDE.md creation/update (with priority rankings 🔴🟡🟢⚪)
30
+ - AST analysis and code structure docs
31
+ - Single-path workflows (ONE way to do ANYTHING)
32
+ - Tool configuration, memory system, gitignore management
237
33
 
238
- ### 9. Update Mode Features (NEW)
239
- When updating existing documentation:
240
- - **Smart Merging**: Intelligently merges new content with existing
241
- - **Custom Preservation**: Keeps your project-specific sections
242
- - **Automatic Archival**: Backs up previous version to `docs/_archive/`
243
- - **Conflict Resolution**: Removes duplicate or contradictory information
244
- - **Change Tracking**: Shows what was updated after completion
34
+ **Smart Update Mode:** Auto-detects existing CLAUDE.md and offers update vs recreate.
245
35
 
246
- ## Examples
247
-
248
- ### Smart Auto-Detection (Recommended)
249
- ```bash
250
- /mpm-init
36
+ ### Context Analysis
251
37
  ```
252
- Analyzes project and offers appropriate action (create/update/review).
253
-
254
- ### Quick Update (Lightweight)
255
- ```bash
256
- /mpm-init update
38
+ /mpm-init context [--days N] # Intelligent git history analysis (default: 7 days)
39
+ /mpm-init catchup # Quick commit history (last 25 commits, no analysis)
257
40
  ```
258
- Fast update based on recent 30-day git activity. Generates activity report and updates docs with minimal changes.
259
-
260
- **Note**: Typing `/mpm-init update` executes `claude-mpm mpm-init --quick-update` automatically.
261
41
 
262
- ### Context Analysis (Intelligent Resumption)
42
+ **context:** Delegates to Research agent for deep analysis of:
43
+ - Active work streams (from commit patterns)
44
+ - Intent and motivation (from messages)
45
+ - Risks and blockers
46
+ - Recommended next actions
263
47
 
264
- Get intelligent context for resuming work based on git history analysis:
48
+ **catchup:** Direct CLI execution, instant output.
265
49
 
266
- **Standard Context Analysis:**
267
- ```bash
268
- /mpm-init context # Analyze last 7 days (default)
269
- /mpm-init context --days 14 # Analyze last 14 days
270
- /mpm-init context --days 30 # Analyze last 30 days
50
+ ### Resume from Logs
271
51
  ```
272
-
273
- This provides intelligent analysis including:
274
- - **Work stream identification** from commit patterns
275
- - **Intent analysis** (why work was done)
276
- - **Risk detection** (stalled work, conflicts, etc.)
277
- - **Recommended next actions** for seamless continuation
278
-
279
- **How it works:**
280
- 1. Parses git history (7 days default)
281
- 2. PM delegates to Research agent with structured prompt
282
- 3. Research agent provides deep analysis
283
- 4. PM presents intelligent summary
284
-
285
- **NOT session state**: This reconstructs context from git history, not saved conversation state.
286
-
287
- **Backward Compatibility:**
288
- ```bash
289
- /mpm-init resume # Still works but deprecated
52
+ /mpm-init resume [--list] [--session-id ID]
290
53
  ```
291
54
 
292
- The old `resume` command redirects to `context` with a deprecation warning.
293
-
294
- ### Resume from Stop Event Logs
295
-
296
- Display context from previous sessions using stop event logs:
297
-
298
- ```bash
299
- /mpm-init resume # Show latest session
300
- /mpm-init resume --list # List all available sessions
301
- /mpm-init resume --session-id abc123 # Resume specific session
302
- /mpm-init resume --last 10 # Show last 10 sessions
303
- ```
304
-
305
- Shows comprehensive context including:
55
+ Reads stop event logs from `.claude-mpm/resume-logs/` and `.claude-mpm/responses/` showing:
306
56
  - What was being worked on
307
- - Tasks completed (from PM tracking)
308
- - Files modified
309
- - Next steps recommended
310
- - Stop reason (context limit, completion, etc.)
311
- - Token usage
312
- - Time elapsed since session
313
-
314
- **Example Output:**
315
- ```
316
- ================================================================================
317
- 📋 Resume Context - Session from 2 hours ago
318
- ================================================================================
319
-
320
- Session ID: 20251104_143000
321
- Ended: 2024-11-04 14:30 (2 hours ago)
322
- Stop Reason: Context threshold reached (70%)
323
- Token Usage: 140,000 / 200,000 (70%)
324
-
325
- Working on:
326
- "Implementing auto-pause and resume functionality"
327
-
328
- Completed:
329
- Researched stop event logging system
330
- Found response logs in .claude-mpm/responses/
331
- Identified two-tier resume strategy
332
-
333
- 📝 Files Modified:
334
- • src/claude_mpm/services/cli/resume_service.py (new)
335
- src/claude_mpm/cli/commands/mpm_init/ (refactored into package)
336
-
337
- 🎯 Next Steps:
338
- • Implement ResumeService class
339
- • Add resume subcommand to mpm-init
340
- • Test with real response logs
341
-
342
- Git Context:
343
- Branch: main
344
- Working Directory: /Users/masa/Projects/claude-mpm
345
- ================================================================================
346
- ```
347
-
348
- **Use Cases:**
349
- - Resume after hitting context limit
350
- - Review what was accomplished in last session
351
- - See exact next steps recommended by PM
352
- - Understand why session stopped
353
-
354
- ### Quick Git History (Catchup)
355
-
356
- Display recent commit history without analysis:
357
-
358
- ```bash
359
- /mpm-init catchup
360
- ```
361
-
362
- Shows:
363
- - Last 25 commits from all branches
364
- - Author attribution and timestamps
365
- - Contributor activity summary
366
-
367
- Use this for quick "what happened recently?" checks. For intelligent analysis, use `context` instead.
368
-
369
- ### Review Project State
370
- ```bash
371
- /mpm-init --review
372
- ```
373
- Analyzes project structure, documentation, and git history without changes.
374
-
375
- ### Update Existing Documentation
376
- ```bash
377
- /mpm-init --update
378
- ```
379
- Updates CLAUDE.md while preserving custom sections.
380
-
381
- ### Organize Project Structure
382
- ```bash
383
- /mpm-init --organize --update
384
- ```
385
- Organizes misplaced files AND updates documentation.
386
-
387
- ### Web Project with React
388
- ```bash
389
- /mpm-init --project-type web --framework react
390
- ```
391
- Initializes with web-specific configurations and React patterns.
392
-
393
- ### Force Fresh Start
394
- ```bash
395
- /mpm-init --force --comprehensive
396
- ```
397
- Overwrites everything with comprehensive setup.
398
-
399
- ### Fast Mode (No AST)
400
- ```bash
401
- /mpm-init --no-ast-analysis --minimal
402
- ```
403
- Quick initialization without code analysis.
404
-
405
- ## Implementation
406
-
407
- **IMPORTANT**: This slash command accepts an optional `update` argument for quick updates.
408
-
409
- **Argument Processing**:
410
- - When you type `/mpm-init update`, Claude executes `claude-mpm mpm-init --quick-update`
411
- - When you type `/mpm-init` (no argument), Claude executes standard mode
412
- - The slash command handler automatically maps the `update` argument to the `--quick-update` flag
413
-
414
- This command routes between different modes:
415
-
416
- ### Context Analysis Commands
417
-
418
- **IMPORTANT**: Context analysis commands (`/mpm-init context`, `/mpm-init catchup`) have distinct behaviors:
419
-
420
- **`/mpm-init context` - Delegates to PM**:
421
- ```bash
422
- claude-mpm mpm-init context --days 7
423
- ```
424
-
425
- This command delegates work to the PM framework:
426
- 1. Parses git history (7 days default)
427
- 2. PM constructs structured Research delegation prompt
428
- 3. PM presents prompt for Research agent to analyze
429
- 4. Research identifies work streams, intent, risks, recommendations
430
- 5. PM synthesizes for user
431
-
432
- This is intelligent analysis requiring Research agent expertise.
57
+ - Tasks completed, files modified
58
+ - Next steps, stop reason, token usage
59
+ - Git context (branch, status)
60
+
61
+ ## Key Options
62
+
63
+ **Configuration:**
64
+ - `--project-type TYPE`: web, api, cli, library
65
+ - `--framework NAME`: react, django, fastapi, etc.
66
+ - `--ast-analysis` / `--no-ast-analysis`: Enable/disable code analysis
67
+ - `--comprehensive` / `--minimal`: Full setup vs CLAUDE.md only
68
+
69
+ **Organization:**
70
+ - `--organize`: Organize misplaced files
71
+ - `--preserve-custom`: Keep custom sections (default)
72
+ - `--review`: Review without changes
73
+
74
+ ## What Gets Created
75
+
76
+ **New Projects:**
77
+ - ✅ CLAUDE.md (priority-ranked instructions)
78
+ - Single-path workflows (make build/test/deploy)
79
+ - Tool configs (linting, formatting, testing)
80
+ - Memory system (.claude-mpm/memories/)
81
+ - DEVELOPER.md, CODE_STRUCTURE.md (with AST)
82
+ - ✅ .gitignore updates (auto-adds .claude-mpm/)
83
+
84
+ **Updates:**
85
+ - Smart merging (preserves custom sections)
86
+ - ✅ Automatic archival (docs/_archive/)
87
+ - Change tracking
433
88
 
434
- **How the PM delegates to Research:**
435
- The PM creates a delegation prompt that asks Research to analyze:
436
- - **Work Stream Identification**: Groups related commits into themes
437
- - **Intent Analysis**: Infers why work was done from commit messages
438
- - **Risk Detection**: Identifies stalled work, conflicts, and blockers
439
- - **Recommended Actions**: Suggests logical next steps for continuation
89
+ ## Examples
440
90
 
441
- **`/mpm-init catchup` - Direct CLI execution**:
442
91
  ```bash
443
- claude-mpm mpm-init catchup
444
- ```
445
-
446
- This executes directly via CLI without agent delegation:
447
- - Displays last 25 commits from all branches
448
- - Shows authors, dates, commit messages
449
- - Instant output (no analysis)
450
-
451
- This is a simple git log display utility.
92
+ # Quick start
93
+ /mpm-init # Auto-detect mode
452
94
 
453
- ---
454
-
455
- ### Project Initialization/Update Commands
95
+ # Quick update (lightweight)
96
+ /mpm-init update # 30-day activity report
456
97
 
457
- **IMPORTANT**: Standard initialization and update commands delegate to the Agentic Coder Optimizer agent.
458
-
459
- **Quick Update Mode** (`/mpm-init update`):
460
- ```bash
461
- claude-mpm mpm-init --quick-update
462
- ```
463
- This triggers a lightweight update that analyzes recent git activity (30 days) and generates an activity report.
98
+ # Resume work
99
+ /mpm-init context --days 14 # Analyze last 2 weeks
100
+ /mpm-init resume # Show latest session from logs
101
+ /mpm-init catchup # Quick commit history
464
102
 
465
- **Standard Mode** (`/mpm-init`):
466
- ```bash
467
- claude-mpm mpm-init [options]
103
+ # Full configuration
104
+ /mpm-init --project-type web --framework react --comprehensive
468
105
  ```
469
- This triggers the full initialization or smart update flow.
470
-
471
- The command delegates to the Agentic Coder Optimizer agent which:
472
- 1. Analyzes your project structure
473
- 2. Creates comprehensive documentation
474
- 3. Establishes single-path workflows
475
- 4. Configures development tools
476
- 5. Sets up memory systems
477
- 6. Performs AST analysis (if enabled)
478
- 7. Organizes everything with priority rankings
479
-
480
- **Quick Update Mode** performs:
481
- 1. Git history analysis (last 30 days)
482
- 2. Recent activity report generation
483
- 3. Lightweight documentation updates
484
- 4. Change summary for PM memory
485
-
486
- ## Expected Output
487
-
488
- ### For New Projects
489
- - ✅ **CLAUDE.md**: Main AI agent documentation with priority rankings
490
- - ✅ **Project structure**: Standard directories created (tmp/, scripts/, docs/)
491
- - ✅ **Single-path workflows**: Clear commands for all operations
492
- - ✅ **Tool configurations**: Linting, formatting, testing setup
493
- - ✅ **Memory system**: Initialized for knowledge retention
494
- - ✅ **Developer docs**: Technical documentation (with AST analysis)
495
- - ✅ **Priority organization**: Instructions ranked by importance
496
- - ✅ **.gitignore**: Configuration directories automatically excluded
497
-
498
- ### For Existing Projects (Update Mode)
499
- - ✅ **Updated CLAUDE.md**: Refreshed with latest standards
500
- - ✅ **Preserved content**: Your custom sections maintained
501
- - ✅ **Archive created**: Previous version in `docs/_archive/`
502
- - ✅ **Structure verified**: Missing directories created
503
- - ✅ **Files organized**: Misplaced files moved (if --organize)
504
- - ✅ **Change summary**: Report of what was updated
505
- - ✅ **.gitignore**: Config directories added if not present
506
-
507
- ### For Quick Update Mode (`/mpm-init update`)
508
- - ✅ **Activity Report**: Summary of recent 30-day git activity
509
- - ✅ **Recent Commits**: List of commits with authors and dates
510
- - ✅ **Changed Files**: Files with most modifications
511
- - ✅ **Active Branches**: Current and recent branch activity
512
- - ✅ **Lightweight Doc Updates**: Append activity notes to CLAUDE.md
513
- - ✅ **PM Memory Update**: Recommendations for project manager
514
- - ✅ **Quick Check**: Verify CLAUDE.md freshness without full regeneration
515
106
 
516
- ## Notes
107
+ ## Implementation Notes
517
108
 
518
- - **Quick Update vs Full Update**: Use `/mpm-init update` for fast activity-based updates (30 days), or `/mpm-init --update` for comprehensive doc refresh
519
- - **Resume Strategies**:
520
- - **`/mpm-init resume`**: Read stop event logs (what PM tracked in last session)
521
- - **`/mpm-init context`**: Analyze git history (intelligent work stream analysis via Research)
522
- - **`/mpm-init catchup`**: Quick commit history display (no analysis)
523
- - **Stop Event Logs**: Response logs in `.claude-mpm/responses/` contain PM summaries with tasks, files, and next steps
524
- - **Two-Tier Resume**: Prefers structured resume logs (`.claude-mpm/resume-logs/`), falls back to response logs
525
- - **Smart Mode**: Automatically detects existing CLAUDE.md and offers update vs recreate
526
- - **Safe Updates**: Previous versions always archived before updating
527
- - **Custom Content**: Your project-specific sections are preserved by default
528
- - **Git Integration**: Analyzes recent commits to understand project evolution and provide work context
529
- - **Backward Compatibility**: All existing `resume` commands redirect to `context` with deprecation warning
530
- - **Argument Processing**: The slash command processes the `update` argument and routes to `--quick-update` flag
531
- - **Agent Delegation**:
532
- - Project initialization and updates use the Agentic Coder Optimizer agent
533
- - Context analysis (`context`) delegates to PM, who coordinates with Research agent
534
- - Simple git history (`catchup`) executes directly via CLI without agent delegation
535
- - **NOT Session State**: Context analysis reconstructs project understanding from git history, not saved conversation state
536
- - AST analysis is enabled by default for comprehensive documentation
537
- - Priority rankings help AI agents focus on critical instructions first
538
- - The holistic review ensures documentation quality and completeness
539
- - All documentation is optimized for AI agent understanding
109
+ **Delegation patterns:**
110
+ - **Project init/update:** → Agentic Coder Optimizer agent
111
+ - **context:** PM Research agent (structured analysis)
112
+ - **catchup:** Direct CLI (git log wrapper)
113
+ - **resume:** PM (reads logs, no delegation)
540
114
 
541
- ## Related Commands
115
+ **Token budgets:**
116
+ - context analysis: 10-30s processing time
117
+ - resume display: ~10-20k tokens
118
+ - catchup: instant, minimal tokens
542
119
 
543
- - `/mpm-status`: Check current project setup status
544
- - `/mpm-agents`: Manage specialized agents
545
- - `/mpm-config`: Configure Claude MPM settings
546
- - `/mpm-doctor`: Diagnose and fix issues
120
+ See docs/commands/init.md for comprehensive documentation.