GitHub Copilot CLI Explorer

Master the Copilot CLI
Ecosystem

Explore agents, skills, prompts, MCP integrations, and CLI workflows. Your interactive guide to GitHub Copilot's command-line interface.

16+
Slash Commands
12
Agent Skills
45+
Prompt Templates
5
MCP Integrations

Agent Explorer

Discover the agents that power Copilot CLI — their tools, skills, and how to use them.

Skills Explorer

Explore the specialized skills agents use — from code generation to security auditing.

Prompt Library

45+ battle-tested prompts organized by category. Copy, customize, and use in your CLI workflow.

40 prompts found

Scaffold a Full-Stack App

Code Generation

Generate a complete full-stack application with frontend, backend, and database setup.

#full-stack#react#express#typescript

Create a full-stack TypeScript application with a React frontend (Vite), Express API backend, and PostgreSQL database. Include authentication with JWT, CRUD operations for a "tasks" resource, and proper error handling. Set up the project structure with separate client/server directories.

Create a REST API Endpoint

Code Generation

Generate a RESTful API endpoint with validation, error handling, and documentation.

#api#rest#validation#typescript

Create a REST API endpoint for managing user profiles. Include GET (list/detail), POST, PUT, and DELETE operations. Add input validation with Zod, proper HTTP status codes, and TypeScript types.

Generate React Component

Code Generation

Create a production-ready React component with TypeScript, tests, and stories.

#react#component#tailwind#typescript

Create a reusable DataTable React component with TypeScript. Support sortable columns, pagination, row selection, and search filtering. Use TailwindCSS for styling. Include prop types and a usage example.

CLI Tool Generator

Code Generation

Build a Node.js command-line tool with argument parsing and interactive prompts.

#cli#node#commander#migrations

Create a Node.js CLI tool using Commander.js for managing database migrations. Include commands: create, up, down, status. Add interactive confirmation prompts for destructive operations and colored output.

WebSocket Server

Code Generation

Generate a WebSocket server with rooms, authentication, and reconnection handling.

#websocket#realtime#node#auth

Create a WebSocket server using ws library in Node.js. Implement rooms/channels, JWT authentication on connection, heartbeat/ping mechanism, graceful reconnection handling, and typed message protocols.

Convert Callbacks to Async/Await

Refactoring

Refactor callback-based code to use modern async/await patterns.

#async#callbacks#modernization

Refactor all callback-based functions in this file to use async/await. Preserve error handling, add proper try/catch blocks, and ensure all edge cases are covered. Maintain backward compatibility.

Extract Reusable Module

Refactoring

Break a large file into smaller, reusable modules with clean interfaces.

#modules#organization#clean-code

This file is over 500 lines. Analyze it and extract logical groups into separate modules. Create clean public interfaces (exports) for each module. Update all imports. Ensure no circular dependencies.

Apply Design Pattern

Refactoring

Refactor code to implement a specific design pattern for better extensibility.

#design-patterns#strategy#oop

Refactor the payment processing code to use the Strategy pattern. Each payment method (credit card, PayPal, crypto) should be a separate strategy. Include a factory for creating strategies and maintain the existing interface.

Improve Type Safety

Refactoring

Add strict TypeScript types, eliminating any types and adding proper generics.

#typescript#type-safety#generics

Audit this codebase for type safety issues. Replace all `any` types with proper types. Add generics where applicable. Enable strict null checks and fix all resulting errors. Add discriminated unions for state management.

Optimize Performance

Refactoring

Refactor code for better runtime performance — memoization, lazy loading, reduced allocations.

#performance#react#optimization

Analyze this React application for performance issues. Add React.memo, useMemo, and useCallback where beneficial. Implement code splitting with lazy/Suspense. Optimize re-renders. Add virtualization for long lists.

Fix Failing Tests

Debugging

Analyze test failures, identify root causes, and apply fixes.

#testing#fix#analysis

Run the test suite, analyze all failing tests, identify the root cause of each failure, and fix them. Explain what was wrong and why the fix works. Do not modify the test expectations unless they are clearly wrong.

Debug Memory Leak

Debugging

Identify and fix memory leaks in a Node.js application.

#memory#node#performance#leak

Analyze this Node.js application for memory leaks. Check for: unclosed connections, event listener accumulation, large object retention, missing cleanup in intervals/timeouts, and circular references. Fix all issues found.

Debug API Error

Debugging

Trace an API error from the HTTP response back to the root cause in the codebase.

#api#error#tracing#server

I'm getting a 500 Internal Server Error on POST /api/orders. Trace the request flow from the route handler through middleware, service layer, and database queries. Find the root cause and fix it.

Fix Race Condition

Debugging

Identify and resolve race conditions in async code.

#concurrency#async#race-condition

There's a race condition causing intermittent failures in the order processing system. Analyze all concurrent operations, identify where race conditions can occur, and implement proper synchronization (locks, queues, or atomic operations).

Debug Build Failure

Debugging

Diagnose and fix build/compilation errors in a project.

#build#typescript#compilation

The build is failing with TypeScript compilation errors. Analyze the build output, identify all errors, determine if they are type errors, missing dependencies, or config issues, and fix everything so the build passes.

Design Microservices Split

Architecture

Analyze a monolith and propose a microservices decomposition strategy.

#microservices#monolith#migration#design

Analyze this monolithic application. Identify bounded contexts, propose service boundaries, define API contracts between services, suggest a communication strategy (sync/async), and create a migration plan from monolith to microservices.

Design Database Schema

Architecture

Design a normalized database schema for a domain with relationships and indexes.

#database#schema#postgresql#design

Design a PostgreSQL database schema for an e-commerce platform. Include tables for users, products, categories, orders, order items, payments, reviews, and inventory. Add proper foreign keys, indexes for common queries, and constraints.

API Design Review

Architecture

Review and improve an API design for consistency, usability, and RESTful best practices.

#api#rest#design#review

Review the API design in this project. Check for RESTful conventions, consistent naming, proper HTTP methods, pagination patterns, error response formats, versioning strategy, and rate limiting. Suggest improvements.

Event-Driven Architecture

Architecture

Design an event-driven system with publishers, subscribers, and event schemas.

#events#pub-sub#async#messaging

Design an event-driven architecture for the notification system. Define event types, create event schemas, implement publisher/subscriber patterns, add dead letter queue handling, and ensure idempotent event processing.

CI/CD Pipeline

DevOps

Create a complete CI/CD pipeline with testing, building, and deployment stages.

#ci-cd#github-actions#docker#deployment

Create a GitHub Actions CI/CD pipeline for a Node.js application. Include: lint, test (with coverage), build, security scan, Docker build, push to registry, and deploy to staging on PR merge, production on release.

Dockerfile Optimization

DevOps

Create a production-optimized multi-stage Dockerfile.

#docker#optimization#security#containers

Create an optimized multi-stage Dockerfile for this Node.js application. Include: build stage, production stage with minimal image, non-root user, health check, proper cache layers, .dockerignore, and security hardening.

Infrastructure as Code

DevOps

Generate Terraform/IaC templates for cloud infrastructure.

#terraform#aws#infrastructure#iac

Create Terraform configurations for deploying this application to AWS. Include: VPC, ECS Fargate cluster, RDS PostgreSQL, ElastiCache Redis, Application Load Balancer, CloudWatch monitoring, and IAM roles with least-privilege.

Monitoring & Alerting

DevOps

Set up application monitoring, logging, and alerting.

#monitoring#logging#metrics#alerting

Set up monitoring for this application. Add structured logging with correlation IDs, health check endpoints, metrics collection (request latency, error rate, memory usage), and alerting rules for SLA breaches.

K8s Deployment

DevOps

Create Kubernetes manifests for containerized deployment.

#kubernetes#k8s#deployment#containers

Create Kubernetes manifests for this application. Include: Deployment with rolling update, Service, Ingress with TLS, ConfigMap, Secrets, HPA for autoscaling, PodDisruptionBudget, and resource limits.

Database Migration

Data Engineering

Create database migration scripts with rollback support.

#database#migration#multi-tenant#rls

Create database migration scripts for adding a multi-tenant architecture. Add tenant_id to all tables, create row-level security policies, update indexes, and include both up and down migrations with data preservation.

Query Optimization

Data Engineering

Analyze and optimize slow database queries.

#sql#optimization#indexes#performance

