Skip to main content

Scaffold agent context files into a project.

Project description

agentinit

CI PyPI Python Versions

agentinit preview

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 --yes to 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.md and docs/CONVENTIONS.md using 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, write TODO: <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).

Check project status

agentinit status

Shows which agent context files are present, missing, or still need to be filled in (contain 'TBD').

Flags:

  • --check — exit with code 1 if files are missing or incomplete (useful for CI pipelines)
  • --minimal — check only the core minimal files

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.mddocs/*. 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.md as 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

  • --json output mode for scripting and CI pipelines
  • agentinit build — validate pointers, enforce line limits, and sanity-check structure

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.2.6.tar.gz (20.7 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.2.6-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentinit-0.2.6.tar.gz
Algorithm Hash digest
SHA256 e5a08d809c7e3c6f4079052af06ce47681bc9336e817a821dcbda91816abd964
MD5 419a23d3ba2517972d5c4e35032c4809
BLAKE2b-256 e3d2a8266110f4dca93023e9e1e4f95d61520c8c3e42543056f35ccd2fc2d048

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: agentinit-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 16.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.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2229f15a82929b0a2510c38b5a2bc4d12dc4654b33046d0909fc1e569406dfdd
MD5 134c63743628bc7e81c761fff300d8bb
BLAKE2b-256 7d8b21d6b3eb9651392d76c68d7990750807a347ab0d33dabda1a2e57749033a

See more details on using hashes here.

Provenance

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