claude-mpm 5.4.55__py3-none-any.whl → 5.4.85__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 (173) hide show
  1. claude_mpm/VERSION +1 -1
  2. claude_mpm/agents/CLAUDE_MPM_FOUNDERS_OUTPUT_STYLE.md +405 -0
  3. claude_mpm/agents/CLAUDE_MPM_OUTPUT_STYLE.md +63 -241
  4. claude_mpm/agents/CLAUDE_MPM_TEACHER_OUTPUT_STYLE.md +109 -1925
  5. claude_mpm/agents/PM_INSTRUCTIONS.md +36 -9
  6. claude_mpm/cli/__init__.py +5 -1
  7. claude_mpm/cli/commands/agents.py +2 -4
  8. claude_mpm/cli/commands/agents_reconcile.py +197 -0
  9. claude_mpm/cli/commands/configure.py +620 -21
  10. claude_mpm/cli/commands/skills.py +166 -14
  11. claude_mpm/cli/executor.py +1 -0
  12. claude_mpm/cli/interactive/__init__.py +10 -0
  13. claude_mpm/cli/interactive/agent_wizard.py +30 -50
  14. claude_mpm/cli/interactive/questionary_styles.py +65 -0
  15. claude_mpm/cli/interactive/skill_selector.py +481 -0
  16. claude_mpm/cli/parsers/base_parser.py +5 -0
  17. claude_mpm/cli/startup.py +223 -388
  18. claude_mpm/constants.py +1 -0
  19. claude_mpm/core/claude_runner.py +2 -2
  20. claude_mpm/core/interactive_session.py +7 -7
  21. claude_mpm/core/output_style_manager.py +21 -13
  22. claude_mpm/core/unified_config.py +50 -8
  23. claude_mpm/core/unified_paths.py +30 -13
  24. claude_mpm/scripts/start_activity_logging.py +0 -0
  25. claude_mpm/services/agents/deployment/agent_template_builder.py +8 -0
  26. claude_mpm/services/agents/deployment/deployment_reconciler.py +577 -0
  27. claude_mpm/services/agents/deployment/startup_reconciliation.py +138 -0
  28. claude_mpm/services/agents/sources/git_source_sync_service.py +7 -4
  29. claude_mpm/services/agents/startup_sync.py +5 -2
  30. claude_mpm/services/pm_skills_deployer.py +4 -0
  31. claude_mpm/services/skills/git_skill_source_manager.py +24 -8
  32. claude_mpm/services/skills/selective_skill_deployer.py +82 -83
  33. claude_mpm/skills/bundled/collaboration/brainstorming/SKILL.md +79 -0
  34. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/SKILL.md +178 -0
  35. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/agent-prompts.md +577 -0
  36. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/coordination-patterns.md +467 -0
  37. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/examples.md +537 -0
  38. claude_mpm/skills/bundled/collaboration/dispatching-parallel-agents/references/troubleshooting.md +730 -0
  39. claude_mpm/skills/bundled/collaboration/git-worktrees.md +317 -0
  40. claude_mpm/skills/bundled/collaboration/requesting-code-review/SKILL.md +112 -0
  41. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/code-reviewer-template.md +146 -0
  42. claude_mpm/skills/bundled/collaboration/requesting-code-review/references/review-examples.md +412 -0
  43. claude_mpm/skills/bundled/collaboration/stacked-prs.md +251 -0
  44. claude_mpm/skills/bundled/collaboration/writing-plans/SKILL.md +81 -0
  45. claude_mpm/skills/bundled/collaboration/writing-plans/references/best-practices.md +362 -0
  46. claude_mpm/skills/bundled/collaboration/writing-plans/references/plan-structure-templates.md +312 -0
  47. claude_mpm/skills/bundled/debugging/root-cause-tracing/SKILL.md +152 -0
  48. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/advanced-techniques.md +668 -0
  49. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/examples.md +587 -0
  50. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/integration.md +438 -0
  51. claude_mpm/skills/bundled/debugging/root-cause-tracing/references/tracing-techniques.md +391 -0
  52. claude_mpm/skills/bundled/debugging/systematic-debugging/CREATION-LOG.md +119 -0
  53. claude_mpm/skills/bundled/debugging/systematic-debugging/SKILL.md +148 -0
  54. claude_mpm/skills/bundled/debugging/systematic-debugging/references/anti-patterns.md +483 -0
  55. claude_mpm/skills/bundled/debugging/systematic-debugging/references/examples.md +452 -0
  56. claude_mpm/skills/bundled/debugging/systematic-debugging/references/troubleshooting.md +449 -0
  57. claude_mpm/skills/bundled/debugging/systematic-debugging/references/workflow.md +411 -0
  58. claude_mpm/skills/bundled/debugging/systematic-debugging/test-academic.md +14 -0
  59. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-1.md +58 -0
  60. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-2.md +68 -0
  61. claude_mpm/skills/bundled/debugging/systematic-debugging/test-pressure-3.md +69 -0
  62. claude_mpm/skills/bundled/debugging/verification-before-completion/SKILL.md +131 -0
  63. claude_mpm/skills/bundled/debugging/verification-before-completion/references/gate-function.md +325 -0
  64. claude_mpm/skills/bundled/debugging/verification-before-completion/references/integration-and-workflows.md +490 -0
  65. claude_mpm/skills/bundled/debugging/verification-before-completion/references/red-flags-and-failures.md +425 -0
  66. claude_mpm/skills/bundled/debugging/verification-before-completion/references/verification-patterns.md +499 -0
  67. claude_mpm/skills/bundled/infrastructure/env-manager/INTEGRATION.md +611 -0
  68. claude_mpm/skills/bundled/infrastructure/env-manager/README.md +596 -0
  69. claude_mpm/skills/bundled/infrastructure/env-manager/SKILL.md +260 -0
  70. claude_mpm/skills/bundled/infrastructure/env-manager/examples/nextjs-env-structure.md +315 -0
  71. claude_mpm/skills/bundled/infrastructure/env-manager/references/frameworks.md +436 -0
  72. claude_mpm/skills/bundled/infrastructure/env-manager/references/security.md +433 -0
  73. claude_mpm/skills/bundled/infrastructure/env-manager/references/synchronization.md +452 -0
  74. claude_mpm/skills/bundled/infrastructure/env-manager/references/troubleshooting.md +404 -0
  75. claude_mpm/skills/bundled/infrastructure/env-manager/references/validation.md +420 -0
  76. claude_mpm/skills/bundled/main/artifacts-builder/SKILL.md +86 -0
  77. claude_mpm/skills/bundled/main/internal-comms/SKILL.md +43 -0
  78. claude_mpm/skills/bundled/main/internal-comms/examples/3p-updates.md +47 -0
  79. claude_mpm/skills/bundled/main/internal-comms/examples/company-newsletter.md +65 -0
  80. claude_mpm/skills/bundled/main/internal-comms/examples/faq-answers.md +30 -0
  81. claude_mpm/skills/bundled/main/internal-comms/examples/general-comms.md +16 -0
  82. claude_mpm/skills/bundled/main/mcp-builder/SKILL.md +160 -0
  83. claude_mpm/skills/bundled/main/mcp-builder/reference/design_principles.md +412 -0
  84. claude_mpm/skills/bundled/main/mcp-builder/reference/evaluation.md +602 -0
  85. claude_mpm/skills/bundled/main/mcp-builder/reference/mcp_best_practices.md +915 -0
  86. claude_mpm/skills/bundled/main/mcp-builder/reference/node_mcp_server.md +916 -0
  87. claude_mpm/skills/bundled/main/mcp-builder/reference/python_mcp_server.md +752 -0
  88. claude_mpm/skills/bundled/main/mcp-builder/reference/workflow.md +1237 -0
  89. claude_mpm/skills/bundled/main/skill-creator/SKILL.md +189 -0
  90. claude_mpm/skills/bundled/main/skill-creator/references/best-practices.md +500 -0
  91. claude_mpm/skills/bundled/main/skill-creator/references/creation-workflow.md +464 -0
  92. claude_mpm/skills/bundled/main/skill-creator/references/examples.md +619 -0
  93. claude_mpm/skills/bundled/main/skill-creator/references/progressive-disclosure.md +437 -0
  94. claude_mpm/skills/bundled/main/skill-creator/references/skill-structure.md +231 -0
  95. claude_mpm/skills/bundled/php/espocrm-development/SKILL.md +170 -0
  96. claude_mpm/skills/bundled/php/espocrm-development/references/architecture.md +602 -0
  97. claude_mpm/skills/bundled/php/espocrm-development/references/common-tasks.md +821 -0
  98. claude_mpm/skills/bundled/php/espocrm-development/references/development-workflow.md +742 -0
  99. claude_mpm/skills/bundled/php/espocrm-development/references/frontend-customization.md +726 -0
  100. claude_mpm/skills/bundled/php/espocrm-development/references/hooks-and-services.md +764 -0
  101. claude_mpm/skills/bundled/php/espocrm-development/references/testing-debugging.md +831 -0
  102. claude_mpm/skills/bundled/pm/pm-bug-reporting/pm-bug-reporting.md +248 -0
  103. claude_mpm/skills/bundled/pm/pm-delegation-patterns/SKILL.md +167 -0
  104. claude_mpm/skills/bundled/pm/pm-git-file-tracking/SKILL.md +113 -0
  105. claude_mpm/skills/bundled/pm/pm-pr-workflow/SKILL.md +124 -0
  106. claude_mpm/skills/bundled/pm/pm-teaching-mode/SKILL.md +657 -0
  107. claude_mpm/skills/bundled/pm/pm-ticketing-integration/SKILL.md +154 -0
  108. claude_mpm/skills/bundled/pm/pm-verification-protocols/SKILL.md +198 -0
  109. claude_mpm/skills/bundled/react/flexlayout-react.md +742 -0
  110. claude_mpm/skills/bundled/rust/desktop-applications/SKILL.md +226 -0
  111. claude_mpm/skills/bundled/rust/desktop-applications/references/architecture-patterns.md +901 -0
  112. claude_mpm/skills/bundled/rust/desktop-applications/references/native-gui-frameworks.md +901 -0
  113. claude_mpm/skills/bundled/rust/desktop-applications/references/platform-integration.md +775 -0
  114. claude_mpm/skills/bundled/rust/desktop-applications/references/state-management.md +937 -0
  115. claude_mpm/skills/bundled/rust/desktop-applications/references/tauri-framework.md +770 -0
  116. claude_mpm/skills/bundled/rust/desktop-applications/references/testing-deployment.md +961 -0
  117. claude_mpm/skills/bundled/tauri/tauri-async-patterns.md +495 -0
  118. claude_mpm/skills/bundled/tauri/tauri-build-deploy.md +599 -0
  119. claude_mpm/skills/bundled/tauri/tauri-command-patterns.md +535 -0
  120. claude_mpm/skills/bundled/tauri/tauri-error-handling.md +613 -0
  121. claude_mpm/skills/bundled/tauri/tauri-event-system.md +648 -0
  122. claude_mpm/skills/bundled/tauri/tauri-file-system.md +673 -0
  123. claude_mpm/skills/bundled/tauri/tauri-frontend-integration.md +767 -0
  124. claude_mpm/skills/bundled/tauri/tauri-performance.md +669 -0
  125. claude_mpm/skills/bundled/tauri/tauri-state-management.md +573 -0
  126. claude_mpm/skills/bundled/tauri/tauri-testing.md +384 -0
  127. claude_mpm/skills/bundled/tauri/tauri-window-management.md +628 -0
  128. claude_mpm/skills/bundled/testing/condition-based-waiting/SKILL.md +119 -0
  129. claude_mpm/skills/bundled/testing/condition-based-waiting/references/patterns-and-implementation.md +253 -0
  130. claude_mpm/skills/bundled/testing/test-driven-development/SKILL.md +145 -0
  131. claude_mpm/skills/bundled/testing/test-driven-development/references/anti-patterns.md +543 -0
  132. claude_mpm/skills/bundled/testing/test-driven-development/references/examples.md +741 -0
  133. claude_mpm/skills/bundled/testing/test-driven-development/references/integration.md +470 -0
  134. claude_mpm/skills/bundled/testing/test-driven-development/references/philosophy.md +458 -0
  135. claude_mpm/skills/bundled/testing/test-driven-development/references/workflow.md +639 -0
  136. claude_mpm/skills/bundled/testing/test-quality-inspector/SKILL.md +458 -0
  137. claude_mpm/skills/bundled/testing/test-quality-inspector/examples/example-inspection-report.md +411 -0
  138. claude_mpm/skills/bundled/testing/test-quality-inspector/references/assertion-quality.md +317 -0
  139. claude_mpm/skills/bundled/testing/test-quality-inspector/references/inspection-checklist.md +270 -0
  140. claude_mpm/skills/bundled/testing/test-quality-inspector/references/red-flags.md +436 -0
  141. claude_mpm/skills/bundled/testing/testing-anti-patterns/SKILL.md +140 -0
  142. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/completeness-anti-patterns.md +572 -0
  143. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/core-anti-patterns.md +411 -0
  144. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/detection-guide.md +569 -0
  145. claude_mpm/skills/bundled/testing/testing-anti-patterns/references/tdd-connection.md +695 -0
  146. claude_mpm/skills/bundled/testing/webapp-testing/SKILL.md +184 -0
  147. claude_mpm/skills/bundled/testing/webapp-testing/decision-tree.md +459 -0
  148. claude_mpm/skills/bundled/testing/webapp-testing/playwright-patterns.md +479 -0
  149. claude_mpm/skills/bundled/testing/webapp-testing/reconnaissance-pattern.md +687 -0
  150. claude_mpm/skills/bundled/testing/webapp-testing/server-management.md +758 -0
  151. claude_mpm/skills/bundled/testing/webapp-testing/troubleshooting.md +868 -0
  152. claude_mpm/utils/agent_dependency_loader.py +103 -4
  153. claude_mpm/utils/robust_installer.py +45 -24
  154. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/METADATA +47 -23
  155. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/RECORD +159 -47
  156. claude_mpm/hooks/claude_hooks/__pycache__/__init__.cpython-311.pyc +0 -0
  157. claude_mpm/hooks/claude_hooks/__pycache__/correlation_manager.cpython-311.pyc +0 -0
  158. claude_mpm/hooks/claude_hooks/__pycache__/event_handlers.cpython-311.pyc +0 -0
  159. claude_mpm/hooks/claude_hooks/__pycache__/hook_handler.cpython-311.pyc +0 -0
  160. claude_mpm/hooks/claude_hooks/__pycache__/installer.cpython-311.pyc +0 -0
  161. claude_mpm/hooks/claude_hooks/__pycache__/memory_integration.cpython-311.pyc +0 -0
  162. claude_mpm/hooks/claude_hooks/__pycache__/response_tracking.cpython-311.pyc +0 -0
  163. claude_mpm/hooks/claude_hooks/__pycache__/tool_analysis.cpython-311.pyc +0 -0
  164. claude_mpm/hooks/claude_hooks/services/__pycache__/__init__.cpython-311.pyc +0 -0
  165. claude_mpm/hooks/claude_hooks/services/__pycache__/connection_manager_http.cpython-311.pyc +0 -0
  166. claude_mpm/hooks/claude_hooks/services/__pycache__/duplicate_detector.cpython-311.pyc +0 -0
  167. claude_mpm/hooks/claude_hooks/services/__pycache__/state_manager.cpython-311.pyc +0 -0
  168. claude_mpm/hooks/claude_hooks/services/__pycache__/subagent_processor.cpython-311.pyc +0 -0
  169. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/WHEEL +0 -0
  170. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/entry_points.txt +0 -0
  171. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/licenses/LICENSE +0 -0
  172. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/licenses/LICENSE-FAQ.md +0 -0
  173. {claude_mpm-5.4.55.dist-info → claude_mpm-5.4.85.dist-info}/top_level.txt +0 -0
@@ -7,6 +7,17 @@
7
7
 
8
8
  The Project Manager (PM) agent coordinates work across specialized agents in the Claude MPM framework. The PM's responsibility is orchestration and quality assurance, not direct execution.
9
9
 
10
+ ## 🔴 ABSOLUTE PROHIBITIONS 🔴
11
+
12
+ **PM must NEVER:**
13
+ 1. Read source code files (`.py`, `.js`, `.ts`, `.tsx`, etc.) - DELEGATE to Research
14
+ 2. Use Read tool more than ONCE per session - DELEGATE to Research
15
+ 3. Investigate, debug, or analyze code directly - DELEGATE to Research
16
+ 4. Use Edit/Write tools on any file - DELEGATE to Engineer
17
+ 5. Run verification commands (curl, lsof) - DELEGATE to local-ops
18
+
19
+ **Violation of any prohibition = Circuit Breaker triggered**
20
+
10
21
  ### Why Delegation Matters
11
22
 
12
23
  The PM delegates all work to specialized agents for three key reasons:
@@ -315,22 +326,31 @@ TodoWrite:
315
326
 
316
327
  ### Read Tool Usage (Strict Hierarchy)
317
328
 
318
- **DEFAULT**: Zero reads - delegate to Research instead.
329
+ **ABSOLUTE PROHIBITION**: PM must NEVER read source code files directly.
330
+
331
+ **Source code extensions** (ALWAYS delegate to Research):
332
+ `.py`, `.js`, `.ts`, `.tsx`, `.jsx`, `.go`, `.rs`, `.java`, `.rb`, `.php`, `.swift`, `.kt`, `.c`, `.cpp`, `.h`
319
333
 
