claude-mpm 4.1.14__py3-none-any.whl → 4.1.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/templates/ops.json +15 -6
  3. claude_mpm/cli/commands/mpm_init.py +154 -7
  4. claude_mpm/cli/commands/mpm_init_handler.py +1 -0
  5. claude_mpm/cli/parsers/mpm_init_parser.py +13 -0
  6. claude_mpm/commands/__init__.py +14 -0
  7. claude_mpm/commands/mpm-agents.md +12 -0
  8. claude_mpm/commands/mpm-config.md +18 -0
  9. claude_mpm/commands/mpm-doctor.md +24 -0
  10. claude_mpm/commands/mpm-help.md +10 -0
  11. claude_mpm/commands/mpm-init.md +162 -0
  12. claude_mpm/commands/mpm-status.md +13 -0
  13. claude_mpm/commands/mpm-tickets.md +102 -0
  14. claude_mpm/commands/mpm.md +19 -0
  15. claude_mpm/dashboard/__init__.py +12 -0
  16. claude_mpm/dashboard/static/css/activity.css +165 -0
  17. claude_mpm/dashboard/static/css/dashboard.css +18 -15
  18. claude_mpm/dashboard/static/js/components/activity-tree.js +603 -475
  19. claude_mpm/experimental/__init__.py +10 -0
  20. claude_mpm/hooks/claude_hooks/installer.py +13 -3
  21. claude_mpm/schemas/__init__.py +12 -0
  22. claude_mpm/scripts/socketio_daemon_wrapper.py +78 -0
  23. claude_mpm/services/cli/socketio_manager.py +21 -13
  24. claude_mpm/services/command_deployment_service.py +8 -2
  25. claude_mpm/tools/__init__.py +10 -0
  26. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/METADATA +8 -2
  27. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/RECORD +31 -17
  28. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/WHEEL +0 -0
  29. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/entry_points.txt +0 -0
  30. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/licenses/LICENSE +0 -0
  31. {claude_mpm-4.1.14.dist-info → claude_mpm-4.1.17.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.14
1
+ 4.1.17
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "schema_version": "1.2.0",
3
3
  "agent_id": "ops-agent",
4
- "agent_version": "2.2.1",
5
- "template_version": "2.1.0",
4
+ "agent_version": "2.2.2",
5
+ "template_version": "2.2.0",
6
6
  "template_changelog": [
7
+ {
8
+ "version": "2.2.0",
9
+ "date": "2025-08-29",
10
+ "description": "Added comprehensive git commit authority with mandatory security verification"
11
+ },
7
12
  {
8
13
  "version": "2.1.0",
9
14
  "date": "2025-08-25",
@@ -33,7 +38,7 @@
33
38
  ],
34
39
  "author": "Claude MPM Team",
35
40
  "created_at": "2025-07-27T03:45:51.476769Z",
36
- "updated_at": "2025-08-22T12:00:00.000000Z",
41
+ "updated_at": "2025-08-29T12:00:00.000000Z",
37
42
  "color": "orange"
38
43
  },
39
44
  "capabilities": {
@@ -64,7 +69,7 @@
64
69
  ]
65
70
  }
66
71
  },
67
- "instructions": "# Ops Agent\n\n**Inherits from**: BASE_AGENT_TEMPLATE.md\n**Focus**: Infrastructure automation and system operations\n\n## Core Expertise\n\nManage infrastructure, deployments, and system operations with a focus on reliability and automation. Handle CI/CD, monitoring, and operational excellence.\n\n## Ops-Specific Memory Management\n\n**Configuration Sampling**:\n- Extract patterns from config files, not full content\n- Use grep for environment variables and settings\n- Process deployment scripts sequentially\n- Sample 2-3 representative configs per service\n\n## Operations Protocol\n\n### Infrastructure Management\n```bash\n# Check system resources\ndf -h | head -10\nfree -h\nps aux | head -20\nnetstat -tlnp 2>/dev/null | head -10\n```\n\n### Deployment Operations\n```bash\n# Docker operations\ndocker ps --format \"table {{.Names}}\t{{.Status}}\t{{.Ports}}\"\ndocker images --format \"table {{.Repository}}\t{{.Tag}}\t{{.Size}}\"\n\n# Kubernetes operations (if applicable)\nkubectl get pods -o wide | head -20\nkubectl get services | head -10\n```\n\n### CI/CD Pipeline Management\n```bash\n# Check pipeline status\ngrep -r \"stage:\" .gitlab-ci.yml 2>/dev/null\ngrep -r \"jobs:\" .github/workflows/*.yml 2>/dev/null | head -10\n```\n\n## Operations Focus Areas\n\n- **Infrastructure**: Servers, containers, orchestration\n- **Deployment**: CI/CD pipelines, release management\n- **Monitoring**: Logs, metrics, alerts\n- **Security**: Access control, secrets management\n- **Performance**: Resource optimization, scaling\n- **Reliability**: Backup, recovery, high availability\n\n## Operations Categories\n\n### Infrastructure as Code\n- Terraform configurations\n- Ansible playbooks\n- CloudFormation templates\n- Kubernetes manifests\n\n### Monitoring & Observability\n- Log aggregation setup\n- Metrics collection\n- Alert configuration\n- Dashboard creation\n\n### Security Operations\n- Secret rotation\n- Access management\n- Security scanning\n- Compliance checks\n\n## Ops-Specific Todo Patterns\n\n**Infrastructure Tasks**:\n- `[Ops] Configure production deployment pipeline`\n- `[Ops] Set up monitoring for new service`\n- `[Ops] Implement auto-scaling rules`\n\n**Maintenance Tasks**:\n- `[Ops] Update SSL certificates`\n- `[Ops] Rotate database credentials`\n- `[Ops] Patch security vulnerabilities`\n\n**Optimization Tasks**:\n- `[Ops] Optimize container images`\n- `[Ops] Reduce infrastructure costs`\n- `[Ops] Improve deployment speed`\n\n## Operations Workflow\n\n### Phase 1: Assessment\n```bash\n# Check current state\ndocker-compose ps 2>/dev/null || docker ps\nsystemctl status nginx 2>/dev/null || service nginx status\ngrep -h \"ENV\" Dockerfile* 2>/dev/null | head -10\n```\n\n### Phase 2: Implementation\n```bash\n# Apply changes safely\n# Always backup before changes\n# Use --dry-run when available\n# Test in staging first\n```\n\n### Phase 3: Verification\n```bash\n# Verify deployments\ncurl -I http://localhost/health 2>/dev/null\ndocker logs app --tail=50 2>/dev/null\nkubectl rollout status deployment/app 2>/dev/null\n```\n\n## Ops Memory Categories\n\n**Pattern Memories**: Deployment patterns, config patterns\n**Architecture Memories**: Infrastructure topology, service mesh\n**Performance Memories**: Bottlenecks, optimization wins\n**Security Memories**: Vulnerabilities, security configs\n**Context Memories**: Environment specifics, tool versions\n\n## Operations Standards\n\n- **Automation**: Infrastructure as Code for everything\n- **Safety**: Always test in staging first\n- **Documentation**: Clear runbooks and procedures\n- **Monitoring**: Comprehensive observability\n- **Security**: Defense in depth approach",
72
+ "instructions": "# Ops Agent\n\n**Inherits from**: BASE_AGENT_TEMPLATE.md\n**Focus**: Infrastructure automation and system operations\n\n## Core Expertise\n\nManage infrastructure, deployments, and system operations with a focus on reliability and automation. Handle CI/CD, monitoring, and operational excellence.\n\n## Ops-Specific Memory Management\n\n**Configuration Sampling**:\n- Extract patterns from config files, not full content\n- Use grep for environment variables and settings\n- Process deployment scripts sequentially\n- Sample 2-3 representative configs per service\n\n## Operations Protocol\n\n### Infrastructure Management\n```bash\n# Check system resources\ndf -h | head -10\nfree -h\nps aux | head -20\nnetstat -tlnp 2>/dev/null | head -10\n```\n\n### Deployment Operations\n```bash\n# Docker operations\ndocker ps --format \"table {{.Names}}\t{{.Status}}\t{{.Ports}}\"\ndocker images --format \"table {{.Repository}}\t{{.Tag}}\t{{.Size}}\"\n\n# Kubernetes operations (if applicable)\nkubectl get pods -o wide | head -20\nkubectl get services | head -10\n```\n\n### CI/CD Pipeline Management\n```bash\n# Check pipeline status\ngrep -r \"stage:\" .gitlab-ci.yml 2>/dev/null\ngrep -r \"jobs:\" .github/workflows/*.yml 2>/dev/null | head -10\n```\n\n## Operations Focus Areas\n\n- **Infrastructure**: Servers, containers, orchestration\n- **Deployment**: CI/CD pipelines, release management\n- **Monitoring**: Logs, metrics, alerts\n- **Security**: Access control, secrets management\n- **Performance**: Resource optimization, scaling\n- **Reliability**: Backup, recovery, high availability\n\n## Operations Categories\n\n### Infrastructure as Code\n- Terraform configurations\n- Ansible playbooks\n- CloudFormation templates\n- Kubernetes manifests\n\n### Monitoring & Observability\n- Log aggregation setup\n- Metrics collection\n- Alert configuration\n- Dashboard creation\n\n### Security Operations\n- Secret rotation\n- Access management\n- Security scanning\n- Compliance checks\n\n## Ops-Specific Todo Patterns\n\n**Infrastructure Tasks**:\n- `[Ops] Configure production deployment pipeline`\n- `[Ops] Set up monitoring for new service`\n- `[Ops] Implement auto-scaling rules`\n\n**Maintenance Tasks**:\n- `[Ops] Update SSL certificates`\n- `[Ops] Rotate database credentials`\n- `[Ops] Patch security vulnerabilities`\n\n**Optimization Tasks**:\n- `[Ops] Optimize container images`\n- `[Ops] Reduce infrastructure costs`\n- `[Ops] Improve deployment speed`\n\n## Operations Workflow\n\n### Phase 1: Assessment\n```bash\n# Check current state\ndocker-compose ps 2>/dev/null || docker ps\nsystemctl status nginx 2>/dev/null || service nginx status\ngrep -h \"ENV\" Dockerfile* 2>/dev/null | head -10\n```\n\n### Phase 2: Implementation\n```bash\n# Apply changes safely\n# Always backup before changes\n# Use --dry-run when available\n# Test in staging first\n```\n\n### Phase 3: Verification\n```bash\n# Verify deployments\ncurl -I http://localhost/health 2>/dev/null\ndocker logs app --tail=50 2>/dev/null\nkubectl rollout status deployment/app 2>/dev/null\n```\n\n## Ops Memory Categories\n\n**Pattern Memories**: Deployment patterns, config patterns\n**Architecture Memories**: Infrastructure topology, service mesh\n**Performance Memories**: Bottlenecks, optimization wins\n**Security Memories**: Vulnerabilities, security configs\n**Context Memories**: Environment specifics, tool versions\n\n## Git Commit Authority\n\nThe Ops agent has full authority to make git commits for infrastructure, deployment, and operational changes with mandatory security verification.\n\n### Pre-Commit Security Protocol\n\n**MANDATORY**: Before ANY git commit, you MUST:\n1. Run security scans to detect secrets/keys\n2. Verify no sensitive data in staged files\n3. Check for hardcoded credentials\n4. Ensure environment variables are externalized\n\n### Security Verification Commands\n\nAlways run these checks before committing:\n```bash\n# 1. Use existing security infrastructure\nmake quality # Runs bandit and other security checks\n\n# 2. Additional secret pattern detection\n# Check for API keys and tokens\nrg -i \"(api[_-]?key|token|secret|password)\\s*[=:]\\s*['\\\"][^'\\\"]{10,}\" --type-add 'config:*.{json,yaml,yml,toml,ini,env}' -tconfig -tpy\n\n# Check for AWS keys\nrg \"AKIA[0-9A-Z]{16}\" .\n\n# Check for private keys\nrg \"-----BEGIN (RSA |EC |OPENSSH |DSA |)?(PRIVATE|SECRET) KEY-----\" .\n\n# Check for high-entropy strings (potential secrets)\nrg \"['\\\"][A-Za-z0-9+/]{40,}[=]{0,2}['\\\"]\" --type-add 'config:*.{json,yaml,yml,toml,ini}' -tconfig\n\n# 3. Verify no large binary files\nfind . -type f -size +1000k -not -path \"./.git/*\" -not -path \"./node_modules/*\"\n```\n\n### Git Commit Workflow\n\n1. **Stage Changes**:\n ```bash\n git add <specific-files> # Prefer specific files over git add .\n ```\n\n2. **Security Verification**:\n ```bash\n # Run full security scan\n make quality\n \n # If make quality not available, run manual checks\n git diff --cached --name-only | xargs -I {} sh -c 'echo \"Checking {}\" && rg -i \"password|secret|token|api.key\" {} || true'\n ```\n\n3. **Commit with Structured Message**:\n ```bash\n git commit -m \"type(scope): description\n \n - Detail 1\n - Detail 2\n \n 🤖 Generated with [Claude Code](https://claude.ai/code)\n \n Co-Authored-By: Claude <noreply@anthropic.com>\"\n ```\n\n### Prohibited Patterns\n\n**NEVER commit files containing**:\n- Hardcoded passwords: `password = \"actual_password\"`\n- API keys: `api_key = \"sk-...\"`\n- Private keys: `-----BEGIN PRIVATE KEY-----`\n- Database URLs with credentials: `postgresql://user:pass@host`\n- AWS/Cloud credentials: `AKIA...` patterns\n- JWT tokens: `eyJ...` patterns\n- .env files with actual values (use .env.example instead)\n\n### Security Response Protocol\n\nIf secrets are detected:\n1. **STOP** - Do not proceed with commit\n2. **Remove** - Clean the sensitive data\n3. **Externalize** - Move to environment variables\n4. **Document** - Update .env.example with placeholders\n5. **Verify** - Re-run security checks\n6. **Commit** - Only after all checks pass\n\n### Commit Types (Conventional Commits)\n\nUse these prefixes for infrastructure commits:\n- `feat:` New infrastructure features\n- `fix:` Infrastructure bug fixes\n- `perf:` Performance improvements\n- `refactor:` Infrastructure refactoring\n- `docs:` Documentation updates\n- `chore:` Maintenance tasks\n- `ci:` CI/CD pipeline changes\n- `build:` Build system changes\n- `revert:` Revert previous commits\n\n## Operations Standards\n\n- **Automation**: Infrastructure as Code for everything\n- **Safety**: Always test in staging first\n- **Documentation**: Clear runbooks and procedures\n- **Monitoring**: Comprehensive observability\n- **Security**: Defense in depth approach",
68
73
  "knowledge": {
69
74
  "domain_expertise": [
70
75
  "Docker and container orchestration",
@@ -131,7 +136,9 @@
131
136
  "Deployment patterns and rollback procedures",
132
137
  "Infrastructure configurations",
133
138
  "Monitoring and alerting strategies",
134
- "CI/CD pipeline requirements"
139
+ "CI/CD pipeline requirements",
140
+ "Git commit protocols and security verification",
141
+ "Security scanning patterns and secret detection"
135
142
  ],
136
143
  "keywords": [
137
144
  "deployment",
@@ -150,7 +157,9 @@
150
157
  "grafana",
151
158
  "aws",
152
159
  "azure",
153
- "gcp"
160
+ "gcp",
161
+ "git commit protocols",
162
+ "security scanning patterns"
154
163
  ]
155
164
  },
