claude-mpm 4.17.0__py3-none-any.whl → 4.18.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of claude-mpm might be problematic. Click here for more details.

Files changed (52) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/BASE_ENGINEER.md +286 -0
  3. claude_mpm/agents/BASE_PM.md +48 -17
  4. claude_mpm/agents/agent_loader.py +4 -4
  5. claude_mpm/agents/templates/engineer.json +5 -1
  6. claude_mpm/agents/templates/svelte-engineer.json +225 -0
  7. claude_mpm/config/agent_config.py +2 -2
  8. claude_mpm/core/config.py +42 -0
  9. claude_mpm/core/factories.py +1 -1
  10. claude_mpm/core/optimized_agent_loader.py +3 -3
  11. claude_mpm/hooks/claude_hooks/response_tracking.py +35 -1
  12. claude_mpm/models/resume_log.py +340 -0
  13. claude_mpm/services/agents/auto_config_manager.py +1 -1
  14. claude_mpm/services/agents/deployment/agent_configuration_manager.py +1 -1
  15. claude_mpm/services/agents/deployment/agent_record_service.py +1 -1
  16. claude_mpm/services/agents/deployment/agent_validator.py +17 -1
  17. claude_mpm/services/agents/deployment/async_agent_deployment.py +1 -1
  18. claude_mpm/services/agents/deployment/local_template_deployment.py +1 -1
  19. claude_mpm/services/agents/local_template_manager.py +1 -1
  20. claude_mpm/services/cli/session_manager.py +87 -0
  21. claude_mpm/services/core/path_resolver.py +1 -1
  22. claude_mpm/services/infrastructure/resume_log_generator.py +439 -0
  23. claude_mpm/services/mcp_config_manager.py +2 -2
  24. claude_mpm/services/session_manager.py +205 -1
  25. claude_mpm/services/unified/deployment_strategies/local.py +1 -1
  26. claude_mpm/skills/bundled/api-documentation.md +393 -0
  27. claude_mpm/skills/bundled/async-testing.md +571 -0
  28. claude_mpm/skills/bundled/code-review.md +143 -0
  29. claude_mpm/skills/bundled/database-migration.md +199 -0
  30. claude_mpm/skills/bundled/docker-containerization.md +194 -0
  31. claude_mpm/skills/bundled/express-local-dev.md +1429 -0
  32. claude_mpm/skills/bundled/fastapi-local-dev.md +1199 -0
  33. claude_mpm/skills/bundled/git-workflow.md +414 -0
  34. claude_mpm/skills/bundled/imagemagick.md +204 -0
  35. claude_mpm/skills/bundled/json-data-handling.md +223 -0
  36. claude_mpm/skills/bundled/nextjs-local-dev.md +807 -0
  37. claude_mpm/skills/bundled/pdf.md +141 -0
  38. claude_mpm/skills/bundled/performance-profiling.md +567 -0
  39. claude_mpm/skills/bundled/refactoring-patterns.md +180 -0
  40. claude_mpm/skills/bundled/security-scanning.md +327 -0
  41. claude_mpm/skills/bundled/systematic-debugging.md +473 -0
  42. claude_mpm/skills/bundled/test-driven-development.md +378 -0
  43. claude_mpm/skills/bundled/vite-local-dev.md +1061 -0
  44. claude_mpm/skills/bundled/web-performance-optimization.md +2305 -0
  45. claude_mpm/skills/bundled/xlsx.md +157 -0
  46. claude_mpm/utils/agent_dependency_loader.py +2 -2
  47. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/METADATA +68 -1
  48. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/RECORD +52 -29
  49. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/WHEEL +0 -0
  50. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/entry_points.txt +0 -0
  51. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/licenses/LICENSE +0 -0
  52. {claude_mpm-4.17.0.dist-info → claude_mpm-4.18.3.dist-info}/top_level.txt +0 -0
claude_mpm/VERSION CHANGED
@@ -1 +1 @@
1
- 4.17.0
1
+ 4.18.3
@@ -262,6 +262,292 @@ Before writing ANY fix or optimization, you MUST:
262
262
  - **Test Coverage**: Minimum 80% for new code
263
263
  - **Documentation**: All public APIs must have docstrings
264
264
 
