agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/ai-ml/github-copilot/SKILL.md

github-copilot

Skill15 starsChanged 42 days agoMITView on GitHub

Expert GitHub Copilot assistance covering inline completions, Copilot Chat, workspace indexing, and custom instructions. Use when maximizing AI pair programming velocity and code quality.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Solution: Create project-level guidelines recognized by Copilot in VS Code and JetBrains.

    line 89
  2. Very specific:

    Use @workspace to scope prompts to whole repository architecture and dependency patterns.

    line 122
  3. Distinctive:

    Verify and write unit tests for all Copilot-generated logic before committing.

    line 124

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Copilot

GitHub Copilot is an enterprise AI pair programming assistant, providing inline completions, multi-file code editing via Copilot Edits, pull request reviews, and CLI integration.

When to Use

  • In-Editor AI Pair Programming: Generating functions, documentation, and boilerplate across VS Code, JetBrains, and Neovim.
  • Repository-Level Architectural Context: Using Copilot Chat with workspace awareness (@workspace).
  • Standardizing Team Prompting: Authoring .github/copilot-instructions.md to enforce organizational coding standards.
  • Automated Pull Request Summarization: Generating detailed PR summaries and test plans within GitHub Enterprise.

Quick Start

Configure custom repository instructions in .github/copilot-instructions.md:

# GitHub Copilot Instructions

- Use modern ES2022+ syntax and TypeScript 5.
- Always validate incoming API payloads using Zod schemas.
- Do not add comments describing self-explanatory lines.
- Write unit tests using Vitest with AAA (Arrange-Act-Assert) pattern.

Core Concepts

Project-Wide Custom Instructions (.github/copilot-instructions.md)

Configuring persistent AI developer guidelines:

# .github/copilot-instructions.md

Repository Standards

- Language: TypeScript 5.5+ with strict mode enabled.
- Framework: Next.js 15 (App Router), Tailwind CSS v4.
- Database: Drizzle ORM with PostgreSQL.
- Testing: Vitest for unit tests, Playwright for e2e.

Coding Conventions

1. Always declare explicit return types on public functions.
2. Prefer async/await over raw Promises.
3. Use early returns and guard clauses to minimize nested blocks.
4. Never suggest 'any'; use typed generics or unknown.
5. All new business functions must include an accompanying unit test file.

Slash Commands & Context Modifiers in Copilot Chat

Directing the AI assistant with precision:

# Prompt in Copilot Chat
@workspace /explain How is user authentication state persisted across server and client components?

# Generating Unit Tests
/tests Generate comprehensive unit tests covering edge cases for validateOrderPayload()

# Fixing Errors
@terminal /fix Resolve this TypeScript compilation error with discriminated unions

Inline Prompt Engineering for Precise Code Generation

Guiding inline suggestions with intentional comment prompts:

// Function: parseJWTHeader
// Inputs: raw auth header string (e.g., 'Bearer <token>')
// Output: decoded payload object or throws UnauthorizedException
// Handles expired tokens, malformed base64, and missing prefix
export function parseJWTHeader(authHeader?: string): TokenPayload {
  // Copilot autocompletes implementation here
}

Common Patterns

Custom Copilot Instructions (.github/copilot-instructions.md)

Problem: Generic completions ignore repository style guides, testing patterns, and library versions.
Solution: Create project-level guidelines recognized by Copilot in VS Code and JetBrains.

<!-- .github/copilot-instructions.md -->

# Project Guidelines

- Architecture: Feature-sliced design (`src/features/<feature-name>/{api,components,hooks}`).
- State Management: TanStack Query for server state; Zustand for global client state.
- Testing: Write Vitest unit tests colocated as `<name>.test.ts` for all pure helper functions.
- Concurrency: Prefer `Promise.allSettled()` over `Promise.all()` for batch operations.

Prompt-Driven Unit Test Generation (/tests)

Problem: Writing repetitive unit test boilerplate for edge cases and validation schemas.
Solution: Highlight target function in editor and invoke /tests with constraints.

// Prompt: /tests generate vitest test cases covering boundary values, empty arrays, and null inputs
export function calculateDiscount(price: number, coupon?: string): number {
  if (price < 0) throw new Error("Price cannot be negative");
  if (coupon === "VIP50") return price * 0.5;
  if (coupon === "SAVE10") return Math.max(0, price - 10);
  return price;
}

Best Practices

Do:

  • Maintain a .github/copilot-instructions.md in repository root to align Copilot with team conventions.
  • Use @workspace to scope prompts to whole repository architecture and dependency patterns.
  • Provide clear docstrings, parameter types, and test names to guide high-quality completions.
  • Verify and write unit tests for all Copilot-generated logic before committing.

Don't:

  • Accept multi-line completions without verifying security implications (e.g. SQL injection, sanitization).
  • Prompt Copilot with confidential tokens, production certificates, or customer PII.
  • Rely on Copilot for sensitive cryptographic algorithm implementation without formal review.

Troubleshooting

ErrorCauseSolution
Copilot completions not appearingEditor extension logged out or GitHub Copilot subscription inactive.Re-authenticate GitHub account in IDE settings.
Copilot generating obsolete API syntaxContext window lacks reference to modern framework version.Open modern reference file in adjacent tab or specify version in prompt.
Copilot completions disabled for languageFile type disabled in Copilot extension language settings.Check github.copilot.enable settings in VS Code settings.json.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.