Skip to content

[bot] docs(ch04): document applyTo frontmatter for instruction files#124

Merged
DanWahlin merged 1 commit into
mainfrom
add-applyto-instruction-docs-a17f3fb512020f99
May 20, 2026
Merged

[bot] docs(ch04): document applyTo frontmatter for instruction files#124
DanWahlin merged 1 commit into
mainfrom
add-applyto-instruction-docs-a17f3fb512020f99

Conversation

@DanWahlin
Copy link
Copy Markdown
Collaborator

What changed

Added a new "Scoping Instructions with applyTo" subsection to the Custom Instruction Files section in Chapter 04 (Agents & Custom Instructions).

New content includes:

  • Explanation of the applyTo YAML frontmatter field and what it does
  • A worked example scoping a Python-standards instruction file to **/*.py
  • A table of common applyTo glob patterns (**/*.py, **/*.{ts,tsx}, tests/**, and the default "no frontmatter" case)
  • A tip recommending quoted glob patterns for cross-platform reliability

Why this update

Copilot CLI v1.0.48 (2026-05-14) fixed a bug where unquoted glob patterns in the applyTo frontmatter were silently ignored. The fix makes the feature reliably available for all users.

The course already documented .instructions.md files, but never explained the applyTo field — meaning learners had no way to know they could scope instructions to specific file types. This is a beginner-friendly feature: it prevents irrelevant instructions from cluttering conversations and encourages more focused instruction files.

Sections updated

  • 04-agents-custom-instructions/README.md — "Custom Instruction Files (.instructions.md)" section, new #### Scoping Instructions with applyTo subsection added

Source

Generated by Course Updater · ● 526.2K ·

Document the applyTo frontmatter option in .instructions.md files,
which scopes an instruction file to specific file types using a glob
pattern. Include a worked example, a table of common patterns, and a
tip about quoting globs for cross-platform reliability.

This feature was made reliably available in Copilot CLI v1.0.48
(2026-05-14), which fixed parsing of unquoted glob patterns in the
applyTo field.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DanWahlin DanWahlin marked this pull request as ready for review May 20, 2026 13:03
Copilot AI review requested due to automatic review settings May 20, 2026 13:03
@DanWahlin DanWahlin merged commit 8bf80cd into main May 20, 2026
3 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Chapter 04 courseware to teach beginners how to scope .instructions.md files using the applyTo YAML frontmatter field, helping keep instruction files relevant to the files a learner is working on.

Changes:

  • Added a new “Scoping Instructions with applyTo” subsection under Custom Instruction Files.
  • Included a worked example and a small table of common applyTo glob patterns.
  • Added a tip recommending quoting glob patterns for reliability.
Show a summary per file
File Description
04-agents-custom-instructions/README.md Adds documentation explaining applyTo frontmatter, with examples and common glob patterns.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

|---|---|
| `"**/*.py"` | Any Python file |
| `"**/*.{ts,tsx}"` | TypeScript and TSX files |
| `"tests/**"` | Any file inside a `tests/` folder |
| `"tests/**"` | Any file inside a `tests/` folder |
| (no frontmatter) | Every conversation — the default |

> 💡 **Tip**: Wrap the glob pattern in quotes (e.g., `"**/*.py"`) to ensure it is interpreted correctly across all operating systems and shells.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants