Scaffold agent context files into a project.
Project description
agentinit
Scaffold tiny context files so your AI coding agents stop guessing your setup. Pure Python stdlib, no runtime dependencies, nothing touches your source code.
Works with Claude Code, Codex, Cursor, Copilot, and Gemini CLI.
If you've ever had an agent guess your test command, ignore your style rules,
or forget what the project does — agentinit creates a small set of Markdown
files that give every agent the same starting context, every session.
Save tokens fast (Minimal mode, 2 minutes)
# Existing repo/folder:
agentinit init --minimal
# New project:
agentinit new myproject --yes --minimal
Then fill only docs/PROJECT.md and docs/CONVENTIONS.md.
Next time, tell your agent: follow CLAUDE.md / AGENTS.md.
What you get:
your-project/
├── AGENTS.md # entry point for all agents
├── CLAUDE.md # Claude Code router
└── docs/
├── PROJECT.md # what this project is (fill this)
└── CONVENTIONS.md # how to work in it (fill this)
- On a terminal, a short interactive wizard runs automatically — use
--yesto skip it. - Use
--purpose "..."to prefill Purpose non-interactively (e.g. in CI). - Keep reading only if you want full mode or advanced usage.
Token savings (rough estimate)
- Tokens saved ≈ tokens you usually re-type per session × number of sessions.
- If you re-type ~200–400 tokens and do 10–20 sessions/month: ~2k–8k tokens/month.
- Actual savings depend on your workflow and which tool loads which files.
Quickstart (60 seconds)
# 1. Install (stable)
pipx install agentinit
# Or bleeding edge:
# pipx install git+https://github.com/Lucenx9/agentinit.git@main
# 2. Scaffold a new project
agentinit new myproject --yes
cd myproject
# 3. Open these files in your code editor (VSCode, Cursor, etc.)
# and fill them in with your project's real info.
# (see "Fill the docs fast" below for an AI-assisted shortcut)
# 4. Commit and you're done
git init && git add -A && git commit -m "init: add agent context files"
For an existing project, run agentinit init in the repo root instead of agentinit new.
Fill the docs fast (AI prompt)
After scaffolding, paste this into your agent to auto-populate the docs:
Read the entire repository. Then fill in
docs/PROJECT.mdanddocs/CONVENTIONS.mdusing only information you find in the repo (package files, existing configs, source code, CI workflows, etc.). Do not invent commands or assumptions. Where information is missing or ambiguous, writeTODO: <what's needed>so the developer can fill it in later. Do not modify any other files.
Review the result, fix any TODOs, and commit.
Install
Requires Python 3.10+.
# With pipx (recommended, stable)
pipx install agentinit
# With pip
pip install agentinit
# Or run one-off without installing
pipx run agentinit --help
# Bleeding edge (latest on main)
# pipx install git+https://github.com/Lucenx9/agentinit.git@main
Usage
Create a new project
agentinit new myproject
On a terminal, a short interactive wizard asks for purpose, environment,
constraints, and commands. Use --yes to skip it, or --purpose "..." to
prefill non-interactively.
Flags:
--yes/-y— skip the interactive wizard--dir <path>— create the project under a different parent directory--force— overwrite agentinit files (including TODO/DECISIONS) if the directory already exists--minimal— create only core files (AGENTS.md, CLAUDE.md, docs/PROJECT.md, docs/CONVENTIONS.md)--purpose "<text>"— prefill Purpose non-interactively--prompt— force the interactive wizard (even if stdin is not a TTY)
Add to an existing project
cd your-project
agentinit init
Copies only missing template files. Safe to run multiple times (idempotent).
The interactive wizard runs by default on a terminal; pass --yes to skip it.
Flags:
--yes/-y— skip the interactive wizard--force— overwrite existing agentinit files (including TODO/DECISIONS)--minimal— create only core files (AGENTS.md, CLAUDE.md, docs/PROJECT.md, docs/CONVENTIONS.md)--purpose "<text>"— prefill Purpose non-interactively--prompt— force the interactive wizard (even if stdin is not a TTY)
Quick minimal scaffold
agentinit minimal
Shortcut for agentinit init --minimal. Accepts the same flags (--yes, --force, --purpose, --prompt).
Remove agentinit files
agentinit remove --dry-run # preview what would be removed
agentinit remove # remove with confirmation prompt
agentinit remove --archive # move to .agentinit-archive/ instead of deleting
agentinit remove --force # skip confirmation prompt
Generated files and maintenance tips
Source of truth
| File | Purpose |
|---|---|
AGENTS.md |
Primary router — all agents start here |
docs/PROJECT.md |
Project purpose, stack, commands, layout, constraints |
docs/CONVENTIONS.md |
Style, naming, testing, git workflow |
docs/TODO.md |
Active work (in progress / next / blocked / done) |
docs/DECISIONS.md |
ADR-lite decision log |
Tool-specific routers
| File | Tool |
|---|---|
CLAUDE.md |
Claude Code |
GEMINI.md |
Gemini CLI |
.github/copilot-instructions.md |
GitHub Copilot |
.cursor/rules/project.mdc |
Cursor |
Each router points to AGENTS.md → docs/*. Keep them short.
Keeping it healthy
- If guidance changes: update docs/ first, not router files.
- Keep router files under ~20 lines.
- Log durable decisions in
docs/DECISIONS.md(date · decision · rationale · alternatives). - Use
docs/TODO.mdas the "current state" so new sessions start with the right focus.
Manual setup (no CLI)
Copy into your repo root: AGENTS.md, CLAUDE.md, GEMINI.md, docs/, .github/, .cursor/ — then customize docs/* and commit.
Updating (pipx)
# From PyPI / GitHub (installed with pipx)
pipx upgrade agentinit
# From a Git install pinned to main
pipx install --force git+https://github.com/Lucenx9/agentinit.git@main
Color output
Output is colored by default on terminals. Color is automatically disabled when piping, redirecting, or in CI. You can also disable it explicitly:
NO_COLOR=1 agentinit init
Respects the NO_COLOR standard and TERM=dumb.
Development
pip install -e . --group dev
python3 -m pytest tests/ -v
Maintainers
Release
- Tags follow
vX.Y.Z(e.g.v0.2.0). - Tag a commit on
main, then publish a GitHub Release from the Releases UI.
Safe testing
Use git worktree to test changes in isolation:
git worktree add ../agentinit-test -b agentinit-test
cd ../agentinit-test
# test template changes
cd -
git worktree remove ../agentinit-test
git branch -D agentinit-test
Planned
agentinit status— show which files are present, missing, or still TBD;--checkfor CI--jsonoutput mode for scripting and CI pipelinesagentinit build— validate pointers, enforce line limits, and sanity-check structure
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.2.5.tar.gz.
File metadata
- Download URL: agentinit-0.2.5.tar.gz
- Upload date:
- Size: 18.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 |
bca8dff2f5fc81ff9aa74f73241ef7d5eca4e0c937c839528cb1e7163abfeb42
|
|
| MD5 |
1490846ee8a6163912f4a1771ca995e9
|
|
| BLAKE2b-256 |
831aa38904d765027582f24893c8b41c3ee7351155604c3b9ec4c199e5b654d3
|
Provenance
The following attestation bundles were made for agentinit-0.2.5.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.2.5.tar.gz -
Subject digest:
bca8dff2f5fc81ff9aa74f73241ef7d5eca4e0c937c839528cb1e7163abfeb42 - Sigstore transparency entry: 1004878133
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@e20468dc8ab1da99210b581cc3629a2a54bc399e -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e20468dc8ab1da99210b581cc3629a2a54bc399e -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentinit-0.2.5-py3-none-any.whl.
File metadata
- Download URL: agentinit-0.2.5-py3-none-any.whl
- Upload date:
- Size: 15.4 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 |
40f194febada2505bf98ed72e26b315a31c5e92760172c03ce3125d5c505a303
|
|
| MD5 |
54a0770292f7ebef69a5218fd673525f
|
|
| BLAKE2b-256 |
2e4cd7c6f0fd8efb423811e75752b5ac34f6d9862e4acf89fbd8a74a0a95e1cd
|
Provenance
The following attestation bundles were made for agentinit-0.2.5-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.2.5-py3-none-any.whl -
Subject digest:
40f194febada2505bf98ed72e26b315a31c5e92760172c03ce3125d5c505a303 - Sigstore transparency entry: 1004878135
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@e20468dc8ab1da99210b581cc3629a2a54bc399e -
Branch / Tag:
refs/tags/v0.2.5 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e20468dc8ab1da99210b581cc3629a2a54bc399e -
Trigger Event:
release
-
Statement type: