agentpack-cli 0.3.11__tar.gz → 0.3.13__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 (137) hide show
  1. agentpack_cli-0.3.13/PKG-INFO +486 -0
  2. agentpack_cli-0.3.13/README.md +447 -0
  3. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/pyproject.toml +3 -3
  4. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/__init__.py +1 -1
  5. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/dependency_graph.py +11 -0
  6. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/application/pack_service.py +384 -26
  7. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/cli.py +26 -0
  8. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/_shared.py +15 -6
  9. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/benchmark.py +880 -219
  10. agentpack_cli-0.3.13/src/agentpack/commands/ci_cmd.py +80 -0
  11. agentpack_cli-0.3.13/src/agentpack/commands/dev_check.py +57 -0
  12. agentpack_cli-0.3.13/src/agentpack/commands/diagnose_selection.py +123 -0
  13. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/doctor.py +46 -1
  14. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/guard.py +18 -8
  15. agentpack_cli-0.3.13/src/agentpack/commands/ignore_cmd.py +123 -0
  16. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/init.py +16 -2
  17. agentpack_cli-0.3.13/src/agentpack/commands/learn.py +101 -0
  18. agentpack_cli-0.3.13/src/agentpack/commands/next_cmd.py +116 -0
  19. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/pack.py +54 -4
  20. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/quickstart.py +3 -3
  21. agentpack_cli-0.3.13/src/agentpack/commands/release_check.py +104 -0
  22. agentpack_cli-0.3.13/src/agentpack/commands/release_cmd.py +54 -0
  23. agentpack_cli-0.3.13/src/agentpack/commands/start_cmd.py +76 -0
  24. agentpack_cli-0.3.13/src/agentpack/commands/state_cmd.py +94 -0
  25. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/status.py +16 -5
  26. agentpack_cli-0.3.13/src/agentpack/commands/task_cmd.py +119 -0
  27. agentpack_cli-0.3.13/src/agentpack/commands/threads.py +173 -0
  28. agentpack_cli-0.3.13/src/agentpack/commands/verify_wheel.py +71 -0
  29. agentpack_cli-0.3.13/src/agentpack/commands/workflow_cmd.py +127 -0
  30. agentpack_cli-0.3.13/src/agentpack/core/changed_paths.py +46 -0
  31. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/config.py +61 -3
  32. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/context_pack.py +221 -4
  33. agentpack_cli-0.3.13/src/agentpack/core/execution_state.py +136 -0
  34. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/git.py +155 -2
  35. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/models.py +18 -0
  36. agentpack_cli-0.3.13/src/agentpack/core/scanner.py +334 -0
  37. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/snapshot.py +5 -2
  38. agentpack_cli-0.3.13/src/agentpack/core/thread_context.py +212 -0
  39. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/data/agentpack.md +18 -0
  40. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/antigravity.py +2 -0
  41. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/claude.py +4 -0
  42. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/codex.py +2 -0
  43. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/cursor.py +3 -0
  44. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/windsurf.py +1 -0
  45. agentpack_cli-0.3.13/src/agentpack/learning/__init__.py +21 -0
  46. agentpack_cli-0.3.13/src/agentpack/learning/collector.py +64 -0
  47. agentpack_cli-0.3.13/src/agentpack/learning/extractor.py +261 -0
  48. agentpack_cli-0.3.13/src/agentpack/learning/feedback.py +22 -0
  49. agentpack_cli-0.3.13/src/agentpack/learning/models.py +65 -0
  50. agentpack_cli-0.3.13/src/agentpack/learning/quality.py +47 -0
  51. agentpack_cli-0.3.13/src/agentpack/learning/renderers.py +99 -0
  52. agentpack_cli-0.3.13/src/agentpack/learning/skill_map.py +29 -0
  53. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/mcp_server.py +44 -23
  54. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/renderers/markdown.py +181 -3
  55. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/discovery.py +57 -0
  56. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/scoring.py +70 -2
  57. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/service.py +2 -0
  58. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/summaries/base.py +41 -13
  59. agentpack_cli-0.3.11/PKG-INFO +0 -1880
  60. agentpack_cli-0.3.11/README.md +0 -1841
  61. agentpack_cli-0.3.11/src/agentpack/commands/ignore_cmd.py +0 -51
  62. agentpack_cli-0.3.11/src/agentpack/core/scanner.py +0 -204
  63. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/.gitignore +0 -0
  64. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/LICENSE +0 -0
  65. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/__init__.py +0 -0
  66. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/antigravity.py +0 -0
  67. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/base.py +0 -0
  68. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/claude.py +0 -0
  69. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/codex.py +0 -0
  70. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/cursor.py +0 -0
  71. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/detect.py +0 -0
  72. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/generic.py +0 -0
  73. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/adapters/windsurf.py +0 -0
  74. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/__init__.py +0 -0
  75. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/go_imports.py +0 -0
  76. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/java_imports.py +0 -0
  77. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/js_ts_imports.py +0 -0
  78. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/monorepo.py +0 -0
  79. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/naming_signals.py +0 -0
  80. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/python_imports.py +0 -0
  81. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/ranking.py +0 -0
  82. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/repo_map.py +0 -0
  83. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/role_inference.py +0 -0
  84. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/rust_imports.py +0 -0
  85. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/symbols.py +0 -0
  86. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/task_classifier.py +0 -0
  87. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/analysis/tests.py +0 -0
  88. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/application/__init__.py +0 -0
  89. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/__init__.py +0 -0
  90. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/claude_cmd.py +0 -0
  91. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/diff.py +0 -0
  92. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/eval_cmd.py +0 -0
  93. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/explain.py +0 -0
  94. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/hook_cmd.py +0 -0
  95. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/install.py +0 -0
  96. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/mcp_cmd.py +0 -0
  97. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/migrate.py +0 -0
  98. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/monitor.py +0 -0
  99. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/repair.py +0 -0
  100. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/route.py +0 -0
  101. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/scan.py +0 -0
  102. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/skills.py +0 -0
  103. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/stats.py +0 -0
  104. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/summarize.py +0 -0
  105. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/tune.py +0 -0
  106. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/commands/watch.py +0 -0
  107. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/__init__.py +0 -0
  108. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/bootstrap.py +0 -0
  109. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/cache.py +0 -0
  110. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/diff.py +0 -0
  111. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/evals.py +0 -0
  112. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/git_hooks.py +0 -0
  113. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/global_install.py +0 -0
  114. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/ignore.py +0 -0
  115. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/merkle.py +0 -0
  116. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/redactor.py +0 -0
  117. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/task_freshness.py +0 -0
  118. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/token_estimator.py +0 -0
  119. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/core/vscode_tasks.py +0 -0
  120. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/installers/__init__.py +0 -0
  121. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/__init__.py +0 -0
  122. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/agents.py +0 -0
  123. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/git_hooks.py +0 -0
  124. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/global_install.py +0 -0
  125. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/platform.py +0 -0
  126. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/integrations/vscode_tasks.py +0 -0
  127. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/renderers/__init__.py +0 -0
  128. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/renderers/compact.py +0 -0
  129. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/renderers/receipts.py +0 -0
  130. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/__init__.py +0 -0
  131. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/models.py +0 -0
  132. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/parser.py +0 -0
  133. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/router/prompt_builder.py +0 -0
  134. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/session/__init__.py +0 -0
  135. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/session/state.py +0 -0
  136. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/summaries/__init__.py +0 -0
  137. {agentpack_cli-0.3.11 → agentpack_cli-0.3.13}/src/agentpack/summaries/offline.py +0 -0
@@ -0,0 +1,486 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentpack-cli
3
+ Version: 0.3.13
4
+ Summary: Local MCP context router for Claude Code, Codex, Cursor, and AI coding agents.
5
+ License: MIT
6
+ License-File: LICENSE
7
+ Keywords: ai,ai-agent,ai-coding-agents,antigravity,ci,claude-code,codex,coding-agent,context,context-engine,context-packing,context-router,cursor,developer-tools,llm,mcp,mcp-context-engine,packing,prompt-context,reduce-token-usage,repo-analysis,repo-context,windsurf
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Build Tools
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: pathspec>=0.12.1
19
+ Requires-Dist: pydantic>=2.0.0
20
+ Requires-Dist: rich>=13.0.0
21
+ Requires-Dist: tiktoken>=0.7.0
22
+ Requires-Dist: tomli-w>=1.0.0
23
+ Requires-Dist: tomli>=2.0.0; python_version < '3.11'
24
+ Requires-Dist: typer>=0.12.0
25
+ Provides-Extra: all
26
+ Requires-Dist: mcp>=1.0.0; extra == 'all'
27
+ Requires-Dist: watchdog>=4.0.0; extra == 'all'
28
+ Provides-Extra: dev
29
+ Requires-Dist: mypy; extra == 'dev'
30
+ Requires-Dist: pytest; extra == 'dev'
31
+ Requires-Dist: pytest-cov; extra == 'dev'
32
+ Requires-Dist: ruff; extra == 'dev'
33
+ Requires-Dist: tomli>=2.0.0; (python_version < '3.11') and extra == 'dev'
34
+ Provides-Extra: mcp
35
+ Requires-Dist: mcp>=1.0.0; extra == 'mcp'
36
+ Provides-Extra: watch
37
+ Requires-Dist: watchdog>=4.0.0; extra == 'watch'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # AgentPack
41
+
42
+ [![PyPI version](https://img.shields.io/pypi/v/agentpack-cli.svg)](https://pypi.org/project/agentpack-cli/)
43
+ [![PyPI Downloads](https://static.pepy.tech/personalized-badge/agentpack-cli?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/agentpack-cli)
44
+ [![npm version](https://img.shields.io/npm/v/@vishal2612200/agentpack.svg)](https://www.npmjs.com/package/@vishal2612200/agentpack)
45
+ [![npm downloads](https://img.shields.io/npm/dm/@vishal2612200/agentpack.svg)](https://www.npmjs.com/package/@vishal2612200/agentpack)
46
+ [![Python versions](https://img.shields.io/pypi/pyversions/agentpack-cli.svg)](https://pypi.org/project/agentpack-cli/)
47
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
48
+ [![CI](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg)](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
49
+
50
+ **Local MCP context router for AI coding agents.**
51
+
52
+ Claude Code, Codex, Cursor, and other coding agents can waste tool calls rediscovering your repo before they make the edit you asked for.
53
+
54
+ AgentPack gives them a ranked map of likely relevant files, tests, rules, and skills for each task. It analyzes your repo locally and packages compact context for CLI and MCP workflows.
55
+
56
+ No cloud indexing. No embeddings required. No API calls for scan, summarize, rank, pack, stats, or benchmark. AgentPack is a context preparation tool, not a coding agent.
57
+
58
+ Try the read-only task router without writing context files:
59
+
60
+ ```bash
61
+ pipx run --spec agentpack-cli agentpack route --task "fix auth token expiry"
62
+ ```
63
+
64
+ ![AgentPack route demo](docs/assets/agentpack-route-demo.svg)
65
+
66
+ > **Status: alpha (v0.3.13).** Works, tested, and used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Current benchmarks are useful regression checks, not broad proof that AgentPack improves coding-agent success. API may change before 1.0.
67
+ >
68
+ > **Platform note:** macOS, Linux, and Windows are supported. Windows support targets PowerShell plus Git for Windows. `cmd.exe` and bare Git setups are not a supported path yet.
69
+ >
70
+ > **Name note:** PyPI package is `agentpack-cli`, npm package is `@vishal2612200/agentpack`, and the command is `agentpack`. This project is unrelated to AgentPack dataset papers or other repos with the same name.
71
+
72
+ ## Before vs After
73
+
74
+ Without AgentPack, a cold coding-agent session often starts with manual repo orientation:
75
+
76
+ ```text
77
+ Task: fix auth token expiry
78
+
79
+ Agent:
80
+ - searches for auth files
81
+ - opens nearby middleware and config
82
+ - may miss related tests
83
+ - spends early turns building a repo map
84
+ ```
85
+
86
+ With AgentPack:
87
+
88
+ ```bash
89
+ agentpack route --task "fix auth token expiry"
90
+ ```
91
+
92
+ ```text
93
+ Task:
94
+ fix auth token expiry
95
+
96
+ Relevant files:
97
+ - tests/test_auth.py
98
+ - src/app/auth.py
99
+ - src/app/users.py
100
+
101
+ Suggested commands:
102
+ - pytest tests/test_auth.py -q
103
+ ```
104
+
105
+ ## Features
106
+
107
+ - **Task-focused packing**: ranks files from git changes, task terms, symbols, imports, related tests, configs, churn, repo history, and deterministic offline summaries.
108
+ - **Budget-aware compression**: emits `full`, `diff`, `symbols`, `skeleton`, or `summary` views instead of all-or-nothing file dumps.
109
+ - **Rendered-token accounting**: budgets against the actual markdown context, not only file payloads.
110
+ - **Reserve buckets**: changed files, tests, docs, and dependencies each get protected selection capacity so one dirty area cannot starve the others.
111
+ - **Execution state**: optional task state files and git-derived fallback status show whether work is planned, in progress, blocked, done, committed, or committed but not pushed.
112
+ - **Thread-scoped context**: explicit `--thread <id>` or `--thread auto` isolates task/context files for multiple agents in one repo and warns on same-branch file overlap.
113
+ - **Task router**: MCP and CLI surfaces route a task to relevant files, scoped rules, installed skills, suggested commands, and safety warnings without executing skills automatically.
114
+ - **Learning layer**: turns task diffs into developer learning notes, skill evidence, and compact lessons future agents can reuse.
115
+ - **Agent integrations**: installs Claude Code, Cursor, Windsurf, Codex, Antigravity, VS Code tasks, git hooks, and MCP configuration.
116
+ - **Local and measurable**: no API calls for scan, summarize, rank, pack, stats, or benchmark; quality is measured with expected-file evals.
117
+
118
+ ## Benchmark Proof
119
+
120
+ Latest public release gate: 8 real commits from Pallets Click, ItsDangerous, and MarkupSafe, scored against files actually changed by each commit.
121
+
122
+ | Metric | Result |
123
+ |---|---:|
124
+ | Avg recall | 79.2% |
125
+ | Avg token precision | 51.2% |
126
+ | Pack p50 | 1,450 tokens |
127
+ | Pack p95 | 3,805 tokens |
128
+
129
+ Full table: [`benchmarks/results/2026-05-27-public.md`](benchmarks/results/2026-05-27-public.md). This is public smoke proof, not a claim of universal ranking quality; expand cases for your own repo with `agentpack benchmark capture`.
130
+
131
+ ## Use Cases
132
+
133
+ - [Claude Code context engine](docs/claude-code-context-engine.md)
134
+ - [MCP context engine](docs/mcp-context-engine.md)
135
+ - [Cursor context packing](docs/cursor-context-packing.md)
136
+ - [AI coding agent context packing](docs/ai-coding-agent-context.md)
137
+ - [Reduce Claude Code token usage](docs/reduce-claude-code-token-usage.md)
138
+ - [AgentPack vs Repomix](docs/agentpack-vs-repomix.md)
139
+ - [AgentPack vs Augment Context Engine](docs/agentpack-vs-augment-context-engine.md)
140
+ - [Docs index](docs/index.md)
141
+
142
+ ## Install
143
+
144
+ ```bash
145
+ pipx install agentpack-cli
146
+ agentpack --version
147
+ ```
148
+
149
+ Requires Python 3.10+. The PyPI package is `agentpack-cli`; the command is `agentpack`. Use `pipx` for normal installs because many macOS/Linux Python distributions block global `pip install` with PEP 668's `externally-managed-environment` error. If you prefer `pip`, install inside a virtual environment.
150
+
151
+ Install `pipx` first if needed:
152
+
153
+ ```bash
154
+ # macOS
155
+ brew install pipx
156
+
157
+ # Ubuntu/Debian
158
+ sudo apt install pipx
159
+
160
+ # Fedora
161
+ sudo dnf install pipx
162
+
163
+ # Arch
164
+ sudo pacman -S python-pipx
165
+
166
+ pipx ensurepath
167
+ ```
168
+
169
+ For JavaScript/TypeScript projects you can use the npm wrapper:
170
+
171
+ ```bash
172
+ npx @vishal2612200/agentpack --version
173
+ npx @vishal2612200/agentpack init --yes
174
+ npx @vishal2612200/agentpack pack
175
+ ```
176
+
177
+ ## Quickstart
178
+
179
+ ```bash
180
+ cd your-repo
181
+ agentpack init --yes
182
+ agentpack work "fix auth token expiry"
183
+ ```
184
+
185
+ Then read `.agentpack/context.md` or the agent-specific context file listed in the output. AgentPack also integrates with MCP so agents can call tools directly instead of reading markdown artifacts.
186
+
187
+ A good explicit workflow is:
188
+
189
+ ```bash
190
+ agentpack task set "fix billing webhook retry handling in app/api/billing/route.ts" --guard
191
+ agentpack next --fix-all-safe
192
+ agentpack status
193
+ agentpack finish --since main
194
+ ```
195
+
196
+ Use `agentpack quickstart --task "..." --write` when you want AgentPack to print the next commands and write the task file for you. Use `agentpack start "..." --pack-only` when you want only a fresh pack and not the guard path.
197
+
198
+ ### Learn from AI-assisted work
199
+
200
+ Generate local post-task learning artifacts from `.agentpack/task.md` and git changes:
201
+
202
+ ```bash
203
+ agentpack learn
204
+ agentpack learn --today
205
+ agentpack learn --since main
206
+ agentpack learn --json
207
+ agentpack learn --llm-prompt --pr-comment
208
+ agentpack learn --feedback helpful --feedback-note "Useful review prompts"
209
+ ```
210
+
211
+ AgentPack writes developer notes to `.agentpack/learning.md` or `.agentpack/daily-summary.md`, updates `.agentpack/skills-progress.json`, writes `.agentpack/agent-lessons.md` for future coding agents, and can emit `.agentpack/learning.prompt.md` or `.agentpack/pr-learning-comment.md`. The MVP is local-first and reuses AgentPack redaction before reading diff snippets.
212
+
213
+ ## Agent Setup
214
+
215
+ AgentPack can install repo-local instructions and hooks for the coding agent you use. The installer is idempotent and merges with existing config where possible.
216
+
217
+ ```bash
218
+ agentpack init --agent claude
219
+ agentpack init --agent codex
220
+ agentpack init --agent cursor
221
+ agentpack init --agent windsurf
222
+ agentpack init --agent antigravity
223
+ agentpack init --agent generic
224
+ ```
225
+
226
+ What each integration writes:
227
+
228
+ | Agent | Files |
229
+ |---|---|
230
+ | Claude Code | `CLAUDE.md`, `.claude/settings.json`, `.mcp.json` |
231
+ | Codex | `AGENTS.md`, `.codex/hooks.json`, git hooks |
232
+ | Cursor | `.cursorrules`, `.cursor/rules/agentpack.mdc`, `.vscode/tasks.json`, git hooks |
233
+ | Windsurf | `.windsurfrules`, `.vscode/tasks.json`, git hooks |
234
+ | Antigravity | `GEMINI.md`, `.vscode/tasks.json`, git hooks |
235
+ | Generic | no agent-specific files; use `context.md` directly |
236
+
237
+ MCP-capable agents should prefer AgentPack MCP tools over reading markdown files directly. The markdown context files remain useful for manual review, CI, non-MCP agents, and logs.
238
+
239
+ Generated instructions keep thread mode explicit. They recommend `AGENTPACK_THREAD_ID=<stable-id> agentpack ... --thread auto` when you want scoped state, but plain installed hooks continue using global `.agentpack/task.md` and `.agentpack/context.md`.
240
+
241
+ ## Configuration Snapshot
242
+
243
+ `agentpack init` creates `.agentpack/config.toml`. Most projects can use the defaults:
244
+
245
+ ```toml
246
+ [context]
247
+ default_mode = "balanced"
248
+ default_budget = 40000
249
+
250
+ [agents.generic]
251
+ output = ".agentpack/context.md"
252
+ ```
253
+
254
+ Use `.agentignore` to remove generated output, vendored code, large exports, or files that repeatedly appear as ranking noise. AgentPack imports obvious generated/noisy entries from gitignore sources during init, but repository-specific outputs should still be added by hand.
255
+
256
+ Use scoring weights only after measuring a real miss:
257
+
258
+ ```bash
259
+ agentpack benchmark --misses
260
+ agentpack explain --file path/to/missed_file.py
261
+ agentpack diagnose-selection
262
+ agentpack ignore suggest
263
+ ```
264
+
265
+ Configuration detail: [`docs/configuration.md`](docs/configuration.md).
266
+
267
+ ## Common Workflows
268
+
269
+ ### Debug Selection
270
+
271
+ ```bash
272
+ agentpack explain --task auto
273
+ agentpack explain --file src/auth/session.py
274
+ agentpack explain --omitted
275
+ agentpack stats
276
+ agentpack diagnose-selection
277
+ ```
278
+
279
+ ### MCP-First Agent Flow
280
+
281
+ 1. Call `start_task(task)` when a new task begins. AgentPack writes `.agentpack/task.md`, packs context, and returns ranked markdown.
282
+ 2. Call `get_context()` when you need the latest pack. It blocks for one refresh if `.agentpack/task.md` or the repo snapshot changed since the last pack.
283
+ 3. Use `route_task(task)` for a lightweight route: relevant files, rules, skills, commands, and safety warnings without writing a full context file.
284
+
285
+ ### Multiple Agent Threads
286
+
287
+ Plain `agentpack pack`, `agentpack status`, and `agentpack guard` keep legacy global behavior and ignore ambient host thread env vars. Use thread mode only when you explicitly ask for it:
288
+
289
+ ```bash
290
+ agentpack pack --thread codex-local
291
+ AGENTPACK_THREAD_ID=codex-local agentpack pack --thread auto
292
+ agentpack threads --active
293
+ agentpack state show --thread codex-local
294
+ ```
295
+
296
+ Thread mode writes under `.agentpack/threads/<id>/` and appends `.agentpack/thread_index.jsonl`. Same-worktree, same-branch overlap is warning-only; separate worktrees or branches remain the safest workflow for concurrent edits.
297
+
298
+ ### Release Validation
299
+
300
+ ```bash
301
+ agentpack dev-check
302
+ agentpack release-check
303
+ agentpack verify-wheel
304
+ agentpack release prepare
305
+ agentpack ci init
306
+ ```
307
+
308
+ The Makefile remains maintainer convenience, but the CLI commands above are the
309
+ package-user source of truth. `agentpack benchmark --release-gate` runs the
310
+ public proof path: public repos, proved target files, misses, and public table
311
+ output. `--sample-fixtures` remains a regression smoke path, not the release
312
+ gate.
313
+
314
+ ## Commands
315
+
316
+ | Command | Purpose |
317
+ |---|---|
318
+ | `agentpack init --yes` | Create local config and ignore files |
319
+ | `agentpack work "task"` | Initialize if needed, start task, refresh context, show next steps |
320
+ | `agentpack start "task"` | Write task and run the guard/refresh workflow |
321
+ | `agentpack finish --since main` | Diagnose, capture benchmark case, run checks, mark done |
322
+ | `agentpack learn` | Generate developer learning notes, skill progress, and future-agent lessons |
323
+ | `agentpack task show|set|clear` | Manage global or thread-scoped task files |
324
+ | `agentpack pack` | Generate a ranked context pack for `.agentpack/task.md` |
325
+ | `agentpack next --fix-all-safe` | Ask AgentPack what command or safe repair should happen next |
326
+ | `agentpack guard --repair-stale --refresh-context` | Check freshness, repair stale rules, refresh context |
327
+ | `agentpack status` | Show context freshness and git/task state |
328
+ | `agentpack stats` | Show pack size, token savings, and top files |
329
+ | `agentpack explain --task auto` | Debug selected and omitted files |
330
+ | `agentpack diagnose-selection` | Turn latest pack/benchmark signals into concrete tuning actions |
331
+ | `agentpack ignore suggest|apply` | Suggest or apply `.agentignore` improvements |
332
+ | `agentpack route --task "..."` | Get lightweight task routing without a full context file |
333
+ | `agentpack threads [--active] [--conflicts]` | Inspect thread-scoped context state |
334
+ | `agentpack state show|set|done` | Read or update execution state files |
335
+ | `agentpack benchmark capture --since <ref>` | Add a benchmark case from changed files |
336
+ | `agentpack benchmark --release-gate` | Run public benchmark evidence path |
337
+ | `agentpack dev-check` | Run docs, lint, pytest, and npm wrapper checks |
338
+ | `agentpack verify-wheel` | Install built wheel in a temp venv and run benchmark gate |
339
+ | `agentpack release-check` | Run version, changelog, tests, build, and benchmark checks |
340
+ | `agentpack release prepare` | Run full release prep, public table, and wheel verification |
341
+ | `agentpack ci init` | Generate a GitHub Actions workflow for AgentPack checks |
342
+
343
+ Full command reference: [`docs/commands.md`](docs/commands.md).
344
+
345
+ ## Make Shortcuts
346
+
347
+ Run `make help` for the current list. The main targets are:
348
+
349
+ | Target | Wraps |
350
+ |---|---|
351
+ | `make test` | `pytest -q` |
352
+ | `make lint` | `python -m ruff check src tests` |
353
+ | `make npm-test` | npm wrapper/version tests |
354
+ | `make docs-check` | README/docs link smoke + `git diff --check` |
355
+ | `make benchmark` | `agentpack benchmark --release-gate --no-public-table` |
356
+ | `make benchmark-publish` | `agentpack benchmark --release-gate` |
357
+ | `make release-fast` | `agentpack release-check --skip-benchmark --skip-build` |
358
+ | `make release` | `agentpack release-check` |
359
+ | `make verify-wheel` | build wheel, install in temp venv, run benchmark gate |
360
+
361
+ `make context` uses legacy global context. For scoped context, run:
362
+
363
+ ```bash
364
+ THREAD=codex-local make context-thread
365
+ AGENTPACK_THREAD_ID=codex-local make context-thread
366
+ ```
367
+
368
+ ## Benchmark Proof
369
+
370
+ AgentPack is best treated as a ranked starting map. It can reduce repeated orientation work, but the agent and reviewer still own correctness.
371
+
372
+ Use real repo evals instead of trusting compression numbers:
373
+
374
+ ```bash
375
+ agentpack benchmark --release-gate
376
+ ```
377
+
378
+ Current benchmark evidence is documented in [`benchmarks/README.md`](benchmarks/README.md) and the generated tables under `benchmarks/results/`. Treat these as scoped evidence for the included cases, not a universal performance claim.
379
+
380
+ ## What A Pack Contains
381
+
382
+ Rendered packs are meant to be readable by humans and directly useful to agents. A typical pack includes:
383
+
384
+ - freshness metadata with task source, generated time, git branch, SHA, and snapshot hash
385
+ - execution state with task status, checklist counts, git dirty/ahead/behind counts, and Docker/Compose availability
386
+ - concurrent-context warnings when another active thread overlaps files on the same branch and worktree
387
+ - token stats and largest token consumers
388
+ - semantic repo map grouped by subsystem
389
+ - selected-file table with include mode and reason
390
+ - compressed context receipts showing why files were included or excluded
391
+ - file context in `full`, `diff`, `symbols`, `skeleton`, or `summary` mode
392
+
393
+ The pack is a starting map. Agents should still verify the selected files against actual code before editing.
394
+
395
+ ## Local Files
396
+
397
+ AgentPack writes local artifacts under `.agentpack/`:
398
+
399
+ | Path | Purpose |
400
+ |---|---|
401
+ | `.agentpack/task.md` | current global task summary |
402
+ | `.agentpack/task_state.md` | optional global execution state |
403
+ | `.agentpack/context.md` | generic/Codex/Cursor/Windsurf fallback context |
404
+ | `.agentpack/context.claude.md` | Claude-flavored fallback context |
405
+ | `.agentpack/learning.md` | local post-task developer learning notes |
406
+ | `.agentpack/daily-summary.md` | local daily learning rollup from `agentpack learn --today` |
407
+ | `.agentpack/skills-progress.json` | local skill evidence map from task work |
408
+ | `.agentpack/agent-lessons.md` | compact repo-specific lessons injected into future packs |
409
+ | `.agentpack/learning.prompt.md` | optional source-backed prompt for external LLM refinement |
410
+ | `.agentpack/pr-learning-comment.md` | optional PR-comment-ready learning summary |
411
+ | `.agentpack/learning-feedback.jsonl` | optional local helpful/not-helpful feedback records |
412
+ | `.agentpack/pack_metadata.json` | freshness and pack metadata |
413
+ | `.agentpack/cache/` | offline file summaries keyed by hash |
414
+ | `.agentpack/snapshots/` | repo snapshot hashes |
415
+ | `.agentpack/thread_index.jsonl` | append-only thread activity index |
416
+ | `.agentpack/threads/<id>/` | scoped task, state, context, and metadata for explicit thread mode |
417
+
418
+ Generated context, cache, snapshots, and thread state are local operational files. The root `.agentpack/config.toml` and `.agentignore` are usually worth committing; generated context artifacts usually are not.
419
+
420
+ ## Troubleshooting
421
+
422
+ If AgentPack selects too much:
423
+
424
+ ```bash
425
+ agentpack diagnose-selection
426
+ agentpack stats
427
+ agentpack explain --omitted
428
+ agentpack explain --budget-plan
429
+ agentpack ignore suggest
430
+ ```
431
+
432
+ If a required file is missing:
433
+
434
+ ```bash
435
+ agentpack explain --file path/to/file.py
436
+ agentpack benchmark --misses
437
+ agentpack benchmark capture --since HEAD~1 --task "describe the task"
438
+ ```
439
+
440
+ If context looks stale:
441
+
442
+ ```bash
443
+ agentpack status --deep
444
+ agentpack guard --agent auto --repair-stale --refresh-context
445
+ ```
446
+
447
+ If multiple agents are editing the same project:
448
+
449
+ ```bash
450
+ agentpack threads --active
451
+ agentpack threads --conflicts
452
+ agentpack state show --thread codex-local
453
+ ```
454
+
455
+ If package release checks fail:
456
+
457
+ ```bash
458
+ agentpack release-check --json
459
+ agentpack release-check --skip-benchmark
460
+ ```
461
+
462
+ Use the skip flags only for local iteration. The final release proof should include the build and public benchmark gate.
463
+
464
+ ## Documentation
465
+
466
+ - [`docs/architecture.md`](docs/architecture.md): pipeline, data flow, package layout, thread/execution state, rendered-budget accounting.
467
+ - [`docs/commands.md`](docs/commands.md): full CLI command reference.
468
+ - [`docs/configuration.md`](docs/configuration.md): config, scoring weights, `.agentignore`, and git integration.
469
+ - [`docs/integrations.md`](docs/integrations.md): agent setup, MCP workflow, hooks, and native integration status.
470
+ - [`docs/benchmarking.md`](docs/benchmarking.md): quality bar, release gate, sample fixtures, and public artifacts.
471
+ - [`docs/development.md`](docs/development.md): local development, release checklist, naming/ranking, and contribution notes.
472
+ - [`docs/limitations.md`](docs/limitations.md): project scope, honest token framing, known limitations, and roadmap.
473
+
474
+ ## Limitations
475
+
476
+ - AgentPack prepares context; it does not edit code, run tests for the agent, or prove correctness.
477
+ - Ranking is deterministic and local, but it can still miss files. Use `agentpack explain`, `agentpack benchmark --misses`, and normal code review.
478
+ - Thread coordination is warning-based, not locking-based. It helps agents notice collisions but does not enforce ownership.
479
+ - Language support is strongest for Python and JavaScript/TypeScript. Other languages still benefit from filenames, git signals, and summaries.
480
+ - Token estimates are approximate, even with rendered-budget accounting. Treat them as operational guidance, not provider billing truth.
481
+
482
+ More detail: [`docs/limitations.md`](docs/limitations.md).
483
+
484
+ ## License
485
+
486
+ MIT