agentleFS
KyuuKyuuStoneKyuuKyuuStone/claude-code-heihei/AGENTS.md

claude-code-heihei

AGENTS.md5 starsChanged 3 months agoMITView on GitHub

This file is the entry point for coding agents. Keep it short: it should route an agent to the right code, tests, and deeper documentation rather than duplicate them. Rules closer to the code take precedence. Before editing .github/, src/, desktop/, adapters/, or docs/, read the nested AGENTS.md in that directory. Additional invariants:

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 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 repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

11 rules. About 0 are common, 4 are distinctive, and 7 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.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run git status --short before editing.

    line 9
  2. Distinctive:

    Prefer existing utilities, stores, services, and test harnesses.

    line 28
  3. Very specific:

    Keep TypeScript ESM style: 2-space indentation, no semicolons, PascalCase components, and camelCase functions/hooks/stores.

    line 30
  4. Distinctive:

    Use structured parsers and existing boundaries instead of ad hoc string manipulation.

    line 31
  5. Very specific:

    Do not commit generated output such as artifacts/, coverage reports, node_modules/, build directories, or Rust target/ trees.

    line 32
  6. Very specific:

    When publishing is explicitly requested, use Conventional Commit subjects and normal product branch prefixes such as fix/, feat/, or docs/.

    line 33
  7. Distinctive:

    Run the narrowest relevant test while iterating.

    line 37
  8. Very specific:

    Run bun run check:impact; every command it selects is part of the minimum handoff for the current diff.

    line 38
  9. Very specific:

    Run bun run verify only when full validation is requested or before claiming a code change is PR-ready or push-ready.

    line 39
  10. Very specific:

    Never use or mutate the developer's real ~/.claude, keychain, tokens, transcripts, providers, or project settings in tests.

    line 52
  11. Very specific:

    Treat ~/.claude/settings.json as user-owned shared state: preserve unknown fields, merge additively, and never add a repository-owned …

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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

Repository Instructions

This file is the entry point for coding agents. Keep it short: it should route an agent to the right code, tests, and deeper documentation rather than duplicate them.

Rules closer to the code take precedence. Before editing .github/, src/, desktop/, adapters/, or docs/, read the nested AGENTS.md in that directory.

Start Here

  • Run git status --short before editing. Preserve all existing user changes and never revert, restage, reformat, or overwrite unrelated work.
  • Identify the affected surface and inspect its production path, nearest tests, and existing implementation pattern before proposing a change. Check recent history when regression context matters.
  • For bugs, reproduce the failure or add a regression test that fails for the intended reason. If reproduction is impossible, state the limitation instead of guessing.
  • Define the smallest behavior change and the proof that will demonstrate it. Stop and re-scope if the diff crosses an unplanned surface, adds a dependency, or grows beyond the verified seam.
  • For broad investigation, parallel read-only subagents are encouraged. Give editing agents non-overlapping file ownership; the primary agent owns integration and final verification.
  • Tool access is capability, not authorization. Do not create/switch branches, commit, push, open or merge a PR, publish a release, change repository settings, or spend live-provider quota unless the user explicitly requests that operation.

Repository Map

  • src/: CLI, Ink UI, commands, services, tools, shared runtime utilities, and the local API/WebSocket server.
  • desktop/: React desktop UI, Electron host, native/sidecar resources, and desktop build scripts.
  • adapters/: Telegram, Feishu, WeChat, DingTalk, and shared IM adapter utilities.
  • site/: React documentation site and build tooling. docs/ and docs/en/ are its Chinese and English Markdown content sources; keep counterparts aligned when both exist.
  • .github/workflows/, scripts/pr/, and scripts/quality-gate/: CI routing and quality policy.
  • release-notes/, scripts/release.ts, and .github/workflows/release-desktop.yml: desktop release automation.

Implementation Rules

  • Make narrow, owned diffs. Every changed line must trace to the request, a failing test, or a verified compatibility constraint.
  • Prefer existing utilities, stores, services, and test harnesses. Do not add dependencies or speculative abstractions unless the task requires them.
  • Production changes under src/, desktop/src/, or adapters/ require a same-area regression test unless a maintainer explicitly approves an exception.
  • Keep TypeScript ESM style: 2-space indentation, no semicolons, PascalCase components, and camelCase functions/hooks/stores.
  • Use structured parsers and existing boundaries instead of ad hoc string manipulation. Add comments only for non-obvious control flow or external constraints.
  • Do not commit generated output such as artifacts/, coverage reports, node_modules/, build directories, or Rust target/ trees.
  • When publishing is explicitly requested, use Conventional Commit subjects and normal product branch prefixes such as fix/, feat/, or docs/; do not create codex/ branches in this repository.

Verification

  1. Run the narrowest relevant test while iterating.
  2. Run bun run check:impact; every command it selects is part of the minimum handoff for the current diff.
  3. Run bun run verify only when full validation is requested or before claiming a code change is PR-ready or push-ready.

Additional invariants:

  • Required PR checks must be deterministic and work on an untrusted fork: no real models, public network, repository secrets, saved providers, or real user home/config. Use fake credentials, fixtures, mocked/loopback transports, temporary directories, and explicit cleanup.
  • Provider/auth/proxy/runtime changes may select bun run check:provider-contract; desktop chat/WebSocket/session changes may select bun run check:chat-contract. These contracts are offline and do not replace their selected surface checks.
  • Any persisted JSON, localStorage, or app-config shape change requires a forward migration, an old-fixture regression test, and bun run check:persistence-upgrade.
  • User-visible desktop or cross-process behavior needs an actual browser/desktop smoke path when unit tests cannot prove the workflow.
  • Live model checks are separate maintainer evidence. Run them only after deterministic checks pass and a maintainer explicitly authorizes quota use; finding credentials on the machine is not authorization.
  • bun run check:docs runs npm ci; run it sequentially with checks that rely on root node_modules.

User-State Safety

  • Never use or mutate the developer's real ~/.claude, keychain, tokens, transcripts, providers, or project settings in tests. Redirect every relevant path to a temporary directory.
  • Treat ~/.claude/settings.json as user-owned shared state: preserve unknown fields, merge additively, and never add a repository-owned global schema marker.
  • Repair/Doctor flows are deny-by-default. They may automatically change only explicitly allowlisted, regenerable desktop UI state; protected user data requires a reviewed, backup-first manual flow.

Handoff

  • Review git diff --check, git diff, and git status --short before reporting completion.
  • Report only evidence from the current worktree: changed files, tests added, commands actually run and their observed results, checks not run, blockers, and remaining risk.
  • passed, failed, skipped, blocked, and not run are different states. A build is not E2E, a mock is not live-provider evidence, and an older report becomes stale after relevant edits.

Deeper Guides

  • Contributor workflow and quality lanes: CONTRIBUTING.md and docs/internals/contributing.md
  • Package scripts and path routing: package.json and scripts/pr/change-policy.ts
  • PR evidence contract: .github/pull_request_template.md
  • Desktop release and auto-update runbook: docs/desktop/10-release-auto-update.md

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.