Onshape FeatureScript Generator
name: onshape-featurescript
by bryko · published 2026-04-01
$ claw add gh:bryko/bryko-onshape-featurescript---
name: onshape-featurescript
description">Generate Onshape FeatureScript code for custom CAD features and parametric parts. Specializes in dust collection fittings library (wyes, elbows, adapters, crosses). Use when user asks to: (1) create FS features (gears, fittings, brushes), (2) modify existing FS, (3) debug FS errors, (4) build libraries with consistent patterns (enums, shells, labels). Patterns for Z-axis fittings, wrapped labels, safe unions/shells. Triggers: 'Onshape FS for X', 'FeatureScript wye/elbow', 'dust fitting'.</description>
---
# Onshape FeatureScript Generator
Quick Start
Analyze request → Match pattern → Gen FS code → Validate logic.
**Core Workflow**:
1. **Precondition**: Enums/lengths/reals w/ bounds.
2. **Body**: Sketches → Extrudes → Booleans → Shell → Wrap/Thicken labels.
3. **Pitfalls**: qOwnedByBody(finalBody), if/else (no ternary lengths), cylinder(coordSystem).
Key Patterns (Memorize)
```
export enum AlignmentStyle { Centered, Tangent, Offset };
if (definition.alignment == AlignmentStyle.Offset) { isLength(def.offsetDistance...); }
```
```
var capFaces = qFacesParallelToDirection(qOwnedByBody(finalBody, EntityType.FACE), vector(0,1,0));
```
```
qUnion([qCreatedBy(id+"inlet", EntityType.BODY), ...]);
```
Dust Fittings Lib
Z-axis: Inlet Z=0 (-Z), Outlet Z=trans (+Z), Branch +X.
See [FITTINGS.md](references/fittings.md) for full spec/pitfalls.
Resources
Gen code → User pastes to Onshape FS editor.
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...