Scope Fields In Frontmatter
Scoped instruction files must declare their scope boundary in frontmatter using scope:, globs:, or applies_to: fields. Without a declared scope, the file's targeting is ambiguous and the agent cannot determine which files the instructions apply to.
Antipatterns
- Describing scope in prose ("This rule applies to Python files") without a frontmatter field. The check looks for
scope:,globs:, orapplies_to:key-value declarations, not prose descriptions. - Using a non-standard field name like
targets:orfiles:. The pattern matchesscope,globs, andapplies_tospecifically. - Omitting scope fields entirely because the file is "obviously" scoped by its directory path. The rule requires explicit declaration regardless of directory placement.
Pass / Fail
Pass
---
globs: "src/**/*.py"
---
# Python Style
Use `ruff` for formatting.
Fail
---
title: Python Style
---
# Python Style
Use `ruff` for formatting Python files.
Limitations
Checks for scope-related frontmatter fields (scope, globs, applies_to). Does not validate whether the declared scope is correct.
