.claude/skills/parametric-search/SKILL.md
# Parametric Search Skill This skill provides guidance for using the ParametricSearch utility to filter electronic components by their specifications. ## Overview `ParametricSearch` enables filtering collections of `ElectronicPart` objects using unit-aware parametric queries. It supports: - Comparison operators (>=, <=, >, <, =, !=) - Range queries (min..max) - Set membership (IN) - Automatic unit parsing (nF, uF, kΩ, etc.) ## Quick Reference ### Query Syntax | Syntax | Example | Matches |
npx skillsauth add Cantara/lib-electronic-components .claude/skills/parametric-searchInstall 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.
This skill provides guidance for using the ParametricSearch utility to filter electronic components by their specifications.
ParametricSearch enables filtering collections of ElectronicPart objects using unit-aware parametric queries. It supports:
| Syntax | Example | Matches |
|--------|---------|---------|
| >= value | >= 10nF | Capacitors 10nF and above |
| <= value | <= 50V | Voltage 50V and below |
| > value | > 1k | Resistance above 1kΩ |
| < value | < 1uF | Capacitance below 1µF |
| = value | = X7R | Exact string match |
| != value | != X5R | Not equal to string |
| min..max | 10nF..1uF | Range (inclusive) |
| IN(a,b,c) | IN(X7R, X5R) | Any of listed values |
| Prefix | Multiplier | Example | |--------|------------|---------| | p | 10⁻¹² | 100pF | | n | 10⁻⁹ | 100nF | | u/µ | 10⁻⁶ | 10uF, 10µF | | m | 10⁻³ | 100mV | | k/K | 10³ | 10k, 10K | | M | 10⁶ | 1M | | G | 10⁹ | 1GHz |
Map<String, String> requirements = Map.of(
"capacitance", ">= 10nF",
"voltage", ">= 25V",
"dielectric", "IN(X7R, X5R)"
);
List<ElectronicPart> results = ParametricSearch.filter(capacitors, requirements);
List<ElectronicPart> results = ParametricSearch.search(capacitors)
.min("capacitance", "10nF")
.max("voltage", "50V")
.in("dielectric", "X7R", "X5R", "C0G")
.find();
// Find resistors between 1kΩ and 100kΩ
List<ElectronicPart> results = ParametricSearch.search(resistors)
.range("resistance", "1k", "100k")
.find();
// Equivalent using where()
List<ElectronicPart> results = ParametricSearch.search(resistors)
.where("resistance", "1k..100k")
.find();
ElectronicPart capacitor = ...;
if (ParametricSearch.meets(capacitor, "capacitance", ">= 10nF")) {
// Part meets requirement
}
// Count matching parts
long count = ParametricSearch.search(parts)
.min("voltage", "25V")
.count();
// Check if any match
boolean hasHighVoltage = ParametricSearch.search(parts)
.min("voltage", "100V")
.anyMatch();
// Get first match
Optional<ElectronicPart> first = ParametricSearch.search(parts)
.equals("dielectric", "C0G")
.findFirst();
| Method | Description |
|--------|-------------|
| where(key, requirement) | Add any requirement string |
| min(key, value) | Add >= value requirement |
| max(key, value) | Add <= value requirement |
| range(key, min, max) | Add min..max requirement |
| equals(key, value) | Add = value requirement |
| notEquals(key, value) | Add != value requirement |
| in(key, values...) | Add IN(values) requirement |
| find() | Execute and return List |
| findFirst() | Execute and return Optional |
| count() | Execute and return count |
| anyMatch() | Execute and return boolean |
Any key in ElectronicPart.getSpecs():
capacitance, resistance, inductancevoltage, current, powertolerance, tempcodielectric, material| Key | Field |
|-----|-------|
| value | getValue() |
| package, pkg | getPkg() |
| manufacturer, mfr | getManufacturer() |
| description, desc | getDescription() |
| mpn | getMpn() |
List<ElectronicPart> results = ParametricSearch.search(capacitors)
.min("voltage", "50V")
.equals("dielectric", "X7R")
.find();
List<ElectronicPart> results = ParametricSearch.search(resistors)
.where("tolerance", "<= 0.1%")
.in("package", "0402", "0603", "0805")
.find();
List<ElectronicPart> murataOnly = ParametricSearch.search(bomEntries)
.equals("manufacturer", "Murata")
.find();
List<ElectronicPart> decouplingCaps = ParametricSearch.search(capacitors)
.range("capacitance", "100nF", "10uF")
.min("voltage", "16V")
.in("dielectric", "X7R", "X5R")
.find();
public List<BOMEntry> findObsoleteHighValueParts(BOM bom) {
return ParametricSearch.search(bom.getBomEntries())
.min("capacitance", "10uF") // High value
.find()
.stream()
.filter(ElectronicPart::isLifecycleAtRisk) // Obsolete
.map(p -> (BOMEntry) p)
.toList();
}
m = milli, M = mega (case matters!)X7R matches x7r)Parts without the requested spec are excluded from results:
// Part without "voltage" spec will NOT be in results
ParametricSearch.filter(parts, Map.of("voltage", ">= 25V"));
// Empty/null collection returns empty list
ParametricSearch.filter(null, requirements); // []
ParametricSearch.filter(List.of(), requirements); // []
// Null/empty requirements returns all parts
ParametricSearch.filter(parts, null); // all parts
ParametricSearch.filter(parts, Map.of()); // all parts
Units are stripped for comparison:
"50V" and "50" compare as equal"10kΩ" and "10k" compare as equalBOMEntry extends ElectronicPart, so filtering works:
List<BOMEntry> entries = ...;
List<ElectronicPart> results = ParametricSearch.filter(entries, requirements);
// Results can be cast back to BOMEntry if needed
ComponentValueStandardizer - Value parsing (used internally)SpecValue / SpecUnit - Typed spec systemBaseComponentSpecs.meetsRequirements() - Similar pattern for typed specscompareTo(), not equals() - 1E+3 equals 1000 by valueu and µ are supported for micro prefix1% parses to 1, not 0.01 (matches how tolerances are typically specified)SpecValue, SpecUnit, BaseComponentSpecs.meetsRequirements(), and ComponentValueStandardizer - a comprehensive typed spec system. ParametricSearch bridges the gap between ElectronicPart.specs (Map<String, String>) and these typed systems.ElectronicPart.specs uses strings, while ComponentSpecification uses typed SpecValue<?>. ParametricSearch works with the string-based system which is more commonly used.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.