claude-mpm 5.1.9__py3-none-any.whl → 5.4.14__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 (162) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/__init__.py +4 -0
  3. claude_mpm/agents/PM_INSTRUCTIONS.md +85 -0
  4. claude_mpm/agents/agent_loader.py +13 -44
  5. claude_mpm/agents/templates/circuit-breakers.md +138 -1
  6. claude_mpm/cli/__main__.py +4 -0
  7. claude_mpm/cli/commands/agent_state_manager.py +8 -17
  8. claude_mpm/cli/commands/auto_configure.py +210 -25
  9. claude_mpm/cli/commands/config.py +88 -2
  10. claude_mpm/cli/commands/configure.py +1097 -158
  11. claude_mpm/cli/commands/configure_agent_display.py +15 -6
  12. claude_mpm/cli/commands/mpm_init/core.py +160 -46
  13. claude_mpm/cli/commands/mpm_init/knowledge_extractor.py +481 -0
  14. claude_mpm/cli/commands/mpm_init/prompts.py +280 -0
  15. claude_mpm/cli/commands/skills.py +21 -2
  16. claude_mpm/cli/commands/summarize.py +413 -0
  17. claude_mpm/cli/executor.py +11 -3
  18. claude_mpm/cli/parsers/base_parser.py +5 -0
  19. claude_mpm/cli/parsers/config_parser.py +153 -83
  20. claude_mpm/cli/parsers/skills_parser.py +3 -2
  21. claude_mpm/cli/startup.py +333 -89
  22. claude_mpm/commands/mpm-config.md +266 -0
  23. claude_mpm/commands/{mpm-ticket-organize.md → mpm-organize.md} +4 -5
  24. claude_mpm/config/agent_sources.py +27 -0
  25. claude_mpm/core/framework/formatters/content_formatter.py +3 -13
  26. claude_mpm/core/framework/loaders/agent_loader.py +8 -5
  27. claude_mpm/core/framework_loader.py +4 -2
  28. claude_mpm/core/logger.py +13 -0
  29. claude_mpm/core/socketio_pool.py +3 -3
  30. claude_mpm/core/unified_agent_registry.py +5 -15
  31. claude_mpm/hooks/claude_hooks/correlation_manager.py +60 -0
  32. claude_mpm/hooks/claude_hooks/event_handlers.py +206 -78
  33. claude_mpm/hooks/claude_hooks/hook_handler.py +6 -0
  34. claude_mpm/hooks/claude_hooks/installer.py +33 -10
  35. claude_mpm/hooks/claude_hooks/memory_integration.py +26 -9
  36. claude_mpm/hooks/claude_hooks/response_tracking.py +2 -3
  37. claude_mpm/hooks/claude_hooks/services/connection_manager.py +4 -0
  38. claude_mpm/hooks/memory_integration_hook.py +46 -1
  39. claude_mpm/init.py +0 -19
  40. claude_mpm/scripts/claude-hook-handler.sh +58 -18
  41. claude_mpm/scripts/launch_monitor.py +93 -13
  42. claude_mpm/services/agents/agent_recommendation_service.py +278 -0
  43. claude_mpm/services/agents/agent_review_service.py +280 -0
  44. claude_mpm/services/agents/deployment/agent_discovery_service.py +2 -3
  45. claude_mpm/services/agents/deployment/agent_template_builder.py +4 -2
  46. claude_mpm/services/agents/deployment/multi_source_deployment_service.py +78 -9
  47. claude_mpm/services/agents/deployment/remote_agent_discovery_service.py +335 -53
  48. claude_mpm/services/agents/git_source_manager.py +34 -0
  49. claude_mpm/services/agents/loading/base_agent_manager.py +1 -13
  50. claude_mpm/services/agents/sources/git_source_sync_service.py +8 -1
  51. claude_mpm/services/agents/toolchain_detector.py +10 -6
  52. claude_mpm/services/analysis/__init__.py +11 -1
  53. claude_mpm/services/analysis/clone_detector.py +1030 -0
  54. claude_mpm/services/command_deployment_service.py +71 -10
  55. claude_mpm/services/event_bus/config.py +3 -1
  56. claude_mpm/services/git/git_operations_service.py +93 -8
  57. claude_mpm/services/monitor/daemon.py +9 -2
  58. claude_mpm/services/monitor/daemon_manager.py +39 -3
  59. claude_mpm/services/monitor/server.py +225 -19
  60. claude_mpm/services/self_upgrade_service.py +120 -12
  61. claude_mpm/services/skills/__init__.py +3 -0
  62. claude_mpm/services/skills/git_skill_source_manager.py +32 -2
  63. claude_mpm/services/skills/selective_skill_deployer.py +230 -0
  64. claude_mpm/services/skills/skill_to_agent_mapper.py +406 -0
  65. claude_mpm/services/skills_deployer.py +64 -3
  66. claude_mpm/services/socketio/event_normalizer.py +15 -1
  67. claude_mpm/services/socketio/server/core.py +160 -21
  68. claude_mpm/services/version_control/git_operations.py +103 -0
  69. claude_mpm/utils/agent_filters.py +17 -44
  70. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/METADATA +47 -84
  71. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/RECORD +76 -150
  72. claude_mpm-5.4.14.dist-info/entry_points.txt +5 -0
  73. claude_mpm-5.4.14.dist-info/licenses/LICENSE +94 -0
  74. claude_mpm-5.4.14.dist-info/licenses/LICENSE-FAQ.md +153 -0
  75. claude_mpm/agents/BASE_AGENT_TEMPLATE.md +0 -292
  76. claude_mpm/agents/BASE_DOCUMENTATION.md +0 -53
  77. claude_mpm/agents/BASE_ENGINEER.md +0 -658
  78. claude_mpm/agents/BASE_OPS.md +0 -219
  79. claude_mpm/agents/BASE_PM.md +0 -480
  80. claude_mpm/agents/BASE_PROMPT_ENGINEER.md +0 -787
  81. claude_mpm/agents/BASE_QA.md +0 -167
  82. claude_mpm/agents/BASE_RESEARCH.md +0 -53
  83. claude_mpm/agents/base_agent.json +0 -31
  84. claude_mpm/agents/base_agent_loader.py +0 -601
  85. claude_mpm/cli/ticket_cli.py +0 -35
  86. claude_mpm/commands/mpm-config-view.md +0 -150
  87. claude_mpm/dashboard/analysis_runner.py +0 -455
  88. claude_mpm/dashboard/index.html +0 -13
  89. claude_mpm/dashboard/open_dashboard.py +0 -66
  90. claude_mpm/dashboard/static/css/activity.css +0 -1958
  91. claude_mpm/dashboard/static/css/connection-status.css +0 -370
  92. claude_mpm/dashboard/static/css/dashboard.css +0 -4701
  93. claude_mpm/dashboard/static/js/components/activity-tree.js +0 -1871
  94. claude_mpm/dashboard/static/js/components/agent-hierarchy.js +0 -777
  95. claude_mpm/dashboard/static/js/components/agent-inference.js +0 -956
  96. claude_mpm/dashboard/static/js/components/build-tracker.js +0 -333
  97. claude_mpm/dashboard/static/js/components/code-simple.js +0 -857
  98. claude_mpm/dashboard/static/js/components/connection-debug.js +0 -654
  99. claude_mpm/dashboard/static/js/components/diff-viewer.js +0 -891
  100. claude_mpm/dashboard/static/js/components/event-processor.js +0 -542
  101. claude_mpm/dashboard/static/js/components/event-viewer.js +0 -1155
  102. claude_mpm/dashboard/static/js/components/export-manager.js +0 -368
  103. claude_mpm/dashboard/static/js/components/file-change-tracker.js +0 -443
  104. claude_mpm/dashboard/static/js/components/file-change-viewer.js +0 -690
  105. claude_mpm/dashboard/static/js/components/file-tool-tracker.js +0 -724
  106. claude_mpm/dashboard/static/js/components/file-viewer.js +0 -580
  107. claude_mpm/dashboard/static/js/components/hud-library-loader.js +0 -211
  108. claude_mpm/dashboard/static/js/components/hud-manager.js +0 -671
  109. claude_mpm/dashboard/static/js/components/hud-visualizer.js +0 -1718
  110. claude_mpm/dashboard/static/js/components/module-viewer.js +0 -2764
  111. claude_mpm/dashboard/static/js/components/session-manager.js +0 -579
  112. claude_mpm/dashboard/static/js/components/socket-manager.js +0 -368
  113. claude_mpm/dashboard/static/js/components/ui-state-manager.js +0 -749
  114. claude_mpm/dashboard/static/js/components/unified-data-viewer.js +0 -1824
  115. claude_mpm/dashboard/static/js/components/working-directory.js +0 -920
  116. claude_mpm/dashboard/static/js/connection-manager.js +0 -536
  117. claude_mpm/dashboard/static/js/dashboard.js +0 -1914
  118. claude_mpm/dashboard/static/js/extension-error-handler.js +0 -164
  119. claude_mpm/dashboard/static/js/socket-client.js +0 -1474
  120. claude_mpm/dashboard/static/js/tab-isolation-fix.js +0 -185
  121. claude_mpm/dashboard/static/socket.io.min.js +0 -7
  122. claude_mpm/dashboard/static/socket.io.v4.8.1.backup.js +0 -7
  123. claude_mpm/dashboard/templates/code_simple.html +0 -153
  124. claude_mpm/dashboard/templates/index.html +0 -606
  125. claude_mpm/dashboard/test_dashboard.html +0 -372
  126. claude_mpm/scripts/mcp_server.py +0 -75
  127. claude_mpm/scripts/mcp_wrapper.py +0 -39
  128. claude_mpm/services/mcp_gateway/__init__.py +0 -159
  129. claude_mpm/services/mcp_gateway/auto_configure.py +0 -369
  130. claude_mpm/services/mcp_gateway/config/__init__.py +0 -17
  131. claude_mpm/services/mcp_gateway/config/config_loader.py +0 -296
  132. claude_mpm/services/mcp_gateway/config/config_schema.py +0 -243
  133. claude_mpm/services/mcp_gateway/config/configuration.py +0 -429
  134. claude_mpm/services/mcp_gateway/core/__init__.py +0 -43
  135. claude_mpm/services/mcp_gateway/core/base.py +0 -312
  136. claude_mpm/services/mcp_gateway/core/exceptions.py +0 -253
  137. claude_mpm/services/mcp_gateway/core/interfaces.py +0 -443
  138. claude_mpm/services/mcp_gateway/core/process_pool.py +0 -977
  139. claude_mpm/services/mcp_gateway/core/singleton_manager.py +0 -315
  140. claude_mpm/services/mcp_gateway/core/startup_verification.py +0 -316
  141. claude_mpm/services/mcp_gateway/main.py +0 -589
  142. claude_mpm/services/mcp_gateway/registry/__init__.py +0 -12
  143. claude_mpm/services/mcp_gateway/registry/service_registry.py +0 -412
  144. claude_mpm/services/mcp_gateway/registry/tool_registry.py +0 -489
  145. claude_mpm/services/mcp_gateway/server/__init__.py +0 -15
  146. claude_mpm/services/mcp_gateway/server/mcp_gateway.py +0 -414
  147. claude_mpm/services/mcp_gateway/server/stdio_handler.py +0 -372
  148. claude_mpm/services/mcp_gateway/server/stdio_server.py +0 -712
  149. claude_mpm/services/mcp_gateway/tools/__init__.py +0 -36
  150. claude_mpm/services/mcp_gateway/tools/base_adapter.py +0 -485
  151. claude_mpm/services/mcp_gateway/tools/document_summarizer.py +0 -789
  152. claude_mpm/services/mcp_gateway/tools/external_mcp_services.py +0 -654
  153. claude_mpm/services/mcp_gateway/tools/health_check_tool.py +0 -456
  154. claude_mpm/services/mcp_gateway/tools/hello_world.py +0 -551
  155. claude_mpm/services/mcp_gateway/tools/kuzu_memory_service.py +0 -555
  156. claude_mpm/services/mcp_gateway/utils/__init__.py +0 -14
  157. claude_mpm/services/mcp_gateway/utils/package_version_checker.py +0 -160
  158. claude_mpm/services/mcp_gateway/utils/update_preferences.py +0 -170
  159. claude_mpm-5.1.9.dist-info/entry_points.txt +0 -10
  160. claude_mpm-5.1.9.dist-info/licenses/LICENSE +0 -21
  161. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/WHEEL +0 -0
  162. {claude_mpm-5.1.9.dist-info → claude_mpm-5.4.14.dist-info}/top_level.txt +0 -0
