Skip to main content

Scaffold agent context files into a project.

Project description

agentinit

CI PyPI Python Versions

agentinit preview

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

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 --ignored to see if your .gitignore is 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.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>. Update docs/STATE.md and docs/TODO.md to 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 for init --minimal.
  • agentinit refresh-llms โ€” Regenerate llms.txt in 1 second (refresh alias 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 in docs/* (and keep original summary in llms.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.txt ensures 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


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.5.tar.gz (58.0 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.5-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentinit-0.3.5.tar.gz
  • Upload date:
  • Size: 58.0 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.5.tar.gz
Algorithm Hash digest
SHA256 fd7e220152e9253209a13619f9d14e907a43814f958d8b6802479b953002fecc
MD5 6791876e010a3315b51f9afc0c0b4e43
BLAKE2b-256 ba32b80d7fedbce28c3f4eca895eeed723b3488e235555b4f987008574e535fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentinit-0.3.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: agentinit-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 53.2 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8a25f912089f0b8a52001181273665eda9f37e7601df85375ecd84d1c29eedaf
MD5 f551d8ef1ba29341421ba4671af0831c
BLAKE2b-256 3c704e9c54167b390e5bacee1f23f96740195cb87cb716e5171d8773bad7f44f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentinit-0.3.5-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