Skip to content

hashgraph-online/awesome-codex-plugins / plugins/aklofas/kicad-happy/skills/datasheets

datasheets

Verified

Extract structured specifications from electronic component datasheet PDFs — pinouts, electrical characteristics, peripherals, topology, and features. Cache extractions per project for consumption by schematic and PCB analyzers. Primary consumer infrastructure for `kicad`, `emc`, `spice`, and `thermal` analyzers. Use this skill whenever the user asks to extract, verify, or read specs from a component datasheet; when analyzers need verified IC knowledge (EN pin thresholds, PG presence, USB peripheral speed); or when a review mentions datasheet coverage, extraction quality, or per-MPN specifications. Also triggers on "extract this datasheet", "what are the specs for MPN X", "verify datasheet extraction", or "check pin functions for part Y".

FileKindSize
SKILL.mdskill md11.2 KB
datasheet_types/__init__.pyscript1.9 KB
datasheet_types/base_block.pyscript6.5 KB
datasheet_types/cache_reader.pyscript12.3 KB
datasheet_types/codec.pyscript6.3 KB
datasheet_types/extraction.pyscript8.0 KB
datasheet_types/pinout.pyscript5.2 KB
datasheet_types/regulator.pyscript5.3 KB
datasheet_types/spec_value.pyscript2.4 KB
datasheet_types/trust_gating.pyscript5.0 KB
distributor_core/__init__.pyscript0 B
distributor_core/cli.pyscript2.9 KB
distributor_core/download.pyscript36.7 KB
distributor_core/inputs.pyscript9.0 KB
distributor_core/manifest.pyscript5.7 KB
distributor_core/sync.pyscript21.0 KB
distributor_core/verify.pyscript12.1 KB
examples/abm8g-106-12.000mhz-t.jsonconfig9.4 KB
examples/irlml6344.jsonconfig16.0 KB
examples/lm2596-adj.jsonconfig14.3 KB
examples/lm358.jsonconfig15.6 KB
examples/mbrs540t3g.jsonconfig12.3 KB
examples/stm32f103c8t6.jsonconfig51.1 KB
prompts/base.mdmarkdown4.5 KB
prompts/crystal.mdmarkdown8.8 KB
prompts/diode.mdmarkdown8.3 KB
prompts/mcu.mdmarkdown9.6 KB
prompts/opamp.mdmarkdown10.7 KB
prompts/pinout.mdmarkdown4.7 KB
prompts/regulator.mdmarkdown4.4 KB
prompts/scout.mdmarkdown3.5 KB
prompts/transistor.mdmarkdown12.5 KB
references/cache-layout.mdmarkdown8.4 KB
references/consumer-api.mdmarkdown10.8 KB
references/dispatch-claude-code.mdmarkdown9.4 KB
references/dispatcher-contract.mdmarkdown8.2 KB
references/extraction-pipeline.mdmarkdown1.7 KB
references/extraction-schema.mdmarkdown18.0 KB
references/field-extraction-guide.mdmarkdown14.9 KB
references/quality-scoring.mdmarkdown8.4 KB
schemas/CHANGELOG.mdmarkdown16.0 KB
schemas/base.schema.jsonconfig9.3 KB
schemas/crystal.schema.jsonconfig7.2 KB
schemas/diode.schema.jsonconfig7.9 KB
schemas/extraction.schema.jsonconfig3.7 KB
schemas/fixtures/lm2596-adj.example.jsonconfig14.3 KB
schemas/fixtures/manifest.example.jsonconfig1000 B
schemas/fixtures/minimal.example.jsonconfig2.1 KB
schemas/manifest.schema.jsonconfig3.0 KB
schemas/mcu.schema.jsonconfig12.4 KB
schemas/opamp.schema.jsonconfig9.2 KB
schemas/pinout.schema.jsonconfig5.9 KB
schemas/plan.schema.jsonconfig4.6 KB
schemas/regulator.schema.jsonconfig8.4 KB
schemas/scout.schema.jsonconfig2.9 KB
schemas/spec_value.schema.jsonconfig3.0 KB
schemas/transistor.schema.jsonconfig12.0 KB
scripts/_smoke_v14_roundtrip.pyscript8.9 KB
scripts/datasheet_extract_cache.pyscript21.2 KB
scripts/datasheet_features.pyscript17.1 KB
scripts/datasheet_page_selector.pyscript16.7 KB
scripts/datasheet_score.pyscript15.5 KB
scripts/datasheet_verify.pyscript45.6 KB
scripts/extraction_schema.pyscript1.8 KB
scripts/merge_results.pyscript13.0 KB
scripts/plan_extraction.pyscript9.5 KB
scripts/validate_extraction_result.pyscript4.0 KB
scripts/validate_sanity_vector.pyscript6.4 KB

