Skip to content
conflict-detection logo

Conflict Detection

conflict-detection

Use before creating new stories or when user asks "check for conflicts", "find duplicates", "review story overlaps", or "detect story conflicts" - scans story-tree database to identify duplicate stories, scope overlaps, and competing approaches using lightweight text similarity (no external depen...

SKILL.md

Full skill instructions

Conflict Detection

Detect duplicate and overlapping stories in the story-tree database.

Database: .claude/​data/​story-tree.db

Critical: Use Python sqlite3 module, NOT sqlite3 CLI.

When to Run

  1. Before generating new stories - prevent creating duplicates
  2. On user request - audit existing stories for conflicts
  3. Periodically in CI - catch conflicts early

Conflict Types

TypeDescriptionConfidence
duplicateSame story, different wordsHigh (65%+ title sim)
scope_overlapOne subsumes or partially covers anotherMedium (60%+ keyword containment)
competingSame problem, incompatible approachesMedium (40%+ want sim, low benefit)

Quick Scan

Run the detection script:

python -c "
import subprocess, sys
result = subprocess.run([sys.executable, '.claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py'],
                       capture_output=True, text=True)
print(result.stdout)
if result.returncode > 0:
    print(f'Exit code {result.returncode} = {result.returncode} conflicts found')
"

Usage Options

# Default scan (50% confidence threshold)
python .claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py

# JSON output for programmatic use
python .claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py --format json

# Lower threshold for more matches
python .claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py --min-confidence 0.4

# Custom database path
python .claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py --db path/​to/​story-tree.db

Output Format

Text (default):

Found N potential conflict(s):

## Conflict 1: DUPLICATE (confidence: 94%)
**Story A**: `1.3.5` - Matter/​Client Database Management
**Story B**: `1.8.1` - Matter/​Client Database
**Reason**: Near-identical titles: title=85%

JSON:

[{
  "story_a_id": "1.3.5",
  "story_b_id": "1.8.1",
  "conflict_type": "duplicate",
  "confidence": 0.94,
  "reason": "Near-identical titles: title=85%",
  "want_similarity": 0.45,
  "benefit_similarity": 0.32,
  "title_similarity": 0.85
}]

Handling Conflicts

After detection, resolve conflicts by:

  1. Duplicates: Merge stories or reject one
  2. Scope overlap: Clarify boundaries or make one a child of the other
  3. Competing: Choose an approach and document decision

Update story status to rejected for discarded stories with a note explaining the decision.

Integration with Story Writing

Before generating stories for a node, check for conflicts:

python -c "
import subprocess, sys, json
result = subprocess.run([sys.executable, '.claude/​skills/​conflict-detection/​scripts/​detect_conflicts.py',
                        '--format', 'json'], capture_output=True, text=True)
conflicts = json.loads(result.stdout) if result.stdout.strip().startswith('[') else []
if conflicts:
    print(f'WARNING: {len(conflicts)} existing conflicts - resolve before adding stories')
    for c in conflicts[:3]:
        print(f'  - {c[\"conflict_type\"]}: {c[\"story_a_id\"]} vs {c[\"story_b_id\"]}')
else:
    print('No conflicts detected - safe to proceed')
"

Algorithm

  1. Load active stories (skip rejected/​archived)
  2. Extract components: title, want, benefit, acceptance criteria
  3. Normalize tokens using domain-specific synonym groups
  4. Compare all pairs using:
    • Jaccard + containment similarity on normalized tokens
    • Acceptance criteria comparison (high signal)
    • Keyword containment ratio
  5. Classify conflicts based on multi-signal scoring
  6. Return sorted by confidence

Constraints:

  • Python stdlib only (no numpy, sklearn, sentence-transformers)
  • Runs in CI without external API calls
  • O(n^2) comparison - fast for <500 stories

Performance Characteristics

Tested against ground truth test cases:

CategoryDetection RateNotes
Duplicates100% (3/​3)High accuracy on title/​criteria overlap
Scope Overlaps40% (2/​5)Limited by lexical similarity
False Positives0%No false positives on negative cases

Known Limitation: Stories using very different vocabulary to describe the same functionality may not be detected. This is inherent to lexical similarity without semantic embeddings.

Tuning: Lower --min-confidence to 0.40 for higher recall (more false positives).

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View