claude-mpm 5.4.3__py3-none-any.whl → 5.4.21__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 (90) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/__init__.py +4 -0
  3. claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +1 -1
  4. claude_mpm/agents/PM_INSTRUCTIONS.md +166 -21
  5. claude_mpm/agents/agent_loader.py +3 -27
  6. claude_mpm/cli/__main__.py +4 -0
  7. claude_mpm/cli/chrome_devtools_installer.py +175 -0
  8. claude_mpm/cli/commands/agents.py +0 -31
  9. claude_mpm/cli/commands/auto_configure.py +210 -25
  10. claude_mpm/cli/commands/config.py +88 -2
  11. claude_mpm/cli/commands/configure.py +85 -43
  12. claude_mpm/cli/commands/configure_agent_display.py +3 -1
  13. claude_mpm/cli/commands/mpm_init/core.py +2 -45
  14. claude_mpm/cli/commands/skills.py +214 -189
  15. claude_mpm/cli/executor.py +3 -3
  16. claude_mpm/cli/parsers/agents_parser.py +0 -9
  17. claude_mpm/cli/parsers/auto_configure_parser.py +0 -138
  18. claude_mpm/cli/parsers/config_parser.py +153 -83
  19. claude_mpm/cli/parsers/skills_parser.py +3 -2
  20. claude_mpm/cli/startup.py +490 -41
  21. claude_mpm/commands/mpm-config.md +265 -0
  22. claude_mpm/commands/mpm-help.md +14 -95
  23. claude_mpm/commands/mpm-organize.md +350 -153
  24. claude_mpm/core/framework/formatters/content_formatter.py +3 -13
  25. claude_mpm/core/framework_loader.py +4 -2
  26. claude_mpm/core/logger.py +13 -0
  27. claude_mpm/hooks/claude_hooks/event_handlers.py +176 -76
  28. claude_mpm/hooks/claude_hooks/hook_handler.py +2 -0
  29. claude_mpm/hooks/claude_hooks/installer.py +33 -10
  30. claude_mpm/hooks/claude_hooks/memory_integration.py +26 -9
  31. claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
  32. claude_mpm/hooks/memory_integration_hook.py +46 -1
  33. claude_mpm/init.py +0 -19
  34. claude_mpm/scripts/claude-hook-handler.sh +58 -18
  35. claude_mpm/scripts/start_activity_logging.py +0 -0
  36. claude_mpm/services/agents/agent_recommendation_service.py +6 -7
  37. claude_mpm/services/agents/agent_review_service.py +280 -0
  38. claude_mpm/services/agents/deployment/agent_discovery_service.py +2 -3
  39. claude_mpm/services/agents/deployment/agent_template_builder.py +1 -0
  40. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +78 -9
  41. claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +13 -0
  42. claude_mpm/services/agents/git_source_manager.py +14 -0
  43. claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
  44. claude_mpm/services/agents/toolchain_detector.py +6 -3
  45. claude_mpm/services/command_deployment_service.py +81 -8
  46. claude_mpm/services/git/git_operations_service.py +93 -8
  47. claude_mpm/services/self_upgrade_service.py +120 -12
  48. claude_mpm/services/skills/__init__.py +3 -0
  49. claude_mpm/services/skills/git_skill_source_manager.py +32 -2
  50. claude_mpm/services/skills/selective_skill_deployer.py +704 -0
  51. claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
  52. claude_mpm/services/skills_deployer.py +126 -9
  53. {claude_mpm-5.4.3.dist-info → claude_mpm-5.4.21.dist-info}/METADATA +47 -8
  54. {claude_mpm-5.4.3.dist-info → claude_mpm-5.4.21.dist-info}/RECORD +58 -82
  55. {claude_mpm-5.4.3.dist-info → claude_mpm-5.4.21.dist-info}/entry_points.txt +0 -3
  56. claude_mpm-5.4.21.dist-info/licenses/LICENSE +94 -0
  57. claude_mpm-5.4.21.dist-info/licenses/LICENSE-FAQ.md +153 -0
  58. claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
  59. claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
  60. claude_mpm/agents/BASE_ENGINEER.md +0 -658
  61. claude_mpm/agents/BASE_OPS.md +0 -219
  62. claude_mpm/agents/BASE_PM.md +0 -480
  63. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
  64. claude_mpm/agents/BASE_QA.md +0 -167
  65. claude_mpm/agents/BASE_RESEARCH.md +0 -53
  66. claude_mpm/agents/base_agent.json +0 -31
  67. claude_mpm/agents/base_agent_loader.py +0 -601
  68. claude_mpm/cli/commands/agents_detect.py +0 -380
  69. claude_mpm/cli/commands/agents_recommend.py +0 -309
  70. claude_mpm/cli/ticket_cli.py +0 -35
  71. claude_mpm/commands/mpm-agents-auto-configure.md +0 -278
  72. claude_mpm/commands/mpm-agents-detect.md +0 -177
  73. claude_mpm/commands/mpm-agents-list.md +0 -131
  74. claude_mpm/commands/mpm-agents-recommend.md +0 -223
  75. claude_mpm/commands/mpm-config-view.md +0 -150
  76. claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-313.pyc +0 -0
  77. claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-313.pyc +0 -0
  78. claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-313.pyc +0 -0
  79. claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-313.pyc +0 -0
  80. claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-313.pyc +0 -0
  81. claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-313.pyc +0 -0
  82. claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-313.pyc +0 -0
  83. claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-313.pyc +0 -0
  84. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-313.pyc +0 -0
  85. claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-313.pyc +0 -0
  86. claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-313.pyc +0 -0
  87. claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-313.pyc +0 -0
  88. claude_mpm-5.4.3.dist-info/licenses/LICENSE +0 -21
  89. {claude_mpm-5.4.3.dist-info → claude_mpm-5.4.21.dist-info}/WHEEL +0 -0
  90. {claude_mpm-5.4.3.dist-info → claude_mpm-5.4.21.dist-info}/top_level.txt +0 -0
