kidoc
Generate professional engineering documentation from KiCad projects — Hardware Design Descriptions (HDD), CE Technical Files, Interface Control Documents (ICD), Design Review Packages, and Manufacturing Transfer Packages. Auto-runs schematic, PCB, EMC, and thermal analyses; renders schematic and PCB SVGs with subsystem cropping, focus dimming, net highlighting, and pin-net annotation; generates power tree, bus topology, and architecture block diagrams. Produces styled PDF with cover pages, TOC, and vector SVG embedding. Markdown source of truth — human-editable, version-controllable. Use for "generate documentation", "create report", "HDD", "CE technical file", "design review package", "ICD", "render schematic", "render layout", "generate block diagram", "manufacturing package", "generate PDF", or "custom report".
What this skill does
# kidoc — Engineering Documentation Skill
Generate professional engineering documentation from KiCad project files.
## Quick Start
One command generates the full scaffold — analyses, diagrams, renders, and markdown are all produced automatically:
```bash
python3 skills/kidoc/scripts/kidoc_scaffold.py \
--project-dir /path/to/kicad/project \
--type hdd \
--output reports/HDD.md
```
This auto-detects `.kicad_sch` and `.kicad_pcb` files, runs schematic/PCB/EMC/thermal analyses, generates block diagrams and schematic SVG renders, and produces a structured markdown scaffold with pre-filled data tables and narrative placeholders.
To produce a PDF:
```bash
python3 skills/kidoc/scripts/kidoc_generate.py \
--project-dir /path/to/kicad/project \
--doc reports/HDD.md \
--format pdf
```
Creates `reports/.venv/` automatically on first run (PDF/DOCX/ODT only — HTML is zero-dep).
## Workflow
1. **Generate scaffold** — `kidoc_scaffold.py` auto-runs all available analyses, renders schematics, generates diagrams, and writes the markdown scaffold.
2. **Fill narratives** — The agent reads the scaffold and writes engineering prose for each `<!-- NARRATIVE: section_name -->` placeholder. The engineer reviews and edits.
3. **Regenerate** — On re-run, data sections between `<!-- GENERATED: section_id -->` markers update from fresh analysis; user-written narrative content is preserved.
4. **Render output** — `kidoc_generate.py` produces PDF, HTML, DOCX, or ODT.
## Document Types
| Type | Name | Key Sections |
|------|------|-------------|
| `hdd` | Hardware Design Description | System overview, power, signals, analog, thermal, EMC, PCB, mechanical, BOM, test, compliance |
| `ce_technical_file` | CE Technical File | Product ID, essential requirements, harmonized standards, risk assessment, Declaration of Conformity |
| `design_review` | Design Review Package | Review summary (cross-analyzer scores), findings, action items |
| `icd` | Interface Control Document | Interface list, per-connector pinout details, electrical characteristics |
| `manufacturing` | Manufacturing Transfer Package | Assembly overview, PCB fab notes, assembly instructions, test procedures |
| `schematic_review` | Schematic Review Report | System overview, power, signals, analog, BOM, schematic appendix |
| `power_analysis` | Power Analysis Report | Power design, thermal, EMC, BOM |
| `emc_report` | EMC Pre-Compliance Report | EMC analysis, compliance, schematic appendix |
## Custom Reports
Use `--spec` to generate reports with arbitrary section ordering:
```bash
python3 skills/kidoc/scripts/kidoc_scaffold.py \
--project-dir . --spec my-report.json --output reports/custom.md
```
Spec format (JSON):
```json
{
"type": "custom",
"title": "USB Interface Analysis",
"sections": [
{"id": "front_matter", "type": "front_matter"},
{"id": "signal_interfaces", "type": "signal_interfaces"},
{"id": "bom", "type": "bom_summary"}
]
}
```
Each section's `type` must match a known section type (same names used in the document types table above). The `id` field is a unique key for that section instance.
To see the full default spec for any built-in type:
```bash
python3 skills/kidoc/scripts/kidoc_spec.py --expand hdd
python3 skills/kidoc/scripts/kidoc_spec.py --list
```
The `--spec` flag also works with `kidoc_generate.py` (uses the spec title as fallback project name).
## Schematic and PCB Rendering
Rendering is integrated into the figure generation engine. The orchestrator and scaffold automatically render schematics and PCB views as part of document generation:
```bash
# Generate all figures (diagrams + schematic/PCB renders) from analysis JSON
python3 skills/kidoc/scripts/kidoc_diagrams.py --analysis schematic.json --output reports/figures/
# Full orchestration with spec, analysis, and project files
python3 skills/kidoc/scripts/kidoc_orchestrator.py --analysis schematic.json \
--project-dir . --output reports/figures/
```
The figure generators support: full-sheet rendering (root + all sub-sheets), subsystem cropping (`focus_refs` in spec sections), net highlighting, pin-level net annotation, and all PCB layer presets. These options are configured in the document spec or passed through the analysis dict.
Rendering features available through the generator framework:
- **Crop**: Focus on a subsystem bounding box around specific component refs
- **Focus/dim**: Show focused components at full opacity, dim the rest to 15%
- **Highlight nets**: Color-trace specific nets via BFS
- **Pin nets**: Annotate pin-level net names at pin tips
For direct programmatic access, use `figures.renderers`:
```python
from figures.renderers import render_schematic, render_pcb
render_schematic('design.kicad_sch', 'output/', crop_refs=['R1', 'R2'], highlight_nets=['VCC'])
render_pcb('board.kicad_pcb', 'output/', preset_name='assembly-front')
```
Layer presets:
| Preset | Shows |
|--------|-------|
| `assembly-front` | Front silk, fab, pads, outline |
| `assembly-back` | Back silk, fab, pads, outline (mirrored) |
| `routing-front` | Front copper, pads, vias, outline |
| `routing-back` | Back copper, pads, vias, outline |
| `routing-all` | All copper layers, pads, vias, zones |
| `power` | Power planes, vias, zone outlines |
Additional options: `--highlight-nets`, `--crop-refs`, `--crop x,y,w,h`, `--mirror`, `--overlay annotations.json` (callout boxes with leader lines).
## Block Diagrams
```bash
python3 skills/kidoc/scripts/kidoc_diagrams.py --analysis schematic.json --all --output diagrams/
python3 skills/kidoc/scripts/kidoc_diagrams.py --analysis schematic.json --power-tree --output diagrams/
python3 skills/kidoc/scripts/kidoc_diagrams.py --analysis schematic.json --bus-topology --output diagrams/
python3 skills/kidoc/scripts/kidoc_diagrams.py --analysis schematic.json --architecture --output diagrams/
```
Generated from schematic analysis JSON. Power trees show regulator topology with inductor values, capacitor summaries, and output voltages.
## Output Formats
| Format | SVG Handling | Dependencies |
|--------|-------------|------|
| **Markdown** | Image references | Zero-dep |
| **HTML** | Inlined as vector | Zero-dep |
| **PDF** | Vector via svglib, custom converter fallback, raster fallback | Venv (`reports/.venv/`) |
| **DOCX** | Rasterized to 300 DPI PNG | Venv |
| **ODT** | Rasterized to 300 DPI PNG | Venv |
PDF output includes a styled cover page, table of contents, formatted tables with alternating rows, and vector SVG diagrams.
## Configuration
Report settings live in `.kicad-happy.json` under the `"reports"` key. Config files cascade: `~/.kicad-happy.json` (user-level defaults, e.g. company branding) merges with project-level config.
```jsonc
{
"project": {
"name": "Widget Board",
"number": "HW-2024-042",
"revision": "1.2",
"company": "Acme Electronics",
"author": "Jane Smith",
"market": "eu"
},
"reports": {
"classification": "Company Confidential",
"documents": [
{"type": "hdd", "output": "HDD-{project}-{rev}", "formats": ["pdf", "docx"]}
],
"branding": {
"logo": "templates/logo.png",
"header_left": "{company}",
"header_right": "{number} Rev {rev}"
}
}
}
```
## Writing Narratives
After generating a scaffold, fill the narrative placeholder sections with engineering prose.
### Workflow
1. Run the context builder to get focused data for each section:
```bash
python3 skills/kidoc/scripts/kidoc_narrative.py \
--analysis analysis/schematic.json \
--section power_design
```
Or build contexts for all narrative sections at once:
```bash
python3 skills/kidoc/scripts/kidoc_narrative.py \
--analysis analysis/schematic.json \
--report reports/HDD.md
```
2. For each section, read the context and write prose that:
- Explains **why**, not just **what** — engineering rationale, tradeoffs
- References specific component values and part numbers
- Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.