agentpack-cli 0.3.24__tar.gz → 0.3.26__tar.gz

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 (162) hide show
  1. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/PKG-INFO +20 -6
  2. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/README.md +19 -5
  3. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/pyproject.toml +1 -1
  4. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/__init__.py +1 -1
  5. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/application/pack_service.py +7 -0
  6. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/cli.py +2 -0
  7. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/benchmark.py +20 -0
  8. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/ci_cmd.py +3 -1
  9. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/doctor.py +37 -4
  10. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/next_cmd.py +4 -3
  11. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/pack.py +3 -2
  12. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/release_check.py +33 -0
  13. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/start_cmd.py +2 -3
  14. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/status.py +2 -1
  15. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/task_cmd.py +3 -2
  16. agentpack_cli-0.3.26/src/agentpack/commands/upgrade.py +38 -0
  17. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/workflow_cmd.py +5 -3
  18. agentpack_cli-0.3.26/src/agentpack/core/command_surface.py +127 -0
  19. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/context_pack.py +12 -1
  20. agentpack_cli-0.3.26/src/agentpack/core/e2e_benchmark.py +75 -0
  21. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/data/agentpack.md +7 -7
  22. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/.codex-plugin/plugin.json +36 -0
  23. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/skills/agentpack-pack.md +30 -0
  24. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/skills/agentpack-refresh.md +29 -0
  25. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/skills/agentpack-review.md +32 -0
  26. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/skills/agentpack-route.md +24 -0
  27. agentpack_cli-0.3.26/src/agentpack/data/codex_plugin/skills/agentpack.md +29 -0
  28. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/antigravity.py +19 -9
  29. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/claude.py +23 -9
  30. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/codex.py +81 -9
  31. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/cursor.py +23 -25
  32. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/windsurf.py +20 -10
  33. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/agents.py +16 -10
  34. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/vscode_tasks.py +5 -2
  35. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/mcp_server.py +56 -0
  36. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/renderers/markdown.py +14 -3
  37. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/models.py +5 -0
  38. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/prompt_builder.py +19 -0
  39. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/service.py +239 -1
  40. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/.gitignore +0 -0
  41. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/LICENSE +0 -0
  42. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/__init__.py +0 -0
  43. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/antigravity.py +0 -0
  44. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/base.py +0 -0
  45. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/claude.py +0 -0
  46. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/codex.py +0 -0
  47. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/cursor.py +0 -0
  48. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/detect.py +0 -0
  49. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/generic.py +0 -0
  50. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/adapters/windsurf.py +0 -0
  51. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/__init__.py +0 -0
  52. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/dependency_graph.py +0 -0
  53. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/go_imports.py +0 -0
  54. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/java_imports.py +0 -0
  55. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/js_ts_imports.py +0 -0
  56. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/monorepo.py +0 -0
  57. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/naming_signals.py +0 -0
  58. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/python_ast.py +0 -0
  59. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/python_imports.py +0 -0
  60. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/ranking.py +0 -0
  61. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/repo_map.py +0 -0
  62. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/role_inference.py +0 -0
  63. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/rust_imports.py +0 -0
  64. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/symbols.py +0 -0
  65. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/task_classifier.py +0 -0
  66. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/analysis/tests.py +0 -0
  67. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/application/__init__.py +0 -0
  68. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/__init__.py +0 -0
  69. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/_shared.py +0 -0
  70. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/claude_cmd.py +0 -0
  71. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/compress_output.py +0 -0
  72. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/dashboard.py +0 -0
  73. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/dev_check.py +0 -0
  74. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/diagnose_selection.py +0 -0
  75. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/diff.py +0 -0
  76. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/eval_cmd.py +0 -0
  77. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/explain.py +0 -0
  78. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/guard.py +0 -0
  79. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/hook_cmd.py +0 -0
  80. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/ignore_cmd.py +0 -0
  81. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/init.py +0 -0
  82. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/install.py +0 -0
  83. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/learn.py +0 -0
  84. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/mcp_cmd.py +0 -0
  85. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/memory.py +0 -0
  86. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/migrate.py +0 -0
  87. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/monitor.py +0 -0
  88. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/perf.py +0 -0
  89. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/quickstart.py +0 -0
  90. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/release_cmd.py +0 -0
  91. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/repair.py +0 -0
  92. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/retrieve.py +0 -0
  93. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/route.py +0 -0
  94. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/scan.py +0 -0
  95. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/skills.py +0 -0
  96. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/state_cmd.py +0 -0
  97. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/stats.py +0 -0
  98. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/summarize.py +0 -0
  99. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/threads.py +0 -0
  100. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/tune.py +0 -0
  101. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/verify_wheel.py +0 -0
  102. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/watch.py +0 -0
  103. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/commands/wrap.py +0 -0
  104. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/__init__.py +0 -0
  105. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/bootstrap.py +0 -0
  106. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/cache.py +0 -0
  107. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/changed_paths.py +0 -0
  108. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/config.py +0 -0
  109. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/diff.py +0 -0
  110. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/evals.py +0 -0
  111. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/execution_state.py +0 -0
  112. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/git.py +0 -0
  113. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/git_hooks.py +0 -0
  114. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/global_install.py +0 -0
  115. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/ignore.py +0 -0
  116. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/loop_protocol.py +0 -0
  117. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/merkle.py +0 -0
  118. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/models.py +0 -0
  119. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/modes.py +0 -0
  120. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/pack_registry.py +0 -0
  121. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/redactor.py +0 -0
  122. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/scanner.py +0 -0
  123. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/snapshot.py +0 -0
  124. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/task_freshness.py +0 -0
  125. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/thread_context.py +0 -0
  126. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/token_estimator.py +0 -0
  127. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/core/vscode_tasks.py +0 -0
  128. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/dashboard/__init__.py +0 -0
  129. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/dashboard/collectors.py +0 -0
  130. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/dashboard/models.py +0 -0
  131. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/dashboard/renderers.py +0 -0
  132. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/installers/__init__.py +0 -0
  133. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/__init__.py +0 -0
  134. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/git_hooks.py +0 -0
  135. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/global_install.py +0 -0
  136. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/integrations/platform.py +0 -0
  137. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/__init__.py +0 -0
  138. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/collector.py +0 -0
  139. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/extractor.py +0 -0
  140. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/feedback.py +0 -0
  141. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/lesson_ranker.py +0 -0
  142. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/models.py +0 -0
  143. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/provider.py +0 -0
  144. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/quality.py +0 -0
  145. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/renderers.py +0 -0
  146. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/learning/skill_map.py +0 -0
  147. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/output_compression/__init__.py +0 -0
  148. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/output_compression/core.py +0 -0
  149. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/renderers/__init__.py +0 -0
  150. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/renderers/compact.py +0 -0
  151. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/renderers/receipts.py +0 -0
  152. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/__init__.py +0 -0
  153. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/discovery.py +0 -0
  154. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/parser.py +0 -0
  155. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/scoring.py +0 -0
  156. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/router/skills_index.py +0 -0
  157. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/session/__init__.py +0 -0
  158. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/session/events.py +0 -0
  159. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/session/state.py +0 -0
  160. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/summaries/__init__.py +0 -0
  161. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/summaries/base.py +0 -0
  162. {agentpack_cli-0.3.24 → agentpack_cli-0.3.26}/src/agentpack/summaries/offline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentpack-cli