@@ -4,11 +4,11 @@ command: organize
4
4
  aliases: [mpm-organize]
5
5
  migration_target: /mpm/system:organize
6
6
  category: system
7
- description: Organize project files into proper directories with intelligent pattern detection
7
+ description: Organize all project files including documentation, source code, tests, scripts, and configuration with intelligent consolidation and pruning
8
8
  ---
9
9
  # /mpm-organize
10
10
 
11
- Organize your project files into proper directories using intelligent pattern detection and framework-aware structure management.
11
+ Organize ALL project files into a clean, structured format with intelligent detection of existing patterns. Includes special handling for documentation consolidation, pruning, and triage into research/user/developer categories.
12
12
 
13
13
  ## Usage
14
14
 
@@ -17,25 +17,35 @@ Organize your project files into proper directories using intelligent pattern de
17
17
  /mpm-organize --dry-run # Preview changes without applying
18
18
  /mpm-organize --force # Proceed even with uncommitted changes
19
19
  /mpm-organize --no-backup # Skip backup creation (not recommended)
20
+ /mpm-organize --docs-only # Only organize documentation files
20
21
  ```
21
22
 
22
23
  ## Description
23
24
 
24
- This slash command delegates to the **Project Organizer agent** to perform thorough project housekeeping. The agent analyzes your project structure, detects existing patterns and framework conventions, then organizes files into proper directories following best practices.
25
+ This slash command delegates to the **Project Organizer agent** to perform intelligent project organization across ALL file types. The agent analyzes your project structure, detects existing patterns, consolidates duplicates, removes stale content, and organizes everything into a clean, logical structure.
25
26
 
26
- **Smart Organization**: The agent follows the official [Project Organization Standard](../../../docs/reference/PROJECT_ORGANIZATION.md), which defines comprehensive organization rules for Claude MPM projects. It also checks CLAUDE.md for project-specific guidelines and respects framework-specific conventions.
27
+ **Comprehensive Scope**: This command organizes ALL project files including:
28
+ - **Documentation** (.md, .rst, .txt) - consolidate, prune, triage into research/user/developer
29
+ - **Source code** - proper module structure and organization
30
+ - **Tests** - organized test suites
31
+ - **Scripts** - automation tools and utilities
32
+ - **Configuration** - project config files
27
33
 
28
- **Standard Documentation**: After organizing, this command ensures the organization standard is documented and accessible at `docs/reference/PROJECT_ORGANIZATION.md` with proper linking from CLAUDE.md.
34
+ **Smart Detection**: The agent first looks for existing organization patterns in your project (e.g., PROJECT_ORGANIZATION.md, CONTRIBUTING.md). If found, it respects and extends those patterns. If not found, it applies framework-appropriate defaults.
29
35
 
30
36
  ## Features
31
37
 
32
- - **📁 Intelligent Pattern Detection**: Analyzes existing directory structure and naming conventions
33
- - **🎯 Framework-Aware**: Respects Next.js, React, Django, Rails, and other framework patterns
34
- - **🔍 CLAUDE.md Integration**: Follows project-specific guidelines when available
38
+ - **📁 Pattern Detection**: Analyzes existing project structure and detects organization conventions
39
+ - **🔄 Consolidation**: Merges duplicate or related files (especially documentation)
40
+ - **✂️ Pruning**: Identifies and removes outdated, stale, or redundant content
41
+ - **📋 Triage**: Categorizes documentation into research/user/developer directories
42
+ - **🏗️ Code Organization**: Ensures proper module structure and file placement
43
+ - **🧪 Test Organization**: Organizes test suites into proper directories
44
+ - **📜 Script Organization**: Moves scripts to dedicated scripts/ directory
35
45
  - **✅ Safe Operations**: Uses `git mv` for tracked files to preserve history
36
46
  - **💾 Automatic Backups**: Creates backups before major reorganizations
37
- - **🔄 Import Path Updates**: Updates import statements after file moves
38
47
  - **📊 Organization Report**: Detailed summary of changes and recommendations
48
+ - **🎯 Smart Scope**: Full project or documentation-only mode (--docs-only)
39
49
 
40
50
  ## Options
41
51
 
@@ -44,11 +54,17 @@ This slash command delegates to the **Project Organizer agent** to perform thoro
44
54
  - `--no-backup`: Skip backup creation before reorganization (not recommended)
45
55
  - `--force`: Proceed even with uncommitted changes (use with caution)
46
56
 
47
- ### Organization Options
48
- - `--docs-only`: Only organize documentation files
57
+ ### Scope Options
58
+ - `--docs-only`: Only organize documentation files (legacy behavior)
59
+ - `--code-only`: Only organize source code files
49
60
  - `--tests-only`: Only organize test files
50
61
  - `--scripts-only`: Only organize script files
51
- - `--skip-imports`: Don't update import paths after moves
62
+
63
+ ### Organization Options
64
+ - `--consolidate-only`: Only consolidate duplicate files, skip reorganization
65
+ - `--prune-only`: Only identify and remove stale files
66
+ - `--triage-only`: Only categorize files without moving them
67
+ - `--no-prune`: Skip pruning phase (keep all existing files)
52
68
 
53
69
  ### Output Options
54
70
  - `--verbose`: Show detailed analysis and reasoning
@@ -57,178 +73,312 @@ This slash command delegates to the **Project Organizer agent** to perform thoro
57
73
 
58
74
  ## What This Command Does
59
75
 
60
- ### 1. Organization Standard Verification
61
- - Ensures `docs/reference/PROJECT_ORGANIZATION.md` exists and is current
62
- - Creates or updates the standard if needed
63
- - Links the standard from CLAUDE.md for easy reference
76
+ ### 1. Pattern Detection
77
+ - Scans existing project structure across all file types
78
+ - Identifies organization conventions (PROJECT_ORGANIZATION.md, CONTRIBUTING.md)
79
+ - Detects framework-specific patterns (Next.js, Django, Flask, etc.)
80
+ - Detects existing documentation organization
81
+ - Falls back to framework-appropriate defaults if no pattern found
64
82
 
65
- ### 2. CLAUDE.md Analysis
66
- - Checks for existing organization guidelines
67
- - Extracts project-specific rules and conventions
68
- - Identifies priority areas for organization
83
+ ### 2. Standard Project Structure
69
84
 
70
- ### 3. Project Structure Detection
71
- - Scans directory hierarchy and patterns
72
- - Identifies naming conventions (camelCase, kebab-case, snake_case)
73
- - Maps current file type locations
74
- - Detects framework-specific conventions (Next.js, Django, Rails, etc.)
75
- - Determines organization type (feature/type/domain-based)
76
-
77
- ### 4. File Organization Strategy
78
-
79
- The agent organizes files into standard directories per [PROJECT_ORGANIZATION.md](../../../docs/reference/PROJECT_ORGANIZATION.md):
85
+ If no existing pattern is detected, organizes according to project type:
80
86
 
87
+ **Documentation** (all project types):
81
88
  ```
82
- docs/ # All documentation files (*.md, guides, architecture)
83
- tests/ # All test files and test utilities
84
- tmp/ # Temporary and ephemeral files
85
- scripts/ # Ad-hoc scripts and utilities
86
- src/ # Source code following framework conventions
87
- .claude/ # Claude MPM configuration and agents
89
+ docs/
90
+ ├── research/ # Research findings, analysis, investigations
91
+ │ ├── spikes/ # Technical spikes and experiments
92
+ │ └── notes/ # Development notes and brainstorming
93
+ ├── user/ # User-facing documentation
94
+ │ ├── guides/ # How-to guides and tutorials
95
+ │ ├── faq/ # Frequently asked questions
96
+ │ └── examples/ # Usage examples
97
+ └── developer/ # Developer documentation
98
+ ├── api/ # API documentation
99
+ ├── architecture/ # Architecture decisions and diagrams
100
+ └── contributing/ # Contribution guidelines
88
101
  ```
89
102
 
90
- ### 5. Framework-Specific Handling
103
+ **Source Code** (framework-specific):
104
+ - Python: `src/package_name/` structure
105
+ - JavaScript/TypeScript: Framework conventions (Next.js, React, etc.)
106
+ - Other: Language-appropriate module structure
107
+
108
+ **Tests**: `tests/` with mirrored source structure
109
+
110
+ **Scripts**: `scripts/` for automation tools
111
+
112
+ **Configuration**: Root or `config/` depending on project size
113
+
114
+ ### 3. File Consolidation
115
+
116
+ Identifies and merges duplicate/similar files:
117
+
118
+ **Documentation**:
119
+ - Duplicate README files
120
+ - Similar guide documents
121
+ - Redundant architecture notes
122
+ - Multiple versions of same doc
123
+ - Scattered meeting notes
91
124
 
92
- **Next.js Projects**:
93
- - Respects `pages/`, `app/`, `public/`, API routes
94
- - Organizes components by feature or domain
95
- - Maintains Next.js conventions
125
+ **Code**:
126
+ - Duplicate utility functions
127
+ - Similar helper modules
128
+ - Redundant configuration files
96
129
 
97
- **Django Projects**:
98
- - Maintains app structure
99
- - Organizes migrations, templates, static files
100
- - Preserves Django conventions
130
+ ### 4. Content Pruning
101
131
 
102
- **React Projects**:
103
- - Organizes components, hooks, utils
104
- - Maintains component hierarchy
105
- - Groups related files
132
+ Removes or archives stale/obsolete content:
106
133
 
107
- **Other Frameworks**:
108
- - Detects and respects framework conventions
109
- - Applies appropriate organizational patterns
134
+ **Documentation**:
135
+ - Outdated documentation (last modified >6 months)
136
+ - Stale TODO lists and notes
137
+ - Obsolete architecture documents
138
+ - Deprecated API documentation
139
+ - Empty or placeholder files
140
+
141
+ **Code**:
142
+ - Commented-out code blocks
143
+ - Unused imports and dependencies
144
+ - Dead code (unreferenced functions/classes)
145
+
146
+ ### 5. File Categorization & Triage
147
+
148
+ Categorizes and organizes files by purpose:
149
+
150
+ **Documentation**:
151
+ - **Research**: Analysis, spikes, investigations, experiments
152
+ - **User**: Guides, tutorials, FAQs, how-tos
153
+ - **Developer**: API docs, architecture, contributing guides
154
+
155
+ **Code**:
156
+ - Source code to proper module structure
157
+ - Tests to organized test suites
158
+ - Scripts to scripts/ directory
159
+ - Configuration to appropriate locations
110
160
 
111
161
  ### 6. Safe File Movement
112
162
 
113
- For each file to be moved:
114
- 1. Analyzes file purpose and dependencies
115
- 2. Determines optimal location based on patterns
163
+ For each file being organized:
164
+ 1. Analyzes file type, content, and purpose
165
+ 2. Determines optimal location based on detected patterns
116
166
  3. Uses `git mv` for version-controlled files
117
- 4. Updates import paths in affected files
118
- 5. Validates build still works
167
+ 4. Preserves git history
168
+ 5. Creates backup before major changes
169
+ 6. Validates move doesn't break imports or references
119
170
 
120
171
  ### 7. Backup Creation
121
172
 
122
- Before major reorganization:
173
+ Before reorganization:
123
174
  ```bash
