.claude/skills/manufacturers/st/SKILL.md
STMicroelectronics MPN encoding patterns, suffix decoding, and handler guidance. Use when working with STM32, STM8, ST MOSFETs, or L78/L79 regulators.
npx skillsauth add Cantara/lib-electronic-components stInstall 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.
STMicroelectronics produces a wide range of components:
STM32 F 1 03 C 8 T 6
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ └── Temperature range (6 = -40 to 85°C)
│ │ │ │ │ │ └── Package (T = LQFP)
│ │ │ │ │ └── Flash size (8 = 64KB)
│ │ │ │ └── Pin count (C = 48 pins)
│ │ │ └── Line (03 = access line)
│ │ └── Core (1 = Cortex-M3)
│ └── Type (F = Mainstream)
└── Family (STM32)
| Letter | Type | Description | |--------|------|-------------| | F | Mainstream | General purpose, good balance | | L | Low-power | Ultra-low-power modes | | H | High-performance | High clock speeds, more features | | G | General-purpose | Newer mainstream series | | W | Wireless | Integrated radio (BLE, LoRa) | | U | Ultra-low-power | Next-gen low-power |
| Digit | Core | Notes | |-------|------|-------| | 0 | Cortex-M0/M0+ | Entry level | | 1 | Cortex-M3 | Mainstream | | 2 | Cortex-M3 | Performance | | 3 | Cortex-M4 | DSP instructions | | 4 | Cortex-M4 | With FPU | | 7 | Cortex-M7 | High performance |
| Code | Pins | Notes | |------|------|-------| | F | 20 | Smallest | | G | 28 | | | K | 32 | | | T | 36 | | | S | 44 | | | C | 48 | Common | | R | 64-66 | Popular | | V | 100 | | | Z | 144 | | | I | 176 | Largest |
| Code | Size | Notes | |------|------|-------| | 4 | 16 KB | | | 6 | 32 KB | | | 8 | 64 KB | Common | | B | 128 KB | | | C | 256 KB | | | D | 384 KB | | | E | 512 KB | | | F | 768 KB | | | G | 1024 KB | | | H | 1536 KB | | | I | 2048 KB | Largest |
| Code | Package | Description | |------|---------|-------------| | T | LQFP | Low-profile Quad Flat Pack | | H | BGA | Ball Grid Array | | U | VFQFPN | Very thin Fine-pitch QFN | | Y | WLCSP | Wafer Level Chip Scale | | P | TSSOP | Thin Shrink SOP |
| Code | Range | Application | |------|-------|-------------| | 6 | -40 to +85°C | Industrial | | 7 | -40 to +105°C | Extended |
STM32F103C8T6
│ │ │││││
│ │ ││││└── 6 = -40 to +85°C
│ │ │││└── T = LQFP package
│ │ ││└── 8 = 64KB Flash
│ │ │└── C = 48 pins
│ │ └── 03 = Access line (medium density)
│ └── F1 = Mainstream Cortex-M3
└── STM32 family
Result: Mainstream M3 MCU, 48-pin LQFP, 64KB Flash, Industrial temp
Common Name: "Blue Pill" MCU
STM8 S 003 F 3 P 6
│ │ │ │ │ │ │
│ │ │ │ │ │ └── Temperature range
│ │ │ │ │ └── Package
│ │ │ │ └── Flash size
│ │ │ └── Pin count
│ │ └── Line
│ └── Type (S=Standard, L=Low-power, A=Automotive)
└── STM8 family
| Prefix | Package | Notes | |--------|---------|-------| | STF | TO-220FP | Isolated tab | | STP | TO-220 | Standard | | STD | DPAK (TO-252) | Surface mount | | STB | D²PAK (TO-263) | High power SMD | | STW | TO-247 | High power through-hole | | VN | Various | N-channel series | | VP | Various | P-channel series |
ST [Package] [Current] [Channel] [Voltage] [Suffix]
│ │ │ │ │ │
│ │ │ │ │ └── Technology (F, L, etc.)
│ │ │ │ └── Voltage class (20=200V, 25=250V)
│ │ │ └── Channel (N=N-ch, P=P-ch)
│ │ └── Current rating (amps)
│ └── Package code (F, P, D, B, W)
└── ST prefix
STF5N52U
│││ │ ││
│││ │ │└── U = technology suffix
│││ │ └── 52 = 520V class
│││ └── N = N-channel
││└── 5 = ~5A rating
│└── F = TO-220FP package
└── ST prefix
L 78 [Voltage] [Grade] [Package]
│ │ │ │ │
│ │ │ │ └── Package suffix
│ │ │ └── Temperature grade (optional)
│ │ └── Output voltage (05=5V, 12=12V, etc.)
│ └── 78=Positive, 79=Negative
└── L prefix (ST designation)
| Suffix | Package | Description | |--------|---------|-------------| | CV | TO-220 | Standard through-hole | | V | TO-220 | Alternate | | CP | TO-220FP | Isolated tab | | P | TO-220FP | Alternate | | CD2T | D²PAK | High power SMD | | D2T | D²PAK | Alternate | | CDT | DPAK | SMD | | DT | DPAK | Alternate |
| Grade | Temperature | Notes | |-------|-------------|-------| | (none) | 0 to +125°C | Standard | | C | 0 to +125°C | Commercial | | A | -40 to +125°C | Extended | | AB | -40 to +125°C | Extended | | AC | 0 to +125°C | Standard |
L7805CV
│ ││ ││
│ ││ │└── V = through-hole variant
│ ││ └── C = Commercial grade
│ │└── 05 = 5V output
│ └── 78 = Positive regulator
└── L prefix
L7912ACD2T
│ ││ │ │ │
│ ││ │ │ └── T = tape packaging
│ ││ │ └── D2 = D²PAK
│ ││ └── AC = standard temp grade
│ │└── 12 = -12V output
│ └── 79 = Negative regulator
└── L prefix
Current STHandler has a bug in extractPackageCode():
// WRONG - Tries to match last 2 chars as package+temp
String lastTwo = upperMpn.substring(upperMpn.length() - 2);
// For STM32F103C8T6: lastTwo = "T6"
// Then validates: "TUVRY".indexOf('T') >= 0 && isDigit('6')
// This passes but returns "T6" instead of just "T" (LQFP)
Correct approach:
// STM32F103C8T6 → Package is second-to-last char: "T"
if (upperMpn.startsWith("STM32") && upperMpn.length() >= 2) {
char packageChar = upperMpn.charAt(upperMpn.length() - 2);
return switch (packageChar) {
case 'T' -> "LQFP";
case 'H' -> "BGA";
case 'U' -> "VFQFPN";
case 'Y' -> "WLCSP";
case 'P' -> "TSSOP";
default -> String.valueOf(packageChar);
};
}
// Extract from prefix: STF = TO-220FP, STP = TO-220, STD = DPAK
if (upperMpn.startsWith("STF")) return "TO-220FP";
if (upperMpn.startsWith("STP")) return "TO-220";
if (upperMpn.startsWith("STD")) return "DPAK";
if (upperMpn.startsWith("STB")) return "D2PAK";
if (upperMpn.startsWith("STW")) return "TO-247";
// STM32F103C8T6 → Series: STM32F103 (or STM32F1)
// For STM32: Extract up to and including line number
if (upperMpn.startsWith("STM32")) {
// STM32 + Type + Core + Line = STM32F103
// Match pattern: STM32[A-Z][0-9]{1,3}
Pattern p = Pattern.compile("^(STM32[A-Z][0-9]{1,3})");
Matcher m = p.matcher(upperMpn);
if (m.find()) return m.group(1);
}
manufacturers/STHandler.javaMICROCONTROLLER_ST, MCU_ST, MOSFET_ST, VOLTAGE_REGULATOR_LINEAR_SThandlers/STHandlerTest.java (72 tests)All issues discovered during analysis have been fixed:
Set.of()// STM32/STM8: Package is second-to-last character
if (upperMpn.startsWith("STM32") || upperMpn.startsWith("STM8")) {
char packageChar = upperMpn.charAt(upperMpn.length() - 2);
return switch (packageChar) {
case 'T' -> "LQFP";
case 'H' -> "BGA";
case 'U' -> "VFQFPN";
// ...
};
}
// MOSFETs: Package is in prefix
if (upperMpn.startsWith("STF")) return "TO-220FP";
if (upperMpn.startsWith("STP")) return "TO-220";
// ...
// Voltage regulators: Strip prefix and grade, then match suffix
String suffix = upperMpn.replaceFirst("^[LM]C?7[89]\\d{2}", "")
.replaceFirst("^[A-C]{1,2}", "");
// CV → TO-220, D2T → D2PAK, etc.
When handler A's matches() falls through to patterns.matches(mpn, type), it can accidentally match patterns registered by handler B.
Fix in AtmelHandler: Don't fall through to pattern matching for base MICROCONTROLLER type - return false if prefix check fails. This prevents AtmelHandler from matching STM32 MPNs.
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.