Size guidance for multibyte languages: CJK text gets ~1/3 the effective budget under byte-based truncation

Aperta Adatta ai principianti
#249 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
documentation

Direzione di ricerca

Leggi il README e le indicazioni attuali sulle dimensioni per il formato AGENTS.md, quindi confronta la formulazione con i limiti di byte, righe e token descritti in questa issue. Il lavoro è completato quando la documentazione spiega chiaramente in che modo i contenuti nelle lingue multibyte influiscono sui limiti effettivi delle dimensioni, se il progetto accetta la proposta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

First, thanks for maintaining the spec — the "README for agents" framing has aged well.

What we ran into

Several agent tools in our stack truncate instruction files at a fixed byte budget (we've seen ~32 KiB in practice). For English text that's roughly 32,000 characters. For Chinese text — 3 bytes per character in UTF-8 — the same wall lands at ~10,900 characters. A Chinese AGENTS.md effectively gets one third of the budget an English one does, and it's easy to hit the wall without noticing, because the file still looks short.

Line-based rules of thumb distort similarly. Cursor's guidance suggests keeping rule files under 500 lines; CJK prose carries more information per line, so a 150-line Chinese file can cost more tokens than a 300-line English one.

What we do about it

In our own template repo we lint instruction files against three walls instead of one:

  • bytes (32 KiB) — the truncation wall tools actually enforce
  • lines (500) — readability for humans
  • estimated tokens (8,192) — what the model actually pays

plus a density note: when CJK characters exceed ~15% of a file, the checker warns that byte-based limits will bind earlier than they look.

Question

Is byte/token-aware size guidance for multibyte-language projects something the spec would consider addressing — even one sentence? Right now "keep it small" quietly means different things depending on the language you write in.

Disclosure: I maintain wallaby-agent-rules, an AGENTS.md template with a three-tier memory convention and the health-check script described above. Happy to share more measurement detail if useful.

Lingua principale
TypeScript
Stelle
24.8k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di agentsmd/agents.md

Tutte le issue di agentsmd/agents.md

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.