124
- backup_YYYYMMDD_HHMMSS.tar.gz # Complete project backup
175
+ backup_project_YYYYMMDD_HHMMSS.tar.gz # Full project backup (or docs-only)
125
176
  ```
126
177
 
127
- ### 8. Import Path Updates
178
+ ### 8. Protected Files (Never Moved)
179
+
180
+ These files remain in project root:
181
+ - `README.md`, `CHANGELOG.md`, `LICENSE.md`
182
+ - `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`
183
+ - `CLAUDE.md`, `CODE.md`, `DEVELOPER.md`
184
+ - Package files: `package.json`, `pyproject.toml`, `Cargo.toml`, etc.
185
+ - Build configs: `Makefile`, `Dockerfile`, `docker-compose.yml`
186
+ - Git files: `.gitignore`, `.gitattributes`
187
+ - Environment templates: `.env.example`, `.env.sample`
128
188
 
129
- Automatically updates:
130
- - Python imports (`from old.path import X` → `from new.path import X`)
131
- - JavaScript/TypeScript imports (`import X from './old/path'` → `import X from './new/path'`)
132
- - Relative path references
133
- - Configuration file paths
189
+ ### 9. Files Excluded from Organization
134
190
 
135
- ### 9. Organization Report
191
+ Never touched:
192
+ - Build artifacts: `dist/`, `build/`, `node_modules/`, `__pycache__/`
193
+ - Version control: `.git/`, `.svn/`, `.hg/`
194
+ - Virtual environments: `venv/`, `.venv/`, `env/`
195
+ - IDE configs: `.vscode/`, `.idea/` (unless --config-only)
196
+
197
+ ### 10. Organization Report
136
198
 
137
199
  Generates detailed report including:
138
- - Files moved and their new locations
200
+ - All files moved with before/after locations
201
+ - Files consolidated (merged) with change summary
202
+ - Files pruned (removed or archived) with reasoning
139
203
  - Pattern analysis and detected conventions
140
- - Import paths updated
204
+ - Import/reference validation results
141
205
  - Recommendations for further improvements
142
- - Violations of best practices (if any)
143
206
 
144
207
  ## Examples
145
208
 
146
- ### Preview Organization (Recommended First Run)
209
+ ### Preview Full Project Organization (Recommended First Run)
147
210
  ```bash
148
211
  /mpm-organize --dry-run
149
212
  ```
150
- Shows what would be changed without making any modifications.
213
+ Shows what changes would be made across ALL project files without applying them.
214
+
215
+ ### Preview Documentation Organization Only
216
+ ```bash
217
+ /mpm-organize --docs-only --dry-run
218
+ ```
219
+ Shows what documentation changes would be made (legacy behavior).
151
220
 
152
- ### Full Organization with Backup
221
+ ### Full Project Organization with Backup
153
222
  ```bash
154
223
  /mpm-organize
155
224
  ```
156
- Interactive mode with automatic backup before changes.
225
+ Interactive mode with automatic backup before organizing all project files.
157
226
 
158
- ### Force Organization (With Uncommitted Changes)
227
+ ### Organize Tests and Scripts Only
159
228
  ```bash
160
- /mpm-organize --force --verbose
229
+ /mpm-organize --tests-only --scripts-only
161
230
  ```
162
- Organizes project even with uncommitted changes, shows detailed output.
231
+ Focus on organizing test files and scripts, leave everything else untouched.
163
232
 
164
- ### Organize Documentation Only
233
+ ### Consolidate Duplicate Files Only
165
234
  ```bash
166
- /mpm-organize --docs-only --dry-run
235
+ /mpm-organize --consolidate-only --dry-run
236
+ ```
237
+ Preview which duplicate files would be merged across the project.
238
+
239
+ ### Identify Stale Files (All Types)
240
+ ```bash
241
+ /mpm-organize --prune-only --dry-run
167
242
  ```
168
- Preview how documentation files would be organized.
243
+ See which outdated files would be removed or archived.
169
244
 
170
- ### Quick Organization Without Backup
245
+ ### Triage Documentation by Category
171
246
  ```bash
172
- /mpm-organize --no-backup
247
+ /mpm-organize --docs-only --triage-only --verbose
173
248
  ```
174
- Skip backup creation for small changes (use with caution).
249
+ Categorize documentation into research/user/developer without moving files.
250
+
251
+ ### Full Organization Without Pruning
252
+ ```bash
253
+ /mpm-organize --no-prune
254
+ ```
255
+ Organize and consolidate all files but keep everything (no deletions).
175
256
 
176
257
  ### Save Organization Report
177
258
  ```bash
178
- /mpm-organize --report /tmp/organize-report.md
259
+ /mpm-organize --report /tmp/project-organize-report.md
179
260
  ```
180
- Save detailed report to file for review.
261
+ Save detailed organization report to file for review.
181
262
 
182
263
  ## Implementation
183
264
 
184
- This slash command delegates to the **Project Organizer agent** (`project-organizer`), which performs intelligent file organization based on detected patterns and framework conventions.
265
+ This slash command delegates to the **Project Organizer agent** (`project-organizer`), which performs intelligent project organization based on detected patterns and content analysis across all file types.
185
266
 
186
267
  The agent receives the command options as context and then:
187
- 1. Analyzes CLAUDE.md for organization guidelines
188
- 2. Detects project framework and patterns
189
- 3. Identifies misplaced files
190
- 4. Creates safe reorganization plan
191
- 5. Executes file moves with git integration
192
- 6. Updates import paths across codebase
193
- 7. Validates build integrity
194
- 8. Generates organization report
268
+ 1. **Scans** for all project files (or scope-specific with --docs-only, --tests-only, etc.)
269
+ 2. **Detects** existing organization patterns (PROJECT_ORGANIZATION.md, CONTRIBUTING.md, framework conventions)
270
+ 3. **Analyzes** file content, purpose, and relationships
271
+ 4. **Categorizes** files by type and purpose (documentation by audience, code by module, tests by coverage)
272
+ 5. **Identifies** duplicates, stale content, and misplaced files
273
+ 6. **Validates** that moves won't break imports or references
274
+ 7. **Creates** safe reorganization plan with detailed reasoning
275
+ 8. **Executes** file moves with git integration (preserves history)
276
+ 9. **Generates** comprehensive organization report
195
277
 
196
278
  When you invoke `/mpm-organize [options]`, Claude MPM:
197
279
  - Passes the options to the Project Organizer agent as task context
198
- - The agent executes the organization workflow
199
- - Results are returned to you through the agent's structured output
280
+ - The agent executes the comprehensive organization workflow
281
+ - Results are returned through structured output with detailed change log
282
+
283
+ **Scope Control**:
284
+ - Default: Organizes ALL project files (comprehensive)
285
+ - `--docs-only`: Only documentation files (legacy behavior)
286
+ - `--code-only`, `--tests-only`, `--scripts-only`: Specific file types
200
287
 
201
288
  ## Expected Output
202
289
 
203
- ### Dry Run Mode
290
+ ### Dry Run Mode (Full Project)
204
291
  ```
205
292
  🔍 Analyzing project structure...
206
- ✓ Detected framework: Next.js
207
- Organization pattern: Feature-based
208
- ✓ Found CLAUDE.md guidelines
293
+ ✓ Detected PROJECT_ORGANIZATION.md - using project standards
294
+ Found Python Flask project with standard structure
295
+ ✓ Found 23 documentation files
296
+ ✓ Found 15 misplaced test files
297
+ ✓ Found 8 scripts in root directory
298
+ ✓ Identified 3 duplicate READMEs
299
+ ✓ Found 5 stale files
209
300
 
210
301
  📁 Proposed Changes:
211
302
 
212
- docs/
213
- ← README_OLD.md (from root)
214
- architecture-notes.txt (from root)
303
+ Documentation:
304
+ Consolidate:
305
+ Merge README_OLD.md + README_BACKUP.md → docs/user/README.md
306
+ → Merge architecture-v1.md + architecture-v2.md → docs/developer/architecture/decisions.md
307
+
308
+ Organize:
309
+ docs/research/
310
+ ← spike-oauth.md (from root)
311
+ ← performance-analysis.md (from root)
312
+ docs/user/guides/
313
+ ← getting-started.md (from root)
314
+ ← installation.md (from docs/)
315
+
316
+ Prune:
317
+ ✂ Remove TODO_2023.md (last modified 18 months ago)
318
+ ✂ Archive deprecated-api.md → docs/_archive/
319
+
320
+ Tests:
321
+ tests/unit/
322
+ ← test_auth.py (from root)
323
+ ← test_utils.py (from src/)
324
+ tests/integration/
325
+ ← test_api_integration.py (from root)
326
+
327
+ Scripts:
328
+ scripts/
329
+ ← deploy.sh (from root)
330
+ ← run_tests.py (from root)
331
+ ← backup_db.sh (from utils/)
332
+
333
+ Source Code:
334
+ src/myapp/utils/
335
+ → Consolidate helpers.py + utility_functions.py → utils.py
336
+
337
+ 📊 Summary:
338
+ - 8 documentation files to move
339
+ - 4 files to consolidate (2 merged)
340
+ - 5 files to prune (3 removed, 2 archived)
341
+ - 15 test files to organize
342
+ - 8 scripts to move
343
+ - 2 code files to consolidate
344
+
345
+ Run without --dry-run to apply changes.
346
+ ```
215
347
 
216
- tests/
217
- ← test_helper.py (from src/)
218
- api.test.js (from src/api/)
348
+ ### Dry Run Mode (Documentation Only)
349
+ ```bash
350
+ /mpm-organize --docs-only --dry-run
351
+ ```
352
+ ```
353
+ 🔍 Analyzing documentation structure...
354
+ ✓ Detected existing pattern: docs/guides/ and docs/reference/
355
+ ✓ Found 23 documentation files
356
+ ✓ Identified 3 duplicate READMEs
357
+ ✓ Found 5 stale documentation files
219
358
 
220
- tmp/
221
- ← debug_output.log (from root)
222
- ← scratch.py (from root)
359
+ 📁 Proposed Changes:
360
+
361
+ Consolidate:
362
+ → Merge README_OLD.md + README_BACKUP.md → docs/user/README.md
363
+ → Merge architecture-v1.md + architecture-v2.md → docs/developer/architecture/decisions.md
364
+
365
+ Prune:
366
+ ✂ Remove TODO_2023.md (last modified 18 months ago)
367
+ ✂ Archive deprecated-api.md → docs/_archive/
368
+ ✂ Remove empty placeholder.md
223
369
 
224
- scripts/
225
- ← migrate.sh (from root)
226
- deploy_helper.py (from root)
370
+ Organize:
371
+ docs/research/
372
+ spike-oauth.md (from root)
373
+ ← performance-analysis.md (from root)
374
+ docs/user/guides/
375
+ ← getting-started.md (from root)
376
+ ← installation.md (from docs/)
227
377
 
228
378
  📊 Summary:
229
- - 8 files to move
230
- - 12 import paths to update
231
- - 0 conflicts detected
379
+ - 8 documentation files to move
380
+ - 4 files to consolidate (2 merged files)
381
+ - 5 files to prune (3 removed, 2 archived)
232
382
 
233
383
  Run without --dry-run to apply changes.
234
384
  ```
@@ -236,68 +386,115 @@ Run without --dry-run to apply changes.
236
386
  ### Actual Organization
237
387
  ```
238
388
  🔍 Analyzing project structure...
239
- ✓ Detected framework: Next.js
240
- Organization pattern: Feature-based
241
- ✓ Created backup: backup_20250102_143022.tar.gz
389
+ ✓ Detected PROJECT_ORGANIZATION.md - using project standards
390
+ Created backup: backup_project_20250102_143022.tar.gz
242
391
 
243
- 📁 Organizing files...
244
- Moved README_OLD.md → docs/
245
- ✓ Moved architecture-notes.txt → docs/
246
- Updated 5 import statements
392
+ 📁 Organizing project files...
393
+ Consolidated README_OLD.md + README_BACKUP.md → docs/user/README.md
394
+ ✓ Moved spike-oauth.md → docs/research/
395
+ Moved test_auth.py tests/unit/
396
+ ✓ Moved deploy.sh → scripts/
397
+ ✓ Consolidated helpers.py + utility_functions.py → src/myapp/utils/utils.py
398
+ ✓ Pruned TODO_2023.md (stale)
399
+ ✓ Archived deprecated-api.md
247
400
 
248
- Organization complete!
401
+ Project organization complete!
249
402
 
