opción
HogarHogar Skill Git y control de versiones generate-custom-instructions-from-codebase

generate-custom-instructions-from-codebase

github/awesome-copilot github/awesome-copilot

Generador de instrucciones para la migración y la evolución del código para GitHub Copilot. Analiza las diferencias entre dos versiones de un proyecto (ramas, confirmaciones o versiones) para crear instrucciones precisas que permitan a Copilot mantener la coherencia durante las migraciones tecnológicas, las refactorizaciones importantes o las actualizaciones de versión de los marcos de trabajo.

...Expandir todo
13
Tiempo actualizado 26 de agosto de 2026

Acerca de generate-custom-instructions-from-codebase

Esta herramienta genera instrucciones de migración y evolución del código para GitHub Copilot mediante el análisis de las diferencias entre dos versiones de un proyecto: dos ramas, confirmaciones o etiquetas. Resuelve el problema de mantener la coherencia durante las migraciones tecnológicas, las refactorizaciones importantes o las actualizaciones de marcos de trabajo: una vez capturados los patrones de transformación entre un estado anterior y uno posterior, Copilot puede aplicar automáticamente los mismos cambios en trabajos futuros, en lugar de depender de que los desarrolladores recuerden cada regla.

La habilidad se rige por variables de configuración (tipo de migración, referencias de origen y destino, alcance del análisis, enfoque de los cambios, nivel de automatización, si se deben generar ejemplos y si se requiere validación). Define una metodología en varias fases: un análisis comparativo de estados que detecta cambios estructurales, cambios en las dependencias y transformaciones de código adaptadas al tipo de migración (versión del marco de trabajo, refactorización de la arquitectura, migración tecnológica); la extracción de patrones de transformación repetitivos en reglas de correspondencia «antes/después»; y la generación de un archivo `.github/copilot-migration-instructions.md`. Ese resultado documenta las transformaciones obligatorias, las que requieren validación, las tablas de correspondencia de API, los nuevos patrones que deben adoptarse, los patrones obsoletos que deben evitarse, las directrices específicas para cada tipo de archivo, los puntos de control de validación y seguridad, los casos de escalado manual y las métricas de supervisión. Las fases opcionales añaden ejemplos de código contextuales «antes/después» y la optimización iterativa de las reglas.

Está dirigida a desarrolladores, arquitectos y equipos que llevan a cabo migraciones sistemáticas y que desean que Copilot reproduzca sus decisiones de evolución de forma coherente. Entre los casos de uso se incluyen la actualización de la versión de un marco de trabajo, la refactorización de la arquitectura o la sustitución de una tecnología por otra, manteniendo la coherencia de las convenciones y evitando los patrones obsoletos. La habilidad lee el historial de control de versiones y los archivos del proyecto, y genera un documento de instrucciones; realiza comparaciones de Git y análisis de archivos, pero no lleva a cabo operaciones destructivas ni gestiona credenciales, por lo que se considera de bajo riesgo.

Preguntas frecuentes

¿Qué genera esta skill?

Un archivo .github/copilot-migration-instructions.md que contiene reglas de transformación automáticas, tablas de correspondencia de API, patrones que se deben adoptar y evitar, puntos de control de validación y métricas de supervisión que guían a Copilot durante futuros cambios.

¿Qué datos de entrada necesita?

Variables de configuración que incluyen el tipo de migración, una referencia de origen y destino (rama, commit o etiqueta), el alcance del análisis, el enfoque del cambio, un nivel de automatización y indicadores para generar ejemplos y requerir validación.

¿Qué tipos de migraciones gestiona?

Actualizaciones de la versión del marco de trabajo, refactorización de la arquitectura, migraciones tecnológicas, actualizaciones de dependencias y cambios de patrones, con un análisis adaptado al tipo de migración seleccionado.

¿El nivel de automatización cambia el resultado?

Sí. El nivel «Conservador» omite las reglas de transformación automática obligatorias, mientras que los niveles «Equilibrado» y «Agresivo» las incluyen; el nivel «Agresivo» añade además una optimización iterativa para maximizar la automatización y reducir los falsos positivos.

¿Cómo identifica las reglas de transformación?

Compara los dos estados del proyecto —estructura de carpetas, dependencias y código—, extrae las transformaciones repetitivas y crea una matriz de correspondencias «antes/después», que incluye cambios que rompen la compatibilidad y patrones obsoletos.

Ver en GitHub

Configuration Variables

