agentcad-cli 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/PKG-INFO +25 -28
  2. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/README.md +24 -27
  3. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/pyproject.toml +1 -1
  4. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/__init__.py +1 -1
  5. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/model/README.md +30 -1
  6. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/CLAUDE.md +124 -0
  7. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/cad-tdd.md +83 -0
  8. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/concept-design.md +88 -0
  9. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/contract-design.md +157 -0
  10. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/debugging.md +73 -0
  11. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/design-quality-review.md +74 -0
  12. agentcad_cli-0.1.4/src/agentcad/_templates/workspace/references/discovery.md +61 -0
  13. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/references/validation-strategy.md +30 -6
  14. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/checks/relations.py +30 -9
  15. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/cli.py +7 -23
  16. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/geometry.py +25 -7
  17. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/review.py +73 -21
  18. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/validate.py +1 -1
  19. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/PKG-INFO +25 -28
  20. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/SOURCES.txt +6 -0
  21. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_checks_relations.py +36 -0
  22. agentcad_cli-0.1.4/tests/test_cli.py +164 -0
  23. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_geometry.py +30 -0
  24. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_precheck_review.py +33 -4
  25. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_workspace.py +6 -0
  26. agentcad_cli-0.1.2/src/agentcad/_templates/workspace/CLAUDE.md +0 -421
  27. agentcad_cli-0.1.2/tests/test_cli.py +0 -138
  28. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/setup.cfg +0 -0
  29. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/__main__.py +0 -0
  30. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/__init__.py +0 -0
  31. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/model/design.json +0 -0
  32. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/model/params.json +0 -0
  33. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/model/part.py +0 -0
  34. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/cadproject.json +0 -0
  35. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/models/.gitkeep +0 -0
  36. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/references/build123d-guide.md +0 -0
  37. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/references/images/.gitkeep +0 -0
  38. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/_templates/workspace/references/notes.md +0 -0
  39. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/checks/__init__.py +0 -0
  40. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/checks/mesh.py +0 -0
  41. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/checks/section.py +0 -0
  42. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/contract.py +0 -0
  43. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/inspect.py +0 -0
  44. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/jsonio.py +0 -0
  45. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/measure.py +0 -0
  46. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/payloads.py +0 -0
  47. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/precheck.py +0 -0
  48. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/probe.py +0 -0
  49. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/render.py +0 -0
  50. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/report.py +0 -0
  51. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/runner.py +0 -0
  52. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/section.py +0 -0
  53. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/stl.py +0 -0
  54. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/templates.py +0 -0
  55. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad/workspace.py +0 -0
  56. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/dependency_links.txt +0 -0
  57. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/entry_points.txt +0 -0
  58. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/requires.txt +0 -0
  59. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/src/agentcad_cli.egg-info/top_level.txt +0 -0
  60. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_checks_section.py +0 -0
  61. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_deliver.py +0 -0
  62. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_jsonio.py +0 -0
  63. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_probe.py +0 -0
  64. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_render.py +0 -0
  65. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_runner.py +0 -0
  66. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_section.py +0 -0
  67. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_stale.py +0 -0
  68. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_stl.py +0 -0
  69. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_validate.py +0 -0
  70. {agentcad_cli-0.1.2 → agentcad_cli-0.1.4}/tests/test_weak_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentcad-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Agent-first CAD workflow runtime
5
5
  Author: AgentCAD contributors
6
6
  License-Expression: MIT
@@ -21,15 +21,15 @@ so the agent can iterate on CAD models with measurable feedback instead of
21
21
  visual intuition.
22
22
 
23
23
  ```text
24
- design contract -> precheck -> params/source -> build
25
- -> measure -> render -> validate -> review -> deliver
24
+ discovery -> concept -> design contract -> precheck -> params/source -> build
25
+ -> measure -> render -> validate -> review -> quality review -> deliver
26
26
  ```
27
27
 
28
28
  ## What's in the box
29
29
 
30
30
  | Stage | Command | Purpose |
31
31
  |---|---|---|
32
- | Init | `agentcad init [--model <name>]` | Initialize workspace scaffold (optionally create first model) |
32
+ | Init | `agentcad init <workspace> [--model <name>]` | Initialize workspace scaffold (optionally create first model) |
33
33
  | Scaffold | `agentcad new <model>` | Create model folder inside an existing workspace |
34
34
  | Sync | `agentcad sync` | Refresh workspace scaffold from latest templates |
35
35
  | Precheck | `agentcad precheck <model>` | Solve `design.json` statically (schema, feature coverage, `min_clearance`) **before** part.py is written |
@@ -38,14 +38,13 @@ design contract -> precheck -> params/source -> build
38
38
  | Render | `agentcad render <model>` | Iso/front/top/side/back SVG previews + Z/X/Y cross-section SVGs |
39
39
  | Probe | `agentcad probe <model>` | Cross-section diameter / bbox / void at specified Z, X, Y; `--scan` to discover step changes |
40
40
  | Inspect | `agentcad inspect <model>` | Three-axis scan + automatic section SVGs + suggested probes |
41
- | Validate | `agentcad validate <model>` | Build + measure + render + design checks + feature coverage; auto-emits debug SVGs on failure |
42
- | Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix and must-view SVG list |
41
+ | Validate | `agentcad validate <model>` | Build + measure + render all orthographic previews + design checks + feature coverage; auto-emits debug SVGs on failure |
42
+ | Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix, hole-access enforcement, and must-view SVG list |
43
43
  | Deliver | `agentcad deliver <model>` | Delivery manifest |
44
44
  | Report | `agentcad report <model>` | Markdown summary of validation result |
45
45
 
46
- Every command prints JSON by default for stable machine-readable output;
47
- add `--text` for human-readable output. Failures include `stage`,
48
- `error.type`, and `error.message`.
46
+ Every command prints stable machine-readable JSON output. Failures include
47
+ `stage`, `error.type`, and `error.message`.
49
48
 
50
49
  ## Validation check types
51
50
 
@@ -62,7 +61,7 @@ add `--text` for human-readable output. Failures include `stage`,
62
61
  | `diameter_decreases_along_z` | post-build | Monotonicity for tapers / lead-ins |
63
62
  | `volume_range` | post-build | Volume sanity bounds |
64
63
  | `min_clearance` | **design-time + post-build** | Pure-shape edge-to-edge clearance between two declared shapes (no STL required) |
65
- | `hole_accessibility` | post-build | Annular clearance around a hole at the working plane |
64
+ | `hole_accessibility` | post-build | Annular clearance around a hole at the working plane; supports X/Y/Z access axes |
66
65
  | `min_wall_thickness` | post-build | Minimum point-pair distance inside a defined region |
67
66
  | `feature_position` | post-build | Assert a 3D point is `solid` or `void` |
68
67
  | `feature_coverage` | automatic | Every declared feature must reference at least one check |
@@ -71,6 +70,11 @@ The four "geometric relation" checks (last block) close the historical gap
71
70
  where `inner_diameter_at_z` would happily report a 4.5 mm hole that was
72
71
  half-covered by an adjacent wall.
73
72
 
73
+ `agentcad review` now treats missing hole-access checks as blocking when holes
74
+ are declared, and always requires iso/front/top/side/back previews. The side
75
+ view requirement came from a real e2e failure where a retaining lip existed in
76
+ the contract but was effectively floating in side projection.
77
+
74
78
  ## Quick start
75
79
 
76
80
  ```bash
@@ -81,20 +85,12 @@ agentcad --help
81
85
  Create a workspace and start modeling:
82
86
 
83
87
  ```bash
84
- mkdir my-agentcad-project
88
+ agentcad init my-agentcad-project --model demo
85
89
  cd my-agentcad-project
86
- agentcad init --model demo
90
+ claude
87
91
  ```
88
92
 
89
- Then open this directory in Claude Code / Cursor and continue from
90
- `models/demo/part.py`.
91
-
92
- `--project` is optional. Use it only when you run commands outside the
93
- workspace root, for example:
94
-
95
- ```bash
96
- agentcad init --model demo --project /tmp/agentcad-demo
97
- ```
93
+ Then ask Claude to design your target model (for example: "Design an adapter from an 8025 fan to a round duct") — it will read `CLAUDE.md` in this workspace and follow the workflow automatically.
98
94
 
99
95
  For local development:
100
96
 
@@ -106,16 +102,16 @@ uv run agentcad --help
106
102
  ## Quick example
107
103
 
108
104
  ```bash
109
- agentcad init --model bracket --project /tmp/my-cad-project
110
- cd /tmp/my-cad-project
105
+ agentcad init my-cad-project --model bracket
106
+ cd my-cad-project
111
107
 
