Skip to content

Commit 02099b8

Browse files
committed
docs(agents): verify and fix AGENTS.md content against actual codebase
Root AGENTS.md: - Add missing make targets (outdated, update-local, update-baseline, etc.) - Add data files section documenting 2-file model cli_audit/AGENTS.md: - Add 2 new modules: local_state.py, upstream_cache.py - Add data model section with file locations - Update module count 18→20, catalog 74→76 scripts/AGENTS.md: - Remove non-existent install_core.sh - Add 20+ undocumented scripts (install_claude.sh, pin_version.sh, etc.) - Fix colors.sh→common.sh (colors.sh doesn't exist) - Document all 10 lib/ modules with correct paths tests/AGENTS.md: - Add missing test files: test_catalog_and_collectors.py, test_local_state.py, test_upstream_cache.py - Update test file count 8→12 All content verified against actual codebase using verify-content.sh
1 parent f68ef0e commit 02099b8

4 files changed

Lines changed: 111 additions & 34 deletions

File tree

AGENTS.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Managed by agent: keep sections and order; edit content, not structure. Last updated: 2025-11-29 -->
1+
<!-- Managed by agent: keep sections and order; edit content, not structure. Last updated: 2026-01-14 -->
22

33
# AGENTS.md (root)
44

@@ -41,7 +41,7 @@ uv run python audit.py --help # Verify CLI works
4141

4242
## Index of scoped AGENTS.md
4343

44-
- [cli_audit/AGENTS.md](./cli_audit/AGENTS.md) — Python package (18 modules)
44+
- [cli_audit/AGENTS.md](./cli_audit/AGENTS.md) — Python package (20 modules)
4545
- [scripts/AGENTS.md](./scripts/AGENTS.md) — Installation scripts (Bash)
4646
- [tests/AGENTS.md](./tests/AGENTS.md) — Test suite (pytest)
4747

@@ -53,15 +53,31 @@ uv run python audit.py --help # Verify CLI works
5353
| `uv run python -m pytest -x` | Run tests, stop on first failure |
5454
| `uv run python audit.py ripgrep` | Single tool audit |
5555
| `uv run python audit.py --help` | Show CLI options |
56-
| `make audit` | Render from snapshot (<100ms) |
57-
| `make update` | Collect fresh versions (~7s) |
56+
| `make audit` | Render from snapshot (fast, no network) |
57+
| `make audit-offline` | Offline audit with hints |
58+
| `make outdated` | Show only missing/outdated tools |
59+
| `make update` | Collect fresh versions (~10s) |
60+
| `make update-local` | Update only local state (no network) |
61+
| `make update-baseline` | Update upstream baseline for commit |
5862
| `make upgrade` | Interactive upgrade guide |
63+
| `make upgrade-managed` | Upgrade all package managers |
64+
| `make upgrade-dry-run` | Preview upgrades without changes |
65+
| `./scripts/set_auto_update.sh <tool>` | Enable auto-update for a tool |
66+
67+
## Data files
68+
69+
**2-file data model** (Phase 2.1):
70+
- `upstream_versions.json` — Latest upstream versions (committed, shared baseline)
71+
- `local_state.json` — Machine-specific installation state (gitignored)
72+
73+
**User configuration:**
74+
- `~/.config/cli-audit/config.yml` — User preferences (auto_update, tool overrides)
5975

6076
## Project overview
6177

6278
**AI CLI Preparation v2.0** — Tool version auditing and installation management for AI coding agents.
6379

64-
- **Architecture:** 18 Python modules, 74 JSON tool catalogs
80+
- **Architecture:** 20 Python modules, 76 JSON tool catalogs
6581
- **Phase 1:** Detection & auditing (complete)
6682
- **Phase 2:** Installation & upgrade management (complete)
6783
- **Entry point:** `audit.py``cli_audit` package

cli_audit/AGENTS.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2025-11-29 -->
1+
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2026-01-14 -->
22

33
# cli_audit/ — Python Package
44

5-
**Modular architecture** with 18 specialized modules for tool detection, auditing, installation, and upgrade management.
5+
**Modular architecture** with 20 specialized modules for tool detection, auditing, installation, and upgrade management.
66

77
## Overview
88

99
The `cli_audit` package provides the core functionality for AI CLI Preparation:
1010

1111
**Phase 1: Detection & Auditing (6 modules)**
1212
- `tools.py` — Tool definitions and metadata
13-
- `catalog.py` — JSON catalog management (74 entries)
13+
- `catalog.py` — JSON catalog management (76 entries)
1414
- `detection.py` — Installation detection, version extraction
1515
- `collectors.py` — Upstream version collection (GitHub, PyPI, npm, crates)
1616
- `snapshot.py` — Snapshot-based caching
@@ -19,7 +19,7 @@ The `cli_audit` package provides the core functionality for AI CLI Preparation:
1919
**Phase 2: Foundation (5 modules)**
2020
- `common.py` — Shared types (InstallResult, AuditResult, etc.)
2121
- `environment.py` — OS/arch detection, package manager detection
22-
- `config.py` — Configuration management (YAML support)
22+
- `config.py` — Configuration management (YAML, user prefs, auto_update)
2323
- `package_managers.py` — Package manager abstractions
2424
- `logging_config.py` — Logging configuration
2525

@@ -29,11 +29,33 @@ The `cli_audit` package provides the core functionality for AI CLI Preparation:
2929
- `bulk.py` — Parallel bulk operations
3030
- `upgrade.py` — Upgrade workflows
3131

32+
**Phase 2: State Management (2 modules)**
33+
- `local_state.py` — Machine-specific installation state (gitignored)
34+
- `upstream_cache.py` — Upstream version cache (committed baseline)
35+
3236
**Phase 2: Advanced Features (3 modules)**
3337
- `breaking_changes.py` — Semver analysis for breaking changes
3438
- `reconcile.py` — Duplicate installation cleanup
3539
- `__init__.py` — Public API exports (backward compatibility)
3640

41+
## Data model
42+
43+
**2-file data model** (Phase 2.1 consolidation):
44+
```
45+
upstream_versions.json # Committed - latest available versions (shared baseline)
46+
local_state.json # Gitignored - machine-specific installation state
47+
```
48+
49+
**User configuration:**
50+
```
51+
~/.config/cli-audit/config.yml # User preferences (auto_update, tool overrides)
52+
```
53+
54+
**Catalog entries** (76 JSON files in `catalog/`):
55+
- Each tool has `name`, `candidates`, `source_kind`, `source_args`, `category`
56+
- Categories: python, node, go, rust, ruby, php, shell, git, devops, platform, ai, general
57+
- User preferences (auto_update) stored in user config, not catalog
58+
3759
## Setup & environment
3860

3961
**Requirements:**

scripts/AGENTS.md

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,56 @@
1-
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2025-11-29 -->
1+
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2026-01-14 -->
22

33
# Installation Scripts - Agent Guide
44

55
**Scope:** Shell scripts for tool installation, update, uninstall, reconcile
66

77
## Overview
88

9-
25+ Bash scripts for installing developer tools with multiple actions:
9+
28 Bash scripts for installing developer tools with multiple actions:
1010
- **install**: Fresh installation (default action)
1111
- **update**: Upgrade to latest version
1212
- **uninstall**: Remove installation
1313
- **reconcile**: Switch to preferred installation method (e.g., system → user)
1414

15-
**Key scripts:**
16-
- `install_core.sh`: Core tools (fd, fzf, ripgrep, jq, yq, bat, delta, just)
15+
**Installation scripts** (language toolchains):
1716
- `install_python.sh`: Python toolchain via uv
1817
- `install_node.sh`: Node.js via nvm
1918
- `install_rust.sh`: Rust via rustup
20-
- `install_go.sh`, `install_aws.sh`, `install_kubectl.sh`, etc.
21-
- `guide.sh`: Interactive upgrade guide
19+
- `install_go.sh`: Go via official installer
20+
- `install_ruby.sh`: Ruby via rbenv/ruby-build
21+
- `install_uv.sh`: uv package manager
22+
23+
**Installation scripts** (tools & services):
24+
- `install_tool.sh`: Main orchestrator - reads catalog, delegates to installers
25+
- `install_group.sh`: Install tool groups
26+
- `install_claude.sh`: Claude Code CLI (native installer)
27+
- `install_ansible.sh`, `install_brew.sh`, `install_composer.sh`
28+
- `install_docker.sh`, `install_gem.sh`, `install_parallel.sh`, `install_yarn.sh`
29+
30+
**Upgrade & management:**
31+
- `guide.sh`: Interactive upgrade guide (supports 'a' for auto-update)
32+
- `upgrade_all.sh`: Batch upgrade all tools
33+
- `auto_update.sh`: Automatic update runner
34+
- `set_auto_update.sh`: Enable/disable auto-update per tool
35+
- `pin_version.sh`, `unpin_version.sh`: Version pinning
36+
37+
**Reconciliation:**
38+
- `reconcile_pip_to_uv.sh`: Migrate pip packages to uv
39+
- `reconcile_pipx_to_uv.sh`: Migrate pipx packages to uv
40+
41+
**Utilities:**
42+
- `check_python_package_managers.sh`: Detect multiple Python package managers
43+
- `check_node_package_managers.sh`: Detect multiple Node.js package managers
2244
- `test_smoke.sh`: Smoke test for audit output
45+
- `auto_update_scope_prototype.sh`: Prototype for scope detection
2346

24-
**Shared utilities:** `lib/` directory (colors, logging, common functions)
47+
**Shared utilities:** `scripts/lib/` directory (10 modules):
48+
- `lib/common.sh` — Logging and output formatting
49+
- `lib/config.sh` — Read user config from `~/.config/cli-audit/config.yml`
50+
- `lib/catalog.sh` — Catalog access utilities
51+
- `lib/capability.sh`, `lib/dependency.sh` — Capability and dependency checks
52+
- `lib/install_strategy.sh`, `lib/reconcile.sh` — Installation strategies
53+
- `lib/path_check.sh`, `lib/policy.sh`, `lib/scope_detection.sh` — Path and policy utilities
2554

2655
## Setup & environment
2756

@@ -73,6 +102,15 @@ make reconcile-node # Switch Node.js to nvm-managed
73102
./scripts/test_smoke.sh # Verify audit output format
74103
```
75104

105+
**Auto-update management:**
106+
```bash
107+
# Enable auto-update for a tool (stores in ~/.config/cli-audit/config.yml)
108+
./scripts/set_auto_update.sh prettier # Enable
109+
./scripts/set_auto_update.sh prettier false # Disable
110+
111+
# In guide.sh, press 'a' to install AND enable auto-update
112+
```
113+
76114
**Debug mode:**
77115
```bash
78116
DEBUG=1 ./scripts/install_python.sh
@@ -102,7 +140,7 @@ set -euo pipefail
102140

103141
# Source shared utilities
104142
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
105-
source "${SCRIPT_DIR}/lib/colors.sh" || true
143+
source "${SCRIPT_DIR}/lib/common.sh" || true
106144
source "${SCRIPT_DIR}/lib/common.sh" || true
107145

108146
# Main function per action
@@ -226,7 +264,7 @@ fi
226264
**Script checklist:**
227265
- [ ] Shebang: `#!/usr/bin/env bash`
228266
- [ ] Strict mode: `set -euo pipefail`
229-
- [ ] Source shared lib: `source "${SCRIPT_DIR}/lib/colors.sh"`
267+
- [ ] Source shared lib: `source "${SCRIPT_DIR}/lib/common.sh"`
230268
- [ ] Action dispatcher (install/update/uninstall/reconcile)
231269
- [ ] Error handling (check return codes, trap on exit)
232270
- [ ] Confirmation prompts (respect FORCE_INSTALL)

tests/AGENTS.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2025-11-29 -->
1+
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2026-01-14 -->
22

33
# tests/ — Test Suite
44

55
**Comprehensive testing** with unit, integration, and E2E tests for the modular cli_audit package.
66

77
## Overview
88

9-
The test suite validates all 18 modules across Phase 1 (Detection & Auditing) and Phase 2 (Installation & Upgrade Management).
9+
The test suite validates all 20 modules across Phase 1 (Detection & Auditing) and Phase 2 (Installation & Upgrade Management).
1010

1111
**Test organization:**
1212
```
1313
tests/
14-
├── test_config.py # Configuration management (48+ tests) ✅
15-
├── test_environment.py # Environment detection (10KB)
16-
├── test_package_managers.py # Package manager abstractions (13KB)
17-
├── test_installer.py # Installation logic (22KB)
18-
├── test_install_plan.py # Planning & dependencies (15KB)
19-
├── test_bulk.py # Bulk operations (28KB)
20-
├── test_reconcile.py # Duplicate cleanup (26KB)
21-
├── test_upgrade.py # Upgrade workflows
22-
├── test_logging.py # Logging configuration (7KB)
23-
├── integration/
24-
│ └── test_e2e_install.py # End-to-end installation tests
25-
└── fixtures/ # Test data and mocks
14+
├── test_bulk.py # Bulk operations
15+
├── test_catalog_and_collectors.py # Catalog and version collectors
16+
├── test_config.py # Configuration management
17+
├── test_environment.py # Environment detection
18+
├── test_install_plan.py # Planning & dependencies
19+
├── test_installer.py # Installation logic
20+
├── test_local_state.py # Local state management
21+
├── test_logging.py # Logging configuration
22+
├── test_package_managers.py # Package manager abstractions
23+
├── test_reconcile.py # Duplicate cleanup
24+
├── test_upgrade.py # Upgrade workflows
25+
├── test_upstream_cache.py # Upstream cache management
26+
└── integration/
27+
└── test_e2e_install.py # End-to-end installation tests
2628
```
2729

2830
**Test coverage:**
29-
- 8 unit test files
31+
- 12 unit test files covering all 20 modules
3032
- 1 integration test directory
31-
- 48+ test cases in test_config.py alone
3233
- Fixtures for mocking external services
3334

3435
## Setup & environment

0 commit comments

Comments
 (0)