@@ -10,7 +10,9 @@ from pathlib import Path
10
10
  from typing import Any, Dict, Optional
11
11
 
12
12
  __all__ = [
13
+ "build_enhanced_update_prompt",
13
14
  "build_initialization_prompt",
15
+ "build_prompt_engineer_optimization_prompt",
14
16
  "build_research_context_prompt",
15
17
  "build_update_prompt",
16
18
  ]
@@ -305,6 +307,208 @@ preserving valuable project-specific information while refreshing standard secti
305
307
  return prompt
306
308
 
307
309
 
310
+ def build_enhanced_update_prompt(
311
+ project_path: Path,
312
+ doc_analysis: Dict[str, Any],
313
+ git_insights: Dict[str, Any],
314
+ log_insights: Dict[str, Any],
315
+ memory_insights: Dict[str, Any],
316
+ project_type: Optional[str] = None,
317
+ framework: Optional[str] = None,
318
+ ast_analysis: bool = True,
319
+ preserve_custom: bool = True,
320
+ ) -> str:
321
+ """
322
+ Build enhanced update prompt with extracted knowledge from multiple sources.
323
+
324
+ This is the AUTO-DETECTED update mode that enriches CLAUDE.md with:
325
+ - Git history insights (architectural decisions, tech changes, workflows)
326
+ - Session log learnings (completed work, patterns)
327
+ - Memory file knowledge (accumulated project wisdom)
328
+
329
+ Args:
330
+ project_path: Path to the project directory
331
+ doc_analysis: Analysis results from DocumentationManager
332
+ git_insights: Extracted git history insights
333
+ log_insights: Extracted session log insights
334
+ memory_insights: Extracted memory file insights
335
+ project_type: Type of project (web, api, cli, library, etc.)
336
+ framework: Specific framework if applicable
337
+ ast_analysis: Enable AST analysis for enhanced documentation
338
+ preserve_custom: Preserve custom sections when updating
339
+
340
+ Returns:
341
+ Formatted prompt string for enhanced update mode
342
+ """
343
+ prompt = f"""Please delegate this task to the Agentic Coder Optimizer agent:
344
+
345
+ ENHANCED UPDATE of existing CLAUDE.md documentation with extracted project knowledge.
346
+
347
+ Project Path: {project_path}
348
+ Update Mode: Knowledge-enriched smart merge
349
+ """
350
+ if project_type:
351
+ prompt += f"Project Type: {project_type}\n"
352
+ if framework:
353
+ prompt += f"Framework: {framework}\n"
354
+
355
+ prompt += f"""
356
+ Existing Documentation Analysis:
357
+ - Current CLAUDE.md: {doc_analysis.get("size", 0):,} characters, {doc_analysis.get("lines", 0)} lines
358
+ - Has Priority Index: {"Yes" if doc_analysis.get("has_priority_index") else "No"}
359
+ - Custom Sections: {len(doc_analysis.get("custom_sections", []))} found
360
+ """
361
+ if preserve_custom and doc_analysis.get("custom_sections"):
362
+ prompt += f"- Preserve Custom Sections: {', '.join(doc_analysis['custom_sections'][:5])}\n"
363
+
364
+ # Add extracted knowledge sections
365
+ prompt += "\n## Extracted Project Knowledge\n\n"
366
+
367
+ # Git insights
368
+ if git_insights.get("available"):
369
+ prompt += "### From Git History (last 90 days):\n\n"
370
+
371
+ if git_insights.get("architectural_decisions"):
372
+ prompt += "**Architectural Patterns Detected:**\n"
373
+ for decision in git_insights["architectural_decisions"][:10]:
374
+ prompt += f"- {decision}\n"
375
+ prompt += "\n"
376
+
377
+ if git_insights.get("tech_stack_changes"):
378
+ prompt += "**Tech Stack Changes:**\n"
379
+ for change in git_insights["tech_stack_changes"][:10]:
380
+ prompt += f"- {change}\n"
381
+ prompt += "\n"
382
+
383
+ if git_insights.get("workflow_patterns"):
384
+ prompt += "**Common Workflows:**\n"
385
+ for workflow in git_insights["workflow_patterns"][:8]:
386
+ prompt += f"- {workflow}\n"
387
+ prompt += "\n"
388
+
389
+ if git_insights.get("hot_files"):
390
+ prompt += "**Hot Files (frequently modified):**\n"
391
+ for file_info in git_insights["hot_files"][:10]:
392
+ prompt += (
393
+ f"- {file_info['path']} ({file_info['modifications']} changes)\n"
394
+ )
395
+ prompt += "\n"
396
+
397
+ # Session log insights
398
+ if log_insights.get("available") and log_insights.get("learnings"):
399
+ prompt += "### From Session Logs:\n\n"
400
+ prompt += "**Recent Learnings from PM Summaries:**\n"
401
+ for learning in log_insights["learnings"][:10]:
402
+ source = learning.get("source", "unknown")
403
+ content = learning.get("content", "")
404
+ # Truncate long content
405
+ if len(content) > 200:
406
+ content = content[:200] + "..."
407
+ prompt += f"- [{source}] {content}\n"
408
+ prompt += "\n"
409
+
410
+ if log_insights.get("common_patterns"):
411
+ prompt += "**Common Task Patterns:**\n"
412
+ prompt += f"- {', '.join(log_insights['common_patterns'][:10])}\n\n"
413
+
414
+ # Memory insights
415
+ if memory_insights.get("available"):
416
+ has_content = False
417
+
418
+ if memory_insights.get("architectural_knowledge"):
419
+ has_content = True
420
+ prompt += "### From Agent Memories:\n\n"
421
+ prompt += "**Architectural Knowledge:**\n"
422
+ for item in memory_insights["architectural_knowledge"][:8]:
423
+ prompt += f"- {item}\n"
424
+ prompt += "\n"
425
+
426
+ if memory_insights.get("implementation_guidelines"):
427
+ if not has_content:
428
+ prompt += "### From Agent Memories:\n\n"
429
+ has_content = True
430
+ prompt += "**Implementation Guidelines:**\n"
431
+ for item in memory_insights["implementation_guidelines"][:8]:
432
+ prompt += f"- {item}\n"
433
+ prompt += "\n"
434
+
435
+ if memory_insights.get("common_mistakes"):
436
+ if not has_content:
437
+ prompt += "### From Agent Memories:\n\n"
438
+ has_content = True
439
+ prompt += "**Common Mistakes to Avoid:**\n"
440
+ for item in memory_insights["common_mistakes"][:8]:
441
+ prompt += f"- {item}\n"
442
+ prompt += "\n"
443
+
444
+ if memory_insights.get("technical_context"):
445
+ if not has_content:
446
+ prompt += "### From Agent Memories:\n\n"
447
+ prompt += "**Current Technical Context:**\n"
448
+ for item in memory_insights["technical_context"][:8]:
449
+ prompt += f"- {item}\n"
450
+ prompt += "\n"
451
+
452
+ # Add update instructions
453
+ prompt += """
454
+ ## UPDATE Tasks with Knowledge Integration:
455
+
456
+ 1. **Review Existing Content**:
457
+ - Analyze current CLAUDE.md structure and content
458
+ - Identify outdated or missing information
459
+ - Preserve valuable custom sections and project-specific knowledge
460
+
461
+ 2. **Integrate Extracted Knowledge**:
462
+ - Merge architectural decisions from git history into Architecture section
463
+ - Add tech stack changes to Technology/Dependencies sections
464
+ - Update workflow patterns in Development Guidelines
465
+ - Incorporate session learnings into relevant sections
466
+ - Merge memory insights into appropriate documentation areas
467
+ - Highlight hot files as critical components
468
+
469
+ 3. **Smart Content Merge**:
470
+ - Update project overview with recent developments
471
+ - Refresh architecture documentation with detected patterns
472
+ - Update development workflows with discovered common patterns
473
+ - Ensure single-path principle (ONE way to do each task)
474
+ - Remove duplicate or contradictory information
475
+
476
+ 4. **Update Priority Organization**:
477
+ - Reorganize content with priority markers (🔴🟡🟢⚪)
478
+ - Ensure critical instructions are at the top
479
+ - Update priority index with all important items
480
+ - Promote frequently-modified files to IMPORTANT sections
481
+
482
+ 5. **Refresh Technical Content**:
483
+ - Update build/test/deploy commands based on workflow patterns
484
+ - Verify tool configurations match tech stack changes
485
+ - Update dependency information with detected changes
486
+ - Refresh API documentation if applicable
487
+ """
488
+ if ast_analysis:
489
+ prompt += """
490
+ 6. **Update Code Documentation** (using Code Analyzer agent):
491
+ - Re-analyze code structure for changes
492
+ - Update API documentation
493
+ - Refresh architecture diagrams
494
+ - Document hot files and critical components
495
+ """
496
+ prompt += """
497
+ 7. **Final Optimization**:
498
+ - Ensure single-path principle throughout
499
+ - Validate all links and references
500
+ - Add/update timestamp in meta section
501
+ - Add "Last Updated" note mentioning knowledge extraction
502
+ - Verify AI agent readability
503
+
504
+ IMPORTANT: This is an ENHANCED UPDATE operation with extracted knowledge.
505
+ Intelligently merge insights from git history, session logs, and agent memories
506
+ into the existing CLAUDE.md while preserving valuable custom content.
507
+ The goal is to create a living document that reflects actual project evolution.
508
+ """
509
+ return prompt
510
+
511
+
308
512
  def build_research_context_prompt(git_analysis: Dict[str, Any], days: int) -> str:
