Claude Code Migration Notes
This skill was migrated from the local Codex skill registry for Claude Code. Use it as a Claude Code SKILL.md skill. Some source text may name Codex-only tools or channels; in Claude Code, use the closest available Claude Code tool, shell command, MCP/plugin integration, or local helper script. Keep secrets in Keychain, environment variables, or authenticated CLIs only.
Image Tech MD Rebuilder
Goal
Convert ordered screenshots of a non-copyable technical document into one coherent Markdown document. The deliverable must read like the original source document, not like an OCR dump.
Required Output Standard
- Produce a continuous technical
.md file with the original document structure.
- Rebuild headings, paragraphs, numbered lists, tables, code blocks, and diagrams semantically.
- Use Mermaid for flowcharts, sequence diagrams, state flows, and architecture diagrams when the screenshot contains a diagram that can be faithfully represented.
- Preserve important screenshots as image references only when OCR/Markdown cannot represent the content reliably.
- Never deliver a final document organized as "screenshot 01 text, screenshot 02 text". That format is only allowed as an intermediate OCR scaffold.
- State the final absolute output path.
Workflow
Inventory images
- Accept a single image path or an image folder.
- Sort screenshots by filename and timestamp unless the user gives a different order.
- Count images and inspect formats/sizes.
Run OCR into intermediate artifacts
- Prefer the bundled script:
uv run --with rapidocr --with onnxruntime --with pillow python C:\Users\18357\.codex\skills\image-tech-md-rebuilder\scripts\ocr_image_folder.py --image-dir "<IMAGE_DIR>" --out-dir "<WORK_DIR>\ocr_output"
- If
rapidocr fails, try rapidocr_onnxruntime, PaddleOCR, Tesseract, or a vision model if available.
- Keep raw OCR artifacts for audit: JSON, plain text dump, and scaffold Markdown.
Rebuild the document, do not summarize
- Read the OCR dump in order.
- Merge text that is split across screenshot boundaries.
- Identify the source document hierarchy: title, intro, sections, Q&A headings, subheadings.
- Reconstruct code from OCR into valid fenced code blocks.
- Reconstruct tables as Markdown tables.
- Reconstruct diagrams as Mermaid or compact ASCII if Mermaid would distort the content.
- Remove screenshot artifacts: line numbers that are not part of code, duplicated repeated headers, OCR garbage, UI controls, cursor marks, and watermark clutter.
Correct OCR systematically
- Fix common technical OCR errors:
FastAPl -> FastAPI
JsoN -> JSON
LLA / 1lm -> LLM / llm by context
MCPServer -> MCP Server
MCPClient -> MCP Client
StreamableHTTP -> Streamable HTTP
Server-SentEvents -> Server-Sent Events
检素 -> 检索
攻路 -> 攻略
Agont, Agint, Agein, Aget -> Agent
- Correct obvious punctuation and numbering errors from OCR, such as
1。 to 1. in numbered lists.
- Preserve domain terms, variable names, and code identifiers exactly when visible.
- If a line is uncertain, compare against the original image before inventing missing content.
Validate before final
- Confirm the final Markdown has no screenshot-section structure unless the original source was actually screenshot-indexed.
- Confirm code fences are balanced.
- Confirm image references, if any, resolve.
- Search for obvious OCR garbage patterns:
????, 1111, 1I1I, uouua, Japeps, FastAPl, Agont, 检素.
- Report residual uncertainty only if specific sections remain ambiguous after checking the image.
Output Naming
Use a clear final name near the image folder, for example:
technical_document_rebuilt.md
<project>_technical_document.md
<source-folder-name>_rebuilt.md
Keep OCR intermediates in an ocr_output folder beside the final document.
Practical Notes
- Terminal display of Chinese can be mojibake on Windows. Verify file contents with Python
Path.read_text(encoding="utf-8") rather than trusting Get-Content rendering.
- For code screenshots, prefer reconstructing likely valid code over preserving OCR line-by-line noise, but do not change the intended logic.
- For interview-prep documents, keep both "short answer" and "detailed answer" sections if present.
- For architecture/flow documents, Mermaid is usually better than embedding screenshots because it makes the result editable and searchable.
1---2name: image-tech-md-rebuilder-23description: Rebuild complete technical Markdown documents from screenshot image folders. Use when the user gives an image path or folder of screenshots from a non-copyable cloud document, especially Chinese/English technical notes, interview prep, architecture docs, code snippets, tables, diagrams, or asks to "复刻/还原/提取图片里的MD/技术文档" rather than produce per-image OCR.4---567## Claude Code Migration Notes89This skill was migrated from the local Codex skill registry for Claude Code. Use it as a Claude Code `SKILL.md` skill. Some source text may name Codex-only tools or channels; in Claude Code, use the closest available Claude Code tool, shell command, MCP/plugin integration, or local helper script. Keep secrets in Keychain, environment variables, or authenticated CLIs only.1011# Image Tech MD Rebuilder1213## Goal1415Convert ordered screenshots of a non-copyable technical document into one coherent Markdown document. The deliverable must read like the original source document, not like an OCR dump.1617## Required Output Standard1819- Produce a continuous technical `.md` file with the original document structure.20- Rebuild headings, paragraphs, numbered lists, tables, code blocks, and diagrams semantically.21- Use Mermaid for flowcharts, sequence diagrams, state flows, and architecture diagrams when the screenshot contains a diagram that can be faithfully represented.22- Preserve important screenshots as image references only when OCR/Markdown cannot represent the content reliably.23- Never deliver a final document organized as "screenshot 01 text, screenshot 02 text". That format is only allowed as an intermediate OCR scaffold.24- State the final absolute output path.2526## Workflow27281. **Inventory images**29 - Accept a single image path or an image folder.30 - Sort screenshots by filename and timestamp unless the user gives a different order.31 - Count images and inspect formats/sizes.32332. **Run OCR into intermediate artifacts**34 - Prefer the bundled script:3536```powershell37uv run --with rapidocr --with onnxruntime --with pillow python C:\Users\18357\.codex\skills\image-tech-md-rebuilder\scripts\ocr_image_folder.py --image-dir "<IMAGE_DIR>" --out-dir "<WORK_DIR>\ocr_output"38```3940 - If `rapidocr` fails, try `rapidocr_onnxruntime`, PaddleOCR, Tesseract, or a vision model if available.41 - Keep raw OCR artifacts for audit: JSON, plain text dump, and scaffold Markdown.42433. **Rebuild the document, do not summarize**44 - Read the OCR dump in order.45 - Merge text that is split across screenshot boundaries.46 - Identify the source document hierarchy: title, intro, sections, Q&A headings, subheadings.47 - Reconstruct code from OCR into valid fenced code blocks.48 - Reconstruct tables as Markdown tables.49 - Reconstruct diagrams as Mermaid or compact ASCII if Mermaid would distort the content.50 - Remove screenshot artifacts: line numbers that are not part of code, duplicated repeated headers, OCR garbage, UI controls, cursor marks, and watermark clutter.51524. **Correct OCR systematically**53 - Fix common technical OCR errors:54 - `FastAPl` -> `FastAPI`55 - `JsoN` -> `JSON`56 - `LLA` / `1lm` -> `LLM` / `llm` by context57 - `MCPServer` -> `MCP Server`58 - `MCPClient` -> `MCP Client`59 - `StreamableHTTP` -> `Streamable HTTP`60 - `Server-SentEvents` -> `Server-Sent Events`61 - `检素` -> `检索`62 - `攻路` -> `攻略`63 - `Agont`, `Agint`, `Agein`, `Aget` -> `Agent`64 - Correct obvious punctuation and numbering errors from OCR, such as `1。` to `1.` in numbered lists.65 - Preserve domain terms, variable names, and code identifiers exactly when visible.66 - If a line is uncertain, compare against the original image before inventing missing content.67685. **Validate before final**69 - Confirm the final Markdown has no screenshot-section structure unless the original source was actually screenshot-indexed.70 - Confirm code fences are balanced.71 - Confirm image references, if any, resolve.72 - Search for obvious OCR garbage patterns: `????`, `1111`, `1I1I`, `uouua`, `Japeps`, `FastAPl`, `Agont`, `检素`.73 - Report residual uncertainty only if specific sections remain ambiguous after checking the image.7475## Output Naming7677Use a clear final name near the image folder, for example:7879- `technical_document_rebuilt.md`80- `<project>_technical_document.md`81- `<source-folder-name>_rebuilt.md`8283Keep OCR intermediates in an `ocr_output` folder beside the final document.8485## Practical Notes8687- Terminal display of Chinese can be mojibake on Windows. Verify file contents with Python `Path.read_text(encoding="utf-8")` rather than trusting `Get-Content` rendering.88- For code screenshots, prefer reconstructing likely valid code over preserving OCR line-by-line noise, but do not change the intended logic.89- For interview-prep documents, keep both "short answer" and "detailed answer" sections if present.90- For architecture/flow documents, Mermaid is usually better than embedding screenshots because it makes the result editable and searchable.