Skip to content

Document the tag-before-pushing workflow in CLAUDE.md - #190

Closed
matenadasdi wants to merge 1 commit into
ja-localization-fullfrom
ja-tagging-workflow-doc
Closed

Document the tag-before-pushing workflow in CLAUDE.md#190
matenadasdi wants to merge 1 commit into
ja-localization-fullfrom
ja-tagging-workflow-doc

Conversation

@matenadasdi

Copy link
Copy Markdown
Collaborator

Suggestion for #140 — take it or leave it, it's a docs-only change.

#140 adds the whole translation pipeline but doesn't touch CLAUDE.md, so nothing tells an author — human or agent — that a page needs tagging before it ships. There's no CI check for it either, and an untagged term isn't flagged anywhere: it just gets machine-translated into Japanese.

This records the intended loop:

  • Run python3 scripts/add_notranslate_tags.py before pushing a new or edited page, and commit the tags with the content.
  • refresh-ui-library.yml's weekly run is the sweep for whatever local runs miss.

Two behaviors worth writing down

Both verified against the script rather than assumed:

  • It needs the network, and degrades soft. Canonical Step titles come from the live steplib spec.json, which is most of its ~4s runtime. On failure it still exits 0 but falls back to glossary-only Step coverage, with only a warning on stderr — so an offline run tags strictly less than an online one. That reframes the weekly sweep: it isn't only for people who forget, it's what repairs offline and stale-glossary runs. Worth an author knowing.
  • It's idempotent and self-importing. Verified on a real page: run 1 wrapped 61 terms and inserted import NT from '@site/src/components/NT'; on its own; run 2 wrapped 0 and left the tag count unchanged. So "just run it again" is always safe advice.

The fact that's easiest to get backwards

The section states plainly that the glossary is the tagger's term source only — never read at translation time, term lists never injected into the prompt. translate_docs.py opens it solely for protect_patterns.

That distinction is genuinely easy to miss: the glossary's own header (point 2) still claims its terms "are injected into the translation prompt as a hard rule", which describes the design this PR replaced. Reading that file top-down gives you the wrong model of how protection works. Worth correcting that comment in this PR too — separate from this change, but same root cause.

Placement

Added next to the other procedural sections (Syncing MCP docs, Generating API reference docs) rather than under Authoring mechanics, to stay clear of the .md/.mdx rewrite in #188 and avoid a merge conflict between the two.

Based on ja-localization-full and targeted at it, so it merges into #140 rather than racing it.

🤖 Generated with Claude Code

This PR adds the whole translation pipeline without touching CLAUDE.md, so
nothing tells an author — human or agent — that a new page has to be tagged
before it ships. Untagged terms aren't flagged anywhere; they just get
machine-translated.

Records the intended loop: run scripts/add_notranslate_tags.py before pushing
a new or edited page and commit the tags with the content, with the weekly
refresh-ui-library.yml run as the sweep for whatever local runs miss.

Two behaviors worth writing down, both verified against the script:

  - It fetches the live steplib spec.json for canonical Step titles (most of
    its ~4s runtime) and degrades soft on failure, so an offline run tags
    strictly less than an online one with only a stderr warning. The weekly
    sweep is what repairs that, not just forgetfulness.
  - It is idempotent and inserts its own NT import — verified: a second run
    over a tagged page wraps 0 and leaves the tag count unchanged.

Also states the load-bearing fact that is easy to get backwards: the glossary
is the tagger's term source only. It is never read at translation time and its
term lists are never injected into the prompt, so a term with no <NT> around
it has no protection at all.

Placed next to the other procedural sections rather than in Authoring
mechanics, to stay clear of the .md/.mdx rewrite in #188.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant