# Text Quality Reviewer reference: Detection Rules
Part of the `text-quality-reviewer` skill. Read this only when the task reaches these sections.
## Detection Rules
### TQR-001: Template Variables in Non-Visual Text (Critical)
Detects unresolved template variable syntax in accessible names.
**Patterns detected:**
- Positional: `{0}`, `{1}`, `{2}`
- Named braces: `{{variable}}`, `{{user.name}}`
- Expression syntax: `${expression}`, `${item.title}`
- Printf-style: `%s`, `%d`, `%1$s`
- Object interpolation: `{property.name}`, `{item.altText}`
- Angular: `{{ expression }}`
- ERB/EJS: `<%= variable %>`
```html
Hi!
Welcome, Maria
```
### TQR-002: Code Syntax in Non-Visual Text (Critical)
Detects programming language syntax used as accessible names.
**Patterns detected:**
- Dot-separated identifiers: `property.altText`, `item.description.value`
- CamelCase or PascalCase identifiers: `heroImageAlt`, `ButtonLabel`
- Snake_case identifiers: `image_alt_text`, `btn_label`
- Array/bracket syntax: `items[0]`, `data['key']`
- Function calls: `getAltText()`, `t('key')`
- HTML entities used as content: `&`, `<`, `'`
```html
```
### TQR-003: Placeholder Text as Labels (Serious)
Detects common placeholder, test, or filler text used as accessible names.
**Strings flagged (case-insensitive):**
- Development: `TODO`, `FIXME`, `TBD`, `PLACEHOLDER`, `TEMP`, `TEST`, `TESTING`
- Filler: `lorem ipsum`, `asdf`, `xxx`, `yyy`, `foo`, `bar`, `baz`, `sample`, `example text`
- Generic: `untitled`, `no title`, `none`, `N/A`, `null`, `undefined`, `empty`
- Default: `image`, `photo`, `picture`, `icon`, `logo`, `banner` (without further description)
- Repeated characters: `aaa`, `123`, `...`
```html
```
### TQR-004: Attribute Name as Its Own Value (Critical)
Detects when the attribute name or its role is used as the value.
**Patterns detected:**
- `alt="alt text"`, `alt="alt"`, `alt="alternative text"`
- `aria-label="aria label"`, `aria-label="ARIA Label"`, `aria-label="label"`
- `aria-label="button"`, `aria-label="link"`, `aria-label="input"`
- `title="title"`, `aria-describedby` target text that says "description"
- Button text that is just the element role: "Button", "Link", "Checkbox"
```html
Settings
Account settings
```
### TQR-005: Empty or Whitespace-Only Accessible Names (Critical)
Detects accessible names that are present but contain no meaningful content. This is different from a missing `alt` attribute (caught by alt-text-headings). These have the attribute but it contains only whitespace, invisible characters, or zero-width spaces.
```html
```
### TQR-006: Duplicate Accessible Names on Different Controls (Serious)
Detects multiple interactive controls on the same page that share identical accessible names but perform different actions.
```html
```
### TQR-007: Filename or File Path as Alt Text (Serious)
Detects file names, paths, or hashes used as image alt text.
**Patterns detected:**
- File extensions: `*.jpg`, `*.png`, `*.gif`, `*.svg`, `*.webp`, `*.avif`, `*.bmp`
- Path separators: text containing `/` or `\` followed by a filename
- CMS hash names: `DSC_0492.jpg`, `IMG_2847.jpg`, `photo-1234567890.webp`
- UUID/hash patterns: `a1b2c3d4-e5f6.png`
```html
```
### TQR-008: Single-Character or Extremely Short Labels (Moderate)
Detects accessible names that are a single character or extremely short (under 3 characters for non-icon elements).
**Exceptions (NOT flagged):**
- Icon buttons with standard single-character symbols when `aria-label` provides the full description
- Buttons with visible text like "X" when `aria-label` says "Close"
- Pagination: "1", "2", "3" when properly labeled with `aria-label`
```html
Player stats
Score: top of the 3rd inningPlayer stats: season batting average .312
```