agentleFS
echoVicechoVic/blade-code/AGENTS.md

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
  1. Distinctive:

    Always respond in Chinese.

    line 3
  2. Distinctive:

    Use TypeBox schemas for tool parameters (not Zod)

    line 72
  3. Very specific:

    Update both changelogs with the new version's changes (what was added/changed/fixed):

    line 84
  4. Distinctive:

    Update related documentation if the feature affects user-facing behavior (docs/, README.md, AGENTS.md, etc.)

    line 87
  5. Very specific:

    Commit and tag: git tag v<version>

    line 89

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 checking

Architecture

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 config

Key Design Principles

  1. Stateless Agent: Agent doesn't store session state; all state passed via context
  2. Tool System: Unified tool registration, execution, and validation with TypeBox schemas
  3. Permission Control: Three-level permission system (allow/ask/deny)
  4. Session Management: Multi-session support with resume and fork capabilities
  5. 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 any type
  • 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

  1. Bump version in packages/cli/package.json
  2. 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)
  3. Update related documentation if the feature affects user-facing behavior (docs/, README.md, AGENTS.md, etc.)
  4. Build and run full test suite: bun run build && bun run test:all
  5. Commit and tag: git tag v<version>
  6. Push tag: git push origin v<version>
  7. GitHub Actions (publish.yml) automatically publishes to npm and creates GitHub Release
  8. 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.