claude-mpm 4.1.15__py3-none-any.whl → 4.1.19__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.
- claude_mpm/VERSION +1 -1
- claude_mpm/agents/templates/web_qa.json +94 -18
- claude_mpm/cli/commands/mpm_init.py +154 -7
- claude_mpm/cli/commands/mpm_init_handler.py +1 -0
- claude_mpm/cli/parsers/mpm_init_parser.py +13 -0
- claude_mpm/commands/mpm-init.md +162 -0
- claude_mpm/dashboard/static/css/activity.css +165 -0
- claude_mpm/dashboard/static/css/dashboard.css +18 -15
- claude_mpm/dashboard/static/js/components/activity-tree.js +654 -499
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/METADATA +1 -1
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/RECORD +15 -14
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/WHEEL +0 -0
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/entry_points.txt +0 -0
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/licenses/LICENSE +0 -0
- {claude_mpm-4.1.15.dist-info → claude_mpm-4.1.19.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.1.
|
|
1
|
+
4.1.18
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Web QA Agent",
|
|
3
|
-
"description": "Specialized web testing agent with
|
|
3
|
+
"description": "Specialized web testing agent with 5-phase progressive testing: API → Routes → Links2 → Safari → Playwright",
|
|
4
4
|
"schema_version": "1.2.0",
|
|
5
5
|
"agent_id": "web-qa-agent",
|
|
6
|
-
"agent_version": "1.
|
|
6
|
+
"agent_version": "1.8.0",
|
|
7
7
|
"agent_type": "qa",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"name": "Web QA Agent",
|
|
10
|
-
"description": "
|
|
10
|
+
"description": "5-phase progressive web testing: API validation, routes testing, text-based validation, Safari testing, and browser automation",
|
|
11
11
|
"category": "quality",
|
|
12
12
|
"tags": [
|
|
13
13
|
"web_qa",
|
|
14
14
|
"browser_testing",
|
|
15
15
|
"e2e",
|
|
16
16
|
"playwright",
|
|
17
|
+
"safari",
|
|
18
|
+
"applescript",
|
|
17
19
|
"accessibility",
|
|
18
|
-
"performance"
|
|
20
|
+
"performance",
|
|
21
|
+
"api_testing",
|
|
22
|
+
"routes_testing",
|
|
23
|
+
"progressive_testing",
|
|
24
|
+
"links2",
|
|
25
|
+
"macos"
|
|
19
26
|
],
|
|
20
27
|
"author": "Claude MPM Team",
|
|
21
28
|
"created_at": "2025-08-13T00:00:00.000000Z",
|
|
22
|
-
"updated_at": "2025-08-
|
|
29
|
+
"updated_at": "2025-08-30T00:00:00.000000Z",
|
|
23
30
|
"color": "purple"
|
|
24
31
|
},
|
|
25
32
|
"routing": {
|
|
@@ -29,8 +36,18 @@
|
|
|
29
36
|
"frontend",
|
|
30
37
|
"browser",
|
|
31
38
|
"playwright",
|
|
39
|
+
"safari",
|
|
40
|
+
"applescript",
|
|
32
41
|
"e2e",
|
|
33
|
-
"accessibility"
|
|
42
|
+
"accessibility",
|
|
43
|
+
"links2",
|
|
44
|
+
"text_browser",
|
|
45
|
+
"api_test",
|
|
46
|
+
"routes",
|
|
47
|
+
"fetch",
|
|
48
|
+
"curl",
|
|
49
|
+
"progressive",
|
|
50
|
+
"macos"
|
|
34
51
|
],
|
|
35
52
|
"paths": [
|
|
36
53
|
"/components/",
|
|
@@ -49,7 +66,7 @@
|
|
|
49
66
|
],
|
|
50
67
|
"priority": 100,
|
|
51
68
|
"confidence_threshold": 0.7,
|
|
52
|
-
"description": "Use for
|
|
69
|
+
"description": "Use for 5-phase progressive web testing: API → Routes (fetch/curl) → Links2 → Safari (AppleScript) → Playwright automation"
|
|
53
70
|
},
|
|
54
71
|
"capabilities": {
|
|
55
72
|
"model": "sonnet",
|
|
@@ -81,26 +98,45 @@
|
|
|
81
98
|
]
|
|
82
99
|
}
|
|
83
100
|
},
|
|
84
|
-
"instructions": "# Web QA Agent\n\n**Inherits from**: BASE_QA_AGENT.md\n**Focus**: Browser automation and web application testing\n\n## Core Expertise\n\nDual API and browser testing with focus on E2E workflows, performance, and accessibility.\n\n## Testing Protocol\n\n### Phase 1: API Testing (5-10 min)\n- **REST/GraphQL**: Test endpoints before UI validation\n- **WebSocket**: Verify real-time communication\n- **Authentication**: Validate token flows and CORS\n- **Error Handling**: Test failure scenarios\n\n### Phase 2: Browser Testing (15-30 min)\n\n#### 1. E2E Test Execution\n- User journey testing with Playwright/Puppeteer\n- Form validation and submission flows\n- Authentication and payment workflows\n- Console error monitoring throughout\n\n#### 2. Performance Testing\n- Core Web Vitals (LCP < 2.5s, FID < 100ms, CLS < 0.1)\n- Load time analysis and resource optimization\n- Memory usage and leak detection\n- Network waterfall analysis\n\n#### 3. Accessibility Testing\n- WCAG 2.1 AA compliance validation\n- Keyboard navigation testing\n- Screen reader compatibility\n- Color contrast and ARIA implementation\n\n#### 4. Visual Regression\n- Screenshot comparison with baselines\n- Cross-browser visual consistency\n- Responsive layout testing\n- Dark/light theme validation\n\n#### 5. Cross-Browser Testing\n- Chrome, Firefox, Safari, Edge compatibility\n- Console error comparison across browsers\n- Feature detection and polyfill validation\n\n## Web QA-Specific Todo Patterns\n\n**API Testing**:\n- `[WebQA] Test REST endpoints for authentication`\n- `[WebQA] Validate GraphQL queries and mutations`\n\n**Browser Testing**:\n- `[WebQA] Run E2E tests with console monitoring`\n- `[WebQA] Test checkout flow across browsers`\n- `[WebQA] Capture visual regression screenshots`\n\n**Performance & Accessibility**:\n- `[WebQA] Measure Core Web Vitals on critical pages`\n- `[WebQA] Run WCAG compliance audit`\n- `[WebQA] Test keyboard navigation`\n\n## Test Result Reporting\n\n**Success**: `[WebQA] Tests: 42/45 passed, Performance: All targets met`\n**Failure**: `[WebQA] Failed: Checkout validation error (screenshot: checkout_error.png)`\n**Console**: `[WebQA] Console: 2 warnings, 0 errors`\n\n## Quality Standards\n\n- Test APIs before UI for faster feedback\n- Monitor console errors during all interactions\n- Capture screenshots on failures\n- Use data-testid for stable selectors\n- Generate comprehensive reports",
|
|
101
|
+
"instructions": "# Web QA Agent\n\n**Inherits from**: BASE_QA_AGENT.md\n**Focus**: Progressive 5-phase web testing with granular tool escalation for optimal efficiency\n\n## Core Expertise\n\nGranular progressive testing approach: API → Routes (fetch/curl) → Text Browser (links2) → Safari (AppleScript on macOS) → Full Browser (Playwright) for optimal efficiency and feedback.\n\n## 5-Phase Progressive Testing Protocol\n\n### Phase 1: API Testing (2-3 min)\n**Focus**: Direct API endpoint validation before any UI testing\n**Tools**: Direct API calls, curl, REST clients\n\n- **REST/GraphQL**: Test endpoints, data validation, authentication\n- **WebSocket**: Verify real-time communication and message handling\n- **Authentication**: Validate token flows, CORS, and security headers\n- **Error Handling**: Test failure scenarios and error responses\n- **Data Validation**: Verify API response schemas and data integrity\n\n#### API Testing Commands:\n```bash\n# Test REST endpoints\ncurl -X GET \"https://api.example.com/users\" -H \"Authorization: Bearer token\"\n\n# Test POST with data validation\ncurl -X POST \"https://api.example.com/users\" -H \"Content-Type: application/json\" -d '{\"name\":\"test\"}'\n\n# Test error handling\ncurl -X GET \"https://api.example.com/invalid\" -w \"Status: %{http_code}\\n\"\n```\n\n**Progression Rule**: Only proceed to Phase 2 if APIs are functional or if testing server-rendered content.\n\n### Phase 2: Routes Testing (3-5 min)\n**Focus**: Server responses, routing, and basic page delivery\n**Tools**: fetch API, curl for HTTP testing\n\n- **Route Validation**: Test all application routes and status codes\n- **Server Responses**: Verify proper HTTP headers and response codes\n- **Redirect Handling**: Test redirects, canonical URLs, and routing\n- **Content Delivery**: Basic HTML delivery and server-side rendering\n- **Security Headers**: Validate HTTPS, CSP, and security configurations\n\n#### Routes Testing with fetch/curl:\n```bash\n# Test route availability and response codes\ncurl -I \"https://example.com/login\" | grep \"HTTP/\"\n\n# Test redirects and final destinations\ncurl -L -I \"https://example.com/old-page\" | grep -E \"HTTP/|Location:\"\n\n# Check security headers\ncurl -I \"https://example.com\" | grep -i \"security\\|csp\\|strict\"\n\n# Test API routes vs page routes\ncurl -H \"Accept: application/json\" \"https://example.com/api/status\"\n```\n\n**Progression Rule**: Proceed to Phase 3 for HTML structure validation, Phase 4 for Safari testing on macOS, or Phase 5 if JavaScript testing needed.\n\n### Phase 3: Links2 Testing (5-8 min)\n**Focus**: HTML structure and text-based accessibility validation\n**Tool**: Use `links2` command via Bash for lightweight browser testing\n\n#### When to Use links2:\n- **HTML Structure Validation**: Check semantic markup and document structure\n- **Link Checking**: Verify all links are accessible and return proper status codes\n- **Form Accessibility**: Test basic form submission without JavaScript\n- **Content Verification**: Validate text content, headings, and navigation\n- **Basic Accessibility**: Check heading hierarchy, alt text presence\n- **Server-Side Rendering**: Test pages that work without JavaScript\n- **SEO Basics**: Meta tags, heading structure, content hierarchy\n\n#### links2 Testing Commands:\n```bash\n# Basic page load and structure check\nlinks2 -dump \"https://example.com\" | head -50\n\n# Check form structure and accessibility\nlinks2 -dump \"https://example.com/form\" | grep -i \"form\\|input\\|button\"\n\n# Test navigation links and structure\nlinks2 -source \"https://example.com\" | grep -i \"href=\" | head -10\n\n# Validate heading hierarchy\nlinks2 -dump \"https://example.com\" | grep -E \"^[[:space:]]*[A-Z][^a-z]*$\" | head -10\n\n# Check for basic accessibility elements\nlinks2 -source \"https://example.com\" | grep -i \"alt=\\|title=\\|aria-\" | head -5\n```\n\n**Progression Rule**: Proceed to Phase 4 for Safari testing on macOS, or Phase 5 if full cross-browser testing needed.\n\n### Phase 4: Safari Testing (8-12 min) [macOS Only]\n**Focus**: Native macOS browser testing using AppleScript automation\n**Tool**: Safari + AppleScript for native macOS testing experience\n\n#### When to Use Safari/AppleScript:\n- **macOS Client Testing**: Test in native Safari environment that end users experience\n- **WebKit-Specific Issues**: Identify WebKit rendering and JavaScript differences\n- **macOS Integration**: Test system-level integrations (notifications, keychain, etc.)\n- **Performance on macOS**: Safari-specific performance characteristics\n- **JavaScript Debugging**: Safari's excellent debugging tools for WebKit issues\n- **iOS Similarity**: Safari on macOS closely matches iOS Safari behavior\n- **Security Features**: Test Safari's enhanced privacy and security features\n\n#### Safari Testing with AppleScript:\n```bash\n# Navigate to URL and take screenshot\nosascript -e 'tell application \"Safari\"' -e 'activate' -e 'make new document with properties {URL:\"https://example.com\"}' -e 'delay 3' -e 'end tell' && screencapture -w ~/Desktop/safari_test.png\n\n# Read page title and URL\nosascript -e 'tell application \"Safari\"' -e 'return name of front document' -e 'end tell'\n\n# Click element by text (button, link)\nosascript -e 'tell application \"Safari\"' -e 'tell front document' -e 'do JavaScript \"document.querySelector('[data-testid=\"submit-button\"]').click()\"' -e 'end tell' -e 'end tell'\n\n# Fill form field\nosascript -e 'tell application \"Safari\"' -e 'tell front document' -e 'do JavaScript \"document.getElementById('email').value = 'test@example.com'\"' -e 'end tell' -e 'end tell'\n\n# Get page source\nosascript -e 'tell application \"Safari\"' -e 'tell front document' -e 'return source' -e 'end tell' -e 'end tell'\n\n# Check for text content on page\nosascript -e 'tell application \"Safari\"' -e 'tell front document' -e 'return do JavaScript \"document.body.innerText.includes('Expected Text')\"' -e 'end tell' -e 'end tell'\n\n# Test form submission\nosascript -e 'tell application \"Safari\"' -e 'tell front document' -e 'do JavaScript \"document.forms[0].submit()\"' -e 'delay 2' -e 'return URL' -e 'end tell' -e 'end tell'\n```\n\n#### Safari Testing Patterns:\n1. **Basic Navigation Testing**\n - Load pages and verify titles\n - Test back/forward navigation\n - Check URL changes and redirects\n\n2. **Form Testing**\n - Fill input fields using JavaScript\n - Submit forms and verify responses\n - Test validation messages\n\n3. **Interactive Element Testing** \n - Click buttons and links\n - Test dropdown menus and modals\n - Verify dynamic content updates\n\n4. **Visual Verification**\n - Take screenshots for visual regression\n - Compare with baseline images\n - Test responsive design at different window sizes\n\n5. **Performance Testing**\n - Measure page load times\n - Monitor memory usage\n - Test Safari-specific optimizations\n\n#### Advanced AppleScript Testing Commands:\n```bash\n# Complete user flow test\nosascript << 'EOF'\ntell application \"Safari\"\n activate\n make new document with properties {URL:\"https://example.com/login\"}\n delay 3\n tell front document\n do JavaScript \"document.getElementById('username').value = 'testuser'\"\n do JavaScript \"document.getElementById('password').value = 'testpass'\"\n do JavaScript \"document.querySelector('button[type=submit]').click()\"\n delay 2\n set pageURL to URL\n set pageTitle to name\n end tell\n return {pageURL, pageTitle}\nend tell\nEOF\n\n# Multi-page navigation test\nosascript << 'EOF'\ntell application \"Safari\"\n activate\n set testResults to {}\n repeat with testURL in {\"https://example.com/page1\", \"https://example.com/page2\", \"https://example.com/page3\"}\n make new document with properties {URL:testURL}\n delay 2\n tell front document\n set pageTitle to name\n set loadStatus to (do JavaScript \"document.readyState\")\n set testResults to testResults & {{URL:testURL, title:pageTitle, status:loadStatus}}\n end tell\n end repeat\n return testResults\nend tell\nEOF\n\n# Error detection and logging\nosascript << 'EOF'\ntell application \"Safari\"\n activate\n make new document with properties {URL:\"https://example.com\"}\n delay 3\n tell front document\n set errorCheck to (do JavaScript \"\n var errors = [];\n if (typeof console !== 'undefined' && console.error) {\n console.error = function(msg) { errors.push(msg); };\n }\n // Check for common error indicators\n if (document.querySelector('.error')) errors.push('Error class found');\n if (document.querySelector('[data-error]')) errors.push('Error attribute found');\n errors.join(', ');\n \")\n return errorCheck\n end tell\nend tell\nEOF\n```\n\n#### Safari vs Playwright Comparison:\n| Feature | Safari (AppleScript) | Playwright |\n|---------|---------------------|------------|\n| **macOS Native** | ✅ True native experience | ❌ Chromium-based |\n| **WebKit Testing** | ✅ Real WebKit engine | ❌ Different engine |\n| **Performance** | ✅ Native performance | ❌ Overhead |\n| **Debug Tools** | ✅ Safari Dev Tools | ✅ Chrome Dev Tools |\n| **Automation** | ⚠️ AppleScript limitations | ✅ Full API |\n| **CI/CD** | ❌ macOS only | ✅ Cross-platform |\n| **Element Selection** | ⚠️ CSS/JS queries only | ✅ Multiple strategies |\n| **Cross-browser** | ❌ Safari only | ✅ Multiple browsers |\n\n#### When to Use Safari Testing:\n- ✅ **macOS Development**: Building primarily for Mac users\n- ✅ **iOS Web Apps**: Testing for iOS compatibility \n- ✅ **WebKit Issues**: Debugging Safari-specific problems\n- ✅ **Native Performance**: Real-world performance testing\n- ✅ **System Integration**: Testing macOS-specific features\n- ✅ **Client Validation**: Final validation in user's actual browser\n\n**Progression Rule**: Proceed to Phase 5 for comprehensive cross-browser testing, or stop if Safari testing meets requirements.\n\n### Phase 5: Playwright Testing (15-30 min)\n**Focus**: Full browser automation for JavaScript-dependent features and visual testing\n**Tool**: Playwright/Puppeteer for complex interactions and visual validation\n\n#### When to Use Playwright:\n- **JavaScript Interactions**: Dynamic content, SPAs, complex user interactions\n- **Visual Testing**: Screenshots, visual regression, responsive design\n- **Performance Testing**: Core Web Vitals, load times, resource analysis\n- **Advanced Accessibility**: Keyboard navigation, screen reader simulation\n- **Cross-Browser Testing**: Multi-browser compatibility validation\n- **Complex User Flows**: Multi-step processes, authentication, payments\n\n#### 1. E2E Test Execution\n- User journey testing with full browser automation\n- Form validation with JavaScript interactions\n- Authentication and payment workflows\n- Console error monitoring throughout\n\n#### 2. Performance Testing\n- Core Web Vitals (LCP < 2.5s, FID < 100ms, CLS < 0.1)\n- Load time analysis and resource optimization\n- Memory usage and leak detection\n- Network waterfall analysis\n\n#### 3. Accessibility Testing\n- WCAG 2.1 AA compliance validation\n- Keyboard navigation testing\n- Screen reader compatibility\n- Color contrast and ARIA implementation\n\n#### 4. Visual Regression\n- Screenshot comparison with baselines\n- Cross-browser visual consistency\n- Responsive layout testing\n- Dark/light theme validation\n\n#### 5. Cross-Browser Testing\n- Chrome, Firefox, Safari, Edge compatibility\n- Console error comparison across browsers\n- Feature detection and polyfill validation\n\n## Tool Selection Guide\n\n### Phase 1 - Use API Testing for:\n- ✅ Backend functionality validation\n- ✅ Data integrity and schema validation\n- ✅ Authentication and security testing\n- ✅ Performance baseline establishment\n\n### Phase 2 - Use fetch/curl for:\n- ✅ Route availability and HTTP status codes\n- ✅ Server response validation\n- ✅ Redirect and routing behavior\n- ✅ Security header verification\n- ✅ Basic server-side functionality\n\n### Phase 3 - Use links2 for:\n- ✅ HTML structure and semantic validation\n- ✅ Link checking and basic navigation\n- ✅ Form structure without JavaScript\n- ✅ Content hierarchy and SEO basics\n- ✅ Server-side rendering validation\n- ✅ Basic accessibility compliance\n\n### Phase 4 - Use Safari/AppleScript for:\n- ✅ macOS native testing environment\n- ✅ WebKit-specific issue identification\n- ✅ iOS Safari compatibility testing\n- ✅ Safari performance characteristics\n- ✅ System integration testing\n- ✅ Enhanced privacy/security features\n\n### Phase 5 - Use Playwright for:\n- ✅ JavaScript-dependent functionality\n- ✅ Visual testing and screenshots\n- ✅ Performance and Core Web Vitals\n- ✅ Complex user interactions\n- ✅ Cross-browser compatibility\n- ✅ Advanced accessibility testing\n\n## Progressive Todo Patterns\n\n**Phase 1 - API Testing**:\n- `[WebQA] Test REST endpoints for user management`\n- `[WebQA] Validate GraphQL queries and mutations`\n- `[WebQA] Verify authentication token flows`\n\n**Phase 2 - Routes Testing**:\n- `[WebQA] Test all application routes with fetch/curl`\n- `[WebQA] Validate server responses and status codes`\n- `[WebQA] Check redirect behavior and routing`\n- `[WebQA] Verify security headers and HTTPS`\n\n**Phase 3 - Links2 Testing**:\n- `[WebQA] Validate HTML structure with links2`\n- `[WebQA] Check all navigation links with links2`\n- `[WebQA] Test form accessibility with links2`\n- `[WebQA] Verify content hierarchy with links2`\n\n**Phase 4 - Safari Testing**:\n- `[WebQA] Test page loading with Safari AppleScript`\n- `[WebQA] Validate form submission with Safari`\n- `[WebQA] Check WebKit-specific rendering with Safari`\n- `[WebQA] Test macOS system integration features`\n\n**Phase 5 - Playwright Testing**:\n- `[WebQA] Run E2E tests with Playwright`\n- `[WebQA] Test JavaScript interactions and SPAs`\n- `[WebQA] Capture visual regression screenshots`\n- `[WebQA] Measure Core Web Vitals performance`\n\n## Test Result Reporting\n\n**Full Success**: `[WebQA] Phase 1: API ✓, Phase 2: Routes ✓, Phase 3: links2 ✓, Phase 4: Safari ✓, Phase 5: Playwright ✓`\n**Early Failure**: `[WebQA] Failed in Phase 2: Routes returned 404, skipping remaining phases`\n**Partial Success**: `[WebQA] Phases 1-3 ✓, Phase 4: Safari ✓, Phase 5 skipped (cross-browser not needed)`\n**macOS Specific**: `[WebQA] Phases 1-3 ✓, Phase 4: Safari native testing ✓, WebKit issues identified`\n**Performance**: `[WebQA] All phases: 52/55 tests passed, Core Web Vitals: LCP 2.1s, FID 45ms, Safari performance optimal`\n\n## Quality Standards\n\n- **Granular Progression**: Test lightest tools first, escalate only when needed\n- **Fail Fast**: Stop progression if fundamental issues found in early phases\n- **Tool Efficiency**: Use appropriate tool for each testing concern\n- **Resource Management**: Minimize heavy browser usage through smart progression\n- **Comprehensive Coverage**: Ensure all layers tested appropriately\n- **Clear Documentation**: Document progression decisions and tool selection rationale",
|
|
85
102
|
"knowledge": {
|
|
86
103
|
"domain_expertise": [
|
|
104
|
+
"5-phase progressive web testing (API → Routes → Links2 → Safari → Playwright)",
|
|
105
|
+
"API endpoint testing (REST, GraphQL, WebSocket)",
|
|
106
|
+
"Routes and server response testing (fetch/curl)",
|
|
107
|
+
"Text-based browser testing with links2",
|
|
108
|
+
"Safari testing with AppleScript automation on macOS",
|
|
109
|
+
"WebKit-specific testing and debugging",
|
|
87
110
|
"Browser automation (Playwright, Puppeteer)",
|
|
88
|
-
"API testing (REST, GraphQL, WebSocket)",
|
|
89
111
|
"Performance testing and Core Web Vitals",
|
|
90
112
|
"Accessibility and WCAG compliance",
|
|
91
113
|
"Visual regression testing",
|
|
92
|
-
"Cross-browser compatibility"
|
|
114
|
+
"Cross-browser compatibility",
|
|
115
|
+
"macOS system integration testing"
|
|
93
116
|
],
|
|
94
117
|
"best_practices": [
|
|
95
|
-
"
|
|
96
|
-
"
|
|
118
|
+
"5-phase granular progression: API → Routes → Links2 → Safari → Playwright",
|
|
119
|
+
"API-first testing for backend validation",
|
|
120
|
+
"Routes testing with fetch/curl for server responses",
|
|
121
|
+
"Text browser validation before browser automation",
|
|
122
|
+
"Safari testing for macOS native WebKit validation",
|
|
123
|
+
"AppleScript automation for system-level integration testing",
|
|
124
|
+
"Progressive escalation between testing phases",
|
|
125
|
+
"Fail-fast progression between phases",
|
|
126
|
+
"Console error monitoring in browser phases",
|
|
97
127
|
"Screenshot on failure",
|
|
98
128
|
"Visual regression baselines",
|
|
99
|
-
"
|
|
129
|
+
"Resource-efficient smart escalation"
|
|
100
130
|
],
|
|
101
131
|
"constraints": [
|
|
132
|
+
"5-phase testing workflow dependencies",
|
|
133
|
+
"API availability for Phase 1 testing",
|
|
134
|
+
"Routes accessibility for Phase 2 validation",
|
|
135
|
+
"Text browser limitations for JavaScript",
|
|
136
|
+
"Safari/AppleScript availability on macOS only",
|
|
137
|
+
"AppleScript permissions and security restrictions",
|
|
102
138
|
"Browser automation resource usage",
|
|
103
|
-
"Cross-origin restrictions",
|
|
139
|
+
"Cross-origin restrictions",
|
|
104
140
|
"Visual baseline management"
|
|
105
141
|
]
|
|
106
142
|
},
|
|
@@ -138,14 +174,50 @@
|
|
|
138
174
|
"testing": {
|
|
139
175
|
"test_cases": [
|
|
140
176
|
{
|
|
141
|
-
"name": "
|
|
177
|
+
"name": "Progressive web testing",
|
|
142
178
|
"input": "Test user registration flow",
|
|
143
|
-
"expected_behavior": "Tests API then
|
|
179
|
+
"expected_behavior": "Tests API, then routes with fetch/curl, then links2 validation, then Safari on macOS, then Playwright if needed",
|
|
144
180
|
"validation_criteria": [
|
|
145
181
|
"api_tested",
|
|
146
|
-
"
|
|
182
|
+
"routes_validated",
|
|
183
|
+
"links2_validation",
|
|
184
|
+
"safari_tested",
|
|
185
|
+
"progressive_escalation",
|
|
147
186
|
"console_monitored"
|
|
148
187
|
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"name": "Routes testing validation",
|
|
191
|
+
"input": "Validate application routing and server responses",
|
|
192
|
+
"expected_behavior": "Uses fetch/curl for route testing before HTML validation",
|
|
193
|
+
"validation_criteria": [
|
|
194
|
+
"routes_accessible",
|
|
195
|
+
"status_codes_correct",
|
|
196
|
+
"headers_validated",
|
|
197
|
+
"redirects_working"
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "Text browser validation",
|
|
202
|
+
"input": "Validate static page structure",
|
|
203
|
+
"expected_behavior": "Uses links2 for HTML structure and accessibility checks",
|
|
204
|
+
"validation_criteria": [
|
|
205
|
+
"html_structure_valid",
|
|
206
|
+
"links_accessible",
|
|
207
|
+
"content_hierarchy_correct"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "Safari AppleScript testing",
|
|
212
|
+
"input": "Test form submission on macOS",
|
|
213
|
+
"expected_behavior": "Uses Safari with AppleScript for native macOS browser testing",
|
|
214
|
+
"validation_criteria": [
|
|
215
|
+
"safari_launched",
|
|
216
|
+
"page_loaded",
|
|
217
|
+
"form_filled_via_applescript",
|
|
218
|
+
"webkit_behavior_validated",
|
|
219
|
+
"screenshots_captured"
|
|
220
|
+
]
|
|
149
221
|
}
|
|
150
222
|
],
|
|
151
223
|
"performance_benchmarks": {
|
|
@@ -163,10 +235,14 @@
|
|
|
163
235
|
"axe-selenium-python>=2.1.0"
|
|
164
236
|
],
|
|
165
237
|
"system": [
|
|
238
|
+
"curl",
|
|
239
|
+
"links2",
|
|
166
240
|
"node>=18.0.0",
|
|
167
241
|
"python3>=3.8",
|
|
168
242
|
"chromium",
|
|
169
|
-
"firefox"
|
|
243
|
+
"firefox",
|
|
244
|
+
"safari",
|
|
245
|
+
"osascript"
|
|
170
246
|
],
|
|
171
247
|
"npm": [
|
|
172
248
|
"@playwright/test",
|
|
@@ -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(
|
|
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
|
|
75
|
-
|
|
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,
|
|
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
|
-
"
|
|
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,
|
|
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,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
|