309
513
  """
310
514
  Build structured Research agent delegation prompt from git analysis.
@@ -440,3 +644,79 @@ Keep it concise (<1000 words) but actionable.
440
644
  """
441
645
 
442
646
  return prompt
647
+
648
+
649
+ def build_prompt_engineer_optimization_prompt(
650
+ content: str, estimated_tokens: int
651
+ ) -> str:
652
+ """
653
+ Build prompt for prompt-engineer to optimize CLAUDE.md.
654
+
655
+ Args:
656
+ content: Current CLAUDE.md content to optimize
657
+ estimated_tokens: Estimated token count of current content
658
+
659
+ Returns:
660
+ Formatted prompt string for prompt-engineer optimization
661
+ """
662
+ return f"""Please delegate this task to the Prompt Engineer agent:
663
+
664
+ Optimize this CLAUDE.md file for conciseness, clarity, and token efficiency while preserving all critical information.
665
+
666
+ ## Current CLAUDE.md Statistics
667
+ - Estimated tokens: {estimated_tokens:,}
668
+ - Target reduction: 20-30% if possible
669
+ - Priority: Preserve ALL CRITICAL (🔴) and IMPORTANT (🟡) information
670
+
671
+ ## Optimization Goals
672
+
673
+ 1. **Remove Redundancy**:
674
+ - Eliminate duplicate information across sections
675
+ - Consolidate similar instructions
676
+ - Remove verbose explanations where brevity suffices
677
+
678
+ 2. **Tighten Language**:
679
+ - Use fewer words to convey the same meaning
680
+ - Replace wordy phrases with concise alternatives
681
+ - Remove filler words and unnecessary qualifiers
682
+
683
+ 3. **Improve Structure**:
684
+ - Ensure clear hierarchical organization
685
+ - Use priority markers (🔴 🟡 🟢 ⚪) effectively
686
+ - Group related information logically
687
+ - Maintain scannable headings
688
+
689
+ 4. **Preserve Critical Content**:
690
+ - Keep ALL security and data handling rules (🔴)
691
+ - Maintain core business logic and constraints (🔴)
692
+ - Preserve architectural decisions (🟡)
693
+ - Keep essential workflows intact (🟡)
694
+
695
+ 5. **Apply Claude Best Practices**:
696
+ - Use high-level guidance over prescriptive checklists
697
+ - Provide context for WHY, not just WHAT
698
+ - Ensure instructions are actionable and unambiguous
699
+ - Optimize for AI agent understanding
700
+
701
+ ## Current CLAUDE.md Content
702
+
703
+ {content}
704
+
705
+ ## Output Requirements
706
+
707
+ Return ONLY the optimized CLAUDE.md content with NO additional explanations.
708
+ The optimized version should:
709
+ - Reduce token count by 20-30% if feasible
710
+ - Maintain all CRITICAL and IMPORTANT instructions
711
+ - Improve clarity and scannability
712
+ - Follow the same structural template (Priority Index, sections with markers)
713
+
714
+ ## Quality Criteria
715
+
716
+ ✅ All 🔴 CRITICAL items preserved
717
+ ✅ All 🟡 IMPORTANT items preserved
718
+ ✅ No contradictory instructions
719
+ ✅ Clear, concise language throughout
720
+ ✅ Logical organization maintained
721
+ ✅ Token count reduced meaningfully
722
+ """
@@ -537,7 +537,7 @@ class SkillsManagementCommand(BaseCommand):
537
537
  toolchain = getattr(args, "toolchain", None)
