Module 14

Mastery: Putting It All Together

Developer Tools Git, GitHub & GitHub Copilot

Module 14 — Mastery: Putting It All Together

Goal: Combine everything — Git fundamentals, GitHub collaboration, and Copilot’s instructions/skills/context/memory — into one professional, repeatable workflow, plus a best-practices checklist you can keep.

If the earlier modules were the instruments, this is playing the song.


14.1 The mental model, fully assembled

        ┌─────────────────────── YOUR REPO ───────────────────────┐
        │                                                          │
        │  .git/        ← the time machine (objects, refs, HEAD)   │  Part A
        │  source code  ← your actual work                         │
        │                                                          │
        │  .github/                                                │
        │   ├─ workflows/      ← CI/CD automation        (Mod 7)   │  Part B
        │   ├─ copilot-instructions.md  ← always-on rules (Mod 11) │
        │   ├─ instructions/*.instructions.md ← scoped rules       │  Part C
        │   ├─ prompts/*.prompt.md      ← reusable commands        │
        │   └─ skills/<name>/SKILL.md   ← on-demand expertise(Mod12)│
        │  AGENTS.md     ← cross-tool agent guidance               │
        │                                                          │
        └──────────────────────────────────────────────────────────┘
                    │                              │
            Git push/pull (Mod 6)          Copilot reads context,
                    ▼                       loads matching skills,
                 GitHub                     recalls memory (Mod 13)
          (PRs, reviews, Actions,                  │
           issues, Copilot agent)                  ▼
                                            AI-assisted changes
                                            you review & commit

Everything you learned occupies a place in this one diagram. Git tracks the work; GitHub coordinates the humans; the .github/ files and memory steer the AI.


14.2 A complete feature workflow (Git + Copilot)

Here’s how a polished change moves from idea to merged, using every layer:

# 1. Start clean and current
git switch main
git pull

# 2. Branch for the work (Module 5)
git switch -c feature/user-export
3. Open agent mode and describe the goal. Copilot now automatically:
   - reads .github/copilot-instructions.md  (your standing rules)   [Mod 11]
   - applies any *.instructions.md matching the files it edits       [Mod 11]
   - matches your request to a skill's description and loads it      [Mod 12]
   - recalls validated repo memories about how things are done       [Mod 13]
   - works within the context window, compacting if it runs long     [Mod 13]
# 4. REVIEW everything Copilot did — never blind-trust
git diff                    # read every change (Module 3)
npm test                    # run the tests

# 5. Stage deliberately, commit with a clear message (Modules 3, 7)
git add -p                  # review hunk-by-hunk while staging
git commit -m "Add CSV user export with tests"

# 6. Push and open a PR (Modules 6, 7)
git push -u origin feature/user-export
# open the PR on GitHub; CI (Actions) runs; Copilot can auto-review it

# 7. Address review feedback, push follow-ups, then squash-merge
# 8. Delete the branch; memory retains what Copilot learned for next time

Notice the discipline: Copilot writes boldly, you review carefully, Git makes both safe. The diff, the tests, the branch, and the reflog mean an AI can move fast without risk.


14.3 Setting up a repo for AI-assisted work (one-time)

When you start (or adopt) a project, invest 30 minutes here and every future session gets better:

  1. Write .github/copilot-instructions.md — stack, conventions, do’s and don’ts (Module 11). Keep it tight.
  2. Add scoped *.instructions.md for areas with special rules (tests, API, styles) using applyTo (Module 11).
  3. Capture repeated tasks as *.prompt.md prompt files (Module 11).
  4. Author skills for your non-obvious procedures — deployments, migrations, security reviews — with sharp, trigger-rich descriptions (Module 12). Pull ready-made ones from awesome-copilot.
  5. Add a CI workflow so tests gate every PR (Module 7).
  6. Commit it all and review changes to these files in PRs like any code.

Then let memory accumulate the rest automatically (Module 13), and correct it when it’s wrong.


14.4 Best-practices checklist

Git hygiene

  • Commit small and often, with clear present-tense messages.
  • One logical change per commit; use git add -p to keep commits focused.
  • Branch per feature; keep main always releasable.
  • Never rebase or amend commits you’ve already pushed (Modules 5, 8).
  • Pull before you start; push when you pause.
  • Trust the reflog — experiment freely (Module 8).

Collaboration

  • Small PRs get reviewed faster and break less.
  • Write PR descriptions that explain why, not just what.
  • Let CI gate merges; don’t merge red checks.
  • Review others’ code kindly and specifically (Module 7).

Copilot mastery

  • Control the context. Reference exact files; start fresh sessions for new tasks (Module 13).
  • Put standing rules in instructions, procedures in skills, and let memory handle the rest. Don’t rely on memory for must-follow policy (Modules 11–13).
  • Write descriptions like an engineer. A skill is only as discoverable as its description (Module 12).
  • Always review AI output. Read the diff, run the tests. Agent mode edits many files — Git is your safety net.
  • Iterate on your instructions. When Copilot gets something wrong, the fix is usually a new line in copilot-instructions.md or a sharper skill description.
  • Keep it lean. Every instruction and skill description spends context budget on every request.

14.5 Where to go next

  • Practice deliberately. Build a small project end-to-end using this exact workflow.
  • Read the source-of-truth docs, since Copilot changes fast: docs.github.com/copilot and the VS Code agent customization docs.
  • Explore awesome-copilot for community instructions, prompts, and skills — and contribute your own.
  • Deepen your Git internals with the free Pro Git book — especially the “Git Internals” chapter, which expands on Module 04.

Key takeaways

  • A mastered repo unites three layers: Git (history/safety), GitHub (collaboration/automation), and Copilot guidance (.github/ instructions, prompts, skills + auto memory).
  • The professional loop: branch → let Copilot work with full context → review the diff and tests → commit cleanly → PR → review/CI → squash-merge → delete branch.
  • Set up instructions, scoped rules, prompt files, skills, and CI once; let memory accumulate the rest.
  • The golden principle: Copilot writes boldly, you review carefully, Git makes it all safe.

You’ve gone from “what is version control?” to understanding Git’s object database, GitHub collaboration, and the precise mechanics of how Copilot loads skills and manages context and memory. One thing remains: doing all of it safely — covered next.

Next: Module 15 — Safety & Security. Return to the index anytime, and keep the glossary handy.