skills/gemini-translate/SKILL.md
Batch-translate content files using Gemini CLI as a subagent, with Claude orchestrating quality and validation
npx skillsauth add baphomet480/claude-skills gemini-translateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Batch-translate content files (markdown, JSON, YAML frontmatter) using Gemini CLI as a translation subagent. Claude orchestrates the pipeline: identifies gaps, builds prompts with glossary context, dispatches to Gemini in a single CLI call, validates output structure, and writes files.
gemini on PATH, OAuth configured)Claude: find translation gaps (missing .es.* files, parity tests)
|
Claude: read source files + glossary + existing translations for tone
|
Claude: build batch prompt and call gemini-translate.sh
|
Gemini: translate all files in one shot, return JSON
|
Claude: parse response, validate structure, write .es.* files
|
Claude: run project tests (i18n symmetry, coverage)
Find content files missing their locale counterpart:
# Generic pattern -- adjust paths and extensions for your project
for f in content/**/*.md; do
base=$(basename "$f")
[[ "$base" == *.es.* ]] && continue
name="${base%.*}"
dir=$(dirname "$f")
[ ! -f "$dir/${name}.es.md" ] && echo "MISSING: $f"
done
Or run your project's i18n parity tests if they exist.
Create a glossary of terms that must be translated consistently. The glossary is a simple text block embedded in the prompt:
## Glossary (EN -> ES)
- "OB/GYN Physician" -> "Medico OB/GYN"
- "High-risk pregnancy" -> "Embarazo de alto riesgo"
- "Certified Nurse Midwife" -> "Enfermera Partera Certificada"
If your project has an existing glossary (Python dict, CSV, JSON), convert it to this format before calling the script. The script accepts a glossary file via --glossary.
bash gemini-translate.sh \
--source-lang en \
--target-lang es \
--glossary glossary.txt \
--model gemini-2.5-pro \
--instructions "Use formal 'usted'. Latin American Spanish, not Spain. Warm but professional tone for patient-facing medical content." \
file1.md file2.md file3.md
The script:
gemini -p "..." -o json --approval-mode planAfter the script returns, Claude should:
<!-- REVIEW: --> flags from Gemini (or surface them to the user).es.* filesgemini-translate.shUsage: gemini-translate.sh [OPTIONS] FILE [FILE...]
Options:
--source-lang LANG Source language code (default: en)
--target-lang LANG Target language code (default: es)
--glossary FILE Path to glossary file (term mappings, one per line)
--instructions TEXT Additional translation instructions for tone/style
--model MODEL Gemini model override (default: system default)
--max-tokens N Max estimated input tokens per batch (default: 80000)
--gemini-bin PATH Path to gemini binary (bypasses wrapper detection)
--dry-run Print the prompt without calling Gemini
Output: JSON array to stdout
[
{"file": "about.md", "translation": "---\ntitle: Acerca de\n---\n..."},
{"file": "careers.md", "translation": "---\ntitle: Carreras\n---\n..."}
]
Exit codes:
0 Success
1 Gemini CLI not found or not authenticated
2 No input files provided
3 Gemini returned an error or unparseable output
These rules are embedded in the prompt sent to Gemini:
<!-- REVIEW: original term -->This skill is project-agnostic. To use it on a new codebase:
.es.md, .es.json, locales/es/, etc.)Many users have a shell wrapper (e.g., ~/bin/gemini) that adds --yolo/-y by default. This conflicts with --approval-mode. The script avoids this by:
pnpx @google/gemini-cli (calls the package directly, no wrapper)gemini on PATH only if pnpx is unavailable--gemini-bin /path/to/binary to override detection entirelyThe script uses -o json for structured output, which returns a {session_id, response, stats} envelope. The embedded Python parser extracts the response field and handles markdown code fences, null bytes, and MCP warning prefixes automatically.
Instead of a fixed file count, the script estimates input tokens (1 token ~ 4 chars) and stops adding files when the budget is reached. The default --max-tokens 80000 leaves room for the translation output (roughly 1.2x the input for EN->ES). Files that exceed the budget are listed as skipped so the caller can run a follow-up batch.
When Gemini hits its output token limit and truncates the JSON mid-entry, the script recovers by:
.es.* files separately so you can easily revert if the model hallucinated structure.--max-tokens.development
Sets up, configures, and optimizes Google Analytics 4 (GA4) properties. Evaluates websites for proper GA4 implementation, tracking codes, and configuration improvements. Uses the Google Analytics Admin API for programmatic setup or provides manual integration paths via gtag.js or Next.js Third Parties.
development
Open-source intelligence on people, companies, domains, and B2B accounts. Use when the user wants to investigate, vet, research, or build a dossier on a target — phrases like "OSINT", "due diligence", "background check", "research this person", "look into [company/domain]", "vet this prospect/vendor", "what does X do", "is this account worth pursuing", "find me a contact at", "who's the buyer for", or any open-source investigation task. Disambiguates identities before reporting and grades every claim by independent source count.
development
Generate, edit, describe, restyle, restore, thumbnail, and batch-process images using xAI (Grok) or OpenAI image APIs and GPT-4o vision. Default provider is xAI ($0.02/image flat rate). Use this skill whenever the user asks to generate, create, make, draw, or design an image or picture using AI, or wants to edit, modify, transform, restyle, composite, or inpaint an existing image. Also handles image description and alt-text generation, background removal, style transfer, photo restoration, thumbnail creation, and batch generation from JSON manifests. Trigger when the user mentions DALL-E, gpt-image, Grok image, xAI image, OpenAI image generation, or wants AI-generated visuals for any purpose (logos, mockups, illustrations, thumbnails, icons, concept art, memes). Also trigger for batch image generation, generating a set or series of images, processing multiple images from a manifest, or creating consistent image collections. If the user says "make me an image of...", "generate a picture", "edit this photo to...", "describe this image", "remove the background", "make this look like watercolor", "restore this old photo", "create a thumbnail", "generate a batch of images", or "process this image manifest", this is the skill to use.
testing
Agentic OS Orchestrator. Process and execute tasks from the shared .agent/state/tasks.json queue. Use when the user asks to 'check the queue', 'process tasks', or run the heartbeat.