Skip to main content

Scaffold agent context files into a project.

Project description

agentinit

CI PyPI Python Versions

agentinit preview

Scaffold tiny, router-first context files so your AI coding agents stop guessing your project setup, style rules, and test commands.

Pure Python standard library. No runtime dependencies. Does not touch your source code. Generates router files for Claude Code, Codex, Cursor, Copilot, and Gemini CLI.

๐Ÿš€ Start in 60 seconds

# 1. Install via pipx (recommended)
pipx install agentinit

# 2. Add minimal agent context to your project
cd your-project
agentinit init --minimal

What it does

Instead of giant, token-heavy instruction files for every tool, agentinit creates a router-first structure. Top-level files stay tiny and only point to AGENTS.md, which links to docs/*.

your-project/
โ”œโ”€โ”€ AGENTS.md              # The central hub for all agents
โ”œโ”€โ”€ CLAUDE.md              # Claude Code router
โ””โ”€โ”€ docs/
    โ”œโ”€โ”€ PROJECT.md         # What this project is (you fill this)
    โ””โ”€โ”€ CONVENTIONS.md     # How to work in it (you fill this)

Next steps: Open docs/PROJECT.md and docs/CONVENTIONS.md and fill them in.

Next session: Tell your agent: "follow the router for your tool (CLAUDE.md / GEMINI.md / etc) โ†’ AGENTS.md"


๐Ÿ› ๏ธ Add extras (Skills, MCP, Personality)

Agents can do more than just read conventions. You can inject modular resources directly into your project. Resources are written under .agents/ and linked from AGENTS.md automatically.

# View available resources
agentinit add --list

# Add specific capabilities
agentinit add skill code-reviewer
agentinit add mcp github
agentinit add security
agentinit add soul "YourAgentName"

(Replace "YourAgentName" with any name you want for your agent persona.)

This creates modular files and automatically links them in your AGENTS.md:

your-project/
โ”œโ”€โ”€ .agents/
โ”‚   โ”œโ”€โ”€ security.md
โ”‚   โ”œโ”€โ”€ soul.md
โ”‚   โ”œโ”€โ”€ mcp-github.md
โ”‚   โ””โ”€โ”€ skills/
โ”‚       โ””โ”€โ”€ code-reviewer/
โ”‚           โ””โ”€โ”€ SKILL.md
โ””โ”€โ”€ AGENTS.md              # Automatically updated!

(Adding resources is safe: it skips existing files to avoid duplicates. Use --force to overwrite.)


๐Ÿšฆ Keep your context clean (Status & CI)

Token limits matter. agentinit includes a status checker and linter to prevent context bloat, broken links, and missing information.

# View line budgets, broken references, and missing details
agentinit status

Example output:
! docs/CONVENTIONS.md (201 lines >= 200)
x Broken reference: docs/missing-file.md

# Perfect for CI (exits non-zero on hard violations)
agentinit status --check

๐Ÿค– AI Prompt: Fill the docs fast

Don't want to write PROJECT.md and CONVENTIONS.md yourself? After running agentinit init, paste this prompt to your favorite AI agent:

Read the entire repository. Fill in docs/PROJECT.md and docs/CONVENTIONS.md using only facts found in the repo (package files, configs, source code, CI). Do not invent commands. If information is missing, write TODO: <what's needed>. Do not modify any other files.

Review the result, fix the TODOs, and commit!


๐Ÿ“š Advanced Usage & Commands

Core Commands

  • agentinit new <project> โ€” Create a new directory and scaffold files.
  • agentinit init โ€” Add missing files to an existing directory.
  • agentinit minimal โ€” Shortcut for init --minimal.
  • agentinit add <type> <name> โ€” Add modular resources (skills, mcp, security, soul).
  • agentinit status โ€” Check health, line budgets, and broken links.
  • agentinit lint โ€” Run contextlint to find duplicate text across files.
  • agentinit remove โ€” Safely remove or archive agent files.

Common Flags (init / new / minimal)

  • --yes or -y โ€” Runs non-interactively / skips the wizard (use --force to overwrite agentinit-managed files).
  • --minimal โ€” Create only the 4 core files (AGENTS.md, CLAUDE.md, and docs).
  • --detect โ€” Auto-detect stack and commands from package files (e.g., package.json, pyproject.toml).
  • --purpose "<text>" โ€” Prefill the project purpose non-interactively.

Linting Options

# Human-readable output
agentinit lint

# Machine-readable JSON for CI
agentinit lint --format json

Removing Files

agentinit remove --dry-run    # Preview what will happen
agentinit remove              # Remove with confirmation
agentinit remove --archive    # Move to .agentinit-archive/ instead of deleting
๐Ÿ’ก Why Router-First?
  • Saves Tokens: Re-typing 400 tokens per session across 20 sessions/month wastes 8k+ tokens.
  • Single Source of Truth: Update a convention once in docs/, and Cursor, Copilot, and Claude all see it.
  • Prevents Hallucinations: Agents stop guessing your test command or trying to use the wrong linting tool.
  • Faster Onboarding: Human developers benefit from reading PROJECT.md just as much as the AI does.
โš™๏ธ Installation & Development

Requires Python 3.10+.

# Install (pipx is recommended for CLI apps)
pipx install agentinit

# Update
pipx upgrade agentinit

# Install without pipx
pip install agentinit

Color Output

Colored output is enabled on terminals. It disables automatically in CI or when piping. Force disable it with:

NO_COLOR=1 agentinit init

Development

pip install -e . --group dev
python3 -m pytest tests/ -v

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentinit-0.3.1.tar.gz (41.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentinit-0.3.1-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

Details for the file agentinit-0.3.1.tar.gz.

File metadata

  • Download URL: agentinit-0.3.1.tar.gz
  • Upload date:
  • Size: 41.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentinit-0.3.1.tar.gz
Algorithm Hash digest
SHA256 787243f4d372aa6a0e6182e36b9d072fcd40ce1ccb3471a7723f5ead06cae7af
MD5 da5f8aa867c1c11303e4e58f666c1875
BLAKE2b-256 aa5f1e78a0297ea20faddb77d6fda739297742783f64f124f7c4841c5de20c8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentinit-0.3.1.tar.gz:

Publisher: publish.yml on Lucenx9/agentinit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentinit-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: agentinit-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 39.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentinit-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b14ff5323e465c07a39d98ed6fc55a57f26e26b2ce9ff3a720d58ff1e5c65c5
MD5 7d0f0f842c17f7febe255c0cee6f6d20
BLAKE2b-256 97b01b04d21a0ae8e879fc8c40cd377a4ae8f4581e85ca27df980902cde614f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentinit-0.3.1-py3-none-any.whl:

Publisher: publish.yml on Lucenx9/agentinit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page