autopilot
AGENTS.md176 starsChanged 2 months agoMITView on GitHub
Project context for coding agents. Refreshed 2026-10-01. Autopilot (autopilot-ai, formerly KimiFlare) is a TypeScript terminal coding agent. OpenRouter with the user's own key is the default provider, and the model picker uses OpenRouter's live catalog; custom OpenAI-compatible endpoints and a Requesty fallback are also supported. Do not assume the old Cloudflare AI Gateway / Workers AI architecture still applies. Run a focused test with npx tsx --test src/path/to/file.test.ts. Tests use node:test and node:assert; there is no Jest/Vitest setup.
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- docs/llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 25
Run a focused test with npx tsx --test src/path/to/file.test.ts.
- Distinctive: line 49
Keep the project ESM-only.
- Distinctive: line 51
Prefer async/await; use type-only imports (import type) when appropriate.
- Very specific: line 52
When adding a tool, define its schema/implementation and register it in ALL_TOOLS in src/tools/executor.ts.
- Very specific: line 54
Keep ink, ink-text-input, ink-spinner, ink-select-input, react, commander, turndown, and camouflage-tui external in the root tsup.config.ts.
- Distinctive: line 56
Run npm run typecheck before considering a change complete.
- Distinctive: line 57
Use Conventional Commits. Do not bump the root package version manually.
- Very specific: line 58
Never commit secrets or user state.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Autopilot — Project Instructions
Project context for coding agents. Refreshed 2026-10-01.
Project
Autopilot (autopilot-ai, formerly KimiFlare) is a TypeScript terminal coding agent. OpenRouter with the user's own key is the default provider, and the model picker uses OpenRouter's live catalog; custom OpenAI-compatible endpoints and a Requesty fallback are also supported. Do not assume the old Cloudflare AI Gateway / Workers AI architecture still applies.
- Node.js 20 or newer; TypeScript 5.7; ESM.
- Interactive terminal UI plus one-shot print and JSON-RPC/SDK modes.
- Main package: autopilot-ai; license: MIT.
Build, test, run
| Command | Purpose |
| npm install | Install dependencies |
| npm run dev | Run the CLI from src/index.tsx |
| npm run build | Bundle CLI and SDK with tsup into dist/ |
| npm run typecheck | Type-check with tsc --noEmit |
| npm test | Run co-located tests with Node's test runner through tsx |
| npm start | Run the built CLI |
| npm run build:remote | Build the separate remote/agent project |
Run a focused test with npx tsx --test src/path/to/file.test.ts. Tests use node:test and node:assert; there is no Jest/Vitest setup.
Repository map
- src/index.tsx — Commander CLI entry point and mode/command routing.
- src/app.tsx, src/ui/ — interactive app state and terminal UI components.
- src/agent/ — OpenRouter client, streaming/tool-call turn loop, prompts, session and supervisor logic.
- src/models/ — OpenRouter model catalog, capabilities, and pricing; live catalog is authoritative, with seed data as offline fallback.
- src/tools/ — tool schemas, implementations, permissions, output reduction, and dispatch (executor.ts).
- src/init/ — /init project discovery and AGENTS.md prompt generation.
- src/skills/ — skill discovery/routing; supports .agents/skills/, AGENTS.md, .github/skills/, and .kimiflare/skills/.
- src/memory/ — local SQLite-backed cross-session memory and retrieval. The repository-scoped database defaults to .kimiflare/memory.db (configurable); memory tools expose remember, recall, and forget.
- src/lsp/, src/mcp/ — Language Server Protocol and Model Context Protocol integrations.
- src/sdk/, src/server/ — programmatic session SDK and RPC/server integration.
- src/runs/, src/jobs/ — durable run/job lifecycle and unattended execution.
- src/code-mode/ — generated TypeScript tool execution and sandboxing.
- src/hooks/, src/intent/, src/cost-attribution/, src/util/ — lifecycle hooks, intent routing, cost reporting, and shared utilities.
- src/remote/ — remote command implementation; remote/agent/ is a separate package.
- acp/ — standalone Zed Agent Client Protocol package.
- feedback-worker/ — separate feedback service; docs/ and functions/ support the GitHub Pages site.
- bin/ — published CLI shims; dist/ is generated output.
Conventions and guardrails
- Keep the project ESM-only. Use import/export, node: prefixes for built-ins, and .js extensions in relative TypeScript imports.
- TypeScript is strict (noUncheckedIndexedAccess, noImplicitOverride, isolatedModules). Keep tests co-located as *.test.ts / *.test.tsx.
- Prefer async/await; use type-only imports (import type) when appropriate.
- When adding a tool, define its schema/implementation and register it in ALL_TOOLS in src/tools/executor.ts; cover behavior with a co-located test.
- Pass and respect AbortSignal for long-running work, especially requests and streams.
- Keep ink, ink-text-input, ink-spinner, ink-select-input, react, commander, turndown, and camouflage-tui external in the root tsup.config.ts; do not accidentally bundle runtime UI dependencies.
- isolated-vm and camouflage-tui are optional dependencies; preserve their graceful/intentional fallback behavior.
- Run npm run typecheck before considering a change complete. Add or update tests for behavior changes.
- Use Conventional Commits. Do not bump the root package version manually; release-please manages releases. The active workflows publish npm releases and deploy docs/ to GitHub Pages.
- Never commit secrets or user state. .kimiflare/, ~, .config/, sessions/, and coverage output are ignored; config and historical user data remain under the legacy kimiflare paths for compatibility.
Context file behavior
/init creates AGENTS.md when no supported project context file exists. It refreshes an existing AGENTS.md first, or otherwise preserves and refreshes legacy KIMI.md, KIMIFLARE.md, or AGENT.md in place. The system prompt loads AGENTS.md before those legacy names. Keep this file focused on stable project facts and actionable conventions; verify claims against the source when they may have changed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