265
+ ## Engineering Quality Documentation Standards
266
+
267
+ All engineers must provide comprehensive documentation for implementations. These standards ensure maintainability, knowledge transfer, and informed decision-making for future modifications.
268
+
269
+ ### Design Decision Documentation (MANDATORY)
270
+
271
+ Every significant implementation must document:
272
+
273
+ **Architectural Choices and Reasoning**
274
+ - Explain WHY you chose this approach over alternatives
275
+ - Document the problem context that influenced the decision
276
+ - Link design to business requirements or technical constraints
277
+
278
+ **Alternatives Considered**
279
+ - List other approaches evaluated during design
280
+ - Explain why each alternative was rejected
281
+ - Note any assumptions that might invalidate the current choice
282
+
283
+ **Trade-offs Analysis**
284
+ - **Performance vs. Maintainability**: Document speed vs. readability choices
285
+ - **Complexity vs. Flexibility**: Note when simplicity was chosen over extensibility
286
+ - **Memory vs. Speed**: Explain resource allocation decisions
287
+ - **Time vs. Quality**: Acknowledge technical debt taken for deadlines
288
+
289
+ **Future Extensibility**
290
+ - Identify extension points for anticipated changes
291
+ - Document which parts are designed to be stable vs. flexible
292
+ - Note refactoring opportunities for future consideration
293
+
294
+ **Example**:
295
+ ```python
296
+ class CacheManager:
297
+ """
298
+ Design Decision: In-memory LRU cache with TTL
299
+
300
+ Rationale: Selected in-memory caching for sub-millisecond access times
301
+ required by API SLA (<50ms p99 latency). Rejected Redis to avoid
302
+ network latency and operational complexity for this use case.
303
+
304
+ Trade-offs:
305
+ - Performance: O(1) access vs. Redis ~1-2ms network round-trip
306
+ - Scalability: Limited to single-node memory vs. distributed cache
307
+ - Persistence: Loses cache on restart vs. Redis durability
308
+
309
+ Alternatives Considered:
310
+ 1. Redis: Rejected due to network latency and ops overhead
311
+ 2. SQLite: Rejected due to disk I/O bottleneck on writes
312
+ 3. No caching: Rejected due to database query load (2000+ QPS)
313
+
314
+ Extension Points: Cache backend interface allows future Redis migration
315
+ if horizontal scaling becomes necessary (>10K QPS threshold).
316
+ """
317
+ ```
318
+
319
+ ### Performance Analysis (RECOMMENDED)
320
+
321
+ For algorithms and critical paths, provide:
322
+
323
+ **Complexity Analysis**
324
+ - **Time Complexity**: Big-O notation for all operations
325
+ - Best case, average case, worst case
326
+ - Explain what factors influence complexity
327
+ - **Space Complexity**: Memory usage characteristics
328
+ - Auxiliary space requirements
329
+ - Scalability limits based on input size
330
+
331
+ **Performance Metrics**
332
+ - Expected performance for typical workloads
333
+ - Benchmarks for critical operations
334
+ - Comparison to previous implementation (if refactoring)
335
+
336
+ **Bottleneck Identification**
337
+ - Known performance limitations
338
+ - Conditions that trigger worst-case behavior
339
+ - Scalability ceilings and their causes
340
+
341
+ **Example**:
342
+ ```python
343
+ def binary_search(arr: list, target: int) -> int:
344
+ """
345
+ Find target in sorted array using binary search.
346
+
347
+ Performance:
348
+ - Time Complexity: O(log n) average/worst case, O(1) best case
349
+ - Space Complexity: O(1) iterative implementation
350
+
351
+ Expected Performance:
352
+ - 1M elements: ~20 comparisons maximum
353
+ - 1B elements: ~30 comparisons maximum
354
+
355
+ Bottleneck: Array must be pre-sorted. If frequent insertions/deletions,
356
+ consider balanced tree structure (O(log n) insert vs. O(n) array insert).
357
+ """
358
+ ```
359
+
360
+ ### Optimization Suggestions (RECOMMENDED)
361
+
362
+ Document future improvement opportunities:
363
+
364
+ **Potential Performance Improvements**
365
+ - Specific optimizations not yet implemented
366
+ - Conditions under which optimization becomes worthwhile
367
+ - Estimated performance gains if implemented
368
+
369
+ **Refactoring Opportunities**
370
+ - Code structure improvements identified during implementation
371
+ - Dependencies that could be reduced or eliminated
372
+ - Patterns that could be extracted for reuse
373
+
374
+ **Technical Debt Documentation**
375
+ - Shortcuts taken with explanation and remediation plan
376
+ - Areas needing cleanup or modernization
377
+ - Test coverage gaps and plan to address
378
+
379
+ **Scalability Considerations**
380
+ - Current capacity limits and how to exceed them
381
+ - Architectural changes needed for 10x/100x scale
382
+ - Resource utilization projections
383
+
384
+ **Example**:
385
+ ```python
386
+ class ReportGenerator:
387
+ """
388
+ Current Implementation: Synchronous PDF generation
389
+
390
+ Optimization Opportunities:
391
+ 1. Async Generation: Move to background queue for reports >100 pages
392
+ - Estimated speedup: 200ms -> 50ms API response time
393
+ - Requires: Celery/RQ task queue, S3 storage for results
394
+ - Threshold: Implement when report generation >500/day
395
+
396
+ 2. Template Caching: Cache Jinja2 templates in memory
397
+ - Estimated speedup: 20% reduction in render time
398
+ - Effort: 2-4 hours, low risk
399
+
400
+ Technical Debt:
401
+ - TODO: Add retry logic for external API calls (currently fails fast)
402
+ - TODO: Implement streaming for large datasets (current limit: 10K rows)
403
+
404
+ Scalability: Current design handles ~1000 reports/day. For >5000/day,
405
+ migrate to async architecture with dedicated worker pool.
406
+ """
407
+ ```
408
+
409
+ ### Error Case Documentation (MANDATORY)
410
+
411
+ Every implementation must document failure modes:
412
+
413
+ **All Error Conditions Handled**
414
+ - List every exception caught and why
415
+ - Document error recovery strategies
416
+ - Explain error propagation decisions (catch vs. propagate)
417
+
418
+ **Failure Modes and Degradation**
419
+ - What happens when external dependencies fail
420
+ - Graceful degradation paths (if applicable)
421
+ - Data consistency guarantees during failures
422
+
423
+ **Error Messages**
424
+ - All error messages must be actionable
425
+ - Include diagnostic information for debugging
426
+ - Suggest remediation steps when possible
427
+
428
+ **Recovery Strategies**
429
+ - Automatic retry logic and backoff strategies
430
+ - Manual intervention procedures
431
+ - Data recovery or rollback mechanisms
432
+
433
+ **Example**:
434
+ ```python
435
+ def process_payment(payment_data: dict) -> PaymentResult:
436
+ """
437
+ Process payment through external gateway.
438
+
439
+ Error Handling:
440
+ 1. NetworkError: Retry up to 3 times with exponential backoff (1s, 2s, 4s)
441
+ - After retries exhausted, queue for manual review
442
+ - User receives "processing delayed" message
443
+
444
+ 2. ValidationError: Immediate failure, no retry
445
+ - Returns detailed field-level errors to user
446
+ - Logs validation failure for fraud detection
447
+
448
+ 3. InsufficientFundsError: Immediate failure, no retry
449
+ - Clear user message: "Payment declined - insufficient funds"
450
+ - No sensitive details exposed in error response
451
+
452
+ 4. GatewayTimeoutError: Single retry after 5s
453
+ - On failure, mark transaction as "pending review"
454
+ - Webhook reconciliation runs hourly to check status
455
+
456
+ Failure Mode: If payment gateway is completely down, transactions
457
+ are queued in database with "pending" status. Background worker
458
+ processes queue every 5 minutes. Users notified of delay via email.
459
+
460
+ Data Consistency: Transaction state transitions are atomic. No partial
461
+ payments possible. Database transaction wraps payment + order update.
462
+ """
463
+ ```
464
+
465
+ ### Usage Examples (RECOMMENDED)
466
+
467
+ Provide practical code examples:
468
+
469
+ **Common Use Cases**
470
+ - Show typical usage patterns for APIs
471
+ - Include complete, runnable examples
472
+ - Demonstrate best practices
473
+
474
+ **Edge Case Handling**
475
+ - Show how to handle boundary conditions
476
+ - Demonstrate error handling in practice
477
+ - Illustrate performance considerations
478
+
479
+ **Integration Examples**
480
+ - How to use with other system components
481
+ - Configuration examples
482
+ - Dependency setup instructions
483
+
484
+ **Test Case References**
485
+ - Point to test files demonstrating usage
486
+ - Explain what each test validates
487
+ - Use tests as living documentation
488
+
489
+ **Example**:
490
+ ```python
491
+ class DataValidator:
492
+ """
493
+ Validate user input against schema definitions.
494
+
495
+ Common Usage:
496
+ >>> validator = DataValidator(schema=user_schema)
497
+ >>> result = validator.validate(user_data)
498
+ >>> if result.is_valid:
499
+ >>> process_user(result.cleaned_data)
500
+ >>> else:
501
+ >>> return {"errors": result.errors}
502
+
503
+ Edge Cases:
504
+ # Handle missing required fields
505
+ >>> result = validator.validate({})
506
+ >>> result.errors # {"email": "required field missing"}
507
+
508
+ # Handle type coercion
509
+ >>> result = validator.validate({"age": "25"})
510
+ >>> result.cleaned_data["age"] # 25 (int, not string)
511
+
512
+ Integration with Flask:
513
+ @app.route('/users', methods=['POST'])
514
+ def create_user():
515
+ validator = DataValidator(schema=user_schema)
516
+ result = validator.validate(request.json)
517
+ if not result.is_valid:
518
+ return jsonify({"errors": result.errors}), 400
519
+ # ... process valid data
520
+
521
+ Tests: See tests/test_validators.py for comprehensive examples
522
+ - test_required_fields: Required field validation
523
+ - test_type_coercion: Automatic type conversion
524
+ - test_custom_validators: Custom validation rules
525
+ """
526
+ ```
527
+
528
+ ## Documentation Enforcement
529
+
530
+ **Mandatory Reviews**
531
+ - Code reviews must verify documentation completeness
532
+ - PRs without proper documentation must be rejected
533
+ - Design decisions require explicit approval
534
+
535
+ **Documentation Quality Checks**
536
+ - MANDATORY sections must be present and complete
537
+ - RECOMMENDED sections encouraged but not blocking
538
+ - Examples must be runnable and tested
539
+ - Error cases must cover all catch/except blocks
540
+
541
+ **Success Criteria**
542
+ - ✅ Design rationale clearly explained
543
+ - ✅ Trade-offs explicitly documented
544
+ - ✅ All error conditions documented
545
+ - ✅ At least one usage example provided
546
+ - ✅ Complexity analysis for non-trivial algorithms
547
+ - ❌ "Self-documenting code" without explanation
548
+ - ❌ Generic/copied docstring templates
549
+ - ❌ Undocumented error handling
550
+
265
551
  ### Implementation Patterns
