Turn a GitHub repository into a usage-first Chinese guide and PDF.
OWNER/REPO.gh first for repo metadata. Fall back to browser only if gh is blocked or missing needed details.scripts/build_pdf.py.MEDIA: lines for the generated files.Prefer these sources, in this order:
README* and localized README filesdocs/ and obvious user-guide filespackage.json, pyproject.toml, Cargo.toml, go.mod, or equivalent manifest files for install/runtime hintsgh repo viewUse rg --files to find files quickly. Favor user-facing docs over architecture or internal implementation notes.
Focus on what a real user needs to learn:
Avoid deep implementation detail unless it is required to explain usage.
If docs are weak, infer carefully from manifests, command docs, examples, and CLI entry points. State uncertainty briefly instead of pretending.
Use gh first.
Examples:
bash
gh repo view OWNER/REPO --json name,description,url,defaultBranchRef,licenseInfo,stargazerCount,forkCount,updatedAt
bash
gh repo clone OWNER/REPO /tmp/repo -- --depth=1
If gh is insufficient, use browser to inspect the GitHub page or linked docs site.
bash
rg --files . | rg '(^README|^readme|^docs/|guide|manual|command|config|example|package\.json$|pyproject\.toml$|Cargo\.toml$|go\.mod$)'
Read only the files needed to build the guide. Do not dump the whole repo into context.
Use this structure unless the repo clearly needs a different shape:
Write outputs under the workspace media directory so they can be sent directly:
media/<slug>-user-guide-zh-YYYYMMDD-HHMMSS.mdmedia/<slug>-user-guide-zh-YYYYMMDD-HHMMSS.pdfUse a short slug derived from the repo name.
After the Markdown guide is ready, run:
bash
python3 skills/github-repo-guide-pdf/scripts/build_pdf.py \
--markdown /absolute/path/to/guide.md \
--output /absolute/path/to/guide.pdf \
--title "<title>" \
--source-url "https://github.com/OWNER/REPO"
If font selection fails, rerun with:
bash
--mainfont "Hiragino Sans GB"
After success, reply with:
MEDIA: line for the Markdown fileMEDIA: line for the PDF fileExample:
text
Done. I turned the repo into a Chinese usage guide and PDF.
MEDIA:media/example-user-guide-zh-20260328-150500.md
MEDIA:media/example-user-guide-zh-20260328-150500.pdf
Before replying, verify all of the following:
OWNER/REPO was normalized correctlyMEDIA: paths match the actual files