Skip to content

Add manufacturing-artifact-generation reasoning protocol#182

Merged
Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Alan-Jowett:add-manufacturing-artifact-generation
Apr 6, 2026
Merged

Add manufacturing-artifact-generation reasoning protocol#182
Alan-Jowett merged 3 commits intomicrosoft:mainfrom
Alan-Jowett:add-manufacturing-artifact-generation

Conversation

@Alan-Jowett
Copy link
Copy Markdown
Member

Summary

Add a \manufacturing-artifact-generation\ reasoning protocol for producing all files needed to submit a PCB design for fabrication and assembly. This is Step 4 of 9 in the end-to-end hardware design workflow — the final protocol step before templates.

New Components

Type Name Path Description
Protocol (reasoning) manufacturing-artifact-generation protocols/reasoning/manufacturing-artifact-generation.md Automated Gerber/drill/BOM/PnP generation with fab-specific formatting

Design Decisions

  • Python script wrapping kicad-cli: Consistent with the \pcb-layout-design\ protocol's approach. Every export step uses concrete \kicad-cli\ commands with documented flags.
  • Fab-specific formatting: JLCPCB requires LCSC part numbers and specific BOM CSV columns; PCBWay has a different format. The protocol includes per-fab configuration rather than generic-only output, because generic artifacts always require manual reformatting.
  • Pick-and-place rotation corrections: Assembly services define 0° rotation differently. The protocol documents this known issue and includes a rotation offset configuration for JLCPCB.
  • Cross-artifact validation: Phase 8 catches common submission failures — Gerber layer count vs stackup, BOM component count vs schematic, pick-and-place count vs BOM, coordinate origin consistency.
  • DNP handling: Components marked Do Not Populate appear in the BOM with a DNP flag — never silently omitted (omission causes confusion).
  • No separate audit protocol needed: The pre-submission validation phase serves as the self-audit, and the existing \�om-consistency\ protocol can audit the generated BOM.
  • **\�pplicable_to: []**: No template references this yet.

Checklist

  • All files have SPDX license headers
  • YAML frontmatter is valid and complete
  • Component names match file names (kebab-case)
  • manifest.yaml updated
  • No vague instructions in protocols
  • Protocols have numbered, ordered phases
  • New components do not conflict with existing ones
  • CI validation passes (\python tests/validate-manifest.py)

Copilot AI review requested due to automatic review settings April 6, 2026 18:39
Add a systematic reasoning protocol for generating all manufacturing
deliverables from a completed PCB design. This is Step 4 of 9 in the
end-to-end hardware design workflow.

The protocol covers 9 phases:
1. Input validation (DRC-clean board, target fab service, BOM data)
2. Gerber generation (all layers, RS-274X/X2, Protel extensions)
3. Drill file generation (Excellon, PTH + NPTH separated)
4. BOM generation with fab-specific formatting (JLCPCB LCSC numbers,
   PCBWay format, DNP handling)
5. Pick-and-place centroid file with rotation offset corrections
6. Assembly drawing generation (top/bottom PDF)
7. Fab-specific packaging (directory structure, Gerber ZIP,
   submission checklist)
8. Pre-submission validation (cross-artifact consistency checks:
   layer count, hole count, BOM count, PnP count, coordinate origin)
9. Python script generation wrapping kicad-cli for full automation

Key design decisions:
- Python script wrapping kicad-cli commands, consistent with the
  pcb-layout-design protocol's approach
- Fab-specific BOM and pick-and-place formatting (JLCPCB, PCBWay)
  because generic artifacts require manual reformatting
- Cross-artifact validation catches common submission failures
  (missing board outline, coordinate origin mismatch, drill unit
  mismatch)
- No new audit protocol needed — the pre-submission validation
  phase serves as the self-audit

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new hardware-focused reasoning protocol to PromptKit for generating the full set of manufacturing deliverables (fab + assembly) from a completed KiCad PCB design, intended as a workflow step before templates start referencing it.

Changes:

  • Introduce manufacturing-artifact-generation reasoning protocol with phased guidance for Gerbers/drill/BOM/PnP/assembly drawings plus validation and an automation-script outline.
  • Register the new protocol in manifest.yaml under the reasoning protocols list.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
protocols/reasoning/manufacturing-artifact-generation.md New multi-phase protocol describing artifact generation, validation, and a Python automation script outline.
manifest.yaml Adds the new protocol to the manifest so it’s discoverable by the bootstrap/component system.

@Alan-Jowett Alan-Jowett force-pushed the add-manufacturing-artifact-generation branch from 7f3fc67 to c457f7c Compare April 6, 2026 18:43
Address four reviewer findings:

1. BOM export command used fake placeholders (\, \)
   that are not valid kicad-cli field syntax. Updated to use actual
   schematic field names (MPN, Manufacturer, LCSC, DNP). Documented
   that quantity is computed by --group-by grouping, not a field.

2. Drill hole count validation referenced 'pcbnew API' but pcbnew
   is not in the tool dependencies. Changed to parse tool definitions
   and hit counts from the Excellon drill file directly.

3. Script takes .kicad_pcb path but BOM export needs the schematic.
   Added schematic path derivation (same directory, same basename,
   .kicad_sch extension) with error handling for missing schematic.

4. 'oshpark' listed as supported fab service but not defined in
   FAB_CONFIGS. Removed from supported list until defined (OSH Park
   is fab-only, no assembly formatting needed).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 6, 2026 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

1. Script accessed sys.argv[1] without arg count check, causing
   IndexError when run without arguments. Added len(sys.argv)
   guard with usage message and board file existence check,
   consistent with pcb-layout-design protocol.

2. kicad-cli commands used inconsistent output paths (./gerbers/,
   ./assembly/, bom-raw.csv) that didn't match Phase 7's defined
   directory structure (manufacturing/gerbers/, manufacturing/
   assembly/). Updated all commands to use the manufacturing/
   prefix for consistency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@Alan-Jowett Alan-Jowett merged commit 41fda15 into microsoft:main Apr 6, 2026
7 checks passed
@Alan-Jowett Alan-Jowett deleted the add-manufacturing-artifact-generation branch April 6, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants