Modern engineering work rarely lives in a single file. Real systems evolve across years of incrementally layered decisions—some good, some accidental. A single feature request (“Add tagging to notes,” “Refactor the validation layer,” “Support a new consumer on our API”) often touches controllers, domain models, repositories, migrations, tests, documentation, and deployment strategy.
Copilot’s agentic capabilities don’t replace your judgment in these situations—they amplify it. When used well, Copilot becomes a partner in system design, refactoring, modernization, and multi-file coordination.
This guide focuses on architecture-aware, multi-step workflows used every day by staff engineers, but written to be accessible for earlier-career engineers who want to understand how senior engineers think—and how Copilot can accelerate their own growth.
It draws on four GitHub Skills exercises (linked below), and builds toward a complete, real-world scenario: extending a small modular Notes Service with a tagging subsystem, refactoring a validation layer, designing a safe migration, and modernizing tests.
You’ll get the most out of this guide if you have:
If you’re earlier in your career, don’t worry. Each section explains why these patterns matter and how to practice them safely.
Senior engineers rarely begin by writing code. They begin by identifying boundaries: domain logic, data access, interfaces, and how modules should interact.
Copilot agent mode can help by revealing structural issues and proposing architectures.
Prompt:
Analyze this service and propose a modular decomposition with domain, infrastructure, and interface layers.
Identify anti-patterns, coupling issues, and potential failure points.
You’ll typically get back:
This transforms Copilot from an autocomplete tool into a design reviewer.
You can push further by asking it to compare architectures:
Compare hexagonal architecture vs. layered architecture for this codebase.
Recommend one based on the constraints here. Include tradeoffs.
Want to try it yourself? Use these proposals as starting points.
Once boundaries are defined, Copilot can coordinate changes across modules.
Prompt:
Implement the domain, controller, and repository layers as distinct modules.
Use dependency inversion to reduce coupling.
Document assumptions and contracts for each module.
Copilot will typically generate:
For earlier-career engineers, this provides exposure to real engineering patterns. For senior engineers, it provides leverage and reduces boilerplate overhead.
Adding a tagging subsystem is a deceptively simple request with meaningful architectural implications.
Even this single feature forces decisions across the system:
Before touching code, ask Copilot to map the impact.
Prompt:
Propose the architectural changes required to add a tagging subsystem.
Identify migration needs, cross-cutting concerns, caching or indexing implications, and potential regressions.
Copilot may identify:
This is the staff-level lens that Copilot can help junior developers adopt.
Then implement it:
Implement the tagging domain model, schema changes, repository updates, and controller logic.
Update tests and documentation. Show each change as a diff.
Example output (simplified)
Migration example:
ALTER TABLE notes ADD COLUMN tags TEXT DEFAULT '[]';
Domain model example:
export interface Tag {
id: string;
label: string;
}
export interface Note {
id: string;
title: string;
body: string;
tags: Tag[];
}
Controller update (partial):
await noteService.addTag(noteId, { label: req.body.label });
This is where agent mode shines: coordinating multiple files with consistent intent.
At senior levels, the hardest part isn’t writing SQL. It’s designing a change that is:
Ask Copilot to reason about this:
Prompt:
Generate an additive, backward-compatible schema migration to support the tagging subsystem.
Describe the rollback plan, compatibility window, and expected impact to existing clients.
This forces Copilot to consider:
If you’re earlier in your career, this offers lessons on how safe migrations are designed. And if you’re more experienced, this gives you a repeatable workflow for multi-step schema evolution.
Let’s perform a real cross-module refactor: extracting validation out of controllers into a domain service.
Prompt:
Create a step-by-step refactor plan to extract validation logic into a domain service.
Identify affected modules and required test updates.
Copilot may output something like:
validationServicePrompt:
Execute steps 1–3 only. Stop before controller rewrites.
Provide detailed diffs and call out risky areas.
This is a low-blast-radius refactor, modeled directly in the IDE.
Instead of asking Copilot “write tests,” ask it to assess the entire suite.
Prompt:
Analyze the current test suite and identify systemic gaps.
Recommend a modernization plan including contract, integration, and domain-layer tests.
Then implement contract tests:
describe("NotesRepository contract", () => {
test("create + fetch returns a fully hydrated note object", async () => {
const note = await notesRepo.create({ title: "Test", body: "…" });
const fetched = await notesRepo.get(note.id);
expect(fetched).toMatchObject({ title: "Test" });
expect(fetched.id).toBeDefined();
});
});
This elevates testing into an architectural concern.
Bringing it all together, here’s a real sequence you might run with Copilot:
This workflow is architecturally realistic—and a model for how Copilot becomes a system-level collaborator.
It’s important to clarify that agent mode is not ideal for:
Copilot should support your decision-making, not replace it.
Here’s where GitHub Skills comes in—not as “beginner content,” but as a set of guided, self-contained labs that reinforce the patterns above.
Even senior engineers will benefit: These exercises are structured so you can reliably recreate complex workflows and test Copilot’s behavior in controlled environments.
Senior Service Delivery Engineer, GitHub
Everything you need to master GitHub, all in one place.
Build what’s next on GitHub, the place for anyone from anywhere to build anything.
Meet the companies and engineering teams that build with GitHub.
Catch up on the GitHub podcast, a show dedicated to the topics, trends, stories and culture in and around the open source developer community on GitHub.