feat(skills): add visa-doc-translatefeat(skills): Add visa-doc-translate skill for automated document translation skill - #255
Conversation
Add automated visa document translation skill that: - Supports multiple OCR methods (macOS Vision, EasyOCR, Tesseract) - Translates documents to professional English - Generates bilingual PDFs (original + translation) - Handles various document types (bank statements, employment certificates, etc.) - Perfect for visa applications to Australia, USA, Canada, UK, EU Tested with retirement certificates and other official documents.
📝 WalkthroughWalkthroughTwo documentation files introduce a Visa Document Translator skill: a tool that automatically converts visa application document images into bilingual English PDFs using OCR and translation. README provides project overview and setup; SKILL.md details the technical workflow including image conversion, EXIF rotation, multi-method OCR, translation, and PDF generation. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
skills/visa-doc-translate/SKILL.md (1)
1-4: File naming uses uppercase, violating the lowercase-hyphen convention.
SKILL.mduses all-uppercase. The{agents,skills,commands,hooks}/**/*.{md,json}guideline requires lowercase with hyphens (e.g.,visa-doc-translate.md). The same applies toREADME.mdin the same directory.As per coding guidelines:
{agents,skills,commands,hooks}/**/*.{md,json}— "Use lowercase with hyphens for file naming (e.g.,python-reviewer.md,tdd-workflow.md)."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@skills/visa-doc-translate/SKILL.md` around lines 1 - 4, Rename the uppercase files to lowercase-hyphen format: change SKILL.md to visa-doc-translate.md and README.md to readme.md (or visa-doc-translate-readme.md if needed for clarity), update any internal references or metadata that point to SKILL.md or README.md (e.g., in manifests, documentation links, package entries) so they reference the new filenames, and ensure CI/config that loads `{agents,skills,commands,hooks}/**/*.{md,json}` picks up the renamed files; test by running the repo docs/manifest checks to confirm no broken links.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@skills/visa-doc-translate/README.md`:
- Line 9: Update the README entry for the "🌍 **Multi-language**" bullet by
removing the spurious comma: change the text "Supports Chinese, and other
languages" to "Supports Chinese and other languages" so the sentence reads
correctly; locate the string inside the README.md and edit that exact bullet
line.
- Around line 1-86: Add a "When to Use" section immediately after the intro
paragraph that states the conditions/triggers for invoking this skill (e.g.,
single-page scanned visa documents or photos, image formats supported including
HEIC/PNG/JPG, non-English text requiring professional English translation, and
cases needing a bilingual A4 PDF for official submissions), include examples of
appropriate and inappropriate use cases (bank statements, employment letters,
not for multi-page PDFs or handwritten notes), and mention any prerequisites
(clear legible images, supported OCR availability) to guide callers before the
existing "How It Works" and "Usage"/Examples sections.
In `@skills/visa-doc-translate/SKILL.md`:
- Line 6: The SKILL.md for visa-doc-translate lacks PII/data-handling guidance
for sensitive documents (passports, ID cards, bank statements), so update
SKILL.md and the README for the visa-doc-translate skill to explicitly state:
what data is processed locally vs transmitted externally (e.g., whether
OCR/translation requests go to cloud APIs), how temporary files and OCR caches
are created and securely deleted (ensure automated cleanup after processing),
and how user consent/disclosure is obtained (present explicit consent text or
settings before uploading or transmitting data); reference the skill name
"visa-doc-translate", the documentation files "SKILL.md" and "README", and any
relevant processing functions or modules that perform OCR/translation so
developers can link the guidance to the actual implementation.
- Around line 37-44: Remove the instruction that tells the agent to run
arbitrary code ("Execute the script to generate the PDF") and replace it with a
safer alternative: either (A) instruct the agent to output the complete, fixed
Python script using PIL/reportlab for the user to review and run locally, or (B)
include a vetted, static PDF-generation template and explicitly state that the
user must run it themselves; update the SKILL.md steps so step 5 references the
non-executing options and points to the script/template (e.g., the generated
script filename or template name) and a clear manual run command, ensuring no
automatic execution is requested.
- Line 43: Remove the legally problematic certified-translation claim added in
SKILL.md (the line adding "This is a certified English translation of the
original document") and replace it with an explicit, non-certified disclaimer
that the output is AI-generated and not a legally certified translation; update
the note text to something like "This translation was generated by an AI and is
not a certified translation; for official immigration use obtain a signed
translation from a qualified human translator," and ensure any references to
"certified" are removed from the skill metadata and user-facing strings.
- Line 17: The documentation incorrectly states that EXIF orientation 6 should
be rotated 90° counterclockwise; update the text to say EXIF orientation 6
requires a 90° clockwise correction (equivalently Image.ROTATE_270 or
image.rotate(270, expand=True) in Pillow) so the code examples and instructions
consistently use Image.ROTATE_270 / rotate(270) when handling orientation == 6.
- Around line 1-117: The SKILL.md is missing the required "When to Use" section;
add a "When to Use" header immediately after the frontmatter/intro and provide
2–4 concise bullets describing scenarios where visa-doc-translate should be used
(e.g., translating official visa application documents like bank deposit
certificates, employment letters, passports, HEIC images from phones, and when a
bilingual PDF is required), keep the existing "Instructions" (How It Works) and
"Example Usage" (Examples) sections intact but rename or ensure headers match
"How It Works" and "Examples" if needed, and include one short example use-case
line to satisfy the Examples guideline.
---
Nitpick comments:
In `@skills/visa-doc-translate/SKILL.md`:
- Around line 1-4: Rename the uppercase files to lowercase-hyphen format: change
SKILL.md to visa-doc-translate.md and README.md to readme.md (or
visa-doc-translate-readme.md if needed for clarity), update any internal
references or metadata that point to SKILL.md or README.md (e.g., in manifests,
documentation links, package entries) so they reference the new filenames, and
ensure CI/config that loads `{agents,skills,commands,hooks}/**/*.{md,json}`
picks up the renamed files; test by running the repo docs/manifest checks to
confirm no broken links.
| # Visa Document Translator | ||
|
|
||
| Automatically translate visa application documents from images to professional English PDFs. | ||
|
|
||
| ## Features | ||
|
|
||
| - 🔄 **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) | ||
| - 📄 **Bilingual PDF**: Original image + professional English translation | ||
| - 🌍 **Multi-language**: Supports Chinese, and other languages | ||
| - 📋 **Professional Format**: Suitable for official visa applications | ||
| - 🚀 **Fully Automated**: No manual intervention required | ||
|
|
||
| ## Supported Documents | ||
|
|
||
| - Bank deposit certificates (存款证明) | ||
| - Employment certificates (在职证明) | ||
| - Retirement certificates (退休证明) | ||
| - Income certificates (收入证明) | ||
| - Property certificates (房产证明) | ||
| - Business licenses (营业执照) | ||
| - ID cards and passports | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| /visa-doc-translate <image-file> | ||
| ``` | ||
|
|
||
| ### Examples | ||
|
|
||
| ```bash | ||
| /visa-doc-translate RetirementCertificate.PNG | ||
| /visa-doc-translate BankStatement.HEIC | ||
| /visa-doc-translate EmploymentLetter.jpg | ||
| ``` | ||
|
|
||
| ## Output | ||
|
|
||
| Creates `<filename>_Translated.pdf` with: | ||
| - **Page 1**: Original document image (centered, A4 size) | ||
| - **Page 2**: Professional English translation | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Python Libraries | ||
| ```bash | ||
| pip install pillow reportlab | ||
| ``` | ||
|
|
||
| ### OCR (one of the following) | ||
|
|
||
| **macOS (recommended)**: | ||
| ```bash | ||
| pip install pyobjc-framework-Vision pyobjc-framework-Quartz | ||
| ``` | ||
|
|
||
| **Cross-platform**: | ||
| ```bash | ||
| pip install easyocr | ||
| ``` | ||
|
|
||
| **Tesseract**: | ||
| ```bash | ||
| brew install tesseract tesseract-lang | ||
| pip install pytesseract | ||
| ``` | ||
|
|
||
| ## How It Works | ||
|
|
||
| 1. Converts HEIC to PNG if needed | ||
| 2. Checks and applies EXIF rotation | ||
| 3. Extracts text using available OCR method | ||
| 4. Translates to professional English | ||
| 5. Generates bilingual PDF | ||
|
|
||
| ## Perfect For | ||
|
|
||
| - 🇦🇺 Australia visa applications | ||
| - 🇺🇸 USA visa applications | ||
| - 🇨🇦 Canada visa applications | ||
| - 🇬🇧 UK visa applications | ||
| - 🇪🇺 EU visa applications | ||
|
|
||
| ## License | ||
|
|
||
| MIT |
There was a problem hiding this comment.
Missing required "When to Use" section.
The skills/**/*.md guideline requires clear sections for When to Use, How It Works, and Examples. This file has "How It Works" and "Examples" (under Usage) but is missing a "When to Use" section that describes the conditions or triggers under which this skill should be invoked.
✏️ Suggested addition (after the intro paragraph)
Automatically translate visa application documents from images to professional English PDFs.
+
+## When to Use
+
+- When a user has a foreign-language official document (e.g., Chinese bank statement, retirement certificate) that must be submitted in English for a visa application.
+- When the source document is provided as an image file (JPEG, PNG, HEIC).
+- When a bilingual PDF (original + English translation) is required for submission to immigration authorities.As per coding guidelines: skills/**/*.md — "Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples."
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Visa Document Translator | |
| Automatically translate visa application documents from images to professional English PDFs. | |
| ## Features | |
| - 🔄 **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) | |
| - 📄 **Bilingual PDF**: Original image + professional English translation | |
| - 🌍 **Multi-language**: Supports Chinese, and other languages | |
| - 📋 **Professional Format**: Suitable for official visa applications | |
| - 🚀 **Fully Automated**: No manual intervention required | |
| ## Supported Documents | |
| - Bank deposit certificates (存款证明) | |
| - Employment certificates (在职证明) | |
| - Retirement certificates (退休证明) | |
| - Income certificates (收入证明) | |
| - Property certificates (房产证明) | |
| - Business licenses (营业执照) | |
| - ID cards and passports | |
| ## Usage | |
| ```bash | |
| /visa-doc-translate <image-file> | |
| ``` | |
| ### Examples | |
| ```bash | |
| /visa-doc-translate RetirementCertificate.PNG | |
| /visa-doc-translate BankStatement.HEIC | |
| /visa-doc-translate EmploymentLetter.jpg | |
| ``` | |
| ## Output | |
| Creates `<filename>_Translated.pdf` with: | |
| - **Page 1**: Original document image (centered, A4 size) | |
| - **Page 2**: Professional English translation | |
| ## Requirements | |
| ### Python Libraries | |
| ```bash | |
| pip install pillow reportlab | |
| ``` | |
| ### OCR (one of the following) | |
| **macOS (recommended)**: | |
| ```bash | |
| pip install pyobjc-framework-Vision pyobjc-framework-Quartz | |
| ``` | |
| **Cross-platform**: | |
| ```bash | |
| pip install easyocr | |
| ``` | |
| **Tesseract**: | |
| ```bash | |
| brew install tesseract tesseract-lang | |
| pip install pytesseract | |
| ``` | |
| ## How It Works | |
| 1. Converts HEIC to PNG if needed | |
| 2. Checks and applies EXIF rotation | |
| 3. Extracts text using available OCR method | |
| 4. Translates to professional English | |
| 5. Generates bilingual PDF | |
| ## Perfect For | |
| - 🇦🇺 Australia visa applications | |
| - 🇺🇸 USA visa applications | |
| - 🇨🇦 Canada visa applications | |
| - 🇬🇧 UK visa applications | |
| - 🇪🇺 EU visa applications | |
| ## License | |
| MIT | |
| # Visa Document Translator | |
| Automatically translate visa application documents from images to professional English PDFs. | |
| ## When to Use | |
| - When a user has a foreign-language official document (e.g., Chinese bank statement, retirement certificate) that must be submitted in English for a visa application. | |
| - When the source document is provided as an image file (JPEG, PNG, HEIC). | |
| - When a bilingual PDF (original + English translation) is required for submission to immigration authorities. | |
| ## Features | |
| - 🔄 **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) | |
| - 📄 **Bilingual PDF**: Original image + professional English translation | |
| - 🌍 **Multi-language**: Supports Chinese, and other languages | |
| - 📋 **Professional Format**: Suitable for official visa applications | |
| - 🚀 **Fully Automated**: No manual intervention required | |
| ## Supported Documents | |
| - Bank deposit certificates (存款证明) | |
| - Employment certificates (在职证明) | |
| - Retirement certificates (退休证明) | |
| - Income certificates (收入证明) | |
| - Property certificates (房产证明) | |
| - Business licenses (营业执照) | |
| - ID cards and passports | |
| ## Usage | |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/README.md` around lines 1 - 86, Add a "When to Use"
section immediately after the intro paragraph that states the
conditions/triggers for invoking this skill (e.g., single-page scanned visa
documents or photos, image formats supported including HEIC/PNG/JPG, non-English
text requiring professional English translation, and cases needing a bilingual
A4 PDF for official submissions), include examples of appropriate and
inappropriate use cases (bank statements, employment letters, not for multi-page
PDFs or handwritten notes), and mention any prerequisites (clear legible images,
supported OCR availability) to guide callers before the existing "How It Works"
and "Usage"/Examples sections.
|
|
||
| - 🔄 **Automatic OCR**: Tries multiple OCR methods (macOS Vision, EasyOCR, Tesseract) | ||
| - 📄 **Bilingual PDF**: Original image + professional English translation | ||
| - 🌍 **Multi-language**: Supports Chinese, and other languages |
There was a problem hiding this comment.
Minor grammar: spurious comma.
"Supports Chinese, and other languages" — the Oxford comma is misplaced here since there are only two items in the list. Should be "Supports Chinese and other languages".
✏️ Proposed fix
- - 🌍 **Multi-language**: Supports Chinese, and other languages
+ - 🌍 **Multi-language**: Supports Chinese and other languages📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - 🌍 **Multi-language**: Supports Chinese, and other languages | |
| - 🌍 **Multi-language**: Supports Chinese and other languages |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/README.md` at line 9, Update the README entry for
the "🌍 **Multi-language**" bullet by removing the spurious comma: change the
text "Supports Chinese, and other languages" to "Supports Chinese and other
languages" so the sentence reads correctly; locate the string inside the
README.md and edit that exact bullet line.
| --- | ||
| name: visa-doc-translate | ||
| description: Translate visa application documents (images) to English and create a bilingual PDF with original and translation | ||
| --- | ||
|
|
||
| You are helping translate visa application documents for visa applications. | ||
|
|
||
| ## Instructions | ||
|
|
||
| When the user provides an image file path, AUTOMATICALLY execute the following steps WITHOUT asking for confirmation: | ||
|
|
||
| 1. **Image Conversion**: If the file is HEIC, convert it to PNG using `sips -s format png <input> --out <output>` | ||
|
|
||
| 2. **Image Rotation**: | ||
| - Check EXIF orientation data | ||
| - Automatically rotate the image based on EXIF data | ||
| - If EXIF orientation is 6, rotate 90 degrees counterclockwise | ||
| - Apply additional rotation as needed (test 180 degrees if document appears upside down) | ||
|
|
||
| 3. **OCR Text Extraction**: | ||
| - Try multiple OCR methods automatically: | ||
| - macOS Vision framework (preferred for macOS) | ||
| - EasyOCR (cross-platform, no tesseract required) | ||
| - Tesseract OCR (if available) | ||
| - Extract all text information from the document | ||
| - Identify document type (deposit certificate, employment certificate, retirement certificate, etc.) | ||
|
|
||
| 4. **Translation**: | ||
| - Translate all text content to English professionally | ||
| - Maintain the original document structure and format | ||
| - Use professional terminology appropriate for visa applications | ||
| - Keep proper names in original language with English in parentheses | ||
| - For Chinese names, use pinyin format (e.g., WU Zhengye) | ||
| - Preserve all numbers, dates, and amounts accurately | ||
|
|
||
| 5. **PDF Generation**: | ||
| - Create a Python script using PIL and reportlab libraries | ||
| - Page 1: Display the rotated original image, centered and scaled to fit A4 page | ||
| - Page 2: Display the English translation with proper formatting: | ||
| - Title centered and bold | ||
| - Content left-aligned with appropriate spacing | ||
| - Professional layout suitable for official documents | ||
| - Add a note at the bottom: "This is a certified English translation of the original document" | ||
| - Execute the script to generate the PDF | ||
|
|
||
| 6. **Output**: Create a PDF file named `<original_filename>_Translated.pdf` in the same directory | ||
|
|
||
| ## Supported Documents | ||
|
|
||
| - Bank deposit certificates (存款证明) | ||
| - Income certificates (收入证明) | ||
| - Employment certificates (在职证明) | ||
| - Retirement certificates (退休证明) | ||
| - Property certificates (房产证明) | ||
| - Business licenses (营业执照) | ||
| - ID cards and passports | ||
| - Other official documents | ||
|
|
||
| ## Technical Implementation | ||
|
|
||
| ### OCR Methods (tried in order) | ||
|
|
||
| 1. **macOS Vision Framework** (macOS only): | ||
| ```python | ||
| import Vision | ||
| from Foundation import NSURL | ||
| ``` | ||
|
|
||
| 2. **EasyOCR** (cross-platform): | ||
| ```bash | ||
| pip install easyocr | ||
| ``` | ||
|
|
||
| 3. **Tesseract OCR** (if available): | ||
| ```bash | ||
| brew install tesseract tesseract-lang | ||
| pip install pytesseract | ||
| ``` | ||
|
|
||
| ### Required Python Libraries | ||
|
|
||
| ```bash | ||
| pip install pillow reportlab | ||
| ``` | ||
|
|
||
| For macOS Vision framework: | ||
| ```bash | ||
| pip install pyobjc-framework-Vision pyobjc-framework-Quartz | ||
| ``` | ||
|
|
||
| ## Important Guidelines | ||
|
|
||
| - DO NOT ask for user confirmation at each step | ||
| - Automatically determine the best rotation angle | ||
| - Try multiple OCR methods if one fails | ||
| - Ensure all numbers, dates, and amounts are accurately translated | ||
| - Use clean, professional formatting | ||
| - Complete the entire process and report the final PDF location | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```bash | ||
| /visa-doc-translate RetirementCertificate.PNG | ||
| /visa-doc-translate BankStatement.HEIC | ||
| /visa-doc-translate EmploymentLetter.jpg | ||
| ``` | ||
|
|
||
| ## Output Example | ||
|
|
||
| The skill will: | ||
| 1. Extract text using available OCR method | ||
| 2. Translate to professional English | ||
| 3. Generate `<filename>_Translated.pdf` with: | ||
| - Page 1: Original document image | ||
| - Page 2: Professional English translation | ||
|
|
||
| Perfect for visa applications to Australia, USA, Canada, UK, and other countries requiring translated documents. |
There was a problem hiding this comment.
Missing required "When to Use" section.
Per the skills/**/*.md guideline, all skill files must include When to Use, How It Works, and Examples sections. This file has "Instructions" (How It Works) and "Example Usage" (Examples) but has no "When to Use" section.
✏️ Suggested addition (after the frontmatter/intro)
You are helping translate visa application documents for visa applications.
+
+## When to Use
+
+- User provides a path to a foreign-language document image (JPEG, PNG, HEIC) and needs an English translation for a visa application.
+- User explicitly requests bilingual PDF output combining the original document image with an English translation.
+- The document is one of the supported official types (bank certificate, ID, passport, employment letter, etc.).
+Instructions
</details>
As per coding guidelines: `skills/**/*.md` — "Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples."
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @skills/visa-doc-translate/SKILL.md around lines 1 - 117, The SKILL.md is
missing the required "When to Use" section; add a "When to Use" header
immediately after the frontmatter/intro and provide 2–4 concise bullets
describing scenarios where visa-doc-translate should be used (e.g., translating
official visa application documents like bank deposit certificates, employment
letters, passports, HEIC images from phones, and when a bilingual PDF is
required), keep the existing "Instructions" (How It Works) and "Example Usage"
(Examples) sections intact but rename or ensure headers match "How It Works" and
"Examples" if needed, and include one short example use-case line to satisfy the
Examples guideline.
</details>
<!-- fingerprinting:phantom:triton:churro -->
<!-- This is an auto-generated comment by CodeRabbit -->
| description: Translate visa application documents (images) to English and create a bilingual PDF with original and translation | ||
| --- | ||
|
|
||
| You are helping translate visa application documents for visa applications. |
There was a problem hiding this comment.
No PII/data handling guidance for highly sensitive identity documents.
The skill processes passports, ID cards, bank statements, and income certificates — documents containing passport numbers, national ID numbers, bank account details, full legal names, and financial figures. The instructions make no mention of:
- Whether OCR/translation data leaves the local machine (e.g., is sent to a cloud API).
- Temporary file cleanup after processing.
- User consent or disclosure about data handling.
For visa applications targeting GDPR jurisdictions (EU/UK), PIPEDA (Canada), and the Australian Privacy Act, absence of this guidance is a compliance gap. At minimum, add a note to the instructions and README clarifying what data is processed locally vs. transmitted externally.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/SKILL.md` at line 6, The SKILL.md for
visa-doc-translate lacks PII/data-handling guidance for sensitive documents
(passports, ID cards, bank statements), so update SKILL.md and the README for
the visa-doc-translate skill to explicitly state: what data is processed locally
vs transmitted externally (e.g., whether OCR/translation requests go to cloud
APIs), how temporary files and OCR caches are created and securely deleted
(ensure automated cleanup after processing), and how user consent/disclosure is
obtained (present explicit consent text or settings before uploading or
transmitting data); reference the skill name "visa-doc-translate", the
documentation files "SKILL.md" and "README", and any relevant processing
functions or modules that perform OCR/translation so developers can link the
guidance to the actual implementation.
| 2. **Image Rotation**: | ||
| - Check EXIF orientation data | ||
| - Automatically rotate the image based on EXIF data | ||
| - If EXIF orientation is 6, rotate 90 degrees counterclockwise |
There was a problem hiding this comment.
Incorrect rotation direction for EXIF orientation 6 — document will appear sideways.
EXIF orientation 6 means the camera was rotated 90° clockwise, so correcting it requires a 90° clockwise rotation (equivalently Image.ROTATE_270 / rotate(270) in Pillow). The instruction says "counterclockwise," which will rotate the document into the wrong orientation and produce an unreadable PDF page.
The established Pillow convention maps EXIF orientation 6 → Image.ROTATE_270, and multiple reference implementations confirm elif exif[orientation] == 6: image = image.rotate(270, expand=True).
✏️ Proposed fix
- - If EXIF orientation is 6, rotate 90 degrees counterclockwise
+ - If EXIF orientation is 6, rotate 90 degrees clockwise (i.e., 270° counterclockwise in Pillow: `image.rotate(270, expand=True)`)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - If EXIF orientation is 6, rotate 90 degrees counterclockwise | |
| - If EXIF orientation is 6, rotate 90 degrees clockwise (i.e., 270° counterclockwise in Pillow: `image.rotate(270, expand=True)`) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/SKILL.md` at line 17, The documentation incorrectly
states that EXIF orientation 6 should be rotated 90° counterclockwise; update
the text to say EXIF orientation 6 requires a 90° clockwise correction
(equivalently Image.ROTATE_270 or image.rotate(270, expand=True) in Pillow) so
the code examples and instructions consistently use Image.ROTATE_270 /
rotate(270) when handling orientation == 6.
| - Create a Python script using PIL and reportlab libraries | ||
| - Page 1: Display the rotated original image, centered and scaled to fit A4 page | ||
| - Page 2: Display the English translation with proper formatting: | ||
| - Title centered and bold | ||
| - Content left-aligned with appropriate spacing | ||
| - Professional layout suitable for official documents | ||
| - Add a note at the bottom: "This is a certified English translation of the original document" | ||
| - Execute the script to generate the PDF |
There was a problem hiding this comment.
AI-generated script execution is a sandboxing/safety risk.
Step 5 instructs the agent to both generate and immediately execute an arbitrary Python script (Execute the script to generate the PDF). This pattern grants the agent unrestricted code execution on the user's machine — any bug, injection via OCR-extracted text, or adversarial document content could lead to unintended filesystem operations or code execution with the user's full privileges. Consider either:
- Generating the script for the user to review and run themselves, or
- Inlining the PDF generation logic as a fixed, audited script template rather than having the LLM generate it ad hoc.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/SKILL.md` around lines 37 - 44, Remove the
instruction that tells the agent to run arbitrary code ("Execute the script to
generate the PDF") and replace it with a safer alternative: either (A) instruct
the agent to output the complete, fixed Python script using PIL/reportlab for
the user to review and run locally, or (B) include a vetted, static
PDF-generation template and explicitly state that the user must run it
themselves; update the SKILL.md steps so step 5 references the non-executing
options and points to the script/template (e.g., the generated script filename
or template name) and a clear manual run command, ensuring no automatic
execution is requested.
| - Title centered and bold | ||
| - Content left-aligned with appropriate spacing | ||
| - Professional layout suitable for official documents | ||
| - Add a note at the bottom: "This is a certified English translation of the original document" |
There was a problem hiding this comment.
"Certified English translation" claim is legally fraudulent in visa contexts.
Appending "This is a certified English translation of the original document" to an AI-generated output is legally problematic. In immigration contexts (Australia, USA, Canada, UK, EU — all named target markets), a "certified translation" is a specific legal artifact: it must be signed by a qualified human translator attesting to its accuracy, and in many jurisdictions it must include the translator's credentials and declaration of competency. An AI-generated document bearing this statement could constitute fraud in a visa application and expose the user to serious legal liability.
Either remove this note entirely or replace it with a disclaimer that makes the AI-generated, non-certified nature explicit, e.g.:
✏️ Proposed fix
- - Add a note at the bottom: "This is a certified English translation of the original document"
+ - Add a note at the bottom: "This is an AI-assisted English translation of the original document. This translation has not been certified by a professional translator and may not satisfy official certification requirements."📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - Add a note at the bottom: "This is a certified English translation of the original document" | |
| - Add a note at the bottom: "This is an AI-assisted English translation of the original document. This translation has not been certified by a professional translator and may not satisfy official certification requirements." |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@skills/visa-doc-translate/SKILL.md` at line 43, Remove the legally
problematic certified-translation claim added in SKILL.md (the line adding "This
is a certified English translation of the original document") and replace it
with an explicit, non-certified disclaimer that the output is AI-generated and
not a legally certified translation; update the note text to something like
"This translation was generated by an AI and is not a certified translation; for
official immigration use obtain a signed translation from a qualified human
translator," and ensure any references to "certified" are removed from the skill
metadata and user-facing strings.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: doc-only changes look good. Approving.
LGTM — visa-doc-translate skill. On-device OCR only, no external calls.
Description
Add a new skill for automatically translating visa application documents to English with
bilingual PDF generation.
Features
Supported Documents
Usage