
Generate Custom Instructions From Codebase
Compare two Git refs and produce Copilot custom-instruction prompts so migrations and refactors stay consistent with your codebase’s new patterns.
Overview
Generate Custom Instructions From Codebase is an agent skill most often used in Build (also Ship review, Operate iteration) that compares two project snapshots and writes GitHub Copilot migration instructions from the di
Install
npx skills add https://github.com/github/awesome-copilot --skill generate-custom-instructions-from-codebaseWhat is this skill?
- Configurable migration types: framework version, architecture refactor, technology migration, dependencies, pattern chan
- Diff analysis between source and target branch, commit, or tag with adjustable scope (whole repo, folder, or modified fi
- Focus lenses: breaking changes, new conventions, obsolete patterns, API shifts, configuration
- Automation level presets: conservative, balanced, or aggressive Copilot suggestion behavior
- Optional transformation examples and validation gates before applying generated instructions
- 5 migration-type presets: Framework Version, Architecture Refactoring, Technology Migration, Dependencies Update, Patter
- 6 configuration dimensions including analysis scope and automation level (Conservative|Balanced|Aggressive)
Adoption & trust: 8.6k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You finished a migration on one branch but Copilot still completes code like the old framework because nothing captured the evolution rules in agent-readable form.
Who is it for?
Repos with a clear before/after ref pair after a real migration or major refactor where you want Copilot aligned to the new codebase.
Skip if: Greenfield projects with no prior reference, or teams not using GitHub Copilot custom instructions—use a human ADR or implementation plan instead.
When should I use this skill?
You are migrating frameworks, refactoring architecture, or upgrading dependencies and want Copilot custom instructions derived from an actual before/after codebase comparison.
What do I get? / Deliverables
You get a structured migration-instructions prompt (with optional examples and validation flags) you can paste into Copilot custom instructions so suggestions follow post-migration conventions.
- Structured migration/evolution instruction prompt for GitHub Copilot
- Optional before/after transformation examples when GENERATE_EXAMPLES is enabled
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build because the output steers day-to-day implementation and agent-assisted edits during technology change. Agent-tooling fits: it generates migration/evolution instructions meant to shape how GitHub Copilot suggests code—not a one-off app feature.
Where it fits
After merging a NestJS v10 upgrade branch, generate instructions so Copilot stops suggesting deprecated decorators.
Document API signature changes between release tags so backend edits stay consistent.
Before a large PR series lands, validate that proposed Copilot rules match the migration diff focus you selected.
Refresh instructions when dependency-only updates land on main and obsolete import paths creep back into suggestions.
How it compares
Use instead of generic “update to React 19” chat prompts when you need diff-grounded, repeatable Copilot policy tied to your actual tree.
Common Questions / FAQ
Who is generate-custom-instructions-from-codebase for?
Solo and indie developers maintaining GitHub Copilot who have already migrated or refactored between two refs and need agent behavior to match the new code.
When should I use generate-custom-instructions-from-codebase?
During Build when standardizing post-migration edits; during Ship when reviewing whether AI suggestions reintroduce old APIs; during Operate when iterating on legacy modules—you run it whenever two refs represent authoritative before/after states.
Is generate-custom-instructions-from-codebase safe to install?
It instructs analysis of repository history and generation of text prompts—review what refs and folders you expose and check the Security Audits panel on this Prism page before use.
SKILL.md
READMESKILL.md - Generate Custom Instructions From Codebase
# 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 | | --------- | --