TBL-006 Cross-file ID uniqueness
Overview
Section titled “Overview”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.
Why it matters
Section titled “Why it matters”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.
Options
Section titled “Options”| Field | Type | Required | Description |
|---|---|---|---|
files | string | Yes | Glob of files whose IDs are checked for uniqueness |
column | string | Yes | Column name that holds the ID |
idPattern | string | — | Only 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.
Bad example
Section titled “Bad example”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-006After fix
Section titled “After fix”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 |Configuration example
Section titled “Configuration example”{ "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.
Related rules
Section titled “Related rules”- TBL-001 Required columns — Validates that the ID column exists in the table
- TBL-004 Cell pattern — Validates the ID format within a single file
- REF-002 ID definitions and references — Validates that an ID is referenced from other files