3
- Version: 0.3.24
3
+ Version: 0.3.26
4
4
  Summary: Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows.
5
5
  Project-URL: Homepage, https://github.com/vishal2612200/agentpack
6
6
  Project-URL: Documentation, https://vishal2612200.github.io/agentpack/
@@ -61,7 +61,9 @@ Description-Content-Type: text/markdown
61
61
 
62
62
  <p align="center">
63
63
  <a href="https://pypi.org/project/agentpack-cli/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/agentpack-cli.svg"></a>
64
+ <a href="https://pepy.tech/projects/agentpack-cli"><img alt="PyPI downloads" src="https://static.pepy.tech/personalized-badge/agentpack-cli?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads"></a>
64
65
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm version" src="https://img.shields.io/npm/v/@vishal2612200/agentpack.svg"></a>
66
+ <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@vishal2612200/agentpack.svg"></a>
65
67
  <a href="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg"></a>
66
68
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
67
69
  </p>
@@ -69,6 +71,8 @@ Description-Content-Type: text/markdown
69
71
  <p align="center">
70
72
  <code>local preflight</code>
71
73
  <code>ranked files</code>
74
+ <code>skill routing</code>
75
+ <code>warm cache</code>
72
76
  <code>tests + commands</code>
73
77
  <code>receipts</code>
74
78
  <code>no cloud index</code>
@@ -83,6 +87,7 @@ AgentPack does the repo-orientation pass first.
83
87
  ```text
84
88
  agentpack route --task "fix auth token expiry"
85
89
  -> files that probably matter
90
+ -> skills and rules that fit the task
86
91
  -> tests that probably prove it
87
92
  -> rules, commands, warnings
88
93
  -> compact context before the agent edits
@@ -101,7 +106,9 @@ No cloud index. No embeddings. No model calls for scan/rank/pack. Just local rep
101
106
 
102
107
  It is not a repo dump. It is not a second brain. It is not a promise that your agent will be right.
103
108
 
104
- It is a preflight map: likely files, likely tests, repo rules, commands, warnings, and a compact pack your agent can inspect before touching code.
109
+ It is a preflight map: likely files, likely tests, the right local skill or rule, commands, warnings, and a compact pack your agent can inspect before touching code.
110
+
111
+ The first run builds local summaries and repo signals. Later runs reuse that cache, so agents do less repeat discovery and spend more of their budget on the actual change.
105
112
 
106
113
  ## Quick Start
107
114
 
@@ -145,6 +152,7 @@ agentpack route --task "fix billing webhook retry handling"
145
152
  ```
146
153
 
147
154
  AgentPack returns likely files, tests, rules, commands, and warnings without changing source files.
155
+ It also recommends matching skills or agent rules when the task points at a known workflow, framework, language, or repo convention.
148
156
 
149
157
  Build context pack next:
150
158
 