Analyze the database queries in this project. Identify slow queries, add missing indexes, rewrite inefficient joins, add proper pagination, and implement query result caching where appropriate.

ETL Pipeline

Data Engineering

Create an ETL pipeline for data ingestion and transformation.

#etl#pipeline#data#transformation

Create an ETL pipeline using Node.js that: extracts data from a REST API, transforms it (clean, validate, normalize), and loads it into PostgreSQL. Include error handling, retry logic, incremental processing, and logging.

AI Agent Workflow

AI/ML

Build an AI agent with tool calling and multi-step reasoning.

#ai#agent#openai#tools

Create an AI agent using the OpenAI API that can: search the web, read files, execute code, and answer questions. Implement a tool-calling loop with proper error handling, context management, and conversation history.

RAG Pipeline

AI/ML

Build a Retrieval Augmented Generation pipeline for document Q&A.

#rag#embeddings#vector-search#llm

Create a RAG pipeline for answering questions about documentation. Include: document chunking, embedding generation, vector store (using pgvector), semantic search retrieval, prompt construction with context, and response generation.

Prompt Engineering System

AI/ML

Create a prompt management system with templates and versioning.

#prompts#templates#ai#management

Build a prompt template system with: variable interpolation, version tracking, A/B testing support, output validation, and logging. Include templates for common tasks (summarization, extraction, classification).

Unit Test Suite

Testing

Generate comprehensive unit tests with edge cases and mocks.

#unit-tests#vitest#mocking#coverage

Write unit tests for all exported functions in this module. Use Vitest with TypeScript. Include: happy path, edge cases, error scenarios, boundary values, and mock external dependencies. Aim for >90% coverage.

E2E Test Scenarios

Testing

Create end-to-end tests for critical user flows.

#e2e#playwright#integration#automation

Write E2E tests using Playwright for the critical user flows: signup, login, create order, view order history, and checkout. Include: page objects, test fixtures, visual regression checks, and CI configuration.

API Integration Tests

Testing

Create API integration tests with database setup/teardown.

#integration#api#database#testing

Write API integration tests for all endpoints. Include: test database setup with migrations, seed data fixtures, request/response validation, auth token handling, cleanup after each test, and parallel execution support.

Comprehensive README

Documentation

Generate a production-quality README with all essential sections.

#readme#markdown#docs#onboarding

Generate a comprehensive README.md for this project. Include: project description, features list, architecture overview, prerequisites, installation steps, configuration guide, usage examples, API reference, contributing guidelines, and license.

API Documentation

Documentation

Generate OpenAPI/Swagger documentation from code.

#openapi#swagger#api-docs#yaml

Generate OpenAPI 3.0 documentation for all API endpoints. Include: path descriptions, request/response schemas, error codes, authentication requirements, example payloads, and write it as an openapi.yaml file.

Architecture Decision Record

Documentation

Document an architecture decision with context, options, and rationale.

#adr#architecture#decision#documentation

Create an Architecture Decision Record (ADR) for [decision]. Include: context, decision drivers, considered options with pros/cons, decision outcome, consequences, and compliance requirements.

OWASP Security Audit

Security

Audit code against OWASP Top 10 vulnerabilities.

#owasp#security#audit#vulnerabilities

Audit this codebase against the OWASP Top 10. Check for: injection flaws, broken authentication, sensitive data exposure, XXE, broken access control, security misconfiguration, XSS, insecure deserialization, known vulnerabilities, and insufficient logging.

Auth Implementation Review

Security

Review authentication and authorization implementation for security gaps.

#auth#jwt#rbac#security-review

Review the authentication and authorization system. Check: password hashing (bcrypt/argon2), JWT implementation (expiry, refresh, revocation), RBAC/ABAC enforcement, session management, CSRF protection, and OAuth flows.

Dependency Vulnerability Scan

Security

Scan and fix known vulnerabilities in project dependencies.

#dependencies#cve#npm-audit#supply-chain

Scan all project dependencies for known vulnerabilities. Check npm audit results, identify critical/high severity issues, and update or replace vulnerable packages. Ensure updates don't break existing functionality.

Input Sanitization

Security

Add input validation and sanitization across all entry points.

#validation#sanitization#injection#xss

