Communitygithub.com

visa-doc-translate

将签证申请文档图像翻译成英文,并生成包含原文和译文的双语PDF文件。适用于需要将签证申请文档图像翻译为英文并生成双语PDF的场景。

visa-doc-translate 是什么?

这是一个专门用于签证申请文档翻译的AI技能。它能够自动处理用户提供的图像文件(如HEIC、PNG、JPG等),首先进行格式转换和EXIF旋转校正,然后通过OCR技术提取文本信息,并将其专业地翻译成英文。最后,它会生成一个易于阅读的双语PDF,第一页显示经过旋转的原图,第二页显示专业的英文翻译。该技能支持macOS Vision框架、EasyOCR和Tesseract OCR等多种OCR方法,并能自动选择最合适的方式。适用于银行存单、收入证明、身份证、营业执照等多种官方文档,是办理澳大利亚、美国、加拿大、英国等国家签证时的理想工具。

兼容平台~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页:显示格式正确的英文翻译:
      • 标题居中且加粗
      • 内容左对齐,间距适当
      • 适合官方文档的专业布局
    • 在底部添加注释:“这是原始文件的认证英文翻译”
    • 执行脚本以生成PDF
  6. 输出:在与原始文件相同的目录中创建名为 <original_filename>_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. 生成 <filename>_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.

相关技能