Communitygithub.com

visa-doc-translate

將簽證申請文件(圖片)翻譯成英文,並生成包含原文與譯文的雙語 PDF。

visa-doc-translate 是什麼?

此技能專為簽證申請文件(如存款證明、在職證明、退休證明等)的翻譯需求設計。用戶提供圖片路徑後,技能會自動執行 HEIC 轉 PNG、根據 EXIF 旋轉校正、透過多種 OCR 方式(macOS Vision、EasyOCR、Tesseract)提取文字,再將所有內容專業翻譯為英文(保留專有名稱並附加拼音或原文),最後使用 Python(Pillow + ReportLab)生成 A4 大小的雙語 PDF:第一頁顯示校正後的原始圖片,第二頁呈現結構清晰的英文翻譯,並附上認證聲明。支援 macOS 及跨平台環境,無需逐步驟確認,自動完成整個流程並回報 PDF 路徑。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/visa-doc-translate

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

您正在協助翻譯簽證申請文件。

指示

當用戶提供圖片檔案路徑時,自動執行以下步驟,無需要求確認:

  1. 圖片轉換:若檔案為 HEIC,使用 sips -s format png <input> --out <output> 轉換為 PNG

  2. 圖片旋轉:

    • 檢查 EXIF 方向資料
    • 根據 EXIF 資料自動旋轉圖片
    • 若 EXIF 方向為 6,逆時針旋轉 90 度
    • 必要時套用額外旋轉(若文件上下顛倒,可測試 180 度)
  3. OCR 文字提取:

    • 自動嘗試多種 OCR 方式:
      • macOS Vision 框架(macOS 優先)
      • EasyOCR(跨平台,無需 tesseract)
      • Tesseract OCR(若可用)
    • 從文件中提取所有文字資訊
    • 識別文件類型(存款證明、在職證明、退休證明等)
  4. 翻譯:

    • 將所有文字內容專業翻譯成英文
    • 保留原始文件結構與格式
    • 使用適合簽證申請的專業術語
    • 專有名詞保留原文,並在括號內附上英文
    • 中文姓名使用拼音格式(如 WU Zhengye)
    • 準確保留所有數字、日期與金額
  5. PDF 生成:

    • 使用 PIL 與 reportlab 建立 Python 指令碼
    • 第 1 頁:顯示旋轉後的原始圖片,置中並縮放至 A4 頁面大小
    • 第 2 頁:顯示格式正確的英文翻譯:
      • 標題置中並加粗
      • 內容左對齊,並有適當間距
      • 適合官方文件的專業排版
    • 在頁面底部加入備註:「This is a certified English translation of the original document」
    • 執行指令碼以生成 PDF
  6. 輸出:在相同目錄下建立名為 <原始檔名>_Translated.pdf 的 PDF 檔案

支援的文件類型

  • 銀行存款證明(存款证明)
  • 收入證明(收入证明)
  • 在職證明(在职证明)
  • 退休證明(退休证明)
  • 房產證明(房产证明)
  • 營業執照(营业执照)
  • 身分證與護照
  • 其他官方文件

技術實作

OCR 方式(依序嘗試)

  1. macOS Vision 框架(僅 macOS):

    import Vision
    from Foundation import NSURL
    
  2. EasyOCR(跨平台):

    pip install easyocr
    
  3. Tesseract OCR(若可用):

    brew install tesseract tesseract-lang
    pip install pytesseract
    

所需 Python 函式庫

pip install pillow reportlab

若使用 macOS Vision 框架:

pip install pyobjc-framework-Vision pyobjc-framework-Quartz

重要指引

  • 請勿在每個步驟要求使用者確認
  • 自動判斷最佳旋轉角度
  • 若某種 OCR 方式失敗,請嘗試其他方式
  • 確保所有數字、日期與金額翻譯準確
  • 使用乾淨、專業的格式
  • 完成整個流程,並回報最終 PDF 位置

使用範例

/visa-doc-translate RetirementCertificate.PNG
/visa-doc-translate BankStatement.HEIC
/visa-doc-translate EmploymentLetter.jpg

輸出範例

此技能將:

  1. 使用可用的 OCR 方式提取文字
  2. 轉換為專業英文翻譯
  3. 生成 <檔名>_Translated.pdf,包含:
    • 第 1 頁:原始文件圖片
    • 第 2 頁:專業英文翻譯

非常適合用於澳洲、美國、加拿大、英國等需要翻譯文件的國家簽證申請。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

相關技能