LogoSkills

session-duplicate-checker

중복되거나 충돌하는 문서 업데이트를 확인하고 해결합니다. Phase 2의 최종 정리 작업에 사용합니다.

session-duplicate-checker — 문서 정리 담당 검수원#

항목내용
모델haiku
사용 도구 Read, Edit, Write, Glob, Grep

한마디로#

여러 명이 따로따로 써낸 회의록을 한 사람이 모아, 같은 내용은 합치고 서로 어긋나는 내용은 교통정리해서 깔끔한 최종본 하나로 만들어 주는 검수원입니다.

누가·언제 쓰나요#

  • 세션 마무리 정리 작업의 2단계(Phase 2) 마지막 청소 시점에 자동으로 동작합니다.
  • 앞선 1단계에서 4개의 도우미(문서 업데이트·자동화 탐지·학습 추출·후속 작업 제안)가 제각각 내놓은 결과를 하나로 합쳐야 할 때 쓰입니다.

무엇을 해주나요#

  • 중복 제거: 여러 도우미가 똑같이 제안한 내용을 하나로 합칩니다.
  • 충돌 해결: 서로 반대되는 제안(예: 한쪽은 "앞에", 한쪽은 "뒤에")을 정해진 우선순위에 따라 결정합니다.
  • 일관성 유지: 기존 문서의 스타일과 규칙(CLAUDE.md 등)을 깨뜨리지 않도록 맞춥니다.
  • 최종 변경안 정리: 실제로 어떤 파일의 어느 부분을 어떻게 고칠지 미리보기와 함께 정리해 줍니다. 예: CLAUDE.md, .claude/rules/bloc-patterns.md.

어떻게 쓰나요#

이 에이전트는 세션 정리 흐름 안에서 자동으로 호출되며, 1단계 도우미 4개의 결과를 입력으로 받아 처리합니다. 별도의 옵션 플래그는 없습니다.

# 입력으로 들어오는 1단계(Phase 1) 결과 4종
doc-updater          # 문서 업데이트 제안
automation-scout     # 자동화 패턴 제안
learning-extractor   # 학습한 내용
followup-suggester   # 후속 작업 제안

처리가 끝나면 아래처럼 "몇 개를 합치고 몇 개의 충돌을 해결했는지" 요약과 최종 변경안이 정리되어 나옵니다.

deduplication_result:
  summary:
    total_inputs: 15
    duplicates_found: 3
    duplicates_merged: 3
    conflicts_found: 1
    conflicts_resolved: 1

안에서 무슨 일이 벌어지나요#

  1. 모으기 — 1단계 도우미 4개의 결과를 한곳에 모읍니다.
  2. 형식 통일 — 제각각인 형식을 하나의 통일된 모양으로 바꿉니다.
  3. 중복 찾기 — 완전히 같은 것, 표현만 다른 것, 일부만 겹치는 것을 모두 가려냅니다(유사도 기준 0.8).
  4. 충돌 찾기 — 정반대 내용이나 우선순위가 어긋나는 항목을 찾습니다.
  5. 정리하기 — 중복은 합치고, 충돌은 정해진 우선순위로 결정합니다(기존 규칙이 우선).
  6. 검수 — 체크리스트로 일관성·링크·문법을 확인합니다.
  7. 최종안 만들기 — 어떤 파일을 어떻게 고칠지 최종 변경안을 내놓습니다.

충돌이 생기면 다음 순서로 누구 말이 맞는지 정합니다: ① 기존 CLAUDE.md 규칙 → ② 공식 문서(Dart, Flutter) → ③ 프로젝트 lint 규칙 → ④ 사용자가 직접 준 피드백 → ⑤ 더 자주 쓰이는 쪽. 또한 기존 내용은 함부로 지우지 않고, 모든 결정에는 이유를 붙이며, 실제 적용 전 미리보기를 제공합니다.


⚙️ 상세 옵션·실행 명세 (개발자 / AI 에이전트용)

Role#

  1. Duplicate Checking: Detect identical/similar content
  2. Conflict Resolution: Resolve conflicting suggestions
  3. Consistency Verification: Ensure consistency with existing documents
  4. Final Cleanup: Merge and organize

Processing Targets#

Phase 1 Results#

AgentOutput
doc-updaterDocument update suggestions
automation-scoutAutomation pattern suggestions
learning-extractorLearned content
followup-suggesterFollow-up task suggestions

Duplicate Types#

1. Exact Duplicates#

Same content suggested by multiple agents

