Master technical decision-making with GitHub Copilot CLI

📚 Understanding Codebases - Copy-Paste Templates

Template: Explain a System
$ copilot explain '[FEATURE/SYSTEM NAME]' --context '[RELEVANT CONTEXT]'

Example: $ copilot explain 'user authentication' --context 'mobile app security'

Template: Find Related Code
$ copilot search '[KEYWORD]' --language [LANGUAGE] --context '[CONTEXT]'

Example: $ copilot search 'database query' --language python --context 'performance critical'

Template: Understand Architecture
$ copilot codebase --analyze --focus 'architecture' --context '[BUSINESS AREA]'

Example: $ copilot codebase --analyze --focus 'architecture' --context 'payment processing'

🔍 Analysis & Assessment - Copy-Paste Templates

Template: Performance Analysis
$ copilot analyze --performance --context '[COMPONENT]' --metric '[METRIC]'

Example: $ copilot analyze --performance --context 'mobile app' --metric 'battery drain'

Template: Security Audit
$ copilot audit --security --focus '[AREA]' --compliance '[STANDARD]'

Example: $ copilot audit --security --focus 'data handling' --compliance 'GDPR'

Template: Code Quality Assessment
$ copilot codebase 'quality' --metric 'test coverage' --target '[COMPONENT]'

Example: $ copilot codebase 'quality' --metric 'test coverage' --target 'authentication'

⚖️ Decision-Making - Copy-Paste Templates

Template: Effort Estimation
$ copilot estimate '[FEATURE NAME]' --context '[CONTEXT]' --compare-with existing

Example: $ copilot estimate 'dark mode support' --context 'mobile app' --compare-with existing

Template: Architecture Comparison
$ copilot compare '[OPTION1] vs [OPTION2]' --context '[CONTEXT]' --analyze 'tradeoffs'

Example: $ copilot compare 'REST vs GraphQL' --context 'mobile API' --analyze 'tradeoffs'

Template: Technical Debt Assessment
$ copilot analyze 'technical debt' --severity --priority --refactor-effort

Example: $ copilot analyze 'technical debt' --severity --priority --refactor-effort

🎯 5-Step Deep Dive Formula

Use this sequence for thorough investigation of any technical topic:

Step 1: Understand the System
$ copilot explain '[SYSTEM]'

Get high-level overview of how it works

Step 2: Find the Relevant Code
$ copilot search '[KEYWORD]' --language [LANGUAGE]

Locate where the system is implemented

Step 3: Analyze Current Implementation
$ copilot analyze --context '[SYSTEM]' --metric '[METRIC]'

Assess performance, quality, or security

Step 4: Understand Tradeoffs & Alternatives
$ copilot compare '[APPROACH1] vs [APPROACH2]' --analyze 'tradeoffs'

See different ways to solve the problem

Step 5: Get Actionable Recommendations
$ copilot estimate '[RECOMMENDED APPROACH]' --effort-breakdown

Understand effort and impact of your decision

❓ Top 10 Quick Questions & Templates

Question Template
How does X work? copilot explain 'X'
Where is X used? copilot search 'X'
How long would X take? copilot estimate 'X'
Is there a security issue in X? copilot audit --security --focus 'X'
What's slowing down X? copilot analyze --performance --context 'X'
Should we use X or Y? copilot compare 'X vs Y'
What's the test coverage of X? copilot codebase 'X' --metric 'test coverage'
How does our X compare to competitors? copilot compare 'our X' --compare-with 'competitor'
What needs to be refactored in X? copilot analyze 'X' --technical-debt
Is X compliant with GDPR/compliance? copilot audit 'X' --compliance 'GDPR'