Copilot instructions
.github/copilot-instructions.mdCopilot instructions
Quality
76/100
Scores the file, not the repository.Length
1,429 words
37 headings · 3 code blocksRepository
19
— · pushed 151 days agoLast changed
3 days ago
First indexed 3 days ago.1# Agent Orchestration23## Available Agents45Located in `~/.copilot/agents/`:67| Agent | Purpose | When to Use |8|-------|---------|-------------|9| planner | Implementation planning | Complex features, refactoring |10| architect | System design | Architectural decisions |11| tdd-guide | Test-driven development | New features, bug fixes |12| code-reviewer | Code review | After writing code |13| security-reviewer | Security analysis | Before commits |14| build-error-resolver | Fix build errors | When build fails |15| e2e-runner | E2E testing | Critical user flows |16| refactor-cleaner | Dead code cleanup | Code maintenance |17| doc-updater | Documentation | Updating docs |1819## Immediate Agent Usage2021No user prompt needed:221. Complex feature requests - Use **planner** agent232. Code just written/modified - Use **code-reviewer** agent243. Bug fix or new feature - Use **tdd-guide** agent254. Architectural decision - Use **architect** agent2627## Parallel Task Execution2829ALWAYS use parallel Task execution for independent operations:3031```markdown32# GOOD: Parallel execution33Launch 3 agents in parallel:341. Agent 1: Security analysis of auth module352. Agent 2: Performance review of cache system363. Agent 3: Type checking of utilities3738# BAD: Sequential when unnecessary39First agent 1, then agent 2, then agent 340```4142## Multi-Perspective Analysis4344For complex problems, use split role sub-agents:45- Factual reviewer46- Senior engineer47- Security expert48- Consistency reviewer49- Redundancy checker5051---5253# Coding Style5455## Immutability (CRITICAL)5657ALWAYS create new objects, NEVER mutate existing ones:5859```60// Pseudocode61WRONG: modify(original, field, value) → changes original in-place62CORRECT: update(original, field, value) → returns new copy with change63```6465Rationale: Immutable data prevents hidden side effects, makes debugging easier, and enables safe concurrency.6667## File Organization6869MANY SMALL FILES > FEW LARGE FILES:70- High cohesion, low coupling71- 200-400 lines typical, 800 max72- Extract utilities from large modules73- Organize by feature/domain, not by type7475## Error Handling7677ALWAYS handle errors comprehensively:78- Handle errors explicitly at every level79- Provide user-friendly error messages in UI-facing code80- Log detailed error context on the server side81- Never silently swallow errors8283## Input Validation8485ALWAYS validate at system boundaries:86- Validate all user input before processing87- Use schema-based validation where available88- Fail fast with clear error messages89- Never trust external data (API responses, user input, file content)9091## Code Quality Checklist9293Before marking work complete:94- [ ] Code is readable and well-named95- [ ] Functions are small (<50 lines)96- [ ] Files are focused (<800 lines)97- [ ] No deep nesting (>4 levels)98- [ ] Proper error handling99- [ ] No hardcoded values (use constants or config)100- [ ] No mutation (immutable patterns used)101102---103104# Development Workflow105106> This file extends [common/git-workflow.md](./git-workflow.md) with the full feature development process that happens before git operations.107108The Feature Implementation Workflow describes the development pipeline: research, planning, TDD, code review, and then committing to git.109110## Feature Implementation Workflow1111120. **Research & Reuse** _(mandatory before any new implementation)_113 - **GitHub code search first:** Run `gh search repos` and `gh search code` to find existing implementations, templates, and patterns before writing anything new.114 - **Exa MCP for research:** Use `exa-web-search` MCP during the planning phase for broader research, data ingestion, and discovering prior art.115 - **Check package registries:** Search npm, PyPI, crates.io, and other registries before writing utility code. Prefer battle-tested libraries over hand-rolled solutions.116 - **Search for adaptable implementations:** Look for open-source projects that solve 80%+ of the problem and can be forked, ported, or wrapped.117 - Prefer adopting or porting a proven approach over writing net-new code when it meets the requirement.1181191. **Plan First**120 - Use **planner** agent to create implementation plan121 - Generate planning docs before coding: PRD, architecture, system_design, tech_doc, task_list122 - Identify dependencies and risks123 - Break down into phases1241252. **TDD Approach**126 - Use **tdd-guide** agent127 - Write tests first (RED)128 - Implement to pass tests (GREEN)129 - Refactor (IMPROVE)130 - Verify 80%+ coverage1311323. **Code Review**133 - Use **code-reviewer** agent immediately after writing code134 - Address CRITICAL and HIGH issues135 - Fix MEDIUM issues when possible1361374. **Commit & Push**138 - Detailed commit messages139 - Follow conventional commits format140 - See [git-workflow.md](./git-workflow.md) for commit message format and PR process141142---143144# Git Workflow145146## Commit Message Format147```148<type>: <description>149150<optional body>151```152153Types: feat, fix, refactor, docs, test, chore, perf, ci154155Note: Attribution disabled globally via ~/.copilot/settings.json.156157## Pull Request Workflow158159When creating PRs:1601. Analyze full commit history (not just latest commit)1612. Use `git diff [base-branch]...HEAD` to see all changes1623. Draft comprehensive PR summary1634. Include test plan with TODOs1645. Push with `-u` flag if new branch165166> For the full development process (planning, TDD, code review) before git operations,167> see [development-workflow.md](./development-workflow.md).168169---170171# Common Patterns172173## Skeleton Projects174175When implementing new functionality:1761. Search for battle-tested skeleton projects1772. Use parallel agents to evaluate options:178 - Security assessment179 - Extensibility analysis180 - Relevance scoring181 - Implementation planning1823. Clone best match as foundation1834. Iterate within proven structure184185## Design Patterns186187### Repository Pattern188189Encapsulate data access behind a consistent interface:190- Define standard operations: findAll, findById, create, update, delete191- Concrete implementations handle storage details (database, API, file, etc.)192- Business logic depends on the abstract interface, not the storage mechanism193- Enables easy swapping of data sources and simplifies testing with mocks194195### API Response Format196197Use a consistent envelope for all API responses:198- Include a success/status indicator199- Include the data payload (nullable on error)200- Include an error message field (nullable on success)201- Include metadata for paginated responses (total, page, limit)202203---204205# Performance Optimization206207## Model Selection Strategy208209**Haiku 4.5** (90% of Sonnet capability, 3x cost savings):210- Lightweight agents with frequent invocation211- Pair programming and code generation212- Worker agents in multi-agent systems213214**Sonnet 4.6** (Best coding model):215- Main development work216- Orchestrating multi-agent workflows217- Complex coding tasks218219**Opus 4.5** (Deepest reasoning):220- Complex architectural decisions221- Maximum reasoning requirements222- Research and analysis tasks223224## Context Window Management225226Avoid last 20% of context window for:227- Large-scale refactoring228- Feature implementation spanning multiple files229- Debugging complex interactions230231Lower context sensitivity tasks:232- Single-file edits233- Independent utility creation234- Documentation updates235- Simple bug fixes236237## Extended Thinking + Plan Mode238239Extended thinking is enabled by default, reserving up to 31,999 tokens for internal reasoning.240241Control extended thinking via:242- **Toggle**: Option+T (macOS) / Alt+T (Windows/Linux)243- **Config**: Set `alwaysThinkingEnabled` in `~/.copilot/settings.json`244- **Budget cap**: `export MAX_THINKING_TOKENS=10000`245- **Verbose mode**: Ctrl+O to see thinking output246247For complex tasks requiring deep reasoning:2481. Ensure extended thinking is enabled (on by default)2492. Enable **Plan Mode** for structured approach2503. Use multiple critique rounds for thorough analysis2514. Use split role sub-agents for diverse perspectives252253## Build Troubleshooting254255If build fails:2561. Use **build-error-resolver** agent2572. Analyze error messages2583. Fix incrementally2594. Verify after each fix260261---262263# Security Guidelines264265## Mandatory Security Checks266267Before ANY commit:268- [ ] No hardcoded secrets (API keys, passwords, tokens)269- [ ] All user inputs validated270- [ ] SQL injection prevention (parameterized queries)271- [ ] XSS prevention (sanitized HTML)272- [ ] CSRF protection enabled273- [ ] Authentication/authorization verified274- [ ] Rate limiting on all endpoints275- [ ] Error messages don't leak sensitive data276277## Secret Management278279- NEVER hardcode secrets in source code280- ALWAYS use environment variables or a secret manager281- Validate that required secrets are present at startup282- Rotate any secrets that may have been exposed283284## Security Response Protocol285286If security issue found:2871. STOP immediately2882. Use **security-reviewer** agent2893. Fix CRITICAL issues before continuing2904. Rotate any exposed secrets2915. Review entire codebase for similar issues292293---294295# Testing Requirements296297## Minimum Test Coverage: 80%298299Test Types (ALL required):3001. **Unit Tests** - Individual functions, utilities, components3012. **Integration Tests** - API endpoints, database operations3023. **E2E Tests** - Critical user flows (framework chosen per language)303304## Test-Driven Development305306MANDATORY workflow:3071. Write test first (RED)3082. Run test - it should FAIL3093. Write minimal implementation (GREEN)3104. Run test - it should PASS3115. Refactor (IMPROVE)3126. Verify coverage (80%+)313314## Troubleshooting Test Failures3153161. Use **tdd-guide** agent3172. Check test isolation3183. Verify mocks are correct3194. Fix implementation, not tests (unless tests are wrong)320321## Agent Support322323- **tdd-guide** - Use PROACTIVELY for new features, enforces write-tests-first324325---
Also in j7-dev/everything-github-copilot
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| j7-dev/everything-github-copilot.codex/AGENTS.md · 19 | AGENTS.md | securityagent-behaviour | 59/100 | 3 days ago | |
| j7-dev/everything-github-copilot.github/instructions/python.instructions.md · 19 | Copilot instructions | testlint-formatstyletypes+2 | 85/100 | 3 days ago | |
| j7-dev/everything-github-copilot.github/instructions/swift.instructions.md · 19 | Copilot instructions | testlint-formatstyletypes+2 | 81/100 | 3 days ago | |
| j7-dev/everything-github-copilot.github/instructions/typescript.instructions.md · 19 | Copilot instructions | testlint-formatstyletypes+4 | 62/100 | 3 days ago | |
| j7-dev/everything-github-copilotAGENTS.md · 19 | AGENTS.md | buildteststylearch+4 | 77/100 | 3 days ago | |
| j7-dev/everything-github-copilot.github/instructions/go.instructions.md · 19 | Copilot instructions | testlint-formatstyletesting-strategy+1 | 77/100 | 3 days ago | |
| j7-dev/everything-github-copilotCLAUDE.md · 19 | CLAUDE.md | testarchagent-behaviour | 81/100 | 3 days ago | |
| j7-dev/everything-github-copilotskills/react-best-practices/AGENTS.md · 19 | AGENTS.md | buildlint-formatstylearch+8 | 64/100 | 3 days ago |
Diff against .codex/AGENTS.md Diff against .github/instructions/python.instructions.md Diff against .github/instructions/swift.instructions.md Diff against .github/instructions/typescript.instructions.md Diff against AGENTS.md Diff against .github/instructions/go.instructions.md Diff against CLAUDE.md Diff against skills/react-best-practices/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 24 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 3 days ago | |
| nerolis-lab/nerolis-lab.github/copilot-instructions.md · 32 | Copilot instructions | setupbuildtestlint-format+11 | 96/100 | 3 days ago | |
| thangaram611/second-brain.github/copilot-instructions.md · 0 | Copilot instructions | setupteststylearch+4 | 96/100 | 3 days ago |