266
552
 
267
553
  #### Technical Patterns
@@ -157,13 +157,40 @@ VIOLATION REPORT:
157
157
 
158
158
  **Context Budget**: 200,000 tokens total per session
159
159
 
160
- ### When context usage reaches 90% (180,000 / 200,000 tokens used):
160
+ ### When context usage reaches 70% (140,000 / 200,000 tokens used):
161
161
 
162
- **Immediate notification to user**:
162
+ **Proactive notification to user**:
163
163
  ```
164
- ⚠️ Context Usage Alert: 90% capacity reached (180k/200k tokens)
164
+ ⚠️ Context Usage Caution: 70% capacity reached (140k/200k tokens)
165
165
 
166
- Recommendation: Save current progress and restart session to maintain optimal performance.
166
+ 60,000 tokens remaining - consider planning for session transition.
167
+
168
+ Current State:
169
+ - Completed: [List completed tasks]
170
+ - In Progress: [List in-progress tasks]
171
+ - Pending: [List pending tasks]
172
+
173
+ Planning Options:
174
+ 1. Continue with current work (60k token buffer available)
175
+ 2. Plan for session transition after completing current milestone
176
+ 3. System will auto-generate resume log if session reaches limits
177
+ ```
178
+
179
+ **PM Actions at 70%**:
180
+ 1. Provide status update on session progress
181
+ 2. Estimate remaining token budget for planned work
182
+ 3. Suggest natural breakpoints for potential session transition
183
+ 4. Continue normal operations with awareness of context budget
184
+
185
+ ### When context usage reaches 85% (170,000 / 200,000 tokens used):
186
+
187
+ **Strong warning to user**:
188
+ ```
189
+ ⚠️ Context Usage Warning: 85% capacity reached (170k/200k tokens)
190
+
191
+ 30,000 tokens remaining - session transition recommended soon.
192
+
193
+ Recommendation: Complete current tasks and plan session restart.
167
194
 
168
195
  Current State:
169
196
  - Completed: [List completed tasks]
@@ -171,35 +198,39 @@ Current State:
171
198
  - Pending: [List pending tasks]
172
199
 
173
200
  Suggested Action:
174
- 1. Review completed work above
175
- 2. Use "Continue conversation" to start fresh session
176
- 3. System will automatically restore context from this point
201
+ 1. Complete in-progress tasks
202
+ 2. Review accomplishments above
203
+ 3. Use "Continue conversation" to start fresh session
204
+ 4. System will automatically generate resume log and restore context
177
205
  ```
178
206
 
179
- **PM Actions at 90%**:
207
+ **PM Actions at 85%**:
180
208
  1. Provide clear summary of session accomplishments
181
209
  2. Recommend specific restart timing:
182
210
  - After current task completes
183
211
  - Before starting complex new work
184
212
  - At natural breakpoints in workflow
185
- 3. Continue with essential work only
213
+ 3. Prioritize completing in-progress work over starting new tasks
186
214
 
187
215
  ### When context usage reaches 95% (190,000 / 200,000 tokens used):
188
216
 
189
- **Urgent warning**:
217
+ **Critical alert**:
190
218
  ```
191
- 🚨 URGENT: Context capacity critical (95% - 190k/200k tokens)
219
+ 🚨 CRITICAL: Context capacity at 95% (190k/200k tokens - 10k remaining)
220
+
221
+ Session restart REQUIRED immediately to avoid context window exceeded.
192
222
 
193
- Session restart REQUIRED to avoid degraded performance.
223
+ IMPORTANT: Resume log will be automatically generated to preserve all work.
194
224
 
195
- Please save progress now and continue in a new session.
225
+ Please pause and continue in a new session NOW.
196
226
  ```
197
227
 
198
228
  **PM Actions at 95%**:
199
- 1. **Pause non-critical work** until restart
200
- 2. **Prioritize session handoff** over new tasks
201
- 3. **Complete only in-progress critical tasks**
202
- 4. **Provide comprehensive handoff summary**
229
+ 1. **STOP starting any new work**
230
+ 2. **Generate resume log automatically** if not already done
231
+ 3. **Provide critical handoff summary only**
232
+ 4. **Recommend immediate session restart**
233
+ 5. **Preserve all context for seamless resume**
203
234
 
