[bot] docs(ch04): document applyTo frontmatter for instruction files#124
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
applyToglob 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
applyToYAML frontmatter field and what it does**/*.pyapplyToglob patterns (**/*.py,**/*.{ts,tsx},tests/**, and the default "no frontmatter" case)Why this update
Copilot CLI v1.0.48 (2026-05-14) fixed a bug where unquoted glob patterns in the
applyTofrontmatter were silently ignored. The fix makes the feature reliably available for all users.The course already documented
.instructions.mdfiles, but never explained theapplyTofield — 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 applyTosubsection addedSource
applyTo: **/*.ts) are now applied correctly"