${MIGRATION_TYPE="Framework Version|Architecture Refactoring|Technology Migration|Dependencies Update|Pattern Changes"}<!-- Type of migration or evolution -->${SOURCE_REFERENCE="branch|commit|tag"}<!-- Source reference point (before state) -->${TARGET_REFERENCE="branch|commit|tag"}  <!-- Target reference point (after state) -->${ANALYSIS_SCOPE="Entire project|Specific folder|Modified files only"}<!-- Scope of analysis -->${CHANGE_FOCUS="Breaking Changes|New Conventions|Obsolete Patterns|API Changes|Configuration"}<!-- Main aspect of changes -->${AUTOMATION_LEVEL="Conservative|Balanced|Aggressive"}<!-- Level of automation for Copilot suggestions -->${GENERATE_EXAMPLES="true|false"}<!-- Include transformation examples -->${VALIDATION_REQUIRED="true|false"}<!-- Require validation before application -->

Generated Prompt

"Analyze code evolution between two project states to generate precise migration instructions for GitHub Copilot. These instructions will guide Copilot to automatically apply the same transformation patterns during future modifications. Follow this methodology:### Phase 1: Comparative State Analysis#### Structural Changes Detection- Compare folder structure between ${SOURCE_REFERENCE} and ${TARGET_REFERENCE}- Identify moved, renamed, or deleted files- Analyze changes in configuration files- Document new dependencies and removed ones#### Code Transformation Analysis${MIGRATION_TYPE == "Framework Version" ?   "- Identify API changes between framework versions   - Analyze new features being used   - Document obsolete methods/properties   - Note syntax or convention changes" : ""}${MIGRATION_TYPE == "Architecture Refactoring" ?   "- Analyze architectural pattern changes   - Identify new abstractions introduced   - Document responsibility reorganization   - Note changes in data flows" : ""}${MIGRATION_TYPE == "Technology Migration" ?   "- Analyze replacement of one technology with another   - Identify functional equivalences   - Document API and syntax changes   - Note new dependencies and configurations" : ""}#### Transformation Pattern Extraction- Identify repetitive transformations applied- Analyze conversion rules from old to new format- Document exceptions and special cases- Create before/after correspondence matrix### Phase 2: Migration Instructions GenerationCreate a `.github/copilot-migration-instructions.md` file with this structure:\`\`\`markdown# GitHub Copilot Migration Instructions## Migration Context- **Type**: ${MIGRATION_TYPE}- **From**: ${SOURCE_REFERENCE} - **To**: ${TARGET_REFERENCE}- **Date**: [GENERATION_DATE]- **Scope**: ${ANALYSIS_SCOPE}## Automatic Transformation Rules### 1. Mandatory Transformations${AUTOMATION_LEVEL != "Conservative" ?   "[AUTOMATIC_TRANSFORMATION_RULES]   - **Old Pattern**: [OLD_CODE]   - **New Pattern**: [NEW_CODE]   - **Trigger**: When to detect this pattern   - **Action**: Transformation to apply automatically" : ""}### 2. Transformations with Validation${VALIDATION_REQUIRED == "true" ?   "[TRANSFORMATIONS_WITH_VALIDATION]   - **Detected Pattern**: [DESCRIPTION]   - **Suggested Transformation**: [NEW_APPROACH]   - **Required Validation**: [VALIDATION_CRITERIA]   - **Alternatives**: [ALTERNATIVE_OPTIONS]" : ""}### 3. API Correspondences${CHANGE_FOCUS == "API Changes" || MIGRATION_TYPE == "Framework Version" ?   "[API_CORRESPONDENCE_TABLE]   | Old API   | New API   | Notes     | Example        |   | --------- | --------- | --------- | -------------- |   | [OLD_API] | [NEW_API] | [CHANGES] | [CODE_EXAMPLE] | " : ""} |### 4. New Patterns to Adopt[DETECTED_EMERGING_PATTERNS]- **Pattern**: [PATTERN_NAME]- **Usage**: [WHEN_TO_USE] - **Implementation**: [HOW_TO_IMPLEMENT]- **Benefits**: [ADVANTAGES]### 5. Obsolete Patterns to Avoid[DETECTED_OBSOLETE_PATTERNS]- **Obsolete Pattern**: [OLD_PATTERN]- **Why Avoid**: [REASONS]- **Alternative**: [NEW_PATTERN]- **Migration**: [CONVERSION_STEPS]## File Type Specific Instructions${GENERATE_EXAMPLES == "true" ?   "### Configuration Files   [CONFIG_TRANSFORMATION_EXAMPLES]      ### Main Source Files   [SOURCE_TRANSFORMATION_EXAMPLES]      ### Test Files   [TEST_TRANSFORMATION_EXAMPLES]" : ""}## Validation and Security### Automatic Control Points- Verifications to perform after each transformation- Tests to run to validate changes- Performance metrics to monitor- Compatibility checks to perform### Manual EscalationSituations requiring human intervention:- [COMPLEX_CASES_LIST]- [ARCHITECTURAL_DECISIONS]- [BUSINESS_IMPACTS]## Migration Monitoring### Tracking Metrics- Percentage of code automatically migrated- Number of manual validations required- Error rate of automatic transformations- Average migration time per file### Error ReportingHow to report incorrect transformations to Copilot:- Feedback patterns to improve rules- Exceptions to document- Adjustments to make to instructions\`\`\`### Phase 3: Contextual Examples Generation${GENERATE_EXAMPLES == "true" ?   "#### Transformation Examples   For each identified pattern, generate:      \`\`\`   // BEFORE (${SOURCE_REFERENCE})   [OLD_CODE_EXAMPLE]      // AFTER (${TARGET_REFERENCE})    [NEW_CODE_EXAMPLE]      // COPILOT INSTRUCTIONS   When you see this pattern [TRIGGER], transform it to [NEW_PATTERN] following these steps: [STEPS]   \`\`\`" : ""}### Phase 4: Validation and Optimization#### Instructions Testing- Apply instructions on test code- Verify transformation consistency- Adjust rules based on results- Document exceptions and edge cases#### Iterative Optimization  ${AUTOMATION_LEVEL == "Aggressive" ?   "- Refine rules to maximize automation   - Reduce false positives in detection   - Improve transformation accuracy   - Document lessons learned" : ""}### Final ResultMigration instructions that enable GitHub Copilot to:1. **Automatically apply** the same transformations during future modifications2. **Maintain consistency** with newly adopted conventions  3. **Avoid obsolete patterns** by automatically proposing alternatives4. **Accelerate future migrations** by capitalizing on acquired experience5. **Reduce errors** by automating repetitive transformationsThese instructions transform Copilot into an intelligent migration assistant, capable of reproducing your technology evolution decisions consistently and reliably."