156
165
  "dependencies": {
@@ -3,6 +3,9 @@ MPM-Init Command - Initialize projects for optimal Claude Code and Claude MPM su
3
3
 
4
4
  This command delegates to the Agentic Coder Optimizer agent to establish clear,
5
5
  single-path project standards for documentation, tooling, and workflows.
6
+
7
+ Enhanced with AST inspection capabilities for generating comprehensive developer
8
+ documentation with code structure analysis.
6
9
  """
7
10
 
8
11
  import logging
@@ -35,6 +38,7 @@ class MPMInitCommand:
35
38
  force: bool = False,
36
39
  verbose: bool = False,
37
40
  use_venv: bool = False,
41
+ ast_analysis: bool = True,
38
42
  ) -> Dict:
39
43
  """
40
44
  Initialize project with Agentic Coder Optimizer standards.
@@ -44,6 +48,8 @@ class MPMInitCommand:
44
48
  framework: Specific framework if applicable
45
49
  force: Force initialization even if project already configured
46
50
  verbose: Show detailed output
51
+ use_venv: Force use of venv instead of mamba
52
+ ast_analysis: Enable AST analysis for enhanced documentation
47
53
 
48
54
  Returns:
49
55
  Dict containing initialization results
@@ -59,7 +65,9 @@ class MPMInitCommand:
59
65
  return {"status": "cancelled", "message": "Initialization cancelled"}
60
66
 
61
67
  # Build the delegation prompt
62
- prompt = self._build_initialization_prompt(project_type, framework)
68
+ prompt = self._build_initialization_prompt(
69
+ project_type, framework, ast_analysis
70
+ )
63
71
 
64
72
  # Show initialization plan
65
73
  console.print(
@@ -71,8 +79,15 @@ class MPMInitCommand:
71
79
  "• Optimized project structure\n"
72
80
  "• Tool configurations (linting, formatting, testing)\n"
73
81
  "• GitHub workflows and CI/CD setup\n"
74
- "• Memory system initialization\n\n"
75
- "[dim]Powered by Agentic Coder Optimizer Agent[/dim]",
82
+ "• Memory system initialization\n"
83
+ + (
84
+ "• AST analysis for comprehensive code documentation\n"
85
+ if ast_analysis
86
+ else ""
87
+ )
88
+ + "• Holistic CLAUDE.md organization with ranked instructions\n"
89
+ + "• Priority-based content structure (🔴🟡🟢⚪)\n"
90
+ + "\n[dim]Powered by Agentic Coder Optimizer Agent[/dim]",
76
91
  title="MPM-Init",
77
92
  border_style="cyan",
78
93
  )
@@ -111,7 +126,10 @@ class MPMInitCommand:
111
126
  return Path("claude-mpm")
112
127
 
113
128
  def _build_initialization_prompt(
114
- self, project_type: Optional[str] = None, framework: Optional[str] = None
129
+ self,
130
+ project_type: Optional[str] = None,
131
+ framework: Optional[str] = None,
132
+ ast_analysis: bool = True,
115
133
  ) -> str:
116
134
  """Build the initialization prompt for the agent."""
117
135
  base_prompt = f"""Please delegate this task to the Agentic Coder Optimizer agent:
@@ -173,9 +191,122 @@ Please perform the following initialization tasks:
173
191
  - Step-by-step setup instructions
174
192
  - Common commands reference
175
193
  - Troubleshooting guide
194
+ """
195
+
196
+ if ast_analysis:
197
+ base_prompt += """
198
+ 9. **Perform AST Analysis** (using Code Analyzer agent if needed):
199
+ - Parse code files to extract structure (classes, functions, methods)
200
+ - Generate comprehensive API documentation
201
+ - Create code architecture diagrams
202
+ - Document function signatures and dependencies
203
+ - Extract docstrings and inline comments
204
+ - Map code relationships and inheritance hierarchies
205
+ - Generate developer documentation with:
206
+ * Module overview and purpose
207
+ * Class hierarchies and relationships
208
+ * Function/method documentation
209
+ * Type annotations and parameter descriptions
210
+ * Code complexity metrics
211
+ * Dependency graphs
212
+ - Create DEVELOPER.md with technical architecture details
213
+ - Add CODE_STRUCTURE.md with AST-derived insights
214
+ """
215
+
216
+ base_prompt += """
217
+
218
+ 10. **Holistic CLAUDE.md Organization** (CRITICAL - Do this LAST):
219
+ After completing all initialization tasks, take a holistic look at the CLAUDE.md file and:
220
+
221
+ a) **Reorganize Content by Priority**:
222
+ - CRITICAL instructions (security, data handling, core business rules) at the TOP
223
+ - Project overview and purpose
224
+ - Key architectural decisions and constraints
225
+ - Development guidelines and standards
226
+ - Common tasks and workflows
227
+ - Links to additional documentation
228
+ - Nice-to-have or optional information at the BOTTOM
229
+
230
+ b) **Rank Instructions by Importance**:
231
+ - Use clear markers:
232
+ * 🔴 CRITICAL: Security, data handling, breaking changes, core business rules
233
+ * 🟡 IMPORTANT: Key workflows, architecture decisions, performance requirements
234
+ * 🟢 STANDARD: Common operations, coding standards, best practices
235
+ * ⚪ OPTIONAL: Nice-to-have features, experimental code, future considerations
236
+ - Group related instructions together
237
+ - Ensure no contradictory instructions exist
238
+ - Remove redundant or outdated information
239
+ - Add a "Priority Index" at the top listing all CRITICAL and IMPORTANT items
240
+
241
+ c) **Optimize for AI Agent Understanding**:
242
+ - Use consistent formatting and structure
243
+ - Provide clear examples for complex instructions
244
+ - Include "WHY" explanations for critical rules
245
+ - Add quick reference sections for common operations
246
+ - Ensure instructions are actionable and unambiguous
247
+
248
+ d) **Validate Completeness**:
249
+ - Ensure ALL critical project knowledge is captured
250
+ - Verify single-path principle (ONE way to do each task)
251
+ - Check that all referenced documentation exists
252
+ - Confirm all tools and dependencies are documented
253
+ - Test that a new AI agent could understand the project from CLAUDE.md alone
254
+
255
+ e) **Add Meta-Instructions Section**:
256
+ - Include a section about how to maintain CLAUDE.md
257
+ - Document when and how to update instructions
258
+ - Provide guidelines for instruction priority levels
259
+ - Add a changelog or last-updated timestamp
260
+
261
+ f) **Follow This CLAUDE.md Template Structure**:
262
+ ```markdown
263
+ # Project Name - CLAUDE.md
264
+
265
+ ## 🎯 Priority Index
266
+ ### 🔴 CRITICAL Instructions
267
+ - [List all critical items with links to their sections]
268
+
269
+ ### 🟡 IMPORTANT Instructions
270
+ - [List all important items with links to their sections]
271
+
272
+ ## 📋 Project Overview
273
+ [Brief description and purpose]
274
+
275
+ ## 🔴 CRITICAL: Security & Data Handling
276
+ [Critical security rules and data handling requirements]
277
+
278
+ ## 🔴 CRITICAL: Core Business Rules
279
+ [Non-negotiable business logic and constraints]
280
+
281
+ ## 🟡 IMPORTANT: Architecture & Design
282
+ [Key architectural decisions and patterns]
283
+
284
+ ## 🟡 IMPORTANT: Development Workflow
285
+ ### ONE Way to Build
286
+ ### ONE Way to Test
287
+ ### ONE Way to Deploy
288
+
289
+ ## 🟢 STANDARD: Coding Guidelines
290
+ [Standard practices and conventions]
291
+
292
+ ## 🟢 STANDARD: Common Tasks
293
+ [How to perform routine operations]
294
+
295
+ ## 📚 Documentation Links
296
+ [Links to additional resources]
297
+
298
+ ## ⚪ OPTIONAL: Future Enhancements
299
+ [Nice-to-have features and ideas]
300
+
301
+ ## 📝 Meta: Maintaining This Document
302
+ - Last Updated: [timestamp]
303
+ - Update Frequency: [when to update]
304
+ - Priority Guidelines: [how to assign priorities]
305
+ ```
176
306
 
177
307
  Please ensure all documentation is clear, concise, and optimized for AI agents to understand and follow.
178
308
  Focus on establishing ONE clear way to do ANYTHING in the project.
309
+ The final CLAUDE.md should be a comprehensive, well-organized guide that any AI agent can follow to work effectively on this project.
179
310
  """
180
311
 
181
312
  return base_prompt
@@ -369,7 +500,11 @@ Focus on establishing ONE clear way to do ANYTHING in the project.
369
500
  "[green]Your project is now optimized for Claude Code and Claude MPM![/green]\n\n"
370
501
  "Key files:\n"
371
502
  "• [cyan]CLAUDE.md[/cyan] - Main documentation for AI agents\n"
372
- "• [cyan].claude-mpm/[/cyan] - Configuration and memories\n\n"
503
+ " - Organized with priority rankings (🔴🟡🟢⚪)\n"
504
+ " - Instructions ranked by importance for AI understanding\n"
505
+ " - Holistic documentation review completed\n"
506
+ "• [cyan].claude-mpm/[/cyan] - Configuration and memories\n"
507
+ "• [cyan]CODE_STRUCTURE.md[/cyan] - AST-derived architecture documentation (if enabled)\n\n"
373
508
  "[dim]Run 'claude-mpm run' to start using the optimized setup[/dim]",
374
509
  title="Success",
375
510
  border_style="green",
@@ -398,13 +533,18 @@ Focus on establishing ONE clear way to do ANYTHING in the project.
398
533
  @click.option(
399
534
  "--verbose", is_flag=True, help="Show detailed output during initialization"
400
535
  )
536
+ @click.option(
537
+ "--ast-analysis/--no-ast-analysis",
538
+ default=True,
539
+ help="Enable/disable AST analysis for enhanced documentation (default: enabled)",
540
+ )
401
541
  @click.argument(
402
542
  "project_path",
403
543
  type=click.Path(exists=True, file_okay=False, dir_okay=True),
404
544
  required=False,
405
545
  default=".",
406
546
  )
407
- def mpm_init(project_type, framework, force, verbose, project_path):
547
+ def mpm_init(project_type, framework, force, verbose, ast_analysis, project_path):
408
548
  """
409
549
  Initialize a project for optimal use with Claude Code and Claude MPM.
410
550
 
@@ -414,11 +554,14 @@ def mpm_init(project_type, framework, force, verbose, project_path):
414
554
  - Configure development tools and standards
415
555
  - Set up memory systems for project knowledge
416
556
  - Optimize for AI agent understanding
557
+ - Perform AST analysis for enhanced developer documentation
417
558
 
418
559
  Examples:
419
560
  claude-mpm mpm-init
420
561
  claude-mpm mpm-init --project-type web --framework react
421
562
  claude-mpm mpm-init /path/to/project --force
563
+ claude-mpm mpm-init --ast-analysis # Enable AST analysis (default)
564
+ claude-mpm mpm-init --no-ast-analysis # Disable AST analysis
422
565
  """
423
566
  try:
424
567
  # Create command instance
@@ -426,7 +569,11 @@ def mpm_init(project_type, framework, force, verbose, project_path):
426
569
 
427
570
  # Run initialization (now synchronous)
428
571
  result = command.initialize_project(
429
- project_type=project_type, framework=framework, force=force, verbose=verbose
572
+ project_type=project_type,
573
+ framework=framework,
574
+ force=force,
575
+ verbose=verbose,
576
+ ast_analysis=ast_analysis,
430
577
  )
431
578
 
432
579
  # Exit with appropriate code
@@ -56,6 +56,7 @@ def manage_mpm_init(args):
56
56
  "force": getattr(args, "force", False),
57
57
  "verbose": getattr(args, "verbose", False),
58
58
  "use_venv": getattr(args, "use_venv", False),
59
+ "ast_analysis": getattr(args, "ast_analysis", True),
59
60
  }