112
- # 1. Design-time: solve the contract before writing geometry
108
+ # 1. Design-time: choose the concept, then solve the contract before geometry
113
109
  agentcad precheck bracket
114
110
 
115
111
  # 2. Implement part.py, then run the post-build pipeline
116
112
  agentcad validate bracket
117
113
 
118
- # 3. Pre-delivery review (relations matrix + must-view SVGs)
114
+ # 3. Pre-delivery review (relations matrix + must-view SVGs), then quality review
119
115
  agentcad review bracket
120
116
 
121
117
  # 4. Deliver
@@ -133,13 +129,14 @@ common-error catalog live in `AGENTS.md`, `CLAUDE.md`, and `references/`
133
129
  | `examples/fan-adapter-8025/` | Two validated models: a fan-to-duct adapter and a magnetic outlet plate |
134
130
  | `examples/iphone15pro-case/` | Real-world phone case with multi-cutouts + section validation |
135
131
  | `examples/e2e-test/` | Sub-agent end-to-end test: design → precheck → build → validate → review on a mounting bracket |
132
+ | `examples/e2e-real-cable-hook/` | Real e2e surface-mounted cable hook with concept + quality review artifacts |
136
133
 
137
134
  Re-run any example:
138
135
 
139
136
  ```bash
140
137
  cd examples/fan-adapter-8025
141
- uv run agentcad validate fan_duct_adapter_8025
142
- uv run agentcad review fan_duct_adapter_8025
138
+ agentcad validate fan_duct_adapter_8025
139
+ agentcad review fan_duct_adapter_8025
143
140
  ```
144
141
 
145
142
  ## Tests
@@ -148,7 +145,7 @@ uv run agentcad review fan_duct_adapter_8025
148
145
  uv run pytest -v
149
146
  ```
150
147
 
151
- 125 tests at last count, covering CLI dispatch, workspace scaffolding, STL
148
+ 144 tests at last count, covering CLI dispatch, workspace scaffolding, STL
152
149
  reading and measurement, section extraction and SVG rendering, JSON IO,
153
150
  post-build validation checks, weak-check warnings, stale build detection,
154
151
  geometric primitives, and `precheck` / `review` integration.
@@ -9,15 +9,15 @@ so the agent can iterate on CAD models with measurable feedback instead of
9
9
  visual intuition.
10
10
 
11
11
  ```text
