Scaffold agent context files into a project.
Project description
agentinit
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.mdanddocs/CONVENTIONS.mdusing only facts found in the repo (package files, configs, source code, CI). Do not invent commands. If information is missing, writeTODO: <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 forinit --minimal.agentinit add <type> <name>โ Add modular resources (skills, mcp, security, soul).agentinit statusโ Check health, line budgets, and broken links.agentinit lintโ Runcontextlintto find duplicate text across files.agentinit removeโ Safely remove or archive agent files.
Common Flags (init / new / minimal)
--yesor-yโ Runs non-interactively / skips the wizard (use--forceto 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.mdjust 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
787243f4d372aa6a0e6182e36b9d072fcd40ce1ccb3471a7723f5ead06cae7af
|
|
| MD5 |
da5f8aa867c1c11303e4e58f666c1875
|
|
| BLAKE2b-256 |
aa5f1e78a0297ea20faddb77d6fda739297742783f64f124f7c4841c5de20c8f
|
Provenance
The following attestation bundles were made for agentinit-0.3.1.tar.gz:
Publisher:
publish.yml on Lucenx9/agentinit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentinit-0.3.1.tar.gz -
Subject digest:
787243f4d372aa6a0e6182e36b9d072fcd40ce1ccb3471a7723f5ead06cae7af - Sigstore transparency entry: 1006715677
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@c0771102c569e2800cc510401d9da9376a70876d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0771102c569e2800cc510401d9da9376a70876d -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b14ff5323e465c07a39d98ed6fc55a57f26e26b2ce9ff3a720d58ff1e5c65c5
|
|
| MD5 |
7d0f0f842c17f7febe255c0cee6f6d20
|
|
| BLAKE2b-256 |
97b01b04d21a0ae8e879fc8c40cd377a4ae8f4581e85ca27df980902cde614f6
|
Provenance
The following attestation bundles were made for agentinit-0.3.1-py3-none-any.whl:
Publisher:
publish.yml on Lucenx9/agentinit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentinit-0.3.1-py3-none-any.whl -
Subject digest:
9b14ff5323e465c07a39d98ed6fc55a57f26e26b2ce9ff3a720d58ff1e5c65c5 - Sigstore transparency entry: 1006715678
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@c0771102c569e2800cc510401d9da9376a70876d -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0771102c569e2800cc510401d9da9376a70876d -
Trigger Event:
release
-
Statement type: