Introduction
Coding agents such as Claude Code, Codex and Cursor work best when they know a project's own functions, types and rules. KScript writes docs for them from your code, so the docs say what your functions really take and return. They stay short, so an agent can read them in full every time.
To get started, run kscript agents in a project:
| Command | What it does |
|---|---|
kscript agents | Write AGENTS.md and .kscript/agents. |
kscript make project (and --bare) writes them for you. After that, they keep themselves up to date. The editor rewrites .kscript/agents and AGENTS.md each time you save a script, and kscript serve and kscript watch do the same whenever a file changes, so edits made anywhere (another editor, a coding agent, git pull) are picked up too.
For an assistant that reads the KScript docs themselves, see AI assistants (MCP).
Checking and printing
--check writes nothing, and fails when the docs are out of date, which suits CI. --print shows the generated part of AGENTS.md:
| Command | What it does |
|---|---|
kscript agents --check | Write nothing; fail if they are out of date (for CI) |
kscript agents --print | Print AGENTS.md's generated part. |