Skip to content

TBL-006 Cross-file ID uniqueness

Validates that values in a specific column (IDs) are unique across multiple files. Duplicates are reported as error. This is a project-scope rule and is evaluated across all documents loaded via include.

Identifiers like requirement IDs, ADR numbers, and test IDs are typically expected to be unique across the entire repository. When multiple files or multiple teams add entries in parallel, the same ID can be assigned twice without anyone noticing. Duplicate IDs break both searchability and traceability, so detecting them mechanically is valuable.

FieldTypeRequiredDescription
filesstringYesGlob of files whose IDs are checked for uniqueness
columnstringYesColumn name that holds the ID
idPatternstringOnly values matching this regex are treated as IDs (non-matching values are ignored)

files uses the same glob syntax as the files option of other rules, but TBL-006 requires it.

docs/auth/requirements.md:
| ID | Description |
| ------ | --------------- |
| REQ-01 | User registration |
docs/todo/requirements.md:
| ID | Description |
| ------ | ----------------- |
| REQ-01 | Create a task |

Both files use REQ-01, which triggers a violation.

docs/todo/requirements.md
line 3 error ID "REQ-01" is already defined in docs/auth/requirements.md:3 TBL-006

Include the zone name in the ID to keep them distinct.

docs/auth/requirements.md:
| ID | Description |
| ----------- | --------------- |
| REQ-AUTH-01 | User registration |
docs/todo/requirements.md:
| ID | Description |
| ----------- | ----------------- |
| REQ-TODO-01 | Create a task |
{
"rule": "tbl006",
"options": {
"files": "**/requirements.md",
"column": "ID",
"idPattern": "^REQ-"
}
}

When idPattern is given, only values matching the pattern are treated as IDs. This lets you scope the check to ID rows even if the table contains sample header rows or other non-ID rows.