.claude/skills/similarity-capacitor/SKILL.md
Use when working with capacitor similarity calculations - comparing ceramic/electrolytic/film capacitor MPNs, understanding value/voltage/dielectric matching, or capacitor-specific similarity logic.
npx skillsauth add Cantara/lib-electronic-components similarity-capacitorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guidance for working with CapacitorSimilarityCalculator in the lib-electronic-components library.
For metadata-driven similarity architecture, see /similarity-metadata:
The CapacitorSimilarityCalculator compares capacitors based on:
ComponentType.CAPACITOR
ComponentType.CAPACITOR_CERAMIC_MURATA
ComponentType.CAPACITOR_CERAMIC_TDK
ComponentType.CAPACITOR_CERAMIC_SAMSUNG
ComponentType.CAPACITOR_CERAMIC_YAGEO
ComponentType.CAPACITOR_ELECTROLYTIC_NICHICON
// Any type starting with "CAPACITOR_"
Returns false for null type.
| Condition | Score | |-----------|-------| | Same value, same package, same voltage | ~0.8+ | | Same value, different package | ~0.5-0.7 | | Same package, different value | ~0.3 | | Different everything | ~0.0-0.3 |
| MPN Pattern | Value |
|-------------|-------|
| 104 in MPN | 100nF (10×10⁴ pF) |
| 103 in MPN | 10nF (10×10³ pF) |
| 100N | 100nF |
| 10U | 10µF |
GRM 188 R 71 H 104 K A01 D
│ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ └── Packaging
│ │ │ │ │ │ │ └────── Termination
│ │ │ │ │ │ └──────── Tolerance (K=10%)
│ │ │ │ │ └──────────── Value (104=100nF)
│ │ │ │ └────────────── Voltage (H=50V)
│ │ │ └───────────────── Dielectric (71=X7R)
│ │ └──────────────────── Thickness
│ └──────────────────────── Size (188=0603)
└──────────────────────────── Series
CL 10 B 104 K B8 NNNC
│ │ │ │ │ │ │
│ │ │ │ │ │ └── Packaging
│ │ │ │ │ └───── Voltage (B8=25V)
│ │ │ │ └─────── Tolerance (K=10%)
│ │ │ └─────────── Value (104=100nF)
│ │ └────────────── Dielectric (B=X7R)
│ └───────────────── Size (10=0603)
└──────────────────── Series
CC 0603 KRX 7R 9 BB 104
│ │ │ │ │ │ │
│ │ │ │ │ │ └── Value (104=100nF)
│ │ │ │ │ └───── Voltage (BB=50V)
│ │ │ │ └─────── TCC code
│ │ │ └────────── Dielectric (7R=X7R)
│ │ └────────────── Tolerance (K=10%)
│ └─────────────────── Size (0603)
└────────────────────── Series
// Murata vs Samsung same value/size
calculator.calculateSimilarity("GRM188R71H104KA01D", "CL10B104KB8NNNC", registry);
// Returns >= 0.5 (both 100nF, 0603)
| Type | Characteristics | Temp Range | |------|-----------------|------------| | C0G/NP0 | Stable, low loss | -55 to +125°C | | X5R | Higher capacity | -55 to +85°C | | X7R | General purpose | -55 to +125°C | | Y5V | High capacity, variable | -30 to +85°C |
// Same Murata capacitor
calculator.calculateSimilarity("GRM188R71H104KA01D", "GRM188R71H104KA01D", registry);
// Returns ~0.8
// Same value, different package
calculator.calculateSimilarity("GRM188R71H104KA01D", "GRM21BR71H104KA01D", registry);
// Returns ~0.5-0.7
// Different values
calculator.calculateSimilarity("GRM188R71H104KA01D", "GRM188R71H103KA01D", registry);
// Returns ~0.3 (100nF vs 10nF)
// Cross-manufacturer
calculator.calculateSimilarity("GRM188R71H104KA01D", "CL10B104KB8NNNC", registry);
// Returns >= 0.5
104 = 10×10⁴ pF = 100nF473 = 47×10³ pF = 47nF| Imperial | Metric | Murata Code | |----------|--------|-------------| | 0402 | 1005 | 155 | | 0603 | 1608 | 188 | | 0805 | 2012 | 21 | | 1206 | 3216 | 31 |
Critical Bug: The micro sign µ (U+00B5) becomes Greek capital MU Μ (U+039C) when uppercased:
"0.1µF".toUpperCase() // Returns "0.1ΜF" NOT "0.1µF"!
Impact: If parseCapacitanceValue() uses toUpperCase() before checking for "µF", the check fails silently, returning null. This causes capacitance comparison to be skipped, reducing similarity from ~1.0 to ~0.33 (package match only).
Solution: Replace µ→u and Μ→u before normalizing:
String normalized = value.replace("µ", "u").replace("Μ", "u");
normalized = normalizeValue(normalized); // Now safe to toUpperCase
if (normalized.contains("UF")) { // Matches both µF and plain UF
Lesson: Always handle Greek-origin SI prefixes (µ, Ω) carefully in string normalization logic.
<!-- Add new learnings above this line -->data-ai
Cost-effective task delegation strategy using Haiku model for straightforward work. Use when planning how to approach simple, pattern-following tasks to minimize costs.
tools
Use when working with component similarity calculations - comparing MPNs, finding equivalent parts, implementing new similarity calculators, or understanding how component matching works.
testing
Use when working with transistor similarity calculations - comparing BJT MPNs, understanding NPN/PNP polarity matching, equivalent groups like 2N2222/PN2222, or transistor-specific similarity logic.
testing
Use when working with sensor similarity calculations - comparing temperature/accelerometer/humidity sensor MPNs, understanding sensor families, equivalent parts, or sensor-specific similarity logic.