Summary
Add code duplication detection as a structural quality gate in vibe-check, integrated into the vibe-check analyze command with a configurable duplication threshold.
RFC: https://github.com/orgs/unbound-force/discussions/483 — Group 8
Phase: P2 (Accessibility)
Context
Duplicated code is a significant maintainability risk, especially with agent-written code where agents may not be aware of existing implementations. Detection gives agents and reviewers visibility into redundancy.
Implementation
vibe-check Integration
- Add duplication detection to
vibe-check analyze
- Use AST-based structural similarity for Go (leveraging
go/ast)
- Configurable threshold: max percentage of duplicated code
- Report duplicated blocks with file locations and similarity scores
CI Gate
vibe-check analyze ./... --max-duplication=5
Exit code non-zero if duplication exceeds the threshold.
Output
- Duplication percentage per package
- List of duplicated code blocks with locations
- Included in the
metrics.ModuleGraph output (via warnings or a dedicated field)
Acceptance Criteria
Dependencies
Summary
Add code duplication detection as a structural quality gate in vibe-check, integrated into the
vibe-check analyzecommand with a configurable duplication threshold.RFC: https://github.com/orgs/unbound-force/discussions/483 — Group 8
Phase: P2 (Accessibility)
Context
Duplicated code is a significant maintainability risk, especially with agent-written code where agents may not be aware of existing implementations. Detection gives agents and reviewers visibility into redundancy.
Implementation
vibe-check Integration
vibe-check analyzego/ast)CI Gate
Exit code non-zero if duplication exceeds the threshold.
Output
metrics.ModuleGraphoutput (via warnings or a dedicated field)Acceptance Criteria
vibe-check analyze--max-duplicationflag with configurable threshold (default: 5%)Dependencies
vibe-check analyzecommand