Communitygithub.com

visa-doc-translate

将签证申请文档图片翻译成英文,并生成包含原文与译文的双语PDF文件。

visa-doc-translate 是什么?

这是一项专为签证申请场景设计的高级技能,能够自动将用户提供的文档图片(如存款证明、收入证明、在职证明等)进行图像处理、OCR文字识别、专业翻译和双语PDF生成。它首先利用macOS Vision框架、EasyOCR或Tesseract等OCR引擎提取文本,然后根据文档类型使用恰当的术语进行英译,并保留数字、日期、金额的精度。最后通过Python脚本生成标准A4版式的PDF,第一页展示旋转校正后的原始图像,第二页呈现格式规整的英文译文,底部附带认证声明。该技能支持macOS及跨平台环境,原生集成Claude Code、Cursor、Codex等AI开发工具,用户只需提供文件路径即可一键完成全套流程,极大提升签证材料翻译效率。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

你正在帮助翻译签证申请文件,以便用于签证申请。

说明

当用户提供图片文件路径时,请自动执行以下步骤,无需请求确认:

  1. 图像转换:如果文件是 HEIC 格式,使用 sips -s format png <输入文件> --out <输出文件> 转换为 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. 输出:在相同目录下创建名为 <原文件名>_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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

相关技能