Datasheet CN Reader
Create a separate output; never overwrite the source PDF.
Required workflow
- Run
datasheet-cn-reader extract SOURCE.pdf --output work/extraction.json. - Run
datasheet-cn-reader manifest work/extraction.json --output work/qa_manifest.json. - Read translation-rules.md.
- Create page translations:
- For Agent translation, run
datasheet-cn-reader translate work/extraction.json --output work/translation.json --provider draft, replace every待人工确认block, and preserve all protected tokens. - For a controlled regression baseline, use
--provider baseline-html --baseline accepted.htm. - For an external translator, use
--provider command --command ...; keep credentials outside prompts and files.
- For Agent translation, run
- Run
datasheet-cn-reader build work/extraction.json work/translation.json --output output/reader.html. - Read qa-contract.md, then run:
datasheet-cn-reader validate work/qa_manifest.json work/translation.json output/reader.html --report output/qa-report.json. - Run
datasheet-cn-reader review output/reader.html --output-dir output/render-review. - Deliver only when validation exits
0and the QA report hasstatus: passed.
Translation contract
- Treat the uploaded PDF as the only parameter authority.
- Translate English natural language only.
- Do not change product models, pin names, parameter symbols, formulas, values, units, test conditions, table order, or MIN/TYP/MAX column relationships.
- Do not silently update values from a website or another revision.
- If external material differs, report the difference without replacing the uploaded value.
- Mark uncertain extraction or translation as
待人工确认; never guess. - Preserve every source page as one corresponding HTML page block.
- Use real HTML tables for structured data; do not substitute table screenshots.
- Keep original page images embedded as data URLs for offline traceability.
Failure rules
- Treat a nonzero validator exit as a hard stop.
- Do not rename a failing build as a verified build.
- Fix the exact page/table/token issue recorded in the QA report.
- Do not suppress a missing token or row without recording a narrowly scoped, evidence-based exemption.
- If OCR is required, record OCR use and confidence per page.
Interfaces
- CLI:
datasheet-cn-reader --help - Source-tree wrappers:
scripts/*.py - MCP stdio server:
python -m datasheet_cn_reader.mcp_server - Generic Agent prompt:
adapters/universal-prompt.md - Product adapters:
adapters/{codex,claude-code,cursor,gemini-cli,hermes}/
Read technical-terms.md when standard Chinese terminology is uncertain.