@@ -154,13 +162,16 @@ agentpack pack --task auto
154
162
  ```
155
163
 
156
164
  AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, and token stats.
165
+ It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
157
166
 
158
167
  ## What AgentPack Gives Your Agent
159
168
 
160
169
  - ranked files for current task
170
+ - skill and rule routing for current task
161
171
  - likely tests and commands
162
172
  - repo rules and agent instructions
163
173
  - compact context pack under budget
174
+ - cached summaries for faster repeated orientation
164
175
  - omitted-file receipts for review
165
176
  - freshness warnings when task or git state changes
166
177
  - local benchmark data when selected context misses real changed files
@@ -229,7 +240,8 @@ See [`docs/agent-plugins.md`](docs/agent-plugins.md) and [`docs/codex-plugin.md`
229
240
  | Repo dumpers | Dump selected or all files | AgentPack ranks files by task |
230
241
  | Coding agents | Edit code | AgentPack prepares context before editing |
231
242
  | IDE search | Finds files on demand | AgentPack pre-routes before agent starts |
232
- | Skills/rules | Change agent behavior | AgentPack changes the context the agent sees |
243
+ | Skills/rules | Change agent behavior | AgentPack routes the matching skill or rule for the task |
244
+ | Cache warmers | Speed repeated scans | AgentPack reuses summaries and snapshots inside the context workflow |
233
245
 
234
246
  ## When To Use It
235
247
 
@@ -241,6 +253,8 @@ Use AgentPack when:
241
253
  - CI or PR review needs reproducible context
242
254
  - agents waste tool calls opening irrelevant files
243
255
  - tasks often miss tests, config, generated rules, or repo conventions
256
+ - teams have useful skills/rules but agents do not reliably pick the right one
257
+ - repeated agent sessions keep rediscovering the same repo structure
244
258
 
245
259
  Do not use AgentPack when:
246
260
 
@@ -252,9 +266,9 @@ Do not use AgentPack when:
252
266
 
253
267
  ## How It Works
254
268
 
255
- AgentPack scans repo locally, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
269
+ AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
256
270
 
257
- It can expose same workflow through CLI, markdown files, MCP tools, hooks, and CI.
271
+ It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
258
272
 
259
273
  Deep dive: [`docs/architecture.md`](docs/architecture.md), [`docs/how-agentpack-works.md`](docs/how-agentpack-works.md), and [`docs/commands.md`](docs/commands.md).
260
274
 
@@ -307,7 +321,7 @@ pipx ensurepath
307
321
 
308
322
  ## Status
309
323
 
310
- Alpha: `0.3.24`.
324
+ Alpha: `0.3.25`.
311
325
 
312
326
  Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
313
327
 
@@ -14,7 +14,9 @@
14
14
 
15
15
  <p align="center">
16
16
  <a href="https://pypi.org/project/agentpack-cli/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/agentpack-cli.svg"></a>
17
+ <a href="https://pepy.tech/projects/agentpack-cli"><img alt="PyPI downloads" src="https://static.pepy.tech/personalized-badge/agentpack-cli?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads"></a>
17
18
  <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm version" src="https://img.shields.io/npm/v/@vishal2612200/agentpack.svg"></a>
19
+ <a href="https://www.npmjs.com/package/@vishal2612200/agentpack"><img alt="npm downloads" src="https://img.shields.io/npm/dm/@vishal2612200/agentpack.svg"></a>
18
20
  <a href="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg"></a>
19
21
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
20
22
  </p>
@@ -22,6 +24,8 @@
22
24
  <p align="center">
23
25
  <code>local preflight</code>
24
26
  <code>ranked files</code>
27
+ <code>skill routing</code>
28
+ <code>warm cache</code>
25
29
  <code>tests + commands</code>
26
30
  <code>receipts</code>
27
31
  <code>no cloud index</code>
@@ -36,6 +40,7 @@ AgentPack does the repo-orientation pass first.
36
40
  ```text
37
41
  agentpack route --task "fix auth token expiry"
38
42
  -> files that probably matter
43
+ -> skills and rules that fit the task
39
44
  -> tests that probably prove it
40
45
  -> rules, commands, warnings
41
46
  -> compact context before the agent edits
@@ -54,7 +59,9 @@ No cloud index. No embeddings. No model calls for scan/rank/pack. Just local rep
54
59
 
55
60
  It is not a repo dump. It is not a second brain. It is not a promise that your agent will be right.
56
61
 
57
- It is a preflight map: likely files, likely tests, repo rules, commands, warnings, and a compact pack your agent can inspect before touching code.
62
+ It is a preflight map: likely files, likely tests, the right local skill or rule, commands, warnings, and a compact pack your agent can inspect before touching code.
63
+
64
+ The first run builds local summaries and repo signals. Later runs reuse that cache, so agents do less repeat discovery and spend more of their budget on the actual change.
58
65
 
59
66
  ## Quick Start
60
67
 
@@ -98,6 +105,7 @@ agentpack route --task "fix billing webhook retry handling"
98
105
  ```
99
106
 
100
107
  AgentPack returns likely files, tests, rules, commands, and warnings without changing source files.
108
+ It also recommends matching skills or agent rules when the task points at a known workflow, framework, language, or repo convention.
101
109
 
102
110
  Build context pack next:
103
111
 
@@ -107,13 +115,16 @@ agentpack pack --task auto
107
115
  ```
108
116
 
109
117
  AgentPack writes local context under `.agentpack/`, including selected files, omitted-file receipts, freshness checks, and token stats.
118
+ It reuses cached file summaries and snapshot metadata so repeated packs do not start from zero.
110
119
 
111
120
  ## What AgentPack Gives Your Agent
112
121
 
113
122
  - ranked files for current task
123
+ - skill and rule routing for current task
114
124
  - likely tests and commands
115
125
  - repo rules and agent instructions
116
126
  - compact context pack under budget
127
+ - cached summaries for faster repeated orientation
117
128
  - omitted-file receipts for review
118
129
  - freshness warnings when task or git state changes
119
130
  - local benchmark data when selected context misses real changed files
