blade-code
AGENTS.md179 starsChanged 11 months agoMITView on GitHub
Always respond in Chinese. Blade Code is a modern AI-powered coding assistant with CLI + Web UI, built with React + Ink (CLI) and React + Vite (Web), using TypeScript. Each independent feature or fix must be released as a separate npm patch version. The docs site (docs/) is bilingual: Chinese is the default under the docs root and English lives under docs/en/. docs/changelog.md (zh) and docs/en/changelog.md (en) are build artifacts synced from CHANGELOG.zh.md and CHANGELOG.md by the Deploy Docs…
- Commits and pushes
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,736 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.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Always respond in Chinese.
- Distinctive: line 72
Use TypeBox schemas for tool parameters (not Zod)
- Very specific: line 84
Update both changelogs with the new version's changes (what was added/changed/fixed):
- Distinctive: line 87
Update related documentation if the feature affects user-facing behavior (docs/, README.md, AGENTS.md, etc.)
- Very specific: line 89
Commit and tag: git tag v<version>
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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
AGENTS.md
Always respond in Chinese.
Project Overview
Blade Code is a modern AI-powered coding assistant with CLI + Web UI, built with React + Ink (CLI) and React + Vite (Web), using TypeScript.
Quick Commands
# Development
bun run dev # Start CLI dev mode (watch)
bun run dev:web # Start CLI + Web server
bun run build # Build CLI
# Running
blade # Start interactive CLI
blade web # Start Web UI (opens browser)
blade serve # Start headless server
# Testing & Quality
bun run test:all # Run all tests
bun run lint # Run linter
bun run type-check # TypeScript type checkingArchitecture
Monorepo Structure
Blade/
├── packages/
│ ├── cli/ # blade-code - CLI core (npm package)
│ │ └── src/
│ │ ├── agent/ # Stateless Agent core
│ │ ├── tools/ # Tool system (builtin, execution, registry)
│ │ ├── server/ # Web server (Hono)
│ │ ├── mcp/ # MCP protocol support
│ │ ├── context/ # Context management
│ │ ├── config/ # Configuration management
│ │ ├── ui/ # Terminal UI (React + Ink)
│ │ ├── store/ # State management (Zustand)
│ │ ├── services/ # Service layer (Chat, Session, etc.)
│ │ ├── services/pi/ # pi-ai runtime adapter
│ │ ├── schema/ # TypeBox runtime wrapper
│ │ ├── commands/ # CLI subcommands (serve, web, mcp, etc.)
│ │ ├── prompts/ # Prompt templates
│ │ ├── slash-commands/ # Slash commands
│ │ ├── skills/ # Skills system
│ │ ├── hooks/ # Hooks system
│ │ └── blade.tsx # Entry point
│ └── vscode/ # blade-vscode - VSCode extension
├── docs/ # User documentation (Docsify)
└── .blade/ # Project-level configKey Design Principles
- Stateless Agent: Agent doesn't store session state; all state passed via context
- Tool System: Unified tool registration, execution, and validation with TypeBox schemas
- Permission Control: Three-level permission system (allow/ask/deny)
- Session Management: Multi-session support with resume and fork capabilities
- pi-ai Runtime: Single LLM abstraction layer; model metadata from catalog, not hardcoded
Code Style
- TypeScript strict mode
- Biome for linting and formatting (single quotes, semicolons, 88 char line width)
- Avoid
anytype - Use TypeBox schemas for tool parameters (not Zod)
Testing
- Test framework: Vitest
- Tests location:
packages/cli/tests/ - Run tests:
bun run test:all - Integration tests must use real API calls, no mocks
Release Process
- Bump version in
packages/cli/package.json - Update both changelogs with the new version's changes (what was added/changed/fixed):
CHANGELOG.md(English, authoritative source consumed by npm/VersionChecker)CHANGELOG.zh.md(Chinese, kept in sync manually with the same version headings)
- Update related documentation if the feature affects user-facing behavior (docs/, README.md, AGENTS.md, etc.)
- Build and run full test suite:
bun run build && bun run test:all - Commit and tag:
git tag v<version> - Push tag:
git push origin v<version> - GitHub Actions (
publish.yml) automatically publishes to npm and creates GitHub Release - Verify:
npm view blade-code version
Each independent feature or fix must be released as a separate npm patch version.
The docs site (docs/) is bilingual: Chinese is the default under the docs root
and English lives under docs/en/. docs/changelog.md (zh) and
docs/en/changelog.md (en) are build artifacts synced from CHANGELOG.zh.md
and CHANGELOG.md by the Deploy Docs workflow — do not edit them directly.
Documentation
- User docs:
docs/ - README.md - Project overview
- CONTRIBUTING.md - Contribution guide
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.

