Imported from lazyverilog/LazyVerilog (
scripts/AGENTS.md). Install upstream withnpx skills add lazyverilog/LazyVerilog --skill scripts. Copyright stays with the author.
scripts
Purpose
Repository-maintenance scripts that call out to services. Unlike tools/, nothing
here benchmarks or debugs the server, and nothing here is part of the build.
Subdirectories
| Directory | Purpose |
|---|---|
translate-readme/ |
Translates README.md into docs/i18n/README.<lang>.md with the Claude Agent SDK |
For AI Agents
translate-readme
cd scripts/translate-readme && npm install
node index.ts ko fr # named languages
node index.ts --tier 1 # a tier (CI's default)
node index.ts --dry-run ko # print the prepared source, call no model
- Driven in CI by
.github/workflows/translate-readme.yml, on a push tomainthat touchesREADME.mdorscripts/translate-readme/, and onworkflow_dispatchfor a chosen language set. Latest only: a push is skipped when a newer commit onmainhas already changed those paths, because that push runs the translation for both, and each run works from the head ofmain, so it sees the previous run's cache. Editing the workflow file does not start a run; useworkflow_dispatch. Auth is theCLAUDE_CODE_OAUTH_TOKENrepository secret, which is what the Agent SDK reads; there is noANTHROPIC_API_KEYin this workflow. - The English
README.mdis the only source. Translations are generated output: edit the English file and let CI regenerate, never hand-patch adocs/i18n/file — the next source change overwrites it. - Translations are cached in
docs/i18n/.translation-cache.json, keyed on the SHA-256 ofREADME.mdplus the model andPROMPT_VERSION. An unchanged README costs nothing to re-run, which is what makes the push trigger safe. Change the prompt and bumpPROMPT_VERSION, or every cached language stays stale forever. - Relative links are rewritten before the model sees them, not by it
(
rewriteRelativeLinks()). A README links its siblings asdocs/features.mdandassets/...; fromdocs/i18n/those resolve two directories too high, so every link in every translation would 404. The model is only asked to preserve what it is handed — path arithmetic is not a translation decision.--dry-runprints exactly what gets sent. - The run is deliberately toolless and isolated:
tools: []andsettingSources: []. Without the latter the SDK loads this repository'sCLAUDE.md, settings, hooks and MCP servers into a job that only needs to rewrite prose. - Adding a language is a row in
LANGUAGES; add it to the README language bar too, or the file is generated and never linked. CI generates tier 1 by default, which is the set that bar lists.