Review all user input entry points (API endpoints, form handlers, URL parameters). Add proper input validation, sanitization, and parameterized queries. Prevent SQL injection, XSS, command injection, and path traversal.

CLI Commands & Playground

Every slash command, flag, mode, and environment variable — with examples you can copy.

Quick Start
Install GitHub Copilot CLI
npm install -g @githubnext/github-copilot-cli
Launch interactive mode
copilot
Or run a single prompt
copilot -p "Explain this repo"
GitHub Copilot CLI — ready to assist.
/
/plan

Activate plan mode for structured task planning. Copilot asks clarifying questions before generating code.

/plan
$/plan
$Shift+Tab to toggle plan mode
/
/model

Switch between available AI models. Shows model list with request multipliers.

/model [model-name]
$/model
$/model claude-sonnet-4
/
/fleet

Execute tasks in parallel across multiple subagents or models.

/fleet [prompt]
$/fleet Implement the search feature using three different approaches
/
/delegate

Hand off the current session to GitHub's server-side Copilot agent. Creates a branch and PR.

/delegate
$/delegate
/
/diff

Review all code changes made in the current session.

/diff
$/diff
/
/agent

List, select, or manage custom agents defined in AGENTS.md or .copilot/agents.yml.

/agent [agent-name]
$/agent
$/agent frontend-agent
/
/skills

List and manage agent skills — specialized task abilities and instructions.

/skills
$/skills
/
/mcp

View, configure, and manage MCP (Model Context Protocol) servers.

/mcp
$/mcp
$/mcp list
/
/resume

Continue long-running work from a previous session.

/resume
$/resume
/
/compact

Manually compress conversation context to free up token space.

/compact
$/compact
/
/context

View detailed token usage breakdown for the current session.

/context
$/context
/
/allow-all

Grant Copilot full permissions for the current session — no more approval prompts.

/allow-all
$/allow-all
/
/yolo

Alias for /allow-all — run with full permissions. Use with caution.

/yolo
$/yolo
/
/experimental

Access preview and experimental features not yet generally available.

/experimental
$/experimental
/
/changelog

View the latest feature updates and changes to Copilot CLI.

/changelog
$/changelog
/
/feedback

Submit feedback — bug report, feature request, or private survey.

/feedback
$/feedback
-p, --prompt

Run in programmatic mode with a single prompt. Completes the task and exits.

copilot -p "your prompt"
$copilot -p "Explain this repo"
$copilot -p "Fix the bug in auth.ts"
--model

Specify which AI model to use for the session.

copilot --model "model-name"
$copilot --model claude-sonnet-4
--allow-all-tools

Grant all tool permissions upfront — no approval prompts during execution.

copilot --allow-all-tools
$copilot -p "Fix tests" --allow-all-tools
--allow-tool

Allow a specific tool or command without requiring approval.

copilot --allow-tool='tool(arg)'
$copilot --allow-tool='shell(npm test)'
$copilot --allow-tool='write'
$copilot --allow-tool='git push'
--deny-tool

Block a specific tool from being used, even if other permissions are granted.

copilot --deny-tool='tool(arg)'
$copilot --allow-all-tools --deny-tool='shell(rm)'
$copilot --deny-tool='shell(git push)'
Interactive Mode

Launch with `copilot` for a chat-like terminal interface. Supports slash commands, plan mode, and iterative workflows.

copilot
$copilot
Programmatic Mode

Launch with `copilot -p` for headless execution. Completes the task and exits. Ideal for scripts and automation.

copilot -p "prompt" [flags]
$copilot -p "Revert last commit" --allow-all-tools
Plan Mode

Toggle with Shift+Tab or /plan. Copilot creates a structured plan before executing, asking clarifying questions first.

/plan or Shift+Tab
$Shift+Tab to enter plan mode
$/plan to activate
$
COPILOT_PROVIDER_BASE_URL

Set a custom API endpoint for the model provider.

export COPILOT_PROVIDER_BASE_URL="https://..."
$export COPILOT_PROVIDER_BASE_URL="http://localhost:11434/v1"
$
COPILOT_PROVIDER_TYPE

Specify the provider type: openai, azure, or anthropic.

export COPILOT_PROVIDER_TYPE="openai"
$export COPILOT_PROVIDER_TYPE="openai"
$export COPILOT_PROVIDER_TYPE="anthropic"
$
COPILOT_PROVIDER_API_KEY

API key for authentication with a custom model provider.

export COPILOT_PROVIDER_API_KEY="sk-..."
$export COPILOT_PROVIDER_API_KEY="sk-your-key"
$
COPILOT_MODEL

Specify the model name (required when using custom provider).

export COPILOT_MODEL="model-name"
$export COPILOT_MODEL="gpt-4o"
$
COPILOT_OFFLINE

Set to "true" for offline mode — disables telemetry and web-based tools.

export COPILOT_OFFLINE="true"
$export COPILOT_OFFLINE="true"

MCP Integrations

Extend Copilot CLI with Model Context Protocol servers — connect databases, browsers, and custom tools.

GitHub MCP Server

Native GitHub integration providing access to issues, pull requests, code search, branches, labels, and repository management directly from the CLI.

Available Tools

search_issuescreate_issuelist_pull_requestscreate_pull_requestmerge_pull_requestsearch_codeget_file_contentslist_branchescreate_branchget_labels
Configuration
# Built-in — no configuration needed.
# Available automatically when authenticated with GitHub.
# Access via: copilot /mcp

# Mention in prompts:
copilot -p "Use GitHub MCP to list all open issues labeled 'bug'"
Usage Examples
# List open bugs
copilot -p "Find all open issues labeled 'bug' and summarize them"

# Create a PR from CLI
copilot -p "Create a pull request for the current branch with a description of all changes"

# Search code across repos
copilot -p "Search the codebase for deprecated API usage"

CLI Quick Start Guide

From installation to mastery — everything you need to get started with Copilot CLI.

1Installation

Install Copilot CLI
Install via npm (recommended)
npm install -g @githubnext/github-copilot-cli
+ @githubnext/github-copilot-cli@latest
Verify installation
copilot --version
GitHub Copilot CLI v1.x.x

2Authentication

Authenticate
Login with GitHub (opens browser)
copilot auth login
✓ Logged in as @your-username
Verify auth status
copilot auth status
✓ Authenticated · Copilot Business

3Usage Modes

Interactive Mode

Launch a chat-like session with full slash command support.

# Start interactive session
copilot

# With a specific model
copilot --model claude-sonnet-4

Programmatic Mode

Execute a single prompt and exit. Great for scripts and CI.

# Run single prompt
copilot -p "Fix all lint errors"

# With auto-approved tools
copilot -p "Run tests" --allow-all-tools

4Key Concepts

Trust Boundary

Copilot operates within the current working directory. It can only access files in the trusted project root and its subdirectories.

Auto-Compaction

When conversation context reaches 95%, Copilot automatically compresses history while preserving key information. Use /compact manually when needed.

Tool Permissions

Every tool invocation requires approval by default. Use --allow-tool or --allow-all-tools to pre-approve. Use --deny-tool to block specific tools.

5Customization

.copilot/instructions.md
# Project Instructions

## Tech Stack
- TypeScript, React, Express
- PostgreSQL with Prisma ORM

## Conventions
- Use functional components
- Prefer async/await over callbacks
- All new code must have tests
- Follow existing naming conventions
AGENTS.md
# Custom Agent: Frontend Lead

## Role
You are a senior frontend engineer
specializing in React and TypeScript.

## Tools
- read_file, write_file, shell

## Instructions
- Use React 19 features
- Follow atomic design
- Add Storybook stories for components

Agent Flow Visualizer

See how prompts flow through agents, skills, and tools to produce results.

How Copilot CLI traces a bug from user prompt to fixed code.

prompt
agent
skill
tool
output

Hover over a node to see details

prompt
agent
skill
tool
output

Best Practices

Expert tips for getting the most out of Copilot CLI — prompt engineering, performance, and workflow optimization.

Prompt Engineering

Be Explicit and Specific

The more context you give, the better the output. Specify language, framework, patterns, and constraints.

  • Include the programming language and framework explicitly
  • Specify file paths when referring to existing code
  • Mention coding conventions and style preferences
  • Define input/output expectations clearly
  • State constraints: "without breaking existing tests" or "maintaining backward compatibility"
