Claude Code Documentation Generation in Spanish Tutorial
Documentation is essential for any software project, but writing it manually in multiple languages takes significant time. If you work on projects with Spanish-speaking team members or serve Latin American markets, generating documentation directly in Spanish becomes a frequent requirement. Claude Code, combined with specialized skills, offers a practical way to automate this process.
This guide shows you how to set up a documentation generation workflow that produces Spanish-language output that produces Spanish-language output from your codebase. You will learn to configure Claude Code skills, generate different types of documentation, and integrate the workflow into your development process.
Prerequisites
Before starting, ensure you have:
- Claude Code installed on your system
- A project with source code to document
- Basic familiarity with running commands in your terminal
The following skills enhance the workflow but are not strictly required:
- pdf skill: For generating formatted PDF documentation
- supermemory skill: For storing terminology preferences across sessions
- tdd skill: For generating test documentation alongside code documentation
Setting Up Your Spanish Documentation Workflow
The foundation of generating Spanish documentation lies in how you structure your prompts. Claude Code responds to natural language instructions, so you can specify language preferences directly in your requests.
Create a dedicated skill configuration by creating a new skill file in your .claude/skills directory:
name: spanish-docs
description: Generate Spanish-language documentation for codebases
This skill file stores Spanish documentation instructions in its body. When you invoke it, Claude Code follows those instructions when generating documentation.
Project Configuration File
For consistent results across a project, create a claude-docs.json file in your project root to define language and output preferences:
{
"language": "es",
"documentation": {
"targetAudience": "developers",
"technicalLevel": "intermediate",
"tone": "professional",
"includeCodeExamples": true,
"codeLanguage": "javascript"
},
"output": {
"format": "markdown",
"includeTableOfContents": true,
"includeIndex": true
}
}
Claude Code works best when it understands the project context. At the start of each documentation session, provide this framing:
Estoy trabajando en [nombre del proyecto], una [tipo de aplicación]
destinada a [usuario objetivo]. El stack tecnológico es: [lista de tecnologías].
Genera documentación técnica en español siguiendo las convenciones de la industria.
Generating Function Documentation in Spanish
To document a specific function in Spanish, invoke Claude Code with a precise prompt:
Document this function in Spanish (es-MX).
Use JSDoc format. Include:
- Brief description
- @param with Spanish type descriptions
- @returns in Spanish
- One usage example
Source file: src/utils/calculator.js
Claude Code analyzes the function and produces Spanish documentation:
/**
* Suma dos números y devuelve el resultado.
*
* @param {number} a - El primer número a sumar
* @param {number} b - El segundo número a sumar
* @returns {number} La suma de los dos números proporcionados
*
* @example
* const resultado = sumar(5, 3);
* console.log(resultado); // 8
*/
function sumar(a, b) {
return a + b;
}
This approach works for JavaScript, TypeScript, Python, and other languages. Adjust the documentation format to match your language’s conventions.
Creating README Files in Spanish
Project README files often need the most attention whenlocalizing for Spanish-speaking teams. Use the following workflow:
# Generate a Spanish README for your project
claude "Generate a Spanish README.md for this project.
Include:
- Project title (Nombre del Proyecto)
- Installation instructions (Instalación)
- Usage guide (Uso)
- Contributing guidelines (Contribución)
- License (Licencia)
Output language: Spanish (es-ES)"
For more complex projects, split the README into multiple prompts:
First prompt: "Generate the introduction and installation sections
in Spanish. Include prerequisites and setup steps."
Second prompt: "Now generate the API reference section in Spanish.
Document all exported functions with their parameters and return types."
This segmented approach prevents context overflow for large codebases.
Using the docx and xlsx Skills for Structured Documentation
When your documentation requires formal corporate templates or offline distribution, the docx skill creates professionally formatted Word documents. Place docx.md in your .claude/ directory, then invoke /docx:
Crea una guía de API en español para mi proyecto de biblioteca JavaScript. Incluye:
- Introducción con ejemplos de instalación
- Referencia de métodos con parámetros y tipos
- Ejemplos de código en cada sección
- Sección de errores comunes y soluciones
For API matrices, feature comparisons, or tabular technical data, the xlsx skill generates structured spreadsheets. Place xlsx.md in .claude/ and invoke /xlsx with a prompt describing your columns and content.
API Documentation in Spanish
API documentation requires consistent terminology and structure. The pdf skill works well for generating formatted API docs:
# Generate PDF API documentation in Spanish
claude "Create API documentation in Spanish (es-419) for this REST API.
Include:
- Endpoint descriptions
- Request parameters (parámetros de solicitud)
- Response formats (formatos de respuesta)
- Error codes (códigos de error)
- Authentication requirements (requisitos de autenticación)
Output format: Markdown suitable for PDF conversion"
Then invoke the pdf skill to create the final document:
Use the pdf skill to convert this markdown to a formatted PDF.
Include header with project name and generation date.
Language: Spanish
Managing Terminology with Supermemory
When generating Spanish documentation across multiple sessions, maintaining consistent terminology matters. The supermemory skill stores your preferences:
Invoke supermemory to store:
- Project: MiApp
- Language: Spanish (es-MX)
- Key terms:
- "user" -> "usuario"
- "authentication" -> "autenticación"
- "endpoint" -> "punto de conexión"
- "payload" -> "carga útil"
On subsequent documentation requests, reference these stored preferences:
Generate documentation using stored Spanish terminology from supermemory.
Maintain consistent translations for technical terms.
This ensures your entire documentation suite uses the same vocabulary, which is critical for professional deliverables.
Automating Documentation Generation
To streamline the workflow, create a shell script that invokes Claude Code:
#!/bin/bash
# generate-spanish-docs.sh
FILE="$1"
LANGUAGE="Spanish (es-MX)"
claude "Generate comprehensive documentation in $LANGUAGE for: $FILE
Include inline comments, JSDoc/docstrings, and a summary section.
Output language must be Spanish."
Make it executable and use it:
chmod +x generate-spanish-docs.sh
./generate-spanish-docs.sh src/components/Button.jsx
For automated runs, integrate with your CI pipeline:
# .github/workflows/docs.yml
name: Spanish Documentation
on: [push]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate Spanish Docs
run: |
claude "Run spanish-docs skill on ./src directory"
Full Prompt Examples in Spanish
The following complete prompts can be used directly in Claude Code sessions.
JavaScript Library Documentation
Eres un escritor técnico especializado en documentación para desarrolladores.
Genera documentación completa en español para una biblioteca JavaScript llamada
"MiBiblioteca" que proporciona utilidades para manipular arrays.
Incluye:
1. Guía de inicio rápido (instalación, ejemplo básico)
2. Referencia de API completa con JSDoc
3. Ejemplos avanzados con casos de uso reales
4. FAQ con preguntas frecuentes
5. Changelog con versiones
Usa markdown con encabezados jerárquicos y código ejecutable.
REST API Documentation
Genera documentación de API en español para un servicio RESTful de gestión de tareas.
La API tiene los siguientes endpoints:
- GET /tasks - Listar todas las tareas
- POST /tasks - Crear nueva tarea
- GET /tasks/{id} - Obtener tarea por ID
- PUT /tasks/{id} - Actualizar tarea
- DELETE /tasks/{id} - Eliminar tarea
Para cada endpoint incluye: método, URL, parámetros, cuerpo de solicitud,
respuestas posibles con códigos de estado y ejemplos de uso.
README Completo de Proyecto
Crea un README.md completo en español para un proyecto de aplicación web
llamada "GestorPro". Incluye:
- Badge de estado de build
- Descripción corta y larga
- Características principales (usa bullets)
- Capturas de pantalla
- Instalación paso a paso
- Uso con ejemplos de código
- Contribución (guía de desarrollo local)
- Licencia
- Créditos
Best Practices
When generating Spanish documentation with Claude Code, keep these points in mind:
Specify regional variants: Spanish varies between Spain (es-ES), Mexico (es-MX), Argentina (es-AR), and other regions. Include your target variant in prompts for accurate terminology.
Maintain a terminology glossary: Decide upfront how to handle English technical terms that have common Spanish equivalents and specify your choice at the start of each prompt. Common decisions include:
- “commit” → “confirmar” or keep “commit”
- “branch” → “rama”
- “pull request” → “solicitud de extracción” or “PR”
- “deploy” → “desplegar” or “despliegue”
Claude Code will respect whichever convention you specify.
Review generated content: Claude Code produces accurate translations, but always review for context-specific nuances that automated systems might miss. Check technical accuracy of code examples, terminology specific to your industry, version numbers and links, and clarity for your target audience.
Combine with the frontend-design skill: When documenting UI components, the frontend-design skill helps generate prop tables and component stories in Spanish.
Use the tdd skill for test documentation: Generate test case descriptions in Spanish alongside your test files.
Conclusion
Claude Code skills provide a powerful foundation for generating Spanish-language documentation. By configuring language settings, storing terminology preferences with supermemory, and using targeted prompts, you can automate documentation workflows that serve Spanish-speaking teams and users.
The key is starting simple: document a single function in Spanish, refine your terminology mappings, then expand to full project READMEs and API documentation. As your configuration matures, the workflow becomes increasingly automated while maintaining consistency across your documentation suite.
Related Reading
- Claude Skill MD Format Complete Specification Guide — create skill configuration files for language-specific documentation
- Automated Code Documentation Workflow with Claude Skills — build automated documentation pipelines
- Building Stateful Agents with Claude Skills Guide — maintain terminology preferences with supermemory across sessions
- Getting Started Hub — explore the full range of Claude skills for developer workflows
Built by theluckystrike — More at zovo.one