Skip to content

Instantly share code, notes, and snippets.

@lasergoat
Created June 27, 2025 20:39
Show Gist options
  • Select an option

  • Save lasergoat/d90ea68c0c0784508806679049b887fc to your computer and use it in GitHub Desktop.

Select an option

Save lasergoat/d90ea68c0c0784508806679049b887fc to your computer and use it in GitHub Desktop.
VSCode snippets for GitHub Copilot feature development workflow

VSCode Copilot Feature Development Snippets

These are VSCode user snippets that generate detailed prompts for GitHub Copilot Chat to handle git workflows and PR creation.

Installation Instructions

Step 1: Open VSCode Snippets Configuration

  1. Open VSCode
  2. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  3. Type "Preferences: Configure User Snippets"
  4. Select "New Global Snippets file..."
  5. Name it feature-workflow.code-snippets

Step 2: Add the Snippet Content

Copy and paste this entire JSON content into the file:

{
  "Feature Start": {
    "prefix": "featurestart",
    "body": [
      "@workspace I need to start work on a new feature branch. Please:",
      "",
      "1. **Check for uncommitted changes:**",
      "   - Run `git status`",
      "   - If changes exist, ask me: 'You have uncommitted changes. Would you like to: 1) Stash them, 2) Commit them, or 3) Cancel?'",
      "   - Handle according to my choice",
      "",
      "2. **Create feature branch:**",
      "   - Branch name: `$1`",
      "   - Run: `git checkout -b $1`",
      "",
      "3. **Set up conventional commits:**",
      "   - Use branch name or ask for ticket/feature prefix",
      "   - Inform me about commit format for this feature",
      "",
      "Prerequisites: git must be available"
    ],
    "description": "Start feature development workflow"
  },
  
  "Feature Done": {
    "prefix": "featuredone", 
    "body": [
      "@workspace I need to complete this feature and create a PR. Please:",
      "",
      "1. **Commit final changes:**",
      "   - Run `git status` to check for uncommitted changes",
      "   - If changes exist, create a final commit using conventional format",
      "   - Use appropriate commit type (feat/fix/refactor/etc)",
      "",
      "2. **Push to origin:**",
      "   - Ask me: 'Ready to push all commits to origin?'",
      "   - If yes: `git push -u origin $(git branch --show-current)`",
      "",
      "3. **Create Pull Request:**",
      "   - Get current branch name",
      "   - Create PR using gh CLI with:",
      "     - Title: Use conventional commit format with branch/feature summary",
      "     - Body with sections for:",
      "       - Summary of changes",
      "       - Changes made (bullet points)",
      "       - Dependencies (if any)",
      "       - Testing instructions",
      "       - Basic checklist",
      "",
      "Prerequisites: gh CLI must be installed and authenticated"
    ],
    "description": "Complete feature and create PR"
  },
  
  "Conventional Commit": {
    "prefix": "commit",
    "body": [
      "@workspace I need to make a conventional commit. Please:",
      "",
      "1. **Analyze changes:**",
      "   - Run `git status` and `git diff --staged`",
      "   - If no staged changes, run `git diff`",
      "   - Summarize what was changed",
      "",
      "2. **Determine commit type:**",
      "   - feat: New feature",
      "   - fix: Bug fix", 
      "   - docs: Documentation only",
      "   - style: Formatting, no logic changes",
      "   - refactor: Code restructuring",
      "   - test: Adding tests",
      "   - chore: Maintenance tasks",
      "",
      "3. **Get scope (optional):**",
      "   - Extract from branch name if available",
      "   - Or ask me for feature/component scope",
      "",
      "4. **Create commit:**",
      "   - Stage changes if needed: `git add -A`",
      "   - Format: `type(scope): concise summary`",
      "   - Execute: `git commit -m 'message'`",
      "   - Do NOT mention AI assistance",
      "   - Do NOT push unless I request it",
      "",
      "5. **Confirm:**",
      "   - Show: `git log -1 --oneline`"
    ],
    "description": "Create conventional commit"
  },
  
  "Quick Branch": {
    "prefix": "branch",
    "body": [
      "@workspace Create a new git branch named '$1' and switch to it. Please:",
      "",
      "1. Check for uncommitted changes first",
      "2. If clean, run: `git checkout -b $1`",
      "3. Confirm the new branch: `git branch --show-current`"
    ],
    "description": "Create and switch to new branch"
  },
  
  "PR Template": {
    "prefix": "prtemplate",
    "body": [
      "## Summary",
      "$1",
      "",
      "## Changes Made",
      "- $2",
      "",
      "## Dependencies",
      "- None / List any dependent PRs",
      "",
      "## Testing",
      "- $3",
      "",
      "## Checklist",
      "- [ ] Tests pass",
      "- [ ] Code reviewed", 
      "- [ ] Documentation updated"
    ],
    "description": "PR description template"
  }
}

Step 3: Save and Restart

  1. Save the file (Cmd+S or Ctrl+S)
  2. Restart VSCode or reload the window

How to Use

In any file, type these prefixes and press Tab:

  1. featurestart + Tab

    • Creates a prompt for Copilot to start a new feature
    • You can add a branch name: featurestart then type your branch name
  2. featuredone + Tab

    • Creates a prompt to complete the feature and create a PR
  3. commit + Tab

    • Creates a prompt for making a conventional commit
  4. branch + Tab

    • Quick branch creation prompt
    • You can specify the branch name
  5. prtemplate + Tab

    • Generates a PR description template
    • Has placeholder fields you can tab through

Example Workflow:

  1. Type featurestart + Tab, add your branch name
  2. Copy the generated text and paste into Copilot Chat
  3. Make your code changes
  4. Type commit + Tab when ready to commit
  5. Type featuredone + Tab when feature is complete

Prerequisites

  • VSCode with GitHub Copilot extension
  • Git installed and configured
  • GitHub CLI (gh) for PR creation
  • GitHub Copilot Chat extension

Notes

  • These snippets generate prompts for Copilot Chat - they don't execute commands directly
  • You'll need to copy/paste the generated text into Copilot Chat
  • Copilot will then execute the git commands and handle the workflow
  • All prompts use conventional commit format
  • No Jira integration - just git and GitHub workflows

File Location

The snippets are saved in:

  • macOS/Linux: ~/.config/Code/User/snippets/feature-workflow.code-snippets
  • Windows: %APPDATA%/Code/User/snippets/feature-workflow.code-snippets

To share with others: Give them this gist URL and tell them to follow the installation instructions for VSCode Copilot integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment