MCAF: .NET QuickDup
Trigger On
- the repo wants
QuickDup
- the team needs repeatable duplicate-code scans for C#
- the user asks about DRY cleanup, copy-paste detection, clone detection, or duplicate logic removal in a .NET repo
Value
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
- reduce ambiguity through explicit planning, verification, and final validation skills
- leave reusable project context so future tasks are faster and safer
Do Not Use For
- formatting-only work
- repos that intentionally use a different clone detector and do not want overlap
- generated-code churn where duplication findings would mostly be noise
Inputs
- the nearest
AGENTS.md
- target solution, project, or source subtree
- current duplication hotspots and generated-code boundaries
Quick Start
- Read the nearest
AGENTS.md and confirm scope and constraints.
- Run this skill's
Workflow through the Ralph Loop until outcomes are acceptable.
- Return the
Required Result Format with concrete artifacts and verification evidence.
Workflow
- Choose the scan target deliberately:
- whole solution for broad discovery
- bounded folders for targeted cleanup
- Scan C# with
.cs only unless the repo explicitly wants Razor, generated XML, or other extensions too.
- Exclude generated and transient paths before trusting the results:
bin/
obj/
Migrations/ when scaffold churn dominates
*.g.cs
*.generated.cs
*.Designer.cs
- Review the top patterns before refactoring anything.
- Classify duplication before changing code:
- real structural duplication worth extraction
- domain-shape duplication that documents intent
- generated or acceptable duplication that should be ignored
- Prefer small extractions, named helpers, shared value objects, or focused abstractions over flag-heavy merge methods.
- Re-run
QuickDup after the refactor and then run the repo's normal quality pass.
Bootstrap When Missing
If QuickDup is not available yet:
- Detect current state:
command -v quickdup
go version
rg --files -g '.quickdup/ignore.json' -g '.quickdup/results.json'
- Choose the install path deliberately:
- preferred when Go is available:
go install github.com/asynkron/Asynkron.QuickDup/cmd/quickdup@latest
- official macOS/Linux fallback:
curl -sSL https://raw.githubusercontent.com/asynkron/Asynkron.QuickDup/main/install.sh | bash
- official Windows fallback:
iwr -useb https://raw.githubusercontent.com/asynkron/Asynkron.QuickDup/main/install.ps1 | iex
- Verify the installed CLI resolves correctly:
- Record exact duplication commands in
AGENTS.md, for example:
quickdup -path . -ext .cs -exclude "bin/*,obj/*,*.g.cs,*.generated.cs,*.Designer.cs"
quickdup -path src -ext .cs -top 20
quickdup -path . -ext .cs -select 0..5
- If the repo wants stable suppressions, create
.quickdup/ignore.json and review each ignored pattern intentionally.
- Run one bounded scan and return
status: configured or status: improved.
- If the repo already standardizes on another clone detector and does not want
QuickDup, return status: not_applicable.
Deliver
- repeatable duplicate-code detection for C#
- explicit exclude and suppression strategy
- concrete refactoring candidates instead of vague maintainability advice
Validate
- the scan target and excludes match the repo's real source boundaries
- generated-code noise is filtered before acting on findings
- duplication cleanup preserves behavior and is backed by relevant tests
QuickDup output is used as input to review, not as an automatic rewrite authority
Ralph Loop
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
- Plan first (mandatory):
- analyze current state
- define target outcome, constraints, and risks
- write a detailed execution plan
- list final validation skills to run at the end, with order and reason
- Execute one planned step and produce a concrete delta.
- Review the result and capture findings with actionable next fixes.
- Apply fixes in small batches and rerun the relevant checks or review steps.
- Update the plan after each iteration.
- Repeat until outcomes are acceptable or only explicit exceptions remain.
- If a dependency is missing, bootstrap it or return
status: not_applicable with explicit reason and fallback path.
Required Result Format
status: complete | clean | improved | configured | not_applicable | blocked
plan: concise plan and current iteration step
actions_taken: concrete changes made
validation_skills: final skills run, or skipped with reasons
verification: commands, checks, or review evidence summary
remaining: top unresolved items or none
For setup-only requests with no execution, return status: configured and exact next commands.
Load References
- read
references/quickdup.md first
Example Requests
- "Find duplicate C# logic in this solution."
- "Add QuickDup to this .NET repo."
- "Review the top QuickDup patterns before we refactor."
- "Set up a repeatable duplicate-code scan for CI or local cleanup."
1---2name: mcaf-dotnet-quickdup3description: Use the open-source free `QuickDup` clone detector for .NET repositories. Use when a repo needs duplicate C# code discovery, structural clone detection, DRY refactoring candidates, or repeatable duplication scans in local workflows and CI.4---56# MCAF: .NET QuickDup78## Trigger On910- the repo wants `QuickDup`11- the team needs repeatable duplicate-code scans for C#12- the user asks about DRY cleanup, copy-paste detection, clone detection, or duplicate logic removal in a .NET repo1314## Value1516- produce a concrete project delta: code, docs, config, tests, CI, or review artifact17- reduce ambiguity through explicit planning, verification, and final validation skills18- leave reusable project context so future tasks are faster and safer1920## Do Not Use For2122- formatting-only work23- repos that intentionally use a different clone detector and do not want overlap24- generated-code churn where duplication findings would mostly be noise2526## Inputs2728- the nearest `AGENTS.md`29- target solution, project, or source subtree30- current duplication hotspots and generated-code boundaries3132## Quick Start33341. Read the nearest `AGENTS.md` and confirm scope and constraints.352. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable.363. Return the `Required Result Format` with concrete artifacts and verification evidence.3738## Workflow39401. Choose the scan target deliberately:41 - whole solution for broad discovery42 - bounded folders for targeted cleanup432. Scan C# with `.cs` only unless the repo explicitly wants Razor, generated XML, or other extensions too.443. Exclude generated and transient paths before trusting the results:45 - `bin/`46 - `obj/`47 - `Migrations/` when scaffold churn dominates48 - `*.g.cs`49 - `*.generated.cs`50 - `*.Designer.cs`514. Review the top patterns before refactoring anything.525. Classify duplication before changing code:53 - real structural duplication worth extraction54 - domain-shape duplication that documents intent55 - generated or acceptable duplication that should be ignored566. Prefer small extractions, named helpers, shared value objects, or focused abstractions over flag-heavy merge methods.577. Re-run `QuickDup` after the refactor and then run the repo's normal quality pass.5859## Bootstrap When Missing6061If `QuickDup` is not available yet:62631. Detect current state:64 - `command -v quickdup`65 - `go version`66 - `rg --files -g '.quickdup/ignore.json' -g '.quickdup/results.json'`672. Choose the install path deliberately:68 - preferred when Go is available: `go install github.com/asynkron/Asynkron.QuickDup/cmd/quickdup@latest`69 - official macOS/Linux fallback: `curl -sSL https://raw.githubusercontent.com/asynkron/Asynkron.QuickDup/main/install.sh | bash`70 - official Windows fallback: `iwr -useb https://raw.githubusercontent.com/asynkron/Asynkron.QuickDup/main/install.ps1 | iex`713. Verify the installed CLI resolves correctly:72 - `quickdup -h`734. Record exact duplication commands in `AGENTS.md`, for example:74 - `quickdup -path . -ext .cs -exclude "bin/*,obj/*,*.g.cs,*.generated.cs,*.Designer.cs"`75 - `quickdup -path src -ext .cs -top 20`76 - `quickdup -path . -ext .cs -select 0..5`775. If the repo wants stable suppressions, create `.quickdup/ignore.json` and review each ignored pattern intentionally.786. Run one bounded scan and return `status: configured` or `status: improved`.797. If the repo already standardizes on another clone detector and does not want `QuickDup`, return `status: not_applicable`.8081## Deliver8283- repeatable duplicate-code detection for C#84- explicit exclude and suppression strategy85- concrete refactoring candidates instead of vague maintainability advice8687## Validate8889- the scan target and excludes match the repo's real source boundaries90- generated-code noise is filtered before acting on findings91- duplication cleanup preserves behavior and is backed by relevant tests92- `QuickDup` output is used as input to review, not as an automatic rewrite authority9394## Ralph Loop9596Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.97981. Plan first (mandatory):99 - analyze current state100 - define target outcome, constraints, and risks101 - write a detailed execution plan102 - list final validation skills to run at the end, with order and reason1032. Execute one planned step and produce a concrete delta.1043. Review the result and capture findings with actionable next fixes.1054. Apply fixes in small batches and rerun the relevant checks or review steps.1065. Update the plan after each iteration.1076. Repeat until outcomes are acceptable or only explicit exceptions remain.1087. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path.109110### Required Result Format111112- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`113- `plan`: concise plan and current iteration step114- `actions_taken`: concrete changes made115- `validation_skills`: final skills run, or skipped with reasons116- `verification`: commands, checks, or review evidence summary117- `remaining`: top unresolved items or `none`118119For setup-only requests with no execution, return `status: configured` and exact next commands.120121## Load References122123- read `references/quickdup.md` first124125## Example Requests126127- "Find duplicate C# logic in this solution."128- "Add QuickDup to this .NET repo."129- "Review the top QuickDup patterns before we refactor."130- "Set up a repeatable duplicate-code scan for CI or local cleanup."