references/quality-scoring.md

View on GitHub
# Quality Scoring Reference

This guide describes the **legacy v1.3 0–10 rubric** (`score_extraction()`). Current v1.4 extractions are scored by `score_v14_extraction()` on 0–100: pinout completeness 20 %, base completeness 25 %, category completeness 25 %, and a reserved 30 % awarded in full. `merge_results.py` stores the score at `extraction.quality_score`. `lookup()` reports it without gating; the dict helpers and `datasheet_verify.py` treat a score below 60 as untrusted. Only the regulator category has a field rubric; any other category payload that is present gets full category credit. The rubric below still applies to v1.3 caches.

The scorer (`datasheet_score.py`) evaluates a completed legacy extraction against a five-dimension completeness rubric and returns a total score from 0.0 to 10.0. The score determines whether the extraction is good enough to cache and use for design review.

---

## Thresholds

| Constant | Value | Source |
|----------|-------|--------|
| `MIN_SCORE` | 6.0 | `datasheet_extract_cache.py` |
| `MAX_RETRIES` | 3 | `datasheet_extract_cache.py` |
| `DEFAULT_MAX_AGE_DAYS` | 90 | `datasheet_extract_cache.py` |

An extraction with `total >= 6.0` is considered sufficient. An extraction with `total < 6.0` is retried if `retry_count < MAX_RETRIES`. Keep the highest-scoring extraction across retries (the cache manager overwrites with each new attempt; stop when sufficient).

---

## Five-Dimension Rubric

| Dimension | Weight | Score Function |
|-----------|--------|---------------|
| Pin coverage | 35% | `_score_pin_coverage()` |
| Voltage ratings | 25% | `_score_voltage_ratings()` |
| Application info | 20% | `_score_application_info()` |
| Electrical characteristics | 10% | `_score_electrical_chars()` |
| SPICE specs | 10% | `_score_spice_specs()` |

**Total** = sum of (dimension score × weight), rounded to one decimal place. Weights sum to 1.0.

---

## Dimension Scoring Rules

### Pin Coverage (35%)

Starting score: 10.0.

| Condition | Deduction |
|-----------|-----------|
| No pins in extraction | Score = 0.0 immediately |
| Fewer than 50% of expected pins present | Score = 0.0 immediately |
| Each missing pin (vs expected count) | -2.0 |
| Each pin with name only (no specs, no description, no `required_external`) | -1.0 |

A pin "has specs" if any of these fields is non-null: `voltage_abs_max`, `voltage_operating_min`, `voltage_operating_max`, `current_max_ma`, `threshold_high_v`, `threshold_low_v`. A pin with only `description` or `required_external` (no numeric specs) still avoids the name-only deduction.

If no `expected_pin_count` is passed to `score_extraction()`, the expected count defaults to the number of pins in the extraction (no missing-pin deduction).

Issues list is capped at 5 entries for readability.

### Voltage Ratings (25%)

Starting score: 10.0.

| Condition | Deduction |
|-----------|-----------|
| `absolute_maximum_ratings` dict missing or empty | -3.0 |
| No key ending in `_max_v` with a non-null value | -2.0 |
| `junction_temp_max_c` missing | -1.0 |
| `recommended_operating_conditions` dict missing or empty | -3.0 |
| `vin_min_v` or `vin_max_v` missing | -1.5 |
| `temp_min_c` or `temp_max_c` missing | -1.0 |

### Application Info (20%)

Starting score: 10.0. If `application_circuit` dict is missing or empty: score = 0.0 immediately.

| Condition | Deduction |
|-----------|-----------|
| `topology` missing | -2.0 |
| Zero component recommendation fields populated | -3.0 |
| Only 1 recommendation field populated (expect 2+) | -1.5 |
| Neither `vout_formula` nor `notes` populated | -2.0 |
| `notes` missing (but `vout_formula` present) | -1.0 |

Recommendation fields counted: `inductor_recommended`, `input_cap_recommended`, `output_cap_recommended`, `feedback_resistor_top_ohm`, `feedback_resistor_bottom_ohm`, `compensation_cap`, `bootstrap_cap`, `decoupling_cap`, and any other key ending in `_recommended`.

### Electrical Characteristics (10%)

Category-dependent. Starting score: 10.0.

If `electrical_characteristics` dict is missing:
- Categories with required fields → score = 0.0
- Categories without required fields → score = 5.0

| Condition | Deduction |
|-----------|-----------|
| Each missing required field for category | -3.0 |
| Each missing optional (nice-to-have) field | -1.0 |

