The Problem

Teams using multiple AI coding agents (Claude Code, Codex, Cursor) face config drift: writing rules, permissions, and skills must be duplicated and kept in sync across agents, repos, and machines. anywhere-agents solves this with a single AGENTS.md that drives all agents, plus composable "packs" for adding rules, skills, or permissions on demand.

What This Does

The repo contains a Python package (packages/pypi/anywhere_agents/) and a thin npm wrapper (packages/npm/bin/anywhere-agents.js). The core is cli.py, which handles bootstrapping, deploying, and applying config to multiple agents. The composer/scripts/ directory holds the pack system: compose_packs.py and compose_rule_packs.py merge pack definitions into per-agent configs.

The skills/ directory contains ready-made skills like implement-review (a staged-diff review loop) and prun (parallel task delegation). The docs/ folder includes render scripts and a full mkdocs site.

How It Is Wired

Execution starts at packages/pypi/anywhere_agents/cli.py. From there, the composer/scripts/packs/ package handles pack resolution. The most-connected module is scripts/packs/__init__.py with 17 importers — it's a hub, so changes there ripple widely. The dispatch module (scripts/packs/dispatch.py) routes pack operations to handlers in scripts/packs/handlers/ (command, hook, permission, skill).

The wiring is straightforward: CLI → composer → pack handlers → filesystem writes. No database, no network calls beyond fetching packs from git refs. The locks.py and transaction.py modules handle file-level locking and atomicity.

How To Use It

Setup: Install via pip (pip install anywhere-agents) or npm. The pyproject.toml and package.json are the dependency manifests.

Configuration: No required env vars. Configuration lives in AGENTS.md and pack YAML files. The bootstrap/ directory contains bootstrap.sh and bootstrap.ps1 for initial setup.

Running it: The entry point is the anywhere-agents CLI. Per the README, the core command is:

anywhere-agents pack add https://github.com/yzhao062/agent-pack --ref v0.1

Real-World Use

A researcher with a LaTeX paper workflow: bootstrap installs the agent-style rule pack (bans ~45 AI-tell words), the implement-review skill for pre-push review, and the prun skill for parallel delegation. One AGENTS.md drives Claude Code on macOS and Codex on Linux without drift.

Code Health & Issues

Static analysis (not opinion) found 128 issues: 33 high, 95 medium.

  • High - Duplicated code blocks: 11,332 repeated 6-line blocks across 121 files, including cli.py and compose_packs.py. Extract shared helpers.
  • High - Deep nesting: 26 instances, max indentation depth 10 in cli.py. Use guard clauses.
  • High - Oversized files: 11 files over 3,000 lines, notably cli.py (3,142 lines). Split by responsibility.
  • Medium - Broad exception handling: 15 instances of bare except in cli.py and compose_rule_packs.py. Catch specific exceptions.
  • Medium - File handles opened without context managers: 6 instances in locks.py and await-review.py. Use with open().

SDLC observations: tests exist (64 files) and CI runs via GitHub Actions, but there's no lockfile (docs/requirements.txt is unpinned). Two dependencies are one major version behind (mkdocs-include-markdown-plugin, pymdown-extensions). No committed secrets found.

The Bottom Line

This is a practical, well-documented tool for a real pain point — multi-agent config drift. The core design is sound, but the codebase needs refactoring: the hub module and oversized files will make changes expensive. Worth using if you run multiple agents; worth cleaning up if you plan to extend it.