create-skill-from-source-code
Qué hace
Esta skill guía al agente de IA para leer un archivo de código fuente y escribir a partir de él documentación didáctica, en forma de archivo de skill. Es para personas que quieren enseñar o documentar una implementación de referencia.
Cuándo usarla
- ✓Cuando tienes una implementación de referencia y quieres material didáctico a partir de ella.
- ✓Cuando necesitas documentación reutilizable que explique cómo funciona una parte del código.
- ✓Cuando quieres dejar por escrito la arquitectura, las técnicas clave y ejemplos de uso.
Link de la skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Lee este archivo de código fuente y escribe una guía clara que explique sus patrones principales y muestre cómo usarlos.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente lee el archivo fuente completo, identifica los patrones de arquitectura, las estructuras de datos y los algoritmos, y anota los puntos de integración. Después escribe el material con una cabecera adecuada, un análisis, plantillas de código y ejemplos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Create Skill from Source Code
This skill guides you through the process of analyzing an existing source code implementation and transforming it into comprehensive educational documentation in the form of a skill file.
Overview
When you have a reference implementation and need to create teaching materials or reusable documentation from it, follow this systematic workflow to extract patterns, analyze architecture, and generate well-structured educational content.
Prerequisites
- Access to the source code file(s) you want to document
- Understanding of the target audience for the skill
- Knowledge of the programming language/framework used
Workflow Steps
1. Read and Parse the Source Code
First, read the complete source file to understand its full scope:
# Read the source file
cat /path/to/source/file.ext
Or use file reading tools to access the content programmatically.
2. Identify Key Architectural Patterns
Analyze the code to identify:
- Core architectural patterns: What design patterns are used? (e.g., Observer, Factory, MVC)
- Key implementation techniques: How are specific challenges solved?
- Important data structures: What structures enable the functionality?
- Critical algorithms: What are the main algorithmic approaches?
- Integration points: How does the code interact with external systems?
Take notes on 3-5 major patterns that define the implementation.
3. Create the Skill Directory Structure
# Create skill directory
mkdir -p skills/skill-name
# If you need auxiliary files (examples, scripts, etc.)
mkdir -p skills/skill-name/examples
mkdir -p skills/skill-name/templates
4. Generate Comprehensive SKILL.md
Create a SKILL.md file with the following structure:
Required YAML Frontmatter
---
name: descriptive-skill-name
description: Brief one-sentence description of what the skill teaches
---
Frontmatter rules:
- Must be enclosed in
---fences name: lowercase, use hyphens for spacesdescription: concise but informative (1-2 sentences max)
Document Body Structure
Organize the content into clear sections:
# [Skill Title]
## Overview
Brief introduction to what pattern/technique is being taught.
## Key Patterns Identified
### Pattern 1: [Name]
**Purpose**: What problem does it solve?
**Implementation**: How is it implemented in the reference code?
**Key Code Elements**:
- Relevant classes/functions
- Important variables/structures
### Pattern 2: [Name]
[Same structure as Pattern 1]
[Continue for 3-5 main patterns]
## Complete Code Template
Provide a minimal but complete implementation:
\`\`\`[language]
// Simplified, well-commented version of the key code
// Include only essential elements
// Add explanatory comments
\`\`\`
## Usage Examples
### Example 1: Basic Usage
\`\`\`[language]
// Practical example showing how to use the pattern
\`\`\`
### Example 2: Advanced Usage
\`\`\`[language]
// More complex scenario
\`\`\`
## Best Practices
- List key recommendations
- Common pitfalls to avoid
- Performance considerations
- Testing strategies
## When to Use This Pattern
Explain scenarios where this pattern is appropriate and where it might not be the best choice.
## Related Patterns
Reference related techniques or alternative approaches.
## References
- Link to original source (if applicable)
- Related documentation
- Further reading
5. Verify File Creation and Frontmatter
After creating the skill file, verify:
# Check file exists
ls -la skills/skill-name/SKILL.md
# Verify frontmatter format
head -n 5 skills/skill-name/SKILL.md
# Should show:
# ---
# name: skill-name
# description: Description here
# ---
Ensure:
- File starts with
---on line 1 - YAML contains at least
nameanddescriptionfields - Frontmatter closes with
--- - Content follows immediately after
6. Add Auxiliary Files (Optional)
If the pattern benefits from additional resources:
Example script (examples/demo.sh):
#!/bin/bash
# Demonstration script showing the pattern in action
Template file (templates/starter.template):
# Ready-to-use template that users can copy
Configuration example (examples/config.example):
# Sample configuration demonstrating best practices
Tips for Creating Effective Skills
Make It Generalizable
- Abstract away specific variable names, file paths, or domain-specific detail
Preguntas frecuentes
¿Qué identifica el agente en el código?
Busca patrones de diseño, técnicas clave, estructuras de datos importantes, algoritmos y puntos de integración.
¿Para quién es la guía?
La skill pide al agente que considere el público al que va dirigida antes de escribir.
¿Incluye ejemplos de código?
Sí. La skill incluye plantillas de código y ejemplos de uso en el resultado.
Detalles
Descripción original del autor
Analyze existing source code to identify key patterns and generate comprehensive educational skill documentation with proper YAML frontmatter, architectural analysis, code templates, and usage examples.
repo: HKUDS/AgentPilot
Popularidad
- Estrellas en GitHub
- 7,8 mil
- Posición en el ranking
- #13043
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
agentpilot
7,8 milAyuda a tu agente a mejorar un proyecto paso a paso, preparando una tarea y ejecutando el bucle de AgentPilot que propone, prueba y puntúa cambios.
openspace
7,8 milAyuda a tu agente a configurar OpenSpace, una herramienta que guarda y recupera skills de agentes, y a conectarla a tu app de IA mediante MCP.
rsi-arena
7,8 milAyuda a tu agente a configurar y ejecutar pruebas de referencia de IA conocidas, como AIME y Terminal-Bench, para comparar distintos métodos de mejora.
experiment-guide
7,8 milAyuda a tu agente a planificar experimentos pequeños, leer sus resultados y anotar conclusiones mientras investiga cómo mejorar un programa.
Skills parecidas
technical-documentation
394 milAyuda a tu agente a escribir y revisar documentación técnica clara y archivos de instrucciones para agentes, para que personas y herramientas de IA puedan seguirlos fácilmente.
architecture-decision-records
280 milHace que tu agente registre las decisiones importantes sobre la estructura del proyecto. Así se entiende el motivo de cada elección y se mantiene un historial claro.
code-tour
280 milPermite que tu agente cree recorridos paso a paso por el código, con referencias exactas a archivos y líneas. Útil para introducciones, explicaciones y revisiones.