microsoft/duplicate-detective
Identifies potential duplicate Accounts, Contacts, or Leads in Dataverse using intelligent fuzzy matching that catches nicknames, abbreviations, phone format variations, and address similarities. Use when user says "find duplicates", "check for duplicate accounts", "are there any duplicate contacts", "duplicate detection", "clean up duplicates", "merge duplicates", or "data quality check".
npx skills add https://github.com/microsoft/dataverse-business-skills --skill duplicate-detective
Sales and marketing teams often accumulate duplicate records due to data entry variations, imports from multiple sources, and inconsistent naming conventions. Standard Dataverse duplicate detection rules are limited (max 5 rules per table) and miss subtle duplicates. This skill provides intelligent duplicate detection to maintain data quality and prevent wasted effort on duplicate outreach.
Ask the user or infer from context:
Based on scope, retrieve records to analyze:
For Accounts:
SELECT accountid, name, telephone1, telephone2, emailaddress1,
address1_line1, address1_city, address1_stateorprovince, address1_postalcode,
websiteurl, numberofemployees, industrycode
FROM account
WHERE statecode = 0
For Contacts:
SELECT contactid, firstname, lastname, fullname, emailaddress1, emailaddress2,
telephone1, mobilephone, jobtitle, accountid,
address1_line1, address1_city, address1_stateorprovince, address1_postalcode
FROM contact
WHERE statecode = 0
For Leads:
SELECT leadid, firstname, lastname, fullname, companyname, emailaddress1,
telephone1, mobilephone, jobtitle, address1_line1, address1_city,
address1_stateorprovince, address1_postalcode, websiteurl
FROM lead
WHERE statecode = 0
3.1 Company/Account Name Matching
Detect duplicates even with variations:
Matching Logic:
3.2 Person Name Matching
Detect duplicate contacts/leads:
Common Nickname Mappings:
| Formal Name | Nicknames |
|-------------|-----------|
| Robert | Bob, Rob, Bobby, Robbie |
| William | Will, Bill, Billy, Willy |
| Richard | Rick, Rich, Dick |
| Michael | Mike, Mikey |
| James | Jim, Jimmy, Jamie |
| Elizabeth | Liz, Beth, Betty, Lizzy |
| Jennifer | Jen, Jenny |
| Katherine | Kate, Katie, Kathy, Cathy |
3.3 Phone Number Matching
Normalize and compare phone numbers:
Phone Normalization Steps:
3.4 Email Address Matching
Detect email-based duplicates:
3.5 Address Matching
Detect address duplicates with variations:
Address Normalization:
Composite Scoring Model:
Calculate overall duplicate probability using weighted scores:
| Field Type | Weight (Accounts) | Weight (Contacts) | Weight (Leads) |
|------------|------------------|-------------------|----------------|
| Name | 35% | 30% | 30% |
| Email | 25% | 30% | 30% |
| Phone | 20% | 20% | 20% |
| Address | 15% | 15% | 15% |
| Website | 5% | - | 5% |
| Company (for contacts) | - | 5% | - |
Score Thresholds:
Organize Results:
Duplicate Set 1 (High Confidence - 95% match):
├── Record A: Contoso Inc. (accountid: xxx)
│ ├── Phone: (555) 123-4567
│ ├── Email: [email protected]
│ └── Address: 123 Main Street, Seattle, WA
└── Record B: Contoso Corporation (accountid: yyy)
├── Phone: 555.123.4567
├── Email: [email protected]
└── Address: 123 Main St, Seattle, WA 98101
Matching Signals:
- Company name: 92% similar (legal suffix variation)
- Phone: 100% match (format difference only)
- Address: 95% match (abbreviation variation)
For Each Duplicate Set, Recommend:
Output Format:
DUPLICATE DETECTION SUMMARY
===========================
Scan Parameters:
- Table: Account
- Records Scanned: 5,432
- Date Range: All active records
Results:
- High Confidence Duplicates: 23 sets (46 records)
- Medium Confidence Duplicates: 45 sets (98 records)
- Low Confidence Duplicates: 12 sets (26 records)
TOP PRIORITY DUPLICATES (High Confidence):
1. [Account] Contoso Inc. ↔ Contoso Corporation
Match Score: 95%
Recommendation: Merge into "Contoso Inc." (more activity)
Impact: 3 opportunities, 12 contacts would be consolidated
2. [Contact] Bob Smith ↔ Robert Smith (both at Contoso)
Match Score: 92%
Recommendation: Merge into "Robert Smith" (more complete record)
Impact: 8 activities would be consolidated
3. [Lead] ABC Manufacturing ↔ A.B.C. Mfg Company
Match Score: 91%
Recommendation: Review - may be parent/subsidiary
Impact: Different addresses - verify relationship first
If user wants to proceed with merge:
| Table | Purpose |
|-------|---------|
| account | Primary entity for company duplicates |
| contact | Primary entity for person duplicates |
| lead | Primary entity for lead duplicates |
| opportunity | Check for linked opportunities |
| activitypointer | Count activities on each record |
| annotation | Document merge decisions |
account:
name (NVARCHAR 160) - Company name for matchingaccountnumber (NVARCHAR 20) - Account number for exact matchingtelephone1, telephone2 (PHONE) - Phone matchingemailaddress1 (EMAIL) - Email matchingaddress1_line1, address1_city, address1_stateorprovince, address1_postalcode - Address matchingwebsiteurl (URL) - Website matchingparentaccountid (LOOKUP → account) - Parent company relationshipstatecode (STATE) - Active(0), Inactive(1) - Filter active onlycontact:
firstname, lastname (NVARCHAR) - Name componentsfullname (NVARCHAR) - Calculated full nameemailaddress1, emailaddress2 (EMAIL) - Email matchingtelephone1, mobilephone (PHONE) - Phone matchingaccountid (LOOKUP → account) - Parent accountjobtitle (NVARCHAR) - Additional matching signaldepartment (NVARCHAR) - Department for disambiguationstatecode (STATE) - Active(0), Inactive(1)lead:
companyname (NVARCHAR 100) - Company matchingfirstname, lastname, fullname (NVARCHAR) - Name matchingemailaddress1 (EMAIL) - Email matchingtelephone1, mobilephone (PHONE) - Phone matchingaddress1_line1, address1_city, address1_stateorprovince - Address matchingwebsiteurl (URL) - Website matchingstatecode (STATE) - Open(0), Qualified(1), Disqualified(2)statuscode (STATUS) - New(1), Contacted(2) [Open]; Qualified(3) [Qualified]; Lost(4), Cannot Contact(5), No Longer Interested(6), Canceled(7) [Disqualified]User says: "Check for duplicate accounts in my CRM"
Actions:
Result:
DUPLICATE DETECTION SUMMARY
- Records Scanned: 5,432 accounts
- High Confidence Duplicates: 23 sets
- Recommendation: Start with "Contoso Inc." ↔ "Contoso Corporation" (95% match)
User says: "Find duplicates of Fabrikam Inc."
Actions:
Result:
Potential duplicates of "Fabrikam Inc.":
1. Fabrikam Incorporated (87% match) - Same phone, similar address
2. The Fabrikam Group (72% match) - Same website domain
User says: "Are there duplicate contacts named Bob at Contoso?"
Actions:
Result:
Found potential duplicate:
- "Bob Smith" (created 2024-01-15) - 3 activities
- "Robert Smith" (created 2023-06-01) - 12 activities
Recommendation: Merge into "Robert Smith" (more complete record)
Cause: Matching threshold too relaxed or common names in dataset
Solution:
Cause: Significant spelling variations or missing data in fields
Solution:
Cause: Common names or parent/subsidiary relationships
Solution:
Take microsoft/duplicate-detective from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.