12
- design contract -> precheck -> params/source -> build
13
- -> measure -> render -> validate -> review -> deliver
12
+ discovery -> concept -> design contract -> precheck -> params/source -> build
13
+ -> measure -> render -> validate -> review -> quality review -> deliver
14
14
  ```
15
15
 
16
16
  ## What's in the box
17
17
 
18
18
  | Stage | Command | Purpose |
19
19
  |---|---|---|
20
- | Init | `agentcad init [--model <name>]` | Initialize workspace scaffold (optionally create first model) |
20
+ | Init | `agentcad init <workspace> [--model <name>]` | Initialize workspace scaffold (optionally create first model) |
21
21
  | Scaffold | `agentcad new <model>` | Create model folder inside an existing workspace |
22
22
  | Sync | `agentcad sync` | Refresh workspace scaffold from latest templates |
23
23
  | Precheck | `agentcad precheck <model>` | Solve `design.json` statically (schema, feature coverage, `min_clearance`) **before** part.py is written |
@@ -26,14 +26,13 @@ design contract -> precheck -> params/source -> build
26
26
  | Render | `agentcad render <model>` | Iso/front/top/side/back SVG previews + Z/X/Y cross-section SVGs |
27
27
  | Probe | `agentcad probe <model>` | Cross-section diameter / bbox / void at specified Z, X, Y; `--scan` to discover step changes |
28
28
  | Inspect | `agentcad inspect <model>` | Three-axis scan + automatic section SVGs + suggested probes |
29
- | Validate | `agentcad validate <model>` | Build + measure + render + design checks + feature coverage; auto-emits debug SVGs on failure |
30
- | Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix and must-view SVG list |
29
+ | Validate | `agentcad validate <model>` | Build + measure + render all orthographic previews + design checks + feature coverage; auto-emits debug SVGs on failure |
30
+ | Review | `agentcad review <model>` | Pre-delivery checklist with pairwise relations matrix, hole-access enforcement, and must-view SVG list |
31
31
  | Deliver | `agentcad deliver <model>` | Delivery manifest |
32
32
  | Report | `agentcad report <model>` | Markdown summary of validation result |
33
33
 
34
- Every command prints JSON by default for stable machine-readable output;
35
- add `--text` for human-readable output. Failures include `stage`,
36
- `error.type`, and `error.message`.
34
+ Every command prints stable machine-readable JSON output. Failures include
35
+ `stage`, `error.type`, and `error.message`.
37
36
 
38
37
  ## Validation check types
39
38
 
@@ -50,7 +49,7 @@ add `--text` for human-readable output. Failures include `stage`,
50
49
  | `diameter_decreases_along_z` | post-build | Monotonicity for tapers / lead-ins |
51
50
  | `volume_range` | post-build | Volume sanity bounds |
52
51
  | `min_clearance` | **design-time + post-build** | Pure-shape edge-to-edge clearance between two declared shapes (no STL required) |
53
- | `hole_accessibility` | post-build | Annular clearance around a hole at the working plane |
52
+ | `hole_accessibility` | post-build | Annular clearance around a hole at the working plane; supports X/Y/Z access axes |
54
53
  | `min_wall_thickness` | post-build | Minimum point-pair distance inside a defined region |
55
54
  | `feature_position` | post-build | Assert a 3D point is `solid` or `void` |
56
55
  | `feature_coverage` | automatic | Every declared feature must reference at least one check |
@@ -59,6 +58,11 @@ The four "geometric relation" checks (last block) close the historical gap
59
58
  where `inner_diameter_at_z` would happily report a 4.5 mm hole that was
60
59
  half-covered by an adjacent wall.
61
60
 
61
+ `agentcad review` now treats missing hole-access checks as blocking when holes
62
+ are declared, and always requires iso/front/top/side/back previews. The side
63
+ view requirement came from a real e2e failure where a retaining lip existed in
64
+ the contract but was effectively floating in side projection.
65
+
62
66
  ## Quick start
63
67
 
64
68
  ```bash
@@ -69,20 +73,12 @@ agentcad --help
69
73
  Create a workspace and start modeling:
70
74
 
71
75
  ```bash
72
- mkdir my-agentcad-project
76
+ agentcad init my-agentcad-project --model demo
73
77
  cd my-agentcad-project
74
- agentcad init --model demo
78
+ claude
75
79
  ```
76
80
 
77
- Then open this directory in Claude Code / Cursor and continue from
78
- `models/demo/part.py`.
79
-
80
- `--project` is optional. Use it only when you run commands outside the
81
- workspace root, for example:
82
-
83
- ```bash
84
- agentcad init --model demo --project /tmp/agentcad-demo
85
- ```
81
+ Then ask Claude to design your target model (for example: "Design an adapter from an 8025 fan to a round duct") — it will read `CLAUDE.md` in this workspace and follow the workflow automatically.
86
82
 
87
83
  For local development:
88
84
 
@@ -94,16 +90,16 @@ uv run agentcad --help
94
90
  ## Quick example
95
91
 
96
92
  ```bash
97
- agentcad init --model bracket --project /tmp/my-cad-project
98
- cd /tmp/my-cad-project
93
+ agentcad init my-cad-project --model bracket
94
+ cd my-cad-project
99
95
 
100
- # 1. Design-time: solve the contract before writing geometry
96
+ # 1. Design-time: choose the concept, then solve the contract before geometry
101
97
  agentcad precheck bracket
102
98
 
103
99
  # 2. Implement part.py, then run the post-build pipeline
104
100
  agentcad validate bracket
105
101
 
106
- # 3. Pre-delivery review (relations matrix + must-view SVGs)
102
+ # 3. Pre-delivery review (relations matrix + must-view SVGs), then quality review
107
103
  agentcad review bracket
108
104
 
109
105
  # 4. Deliver
@@ -121,13 +117,14 @@ common-error catalog live in `AGENTS.md`, `CLAUDE.md`, and `references/`
121
117
  | `examples/fan-adapter-8025/` | Two validated models: a fan-to-duct adapter and a magnetic outlet plate |
122
118
  | `examples/iphone15pro-case/` | Real-world phone case with multi-cutouts + section validation |
123
119
  | `examples/e2e-test/` | Sub-agent end-to-end test: design → precheck → build → validate → review on a mounting bracket |
120
+ | `examples/e2e-real-cable-hook/` | Real e2e surface-mounted cable hook with concept + quality review artifacts |
124
121
 
125
122
  Re-run any example:
126
123
 
127
124
  ```bash