Required and optional fields by category:

| Category | Required | Optional |
|----------|----------|---------|
| `operational_amplifier` | `gbw_hz`, `slew_vus` | `vos_mv`, `aol_db`, `rin_ohms` |
| `comparator` | `prop_delay_ns` | `vos_mv`, `aol_db` |
| `linear_regulator` | `vref_v`, `quiescent_current_ua` | `dropout_mv`, `output_current_max_ma` |
| `switching_regulator` | `vref_v`, `switching_frequency_khz` | `quiescent_current_ua`, `output_current_max_ma` |
| `voltage_reference` | `vref_v`, `vref_accuracy_pct` | `temp_coefficient_ppmk` |
| `microcontroller` | (none) | `quiescent_current_ua`, `io_voltage_max` |
| `esd_protection` | `clamping_voltage_v` | `leakage_current_na`, `capacitance_pf` |
| all others | (none) | (none) |

For categories with no required and no optional fields: if 3+ fields are populated, score = 10.0; if 1–2 fields, score = 7.0; if 0 fields, score = 5.0.

Issues list is capped at 5 entries.

### SPICE Specs (10%)

Starting score: 10.0.

| Condition | Score / Deduction |
|-----------|-------------------|
| `spice_specs` dict missing, but `electrical_characteristics` present | Score = 5.0 |
| `spice_specs` dict missing, no electrical chars either | Score = 0.0 |
| `spice_specs` section is empty (all values null) | Score = 0.0 |
| Each missing required SPICE field for category | -4.0 |
| 1–2 fields populated, no required fields for category | Score capped at 6.0 |

Required SPICE fields by category:

| Category | Required SPICE fields |
|----------|----------------------|
| `operational_amplifier` | `gbw_hz` |
| `linear_regulator` | `vref`, `dropout_mv` |
| `switching_regulator` | `vref` |
| `voltage_reference` | `vref` |
| `comparator` | (none) |
| all others | (none) |

---

## Score Interpretation

| Score | Meaning |
|-------|---------|
| >= 8.0 | All critical fields present; high confidence for automated pin audit |
| 6.0 – 7.9 | Sufficient for design review; some optional specs missing |
| < 6.0 | Insufficient; cache manager will retry up to `MAX_RETRIES` times |

An extraction at 5.9 from a part with a minimal datasheet (no application circuit section, no SPICE specs) is not the same as 5.9 from a part whose datasheet has everything but was incompletely extracted. Check the `issues` list to distinguish.

---

## Calling the Scorer

```python
from datasheet_score import score_extraction

result = score_extraction(extraction, expected_pin_count=6)
```

Returns:

```python
{
    "total": 8.3,
    "pin_coverage": 9.0,
    "voltage_ratings": 8.5,
    "application_info": 7.0,
    "electrical_characteristics": 8.0,
    "spice_specs": 8.5,
    "issues": ["Pin 3 (BOOT): name only, no specs", ...],
    "sufficient": True   # True if total >= 6.0
}
```

The `issues` list is the union of per-dimension issue strings (capped per dimension). Use it to guide retry attempts — if the issues show "No application circuit information", re-read the application section pages.

---

## Cache Index Entry

When an extraction is cached via `cache_extraction()`, the `manifest.json` records a summary:

```json
{
  "file": "TPS61023DRLR_a1b2c3.json",
  "mpn": "TPS61023DRLR",
  "category": "switching_regulator",
  "source_pdf": "TPS61023DRLR.pdf",
  "source_pdf_hash": "sha256:...",
  "extraction_date": "2026-04-15T12:00:00+00:00",
  "extraction_score": 8.2,
  "extraction_version": 1,
  "pin_count": 6
}
```

The `extraction_score` in the index is the `total` from `score_extraction()`, stored in `extraction_metadata.extraction_score` inside the full JSON. An entry with `extraction_score < 6.0` may still be present if `retry_count >= MAX_RETRIES` (retries exhausted).

---

## Staleness Check

`is_extraction_stale()` in `datasheet_extract_cache.py` returns `(True, reason)` if any of:

1. Extraction not found in cache (`"not_cached"`)
2. `extraction_version < EXTRACTION_VERSION` (`"schema_upgrade"`)
3. Source PDF hash changed (`"pdf_changed"`)
4. Score below `MIN_SCORE` and retries not exhausted (`"low_score (X.X < 6.0, retry N/3)"`)
5. Extraction older than 90 days (`"age (N days > 90)"`)

A stale extraction can still be returned by `get_extraction_for_review()` along with the stale status; the caller decides whether to use the old data or wait for a refresh.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall