claude-mpm 4.7.3__py3-none-any.whl → 4.7.5__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.
@@ -63,6 +63,10 @@ def manage_mpm_init(args):
63
63
  "preserve_custom": getattr(args, "preserve_custom", True),
64
64
  "skip_archive": getattr(args, "skip_archive", False),
65
65
  "dry_run": getattr(args, "dry_run", False),
66
+ "quick_update": getattr(args, "quick_update", False),
67
+ "non_interactive": getattr(args, "non_interactive", False),
68
+ "days": getattr(args, "days", 30),
69
+ "export": getattr(args, "export", None),
66
70
  }
67
71
 
68
72
  # Execute initialization (now synchronous)
@@ -30,13 +30,18 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
30
30
  ),
31
31
  epilog=(
32
32
  "Examples:\n"
33
- " claude-mpm mpm-init # Initialize/update current directory\n"
34
- " claude-mpm mpm-init --review # Review project state without changes\n"
35
- " claude-mpm mpm-init --update # Update existing CLAUDE.md\n"
36
- " claude-mpm mpm-init --organize # Organize project structure\n"
37
- " claude-mpm mpm-init --project-type web # Initialize as web project\n"
38
- " claude-mpm mpm-init --framework react # Initialize with React framework\n"
39
- " claude-mpm mpm-init /path/to/project --force # Force reinitialize project"
33
+ " claude-mpm mpm-init # Initialize/update current directory\n"
34
+ " claude-mpm mpm-init --review # Review project state without changes\n"
35
+ " claude-mpm mpm-init --update # Update existing CLAUDE.md\n"
36
+ " claude-mpm mpm-init --quick-update # Quick update based on recent git activity\n"
37
+ " claude-mpm mpm-init --quick-update --non-interactive # View activity report only\n"
38
+ " claude-mpm mpm-init --quick-update --days 7 # Analyze last 7 days\n"
39
+ " claude-mpm mpm-init --quick-update --export # Export report to default location\n"
40
+ " claude-mpm mpm-init --quick-update --export report.md # Export to specific file\n"
41
+ " claude-mpm mpm-init --organize # Organize project structure\n"
42
+ " claude-mpm mpm-init --project-type web # Initialize as web project\n"
43
+ " claude-mpm mpm-init --framework react # Initialize with React framework\n"
44
+ " claude-mpm mpm-init /path/to/project --force # Force reinitialize project"
40
45
  ),
41
46
  formatter_class=argparse.RawDescriptionHelpFormatter,
42
47
  )
@@ -81,6 +86,31 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
81
86
  action="store_true",
82
87
  help="Update existing CLAUDE.md instead of recreating (smart merge)",
83
88
  )
