Identity Fields In Frontmatter
Frontmatter must include identity fields (id, name, or slug) to uniquely identify the instruction file. Without an identity field, the file cannot be referenced, overridden, or tracked by other rules.
Antipatterns
- Frontmatter with only metadata fields: A frontmatter block containing
globs:anddescription:but noid:,name:, orslug:field. The check requires at least one identity key. - Identity field in body instead of frontmatter: Writing
id: my-rulein the markdown body rather than between---fences. The pattern matches anywhere in the file, but the rule intent is frontmatter placement. - Misspelled identity key: Using
ID:orSlug:— the check pattern is case-insensitive, so these pass. But usingidentifier:orlabel:instead ofid,name, orslugwill fail because only those three keywords are matched.
Pass / Fail
Pass
---
slug: my-rule
description: Enforces naming conventions
globs: ["src/**/*.py"]
---
Fail
---
description: Enforces naming conventions
globs: ["src/**/*.py"]
---
Limitations
Checks for identity-related frontmatter fields (id, name, slug). Does not validate whether the values are correct or unique.
