| name | generate-bom |
| description | Use when you have a components.json and want to generate a structured Bill of Materials as markdown table and CSV for sourcing or documentation. |
Generate BOM
Convert a components.json inventory into a structured Bill of Materials (BOM). Output includes a markdown table and CSV file, with columns for reference designator, component type, part number, quantity, package, manufacturer, datasheet URL, and notes. Identical parts are automatically grouped with quantity counts.
Data storage root:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/hardware-id-annotation/
When to use
- You need to order replacement components or source a design
- You want a formatted BOM for documentation or manufacturing
- You want to deduplicate and count identical parts across the board
- You're preparing a design for PCB assembly (pick-and-place, solder paste)
Inputs to gather
- Components JSON — path to
data/<board-slug>/components.json
- Optional specs JSON — if available,
data/<board-slug>/specs-summary.json (from cross-check-specs) to enrich BOM with manufacturer and datasheet URLs
- Output format —
markdown (default), csv, or both
Procedure
-
Load components.json. Validate structure: components array with entries containing id, type, part_number_visible, package.
-
Deduplicate and count. Group by part_number_visible (or part_number_standardized if present); count occurrences.
-
Enrich with specs (optional). If specs JSON exists, join on part number to pull manufacturer, datasheet_url, and other details.
-
Generate markdown table:
# BOM: <board-slug>
| Ref | Qty | Type | Part Number | Package | Manufacturer | Datasheet | Notes |
|-----|-----|------|-------------|---------|--------------|-----------|-------|
| C1, C2, C3 | 3 | Capacitor | 100nF 0805 | 0805 | — | — | Ceramic, unmarked |
| U1 | 1 | IC | STM32F407VG | LQFP100 | STMicroelectronics | [link] | ARM Cortex-M4 |
| ... | | | | | | | |
**Summary:** 42 components, 28 unique parts, highest-volume: 100nF capacitor (×8)
-
Generate CSV file:
ref,qty,type,part_number,package,manufacturer,datasheet_url,notes
C1;C2;C3,3,Capacitor,100nF 0805,0805,—,—,Ceramic unmarked
U1,1,IC,STM32F407VG,LQFP100,STMicroelectronics,https://...,ARM Cortex-M4
...
-
Save outputs:
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/hardware-id-annotation/data/<board-slug>/bom.md
${CLAUDE_USER_DATA:-${XDG_DATA_HOME:-$HOME/.local/share}/claude-plugins}/hardware-id-annotation/data/<board-slug>/bom.csv
-
Console output: Summary statistics (total parts, unique parts, part-count distribution).
Output / side effects
- Markdown file: human-readable BOM with formatting and summary
- CSV file: machine-readable, suitable for import into sourcing tools, ERP, or CAM software
- Console: line count, unique part count, top parts by quantity
Safety / constraints
- Unknown part numbers (entries with
part_number_visible: null) are still included in the BOM but flagged in the notes column as "unidentified" or "visual match only".
- Qty column sums identical part numbers; if a part is split across multiple reference designators, list them comma-separated in the Ref column.
- Datasheet URLs may be empty if
cross-check-specs was not run; document which BOMs are enriched vs. basic.