89
+ init_group.add_argument(
90
+ "--quick-update",
91
+ action="store_true",
92
+ help="Perform lightweight update based on recent git activity (default: 30 days)",
93
+ )
94
+ init_group.add_argument(
95
+ "--non-interactive",
96
+ action="store_true",
97
+ help="Non-interactive mode - display report only without prompting for changes (use with --quick-update)",
98
+ )
99
+ init_group.add_argument(
100
+ "--days",
101
+ type=int,
102
+ default=30,
103
+ choices=[7, 14, 30, 60, 90],
104
+ help="Number of days for git history analysis in quick update mode (default: 30)",
105
+ )
106
+ init_group.add_argument(
107
+ "--export",
108
+ type=str,
109
+ nargs="?",
110
+ const="auto",
111
+ metavar="PATH",
112
+ help="Export activity report to file (default: docs/reports/activity-report-{timestamp}.md)",
113
+ )
84
114
  init_group.add_argument(
85
115
  "--review",
86
116
  action="store_true",
@@ -75,9 +75,12 @@ Available Commands:
75
75
  /mpm-organize [--dry-run] [--force]
76
76
  Organize project file structure
77
77
 
78
- /mpm-init
78
+ /mpm-init [update]
79
79
  Initialize or update project documentation
80
80
 
81
+ /mpm-monitor [start|stop|restart|status|port]
82
+ Manage Socket.IO monitoring server and dashboard
83
+
81
84
  Use '/mpm-help <command>' for detailed help on a specific command.
82
85
  ```
83
86
 
@@ -1,4 +1,4 @@
1
- # /mpm-init
1
+ # /mpm-init [update]
2
2
 
3
3
  Initialize or intelligently update your project for optimal use with Claude Code and Claude MPM using the Agentic Coder Optimizer agent.
4
4
 
@@ -6,8 +6,9 @@ Initialize or intelligently update your project for optimal use with Claude Code
6
6
 
7
7
  ```
8
8
  /mpm-init # Auto-detects and offers update or create
9
+ /mpm-init update # Lightweight update based on recent git activity
9
10
  /mpm-init --review # Review project state without changes
10
- /mpm-init --update # Update existing CLAUDE.md
11
+ /mpm-init --update # Full update of existing CLAUDE.md
11
12
  /mpm-init --organize # Organize project structure
12
13
  /mpm-init --force # Force recreate from scratch
13
14
  /mpm-init --project-type web --framework react
@@ -18,6 +19,8 @@ Initialize or intelligently update your project for optimal use with Claude Code
18
19
 
19
20
  This command delegates to the Agentic Coder Optimizer agent to establish clear, single-path project standards for documentation, tooling, and workflows.
20
21
 
22
+ **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.
23
+
21
24
  **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.
22
25
 
23
26
  ## Features
@@ -135,6 +138,14 @@ When updating existing documentation:
135
138
  ```
136
139
  Analyzes project and offers appropriate action (create/update/review).
137
140
 
141
+ ### Quick Update (Lightweight)
142
+ ```bash
143
+ /mpm-init update
144
+ ```
145
+ Fast update based on recent 30-day git activity. Generates activity report and updates docs with minimal changes.
146
+
147
+ **Note**: Typing `/mpm-init update` executes `claude-mpm mpm-init --quick-update` automatically.
148
+
138
149
  ### Review Project State
139
150
  ```bash
140
151
  /mpm-init --review
@@ -173,10 +184,26 @@ Quick initialization without code analysis.
173
184
 
174
185
  ## Implementation
175
186
 
176
- This command executes:
187
+ **IMPORTANT**: This slash command accepts an optional `update` argument for quick updates.
188
+
189
+ **Argument Processing**:
190
+ - When you type `/mpm-init update`, Claude executes `claude-mpm mpm-init --quick-update`
191
+ - When you type `/mpm-init` (no argument), Claude executes standard mode
192
+ - The slash command handler automatically maps the `update` argument to the `--quick-update` flag
193
+
194
+ This command routes between different modes:
195
+
196
+ **Quick Update Mode** (`/mpm-init update`):
197
+ ```bash
198
+ claude-mpm mpm-init --quick-update
199
+ ```
200
+ This triggers a lightweight update that analyzes recent git activity (30 days) and generates an activity report.
201
+
202
+ **Standard Mode** (`/mpm-init`):
177
203
  ```bash
178
204
  claude-mpm mpm-init [options]
179
205
  ```
206
+ This triggers the full initialization or smart update flow.
180
207
 
181
208
  The command delegates to the Agentic Coder Optimizer agent which:
182
209
  1. Analyzes your project structure
@@ -187,6 +214,12 @@ The command delegates to the Agentic Coder Optimizer agent which:
187
214
  6. Performs AST analysis (if enabled)
188
215
  7. Organizes everything with priority rankings
189
216
 
217
+ **Quick Update Mode** performs:
218
+ 1. Git history analysis (last 30 days)
219
+ 2. Recent activity report generation
220
+ 3. Lightweight documentation updates
221
+ 4. Change summary for PM memory
222
+
190
223
  ## Expected Output
191
224
 
192
225
  ### For New Projects
@@ -206,12 +239,23 @@ The command delegates to the Agentic Coder Optimizer agent which:
206
239
  - ✅ **Files organized**: Misplaced files moved (if --organize)
207
240
  - ✅ **Change summary**: Report of what was updated
208
241
 
242
+ ### For Quick Update Mode (`/mpm-init update`)
243
+ - ✅ **Activity Report**: Summary of recent 30-day git activity
244
+ - ✅ **Recent Commits**: List of commits with authors and dates
245
+ - ✅ **Changed Files**: Files with most modifications
246
+ - ✅ **Active Branches**: Current and recent branch activity
247
+ - ✅ **Lightweight Doc Updates**: Append activity notes to CLAUDE.md
248
+ - ✅ **PM Memory Update**: Recommendations for project manager
249
+ - ✅ **Quick Check**: Verify CLAUDE.md freshness without full regeneration
250
+
209
251
  ## Notes
210
252
 
253
+ - **Quick Update vs Full Update**: Use `/mpm-init update` for fast activity-based updates (30 days), or `/mpm-init --update` for comprehensive doc refresh
211
254
  - **Smart Mode**: Automatically detects existing CLAUDE.md and offers update vs recreate
212
255
  - **Safe Updates**: Previous versions always archived before updating
213
256
  - **Custom Content**: Your project-specific sections are preserved by default
214
257
  - **Git Integration**: Analyzes recent commits to understand project evolution
258
+ - **Argument Processing**: The slash command processes the `update` argument and routes to `--quick-update` flag
215
259
  - The command uses the Agentic Coder Optimizer agent for implementation
216
260
  - AST analysis is enabled by default for comprehensive documentation
217
261
  - Priority rankings help AI agents focus on critical instructions first
@@ -0,0 +1,409 @@
1
+ # Manage Socket.IO monitoring server
2
+
3
+ Control the Claude MPM monitoring server that powers the real-time dashboard interface for event tracking and project visualization.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /mpm-monitor [subcommand] [options]
9
+ ```
10
+
11
+ ## Description
12
+
13
+ This slash command manages the Socket.IO monitoring server that provides real-time event tracking and visualization through a web-based dashboard. The monitoring server listens for events from the Claude MPM framework and displays them in an interactive interface accessible via web browser.
14
+
15
+ The monitoring server typically runs on port 8765 (or auto-selects an available port in the range 8765-8785) and provides a real-time dashboard at `http://localhost:8765`.
16
+
17
+ ## Available Subcommands
18
+
19
+ ### Start Monitoring Server
20
+ Start the Socket.IO monitoring server to enable real-time event tracking.
21
+
22
+ ```
23
+ /mpm-monitor start [--port PORT] [--host HOST] [--dashboard] [--dashboard-port PORT] [--foreground] [--background] [--force] [--no-reclaim]
24
+ ```
25
+
26
+ **Options:**
27
+ - `--port PORT`: Specific port to start server on (auto-selects if not specified, range: 8765-8785)
28
+ - `--host HOST`: Host to bind to (default: localhost)
29
+ - `--dashboard`: Enable web dashboard interface (enabled by default)
30
+ - `--dashboard-port PORT`: Dashboard port number (default: 8766)
31
+ - `--foreground`: Run server in foreground mode (blocks terminal)
32
+ - `--background`: Run server in background/daemon mode (default behavior)
33
+ - `--force`: Force kill daemon processes to reclaim ports (use with caution)
34
+ - `--no-reclaim`: Don't automatically reclaim ports from debug scripts
35
+
36
+ **Examples:**
37
+ ```
38
+ /mpm-monitor start
39
+ /mpm-monitor start --port 8765
40
+ /mpm-monitor start --port 8770 --dashboard --dashboard-port 8771
41
+ /mpm-monitor start --foreground
42
+ /mpm-monitor start --force --port 8765
43
+ ```
44
+
45
+ **Default Behavior:**
46
+ - Runs in background/daemon mode
47
+ - Auto-selects first available port in range 8765-8785
48
+ - Enables web dashboard on port 8766
49
+ - Gracefully reclaims ports from debug scripts (not daemons)
50
+
51
+ ### Stop Monitoring Server
52
+ Stop a running monitoring server instance.
53
+
54
+ ```
55
+ /mpm-monitor stop [--port PORT] [--force]
56
+ ```
57
+
58
+ **Options:**
59
+ - `--port PORT`: Port of server to stop (stops all instances if not specified)
60
+ - `--force`: Force stop even if clients are connected
61
+
62
+ **Examples:**
63
+ ```
64
+ /mpm-monitor stop
65
+ /mpm-monitor stop --port 8765
66
+ /mpm-monitor stop --force
67
+ ```
68
+
69
+ **Behavior:**
70
+ - Without `--port`: Stops all running monitoring server instances
71
+ - With `--port`: Stops only the server on specified port
72
+ - Without `--force`: Gracefully disconnects clients before stopping
73
+ - With `--force`: Immediately stops server regardless of client connections
74
+
75
+ ### Restart Monitoring Server
76
+ Restart the monitoring server (stop and start in one operation).
77
+
78
+ ```
79
+ /mpm-monitor restart [--port PORT] [--host HOST]
80
+ ```
81
+
82
+ **Options:**
83
+ - `--port PORT`: Port to restart on (uses previous port if not specified)
84
+ - `--host HOST`: Host to bind to (default: localhost)
85
+
86
+ **Examples:**
87
+ ```
88
+ /mpm-monitor restart
89
+ /mpm-monitor restart --port 8770
90
+ /mpm-monitor restart --port 8765 --host 0.0.0.0
91
+ ```
92
+
93
+ **Behavior:**
94
+ - Stops existing server instance
95
+ - Starts new instance with same or updated configuration
96
+ - Preserves client connections where possible
97
+
98
+ ### Check Server Status
99
+ Display status information about running monitoring servers.
100
+
101
+ ```
102
+ /mpm-monitor status [--verbose] [--show-ports]
103
+ ```
104
+
105
+ **Options:**
106
+ - `--verbose`: Show detailed status information (process IDs, uptime, connections)
107
+ - `--show-ports`: Show status of all ports in the range (8765-8785)
108
+
109
+ **Examples:**
110
+ ```
111
+ /mpm-monitor status
112
+ /mpm-monitor status --verbose
113
+ /mpm-monitor status --show-ports
114
+ ```
115
+
116
+ **Status Information:**
117
+ - Running server instances and their ports
118
+ - Process IDs and uptime
119
+ - Number of connected clients
120
+ - Dashboard URLs
121
+ - Port availability status (with --show-ports)
122
+
123
+ ### Start on Specific Port
124
+ Start or restart monitoring server on a specific port (convenience command).
125
+
126
+ ```
127
+ /mpm-monitor port <PORT> [--host HOST] [--force] [--no-reclaim]
128
+ ```
129
+
130
+ **Arguments:**
131
+ - `PORT`: Port number to use (required)
132
+
133
+ **Options:**
134
+ - `--host HOST`: Host to bind to (default: localhost)
135
+ - `--force`: Force kill daemon processes to reclaim port (use with caution)
136
+ - `--no-reclaim`: Don't automatically reclaim port from debug scripts
137
+
138
+ **Examples:**
139
+ ```
140
+ /mpm-monitor port 8765
141
+ /mpm-monitor port 8770 --host 0.0.0.0
142
+ /mpm-monitor port 8765 --force
143
+ ```
144
+
145
+ **Behavior:**
146
+ - If server already running on port: restarts it
147
+ - If port is in use by another process: fails (unless --force)
148
+ - Auto-reclaims ports from debug scripts (unless --no-reclaim)
149
+
150
+ ## Implementation
151
+
152
+ This command executes:
153
+ ```bash
154
+ claude-mpm monitor [subcommand] [options]
155
+ ```
156
+
157
+ The slash command passes through to the actual CLI monitoring system, which manages Socket.IO server processes.
158
+
159
+ ## Monitoring Features
160
+
161
+ ### Real-Time Event Tracking
162
+ The monitoring server captures and displays:
163
+ - **Agent Events**: Task delegation, completion, errors
164
+ - **Tool Usage**: File operations, bash commands, API calls
165
+ - **System Events**: Server startup/shutdown, configuration changes
166
+ - **Project Events**: File changes, git operations, test results
167
+ - **Memory Operations**: Knowledge persistence, context updates
168
+ - **WebSocket Events**: Client connections, disconnections, errors
169
+
170
+ ### Web Dashboard
171
+ The dashboard interface provides:
172
+ - **Live Event Stream**: Real-time event feed with filtering
173
+ - **Project Overview**: Active agents, current tasks, system status
174
+ - **Performance Metrics**: Event rates, processing times, error counts
175
+ - **Event History**: Searchable log of past events
176
+ - **Connection Status**: Client connections, server health
177
+ - **Visualization**: Event timelines, agent activity graphs
178
+
179
+ ### Port Management
180
+ The monitoring server implements smart port selection:
181
+ - **Auto-Selection**: Finds first available port in range 8765-8785
182
+ - **Port Reclamation**: Gracefully reclaims ports from debug scripts
183
+ - **Conflict Resolution**: Detects and handles port conflicts
184
+ - **Multi-Instance**: Supports multiple servers on different ports
185
+
186
+ ## Expected Output
187
+
188
+ ### Start Command Output
189
+ ```
190
+ Starting Socket.IO monitoring server...
191
+
192
+ ✓ Server started successfully
193
+ - Server URL: http://localhost:8765
194
+ - Dashboard URL: http://localhost:8766
195
+ - Process ID: 12345
196
+ - Mode: background
197
+
198
+ Monitoring server is ready for connections.
199
+ Open http://localhost:8766 in your browser to view the dashboard.
200
+ ```
201
+
202
+ ### Stop Command Output
203
+ ```
204
+ Stopping monitoring server...
205
+
206
+ ✓ Server on port 8765 stopped successfully
207
+ - Disconnected 3 clients gracefully
208
+ - Process 12345 terminated
209
+
210
+ Monitoring server stopped.
211
+ ```
212
+
213
+ ### Status Command Output
214
+ ```
215
+ Monitoring Server Status
216
+ ========================
217
+
218
+ Active Servers: 1
219
+
220
+ Server 1:
221
+ - Port: 8765
222
+ - Dashboard: http://localhost:8766
223
+ - Process ID: 12345
224
+ - Uptime: 2h 15m 30s
225
+ - Connected Clients: 3
226
+ - Status: Running
227
+
228
+ Dashboard accessible at: http://localhost:8766
229
+ ```
230
+
231
+ ### Status with --verbose Output
232
+ ```
233
+ Monitoring Server Status (Detailed)
234
+ ====================================
235
+
236
+ Active Servers: 1
237
+
238
+ Server 1:
239
+ - Port: 8765
240
+ - Host: localhost
241
+ - Dashboard: http://localhost:8766
242
+ - Dashboard Port: 8766
243
+ - Process ID: 12345
244
+ - Started: 2025-01-08 14:30:15
245
+ - Uptime: 2h 15m 30s
246
+ - Connected Clients: 3
247
+ - Events Processed: 1,247
248
+ - Average Event Rate: 0.17/sec
249
+ - Status: Running (Healthy)
250
+
251
+ Client Connections:
252
+ 1. Browser (127.0.0.1:54321) - Connected 2h 10m ago
253
+ 2. CLI Monitor (127.0.0.1:54322) - Connected 1h 45m ago
254
+ 3. External Tool (127.0.0.1:54323) - Connected 30m ago
255
+
256
+ Dashboard accessible at: http://localhost:8766
257
+ ```
258
+
259
+ ### Status with --show-ports Output
260
+ ```
261
+ Monitoring Server Status
262
+ ========================
263
+
264
+ Active Servers: 1
265
+ Available Ports: 19
266
+
267
+ Port Status (8765-8785):
268
+ 8765: ✓ RUNNING (PID 12345, 3 clients)
269
+ 8766: • IN USE (Dashboard for 8765)
270
+ 8767: ○ AVAILABLE
271
+ 8768: ○ AVAILABLE
272
+ 8769: ○ AVAILABLE
273
+ 8770: ○ AVAILABLE
274
+ ... (additional ports)
275
+ 8785: ○ AVAILABLE
276
+
277
+ Legend:
278
+ ✓ RUNNING - Monitor server active
279
+ • IN USE - Used by another process
280
+ ○ AVAILABLE - Ready for use
281
+
282
+ Dashboard accessible at: http://localhost:8766
283
+ ```
284
+
285
+ ### Error Output Examples
286
+ ```
287
+ Error: Port 8765 is already in use by another process
288
+ Suggestion: Use --port to specify a different port or --force to reclaim
289
+
290
+ Error: Failed to start monitoring server
291
+ Reason: Permission denied on port 8765
292
+ Suggestion: Try a port > 1024 or run with appropriate permissions
293
+
294
+ Error: Server on port 8765 is not running
295
+ Suggestion: Use '/mpm-monitor start' to start the server
296
+ ```
297
+
298
+ ## Use Cases
299
+
300
+ ### Development Workflow
301
+ 1. **Start monitoring** before beginning development session
302
+ 2. **View dashboard** to track agent activity and events in real-time
303
+ 3. **Monitor errors** to catch issues as they occur
304
+ 4. **Stop monitoring** when done or to free resources
305
+
306
+ ### Debugging
307
+ 1. **Start with --verbose** to see detailed process information
308
+ 2. **Check status** to verify server is running and clients are connected
309
+ 3. **Review dashboard** to examine event history and error patterns
310
+ 4. **Restart** if server becomes unresponsive
311
+
312
+ ### Multiple Projects
313
+ 1. **Use --port** to run separate monitors for different projects
314
+ 2. **Check --show-ports** to see which ports are available
315
+ 3. **Manage multiple instances** independently
316
+
317
+ ### Production Monitoring
318
+ 1. **Start with --background** to run as daemon (default)
319
+ 2. **Configure --host 0.0.0.0** to allow remote access
320
+ 3. **Check status regularly** to ensure server health
321
+ 4. **Use --force carefully** only when necessary to reclaim ports
322
+
323
+ ## Troubleshooting
324
+
325
+ ### Port Already in Use
326
+ ```bash
327
+ # Check what's using the port
328
+ /mpm-monitor status --show-ports
329
+
330
+ # Start on a different port
331
+ /mpm-monitor start --port 8770
332
+
333
+ # Or force reclaim (use cautiously)
334
+ /mpm-monitor start --port 8765 --force
335
+ ```
336
+
337
+ ### Server Won't Start
338
+ ```bash
339
+ # Check detailed status
340
+ /mpm-monitor status --verbose
341
+
342
+ # Try manual restart
343
+ /mpm-monitor stop --force
344
+ /mpm-monitor start
345
+ ```
346
+
347
+ ### Dashboard Not Accessible
348
+ ```bash
349
+ # Verify server is running
350
+ /mpm-monitor status
351
+
352
+ # Check dashboard port
353
+ /mpm-monitor status --verbose
354
+
355
+ # Restart with specific dashboard port
356
+ /mpm-monitor restart --dashboard-port 8766
357
+ ```
358
+
359
+ ### Multiple Servers Running
360
+ ```bash
361
+ # Check all running servers
362
+ /mpm-monitor status --show-ports
363
+
364
+ # Stop all servers
365
+ /mpm-monitor stop
366
+
367
+ # Start single server
368
+ /mpm-monitor start
369
+ ```
370
+
371
+ ## Related Commands
372
+
373
+ - `/mpm-status`: Show overall system status including monitoring server
374
+ - `/mpm-doctor`: Diagnose monitoring and server issues
375
+ - `/mpm-config`: Configure monitoring server settings
376
+ - `/mpm-init`: Initialize project with monitoring configuration
377
+
378
+ ## Notes
379
+
380
+ - **Default Mode**: Server runs in background/daemon mode by default
381
+ - **Port Range**: Auto-selects from 8765-8785 if not specified
382
+ - **Dashboard**: Web interface is enabled by default on port 8766
383
+ - **Graceful Shutdown**: Server attempts to disconnect clients gracefully on stop
384
+ - **Force Reclaim**: The `--force` option should be used with caution as it kills processes
385
+ - **Debug Scripts**: Ports are automatically reclaimed from debug scripts (not daemons) unless `--no-reclaim` is specified
386
+ - **Multiple Instances**: You can run multiple monitoring servers on different ports for different projects
387
+ - **Security**: By default, server only binds to localhost. Use `--host 0.0.0.0` for remote access (consider security implications)
388
+
389
+ ## Technical Details
390
+
391
+ ### Socket.IO Server
392
+ - **Protocol**: Socket.IO 4.x with WebSocket transport
393
+ - **Port Range**: 8765-8785 (auto-selection)
394
+ - **Dashboard**: Static web application served on separate port
395
+ - **Events**: Real-time bidirectional event streaming
396
+ - **Clients**: Supports multiple simultaneous client connections
397
+
398
+ ### Process Management
399
+ - **Daemon Mode**: Background process with PID tracking
400
+ - **Foreground Mode**: Blocking process (useful for debugging)
401
+ - **Health Checks**: Automatic health monitoring
402
+ - **Graceful Shutdown**: Clean client disconnection on stop
403
+
404
+ ### Port Allocation Strategy
405
+ 1. Check if requested port is available
406
+ 2. If not specified, scan range 8765-8785
407
+ 3. Detect port conflicts with existing processes
408
+ 4. Optionally reclaim ports from debug scripts (not daemons)
409
+ 5. Fail gracefully if no ports available
@@ -15,7 +15,9 @@ Organize your project files into proper directories using intelligent pattern de
15
15
 
16
16
  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.
17
17
 
18
- **Smart Organization**: The agent first checks CLAUDE.md for project-specific organization guidelines. If not found, it applies framework-specific conventions and industry best practices.
18
+ **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.
19
+
20
+ **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.
19
21
 
20
22
  ## Features
21
23
 
@@ -47,21 +49,26 @@ This slash command delegates to the **Project Organizer agent** to perform thoro
47
49
 
48
50
  ## What This Command Does
49
51
 
50
- ### 1. CLAUDE.md Analysis
52
+ ### 1. Organization Standard Verification
53
+ - Ensures `docs/reference/PROJECT_ORGANIZATION.md` exists and is current
54
+ - Creates or updates the standard if needed
55
+ - Links the standard from CLAUDE.md for easy reference
56
+
57
+ ### 2. CLAUDE.md Analysis
51
58
  - Checks for existing organization guidelines
52
59
  - Extracts project-specific rules and conventions
53
60
  - Identifies priority areas for organization
54
61
 
55
- ### 2. Project Structure Detection
62
+ ### 3. Project Structure Detection
56
63
  - Scans directory hierarchy and patterns
57
64
  - Identifies naming conventions (camelCase, kebab-case, snake_case)
58
65
  - Maps current file type locations
59
66
  - Detects framework-specific conventions (Next.js, Django, Rails, etc.)
60
67
  - Determines organization type (feature/type/domain-based)
61
68
 
62
- ### 3. File Organization Strategy
69
+ ### 4. File Organization Strategy
63
70
 
64
- The agent organizes files into standard directories:
71
+ The agent organizes files into standard directories per [PROJECT_ORGANIZATION.md](../../../docs/reference/PROJECT_ORGANIZATION.md):
65
72
 
66
73
  ```
67
74
  docs/ # All documentation files (*.md, guides, architecture)
@@ -72,7 +79,7 @@ src/ # Source code following framework conventions
72
79
  .claude/ # Claude MPM configuration and agents
73
80
  ```
74
81
 
75
- ### 4. Framework-Specific Handling
82
+ ### 5. Framework-Specific Handling
76
83
 
77
84
  **Next.js Projects**:
78
85
  - Respects `pages/`, `app/`, `public/`, API routes
@@ -93,7 +100,7 @@ src/ # Source code following framework conventions
93
100
  - Detects and respects framework conventions
94
101
  - Applies appropriate organizational patterns
95
102
 
96
- ### 5. Safe File Movement
103
+ ### 6. Safe File Movement
97
104
 
98
105
  For each file to be moved:
99
106
  1. Analyzes file purpose and dependencies
@@ -102,14 +109,14 @@ For each file to be moved:
102
109
  4. Updates import paths in affected files
103
110
  5. Validates build still works
104
111
 
105
- ### 6. Backup Creation
112
+ ### 7. Backup Creation
106
113
 
107
114
  Before major reorganization:
108
115
  ```bash
109
116
  backup_YYYYMMDD_HHMMSS.tar.gz # Complete project backup
110
117
  ```
111
118
 
112
- ### 7. Import Path Updates
119
+ ### 8. Import Path Updates
113
120
 
114
121
  Automatically updates:
115
122
  - Python imports (`from old.path import X` → `from new.path import X`)
@@ -117,7 +124,7 @@ Automatically updates:
117
124
  - Relative path references
118
125
  - Configuration file paths
119
126
 
120
- ### 8. Organization Report
127
+ ### 9. Organization Report
121
128
 
122
129
  Generates detailed report including:
123
130
  - Files moved and their new locations
@@ -274,6 +281,12 @@ Use `/mpm-organize` when:
274
281
  - Follows guidelines in CLAUDE.md when available
275
282
  - Falls back to framework conventions and best practices
276
283
 
284
+ ## Related Documentation
285
+
286
+ - **[Project Organization Standard](../../../docs/reference/PROJECT_ORGANIZATION.md)**: Comprehensive organization rules and guidelines
287
+ - **[Project Structure](../../../docs/developer/STRUCTURE.md)**: Authoritative file organization reference
288
+ - **[CLAUDE.md](../../../CLAUDE.md)**: Development guidelines with organization quick reference
289
+
277
290
  ## Related Commands
278
291
 
279
292
  - `/mpm-init`: Initialize or update project documentation and structure