Typical Use Cases

Framework Version Migration

Perfect for documenting the transition from Angular 14 to Angular 17, React Class Components to Hooks, or .NET Framework to .NET Core. Automatically identifies breaking changes and generates corresponding transformation rules.

Technology Stack Evolution

Essential when replacing a technology entirely: jQuery to React, REST to GraphQL, SQL to NoSQL. Creates a comprehensive migration guide with pattern mappings.

Architecture Refactoring

Ideal for large refactorings like Monolith to Microservices, MVC to Clean Architecture, or Component to Composable architecture. Preserves architectural knowledge for future similar transformations.

Design Pattern Modernization

Useful for adopting new patterns: Repository Pattern, Dependency Injection, Observer to Reactive Programming. Documents the rationale and implementation differences.

Unique Benefits

🧠 Artificial Intelligence Enhancement

Unlike traditional migration documentation, these instructions "train" GitHub Copilot to reproduce your technology evolution decisions automatically during future code modifications.

🔄 Knowledge Capitalization

Transforms specific project experience into reusable rules, avoiding the loss of migration expertise and accelerating future similar transformations.

🎯 Context-Aware Precision

Instead of generic advice, generates instructions tailored to your specific codebase, with real before/after examples from your project evolution.

⚡ Automated Consistency

Ensures that new code additions automatically follow the new conventions, preventing architectural regression and maintaining code evolution coherence.

Todos los archivos

0 archivos

Instalar generate-custom-instructions-from-codebase

Descarga y descomprime los archivos de habilidades en tu directorio .claude/skills/.

Descargar ZIP

Clona el repositorio y copia los archivos de la habilidad a tu proyecto.

git clone https://github.com/github/awesome-copilot/blob/main/skills/generate-custom-instructions-from-codebase/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

Copiar Copiar
Configuración rápida: Copia la carpeta de la habilidad en .claude/skills/. Claude la detectará automáticamente y la utilizará.

Habilidades relacionadas

github-project-management
Tiempo actualizado 29 de junio de 2026
using-git-worktrees
Tiempo actualizado 29 de junio de 2026
readme-blueprint-generator
Tiempo actualizado 5 de julio de 2026
finishing-a-development-branch
Tiempo actualizado 29 de junio de 2026
OR