Scaffold agent context files into a project.
Project description
agentinit
Scaffold hardened, router-first context files so your AI coding agents stop guessing and start delivering.
Pure Python standard library. No runtime dependencies. Generates 2026-ready manifests for Claude Code, Cursor, Copilot, and Gemini CLI. llms.txt also provides discovery-friendly routing for other tools (for example, Windsurf).
llms.txt now includes auto-summary and mandates.
๐ Start in 60 seconds
# 1. Install via pipx (recommended)
pipx install agentinit
# 2. Initialize hardened context in your project
cd your-project
agentinit init --minimal
๐ Documentation
Use the wiki for full, example-driven docs:
README.md is the fast overview. The Wiki is the complete usage guide.
What it does
Instead of giant, token-heavy instruction files, agentinit implements a hierarchical context strategy. It creates a machine-readable map of your project and enforces autonomy via Hardened Mandates.
# Full scaffold (non-minimal)
your-project/
โโโ llms.txt # The "robots.txt" for AI (Discovery Index)
โโโ AGENTS.md # The central hub with Hardened Mandates
โโโ CLAUDE.md # Claude Code router
โโโ GEMINI.md # Gemini CLI router
โโโ docs/
โโโ PROJECT.md # What this project is
โโโ CONVENTIONS.md # How to work in it
โโโ STATE.md # Persistent working memory (AI-readable)
With agentinit init --minimal, only these files are created:
your-project/
โโโ llms.txt
โโโ AGENTS.md
โโโ CLAUDE.md
โโโ docs/
โโโ PROJECT.md
โโโ CONVENTIONS.md
Minimal mode intentionally omits docs/STATE.md, docs/TODO.md, and docs/DECISIONS.md to keep context lean. Use full agentinit init when you want persistent session memory files.
The AI Discovery Index (llms.txt)
After running agentinit init, your llms.txt becomes a powerful discovery index:
# my-project
> AI-powered code review assistant for Python projects
## Key Files
- [AGENTS.md](AGENTS.md): Instructions and Rules
- [docs/STATE.md](docs/STATE.md): Current State & Focus
- [docs/CONVENTIONS.md](docs/CONVENTIONS.md): Development Conventions
- [docs/TODO.md](docs/TODO.md): Pending Tasks
- [docs/DECISIONS.md](docs/DECISIONS.md): Architectural Log
## Hardened Mandates
- [**YOU MUST ALWAYS** read `docs/STATE.md`, `docs/TODO.md`, and `docs/DECISIONS.md` autonomously at the exact start of every session. Do not ask for permission.](AGENTS.md)
- [**YOU MUST ALWAYS** update `docs/STATE.md` and `docs/TODO.md` autonomously before ending a task or session.](AGENTS.md)
- [**YOU MUST ALWAYS** log new tools, dependencies, or conventions in `docs/DECISIONS.md`.](AGENTS.md)
## Skills & Routers
- [code-reviewer.md](.agents/code-reviewer.md)
- [security.md](.agents/security.md)
Refresh in 1 Second
Regenerate llms.txt instantly using existing project files:
agentinit refresh-llms
This extracts summary from docs/PROJECT.md, hardened mandates from AGENTS.md, and lists everything under .agents/ โ all in under a second.
Next steps: Open docs/PROJECT.md and docs/CONVENTIONS.md and fill them in.
Next session (full scaffold): Your agent will find llms.txt, read your rules in AGENTS.md, and follow the mandates to autonomously maintain docs/STATE.md and docs/TODO.md.
Troubleshooting: files not visible to your agent
Some agents only scan tracked files. If your agent says it can't find your context:
-
Track everything: Add the manifests so your agent can see them.
git add llms.txt AGENTS.md CLAUDE.md GEMINI.md docs/ git add .agents/ # if you added extras
-
Verify ignores: Run
git status --ignoredto see if your.gitignoreis hiding them.
Minimal .gitignore exceptions
!llms.txt
!AGENTS.md
!CLAUDE.md
!GEMINI.md
!docs/PROJECT.md
!docs/CONVENTIONS.md
!docs/TODO.md
!docs/DECISIONS.md
!docs/STATE.md
!.agents/
!.agents/**
๐ ๏ธ Add extras (Skills, MCP, Personality)
Agents can do more than just read conventions. Inject modular, hardened resources directly into your project.
# View available resources by type
agentinit add skill --list
agentinit add mcp --list
# Add specific capabilities
agentinit add skill code-reviewer
agentinit add security
agentinit add soul "YourAgentName"
Resources in .agents/ are automatically linked in AGENTS.md and use Imperative Mandates (MUST ALWAYS, MUST NEVER) to ensure compliance and zero-sycophancy.
๐ฆ Keep your context clean (Status & CI)
Token limits matter. agentinit includes a validator to prevent context bloat, broken links, and missing information.
# View line budgets, broken references, and missing details
agentinit status
# Perfect for CI (exits non-zero on violations)
agentinit status --check
๐ค AI Prompt: Fill the docs fast
After running agentinit init, paste this 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>. Updatedocs/STATE.mdanddocs/TODO.mdto reflect our current progress. Do not modify any other files.
๐ Advanced Usage & Commands
Core Commands
agentinit initโ Add missing files to an existing directory.agentinit minimalโ Shortcut forinit --minimal.agentinit refresh-llmsโ Regenerate llms.txt in 1 second (refreshalias also available).agentinit statusโ Check health, line budgets, and broken links.agentinit add <type> <name>โ Add modular resources (skills, mcp, security, soul).agentinit new <project>โ Create a new directory and scaffold files.agentinit removeโ Safely remove or archive agent files.
Common Flags
--detectโ Auto-detect stack and commands from package files (e.g.,package.json,pyproject.toml).--yes/-yโ Runs non-interactively and skips the wizard.--purpose "<text>"โ Prefill the project purpose non-interactively.--translate-purposeโ Translate non-English purpose text to English indocs/*(and keep original summary inllms.txt).--skeleton fastapiโ Copy a minimal FastAPI + SQLite boilerplate (pyproject.toml,main.py, tests) after context files.
Examples
# Existing repo: detect + auto-translate purpose into English docs
agentinit init --detect --purpose "Una semplice API REST per gestire todo list con FastAPI + SQLite"
# Force translation even without detect
agentinit init --purpose "Une API REST simple pour gerer une liste de taches" --translate-purpose
# New project with context files + FastAPI starter skeleton
agentinit new demo-fastapi --detect --purpose "Modern FastAPI API with SQLite" --skeleton fastapi
๐ก Why Hardened Context?
- Agent Autonomy: Explicit mandates (
YOU MUST ALWAYS read state.md) transform the agent from a chatbot into a disciplined project maintainer. - AI-Discovery Index:
llms.txtensures any tool (Cursor, Windsurf, Claude) immediately understands your project map. - Progressive Disclosure: Keeps the context window high-signal by loading deep details only when relevant.
- Zero Sycophancy: Mandates force the agent to skip "I'd be happy to help!" and jump straight to the technical solution.
โ๏ธ Installation & Development
Requires Python 3.10+.
# Install (pipx is recommended)
pipx install agentinit
# Update
pipx upgrade agentinit
Development
pip install -e . --group dev
python3 -m ruff check agentinit tests cli
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.6.tar.gz.
File metadata
- Download URL: agentinit-0.3.6.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
833d7d4328bf3a1e7198958b25eb843cd0320a26cbde8db2c0aa06fdcc52e76d
|
|
| MD5 |
8619cede3beee8a3f56af3cfce86a3e6
|
|
| BLAKE2b-256 |
0bafc66ad6acf99ba0b5f2688a0b484f921c31ee6f5dca89cf87746d95d8abc9
|
Provenance
The following attestation bundles were made for agentinit-0.3.6.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.6.tar.gz -
Subject digest:
833d7d4328bf3a1e7198958b25eb843cd0320a26cbde8db2c0aa06fdcc52e76d - Sigstore transparency entry: 1041696469
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@57c863543313c97b194c38e6a1ca81c611f39fcb -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57c863543313c97b194c38e6a1ca81c611f39fcb -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentinit-0.3.6-py3-none-any.whl.
File metadata
- Download URL: agentinit-0.3.6-py3-none-any.whl
- Upload date:
- Size: 53.3 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 |
d56246f7747a9fa0b604a65999e1efac6016bf1847450ad36b6553faad3e5541
|
|
| MD5 |
9fa649618492fd713732ae5152e5ec36
|
|
| BLAKE2b-256 |
389c08a0312e17b57328f9e643c26c1d874547b530bcfaec508bcf63e04a1a7a
|
Provenance
The following attestation bundles were made for agentinit-0.3.6-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.6-py3-none-any.whl -
Subject digest:
d56246f7747a9fa0b604a65999e1efac6016bf1847450ad36b6553faad3e5541 - Sigstore transparency entry: 1041696512
- Sigstore integration time:
-
Permalink:
Lucenx9/agentinit@57c863543313c97b194c38e6a1ca81c611f39fcb -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/Lucenx9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57c863543313c97b194c38e6a1ca81c611f39fcb -
Trigger Event:
release
-
Statement type: