๐Ÿค– Github Copiliot tech debt burndown - Copilot-instructions.md
 
 

If you're using GitHub Copilot I've generated copilot-instructions.md content based GitHub Billing Team's best practices article. Pop it in your .github directory and let Copilot do its AI magic.


# Copilot Instructions – Burn Down Technical Debt

These instructions are based on how the GitHub Billing Team uses Copilot to reduce technical debt effectively. Apply these principles when suggesting code, refactors, or comments:

## ๐Ÿ” Embrace Incremental Change
- Target **small, surgical improvements** in the code you're already working on.
- Don't boil the ocean—fix what you touch.
- Think in terms of **continuous cleanup**, not massive rewrites.

## ๐Ÿงน Remove Low-Hanging Technical Debt
- Look for and remove:
  - Dead or unused code.
  - Outdated TODOs and comments.
  - Duplicated logic or over-engineered patterns.
- Eliminate unnecessary abstractions and flatten convoluted control flows.

## โœ๏ธ Improve Readability and Consistency
- Rename confusing variables, methods, and files to better reflect intent.
- Align code to consistent patterns, naming conventions, and idioms.
- Suggest structure changes that reduce the cognitive load on future developers.

## ๐Ÿ”ฌ Add Missing Tests (Where Feasible)
- Propose unit tests when legacy code lacks coverage—especially if you're already modifying that area.
- Suggest mocking, dependency injection, or other techniques to make testing possible.

## ๐Ÿ“ˆ Leave the Codebase Better Than You Found It
- Adopt a Boy Scout Rule mindset: if you're touching a piece of code, leave it cleaner.
- Don't leave a mess behind—improve code hygiene with every commit.

## ๐Ÿ‘ Think Like a Maintainer
- Imagine you're the one maintaining this code in a year.
- Would your suggestion reduce time to understand, fix, or extend the code?
- Avoid clever tricks in favor of clarity and maintainability.

## ๐Ÿ’ก Collaborate with Developers, Not Replace Them
- Treat Copilot suggestions as **collaborative inputs**—not final answers.
- Encourage developers to review, revise, and adapt suggestions in the context of their team's style and priorities.

## ๐ŸšฆIntegrate with Existing Cleanup Backlogs
- Assume this repo is actively burning down tech debt.
- Structure suggestions to **align with in-flight refactor efforts** when possible.
- For larger structural issues, suggest backlog-worthy improvements as comments or TODOs.

---

Inspired by the GitHub Billing Team's Copilot usage:  
https://github.blog/ai-and-ml/github-copilot/how-the-github-billing-team-uses-the-coding-agent-in-github-copilot-to-continuously-burn-down-technical-debt/