Learn Everything

Paths/Copilot Engineer/Customising the Assistant / Instruction Files

Guided Taskbeginnerubuntu:24.04Ask AI

Write the Instruction File

The instruction file is read before every suggestion, so it should hold the few things that are always true. Write yours.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • File ~/copilot/custom/instructions.md exists○
  • The document states the conventions to encode○
  • The document states the commands to encode○
  • The document states the rules the assistant must never break○

02Walkthrough

4 steps
  1. 01

    Create the custom directory

    The instruction material lives in one folder.

    mkdir -p ~/copilot/custom
  2. 02

    Write the conventions and the commands

    The conventions the repository already follows, and the three commands that build, test and lint it.

    echo '# Instruction file\n\n## Conventions\n\n- TypeScript strict mode, no any\n- named exports only\n- one component per file, one behaviour per test\n\n## Commands\n\n- build: pnpm build\n- test: pnpm test\n- lint: pnpm lint' > ~/copilot/custom/instructions.md
  3. 03

    Write the prohibitions and the length rule

    Say what is never allowed, and keep the file short. A long instruction file is read less carefully than a short one.

    echo '\n## Never\n\n- never add a dependency that is not already in the manifest\n- never edit generated code\n- never widen the scope of a task\n\n## Length\n\nKeep it short - under a page. A file that is too long gets skimmed, and a rule that gets skimmed is not a rule.' >> ~/copilot/custom/instructions.md
  4. 04

    Verify and submit

    cat the document, then submit for validation.

    cat ~/copilot/custom/instructions.md

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — ubuntu:24.04

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list