320
334
  **SINGLE EXCEPTION**: ONE config/settings file for delegation context only.
335
+ - Allowed: `package.json`, `pyproject.toml`, `settings.json`, `.env.example`
336
+ - NOT allowed: Any file with source code extensions above
337
+
338
+ **Pre-Flight Check (MANDATORY before ANY Read call)**:
339
+ 1. Is this a source code file? → STOP, delegate to Research
340
+ 2. Have I already used Read once this session? → STOP, delegate to Research
341
+ 3. Does my task contain investigation keywords? → STOP, delegate to Research
342
+
343
+ **Investigation Keywords** (trigger delegation, not Read):
344
+ - check, look, see, find, search, analyze, investigate, debug
345
+ - understand, explore, examine, review, inspect, trace
346
+ - "what does", "how does", "why does", "where is"
321
347
 
322
348
  **Rules**:
323
349
  - ✅ Allowed: ONE file (`package.json`, `pyproject.toml`, `settings.json`, `.env.example`)
324
- - ❌ Forbidden: Source code (`.py`, `.js`, `.ts`, `.tsx`, `.go`, `.rs`)
325
- - ❌ Forbidden: Multiple files OR investigation keywords ("check", "analyze", "debug", "investigate")
350
+ - ❌ NEVER: Source code (`.py`, `.js`, `.ts`, `.tsx`, `.go`, `.rs`)
351
+ - ❌ NEVER: Multiple files OR investigation keywords ("check", "analyze", "debug", "investigate")
326
352
  - **Rationale**: Reading leads to investigating. PM must delegate, not do.
327
353
 
328
- **Before Using Read, Check**:
329
- 1. Investigation keywords present? → Delegate to Research (zero reads)
330
- 2. Source code file? → Delegate to Research
331
- 3. Already used Read once? → Violation - delegate to Research
332
- 4. Purpose is delegation context (not understanding)? → ONE Read allowed
333
-
334
354
  ## Agent Deployment Architecture
335
355
 
336
356
  ### Cache Structure
@@ -1306,6 +1326,13 @@ PM: *Delegates to Research* # ✅ CORRECT: If vector search insufficient
1306
1326
  **Action**: BLOCK - Must delegate to Research instead
1307
1327
  **Enforcement**: Violation #1 = Warning, #2 = Session flagged, #3 = Non-compliant
1308
1328
 
1329
+ **Proactive Self-Check (PM must ask before EVERY Read call)**:
1330
+ 1. "Is this file a source code file?" → If yes, DELEGATE
1331
+ 2. "Have I already used Read this session?" → If yes, DELEGATE
1332
+ 3. "Am I investigating/debugging?" → If yes, DELEGATE
1333
+
1334
+ If ANY answer is YES → Do NOT use Read, delegate to Research instead.
1335
+
1309
1336
  **Allowed Exception:**
1310
1337
  - ONE config file read (package.json, pyproject.toml, settings.json, .env.example)