128
125
  cd examples/fan-adapter-8025
129
- uv run agentcad validate fan_duct_adapter_8025
130
- uv run agentcad review fan_duct_adapter_8025
126
+ agentcad validate fan_duct_adapter_8025
127
+ agentcad review fan_duct_adapter_8025
131
128
  ```
132
129
 
133
130
  ## Tests
@@ -136,7 +133,7 @@ uv run agentcad review fan_duct_adapter_8025
136
133
  uv run pytest -v
137
134
  ```
138
135
 
139
- 125 tests at last count, covering CLI dispatch, workspace scaffolding, STL
136
+ 144 tests at last count, covering CLI dispatch, workspace scaffolding, STL
140
137
  reading and measurement, section extraction and SVG rendering, JSON IO,
141
138
  post-build validation checks, weak-check warnings, stale build detection,
142
139
  geometric primitives, and `precheck` / `review` integration.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agentcad-cli"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  description = "Agent-first CAD workflow runtime"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11,<3.13"
@@ -1,3 +1,3 @@
1
1
  """Agent-first CAD workflow runtime."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.4"
@@ -20,6 +20,16 @@ agentcad review {name} # 5. pre-delivery checklist + relations matrix
20
20
  agentcad deliver {name} # 6. write delivery manifest
21
21
  ```
22
22
 
23
+ Before writing `design.json`, run the Discovery Gate in
24
+ `../../references/discovery.md`. If mating dimensions, manufacturing target,
25
+ tolerances, orientation, or topology choices are unclear, ask 2-3 focused
26
+ questions with concrete options and wait for the user's answer.
27
+
28
+ For non-trivial parts, write a short `concept.md` using
29
+ `../../references/concept-design.md` before committing `design.json`. After
30
+ `validate` and `review` pass, apply
31
+ `../../references/design-quality-review.md` before delivery.
32
+
23
33
  ## Common errors to design *against*
24
34
 
25
35
  For every hole declared in `params.json`, also declare a `min_clearance` check
@@ -40,7 +50,26 @@ wall" bug at design time, before any code is written.
40
50
  }
41
51
  ```
42
52
 
43
- See `../references/validation-strategy.md` for a complete catalog of design
53
+ Also declare a `hole_accessibility` check for the real approach plane. For a
54
+ Y-axis screw driven from the front of a vertical plate, the center is `[x, z]`:
55
+
56
+ ```json
57
+ {
58
+ "id": "left_hole_tool_access",
59
+ "type": "hole_accessibility",
60
+ "axis": "y",
61
+ "y": -10.0,
62
+ "center": [hole_x, hole_z],
63
+ "hole_diameter": 4.5,
64
+ "clearance_diameter": 12.0
65
+ }
66
+ ```
67
+
68
+ For attached load-bearing features, add a connection/root check. A retaining
69
+ lip, rib, boss, tab, arm, or flange needs proof that the base interface exists,
70
+ not only proof that the feature body exists somewhere.
71
+
72
+ See `../../references/validation-strategy.md` for a complete catalog of design
44
73
  errors and the check types that catch them.
45
74
 
46
75
  Generated artifacts go to `outputs/`.
@@ -0,0 +1,124 @@
1
+ # AgentCAD Workspace
2
+
3
+ You are working in an AgentCAD workspace. Your job is to create and refine CAD
4
+ models using the `agentcad` CLI and build123d geometry library.
5
+
6
+ ## Workflow (13 stages, do not skip)
7
+
8
+ 1. **Understand**: read the user request, identify every feature, and pass the
9
+ Discovery Gate in `references/discovery.md`.
10
+ 2. **Concept**: when the model is non-trivial, compare 2-3 topology concepts
11
+ using `references/concept-design.md`. Commit to one concept before writing
12
+ the contract.
13
+ 3. **Contract**: write `models/<name>/design.json` with features and checks.
14
+ Load `references/contract-design.md` before editing the contract.
15
+ 4. **Params**: put tunable dimensions in `models/<name>/params.json`.
16
+ 5. **Precheck**: run `agentcad precheck <name>`. Do not write `part.py` while
17
+ precheck fails.
18
+ 6. **Implement**: write `models/<name>/part.py` using build123d. The final
19
+ object must be assigned to global variable `result`.
20
+ 7. **Build**: run `agentcad build <name>`.
21
+ 8. **Measure**: run `agentcad measure <name>`.
22
+ 9. **Render**: run `agentcad render <name> --views iso,front,top,side,back`.
23
+ 10. **Validate**: run `agentcad validate <name>`. It must pass.
24
+ 11. **Review**: run `agentcad review <name>` and inspect every `must_view`
25
+ artifact.
26
+ 12. **Quality Review**: apply `references/design-quality-review.md`. If the
27
+ model is merely valid but not good, revise the concept, contract, or
28
+ geometry and repeat validation.
29
+ 13. **Deliver**: run `agentcad deliver <name>` only after review and quality
30
+ review pass.
31
+
32
+ Do not manually export STEP/STL from `part.py`. The runner owns all exports.
33
+
34
+ ## Stage References
35
+
36
+ Read only the references needed for the current stage.
37
+
38
+ | Stage | Reference |
39
+ |---|---|
40
+ | Requirements, ambiguity, user choices | `references/discovery.md` |
41
+ | Topology options, tradeoffs, concept choice | `references/concept-design.md` |
42
+ | `design.json`, feature coverage, check selection | `references/contract-design.md` |
43
+ | Checks-first implementation loop | `references/cad-tdd.md` |
44
+ | Check details, tolerances, probe usage, validation failures | `references/validation-strategy.md` |
45
+ | build123d API patterns and geometry construction | `references/build123d-guide.md` |
46
+ | Build/debug triage and external docs lookup | `references/debugging.md` |
47
+ | Post-validation design quality critique | `references/design-quality-review.md` |
48
+
49
+ ## Hard Rules
50
+
51
+ - Units are millimeters unless the user explicitly says otherwise.
52
+ - Coordinate convention: +X right, +Y back, +Z up.
53
+ - Do not write generated artifacts outside `models/<name>/outputs/`.
54
+ - Treat `design.json` as the design contract: source of truth for what the
55
+ model should be.
56
+ - Treat CLI JSON output as the source of truth for what the model actually is.
57
+ - Do not claim a model is complete until `agentcad validate` and
58
+ `agentcad review` both pass and the quality review has no blocking issues.
59
+ - Every requested feature must have at least one validation check.
60
+ - bbox + watertight alone are not sufficient: they pass even when features are
61
+ missing or hidden.
62
+ - Every hole needs a `min_clearance` check for each surrounding wall, adjacent
63
+ solid, or relevant edge.
64
+ - Every hole also needs a `hole_accessibility` check on the real tool/fastener
65
+ approach plane.
66
+ - Every load-bearing attached feature needs at least one interface/root check
67
+ in addition to a body-exists check. A lip, rib, boss, tab, wall, hook, or
68
+ bracket arm that only touches at an edge is a blocker even if validate passes.
69
+ - Inspect side, front, top, back, and iso previews. A feature that looks
70
+ detached in any orthographic view is not deliverable until the contract
71
+ contains a check that would catch that failure.
72
+ - Reason edge-to-edge, never center-to-face.
73
+
74
+ ## Workspace Layout
75
+
76
+ ```text
77
+ models/<name>/
78
+ design.json Feature contract: features list + checks
79
+ params.json Tunable dimensions
80
+ part.py build123d geometry (assign to `result`)
81
+ metadata.json (auto-generated if part.py defines `metadata`)
82
+ outputs/
83
+ build.json Build report
84
+ geometry.json STL measurement report
85
+ validation.json Validation results
86
+ precheck.json Static contract report
87
+ review.json Pre-delivery review report
88
+ deliverable.json Delivery manifest
89
+ preview.iso.svg SVG preview
90
+ <name>.step STEP export
91
+ <name>.stl STL export
92
+ ```
93
+
94
+ ## CLI Quick Reference
95
+
96
+ ```bash
97
+ agentcad init <workspace> [--model <model>]
98
+ agentcad new <model>
99
+ agentcad precheck <model>
100
+ agentcad build <model>
101
+ agentcad build <model> --force
102
+ agentcad measure <model>
103
+ agentcad render <model>
104
+ agentcad render <model> --views iso,front,top,side,back
105
+ agentcad validate <model>
106
+ agentcad review <model>
107
+ agentcad deliver <model>
108
+ agentcad probe <model> --z <z>
109
+ agentcad probe <model> --z <z> "--center=cx,cy"
110
+ agentcad probe <model> --z <z> --region x0,y0,x1,y1
111
+ agentcad probe <model> --x <x>
112
+ agentcad probe <model> --y <y>
113
+ agentcad probe <model> --scan
114
+ agentcad probe <model> --scan --axis x
115
+ agentcad probe <model> --scan --axis y
116
+ agentcad render <model> --section-z <z>
117
+ agentcad render <model> --section-x <x>
118
+ agentcad render <model> --section-y <y>
119
+ agentcad inspect <model>
120
+ agentcad report <model>
121
+ ```
122
+
123
+ All commands output machine-readable JSON by default. Read the JSON before
124
+ deciding the next action.
@@ -0,0 +1,83 @@
1
+ # CAD TDD
2
+
3
+ Use this reference before writing `part.py`.
4
+
5
+ Every feature must have a check that can pass or fail before the final geometry
6
+ is written. The order is not negotiable: checks first, geometry second.
7
+
8
+ ## Per-Feature Planning Table
9
+
10
+ Fill this table before implementing a feature:
11
+
12
+ | Feature | Shape | Center (cx, cy) | Z slice | Expected value | Check type |
13
+ |---|---|---|---|---|---|
14
+ | Outer shell | rectangle | - | - | [w, h, t] | `bbox_size` |
15
+ | Camera hole | W x H rectangle | (cx, cy) | wall_back / 2 | min(W, H) | `inner_diameter_at_z` |
16
+ | Inner cavity | void | center | wall_back + 2 | `void` | `section_bbox_at_z` |
17
+ | USB-C port | W x H rectangle | (0, y) | z_mid | min(W, H) | `inner_diameter_at_z` |
18
+
19
+ If you cannot fill in all columns for a feature, ask a focused question or
20
+ revise the contract before coding. Do not start `part.py` while a feature has
21
+ no measurable check strategy.
22
+
23
+ ## Red Phase
24
+
25
+ After finishing `design.json`, write a minimal `part.py` that produces the
26
+ outer envelope only, no internal features. Then run:
27
+
28
+ ```bash
29
+ agentcad validate <model>
30
+ ```
31
+
32
+ Expected outcome:
33
+
34
+ - `bbox_size` passes.
35
+ - Section, diameter, clearance, or position checks for missing internal
36
+ features fail.
37
+
38
+ If a section check passes while its feature is missing, the check is wrong.
39
+ Return to the planning table and redesign it.
40
+
41
+ ## Green Phase
42
+
43
+ Implement one feature at a time and rerun `agentcad validate` immediately.
44
+ Watch the matching check flip from failing to passing. Do not batch multiple
45
+ features before validating.
46
+
47
+ ## Feature To Check Cheat Sheet
48
+
49
+ | Feature type | Check type | Z slice | Expected value | Tolerance |
50
+ |---|---|---|---|---|
51
+ | Circular hole diameter D | `inner_diameter_at_z` | mid-Z of hole | D | 0.3 |
52
+ | Rectangular hole W x H | `inner_diameter_at_z` | mid-Z of hole | min(W, H) | 3-5 |
53
+ | Rectangular void region | `section_bbox_at_z` expected=`void` | mid-Z of feature | - | - |
54
+ | Solid face, boss, or back panel | `section_bbox_at_z` expected=`solid` | mid-Z of face | - | - |
55
+ | Outer envelope | `bbox_size` | - | [total_w, d, h] | 0.5 |
56
+ | Taper or lead-in | `diameter_decreases_along_z` | z_range | monotonic | - |
57
+ | Hole vs adjacent solid | `min_clearance` | - | descriptors | min_mm=0 |
58
+ | Bolt assembly hole | `hole_accessibility` | working plane Z | hole and clearance radius | - |
59
+ | Thin wall or rib | `min_wall_thickness` | section Z | min_mm=1.0 | 0.1 |
60
+ | Direction marker | `feature_position` | point | `solid` or `void` | 0.5 |
61
+ | Attached lip/rib/boss/arm root | `section_bbox_at_z` | attachment/interface Z | `solid` | - |
62
+
63
+ Z slice formula: if a feature occupies `[z_bottom, z_top]`, slice at
64
+ `z = (z_bottom + z_top) / 2`.
65
+
66
+ When you do not know the expected value, run `agentcad build`, then
67
+ `agentcad probe <model> --z <z>`. The `suggested_checks` field is ready to
68
+ paste into `design.json`.
69
+
70
+ When you do not know which Z to probe, run `agentcad probe <model> --scan` to
71
+ surface step changes such as cavity starts and wall transitions.
72
+
73
+ ## Connection Red Phase
74
+
75
+ For attached features, write two checks before coding:
76
+
77
+ - body check: the feature exists at its main section
78
+ - root check: the feature has material at the interface where it must transfer
79
+ load into the parent body
80
+
81
+ In the red phase, deliberately build only the parent body and confirm both
82
+ checks fail. In the green phase, make sure the root check flips only when the
83
+ feature is actually connected through a meaningful contact area.
@@ -0,0 +1,88 @@
1
+ # Concept Design
2
+
3
+ Use this after discovery and before writing `design.json` for any non-trivial
4
+ part. The goal is to choose a good topology before the validation contract
5
+ locks the agent into a mediocre geometry.
6
+
7
+ Skip this only for simple primitives, direct dimension edits, or fixes where
8
+ the topology is already established.
9
+
10
+ ## Required Output
11
+
12
+ Create a short concept note in the conversation before editing files. For
13
+ persistent work, also save it as `models/<name>/concept.md`.
14
+
15
+ The concept note must include:
16
+
17
+ 1. User goal and operating context.
18
+ 2. 2-3 topology concepts.
19
+ 3. Tradeoffs for each concept.
20
+ 4. Chosen concept and reason.
21
+ 5. Key dimensions and assumptions that will become `params.json`.
22
+ 6. Feature list and validation strategy that will become `design.json`.
23
+
24
+ ## Topology Concepts
25
+
26
+ Each concept should describe the actual CAD structure, not just styling.
27
+
28
+ For each option, cover:
29
+
30
+ - load path and likely weak points
31
+ - assembly sequence and tool access
32
+ - manufacturing target and print/machining orientation
33
+ - minimum wall/rib assumptions
34
+ - support material or overhang risk for FDM
35
+ - which dimensions are mating-critical
36
+ - which checks will prove the concept works
37
+ - what would make the concept fail
38
+
39
+ Example:
40
+
41
+ ```markdown
42
+ ## Concept Options
43
+
44
+ ### A. Single-piece plate with two raised bosses
45
+ - Best for: fast FDM prototype and simple screw mounting.
46
+ - Risk: bosses concentrate stress unless filleted and tied into ribs.
47
+ - Validation: bbox, boss positions, hole diameters, hole-wall clearance,
48
+ bolt accessibility, min wall thickness around bosses.
49
+
50
+ ### B. Folded L-bracket with triangular ribs
51
+ - Best for: higher bending stiffness under vertical load.
52
+ - Risk: more overhang and harder support removal.
53
+ - Validation: upright position, rib solids, transverse hole access,
54
+ min wall thickness, section checks through both ribs.
55
+
56
+ ### C. Two-piece clamp with captured nut pocket
57
+ - Best for: adjustable assembly.
58
+ - Risk: more parts and tighter tolerance stack-up.
59
+ - Validation: nut pocket void, screw path, clamp gap, clearance around tool.
60
+
61
+ Chosen: B, because the load is a cantilever and stiffness matters more than
62
+ print simplicity.
63
+ ```
64
+
65
+ ## When To Ask The User
66
+
67
+ Ask for a concept choice when multiple concepts satisfy the request but differ
68
+ in topology, assembly, manufacturing, cost, or visual form.
69
+
70
+ Use 2-3 options with a recommended default. Stop and wait for the answer unless
71
+ the user explicitly delegated design choice.
72
+
73
+ Proceed without asking only when one concept clearly dominates because of the
74
+ user's constraints. State why the other options were rejected.
75
+
76
+ ## Concept Quality Bar
77
+
78
+ Before writing `design.json`, check the chosen concept:
79
+
80
+ - Can every important feature be validated with an existing check type?
81
+ - Are mating dimensions explicit or conservatively parameterized?
82
+ - Are holes accessible by fasteners/tools?
83
+ - Are wall thickness and clearances manufacturable?
84
+ - Is the load path plausible, not just visually plausible?
85
+ - Are there section views that will expose hidden mistakes?
86
+
87
+ If the answer is no, revise the concept or ask a focused question before
88
+ writing the contract.