538
538
  categories = getattr(args, "categories", None)
539
539
  force = getattr(args, "force", False)
540
- all_skills = getattr(args, "all", False)
540
+ all_skills = getattr(args, "all_skills", False)
541
541
 
542
542
  if collection:
543
543
  console.print(
@@ -554,17 +554,36 @@ class SkillsManagementCommand(BaseCommand):
554
554
  "[yellow]No toolchain specified. Use --toolchain to filter by language,[/yellow]"
555
555
  )
556
556
  console.print(
557
- "[yellow]or --all to deploy all available skills.[/yellow]\n"
557
+ "[yellow]or --all-skills to deploy all available skills (not just agent-referenced).[/yellow]\n"
558
558
  )
559
559
 
560
+ # Selective deployment is enabled by default (deploy only agent-referenced skills)
561
+ # Use --all-skills to disable selective mode
560
562
  result = self.skills_deployer.deploy_skills(
561
563
  collection=collection,
562
564
  toolchain=toolchain,
563
565
  categories=categories,
564
566
  force=force,
567
+ selective=not all_skills, # Disable selective mode if --all-skills is set
565
568
  )
566
569
 
567
570
  # Display results
571
+ # Show selective mode summary
572
+ if result.get("selective_mode"):
573
+ total_available = result.get("total_available", 0)
574
+ deployed_count = result["deployed_count"]
575
+ console.print(
576
+ f"[cyan]📌 Selective deployment: {deployed_count} agent-referenced skills "
577
+ f"(out of {total_available} available)[/cyan]"
578
+ )
579
+ console.print(
580
+ "[dim]Use --all-skills to deploy all available skills[/dim]\n"
581
+ )
582
+ else:
583
+ console.print(
584
+ "[cyan]📦 Deploying all available skills (selective mode disabled)[/cyan]\n"
585
+ )
586
+
568
587
  if result["deployed_count"] > 0:
569
588
  console.print(
570
589
  f"[green]✓ Deployed {result['deployed_count']} skill(s):[/green]"