Skip to content

check-readme-sync: warn on EN vs translated README bold-link roster drift - #18

Open
sergiobuilds wants to merge 1 commit into
LilMGenius:mainfrom
sergiobuilds:pr/check-readme-sync
Open

check-readme-sync: warn on EN vs translated README bold-link roster drift#18
sergiobuilds wants to merge 1 commit into
LilMGenius:mainfrom
sergiobuilds:pr/check-readme-sync

Conversation

@sergiobuilds

Copy link
Copy Markdown
Contributor

What

~100줄 스크립트 하나(scripts/check-readme-sync.cjs)로, 루트 README.md의 skill 볼드 링크(**[<skill>](path)) 로스터와 docs/readme/README.<lang>.md 10개 번역본의 로스터를 비교합니다. SET(누락)과 ORDER(공통 부분집합의 순서 일치)를 검증합니다. 기본은 warn-only.

Why

CLAUDE.md의 shipping checklist step 2가 이미 "번역본도 함께 갱신한다"고 요구하고 있는데 자동화가 없었습니다. 번역본은 ba9ae6e feat: add localized READMEs 이후 콘텐츠 갱신 없이 16a98c3에서 스위처 정규화만 받았고, 그동안 EN 쪽은 여러 번 skill이 추가·개명됐습니다. 현재 시점(cdbb4a1b)에는 볼드 링크 로스터가 우연히 정렬돼 있어 이 PR은 예방용입니다.

check-catalog-sync는 4개 내부 surface(plugin.json / catalog.cjs / re0-upgrade / EN README)의 SET만 지키고 ORDER는 사람 판단으로 남겨뒀습니다. 그 결정을 존중해서, 이 스크립트는 EN README를 downstream mirror인 번역본에만 적용합니다. 4-surface 사이에는 손대지 않습니다.

Scope

  • 볼드 링크 skill SET + ORDER 검증만.
  • 번역된 산문·톤·완성도는 판단하지 않습니다.
  • 코드블록 안의 예시 링크는 fence를 벗겨 무시합니다.
  • 중복 언급(스위처·푸터의 재링크)은 dedupe해서 카운트합니다.
  • 기본 exit 0(warn); --strict로 exit 1 승격.

Wiring

  • .github/workflows/ci.ymlLocalized README bold-link roster drift-guard (warn-only) 스텝 한 줄 추가.
  • CLAUDE.md shipping step 2에 check-readme-sync를 언급하고, warn-only 기본과 --strict 승격 옵션을 명시.
  • package.json은 손대지 않았습니다(현재 scripts 필드가 비어 있고, 다른 check-* 도구도 CI에서 직접 호출하는 스타일이라 그 관습을 따랐습니다).

Test

tests/check-readme-sync.test.cjs — temp 디렉토리에 합성 저장소를 만들어 4개 케이스:

  1. normal(모두 일치) → exit 0, "OK" 출력
  2. missing(한 번역본에 skill 누락) → warn, exit 0, 1 missing (readchk) 리포트
  3. order-swap(두 skill 순서 교체) → warn, exit 0, order mismatch 리포트
  4. --strict 모드에서 drift → exit 1, ::error:: 출력

로컬 실측: 현재 main(cdbb4a1)에서 node scripts/check-readme-sync.cjsREADME sync OK: 28 bold-link skills match across 10 localizations을 반환합니다.

Notes

  • warn-only 유지에는 이유가 있습니다. 번역이 EN을 즉시 따라오지 못하는 게 정상 상태이므로, 매 커밋 실패로 밀어붙이면 오히려 성가십니다. 유지관리자가 원할 때 --strict로 승격하거나 CI 스텝을 그대로 fail-mode로 바꾸면 됩니다.
  • CLAUDE.md의 "guards the set, not the order" 문장은 4-surface 결정 경계입니다. 이 스크립트는 그 경계 밖(번역본)만 다룹니다.

…-link SET+ORDER (warn-first)

The English README's skill roster (bold-link **[name](path) entries) is the source
of truth for the 10 localized copies under docs/readme/. CLAUDE.md's shipping
checklist step 2 already requires translations track the English roster, but there
is no automation — this script fills that gap.

Scope is intentionally narrow: SET (each translation contains every EN skill) and
ORDER (shared-subset order matches EN). Translated prose, tone, and completeness
are left to maintainer judgment. The 'guards the set, not the order' carve-out
from check-catalog-sync applies to the four internal roster surfaces
(plugin.json / catalog.cjs / re0-upgrade / EN README) which the maintainer holds
by hand; localized READMEs sit outside that boundary because they are downstream
mirrors of the EN README, not peers of it.

Default is warn-only (exit 0) so a translation lag never blocks CI or a merge;
pass --strict to promote it to a failure once the maintainer wants enforcement.
Wired into ci.yml as a warn-only step and referenced from CLAUDE.md alongside
check-catalog-sync. tests/check-readme-sync.test.cjs covers normal, missing,
order-swap, and --strict cases with a temp-dir fixture repo.

Current state on main: all 10 translations pass. The check is preventive.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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