create-skill-from-source-code
O que ela faz
Esta skill orienta o agente de IA a ler um arquivo de código-fonte e escrever documentação educativa a partir dele, na forma de um arquivo de skill. É para pessoas que querem ensinar ou documentar uma implementação de referência.
Quando usar
- ✓Quando você tem uma implementação de referência e quer material de ensino feito a partir dela.
- ✓Quando você precisa de documentação reutilizável que explique como um trecho de código funciona.
- ✓Quando quer registrar por escrito a arquitetura, as técnicas principais e exemplos de uso.
Link da skill
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Leia este arquivo de código-fonte e escreva um guia claro que explique os principais padrões dele e mostre como usá-los.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente lê o arquivo completo, identifica os padrões de arquitetura, as estruturas de dados e os algoritmos, e anota os pontos de integração. Depois escreve o material com um cabeçalho adequado, análise, modelos de código e exemplos.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
O que o agente identifica no código?
Ele procura padrões de projeto, técnicas principais, estruturas de dados importantes, algoritmos e pontos de integração.
Para quem é o guia?
A skill pede que o agente considere o público-alvo antes de escrever.
Inclui exemplos de código?
Sim. A skill inclui modelos de código e exemplos de uso na saída.
Detalhes
Descrição original do 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
Popularidade
- Estrelas no GitHub
- 7,8 mil
- Posição no ranking
- #13043
- Licença
- MIT
- Atualizada em
- 01/11/2026
Comentários
- …
Mais skills deste repositório
agentpilot
7,8 milAjuda seu agente a melhorar um projeto passo a passo, preparando uma tarefa e executando o ciclo do AgentPilot, que propõe, testa e pontua mudanças.
openspace
7,8 milAjuda seu agente a configurar o OpenSpace, uma ferramenta que armazena e busca skills de agentes, e a conectá-la ao seu app de IA pelo MCP.
rsi-arena
7,8 milAjuda seu agente a configurar e rodar testes padrão de benchmark de IA, como AIME e Terminal-Bench, para comparar diferentes métodos de melhoria.
experiment-guide
7,8 milAjuda seu agente a planejar pequenos experimentos, ler seus resultados e registrar descobertas enquanto investiga como melhorar um programa.
Skills parecidas
technical-documentation
394 milAjuda seu agente a escrever e revisar documentação técnica clara e arquivos de instruções, para que pessoas e ferramentas de IA sigam tudo com facilidade.
architecture-decision-records
280 milFaz seu agente registrar decisões importantes sobre a estrutura do projeto. Ajuda a entender o porquê das escolhas feitas e a manter um histórico claro das mudanças.
code-tour
280 milFaz seu agente criar guias passo a passo no código, com arquivos e linhas exatos. Útil para apresentar projetos, explicar código ou revisar mudanças.