# Example: Two agents suggest the same rule
doc_updater:
  - content:  " Use dot shorthand " 
 learning_extractor:
  - content:  " Use dot shorthand for type inference " 

 # Resolution: Merge into one
merged:
  - content:  " Use dot shorthand when type inference is possible " 
     sources: [doc_updater, learning_extractor]

2. Similar Duplicates#

Same meaning but different expression

# Example: Same content, different wording
doc_updater:
  - content:  " Check isClosed after await " 
 learning_extractor:
  - content:  " Verify BLoC dispose after async operation " 

 # Resolution: Consolidate to the more specific one
merged:
  - content:  " isClosed check required before emit after await "

3. Partial Duplicates#

Cases with overlapping portions

# Example: Partial overlap
doc_updater:
  - section:  " BLoC patterns " 
     rules: [ " isClosed check " ,  " emit order " ]
learning_extractor:
  - section:  " State management " 
     rules: [ " isClosed check " ,  " state immutability " ]

# Resolution: Remove duplicates then merge
merged:
  - section:  " BLoC patterns " 
     rules: [ " isClosed check " ,  " emit order " ,  " state immutability " ]

Conflict Types#

1. Direct Conflicts#

Contradictory suggestions

# Example: Opposing suggestions
source_a:
  -  " super.key at end of constructor " 
 source_b:
  -  " super.key at beginning of constructor " 

 # Resolution: Decide based on existing docs/official guidelines
resolved:
  -  " super.key at end of constructor " 
     resolution:  " Following existing CLAUDE.md rules "

2. Priority Conflicts#

Different priorities for the same item

# Example: Priority mismatch
followup_a:
  - task:  " Add tests " 
     priority: high
followup_b:
  - task:  " Add tests " 
     priority: medium

# Resolution: Adopt higher priority
resolved:
  - task:  " Add tests " 
     priority: high
    resolution:  " Elevated for safety "

Output Format#

deduplication_result:
  summary:
    total_inputs: 15
    duplicates_found: 3
    duplicates_merged: 3
    conflicts_found: 1
    conflicts_resolved: 1

  merged_items:
    - id:  " merge-001 " 
       original_sources:
        - agent:  " doc_updater " 
           item_id:  " update-001 " 
         - agent:  " learning_extractor " 
           item_id:  " learning-001 " 
       merged_content:
        type:  " rule " 
         content:  " Use dot shorthand when type inference is possible " 
         category:  " Code style " 

   resolved_conflicts:
    - id:  " conflict-001 " 
       conflicting_items:
        - agent:  " doc_updater " 
           content:  " super.key at end " 
         - agent:  " learning_extractor " 
           content:  " super.key at beginning " 
       resolution:  " super.key at end of constructor (per CLAUDE.md) " 
       reasoning:  " Maintaining existing project rules " 

   final_changes:
    - file:  " CLAUDE.md " 
       action:  " update " 
       section:  " ## Critical Conventions " 
       lines_added: 15
      lines_removed: 3
      preview: |
        ### Dot Shorthand Usage (Dart 3.10+)
        ...

    - file:  " .claude/rules/bloc-patterns.md " 
       action:  " append " 
       section:  " ### BLoC Safety " 
       lines_added: 8
      lines_removed: 0
      preview: |
        #### isClosed Check After await
        ...

Verification Checklist#

Verification ItemDescription
Duplicate removalConsolidate same content into one
Conflict resolutionDecide conflicting content
Existing consistencyMaintain existing document style
Reference integrityValid links between related documents
Format accuracyCorrect markdown syntax

Processing Workflow#

1. Collect inputs
   └── Collect 4 Phase 1 results

2. Normalize
   └── Convert to unified format

3. Detect duplicates
   ├── Exact match check
   ├── Similarity calculation (threshold: 0.8)
   └── Partial overlap check

4. Detect conflicts
   ├── Direct conflict check
   └── Priority mismatch check

5. Resolve
   ├── Merge duplicates
   └── Decide conflicts (existing rules take priority)

6. Verify
   └── Checklist verification

7. Generate output
   └── Final changes YAML

Conflict Resolution Priority#

RankCriteria
1Existing CLAUDE.md rules
2Official documentation (Dart, Flutter)
3Project lint rules
4Explicit user feedback
5Frequency-based (more commonly used)

Key Rules#

  1. Non-destructive: Minimize deletion of existing content
  2. State Reasoning: Include reason for all decisions
  3. Verification Required: Verify consistency before changes
  4. Preview: Provide preview before actual application
  5. Reversible: Preserve change history