250
- 📊 Report saved to: /tmp/organization-report.md
403
+ 📊 Report saved to: /tmp/project-organization-report.md
251
404
  ```
252
405
 
253
406
  ## Safety Guarantees
254
407
 
255
- - **Backup Created**: Full project backup before changes (unless --no-backup)
256
- - **Git Integration**: Uses `git mv` to preserve file history
257
- - **Dry Run Available**: Preview all changes before applying
258
- - **Import Updates**: Automatically fixes broken imports
259
- - **Build Validation**: Verifies build still works after changes
408
+ - **Full Project Backup**: Backup of all affected files before changes (unless --no-backup)
409
+ - **Git Integration**: Uses `git mv` to preserve file history for tracked files
410
+ - **Dry Run Available**: Preview all changes before applying (--dry-run)
411
+ - **Import Validation**: Validates that code moves won't break imports/references
412
+ - **Protected Files**: Critical root files never moved (README.md, package.json, etc.)
260
413
  - **Rollback Support**: Backup enables full rollback if needed
414
+ - **Conservative Pruning**: Stale files are archived rather than deleted when in doubt
415
+ - **Scope Control**: Limit changes to specific file types (--docs-only, --tests-only, etc.)
261
416
 
262
417
  ## When to Use This Command
263
418
 
264
419
  Use `/mpm-organize` when:
265
- - Starting a new project and establishing structure
266
- - Project has accumulated misplaced files
267
- - After major feature additions
268
- - Before major refactoring
269
- - When onboarding new team members
270
- - To enforce organization standards
420
+ - **Project has grown organically** and structure has become messy
421
+ - **Test files are scattered** across the codebase
422
+ - **Scripts are in root** instead of scripts/ directory
423
+ - **Documentation is disorganized** with duplicates and stale content
424
+ - **Code has duplicated utilities** that should be consolidated
425
+ - **Starting a new project** and establishing clean structure
426
+ - **Before a major release** (clean up everything)
427
+ - **After a major refactor** (reorganize changed files)
428
+ - **When onboarding new team members** (clear, organized structure)
429
+ - **After accumulating research notes** and experimental code
271
430
 
272
431
  ## Best Practices
273
432
 
274
- 1. **Always Start with Dry Run**: Use `--dry-run` first to preview changes
275
- 2. **Commit First**: Commit your work before organizing (or use --force)
276
- 3. **Review CLAUDE.md**: Ensure guidelines are current before organizing
277
- 4. **Test After**: Run tests after organization to verify nothing broke
278
- 5. **Update Documentation**: Document any new organizational patterns
433
+ 1. **Always Start with Dry Run**: Use `--dry-run` first to preview ALL changes
434
+ 2. **Commit First**: Commit your work before organizing (or use --force, but not recommended)
435
+ 3. **Start Small**: Use `--docs-only` first, then expand to full project organization
436
+ 4. **Review Proposed Changes**: Carefully review consolidations and moves
437
+ 5. **Verify Pruning Decisions**: Review stale files before removal, some may still be valuable
438
+ 6. **Test After Organization**: Run tests after organizing to ensure imports still work
439
+ 7. **Update Links**: Check that documentation links and imports still work
440
+ 8. **Document Structure**: Update README or PROJECT_ORGANIZATION.md to reflect new structure
441
+ 9. **Use Scope Flags**: Limit scope with `--docs-only`, `--tests-only`, etc. for focused changes
442
+ 10. **Review Report**: Always check the organization report for detailed change log
279
443
 
280
444
  ## Notes
281
445
 
282
446
  - This slash command delegates to the **Project Organizer agent** (`project-organizer`)
283
- - The agent performs intelligent file placement based on learned patterns
284
- - Respects framework-specific conventions automatically
447
+ - The agent performs intelligent organization across **all project file types**
448
+ - **Default behavior**: Organizes ALL files (comprehensive project organization)
449
+ - **Legacy behavior**: Use `--docs-only` to only organize documentation (old default)
285
450
  - Integrates with git to preserve file history
286
- - Updates import paths to prevent build breakage
287
451
  - Creates comprehensive reports for audit trails
288
- - Can be run repeatedly safely (idempotent)
289
- - Follows guidelines in CLAUDE.md when available
290
- - Falls back to framework conventions and best practices
291
-
292
- ## Related Documentation
293
-
294
- - **[Project Organization Standard](../../../docs/reference/PROJECT_ORGANIZATION.md)**: Comprehensive organization rules and guidelines
295
- - **[Project Structure](../../../docs/developer/STRUCTURE.md)**: Authoritative file organization reference
296
- - **[CLAUDE.md](../../../CLAUDE.md)**: Development guidelines with organization quick reference
452
+ - Can be run repeatedly safely (idempotent within scope)
453
+ - Detects existing patterns and respects them (PROJECT_ORGANIZATION.md, CONTRIBUTING.md)
454
+ - Falls back to framework-appropriate defaults if no pattern detected
455
+
456
+ ## What Gets Organized (by Default)
457
+
458
+ **ALL project files by default**, including:
459
+
460
+ **Documentation**:
461
+ - Markdown files (*.md)
462
+ - reStructuredText files (*.rst)
463
+ - Text documentation (*.txt in docs/ or with doc-like names)
464
+ - README files in various locations (except root README.md)
465
+ - Guide and tutorial files
466
+ - Architecture and design documents
467
+
468
+ **Source Code**:
469
+ - Python files (*.py) - organized into proper module structure
470
+ - JavaScript/TypeScript (*.js, *.ts, *.jsx, *.tsx)
471
+ - Other language source files
472
+ - Utilities and helper modules
473
+
474
+ **Tests**:
475
+ - Unit tests (*_test.*, test_*.*)
476
+ - Integration tests
477
+ - Test fixtures and utilities
478
+
479
+ **Scripts**:
480
+ - Shell scripts (*.sh, *.bash)
481
+ - Python scripts (identified by patterns)
482
+ - Build and deployment scripts
483
+
484
+ **Configuration** (with caution):
485
+ - Project-specific configs (not package.json, pyproject.toml, etc.)
486
+ - Environment config templates
487
+
488
+ **Files NEVER touched (protected)**:
489
+ - Root README.md, CHANGELOG.md, LICENSE.md
490
+ - Package files (package.json, pyproject.toml, Cargo.toml, etc.)
491
+ - Build artifacts (dist/, build/, target/, node_modules/, __pycache__/)
492
+ - Git files (.git/, .gitignore, .gitattributes)
493
+ - CI/CD files (.github/, .gitlab-ci.yml, etc.)
494
+ - Virtual environments (venv/, .venv/, env/)
297
495
 
298
496
  ## Related Commands
299
497
 
300
498
  - `/mpm-init`: Initialize or update project documentation and structure
301
- - `/mpm-doctor`: Diagnose project health and issues
499
+ - `/mpm-doctor`: Diagnose project health and issues (includes documentation checks)
302
500
  - `/mpm-status`: Check current project state
303
- - `/mpm-config`: Configure organization rules and preferences