Enhance Productivity and Code Quality
Unlock the complete study guide.
Bundled into the existing GitHub Copilot premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- One loop for every productivity task
- Generating code from comments and prompts
- Breaking a complex generation task into steps
- Reviewing generated code before you accept it
- Refactoring: new structure, same behavior
- Generating documentation from code
- Learning in the editor: explanations and follow-ups
- Debugging with evidence: error text and expected behavior
- Generating sample data that respects the schema
- Modernizing legacy code: the two documented approaches
- The chat-driven modernization workflow
- Assessing and upgrading with the app modernization extension
- Finishing a modernization after the conversion
- Practice scenarios: productivity tasks
One loop, different baselines: what to supply, what to state, what to check per task
| Task | Context to supply | Target to state | Baseline to check against |
|---|---|---|---|
| Code generation | Surrounding code, relevant open files, example inputs and outputs | Goal, then inputs, outputs, error handling and framework | Your stated requirements, through review and tests |
| Refactoring | The selected code, understood first through an explanation | Target structure or convention, such as the syntax of the language version the project targets, or a naming style | Existing behavior, through the existing tests |
| Documentation | The code; for project docs also configuration, existing docs and audience | Contract and rationale: inputs, outputs, dependencies, assumptions | The current implementation |
| Explanation | The selected code or file | The part to clarify and the language you already know | The code itself |
| Debugging | Error message and the relevant code | Expected behavior versus actual behavior | The expected behavior, after the fix runs |
| Sample data | Schema or a representative structured sample | Count, patterns, uniqueness and which keys must resolve to parent rows | Constraints, relationships and business rules |
| Modernization | Legacy files, dependencies and data flow | Target language or framework, one bounded part at a time | The legacy system's behavior; in the chat-driven workflow, a stakeholder-validated test plan |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
References
- https://github.com/github/docs/blob/871db5e8a4122d0c6d218f08a64e7e95b950c448/content/copilot/tutorials/refactor-code.md
- https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/gh-300
- https://docs.github.com/en/copilot/concepts/prompting/prompt-engineering
- https://docs.github.com/en/copilot/tutorials/copilot-cookbook/refactor-code/translate-code
- https://docs.github.com/en/copilot/concepts/completions/code-suggestions
- https://docs.github.com/en/copilot/get-started/best-practices
- https://docs.github.com/en/copilot/how-tos/get-code-suggestions/get-ide-code-suggestions?tool=vscode
- https://docs.github.com/en/copilot/tutorials/review-ai-generated-code
- https://github.com/github/docs/commit/e69e757062
- https://docs.github.com/en/copilot/tutorials/copilot-cookbook/refactor-code
- https://docs.github.com/en/copilot/tutorials/copilot-cookbook/refactor-code/improve-code-readability
- https://github.blog/ai-and-ml/github-copilot/documenting-and-explaining-legacy-code-with-github-copilot-tips-and-examples/
- https://docs.github.com/en/copilot/reference/cheat-sheet
- https://learn.microsoft.com/en-us/training/modules/generate-documentation-using-github-copilot-tools/6-generate-inline-code-documentation-using-github-copilot
- https://learn.microsoft.com/en-us/training/modules/generate-documentation-using-github-copilot-tools/5-generate-project-documentation-using-github-copilot
- https://code.visualstudio.com/docs/chat/copilot-chat-context
- https://docs.github.com/en/copilot/tutorials/customization-library/prompt-files/document-api
- https://learn.microsoft.com/en-us/training/modules/generate-documentation-using-github-copilot-tools/4-analyze-explain-code-using-github-copilot
- https://github.blog/changelog/2026-05-18-ask-questions-in-context-with-copilot-on-web/
- https://docs.github.com/en/get-started/learning-to-code/finding-and-understanding-example-code
- https://docs.github.com/en/get-started/learning-to-code/setting-up-copilot-for-learning-to-code
- https://docs.github.com/en/get-started/learning-to-code/learning-to-debug-with-github-copilot
- https://learn.microsoft.com/en-us/sql/tools/visual-studio-code-extensions/github-copilot/test-and-mocking-data-generator?view=sql-server-ver17
- https://github.com/github/docs/blob/871db5e8a4122d0c6d218f08a64e7e95b950c448/content/copilot/tutorials/modernize-legacy-code.md
- https://github.com/github/docs/blob/871db5e8a4122d0c6d218f08a64e7e95b950c448/content/copilot/tutorials/migrate-a-project.md
- https://github.com/github/docs/blob/871db5e8a4122d0c6d218f08a64e7e95b950c448/content/copilot/tutorials/modernize-java-applications.md
- https://learn.microsoft.com/en-us/java/upgrade/