AGENTS.md
Single source of truth for Agent identity, code standards, and project rules. Symbolinked by CLAUDE.md, and GEMINI.md, only edit AGENTS.md when needed.
Identity & Communication
- Role: An expert coding assistant.
- Language:
- Chat: User's language (Use Chinese if user uses Chinese).
- Code/Comments: English ONLY.
- Docs: See Multi-language Docs Section.
- Style: Concise, technical, action-oriented.
Code Standards
- General:
- Comments explain why, not what. Update docs when logic changes.
- If you community has a mature and modern library for a specific feature, use it instead of implementing it yourself.
- Internal helper functions must not silently acquire environment capability through optional/default fallbacks unless the API explicitly documents that behavior. Require callers to pass capability dependencies explicitly, or model absence with an explicit
null | undefinedvalue when "not available" is the intended state. - Do NOT automatically create git commits. Leave staging and committing to the user or explicitly ask for permission first.
- YAML: 2-space indent, quote only when necessary.
- Bash:
set -e,[[ ]]not[ ], quote variables. - Docs:docs should reflect current project status or futures plans, historical changes should be placed at CHANGELOG.md not in
docsfolder.
Project Rules
File Organization
- Docs:
README.md->docs/ - Docs Site:
docsite/is the VitePress source root. Keep source content indocs/en,docs/zh, and root docs; maintain Git-compatible relative symlinks intodocsite/viadocsite/scripts/fix-docsite-symlink.ts. Do not copy source docs or restore adocsite/.staged/pipeline. The custom domain issecuritydept.ethaxon.comwith VitePressbase: "/". Docs site build/verification is independent from the main app build and should usejust build-docs. - Data:
data/ - Temp:
temp/if agents need to create temp files, please use temp folder
Tools Preferences & Workflows
- Toolchains:
mise(env),pnpm(Node config),rust-toolchain.toml/cargo(Rust). - Environment must match
mise: before running Node / pnpm / Rust verification, use the tool versions declared inmise.toml. Do NOT rely on the host shell's fallback toolchain when it differs frommise current. If command results may be version-sensitive, treat non-miseruns as non-authoritative and rerun under themiseenvironment before making review or release judgments. - Task Runner: Use
justfor actions (build,test,lint,format);.envis auto-loaded. - Release authority: treat
securitydept-metadata.tomlandscripts/release-cli.tsas the only release authority. Allowed project versions areX.Y.Z,X.Y.Z-alpha.N, andX.Y.Z-beta.N; channel aliases are inferred automatically (alpha -> nightly,beta -> rc, stable ->latest, with stable container images also taggingrelease).release-cli version check/setalso owns publishable Cargopathdependency version requirements, not only manifest package versions.release-cli metadata syncowns shared publish metadata for publishable Rust crates and npm packages, including descriptions, authors, keywords, repository links, and minimal package READMEs. Usejust release-*orrelease-cli ...instead of re-encoding release tags in scripts or workflows. Local blocked crate packaging may add--allow-dirty; publish flows should not. Seedocs/en/008-RELEASE_AUTOMATION.md/docs/zh/008-RELEASE_AUTOMATION.md. - Iteration Close-Out: After each complete iteration, run formatting first, then verify the codebase is still healthy. At minimum, do
lint-fix/format, re-runlint, and confirm relevanttypecheck,build, andtestcommands pass. This is required so style drift and broken imports are caught in the same iteration instead of leaking into the next one. - TypeScript:
- Manage via
tsconfig.jsonreferences. - Use
bundlerresolution (prefer extensionless imports without.jssuffixes if not necessary). - Use
@standard-schemafor validation; avoid binding to specific libs likezod. - Keep short, single-use internal helper functions inline when extraction only adds navigation overhead; extract helpers when they are reused, materially clarify a complex block, or define a stable boundary.
- For enum-like string domains, prefer
export const Foo = { ... } as const+export type Foo = (typeof Foo)[keyof typeof Foo]. - For public contracts and repeated telemetry vocabulary, extract named constants instead of scattering raw strings.
- Keep production SDK output within the ES2022 runtime boundary. Node 26 tests may use
using/await usingfor lexically ownedDisposableTraitvalues, but this test convenience must not raise adopter runtime requirements. - In tests, prefer lexical
usingownership over manual cleanup. Explicit disposal is reserved for documented lifecycle-under-test cases; behavior after disposal is undefined and must not be tested or documented. - Disposal sequencing may be required internally to prevent
EmptyError, cancellation cascades, or error amplification. Preserve that implementation invariant, but do not expose the exact EventStream/RxJS emit/complete/unsubscribe order as an exported or documented public contract; tests should assert required outcomes rather than internal sequencing. - TS SDK API shape — options object first: public functions use an
optionsobject for optional params; positional second args only when self-evident and uniquely ergonomic. Widening an API converts the whole second arg to options even if it's a breaking change. See TypeScript SDK Coding Standards for the full decision rationale.
- Manage via
- Web UI Stack: TS + Vite + React +
@tanstack/react-*+ TailwindCSS + shadcn/ui. - Server Stack: Rust + axum + openconnectid + serde + snafu + tracing.
Multi-language Docs
Directory Structure:
- English docs:
docs/{lang}/00x-TITLE.md(e.g.,docs/en/00x-TITLE.md)
Rules:
- Translate user-facing docs only (README, docs/00x-*.md); do NOT translate machine-oriented docs (AGENTS.md, CLAUDE.md, etc.)
- Each doc should have bidirectional language links at the bottom:
[English](../en/xxx.md) | [中文](xxx.md)(in Chinese docs) or[English](xxx.md) | [中文](../zh/xxx.md)(in English docs) - Non-English docs must link to other docs in the same language folder when available (e.g.,
docs/zh/links point todocs/zh/) - For future languages, create
docs/{lang}/folder and follow the same pattern (e.g.,docs/es/,docs/ja/)
Current languages:
- English:
docs/en/00x-TITLE.md - Chinese:
docs/zh/00x-TITLE.md