$npx -y skills add github/awesome-copilot --skill git-flow-branch-creatorIntelligent Git Flow branch creator that analyzes git status/diff and creates appropriate branches following the nvie Git Flow branching model.
| 1 | ### Instructions |
| 2 | |
| 3 | ```xml |
| 4 | <instructions> |
| 5 | <title>Git Flow Branch Creator</title> |
| 6 | <description>This prompt analyzes your current git changes using git status and git diff (or git diff --cached), then intelligently determines the appropriate branch type according to the Git Flow branching model and creates a semantic branch name.</description> |
| 7 | <note> |
| 8 | Just run this prompt and Copilot will analyze your changes and create the appropriate Git Flow branch for you. |
| 9 | </note> |
| 10 | </instructions> |
| 11 | ``` |
| 12 | |
| 13 | ### Workflow |
| 14 | |
| 15 | **Follow these steps:** |
| 16 | |
| 17 | 1. Run `git status` to review the current repository state and changed files. |
| 18 | 2. Run `git diff` (for unstaged changes) or `git diff --cached` (for staged changes) to analyze the nature of changes. |
| 19 | 3. Analyze the changes using the Git Flow Branch Analysis Framework below. |
| 20 | 4. Determine the appropriate branch type based on the analysis. |
| 21 | 5. Generate a semantic branch name following Git Flow conventions. |
| 22 | 6. Create the branch and switch to it automatically. |
| 23 | 7. Provide a summary of the analysis and next steps. |
| 24 | |
| 25 | ### Git Flow Branch Analysis Framework |
| 26 | |
| 27 | ```xml |
| 28 | <analysis-framework> |
| 29 | <branch-types> |
| 30 | <feature> |
| 31 | <purpose>New features, enhancements, non-critical improvements</purpose> |
| 32 | <branch-from>develop</branch-from> |
| 33 | <merge-to>develop</merge-to> |
| 34 | <naming>feature/descriptive-name or feature/ticket-number-description</naming> |
| 35 | <indicators> |
| 36 | <indicator>New functionality being added</indicator> |
| 37 | <indicator>UI/UX improvements</indicator> |
| 38 | <indicator>New API endpoints or methods</indicator> |
| 39 | <indicator>Database schema additions (non-breaking)</indicator> |
| 40 | <indicator>New configuration options</indicator> |
| 41 | <indicator>Performance improvements (non-critical)</indicator> |
| 42 | </indicators> |
| 43 | </feature> |
| 44 | |
| 45 | <release> |
| 46 | <purpose>Release preparation, version bumps, final testing</purpose> |
| 47 | <branch-from>develop</branch-from> |
| 48 | <merge-to>develop AND master</merge-to> |
| 49 | <naming>release-X.Y.Z</naming> |
| 50 | <indicators> |
| 51 | <indicator>Version number changes</indicator> |
| 52 | <indicator>Build configuration updates</indicator> |
| 53 | <indicator>Documentation finalization</indicator> |
| 54 | <indicator>Minor bug fixes before release</indicator> |
| 55 | <indicator>Release notes updates</indicator> |
| 56 | <indicator>Dependency version locks</indicator> |
| 57 | </indicators> |
| 58 | </release> |
| 59 | |
| 60 | <hotfix> |
| 61 | <purpose>Critical production bug fixes requiring immediate deployment</purpose> |
| 62 | <branch-from>master</branch-from> |
| 63 | <merge-to>develop AND master</merge-to> |
| 64 | <naming>hotfix-X.Y.Z or hotfix/critical-issue-description</naming> |
| 65 | <indicators> |
| 66 | <indicator>Security vulnerability fixes</indicator> |
| 67 | <indicator>Critical production bugs</indicator> |
| 68 | <indicator>Data corruption fixes</indicator> |
| 69 | <indicator>Service outage resolution</indicator> |
| 70 | <indicator>Emergency configuration changes</indicator> |
| 71 | </indicators> |
| 72 | </hotfix> |
| 73 | </branch-types> |
| 74 | </analysis-framework> |
| 75 | ``` |
| 76 | |
| 77 | ### Branch Naming Conventions |
| 78 | |
| 79 | ```xml |
| 80 | <naming-conventions> |
| 81 | <feature-branches> |
| 82 | <format>feature/[ticket-number-]descriptive-name</format> |
| 83 | <examples> |
| 84 | <example>feature/user-authentication</example> |
| 85 | <example>feature/PROJ-123-shopping-cart</example> |
| 86 | <example>feature/api-rate-limiting</example> |
| 87 | <example>feature/dashboard-redesign</example> |
| 88 | </examples> |
| 89 | </feature-branches> |
| 90 | |
| 91 | <release-branches> |
| 92 | <format>release-X.Y.Z</format> |
| 93 | <examples> |
| 94 | <example>release-1.2.0</example> |
| 95 | <example>release-2.1.0</example> |
| 96 | <example>release-1.0.0</example> |
| 97 | </examples> |
| 98 | </release-branches> |
| 99 | |
| 100 | <hotfix-branches> |
| 101 | <format>hotfix-X.Y.Z OR hotfix/critical-description</format> |
| 102 | <examples> |
| 103 | <example>hotfix-1.2.1</example> |
| 104 | <example>hotfix/security-patch</example> |
| 105 | <example>hotfix/payment-gateway-fix</example> |
| 106 | <example>hotfix-2.1.1</example> |
| 107 | </examples> |
| 108 | </hotfix-branches> |
| 109 | </naming-conventions> |
| 110 | ``` |
| 111 | |
| 112 | ### Analysis Process |
| 113 | |
| 114 | ```xml |
| 115 | <analysis-process> |
| 116 | <step-1> |
| 117 | <title>Change Nature Analysis</title> |
| 118 | <description>Examine the types of files modified and the nature of changes</description> |
| 119 | <criteria> |
| 120 | <files-modified>Look at file extensions, directory structure, and purpose</files-modified> |
| 121 | <change-scope>Determine if changes are additive, corrective, or preparatory</change-scope> |
| 122 | <urgency-level>Assess if changes address critical issues or are developmental</urgency-level> |
| 123 | </criteria> |
| 124 | </step-1> |
| 125 | |
| 126 | <step-2> |
| 127 | <title>Git Flow Classification</title> |
| 128 | <description>Map the changes to appropriate Git Flow branch type</description> |
| 129 | <decision-tree> |
| 130 | <question>Are these critical fixes for production issues?</question> |
| 131 | <if-yes>Consider hotfix branch</if-yes> |
| 132 | <if-no> |
| 133 | <question>Are these release preparation changes (version bumps, final tweaks)?</question> |
| 134 | <if-yes>Consider release branch</if-yes> |
| 135 | <if-no>Default to feature |