@@ -182,7 +193,8 @@ See [`docs/agent-plugins.md`](docs/agent-plugins.md) and [`docs/codex-plugin.md`
182
193
  | Repo dumpers | Dump selected or all files | AgentPack ranks files by task |
183
194
  | Coding agents | Edit code | AgentPack prepares context before editing |
184
195
  | IDE search | Finds files on demand | AgentPack pre-routes before agent starts |
185
- | Skills/rules | Change agent behavior | AgentPack changes the context the agent sees |
196
+ | Skills/rules | Change agent behavior | AgentPack routes the matching skill or rule for the task |
197
+ | Cache warmers | Speed repeated scans | AgentPack reuses summaries and snapshots inside the context workflow |
186
198
 
187
199
  ## When To Use It
188
200
 
@@ -194,6 +206,8 @@ Use AgentPack when:
194
206
  - CI or PR review needs reproducible context
195
207
  - agents waste tool calls opening irrelevant files
196
208
  - tasks often miss tests, config, generated rules, or repo conventions
209
+ - teams have useful skills/rules but agents do not reliably pick the right one
210
+ - repeated agent sessions keep rediscovering the same repo structure
197
211
 
198
212
  Do not use AgentPack when:
199
213
 
@@ -205,9 +219,9 @@ Do not use AgentPack when:
205
219
 
206
220
  ## How It Works
207
221
 
208
- AgentPack scans repo locally, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
222
+ AgentPack scans repo locally, builds and reuses file summaries, indexes local skills and rules, combines filename, git, config, dependency, summary, and benchmark signals, ranks likely files for task, then renders a compact context pack.
209
223
 
210
- It can expose same workflow through CLI, markdown files, MCP tools, hooks, and CI.
224
+ It can expose the same workflow through CLI, markdown files, MCP tools, hooks, plugins, and CI.
211
225
 
212
226
  Deep dive: [`docs/architecture.md`](docs/architecture.md), [`docs/how-agentpack-works.md`](docs/how-agentpack-works.md), and [`docs/commands.md`](docs/commands.md).
213
227
 
@@ -260,7 +274,7 @@ pipx ensurepath
260
274
 
261
275
  ## Status
262
276
 
263
- Alpha: `0.3.24`.
277
+ Alpha: `0.3.25`.
264
278
 
265
279
  Works, tested, and used in real sessions. Python and JavaScript/TypeScript have strongest support. APIs may change before 1.0.
266
280
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentpack-cli"
3
- version = "0.3.24"
3
+ version = "0.3.26"
4
4
  description = "Local context engine for AI coding agents that ranks relevant repo files and builds compact task-focused context packs for Claude Code, Codex, Cursor, Windsurf, MCP, and CI workflows."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """AgentPack — task-aware context packing for AI coding agents."""
2
2
 
3
- __version__ = "0.3.24"
3
+ __version__ = "0.3.26"
@@ -9,6 +9,7 @@ from datetime import datetime, timezone
9
9
  from pathlib import Path
10
10
  from typing import Any
11
11
 
12
+ from agentpack import __version__
12
13
  from agentpack.core.config import load_config
13
14
  from agentpack.core.changed_paths import clear_changed_paths, read_changed_paths
14
15
  from agentpack.core.ignore import DEFAULT_AGENTIGNORE, load_spec
@@ -16,6 +17,7 @@ from agentpack.core.scanner import scan, scan_incremental
16
17
  from agentpack.core.snapshot import build_snapshot, save_snapshot, load_snapshot
17
18
  from agentpack.core.diff import diff_snapshots
18
19
  from agentpack.core import git
20
+ from agentpack.core.command_surface import refresh_commands
19
21
  from agentpack.core.context_pack import enrich_call_site_scores, select_files, save_pack_metadata, load_pack_metadata
20
22
  from agentpack.core.execution_state import build_execution_state, compact_execution_state
21
23
  from agentpack.core.models import (
@@ -1575,7 +1577,12 @@ def _build_freshness_metadata(
1575
1577
  ) -> dict[str, Any]:
1576
1578
  dirty = git.dirty_files(root) if git.is_git_repo(root) else set()
1577
1579
  metadata: dict[str, Any] = {
1580
+ "agentpack_version": __version__,
1578
1581
  "generated_at": datetime.now(timezone.utc).isoformat(),
1582
+ "cwd": str(Path.cwd()),
1583
+ "git_root": str(root),
1584
+ "worktree_path": str(root),
1585
+ "source_command": refresh_commands(request.agent).primary,
1579
1586
  "task_source": request.task_source,
1580
1587
  "changed_files_source": plan.changed_files_source,
1581
1588
  "snapshot_root_hash": snapshot_root_hash,
@@ -42,6 +42,7 @@ from agentpack.commands import (
42
42
  task_cmd,
43
43
  threads,
44
44
  tune,
45
+ upgrade,
45
46
  verify_wheel,
46
47
  watch,
47
48
  wrap,
@@ -95,6 +96,7 @@ for mod in [
95
96
  diagnose_selection,
96
97
  eval_cmd,
97
98
  tune,
99
+ upgrade,
98
100
  watch,
99
101
  claude_cmd,
100
102
  benchmark,
@@ -166,6 +166,7 @@ class E2EResult:
166
166
  expected_files_touched: list[str]
167
167
  missing_expected_edits: list[str]
168
168
  unexpected_files_touched: list[str]
169
+ agentpack_noise: list[str]
169
170
  agent_log_path: str
170
171
  test_log_path: str
171
172
  workdir: str
@@ -3226,6 +3227,7 @@ def _e2e_strategy_metrics(records: list[dict[str, Any]], strategy: str) -> dict[
3226
3227
  return {
3227
3228
  "runs": float(len(subset)),
3228
3229
  "success_rate": sum(1 for row in subset if row.get("passed")) / len(subset),
3230
+ "noise_rate": sum(1 for row in subset if row.get("agentpack_noise")) / len(subset),
3229
3231
  "expected_touch_rate": expected_touch_rate,
3230
3232
  "avg_input_tokens": avg("input_tokens"),
3231
3233
  "avg_output_tokens": avg("agent_output_tokens"),
@@ -3285,6 +3287,7 @@ def _print_e2e_ab_table(
3285
3287
  table.add_row("runs", f"{base['runs']:.0f}", f"{treat['runs']:.0f}", "-")
3286
3288
  table.add_row("task success", f"{base['success_rate']:.0%}", f"{treat['success_rate']:.0%}", f"{deltas['success_rate_pp']:+.1f} pp")
3287
3289
  table.add_row("expected file touched", f"{base['expected_touch_rate']:.0%}", f"{treat['expected_touch_rate']:.0%}", "-")
3290
+ table.add_row("AgentPack noise cases", f"{base['noise_rate']:.0%}", f"{treat['noise_rate']:.0%}", "-")
3288
3291
  table.add_row("tool calls", f"{base['avg_tool_calls']:.1f}", f"{treat['avg_tool_calls']:.1f}", f"{deltas['tool_calls_saved']:+.1f}")
3289
3292
  table.add_row("tokens", f"{base['avg_total_tokens']:,.0f}", f"{treat['avg_total_tokens']:,.0f}", f"{deltas['tokens_saved']:+,.0f}")
3290
3293
  table.add_row("cost", f"${base['avg_total_cost_usd']:.4f}", f"${treat['avg_total_cost_usd']:.4f}", _fmt_signed_usd(deltas["token_cost_saved_usd"]))
@@ -3317,6 +3320,7 @@ def _e2e_ab_markdown(
3317
3320
  f"| runs | {base['runs']:.0f} | {treat['runs']:.0f} | - |",
3318
3321
  f"| task success | {base['success_rate']:.0%} | {treat['success_rate']:.0%} | {deltas['success_rate_pp']:+.1f} pp |",
3319
3322
  f"| expected file touched | {base['expected_touch_rate']:.0%} | {treat['expected_touch_rate']:.0%} | - |",
3323
+ f"| AgentPack noise cases | {base['noise_rate']:.0%} | {treat['noise_rate']:.0%} | - |",
3320
3324
  f"| tool calls | {base['avg_tool_calls']:.1f} | {treat['avg_tool_calls']:.1f} | {deltas['tool_calls_saved']:+.1f} |",
3321
3325
  f"| tokens | {base['avg_total_tokens']:,.0f} | {treat['avg_total_tokens']:,.0f} | {deltas['tokens_saved']:+,.0f} |",
3322
3326
  f"| token cost | ${base['avg_total_cost_usd']:.4f} | ${treat['avg_total_cost_usd']:.4f} | {_fmt_signed_usd(deltas['token_cost_saved_usd'])} |",
@@ -3410,6 +3414,7 @@ def _run_e2e_case(
3410
3414
  expected_touched = _expected_files_touched(public_changed, case.expected_edit_paths)
3411
3415
  missing_expected = sorted(set(case.expected_edit_paths) - set(expected_touched))
3412
3416
  unexpected_touched = _unexpected_files_touched(public_changed, case.expected_edit_paths)
3417
+ agentpack_noise = _agentpack_noise(strategy, unexpected_touched, missing_expected, public_changed)
3413
3418
  time_to_first_expected_file = _time_to_first_expected_file(repo, expected_touched, agent_start_epoch)
3414
3419
  tool_calls = _estimate_agent_tool_calls(agent)
3415
3420
  duration = time.perf_counter() - start
@@ -3442,6 +3447,7 @@ def _run_e2e_case(
3442
3447
  expected_files_touched=expected_touched,
3443
3448
  missing_expected_edits=missing_expected,
3444
3449
  unexpected_files_touched=unexpected_touched,
3450
+ agentpack_noise=agentpack_noise,
3445
3451
  agent_log_path=str(agent_log_path),
3446
3452
  test_log_path=str(test_log_path),
3447
3453
  workdir=str(work_root),
@@ -3495,6 +3501,20 @@ def _unexpected_files_touched(changed: list[str], expected_edit_paths: list[str]
3495
3501
  return sorted(path for path in changed if path not in expected)
3496
3502
 
3497
3503
 
3504
+ def _agentpack_noise(strategy: str, unexpected: list[str], missing_expected: list[str], changed: list[str]) -> list[str]:
3505
+ if "agentpack" not in strategy:
3506
+ return []
3507
+ noise: list[str] = []
3508
+ if unexpected:
3509
+ noise.append(f"unexpected edits: {', '.join(unexpected[:5])}")
3510
+ if missing_expected:
3511
+ noise.append(f"missed expected files: {', '.join(missing_expected[:5])}")
3512
+ generated = [path for path in changed if _is_generated_e2e_path(path)]
3513
+ if generated:
3514
+ noise.append(f"generated AgentPack files changed: {', '.join(generated[:5])}")
3515
+ return noise
3516
+
3517
+
3498
3518
  def _process_output_tokens(result: subprocess.CompletedProcess[str]) -> int:
3499
3519
  return estimate_tokens("\n".join(part for part in (result.stdout, result.stderr) if part))
3500
3520
 
@@ -79,6 +79,8 @@ jobs:
79
79
  if: github.event_name == 'push'
80
80
  steps:
81
81
  - uses: actions/checkout@v4
82
+ with:
83
+ fetch-depth: 0
82
84
  - uses: actions/setup-python@v5
83
85
  with:
84
86
  python-version: "3.11"
@@ -86,5 +88,5 @@ jobs:
86
88
  with:
87
89
  node-version: "20"
88
90
  - run: python -m pip install -e ".[dev]" build
89
- - run: python -m agentpack.cli release-check
91
+ - run: python -m agentpack.cli release-check --profile auto
90
92
  """
@@ -17,6 +17,7 @@ from agentpack.integrations.global_install import (
17
17
  _detect_rc_file,
18
18
  )
19
19
  from agentpack.commands._shared import console, _root
20
+ from agentpack.core.command_surface import available_cli_commands, installed_cli_status, refresh_commands
20
21
  from agentpack.core.context_pack import load_pack_metadata
21
22
  from agentpack.core.ignore import agentignore_sync_status, format_import_summary
22
23
  from agentpack.core.task_freshness import task_freshness
@@ -45,7 +46,12 @@ def register(app: typer.Typer) -> None:
45
46
 
46
47
  # --- CLI binary ---
47
48
  console.print("[bold]CLI[/]")
48
- binary = shutil.which("agentpack")
49
+ cli_status = installed_cli_status()
50
+ binary = cli_status.get("binary") or shutil.which("agentpack")
51
+ console.print(f" [green]✓[/] importable AgentPack version: {cli_status.get('agentpack_version')}")
52
+ importable = cli_status.get("importable_commands") or []
53
+ if importable:
54
+ console.print(f" [green]✓[/] importable commands: {', '.join(str(cmd) for cmd in importable)}")
49
55
  if binary:
50
56
  try:
51
57
  result = subprocess.run(["agentpack", "--version"], capture_output=True, text=True)
@@ -56,6 +62,15 @@ def register(app: typer.Typer) -> None:
56
62
  else:
57
63
  console.print(" [red]✗[/] agentpack not on PATH — run: pipx install agentpack-cli")
58
64
  ok = False
65
+ help_commands = cli_status.get("help_commands") or []
66
+ if help_commands:
67
+ console.print(f" [green]✓[/] installed CLI commands: {', '.join(str(cmd) for cmd in help_commands)}")
68
+ if binary and "guard" not in set(str(cmd) for cmd in help_commands) and "guard" in set(available_cli_commands()):
69
+ console.print(
70
+ " [yellow]![/] installed CLI command surface may be stale; "
71
+ f"exact repair: {cli_status.get('repair_command')}"
72
+ )
73
+ ok = False
59
74
 
60
75
  try:
61
76
  root = _root()
@@ -147,8 +162,19 @@ def register(app: typer.Typer) -> None:
147
162
  "MCP get_context auto-refreshes this, or run: agentpack pack --task auto"
148
163
  )
149
164
  ok = False
165
+ meta = load_pack_metadata(root) or {}
166
+ freshness = meta.get("freshness") or {}
167
+ if freshness:
168
+ console.print(
169
+ " [green]✓[/] context provenance: "
170
+ f"task_source={freshness.get('task_source', 'unknown')}, "
171
+ f"git_root={freshness.get('git_root', root)}, "
172
+ f"worktree={freshness.get('worktree_path', root)}, "
173
+ f"branch={freshness.get('git_branch', 'unknown')}, "
174
+ f"generated={freshness.get('generated_at', 'unknown')}"
175
+ )
150
176
  else:
151
- console.print(" [yellow]![/] No context pack yet — write .agentpack/task.md, then run: agentpack pack --task auto")
177
+ console.print(f" [yellow]![/] No context pack yet — write .agentpack/task.md, then run: {refresh_commands(agent).context_missing}")
152
178
 
153
179
  # --- Agent-specific config ---
154
180
  console.print("\n[bold]Agent config[/]")
@@ -249,6 +275,14 @@ def register(app: typer.Typer) -> None:
249
275
  pass
250
276
  if not _local_has_mcp and not _global_has_mcp:
251
277
  console.print(" [yellow]![/] MCP server not registered — mcp__agentpack__* tools unavailable")
278
+ console.print(" [yellow]![/] exact repair: agentpack install --agent claude")
279
+ ok = False
280
+ else:
281
+ console.print(
282
+ " [green]✓[/] expected MCP tools: "
283
+ "readiness, route_task, pack_context, get_context, refresh, get_stats"
284
+ )
285
+ console.print(" [green]✓[/] live exposure proof: call MCP tool `readiness` from the agent host")
252
286
 
253
287
  # --- Agent integration matrix ---
254
288
  console.print("\n[bold]Agent integration audit[/]")
@@ -268,8 +302,7 @@ def register(app: typer.Typer) -> None:
268
302
  ok = False
269
303
  if not selected_ok:
270
304
  console.print(
271
- f" [yellow]![/] executable guard repair: "
272
- f"agentpack guard --agent {selected} --repair-stale --refresh-context"
305
+ f" [yellow]![/] exact repair: {refresh_commands(selected).repair}"
273
306
  )
274
307
 
275
308
  # --- Concurrent threads ---
@@ -7,6 +7,7 @@ import typer
7
7
  from agentpack.commands._shared import console, _root, run_refresh
8
8
  from agentpack.commands.diagnose_selection import build_selection_diagnosis, _markdown_report
9
9
  from agentpack.commands.guard import _context_is_fresh
10
+ from agentpack.core.command_surface import refresh_commands
10
11
  from agentpack.core.config import load_config
11
12
  from agentpack.core.context_pack import load_pack_metadata
12
13
  from agentpack.core.loop_protocol import load_loop_state
@@ -34,7 +35,7 @@ def register(app: typer.Typer) -> None:
34
35
  stats = run_refresh(root, "auto", "balanced", 0)
35
36
  if stats:
36
37
  recommendations = [{"kind": "fixed", "command": "agentpack next", "reason": "refreshed stale context"}]
37
- fixes.append({"kind": "stale_context", "command": "agentpack guard --agent auto --repair-stale --refresh-context", "returncode": 0})
38
+ fixes.append({"kind": "stale_context", "command": refresh_commands("auto").repair, "returncode": 0})
38
39
  payload = {"recommendations": recommendations, "fixes": fixes, "ok": not recommendations}
39
40
  if json_output:
40
41
  typer.echo(json.dumps(payload, indent=2, sort_keys=True))
@@ -58,7 +59,7 @@ def _recommendations(root) -> list[dict[str, str]]:
58
59
  items.append({"kind": "missing_task", "command": 'agentpack start "describe the task"', "reason": "no concrete task is set"})
59
60
  fresh, reason = _context_is_fresh(root)
60
61
  if not fresh:
61
- items.append({"kind": "stale_context", "command": "agentpack guard --agent auto --repair-stale --refresh-context", "reason": reason})
62
+ items.append({"kind": "stale_context", "command": refresh_commands("auto").repair, "reason": reason})
62
63
  if _has_thread_conflicts(root):
63
64
  items.append({"kind": "thread_conflict", "command": "agentpack threads --conflicts", "reason": "active threads overlap on this branch/worktree"})
64
65
  if _pack_looks_noisy(root):
@@ -138,7 +139,7 @@ def _fix_all_safe(root, recommendations: list[dict[str, str]]) -> tuple[list[dic
138
139
  stats = run_refresh(root, "auto", "balanced", 0)
139
140
  fixes.append({
140
141
  "kind": "stale_context",
141
- "command": "agentpack guard --agent auto --repair-stale --refresh-context",
142
+ "command": refresh_commands("auto").repair,
142
143
  "returncode": 0 if stats else 1,
143
144
  })
144
145
  recommendations = _recommendations(root)
@@ -17,6 +17,7 @@ from agentpack.analysis.ranking import suggest_task_rewrite
17
17
  from agentpack.application.pack_service import PackRequest, PackService, PackResult
18
18
  from agentpack.commands._shared import console, _root, _file_hash, _now_iso
19
19
  from agentpack.core.changed_paths import record_changed_paths
20
+ from agentpack.core.command_surface import refresh_commands
20
21
  from agentpack.core.modes import MODE_HELP, invalid_mode_message, is_requested_mode
21
22
  from agentpack.integrations.agents import check_agent_integration, install_agent_integration
22
23
  from agentpack.session.state import TASK_FILE, load_session, save_session, log_activity
@@ -314,7 +315,7 @@ def _agent_integration_warnings(result: PackResult) -> list[str]:
314
315
  if not failing:
315
316
  return []
316
317
  return [
317
- f"Agent integration needs repair ({agent}); run `agentpack guard --agent {agent} --repair-stale --refresh-context`."
318
+ f"Agent integration needs repair ({agent}); run `{refresh_commands(agent).repair}`."
318
319
  ]
319
320
 
320
321
 
@@ -337,7 +338,7 @@ def _auto_repair_stale_agent_rules(agent: str) -> None:
337
338
  except Exception as exc:
338
339
  console.print(
339
340
  f"[yellow]Stale AgentPack integration detected for {agent}; "
340
- f"run `agentpack guard --agent {agent} --repair-stale --refresh-context`. ({exc})[/]"
341
+ f"run `{refresh_commands(agent).repair}`. ({exc})[/]"
341
342
  )
342
343
 
343
344
 
@@ -145,11 +145,44 @@ def _pytest_args_for_profile(root: Path, profile: str) -> list[str]:
145
145
 
146
146
 
147
147
  def _changed_files(root: Path) -> list[str]:
148
+ ci_changed = _github_event_changed_files(root)
149
+ if ci_changed:
150
+ return ci_changed
148
151
  tracked = _git_lines(root, ["git", "diff", "--name-only", "HEAD", "--"])
149
152
  untracked = _git_lines(root, ["git", "ls-files", "--others", "--exclude-standard"])
150
153
  return sorted(set(tracked + untracked))
151
154
 
152
155
 
156
+ def _github_event_changed_files(root: Path) -> list[str]:
157
+ event_path = os.environ.get("GITHUB_EVENT_PATH")
158
+ event_name = os.environ.get("GITHUB_EVENT_NAME", "")
159
+ if not event_path:
160
+ return []
161
+ try:
162
+ payload = json.loads(Path(event_path).read_text(encoding="utf-8"))
163
+ except (OSError, json.JSONDecodeError):
164
+ return []
165
+ if not isinstance(payload, dict):
166
+ return []
167
+
168
+ base = ""
169
+ head = ""
170
+ if event_name == "push":
171
+ base = str(payload.get("before") or "")
172
+ head = str(payload.get("after") or os.environ.get("GITHUB_SHA") or "")
173
+ elif event_name == "pull_request":
174
+ pull_request = payload.get("pull_request")
175
+ if isinstance(pull_request, dict):
176
+ base_ref = pull_request.get("base")
177
+ head_ref = pull_request.get("head")
178
+ if isinstance(base_ref, dict) and isinstance(head_ref, dict):
179
+ base = str(base_ref.get("sha") or "")
180
+ head = str(head_ref.get("sha") or "")
181
+ if not base or not head or set(base) == {"0"}:
182
+ return []
183
+ return _git_lines(root, ["git", "diff", "--name-only", base, head, "--"])
184
+
185
+
153
186
  def _git_lines(root: Path, command: list[str]) -> list[str]:
154
187
  result = subprocess.run(command, cwd=root, capture_output=True, text=True)
155
188
  if result.returncode != 0:
@@ -6,6 +6,7 @@ from pathlib import Path
6
6
  import typer
7
7
 
8
8
  from agentpack.commands._shared import console, _root
9
+ from agentpack.core.command_surface import refresh_command_args
9
10
  from agentpack.core.context_pack import load_pack_metadata
10
11
  from agentpack.core.thread_context import resolve_thread_option, thread_paths
11
12
  from agentpack.integrations.platform import cli_module_argv
@@ -42,9 +43,7 @@ def register(app: typer.Typer) -> None:
42
43
  if workspace:
43
44
  argv.extend(["--workspace", workspace])
44
45
  else:
45
- argv = cli_module_argv("guard", "--agent", agent, "--repair-stale", "--refresh-context", "--mode", mode)
46
- if budget:
47
- argv.extend(["--budget", str(budget)])
46
+ argv = cli_module_argv(*refresh_command_args(agent, mode, budget))
48
47
  if thread_id:
49
48
  argv.extend(["--thread", thread_id])
50
49
  result = subprocess.run(argv, cwd=root)
@@ -4,6 +4,7 @@ import typer
4
4
  import shutil
5
5
 
6
6
  from agentpack.core.config import load_config
7
+ from agentpack.core.command_surface import refresh_commands
7
8
  from agentpack.core.ignore import load_spec
8
9
  from agentpack.core.scanner import scan
9
10
  from agentpack.core.snapshot import build_snapshot
@@ -98,4 +99,4 @@ def _print_deep_health(root, meta: dict | None) -> None:
98
99
  if not check.ok:
99
100
  failing.append(check)
100
101
  if failing:
101
- console.print(f" [yellow]![/] Guard repair: agentpack guard --agent {agent} --repair-stale --refresh-context")
102
+ console.print(f" [yellow]![/] Repair: {refresh_commands(agent).repair}")
@@ -7,6 +7,7 @@ from pathlib import Path
7
7
  import typer
8
8
 
9
9
  from agentpack.commands._shared import console, _root
10
+ from agentpack.core.command_surface import refresh_command_args
10
11
  from agentpack.core.thread_context import resolve_thread_option, thread_paths
11
12
  from agentpack.integrations.platform import cli_module_argv
12
13
  from agentpack.session.state import TASK_FILE
@@ -47,7 +48,7 @@ def set_task(
47
48
  task_text: str = typer.Argument(..., help="Task text to write."),
48
49
  thread: str = typer.Option("", "--thread", help="Use thread-scoped task state."),
49
50
  pack: bool = typer.Option(False, "--pack", help="Run agentpack pack after writing the task."),
50
- guard: bool = typer.Option(False, "--guard", help="Run agentpack guard --repair-stale --refresh-context after writing."),
51
+ guard: bool = typer.Option(False, "--guard", help="Run the installed refresh/repair command after writing."),
51
52
  agent: str = typer.Option("auto", "--agent", help="Agent to pass to pack/guard."),
52
53
  mode: str = typer.Option("balanced", "--mode", help="Pack/guard mode."),
53
54
  ) -> None:
@@ -63,7 +64,7 @@ def set_task(
63
64
 
64
65
  thread_id = _thread_id(root, thread)
65
66
  if guard:
66
- _run_cli(["guard", "--agent", agent, "--repair-stale", "--refresh-context", "--mode", mode], thread_id=thread_id)
67
+ _run_cli(refresh_command_args(agent, mode), thread_id=thread_id)
67
68
  elif pack:
68
69
  _run_cli(["pack", "--agent", agent, "--task", "auto", "--mode", mode], thread_id=thread_id)
69
70
 
@@ -0,0 +1,38 @@
1
+ from __future__ import annotations
2
+
3
+ import typer
4
+
5
+ from agentpack.commands._shared import console, _root
6
+ from agentpack.commands.install import _install_slash_command, _print_install_results
7
+ from agentpack.integrations.agents import SUPPORTED_AGENTS, expand_agents, install_agent_integration
8
+
9
+
10
+ def register(app: typer.Typer) -> None:
11
+ @app.command()
12
+ def upgrade(
13
+ agent: str = typer.Option(
14
+ "auto",
15
+ "--agent",
16
+ help=f"Agent integration to refresh after package upgrade ({' | '.join(SUPPORTED_AGENTS)}).",
17
+ ),
18
+ ) -> None:
19
+ """Refresh the detected AgentPack IDE/agent integration after upgrading the package."""
20
+ root = _root()
21
+ if agent not in SUPPORTED_AGENTS:
22
+ console.print(f"[yellow]Unknown agent: {agent}. Supported: {', '.join(SUPPORTED_AGENTS)}[/]")
23
+ raise typer.Exit(1)
24
+
25
+ agents = expand_agents(agent, root)
26
+ if agent == "auto":
27
+ console.print(f"[dim]Auto-detected agent: {agents[0]}[/]")
28
+
29
+ for selected in agents:
30
+ console.print(f"\n[bold]{selected}[/]")
31
+ results = install_agent_integration(
32
+ root,
33
+ selected,
34
+ install_slash_command=_install_slash_command,
35
+ )
36
+ _print_install_results(selected, results)
37
+
38
+ console.print("\n[bold green]Upgrade integration refresh complete.[/]")