kiritan
Skill3 starsChanged 50 days agoMITView on GitHub
Helps write and maintain Kiritan-based i18n — editing base/*.base.md files with :::kiritan{...} directives, choosing the sidecar/inline/catalog document strategy or the colocated/split/centralized/embedded runtime strategy, running kiritan init/build/check/translate/extract/typegen, and avoiding common mistakes such as hand-editing generated output. Use when a repo has a *.kiritanconfig config file, a base/ directory of *.base.md sources, or generated docs carrying a `<!-- kiritan:untranslated -->` / `<!-- kiritan:hash ... -->` marker — or when asked to localize a README/doc, add or fix a translation, or resolve a `kiritan check` failure.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- otnc/agent-skillsword for word, first seen Sep 27, 2026
- otnc/skills_fix-unnatural-line-breaksword for word, first seen Sep 27, 2026
Other versions2 projects use a version of this.
Word for word · 2
- otnc/skills_fix-unnatural-line-breaks★ 4100% same
- otnc/agent-skills★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- token-saver-claude-codeSkill
- token-saver-codexSkill
- token-saver-copilotSkill
- token-saver-cursorSkill
- token-saver-opencodeSkill
- token-saverSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Look for any of:
- Very specific: line 26
Always find and edit the *.base.md source instead, then regenerate:
- Very specific: line 33
If you can't find the base file, read the config's sources globs and naming.baseSuffix (default ".base") to work out which file is the real …
- Very specific: line 115
Every command except kiritan init accepts --mode <mode> and --config <path> to layer on non-default config files — there's no config to …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
kiritan
Kiritan is an i18n tool that, beyond the usual key→string runtime i18n, also builds localized documents (README, docs, etc.) from a single base file. This is the operating manual for working inside a project that already uses it — or for introducing it to a repo that doesn't yet — not for writing Kiritan's own source.
Recognizing a Kiritan project
Look for any of:
- A
.kiritanconfig(ordev.kiritanconfig/local.kiritanconfig/etc.) config file, usually at the repo root, exportingdefineConfig({...}). It has no file extension by design — don't mistake it for a stray/misnamed file. - A
base/directory containing*.base.mdfiles (the convention this project itself uses; a project may instead keep base files elsewhere per its ownsourcesglobs). - A generated document carrying a
<!-- kiritan:untranslated (source: ...) -->or<!-- kiritan:hash ... -->HTML comment, or an auto-inserted language-switcher line (**English** | [日本語](...)).
The one rule that matters most: never hand-edit generated output
Every file listed under the resolved config's sources (check .kiritanconfig and its naming/naming.template for the actual output paths) is generated from a base file — editing it directly gets silently overwritten on the next kiritan build, and for sidecar/catalog strategies it will drift from its embedded hash, which kiritan check reports as stale.
Always find and edit the *.base.md source instead, then regenerate:
kiritan build # or: npm run docs:build, if the project defines that script
kiritan check # verify nothing is left missing/stale before finishingIf you can't find the base file, read the config's sources globs and naming.baseSuffix (default ".base") to work out which file is the real source for a given output.
Directive syntax (inline strategy)
remark-directive syntax, one locale per self-contained block — never a single block trying to hold a switch/case over multiple locales:
:::kiritan{locale=en}
## Usage
English content.
:::
:::kiritan{locale=ja}
## 使い方
日本語のコンテンツ。
:::- Content outside any
:::kiritan{...}block is shared verbatim across every locale's output (badges, license notices, etc.). locale=xxmust exactly match a value in the resolved config'slocales.list— an unrecognized code is a build-time error, not a silent skip.::kiritan{switcher}(a leaf directive, no closing:::) marks where the language-switcher line is inserted. It's usually unnecessary to add by hand — Kiritan auto-inserts it after the first heading unless a marker already exists orswitcher.position/switcher.enabledsays otherwise.- Nesting another directive inside a block just needs more colons on the outer fence (
::::kiritan{locale=en}wrapping a:::note) — no special handling needed.
Prefer many small block pairs over one block holding the whole document
Split at every natural section boundary (each heading, usually) into its own locale=en/locale=ja pair, rather than wrapping the entire page's content in a single pair per locale. Prefer this:
:::kiritan{locale=en}
## Usage
English content.
:::
:::kiritan{locale=ja}
## 使い方
日本語のコンテンツ。
:::
:::kiritan{locale=en}
## Configuration
More English content.
:::
:::kiritan{locale=ja}
## 設定
さらに日本語のコンテンツ。
:::over this:
:::kiritan{locale=en}
## Usage
English content.
## Configuration
More English content.
:::
:::kiritan{locale=ja}
## 使い方
日本語のコンテンツ。
## 設定
さらに日本語のコンテンツ。
:::Both build to the same output, but the split form is far easier to read and review in the source: each locale pair sits right next to its counterpart, a diff to one section doesn't touch the surrounding ones, and nothing is lost scrolling through a wall of one language before the other begins. Apply this when writing a new base file and when restructuring an existing one — not by forcibly re-splitting a file just to reformat it if nothing else about it is changing.
CLI commands, and when to reach for each
| Command | Run it when |
kiritan init | In a repo that doesn't use Kiritan yet, when asked to localize its README/docs — scaffolds .kiritanconfig, base/README.base.md, and a .gitignore entry for local.kiritanconfig. Leaves existing files alone unless --force is passed. |
kiritan build | After editing any *.base.md — regenerates every configured output. |
kiritan check | After any base-file or translation change, before calling the work done — CI-friendly, reports missing/stale/machine/i18n-key-mismatch. |
kiritan verify | To confirm generated docs are in sync with their base files (no hand edits, nothing out of date) — writes nothing, exits non-zero on a mismatch. Different from check, which is about missing/stale translations. |
kiritan extract | After adding a new :::kiritan{#<id>} block, for catalog-strategy sources — scaffolds the new id into each locale's catalog file. |
kiritan translate | To auto-fill missing/stale translations — only does anything if the source configures translate.middlewares and translate.auto: true (the default is off, and kiritan translate says so when middlewares are configured but auto isn't). |
kiritan typegen | Only for runtime i18n, when runtime.sources aggregates multiple files into one shared t() — regenerates the aggregated type declaration. |
In a project that keeps kiritan in devDependencies, invoke it as npx kiritan <command> — or npm run docs:build / npm run docs:check, if the project defines those scripts — instead of a globally installed kiritan.
Every command except kiritan init accepts --mode <mode> and --config <path> to layer on non-default config files — there's no config to layer yet before init has run.
Common mistakes to avoid
- Editing a generated output file instead of its
*.base.mdsource (see the rule above). - Writing
{{name}}instead of%{name}for interpolation. - Packing multiple locales into one
:::kiritan{...}block instead of one self-contained block per locale. - Wrapping a whole document's content in one block pair per locale instead of splitting at each section — see "Prefer many small block pairs" above.
- Using a
locale=value not present inlocales.list(build-time error). - Adding a new
:::kiritan{#<id>}block forcatalogand forgetting to runkiritan extractbefore it can be translated. - Hand-writing or guessing a catalog entry's
hashfield. - Assuming
kiritan translatedoes something when the source has notranslate.middlewaresconfigured, or whentranslate.autoisn'ttrue— check the config first. A source's owntranslatereplaces the top-level one entirely, so it needs its ownauto: true.
References — read only what the task needs
- Document strategies:
catalogandsidecar— read when the project'ssourcesuse (or you're adding)strategy: "catalog"or"sidecar". - Runtime i18n:
t(key, params)— read when working on UI strings in application code,runtime.sources, orkiritan typegen. - Config and variable interpolation — read when writing or editing a
.kiritanconfig, or when%{name}interpolation is involved.
Where to look for more
- The target project's own
docs/DESIGN.md, if it has one — the authoritative spec for its config shape and behavior. kiritan <command> --helpfor exact flags.
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.