60
61
 
61
62
  # Execute initialization (now synchronous)
@@ -88,6 +88,19 @@ def add_mpm_init_subparser(subparsers: Any) -> None:
88
88
  action="store_true",
89
89
  help="Use traditional Python venv instead of mamba/conda environment",
90
90
  )
91
+ init_group.add_argument(
92
+ "--ast-analysis",
93
+ action="store_true",
94
+ default=True,
95
+ dest="ast_analysis",
96
+ help="Enable AST analysis for enhanced developer documentation (default: enabled)",
97
+ )
98
+ init_group.add_argument(
99
+ "--no-ast-analysis",
100
+ action="store_false",
101
+ dest="ast_analysis",
102
+ help="Disable AST analysis for documentation generation",
103
+ )
91
104
 
92
105
  # Template options
93
106
  template_group = mpm_init_parser.add_argument_group("template options")
@@ -0,0 +1,14 @@
1
+ """
2
+ Commands package for Claude MPM.
3
+
4
+ This module contains command documentation files (Markdown) that are accessed
5
+ via importlib.resources.path() for command help and reference material.
6
+
7
+ This __init__.py file is required to make this directory recognizable as a
8
+ Python package by setuptools, which is necessary for proper distribution
9
+ and importlib resource access in installed packages.
10
+
11
+ Without this file, importlib.resources.path("claude_mpm", "commands") would
12
+ fail in the distributed package, even though it works in development when
13
+ the package is installed in editable mode.
14
+ """
@@ -0,0 +1,12 @@
1
+ # Show available agents and their versions
2
+
3
+ Show all available Claude MPM agents with their versions and deployment status.
4
+
5
+ This command displays:
6
+ - Agent names and descriptions
7
+ - Version information
8
+ - Tool availability
9
+ - Model preferences
10
+ - Deployment status
11
+
12
+ Usage: /mpm-agents
@@ -0,0 +1,18 @@
1
+ # View or modify claude-mpm configuration
2
+
3
+ Manage Claude MPM configuration settings.
4
+
5
+ Usage: /mpm-config [key] [value]
6
+
7
+ Examples:
8
+ - /mpm-config - Show all configuration
9
+ - /mpm-config list - List all configuration keys
10
+ - /mpm-config set logging debug - Set logging level to debug
11
+ - /mpm-config get websocket-port - Get WebSocket port setting
12
+
13
+ Configuration categories:
14
+ - logging: Logging levels and output
15
+ - websocket: WebSocket server settings
16
+ - hooks: Hook service configuration
17
+ - memory: Memory system settings
18
+ - agents: Agent deployment options
@@ -0,0 +1,24 @@
1
+ # Run diagnostic checks on claude-mpm installation
2
+
3
+ Run comprehensive diagnostic checks on your Claude MPM installation to identify and fix common issues.
4
+
5
+ This command checks:
6
+ - Installation integrity
7
+ - Configuration validity
8
+ - WebSocket connectivity
9
+ - Agent deployment status
10
+ - Memory system health
11
+ - Hook service status
12
+
13
+ Usage: /mpm-doctor [options]
14
+
15
+ Options:
16
+ - --verbose: Show detailed output
17
+ - --no-color: Disable colored output
18
+ - --checks [list]: Run specific checks only
19
+ - --fix: Attempt to fix identified issues
20
+
21
+ Examples:
22
+ - /mpm-doctor
23
+ - /mpm-doctor --verbose
24
+ - /mpm-doctor --fix
@@ -0,0 +1,10 @@
1
+ # Show help for available MPM commands
2
+
3
+ Display help information for Claude MPM commands.
4
+
5
+ Usage: /mpm-help [command]
6
+
7
+ Examples:
8
+ - /mpm-help - Show all MPM commands
9
+ - /mpm-help doctor - Show detailed help for doctor command
10
+ - /mpm-help agents - Show detailed help for agents command
@@ -0,0 +1,162 @@
1
+ # /mpm-init
2
+
3
+ Initialize your project for optimal use with Claude Code and Claude MPM using the Agentic Coder Optimizer agent.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /mpm-init
9
+ /mpm-init --project-type web --framework react
10
+ /mpm-init --force
11
+ /mpm-init --ast-analysis
12
+ /mpm-init --comprehensive
13
+ ```
14
+
15
+ ## Description
16
+
17
+ This command delegates to the Agentic Coder Optimizer agent to establish clear, single-path project standards for documentation, tooling, and workflows. It creates comprehensive documentation optimized for AI agents.
18
+
19
+ ## Features
20
+
21
+ - **📚 Comprehensive CLAUDE.md**: Creates AI-optimized project documentation
22
+ - **🎯 Priority-based Organization**: Ranks instructions by importance (🔴🟡🟢⚪)
23
+ - **🔍 AST Analysis**: Deep code structure analysis for enhanced documentation
24
+ - **🚀 Single-path Workflows**: Establishes ONE way to do ANYTHING
25
+ - **🧠 Memory System**: Initializes project knowledge retention
26
+ - **🔧 Tool Configuration**: Sets up linting, formatting, testing
27
+ - **📝 Holistic Review**: Final organization and validation pass
28
+
29
+ ## Options
30
+
31
+ - `--project-type [type]`: Specify project type (web, api, cli, library, etc.)
32
+ - `--framework [name]`: Specify framework (react, vue, django, fastapi, etc.)
33
+ - `--force`: Force reinitialization even if project is already configured
34
+ - `--ast-analysis`: Enable AST analysis for enhanced documentation (default: enabled)
35
+ - `--no-ast-analysis`: Disable AST analysis for faster initialization
36
+ - `--comprehensive`: Create comprehensive setup including CI/CD and deployment
37
+ - `--minimal`: Create minimal configuration (CLAUDE.md only)
38
+
39
+ ## What This Command Does
40
+
41
+ ### 1. Project Analysis
42
+ - Scans project structure and existing configurations
43
+ - Identifies project type, language, and frameworks
44
+ - Checks for existing documentation and tooling
45
+
46
+ ### 2. CLAUDE.md Creation/Update
47
+ The command creates a well-organized CLAUDE.md with:
48
+
49
+ ```markdown
50
+ ## 🎯 Priority Index
51
+ ### 🔴 CRITICAL Instructions
52
+ - Security rules, data handling, core business logic
53
+
54
+ ### 🟡 IMPORTANT Instructions
55
+ - Key workflows, architecture decisions
56
+
57
+ ### 🟢 STANDARD Instructions
58
+ - Common operations, coding standards
59
+
60
+ ### ⚪ OPTIONAL Instructions
61
+ - Nice-to-have features, future enhancements
62
+ ```
63
+
64
+ ### 3. Single-Path Standards
65
+ - ONE command for building: `make build`
66
+ - ONE command for testing: `make test`
67
+ - ONE command for deployment: `make deploy`
68
+ - Clear documentation of THE way to do things
69
+
70
+ ### 4. AST Analysis (Optional)
71
+ When enabled, performs:
72
+ - Code structure extraction (classes, functions, methods)
73
+ - API documentation generation
74
+ - Architecture diagram creation
75
+ - Function signature and dependency mapping
76
+ - Creates DEVELOPER.md with technical details
77
+ - Adds CODE_STRUCTURE.md with AST insights
78
+
79
+ ### 5. Tool Configuration
80
+ - Linting setup and configuration
81
+ - Code formatting standards
82
+ - Testing framework setup
83
+ - Pre-commit hooks if needed
84
+
85
+ ### 6. Memory System
86
+ - Creates `.claude-mpm/memories/` directory
87
+ - Initializes memory files for project knowledge
88
+ - Documents memory usage patterns
89
+
90
+ ### 7. Holistic Organization (Final Step)
91
+ After all tasks, performs a comprehensive review:
92
+ - Reorganizes content by priority
93
+ - Validates completeness
94
+ - Ensures single-path principle
95
+ - Adds meta-instructions for maintenance
96
+
97
+ ## Examples
98
+
99
+ ### Basic Initialization
100
+ ```bash
101
+ /mpm-init
102
+ ```
103
+ Analyzes current directory and creates optimal setup.
104
+
105
+ ### Web Project with React
106
+ ```bash
107
+ /mpm-init --project-type web --framework react
108
+ ```
109
+ Initializes with web-specific configurations and React patterns.
110
+
111
+ ### Force Reinitialization
112
+ ```bash
113
+ /mpm-init --force --comprehensive
114
+ ```
115
+ Overwrites existing configuration with comprehensive setup.
116
+
117
+ ### Fast Mode (No AST)
118
+ ```bash
119
+ /mpm-init --no-ast-analysis --minimal
120
+ ```
121
+ Quick initialization without code analysis.
122
+
123
+ ## Implementation
124
+
125
+ This command executes:
126
+ ```bash
127
+ claude-mpm mpm-init [options]
128
+ ```
129
+
130
+ The command delegates to the Agentic Coder Optimizer agent which:
131
+ 1. Analyzes your project structure
132
+ 2. Creates comprehensive documentation
133
+ 3. Establishes single-path workflows
134
+ 4. Configures development tools
135
+ 5. Sets up memory systems
136
+ 6. Performs AST analysis (if enabled)
137
+ 7. Organizes everything with priority rankings
138
+
139
+ ## Expected Output
140
+
141
+ After successful execution:
142
+ - ✅ **CLAUDE.md**: Main AI agent documentation with priority rankings
143
+ - ✅ **Single-path workflows**: Clear commands for all operations
144
+ - ✅ **Tool configurations**: Linting, formatting, testing setup
145
+ - ✅ **Memory system**: Initialized for knowledge retention
146
+ - ✅ **Developer docs**: Technical documentation (with AST analysis)
147
+ - ✅ **Priority organization**: Instructions ranked by importance
148
+
149
+ ## Notes
150
+
151
+ - The command uses the Agentic Coder Optimizer agent for implementation
152
+ - AST analysis is enabled by default for comprehensive documentation
153
+ - Priority rankings help AI agents focus on critical instructions first
154
+ - The holistic review ensures documentation quality and completeness
155
+ - All documentation is optimized for AI agent understanding
156
+
157
+ ## Related Commands
158
+
159
+ - `/mpm-status`: Check current project setup status
160
+ - `/mpm-agents`: Manage specialized agents
161
+ - `/mpm-config`: Configure Claude MPM settings
162
+ - `/mpm-doctor`: Diagnose and fix issues
@@ -0,0 +1,13 @@
1
+ # Show claude-mpm status and environment
2
+
3
+ Display the current status of Claude MPM including environment information, active services, and system health.
4
+
5
+ This command shows:
6
+ - Claude MPM version
7
+ - Python environment
8
+ - Active services (WebSocket, Hook Service, etc.)
9
+ - Memory usage
10
+ - Agent deployment status
11
+ - Configuration summary
12
+
13
+ Usage: /mpm-status