Prompt Engineering

Break Complex Tasks into Steps

Large tasks get better results when decomposed. Use plan mode or sequential prompts.

  • Use /plan mode for complex multi-step tasks
  • Start with analysis: "Analyze this file and identify issues"
  • Then act: "Fix the issues you identified"
  • Queue follow-up messages while Copilot is working
  • Use iterative refinement: start broad, then narrow down
Prompt Engineering

Use Templates and Patterns

Structured prompts produce structured output. Use consistent prompt patterns for repeatable results.

  • Pattern: "Create a [thing] that [does what] using [technology] with [constraints]"
  • Pattern: "Review [target] for [criteria]. Suggest fixes for [priority issues]"
  • Pattern: "Refactor [code] to use [pattern]. Maintain [invariants]"
  • Save effective prompts for reuse across projects
  • Combine prompts with CLI flags for automation
Prompt Engineering

Provide Examples and Context

Show Copilot what you want with examples. Reference existing code patterns in your project.

  • "Follow the same pattern as src/routes/users.ts"
  • "Here's an example of the expected output format: ..."
  • "Use the same error handling approach as the auth module"
  • Reference config files: "Use the ESLint rules in .eslintrc"
  • Mention existing tests as patterns: "Follow the test style in __tests__/"
CLI Usage

Start in the Right Directory

Always launch Copilot from your project root. It uses the working directory as its trust boundary.

  • cd to your project root before running `copilot`
  • Copilot can only read/modify files within the trusted directory
  • Use git repositories — Copilot leverages git context
  • Run from the directory with your package.json / pyproject.toml
  • For monorepos, cd to the specific package directory for focused context
CLI Usage

Master Tool Permissions

Understand and use the tool permission system to balance speed and safety.

  • --allow-all-tools for trusted automation tasks
  • --allow-tool='shell(npm test)' to auto-approve specific commands
  • --allow-tool='write' to skip file write approvals
  • --deny-tool='shell(rm)' to block dangerous operations even with --allow-all-tools
  • Use /allow-all during interactive sessions when you trust the operations
CLI Usage

Use Programmatic Mode for Automation

Combine -p flag with tool permissions for scriptable CLI workflows.

  • copilot -p "prompt" for single-shot execution
  • Chain with shell: copilot -p "Fix lint errors" && npm run lint
  • Use in CI: copilot -p "Generate changelog" --allow-all-tools
  • Pipe input: echo "explain this" | copilot -p -
  • Combine with --model for specific model selection
CLI Usage

Manage Context Effectively

Keep conversations focused. Use /compact when context grows large.

  • Use /compact to compress context without losing key information
  • Use /context to check current token usage
  • Start new sessions for unrelated tasks
  • Use /resume to continue previous work in new sessions
  • Copilot auto-compacts at 95% token limit
Performance

Scope Your Prompts Tightly

Smaller, focused prompts execute faster and produce better results than broad ones.

  • Target specific files: "Fix the bug in src/utils/auth.ts"
  • Avoid "fix everything" — instead "fix the 3 TypeScript errors in this file"
  • Use file paths to narrow the search scope
  • One task per prompt in programmatic mode
  • Batch related changes but keep them in the same domain
Performance

Choose the Right Model

Different models have different strengths. Use /model to switch based on the task.

  • Use faster models for simple tasks (explanations, small edits)
  • Use advanced models for complex architecture and multi-file refactoring
  • Check request multipliers with /model — higher multiplier = more quota used
  • Use /fleet to try multiple models in parallel for important decisions
  • Set COPILOT_MODEL env var to default to your preferred model
Performance

Leverage Custom Instructions

Pre-configure Copilot with project-specific knowledge to reduce prompt size and improve accuracy.

  • Create .copilot/instructions.md with project conventions
  • Define coding style, architecture patterns, and tech stack
  • Add common gotchas and project-specific rules
  • Use AGENTS.md for role-specific agents
  • Copilot Memory automatically learns your patterns over time

Workflow Templates

End-to-end automation scripts for common development workflows — ready to customize and run.

Refactoring

Refactor Legacy Codebase

Systematically modernize a legacy codebase — update patterns, fix anti-patterns, and improve maintainability.

Workflow Steps