1311
1338
  - Purpose: Delegation context ONLY (not investigation)
@@ -91,7 +91,11 @@ def main(argv: Optional[list] = None):
91
91
  )
92
92
 
93
93
  try:
94
- run_background_services()
94
+ # Check for --force-sync flag or environment variable
95
+ force_sync = getattr(args, "force_sync", False) or os.environ.get(
96
+ "CLAUDE_MPM_FORCE_SYNC", "0"
97
+ ) in ("1", "true", "True", "yes")
98
+ run_background_services(force_sync=force_sync)
95
99
  launch_progress.finish(message="Ready")
96
100
 
97
101
  # Inform user about Claude Code initialization delay (3-5 seconds)
@@ -1379,7 +1379,7 @@ class AgentsCommand(AgentCommand):
1379
1379
  return CommandResult.error_result("agent_id is required")
1380
1380
 
1381
1381
  import os
1382
- import subprocess
1382
+ import subprocess # nosec B404
1383
1383
 
1384
1384
  from ...services.agents.local_template_manager import (
1385
1385
  LocalAgentTemplateManager,
@@ -1415,7 +1415,7 @@ class AgentsCommand(AgentCommand):
1415
1415
 
1416
1416
  # Use system editor
1417
1417
  editor = getattr(args, "editor", None) or os.environ.get("EDITOR", "nano")
1418
- subprocess.run([editor, str(template_file)], check=True)
1418
+ subprocess.run([editor, str(template_file)], check=True) # nosec B603
1419
1419
  return CommandResult.success_result(
1420
1420
  f"Agent '{agent_id}' edited successfully"
1421
1421
  )
@@ -1519,8 +1519,6 @@ class AgentsCommand(AgentCommand):
1519
1519
  console.print("For a better experience with integrated configuration:")
1520
1520
  console.print(" • Agent management")
1521
1521
  console.print(" • Skills management")
1522
- console.print(" • Template editing")
1523
- console.print(" • Behavior configuration")
1524
1522
  console.print(" • Startup settings\n")
1525
1523
 
1526
1524
  console.print("Please use: [bold green]claude-mpm config[/bold green]\n")
@@ -0,0 +1,197 @@
1
+ """
2
+ Agent/Skill Reconciliation CLI Command
3
+
4
+ Shows the reconciliation view between configured and deployed agents/skills,
5
+ and performs reconciliation (deploy missing, remove unneeded).
6
+
7
+ Usage:
8
+ claude-mpm agents reconcile [--dry-run] [--show-only]
9
+ claude-mpm skills reconcile [--dry-run] [--show-only]
10
+ """
11
+
12
+ from pathlib import Path
13
+
14
+ from rich.console import Console
15
+ from rich.table import Table
16
+
17
+ from ...core.unified_config import UnifiedConfig
18
+ from ...services.agents.deployment.deployment_reconciler import (
19
+ DeploymentReconciler,
20
+ ReconciliationState,
21
+ )
22
+ from ..shared import BaseCommand, CommandResult
23
+
24
+
25
+ class AgentsReconcileCommand(BaseCommand):
26
+ """CLI command for agent reconciliation."""
27
+
28
+ def __init__(self):
29
+ super().__init__("agents-reconcile")
30
+ self.console = Console()
31
+
32
+ def run(self, args) -> CommandResult:
33
+ """Execute reconciliation."""
34
+ # Load config
35
+ config = UnifiedConfig()
36
+ reconciler = DeploymentReconciler(config)
37
+
38
+ # Get project path
39
+ project_path = Path(getattr(args, "project_path", "."))
40
+
41
+ # Show current state
42
+ if getattr(args, "show_only", False) or getattr(args, "dry_run", False):
43
+ return self._show_reconciliation_view(reconciler, project_path)
44
+
45
+ # Perform reconciliation
46
+ return self._reconcile_agents(reconciler, project_path)
47
+
48
+ def _show_reconciliation_view(
49
+ self, reconciler: DeploymentReconciler, project_path: Path
50
+ ) -> CommandResult:
51
+ """Show reconciliation view without making changes."""
52
+ view = reconciler.get_reconciliation_view(project_path)
53
+ agent_state = view["agents"]
54
+ skill_state = view["skills"]
55
+
56
+ # Display agents table
57
+ self.console.print(
58
+ "\n[bold blue]═══ Agent Reconciliation View ═══[/bold blue]\n"
59
+ )
60
+ agent_table = self._build_reconciliation_table(agent_state, "Agent")
61
+ self.console.print(agent_table)
62
+
63
+ # Display skills table
64
+ self.console.print(
65
+ "\n[bold blue]═══ Skill Reconciliation View ═══[/bold blue]\n"
66
+ )
67
+ skill_table = self._build_reconciliation_table(skill_state, "Skill")
68
+ self.console.print(skill_table)
69
+
70
+ # Show summary
71
+ self._show_summary(agent_state, skill_state)
72
+
73
+ return CommandResult.success_result("Reconciliation view displayed")
74
+
75
+ def _build_reconciliation_table(
76
+ self, state: ReconciliationState, item_type: str
77
+ ) -> Table:
78
+ """Build Rich table for reconciliation state."""
79
+ table = Table(title=f"{item_type} Deployment Status")
80
+
81
+ table.add_column(f"{item_type}", style="cyan", no_wrap=True)
82
+ table.add_column("Configured", style="green")
83
+ table.add_column("Deployed", style="yellow")
84
+ table.add_column("Action", style="magenta")
85
+
86
+ # All items to consider
87
+ all_items = state.configured | state.deployed | state.cached
88
+
89
+ for item_id in sorted(all_items):
90
+ configured = "✓" if item_id in state.configured else "✗"
91
+ deployed = "✓" if item_id in state.deployed else "✗"
92
+
93
+ # Determine action
94
+ if item_id in state.to_deploy:
95
+ if item_id in state.cached:
96
+ action = "Will deploy"
97
+ else:
98
+ action = "[red]Missing in cache![/red]"
99
+ elif item_id in state.to_remove:
100
+ action = "Will remove"
101
+ elif item_id in state.unchanged:
102
+ action = "-"
103
+ elif item_id in state.cached and item_id not in state.configured:
104
+ action = "[dim]Available (not configured)[/dim]"
105
+ else:
106
+ action = "-"
107
+
108
+ table.add_row(item_id, configured, deployed, action)
109
+
110
+ return table
111
+
112
+ def _show_summary(
113
+ self, agent_state: ReconciliationState, skill_state: ReconciliationState
114
+ ) -> None:
115
+ """Show reconciliation summary."""
116
+ self.console.print("\n[bold]Summary:[/bold]")
117
+
118
+ # Agents
119
+ self.console.print("\nAgents:")
120
+ self.console.print(f" Configured: {len(agent_state.configured)}")
121
+ self.console.print(f" Deployed: {len(agent_state.deployed)}")
122
+ self.console.print(f" To deploy: {len(agent_state.to_deploy)}")
123
+ self.console.print(f" To remove: {len(agent_state.to_remove)}")
124
+ self.console.print(f" Unchanged: {len(agent_state.unchanged)}")
125
+
126
+ # Skills
127
+ self.console.print("\nSkills:")
128
+ self.console.print(f" Configured: {len(skill_state.configured)}")
129
+ self.console.print(f" Deployed: {len(skill_state.deployed)}")
130
+ self.console.print(f" To deploy: {len(skill_state.to_deploy)}")
131
+ self.console.print(f" To remove: {len(skill_state.to_remove)}")
132
+ self.console.print(f" Unchanged: {len(skill_state.unchanged)}")
133
+
134
+ # Show next steps
135
+ if agent_state.to_deploy or skill_state.to_deploy:
136
+ self.console.print(
137
+ "\n[yellow]Run without --show-only to perform deployment[/yellow]"
138
+ )
139
+
140
+ def _reconcile_agents(
141
+ self, reconciler: DeploymentReconciler, project_path: Path
142
+ ) -> CommandResult:
143
+ """Perform agent and skill reconciliation."""
144
+ # Show current state first
145
+ self._show_reconciliation_view(reconciler, project_path)
146
+
147
+ self.console.print("\n[bold blue]Performing reconciliation...[/bold blue]\n")
148
+
149
+ # Reconcile agents
150
+ self.console.print("[cyan]Reconciling agents...[/cyan]")
151
+ agent_result = reconciler.reconcile_agents(project_path)
152
+
153
+ if agent_result.deployed:
154
+ self.console.print(
155
+ f" [green]✓ Deployed: {', '.join(agent_result.deployed)}[/green]"
156
+ )
157
+ if agent_result.removed:
158
+ self.console.print(
159
+ f" [yellow]✓ Removed: {', '.join(agent_result.removed)}[/yellow]"
160
+ )
161
+ if agent_result.errors:
162
+ for error in agent_result.errors:
163
+ self.console.print(f" [red]✗ {error}[/red]")
164
+
165
+ # Reconcile skills
166
+ self.console.print("\n[cyan]Reconciling skills...[/cyan]")
167
+ skill_result = reconciler.reconcile_skills(project_path)
168
+
169
+ if skill_result.deployed:
170
+ self.console.print(
171
+ f" [green]✓ Deployed: {', '.join(skill_result.deployed)}[/green]"
172
+ )
173
+ if skill_result.removed:
174
+ self.console.print(
175
+ f" [yellow]✓ Removed: {', '.join(skill_result.removed)}[/yellow]"
176
+ )
177
+ if skill_result.errors:
178
+ for error in skill_result.errors:
179
+ self.console.print(f" [red]✗ {error}[/red]")
180
+
181
+ # Final summary
182
+ total_errors = len(agent_result.errors) + len(skill_result.errors)
183
+ if total_errors == 0:
184
+ self.console.print("\n[bold green]✓ Reconciliation complete![/bold green]")
185
+ return CommandResult.success_result("Reconciliation successful")
186
+ self.console.print(
187
+ f"\n[bold yellow]⚠ Reconciliation complete with {total_errors} errors[/bold yellow]"
188
+ )
189
+ return CommandResult.error_result(f"Reconciliation had {total_errors} errors")
190
+
191
+
192
+ class SkillsReconcileCommand(AgentsReconcileCommand):
193
+ """CLI command for skill reconciliation (alias to agents reconcile)."""
194
+
195
+ def __init__(self):
196
+ BaseCommand.__init__(self, "skills-reconcile")
197
+ self.console = Console()