/bdd:consistency-checkfrom bdd
This skill should be used when the user asks to "check consistency", "find conflicts", "consistency check", "conflict detection", "incremental check", "full check", "check my specs", "validate BDD specs", "check for contradictions", or wants to detect and resolve conflicts between BDD spec files (.feature files, BDRs, and glossary).
Ships in bdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Detect and resolve contradictions across BDD spec artifacts — .feature files, BDR files, and glossary. Two modes:
spec/ directory for internal contradictions. No side has priority; all conflicts are presented for the user to resolve.Ask the user which mode to use if not specified. If the user says "check my changes" or similar, default to incremental.
Create a temporary findings file at spec/.consistency-check.md to record observations as they are discovered. This file is working memory — write to it incrementally during the check. Remove it after the check completes and all resolutions are applied.
# Consistency Check — [mode: incremental | full]
<!-- Started: YYYY-MM-DD -->
<!-- Scope: [files or "full spec/"] -->
## Points Observed
<!-- Each point is a factual statement extracted from a spec artifact. -->
<!-- All paths use full spec/ prefix (e.g., spec/domains/orders/features/cancellation.feature) -->
<!-- Format: [ID] source_file:line — statement -->
- [P1] spec/domains/orders/features/cancellation.feature:12 — Orders can only be cancelled before dispatch
- [P2] spec/domains/shipping/features/dispatch.feature:8 — Dispatch status is set when carrier confirms pickup
- [P3] spec/decisions/BDR-0001.md — No cancellation after dispatch (accepted)
## Conflicts Detected
<!-- Each conflict references the points that contradict each other. -->
### C1: [short title]
- **Points**: P1 vs P5
- **Nature**: [contradictory rules | overlapping scenarios | decision reversal | glossary inconsistency | stale reference | stale backlog | monolithic feature]
- **Detail**: [explain the contradiction]
- **Severity**: [breaking | misleading | cosmetic]
- **Source priority** (incremental only): [changed | existing]
## Resolutions
### C1: [short title]
- **Decision**: [what was decided]
- **Action**: [files modified and how]
Determine the scope of changes:
git diff --name-only (staged + unstaged) filtered to spec/ paths.feature, BDR (.md in spec/decisions/), spec/glossary.md, and spec/backlog.md filesIf no spec files have changed, inform the user and exit.
Read each changed file. For every business-relevant statement, record a point in the findings ledger:
Rule: statement, each Scenario: title + its Then outcomes, Feature narrativeLabel each point with a [P<n>] identifier, the source file and line, and a concise statement.
Read all other spec files (not in the change set), including spec/backlog.md and spec/glossary.md. BDR files may live in spec/decisions/ and/or spec/domains/<domain>/decisions/ — scan both paths. For each, extract points using the same method. As each new point is recorded, compare it against all previously recorded points. Look for:
spec/backlog.md that has since been implemented (a matching .feature file or BDR now exists), or an open decision that has been resolved by a BDR.feature file whose rules serve different business concerns — different actors or domains are signals, not triggers on their ownWhen a conflict is found, record it immediately in the findings ledger under Conflicts Detected. Do not wait until all files are scanned.
After scanning completes, extract all conflicts from the ledger. For each conflict:
Present all conflicts as a batch. Ask the user to confirm, adjust, or reject each resolution.
For confirmed resolutions:
Remove spec/.consistency-check.md. Summarize what was changed.
Read every .feature file, BDR, spec/glossary.md, and spec/backlog.md under spec/. BDR files live in spec/decisions/ (global) and/or spec/domains/<domain>/decisions/ (domain-scoped) — scan both paths. Process them in a consistent order:
spec/glossary.md first (establishes term definitions)spec/backlog.md (establishes deferred items).feature files grouped by domainspec/decisions/ and spec/domains/*/decisions/, grouped by domainFor each file, extract points and record them in the findings ledger. After recording each point, compare it against all previously recorded points. This incremental comparison is critical — it catches conflicts as they emerge rather than requiring a combinatorial comparison at the end.
For each pair of points being compared, check:
A single pass may miss conflicts that only become apparent after examining later files. After the initial pass:
Group conflicts by severity:
For each conflict, present:
Ask the user to resolve each conflict (or group related conflicts for batch resolution).
Same as incremental mode step 5. Follow BDR body editing rules — edit directly when supplementing, supersede when the decision itself conflicts. Track cascading changes.
After all resolutions are applied, do one final scan of all modified files against the full spec to confirm no new conflicts were introduced by the resolutions.
Remove spec/.consistency-check.md. Summarize all changes made.
When comparing two points, use this mental framework:
Only flag a conflict when two points make incompatible claims about the same subject in overlapping scope, and both are currently active (not superseded).
| Artifact | Extract as point |
|---|---|
Feature: title + narrative | The capability and who it serves |
Rule: statement | The business rule claim |
Scenario: title | The specific behaviour being illustrated |
Then steps | The expected outcomes / assertions |
Background: steps | Assumed preconditions for all scenarios in scope |
@wip scenarios | Flag as provisional — lower confidence in conflict detection |
| Tags | Categorization claims (e.g., @orders means this belongs to orders domain) |
All Rule: blocks as a group | Whether the rules serve disparate business concerns — different actors or unrelated capabilities are signals, not triggers on their own (monolithic feature signal) |
| Artifact | Extract as point |
|---|---|
status in frontmatter | Whether this decision is active |
Decision section | What was decided |
Rejected Alternatives | What was explicitly ruled out |
Feature / Rule references | Which specs this decision governs |
superseded-by / Supersedes | Decision lineage |
| Artifact | Extract as point |
|---|---|
| Each term + definition | The authoritative meaning of this domain concept |
| Artifact | Extract as point |
|---|---|
| Deferred feature entry | A capability explicitly not yet implemented |
| Open decision entry | A decision explicitly not yet resolved |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fahchen/skills --plugin bdd2 skills in this plugin
Other plugins' skills for the same job