1Analyze the codebase and create a report of legacy patterns
2Prioritize changes by impact and risk
3Update language features (var→const/let, callbacks→async/await)
4Extract modules and reduce file sizes
5Add TypeScript types or JSDoc annotations
6Run tests after each step to verify no regressions

Prompt

Analyze this codebase for legacy patterns. Create a prioritized modernization plan, then execute it step by step. Start with the highest-impact, lowest-risk changes. Run tests after each change.

Code Generation

Generate Microservice

Scaffold a complete microservice with API, database, Docker, and CI/CD.

Workflow Steps

1Scaffold project structure with Express/Fastify
2Create database models and migrations
3Implement CRUD API endpoints with validation
4Add authentication middleware
5Create Dockerfile and docker-compose
6Set up GitHub Actions CI/CD pipeline
7Generate API documentation

Prompt

Create a Node.js microservice with TypeScript, Express, PostgreSQL (Prisma ORM), JWT authentication, input validation with Zod, structured logging, health checks, Dockerfile, docker-compose, GitHub Actions CI/CD, and OpenAPI docs.

DevOps

Fix CI Pipeline

Diagnose and fix a failing CI/CD pipeline — build errors, test failures, and deployment issues.

Workflow Steps

1Analyze the CI logs to identify failure points
2Check for environment/dependency differences
3Fix build errors or test failures
4Update CI configuration if needed
5Verify the pipeline passes locally
6Push fixes and monitor the pipeline

Prompt

The CI pipeline is failing. Analyze the GitHub Actions workflow, check the recent logs, identify what changed, and fix the issues. Ensure the pipeline passes for both PR checks and main branch deployment.

Architecture

Analyze Repository

Get a comprehensive understanding of an unfamiliar codebase — architecture, patterns, and entry points.

Workflow Steps

1Scan the project structure and key files
2Identify the tech stack and frameworks
3Map the architecture and data flow
4Find entry points and main modules
5Document key patterns and conventions
6List potential improvements

Prompt

Analyze this repository comprehensively. Explain: the tech stack, project structure, architecture patterns, main entry points, data flow, key modules, testing approach, and deployment setup. Then list the top 5 areas for improvement.

Development

Add Feature with Tests

Implement a new feature following TDD — write tests first, then implementation.

Workflow Steps

1Understand the feature requirements
2Write failing unit tests for the feature
3Implement the feature to pass the tests
4Add integration tests
5Update documentation
6Create a PR with descriptive commit messages

Prompt

Implement [feature description] using TDD. First write failing tests that define the expected behavior, then implement the feature to pass all tests. Add both unit and integration tests. Update the README with the new feature.

Security

Security Hardening

Comprehensive security audit and hardening of an application.

Workflow Steps

1Run dependency vulnerability scan
2Audit for OWASP Top 10
3Review auth/authz implementation
4Check for hardcoded secrets
5Add input validation and sanitization
6Set up security headers and CSP
7Document security measures

Prompt

Perform a comprehensive security audit: scan dependencies, check OWASP Top 10, review auth, find hardcoded secrets, validate inputs, and set up security headers. Fix all critical and high severity issues.

Architecture

API Migration (v1 → v2)

Plan and execute an API version migration with backward compatibility.

Workflow Steps

1Document all v1 API endpoints and consumers
2Design v2 API with improvements
3Create migration guide for consumers
4Implement v2 endpoints alongside v1
5Add deprecation warnings to v1
6Write migration tests
7Set up traffic routing (v1 → v2)

Prompt

Plan an API migration from v1 to v2. Document all v1 endpoints, design improved v2 endpoints, implement them alongside v1 with deprecation warnings, create a migration guide, and add tests to verify both versions work.

Development

Performance Optimization

Profile, identify bottlenecks, and optimize application performance.

Workflow Steps

1Profile the application to identify bottlenecks
2Optimize database queries (add indexes, fix N+1)
3Add caching layers (Redis/in-memory)
4Optimize frontend bundle size
5Implement lazy loading and code splitting
6Set up performance monitoring

Prompt

Analyze this application for performance bottlenecks. Check: slow database queries, missing indexes, N+1 queries, unnecessary re-renders, large bundle size, missing caching. Fix the top issues and add performance monitoring.