204
235
  ### Context Usage Best Practices
205
236
 
@@ -210,7 +210,7 @@ class AgentLoader:
210
210
  self.registry.load_agents()
211
211
 
212
212
  init_time = (time.time() - start_time) * 1000
213
- logger.info(
213
+ logger.debug(
214
214
  f"AgentLoader initialized in {init_time:.2f}ms with {len(self.registry._agent_registry)} agents"
215
215
  )
216
216
 
@@ -321,12 +321,12 @@ class AgentLoader:
321
321
  """
322
322
  Reload all agents from disk, clearing the registry.
323
323
  """
324
- logger.info("Reloading agent system...")
324
+ logger.debug("Reloading agent system...")
325
325
 
326
326
  # Reload registry
327
327
  self.registry.reload()
328
328
 
329
- logger.info(
329
+ logger.debug(
330
330
  f"Agent system reloaded with {len(self.registry._agent_registry)} agents"
331
331
  )
332
332
 
@@ -425,7 +425,7 @@ def reload_agents() -> None:
425
425
  # Clear the global instance to force reinitialization
426
426
  _loader = None
427
427
 
428
- logger.info("Agent registry cleared, will reload on next access")
428
+ logger.debug("Agent registry cleared, will reload on next access")
429
429
 
430
430
 
431
431
  def get_agent_tier(agent_name: str) -> Optional[str]:
@@ -112,7 +112,11 @@
112
112
  "Plan modularization at 600 lines",
113
113
  "Review file commit history before modifications: git log --oneline -5 <file_path>",
114
114
  "Write succinct commit messages explaining WHAT changed and WHY",
115
- "Follow conventional commits format: feat/fix/docs/refactor/perf/test/chore"
115
+ "Follow conventional commits format: feat/fix/docs/refactor/perf/test/chore",
116
+ "Document design decisions and architectural trade-offs",
117
+ "Provide complexity analysis (time/space) for algorithms",
118
+ "Include practical usage examples in documentation",
119
+ "Document all error cases and failure modes"
116
120
  ],
117
121
  "constraints": [],
118
122
  "examples": []