tldr-zh-page-maintainer
Skill0 starsChanged 3 months agoMITView on GitHub
Maintain Simplified Chinese tldr pages from their current English sources, including creating missing translations, synchronizing existing pages, and revising or polishing Chinese wording, with deterministic validation, human review, local commit, fork push, and browser PR handoff. Use when the user provides one or more tldr command names and wants to create or update pages.zh content in a local tldr-pages/tldr clone. Do not use for editing English pages or adding other locales.
- Commits and pushes
In this repository2 other files it gives its agents.
- image-generatorSkill
- tldr-en-page-maintainerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
35 rules. About 0 are common, 19 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 8
Treat one skill invocation as one maintenance batch.
- Distinctive: line 20
Default a batch to one operation type.
- Distinctive: line 24
Use this state flow:
- Distinctive: line 42
Treat the ordered command set, operation assigned to each command, and resolved source/target mapping as the batch identity.
- Very specific: line 44
Never silently drop a command, choose an ambiguous platform or operation, expand a revise request into a full synchronization, stash work, …
- Very specific: line 46
Keep CONTENT_APPROVED, LOCAL_FINALIZATION_APPROVED, and REMOTE_PREPARATION_APPROVED distinct.
- Distinctive: line 54
If command boundaries or operation assignments are ambiguous, show the parsed batch, explain the ambiguity, recommend an interpretation, …
- Very specific: line 60
Read the current .github/PULL_REQUEST_TEMPLATE.md and extract any applicable page or batch limit.
- Very specific: line 63
Run gh auth status. If unauthenticated, recommend gh auth login and pause.
- Distinctive: line 65
Run the bundled resolver against the fetched ref:
- Distinctive: line 87
Create one branch from the fetched upstream main only after every check passes.
- Distinctive: line 104
Read references/zh-translation-rules.md completely, then read every fixed and conditional repository reference routed by that document.
- Distinctive: line 106
Read the operation-specific instructions for every operation present in the batch:
- Distinctive: line 122
Run all of the following against the exact target paths:
- Distinctive: line 124
Run the project-local Markdown linter.
- Very specific: line 125
Read the current scripts/test.sh and run the project-local tldr-lint with the exact ignore codes currently used for pages.zh.
- Distinctive: line 126
Run the bundled validator with every source/target pair, its operation, and scope checking enabled:
- Distinctive: line 153
Do not attach full pages, a complete diff, or auto-fix details unless requested.
- Very specific: line 163
Read the current CONTRIBUTING.md section “Commit message and PR title.”
- Very specific: line 166
After approval, report LOCAL_FINALIZATION_APPROVED and rerun the entire hard-validation phase.
- Distinctive: line 167
If any file changes during final validation, invalidate content approval and return to Phase 3 and human review.
- Distinctive: line 170
Run git diff --cached --check, inspect git diff --cached --name-status, and inspect the staged content.
- Very specific: line 171
Create exactly one commit with the approved message.
- Distinctive: line 172
Verify the new commit's hash, message, files, content, and post-commit worktree status.
- Distinctive: line 174
If a hook or commit fails, report the original error and staged state.
- Very specific: line 182
Use gh api user to identify the current account.
- Very specific: line 185
Read the current commit/PR title rule and .github/PULL_REQUEST_TEMPLATE.md.
- Distinctive: line 186
Default the PR title to the commit message.
- Very specific: line 187
Check only boxes supported by actual evidence.
- Very specific: line 189
After approval, report REMOTE_PREPARATION_APPROVED and push with git push -u <fork-remote> HEAD.
- Very specific: line 201
Stop at PR_READY_FOR_REVIEW.
- Very specific: line 203
After creation, use gh pr view or gh pr list to verify the PR number, title, URL, base/head, and state.
- Distinctive: line 211
Read references/zh-translation-rules.md completely in Phase 2.
- Distinctive: line 212
Read only the operation references used by the batch.
- Very specific: line 213
Run scripts/validate_batch.py for source resolution and hard validation.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Maintain tldr Simplified Chinese Pages
Treat one skill invocation as one maintenance batch. Keep every user-provided command in the same branch, commit, and PR unless the user explicitly changes the batch. Run from the root of a local tldr-pages/tldr clone.
Scope and Intent
Support three operation types:
create: create a missing Chinese page from the current English page.sync: synchronize an existing Chinese page with the current English page while preserving accurate existing Chinese wording.revise: correct, retranslate, or polish an existing Chinese page within the user's requested scope, using the English page as the semantic and structural boundary.
Infer intent from the user's request, not merely from whether the target exists. Treat wording such as “补充缺失翻译” as create, “与英文同步” as sync, and “修正翻译” or “润色” as revise. If the request only says “翻译” and the target already exists, report that fact and ask whether the user wants synchronization or revision; do not silently choose.
Default a batch to one operation type. Allow a mixed batch only when the user clearly requests different operations for different commands. Preserve the user's command order.
End after the PR is created and verified. Do not track CI, handle review comments, monitor merging, clean branches, or edit English pages unless separately requested.
Use this state flow:
REQUESTED
-> PREFLIGHTED
-> READY_FOR_EDIT
-> DRAFTED
-> VALIDATED
-> CONTENT_APPROVED
-> LOCAL_FINALIZATION_APPROVED
-> LOCALLY_FINALIZED
-> REMOTE_PREPARATION_APPROVED
-> PR_READY_FOR_REVIEW
-> PR_CREATEDGlobal Controls
- Treat the ordered command set, operation assigned to each command, and resolved source/target mapping as the batch identity. If any of them changes, return to preflight and rerun it completely.
- Aggregate all blockers found in a phase. Explain each cause, recommend a concrete resolution, and then ask the user what to do.
- Never silently drop a command, choose an ambiguous platform or operation, expand a
reviserequest into a full synchronization, stash work, overwrite a branch, bypass hooks, force-push, delete a branch, or rewrite commit history. - Bind every approval to the exact files and plan shown to the user. Any page-content change invalidates
CONTENT_APPROVED. Any material commit or remote-plan change invalidates its corresponding approval. - Keep
CONTENT_APPROVED,LOCAL_FINALIZATION_APPROVED, andREMOTE_PREPARATION_APPROVEDdistinct. - Resolve paths relative to the repository root. Resolve bundled resources relative to this
SKILL.md.
Parse the User Input
- Accept command names with an optional operation for each command. Do not require platform names, repository paths, or page paths.
- Accept one command or a comma-, Chinese-enumeration-comma-, newline-, or natural-language-separated list.
- Preserve spaces inside subcommands. Treat
git commitandgit-commitas equivalent lookup forms. - If command boundaries or operation assignments are ambiguous, show the parsed batch, explain the ambiguity, recommend an interpretation, and ask the user to confirm within preflight.
Phase 1: Preflight
Enter with REQUESTED. Complete all checks before creating a branch.
- Read the current
.github/PULL_REQUEST_TEMPLATE.mdand extract any applicable page or batch limit. The repository document is authoritative; do not assume a limit applies equally to new and updated pages without reading its wording. - Require a clean worktree using
git status --porcelain=v1 --untracked-files=all. If dirty, list every change and recommend that the user save or finish it. Do not stash, commit, or delete it. - Inspect every remote URL. Identify
tldr-pages/tldrby normalized URL, never by assuming the remote is namedupstreamororigin. - Run
gh auth status. If unauthenticated, recommendgh auth loginand pause. Never handle or print credentials. - Fetch the official upstream
mainexplicitly. Run the bundled resolver against the fetched ref:
python <skill-dir>/scripts/validate_batch.py resolve \ --repo <repo-root> \ --ref <official-remote>/main \ --json \ <commands...>- Require exactly one English source page for every command. Use the returned
target_existsfact to enforce the assigned operation:createrequires a missing Chinese target.syncandreviserequire an existing Chinese target.
- For every
revisepage, compare the current English and Chinese pages before branching. If the English page contains structural or content changes outside the requested revision, report them and ask whether to expand that page tosync; do not make that scope change implicitly. Query open upstream PRs with file data, using a sufficiently high limit:
gh pr list --repo tldr-pages/tldr --state open --limit 1000 \ --json number,title,url,filesCompare actual changed file paths with every target page. Do not infer duplicates from PR titles alone.
- Create one branch from the fetched upstream
mainonly after every check passes.
Choose the branch prefix from the batch operations:
- Only
create:translate-zh/<batch-slug> - Only
sync:sync-zh/<batch-slug> - Only
revise:revise-zh/<batch-slug> - Explicitly mixed:
maintain-zh/<batch-slug>
Normalize a subcommand to a hyphenated page name and join multiple commands with _. Do not add a date, hash, or random suffix preemptively. If the local name already exists, do not reuse or delete it; recommend a readable numeric suffix and ask the user.
Report the ordered operation/source/target mapping, all check results, the branch name, PREFLIGHTED, and then READY_FOR_EDIT.
Phase 2: Edit the Whole Batch
Enter only with READY_FOR_EDIT.
Read references/zh-translation-rules.md completely, then read every fixed and conditional repository reference routed by that document. Current repository rules outrank the bundled summary.
Read the operation-specific instructions for every operation present in the batch:
create: references/create-pages.mdsync: references/sync-pages.mdrevise: references/revise-pages.md
Before editing each page, search pages.zh for the closest pages in the same command family. Reuse established terminology, recurring descriptions, and placeholders when they fit the current English source. Treat sibling pages as wording references only; the current English source remains authoritative for meaning, structure, and command behavior.
Finish every page in the batch before validation. Record uncertain terminology and material editing decisions without repeatedly interrupting the user. Pause only when the English meaning cannot be understood reliably or a requested revision would change command behavior.
Report the edited files, operation for each file, material synchronization or revision decisions, uncertainty list, and DRAFTED.
Phase 3: Run Hard Validation
Enter only with DRAFTED. Do not judge naturalness or translation preference here.
Run all of the following against the exact target paths:
- Run the project-local Markdown linter.
- Read the current
scripts/test.shand run the project-localtldr-lintwith the exact ignore codes currently used forpages.zh. Do not use a bare invocation whose behavior differs from CI. Run the bundled validator with every source/target pair, its operation, and scope checking enabled:
python <skill-dir>/scripts/validate_batch.py validate \ --repo <repo-root> \ --check-scope \ --json \ --pair create:pages/<platform>/<command>.md=pages.zh/<platform>/<command>.md \ --pair sync:pages/<platform>/<command>.md=pages.zh/<platform>/<command>.md \ --pair revise:pages/<platform>/<command>.md=pages.zh/<platform>/<command>.mdInclude only the actual pairs in the batch. The validator checks operation/target state, mapping, titles, structural order, header/example/command counts, URLs, inline command references, command integrity with translatable placeholders masked, trailing whitespace, final newlines, and exact worktree scope. It is read-only.
Automatically fix only deterministic hard failures. After any fix, rerun the entire phase. If a failure cannot be fixed reliably, aggregate it, recommend a resolution, and ask the user. Do not advance while any hard failure remains.
Report the hard-check summary, automatic fixes, carried uncertainty list, and VALIDATED.
Phase 4: Human Review and Iteration
Enter only with VALIDATED. By default, report exactly:
- Batch commands, operation assignments, and changed-file list.
- Recorded uncertain terms and material synchronization or revision decisions.
- Hard-validation summary.
- An explicit statement that nothing has been committed, pushed, or submitted as a PR.
Do not attach full pages, a complete diff, or auto-fix details unless requested. Ask the user to inspect the local pages.
For every requested change, edit the affected page, invalidate VALIDATED, rerun the entire hard-validation phase, and present the same four-item review package. Never infer approval from silence or an ambiguous reply.
On explicit overall content approval after disclosure, report CONTENT_APPROVED. Do not commit yet.
Phase 5: Local Finalization
Enter only with CONTENT_APPROVED.
- Read the current
CONTRIBUTING.mdsection “Commit message and PR title.” - Draft one commit message for the entire batch. Use current repository rules and recent accepted commits only to resolve uncovered ambiguity.
- Show the exact target files and proposed commit message. Ask for explicit local-finalization authorization.
- After approval, report
LOCAL_FINALIZATION_APPROVEDand rerun the entire hard-validation phase. - If any file changes during final validation, invalidate content approval and return to Phase 3 and human review.
- Confirm that the worktree contains only the expected target changes and that each target's change type matches its assigned operation.
- Stage exact paths with
git add -- <target-pages...>; never use a broad add. - Run
git diff --cached --check, inspectgit diff --cached --name-status, and inspect the staged content. - Create exactly one commit with the approved message. Do not use
--no-verify. - Verify the new commit's hash, message, files, content, and post-commit worktree status.
If a hook or commit fails, report the original error and staged state. Do not reset, delete files, bypass the hook, or rewrite history. If a successful commit is later found wrong, stop and ask the user; do not amend or reset automatically.
On success, report only the commit hash/message, committed files, final validation and worktree result, an explicit statement that nothing has been pushed or submitted, and LOCALLY_FINALIZED.
Phase 6: Remote Preparation and PR Handoff
Enter only with LOCALLY_FINALIZED. Do not repeat preflight's upstream fetch, page-state checks, or open-PR duplicate scan by default.
- Use
gh api userto identify the current account. - Reuse the official upstream found in preflight. Identify the user fork by URL, fork relationship, and permission with
gh repo view; do not assumeoriginis the fork. - Require a unique writable fork remote. Never push to the official upstream.
- Read the current commit/PR title rule and
.github/PULL_REQUEST_TEMPLATE.md. - Default the PR title to the commit message. Preserve the complete current PR template.
- Check only boxes supported by actual evidence. Check the human-review item only because the batch reached
CONTENT_APPROVED. Do not invent command versions or issue references. UseClosesonly when the PR fully resolves a known issue. - Show the fork remote/repository, remote branch, PR base/head, title, and complete body. Ask for explicit remote-preparation authorization.
- After approval, report
REMOTE_PREPARATION_APPROVEDand push withgit push -u <fork-remote> HEAD. Never force-push. Open the prefilled form without creating the PR:
gh pr create --repo tldr-pages/tldr \ --base main \ --head <user>:<branch> \ --title <title> \ --body-file <temporary-body-file> \ --web- Stop at
PR_READY_FOR_REVIEW. Ask the user to inspect the full diff, base/head, title, body, and checklist in the browser. - Let the user click “Create pull request” by default. If the user explicitly asks the agent to submit, reread the visible base/head, title, and body first and submit only if base/head still match the authorized plan.
- After creation, use
gh pr vieworgh pr listto verify the PR number, title, URL, base/head, and state.
If push fails, do not force. If a remote branch already exists or the push is non-fast-forward, report it and ask. If the browser cannot open, preserve the remote branch and provide the direct PR-creation target and prefilled content. If submission fails, do not click repeatedly. Never delete the remote branch or modify an already-created PR in this workflow.
On success, report the PR number/title/link, base/head and remote branch, batch commands/operations/files, PR_CREATED, and that the workflow has ended.
Bundled Resources
- Read references/zh-translation-rules.md completely in Phase 2.
- Read only the operation references used by the batch.
- Run scripts/validate_batch.py for source resolution and hard validation. Use
--helpfor its complete CLI.
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.

