Generate-Custom-Instructions-From-Codebase
Generate-Custom-Instructions-From-Codebase是一款code方向的AI技能,核心价值是Migration and code evolution instructions generator for GitHub Copilot,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Migration and code evolution instructions generator for GitHub Copilot. Analyzes differences between two project versions (branches, commits, or releases) to create precise instructions allowing Copil
mkdir -p ./skills/generate-custom-instructions-from-codebase && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/generate-custom-instructions-from-codebase/SKILL.md -o ./skills/generate-custom-instructions-from-codebase/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Migration and Code Evolution Instructions Generator
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 Generation
Create 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**🎯 Best For
- Developers scaffolding new projects
- Prototype builders
- Data analysts
- Business intelligence teams
- Claude users
💡 Use Cases
- Bootstrapping React components
- Creating API route handlers
- Finding patterns in customer data
- Creating automated dashboards
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Generate-Custom-Instructions-From-Codebase to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Can I customize the generated output?
Yes — modify the skill's prompt instructions to match your project conventions and coding style.
Can this connect to my database directly?
Most data skills accept CSV or JSON input. Database connectors are listed in the Works With section.
Is Generate-Custom-Instructions-From-Codebase compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Generate-Custom-Instructions-From-Codebase?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Generate-Custom-Instructions-From-Codebase?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/generate-custom-instructions-from-codebase/SKILL.md, ready to use.
⚠️ Common Mistakes to Avoid
Using generated code without understanding
Understand what generated code does before shipping it to production.
Not validating data quality
AI analysis is only as good as your input data. Profile and clean data before analysis.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.