autospec-fab
Use when the user wants to autonomously implement, validate, and release parametric 3D / CAD-as-code features whose output is 3D-printable STL — proven watertight, structurally sound, fluid/airflow-correct, and visually inspected — across any repo that opts in via `.autospec/fab.yml`.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- autospec-fab
- description
- Use when the user wants to autonomously implement, validate, and release parametric 3D / CAD-as-code features whose output is 3D-printable STL — proven watertight, structurally sound, fluid/airflow-correct, and visually inspected — across any repo that opts in via `.autospec/fab.yml`.
02 资源文件 127
- 参考文档codex/prompt.md10.7 KB
- 其他docker/Dockerfile7.1 KB
- 参考文档docker/requirements.txt1.1 KB
- 参考文档docker/smoke/model/flow.json117 B
- 参考文档docker/smoke/model/load.json77 B
- 参考文档docker/smoke/model/metadata.json234 B
- 其他docker/smoke/part.stl1.5 KB
- 脚本docker/smoke/run_smoke.sh7.2 KB
- 脚本docker/wrappers/ccx_safety_wrapper.py6.2 KB
- 脚本docker/wrappers/foam_cfd_reduce.py7.4 KB
- 其他fixtures/box/box.stl1.5 KB
- 参考文档fixtures/dogfood-featureful/circuit.json492 B
- 其他fixtures/dogfood-featureful/dogfood.stl1.5 KB
- 参考文档fixtures/dogfood-featureful/duct.json540 B
- 参考文档fixtures/dogfood-featureful/metadata.json247 B
- 其他fixtures/dogfood/dogfood.stl1.5 KB
- 参考文档fixtures/dogfood/metadata.json190 B
- 其他fixtures/open-cube.stl1.3 KB
- 其他fixtures/two-cubes.stl2.9 KB
- 脚本install.sh5.8 KB
- 参考文档opencode/agent.md11.0 KB
- 参考文档README.md14.2 KB
- 脚本scripts/.gitkeep—
- 脚本scripts/fab-vision-cli.py18.5 KB
- 脚本scripts/freecad_harness.py6.4 KB
- 脚本scripts/load-fab-config.sh6.8 KB
- 脚本scripts/openfoam_case.py4.3 KB
- 脚本scripts/release_gate_stages.py5.9 KB
- 脚本scripts/render_views.py2.6 KB
- 脚本scripts/stage_cfd.py12.0 KB
- 脚本scripts/stage_circuit.py11.3 KB
- 脚本scripts/stage_docs.py8.6 KB
- 脚本scripts/stage_dust.py9.9 KB
- 脚本scripts/stage_fea.py13.6 KB
- 脚本scripts/stage_fitting.py12.6 KB
- 脚本scripts/stage_gasket.py9.5 KB
- 脚本scripts/stage_metadata.py5.4 KB
- 脚本scripts/stage_render.py6.9 KB
- 脚本scripts/stage_slicer.py17.6 KB
- 脚本scripts/stage_vision.py9.4 KB
- 脚本scripts/stage-geometry.py11.0 KB
- 脚本scripts/stl-release-gate.py11.3 KB
- 其他tests/define-fab-lens.bats3.4 KB
- 其他tests/fixtures/cfd/body.stl1.4 KB
- 参考文档tests/fixtures/cfd/flow.json117 B
- 参考文档tests/fixtures/cfd/model-critical.json160 B
- 参考文档tests/fixtures/cfd/model-noncritical.json157 B
- 参考文档tests/fixtures/circuit/broken-link.json355 B
- 参考文档tests/fixtures/circuit/connected.json492 B
- 参考文档tests/fixtures/circuit/leaked-isolation.json501 B
- 参考文档tests/fixtures/circuit/relief-low-flow.json357 B
- 参考文档tests/fixtures/complete-fab.yml673 B
- 参考文档tests/fixtures/dust/blocked.json292 B
- 参考文档tests/fixtures/dust/clean.json540 B
- 参考文档tests/fixtures/dust/gate-slot.json293 B
- 参考文档tests/fixtures/dust/pinched.json300 B
- 参考文档tests/fixtures/dust/pvc.json287 B
- 参考文档tests/fixtures/empty-models-fab.yml207 B
- 其他tests/fixtures/fea/body.stl1.4 KB
- 参考文档tests/fixtures/fea/load.json77 B
- 参考文档tests/fixtures/fea/model-critical.json160 B
- 参考文档tests/fixtures/fea/model-noncritical.json157 B
- 其他tests/fixtures/gasket-enclosed/body.stl1.5 KB
- 参考文档tests/fixtures/gasket-enclosed/model.json331 B
- 其他tests/fixtures/gasket-exposed/body.stl1.5 KB
- 参考文档tests/fixtures/gasket-exposed/model.json331 B
- 其他tests/fixtures/gasket-thin/body.stl1.5 KB
- 参考文档tests/fixtures/gasket-thin/model.json331 B
- 参考文档tests/fixtures/missing-generator-fab.yml329 B
- 参考文档tests/fixtures/model-invalid.json135 B
- 参考文档tests/fixtures/model-valid.json419 B
- 参考文档tests/fixtures/no-printer-fab.yml299 B
- 其他tests/fixtures/port-blocked/body.stl1.5 KB
- 参考文档tests/fixtures/port-blocked/model.json330 B
- 其他tests/fixtures/port-good/body.stl1.5 KB
- 参考文档tests/fixtures/port-good/model.json329 B
- 其他tests/fixtures/port-tower/body.stl1.4 KB
- 参考文档tests/fixtures/port-tower/model.json362 B
- 参考文档tests/fixtures/slicer/printer.json98 B
- 其他tests/fixtures/slicer/steep_overhang.stl1.6 KB
- 其他tests/fixtures/slicer/thick_wall.stl1.5 KB
- 其他tests/fixtures/slicer/thin_wall.stl1.5 KB
- 脚本tests/freecad_shim.py1.7 KB
- 其他tests/load-fab-config.bats5.7 KB
- 其他tests/readme-layout.bats1.4 KB
- 其他tests/scaffold.bats2.4 KB
- 其他tests/test_ccx_safety_wrapper.bats799 B
- 脚本tests/test_ccx_safety_wrapper.py4.6 KB
- 脚本tests/test_engine_featureful.py4.9 KB
- 其他tests/test_fab_dockerfile_pin_lint.bats2.0 KB
- 其他tests/test_fab_smoke_fixture.bats5.0 KB
- 其他tests/test_fab_vision_cli.bats6.2 KB
- 脚本tests/test_fab_vision_cli.py19.0 KB
- 其他tests/test_foam_cfd_reduce.bats793 B
- 脚本tests/test_foam_cfd_reduce.py5.1 KB
- 其他tests/test_freecad_harness.bats763 B
- 脚本tests/test_freecad_harness.py13.1 KB
- 脚本tests/test_release_gate_results.py4.2 KB
- 其他tests/test_release_gate.bats761 B
- 脚本tests/test_release_gate.py17.1 KB
- 脚本tests/test_slicer_printer_threading.py4.0 KB
- 脚本tests/test_stage_cfd_cache.py5.5 KB
- 其他tests/test_stage_cfd.bats647 B
- 脚本tests/test_stage_cfd.py13.5 KB
- 其他tests/test_stage_circuit.bats658 B
- 脚本tests/test_stage_circuit.py13.2 KB
- 其他tests/test_stage_docs.bats748 B
- 脚本tests/test_stage_docs.py13.6 KB
- 其他tests/test_stage_dust.bats649 B
- 脚本tests/test_stage_dust.py9.5 KB
- 其他tests/test_stage_fea.bats646 B
- 脚本tests/test_stage_fea.py13.9 KB
- 其他tests/test_stage_fitting.bats658 B
- 脚本tests/test_stage_fitting.py8.4 KB
- 其他tests/test_stage_gasket.bats655 B
- 脚本tests/test_stage_gasket.py9.2 KB
- 其他tests/test_stage_geometry.bats760 B
- 脚本tests/test_stage_geometry.py6.8 KB
- 其他tests/test_stage_metadata.bats760 B
- 脚本tests/test_stage_metadata.py7.8 KB
- 其他tests/test_stage_render.bats750 B
- 脚本tests/test_stage_render.py8.0 KB
- 其他tests/test_stage_slicer.bats750 B
- 脚本tests/test_stage_slicer.py8.1 KB
- 其他tests/test_stage_vision.bats750 B
- 脚本tests/test_stage_vision.py10.4 KB
- 脚本uninstall.sh2.0 KB
03 SKILL.md 正文
autospec-fab workflow
Run the full fabrication QA pipeline for a CAD-as-code project: regenerate STL artifacts from source, then gate every printable model through geometry, vacuum/pressure, gasket, airflow, slicer, FEA, CFD, render, and visual-inspection stages before release.
<!-- autospec-block:startup-self-update SKILL_NAME=autospec-fab -->
Self-update mode
If the feature-request argument matches update after trimming and lowercasing,
re-install the full autospec suite from main, show the before/after diff if the
harness exposes it, then stop. Do not run the fabrication pipeline.
Required capabilities & harness adapter
| Capability | Claude Code | OpenCode | Codex CLI | Fallback if missing |
|---|---|---|---|---|
| Subagent model tier | Tier A: opus + ultrathink |
Tier A: top-tier task + max reasoning |
Tier A: current top GPT + reasoning_effort=high |
Run inline, but keep the same report contract |
| <!-- autospec-block:harness-adapter-core --> | ||||
| Shell execution | Bash tool | shell tool | shell/apply_patch | Required for fab stage scripts |
Model tier: TIER_A for FEA/CFD analysis and vision advisory because geometry defects and pressure failures are more expensive than extra review tokens.
Harness detection
Detect the harness once at skill start:
- Claude Code:
Agentwithsubagent_typeis available.TIER_A=opus+ ultrathink.TIER_B=sonnet.
- OpenCode:
tasktool is available.TIER_A= top-tier task model + high reasoning.TIER_B= smaller-tier task model + medium reasoning.
- Codex CLI:
apply_patchis the primary edit tool.TIER_A= current top GPT +reasoning_effort=high.TIER_B= current cost-optimized Codex model +reasoning_effort=medium.
Prefer a Tier A subagent for FEA/CFD gate analysis and vision advisory pass.
If TIER_A is unavailable, silently fall back to the next available top-tier
model. If delegation is unavailable, run inline.
When to use
- When a CAD-as-code project produces printable STL and needs autonomous fabrication QA: geometry validation, vacuum/pressure safety, slicer wall checks, FEA, CFD, render, and vision-advisory before release.
- When the repo opts in via
.autospec/fab.ymland you need a repeatable, gated pipeline that blocks on geometry defects and surfaces visual findings as non-blocking advisories. - When implementing a new parametric feature (
area:fab/autospec:fab-flowissue) and you need the full-suite gate (clean regen → release-gate → unittest).
When not to use
- Do not use against repos without
.autospec/fab.yml— the skill exits withcode_health:fab_no_contractrather than guessing at STL locations. - Do not use when the CAD backend is not FreeCAD-scripted — the harness lib
(
freecadcmd) will not resolve and stages will error. - Do not use to hand-edit generated artifacts (
build/, BOM.md, PDFs, renders, section images, contact sheets) — theNO_HANDEDIT_GENERATEDguard instage-docs.pywill detect and reject such edits.
Composition map
Stage scripts and the release-gate engine live under skills/autospec-fab/scripts/
and install into ~/.autospec/scripts/ via install.sh. Real stage scripts land
in child issues #1222–#1234; this scaffold commits a scripts/.gitkeep placeholder.
| Component | Script / owner | Purpose |
|---|---|---|
stage-geometry.py |
#1222 | Reload STL + watertight + single-body connectivity (trimesh) |
stage-metadata.py |
#1223 | Schema-validate per-model metadata sidecar |
stage-vacuum-fitting.py |
#1224 | NPT access + ≥5 mm clearance + tower rejection |
stage-vacuum-circuit.py |
#1225 | Inlet→gasket reachability + isolation + no-relief |
stage-gasket.py |
#1226 | ≥5 mm wall + seal-face continuity |
stage-dust-airflow.py |
#1227 | Full-size openings + monotonic area + reject gate slots/PVC |
stage-slicer.py |
#1228 | Min wall + overhang-angle + section QA |
stage-fea.py |
#1229 | CalculiX structural FEA, anisotropic, geometry-hash cached |
stage-cfd.py |
#1230 | OpenFOAM fluid/airflow CFD, geometry-hash cached |
stage-render.py |
#1231 | 16-view FreeCAD headless render + contact sheet |
stage-vision.py |
#1232 | LLM-vision advisory pass (always warn/pass, never fail) |
stage-docs.py |
#1233 | Docs/PDF sync + NO_HANDEDIT_GENERATED guard |
stl-release-gate.py |
#1234 | Engine: sequence stages → .autospec/fab/release-gate.json |
| FreeCAD harness lib | #1221 | freecadcmd open/section/export/render helpers |
External solvers (ccx, OpenFOAM simpleFoam/blockMesh, freecadcmd, vision
CLI) are PATH-resolved so $TMP/bin mocks work in tests.
STL Modeling Rules
Gateable rules (deterministic — stages 1–12 above + FEA/CFD block on violation)
- Watertight: every exported body passes
trimesh.is_watertight. - Single-body connectivity:
mesh.split()yields the expected body count (default 1); disconnected bodies are a hard reject (code_health:disconnected_bodies). - NPT access: every NPT pilot preserves tap access, fitting-body clearance,
entry relief, and usable thread depth. Narrow towers/ears/bosses around NPT ports
are rejected (
code_health:blocked_npt). - Vacuum fitting clearance: every fitting/hose/socket/port has ≥5 mm radial free clearance unless a larger connector envelope is documented.
- Vacuum circuit reachability: graph reachability proves every intended inlet
connects to each intended gasket/cavity/port; isolated circuits stay isolated
unless declared shared-input. No relief valves, bleed ports, or restrictors on
low-flow pump models (
code_health:disconnected_flow). - Gasket wall: every exposed gasket groove has ≥5 mm surrounding plastic
outside the groove. Exposed gasket sides are a hard reject
(
code_health:exposed_gasket). - Dust/airflow openings: full-size unobstructed hose/duct/socket openings; monotonic cross-section; reject blocked ports, disconnected ducts, printed gate slots, or PVC used as the printed airflow duct.
- Slicer walls: min wall = printer
min_perimeters × nozzle_width; overhang ≤max_overhang_deg; section QA at key planes. - FEA safety factor: every load-critical part holds its intended load with the
configured safety factor using material + print-orientation anisotropy from the
metadata sidecar (
code_health:fea_below_safety). - CFD targets: every flow-critical part meets pressure-drop / velocity /
no-stagnation targets (
code_health:cfd_target_miss).
Judgment rules (LLM review lens — advisory, never blocking gate)
- Prefer simple printable geometry over decorative forms.
- Keep vacuum/pressure parts conservative; optimize material only when fit/strength/sealing/tap-access/QA stay protected.
- Remove material from non-pressure accessories first (storage, brackets, covers, trays).
- After unioning caps/ribs/reinforcements/brackets, recut/reverify affected ports so bores/channels/gasket cavities are not refilled or clipped.
Change workflow
- Regression test first: any geometry-affecting change requires adding or updating a focused regression test before touching source.
- Smallest safe change: make the minimal modeling/source change that fixes the issue without disturbing unrelated geometry.
- Never hand-edit generated artifacts:
build/, BOM.md, PDFs, renders, section images, and contact sheets are all generated — theNO_HANDEDIT_GENERATEDguard detects and rejects hand edits. - Update hand-maintained docs (MANIFEST.md, README.md, FITTINGS_AND_SCREWS.md) when paths, dimensions, procedures, or rules change.
- Clean full catalog regen:
rm -rf build && .venv/bin/python src/generate.py(or thegeneratoroverride in.autospec/fab.yml). - Unit suite:
.venv/bin/python -m unittest discover -s tests— passes only when unittest reports OK. A known negative test prints afake.stlmetadata failure; ignore that line, honor the OK summary. - Release gate: run
stl-release-gate.py; release only when every stage passes (FEA/CFD included) and the vision pass has no un-triaged blocking-looking finding.
Release-gate / phase contract (stub — full stage prose lands in #1234)
The engine stl-release-gate.py sequences stages in order and aggregates
per-stage JSON fragments into .autospec/fab/release-gate.json. Each stage script
accepts a uniform CLI:
<script> --in <stl|dir> --model <metadata.json> --out <release-gate-fragment.json>
Exit non-zero only on harness error; gate pass/fail is expressed in the fragment
status field, not the exit code.
Stage order and owners:
- geometry (#1222) — reload + watertight + single-body connectivity
- metadata (#1223) — schema-validate sidecar
- vacuum-fitting (#1224) — NPT access + clearance + tower rejection
- vacuum-circuit (#1225) — inlet→gasket reachability + isolation + no-relief
- gasket (#1226) — ≥5 mm wall + seal-face continuity
- dust-airflow (#1227) — full-size openings + monotonic area
- slicer (#1228) — min wall + overhang + section QA
- fea (#1229) — CalculiX, anisotropic, geometry-hash cached
- cfd (#1230) — OpenFOAM, geometry-hash cached
- render (#1231) — 16-view FreeCAD headless render + contact sheet
- vision (#1232) — LLM-vision advisory (always warn/pass, never fail)
- docs (#1233) — docs/PDF sync + NO_HANDEDIT_GENERATED guard
Hard reject on: blocked NPT access (blocked_npt), exposed gasket sides
(exposed_gasket), disconnected flow (disconnected_flow), non-watertight mesh
(non_watertight), disconnected bodies (disconnected_bodies), FEA below safety
factor (fea_below_safety), or CFD target miss (cfd_target_miss).
Geometry gates block; the vision stage only advises — it never emits a blocking status even when it observes a potential defect.
Stop mode
If the request is exactly stop or stop plus --<word> flags after
normalization, dispatch to:
bash "${AUTOSPEC_SCRIPTS_DIR:-$HOME/.autospec/scripts}/autospec-stop.sh" <args>
Print the helper output and stop. Do not run the fabrication pipeline.
Harness-aware handoff
Loop dispatch uses lib/autospec-harness-detect.sh to resolve the active AI
harness and pick the canonical /autospec --autonomous invocation form:
- Claude Code →
claude "/autospec" "--autonomous" "$PROMPT". - Codex CLI →
codex exec --skip-git-repo-check "/autospec --autonomous $PROMPT" </dev/null(the </dev/null closes stdin — without it codex exec hangs on an open stdin, issue #3380). - OpenCode →
opencode "/autospec" "--autonomous" "$PROMPT"(best-effort).
Detection order: AUTOSPEC_HANDOFF_DISPATCHER_KIND env override → skill-mount
probe → PATH probe. Missing dispatcher exits 3 with
code_health:loop_handoff_no_dispatcher_for_harness.
04 同仓库更多 Skills
trio-pass-skill
暂无简介
duo-pass-skill
暂无简介
duo-divergence-skill
暂无简介
autospec
Use when the user wants to ship a feature end-to-end across multiple commits — bootstraps repo if missing, brainstorms a design spec, decomposes into linked GitHub issues, or splits an existing spec into issues, then runs an autonomous implementation loop with auto-merge.
autospec-upgrade
Use when the user wants to upgrade an Angular, Next.js, or React project to the latest official versions safely — by locking observable behavior before touching versions, upgrading one major at a time with official codemods, and gating completion on mutation score rather than coverage theater.
autospec-ui-audit
Use when a React Router application needs a deterministic whole-site route inventory before UI, UX, navigation, or evidence auditing begins.