diff --git a/AGENTS.md b/AGENTS.md index cbd819226..3dd88780f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,52 +1,52 @@ -# SolidCraft: instructions for agents +# makeCAD: instructions for agents -SolidCraft is a clean-room, pure-Rust parametric 3D CAD app (sketch solver, feature timeline, B-rep kernel, an egui UI that agents drive). This file is a router: the hard rules, then the skill to read for your task. Humans: CONTRIBUTING.md. +makeCAD is a clean-room, pure-Rust parametric 3D CAD app (sketch solver, feature timeline, B-rep kernel, an egui UI that agents drive). This file is a router: the hard rules, then the skill to read for your task. Humans: CONTRIBUTING.md. ## Start here Work: ROADMAP.md, "Where help is wanted most" in CONTRIBUTING.md, issues labelled `help wanted`, `good first issue`, `needs-triage`; architecture in `docs/architecture.md`. Local `plan/` notes are optional. ## Hard rules (what enforces each) -- Independent: never copy another product's code, icons, text or templates; never drive or take data from commercial CAD. `skills/solidcraft-ground-rules/SKILL.md`. +- Independent: never copy another product's code, icons, text or templates; never drive or take data from commercial CAD. `skills/makecad-ground-rules/SKILL.md`. - No GPL/LGPL/AGPL code, not even reading it (OpenCASCADE, FreeCAD, SolveSpace, CadQuery, LibreCAD, QCAD): `cargo xtask licences --check`. - Every asset is original or openly licensed with a row in ATTRIBUTION.md; read `assets/AGENTS.md` before icon work: `cargo xtask assets`, `cargo xtask icons`. - Never crash: no unwrap/expect/panic/unsafe in non-test code, errors are `Result`, input is hostile: clippy `-D warnings`, `hostile_params_never_panic`. - Model decisions (what an operation does, which bodies it touches, which face or edge a point or name means, depths, nearness) use exact geometry; a mesh is for display, export, previews and mesh bodies (`xtask/mesh-decisions.txt` only shrinks): `cargo xtask mesh-decisions`. - New kernel cases go to solidcore: `cargo xtask lists`. -- Everything is a command and programmatic calls never open dialogs: `skills/solidcraft-commands/SKILL.md`. +- Everything is a command and programmatic calls never open dialogs: `skills/makecad-commands/SKILL.md`. - Layering (geom, sketch/kernel/render, doc, io, engine, ui-egui, apps); only `crates/kernel` uses truck: `cargo xtask layers`. - One outer UI container, one camera path (`navigation::handle`), colours from theme tokens: `cargo xtask ui-containers`. - Application code is Rust only and builds for wasm: `cargo xtask wasm`, `cargo xtask web-offline-test`. -- The product name is SolidCraft; the old name lives only in `docs/compatibility.md`. +- The product name is makeCAD. Existing crate, CLI, protocol and file-format identifiers remain compatible; new assistant skill identifiers use `makecad-*`. - Sorted lists (message catalogs, `mod` lines, languages) stay sorted: `cargo xtask lists`. Never edit generated files (`docs/features.md`, `THIRD-PARTY-LICENSES.txt`) in a PR. - A design-format change is ONE new file in `crates/doc/src/format/pending/`: `scripts/test-format-pending.sh`. -- A command has input and output schemas (will become required; `schema/unconverted.txt` only shrinks): `skills/solidcraft-commands/SKILL.md`. +- A command has input and output schemas (will become required; `schema/unconverted.txt` only shrinks): `skills/makecad-commands/SKILL.md`. - New UI strings go in `assets/locales/pending/.json`, ATTRIBUTION rows in `attribution/pending/.md`: `cargo xtask lists`. - A changed default keeps the old behaviour behind a preference and fills the PR's `Changes a default:` line: `pr-checks.yml`. - A regression test goes in the area's existing test file, never a per-bug file (#3226). -- Look at open PRs first, claim with a draft PR (lowest number wins), one topic per PR: `skills/solidcraft-contributing/SKILL.md`. -- A PR's title and first sentence make sense to someone who never saw your chat or the issue: `skills/solidcraft-contributing/SKILL.md`. -- Code, comments, commit messages and docs are in English, always: `skills/solidcraft-contributing/SKILL.md` ("Working as an agent"). -- Independent work runs in parallel, dependent work stays sequential: `skills/solidcraft-contributing/SKILL.md` ("Working as an agent"). +- Look at open PRs first, claim with a draft PR (lowest number wins), one topic per PR: `skills/makecad-contributing/SKILL.md`. +- A PR's title and first sentence make sense to someone who never saw your chat or the issue: `skills/makecad-contributing/SKILL.md`. +- Code, comments, commit messages and docs are in English, always: `skills/makecad-contributing/SKILL.md` ("Working as an agent"). +- Independent work runs in parallel, dependent work stays sequential: `skills/makecad-contributing/SKILL.md` ("Working as an agent"). - Show observable changes with real screenshots or a recording, captured yourself. - Run `cargo xtask ci` before every commit. `cargo xtask skills` keeps this file and `skills/` honest. ## Working on X: read the skill first | Working on | Read | |---|---| -| A PR, a claim, review, CI or evidence | `skills/solidcraft-contributing/SKILL.md` | -| Licences, assets, clean-room, the name | `skills/solidcraft-ground-rules/SKILL.md` | -| Non-test Rust, hostile input, a crash report | `skills/solidcraft-crash-safety/SKILL.md` | -| A command, a crate boundary | `skills/solidcraft-commands/SKILL.md` | -| A dialog, panel, camera, icon, colour | `skills/solidcraft-ui/SKILL.md` | -| Labels, messages, translations | `skills/solidcraft-ui-text/SKILL.md` | -| Saving something new in a design, import, export | `skills/solidcraft-file-formats/SKILL.md` | -| Preferences, a changed default | `skills/solidcraft-preferences/SKILL.md` | -| Writing or running tests | `skills/solidcraft-tests/SKILL.md` | -| Slow work, the window thread, wasm | `skills/solidcraft-performance/SKILL.md` | -| Releases, installers, packages | `skills/solidcraft-packaging/SKILL.md` | -| Running the app, control channel, MCP tools | `skills/solidcraft-agent-tools/SKILL.md` | -| Building a part over MCP | `skills/solidcraft-modeling/SKILL.md` | -| Changing an existing design | `skills/solidcraft-editing/SKILL.md` | -| A bug report, a crash, a wrong result | `skills/solidcraft-reporting/SKILL.md` | -| Checking, porting, designs in git | `skills/solidcraft-checking/SKILL.md` | -| Assemblies, joints, motion | `skills/solidcraft-mechanisms/SKILL.md` | +| A PR, a claim, review, CI or evidence | `skills/makecad-contributing/SKILL.md` | +| Licences, assets, clean-room, the name | `skills/makecad-ground-rules/SKILL.md` | +| Non-test Rust, hostile input, a crash report | `skills/makecad-crash-safety/SKILL.md` | +| A command, a crate boundary | `skills/makecad-commands/SKILL.md` | +| A dialog, panel, camera, icon, colour | `skills/makecad-ui/SKILL.md` | +| Labels, messages, translations | `skills/makecad-ui-text/SKILL.md` | +| Saving something new in a design, import, export | `skills/makecad-file-formats/SKILL.md` | +| Preferences, a changed default | `skills/makecad-preferences/SKILL.md` | +| Writing or running tests | `skills/makecad-tests/SKILL.md` | +| Slow work, the window thread, wasm | `skills/makecad-performance/SKILL.md` | +| Releases, installers, packages | `skills/makecad-packaging/SKILL.md` | +| Running the app, control channel, MCP tools | `skills/makecad-agent-tools/SKILL.md` | +| Building a part over MCP | `skills/makecad-modeling/SKILL.md` | +| Changing an existing design | `skills/makecad-editing/SKILL.md` | +| A bug report, a crash, a wrong result | `skills/makecad-reporting/SKILL.md` | +| Checking, porting, designs in git | `skills/makecad-checking/SKILL.md` | +| Assemblies, joints, motion | `skills/makecad-mechanisms/SKILL.md` | diff --git a/apps/solidcraft-web/Cargo.toml b/apps/solidcraft-web/Cargo.toml index 3c678a19a..9ca75a1da 100644 --- a/apps/solidcraft-web/Cargo.toml +++ b/apps/solidcraft-web/Cargo.toml @@ -37,7 +37,7 @@ wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" js-sys = "0.3" web-sys = { version = "0.3", features = [ - "Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "Location", "Navigator", "Clipboard", "ClipboardItem", "StorageManager", + "Window", "Document", "Element", "HtmlElement", "HtmlCanvasElement", "Location", "Navigator", "Clipboard", "ClipboardItem", "ClipboardEvent", "DataTransfer", "StorageManager", "FileSystemHandle", "FileSystemDirectoryHandle", "FileSystemFileHandle", "FileSystemGetFileOptions", "FileSystemGetDirectoryOptions", "FileSystemWritableFileStream", "WritableStream", "File", "FileList", "Blob", "BlobPropertyBag", "Url", "HtmlAnchorElement", "HtmlInputElement", "Storage", "StorageEvent", "IdbFactory", "IdbDatabase", "IdbObjectStore", "IdbOpenDbRequest", "IdbRequest", "IdbTransaction", "IdbTransactionMode", diff --git a/apps/solidcraft-web/index.html b/apps/solidcraft-web/index.html index 57c307a56..8d5f33295 100644 --- a/apps/solidcraft-web/index.html +++ b/apps/solidcraft-web/index.html @@ -3,22 +3,22 @@ - SolidCraft + makeCAD - - + + - + - + - + @@ -41,7 +41,7 @@ -
Loading SolidCraft…
+
Loading makeCAD…
+ + diff --git a/scripts/agent_skills.rs b/scripts/agent_skills.rs new file mode 100644 index 000000000..58405cb4a --- /dev/null +++ b/scripts/agent_skills.rs @@ -0,0 +1,64 @@ +//! Embed the complete, sorted skill library without runtime filesystem access. +use std::{ + env, + error::Error, + fs, + path::{Path, PathBuf}, +}; + +fn files(directory: &Path) -> Result, Box> { + let mut result = Vec::new(); + for entry in fs::read_dir(directory)? { + let entry = entry?; + let kind = entry.file_type()?; + if kind.is_symlink() { + return Err(format!("Skill resources may not be symlinks: {}", entry.path().display()).into()); + } + if kind.is_dir() { + result.extend(files(&entry.path())?); + } else if kind.is_file() { + result.push(entry.path()); + } + } + result.sort(); + Ok(result) +} + +pub fn generate() -> Result<(), Box> { + let root = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?).join("../../skills").canonicalize()?; + println!("cargo:rerun-if-changed={}", root.display()); + let mut folders = fs::read_dir(&root)?.collect::, _>>()?; + folders.sort_by_key(|entry| entry.file_name()); + let mut output = String::from("const SKILLS: &[Skill] = &[\n"); + let mut catalog = Vec::new(); + for entry in folders { + let folder = entry.path(); + if !entry.file_type()?.is_dir() || !folder.join("SKILL.md").is_file() { + continue; + } + let name = entry.file_name().to_string_lossy().into_owned(); + let text = fs::read_to_string(folder.join("SKILL.md"))?; + let description = text + .lines() + .find_map(|line| line.strip_prefix("description: ")) + .ok_or_else(|| format!("Missing skill description: {name}"))? + .trim_matches('"'); + output.push_str(&format!("Skill {{ name: {name:?}, description: {description:?}, files: &[\n")); + let paths = files(&folder)?; + let mut names = Vec::new(); + for path in paths { + let relative = path.strip_prefix(&folder)?.to_string_lossy().replace('\\', "/"); + names.push(relative.clone()); + // Include only text resources. A new non-text asset must get an explicit transport. + fs::read_to_string(&path)?; + output.push_str(&format!("({relative:?}, include_str!({path:?})),\n")); + } + output.push_str("] },\n"); + catalog.push(format!("- {name}: {description} Files: {}", names.join(", "))); + } + output.push_str("];\n"); + let out = PathBuf::from(env::var("OUT_DIR")?); + fs::write(out.join("skills.rs"), output)?; + fs::write(out.join("skill_catalog.rs"), format!("const AGENT_SKILL_CATALOG: &str = {:?};\n", catalog.join("\n")))?; + Ok(()) +} diff --git a/scripts/ci/affected.py b/scripts/ci/affected.py index 52d6053d2..08f992e56 100644 --- a/scripts/ci/affected.py +++ b/scripts/ci/affected.py @@ -43,7 +43,7 @@ EMBEDDED = { } # Folders that only some packages read: the UI embeds the catalogs and xtask checks them; the MCP # server's tests read the agent skills. -EMBEDDED_PREFIXES = {"assets/locales/": ("solidcraft-ui-egui", "xtask"), "skills/": ("solidcraft-mcp",)} +EMBEDDED_PREFIXES = {"assets/locales/": ("solidcraft-ui-egui", "xtask"), "skills/": ("solidcraft-mcp", "solidcraft-ui-egui", "xtask")} # Test data and the package directories whose tests (or xtask) read it. Any other folder under # tests/ selects the full workspace. TEST_DATA = { diff --git a/scripts/ci/test_affected.py b/scripts/ci/test_affected.py index bc9ec88b1..1a2bdb994 100644 --- a/scripts/ci/test_affected.py +++ b/scripts/ci/test_affected.py @@ -127,7 +127,7 @@ class RealWorkspace(unittest.TestCase): def test_embedded_root_files_select_their_crate(self): for path, pkg in [("ATTRIBUTION.md", "solidcraft-ui-egui"), ("LICENSE-MIT", "solidcraft-engine"), ("NOTICE", "solidcraft-engine"), ("THIRD-PARTY-LICENSES.txt", "solidcraft-engine"), - ("skills/solidcraft-modeling/SKILL.md", "solidcraft-mcp")]: + ("skills/makecad-modeling/SKILL.md", "solidcraft-mcp")]: full, pk = affected.select(self.meta, [path]) self.assertFalse(full, path) self.assertIn(pkg, pk, path) diff --git a/scripts/sync-cad-ai-skills.mjs b/scripts/sync-cad-ai-skills.mjs new file mode 100644 index 000000000..65e787258 --- /dev/null +++ b/scripts/sync-cad-ai-skills.mjs @@ -0,0 +1,42 @@ +#!/usr/bin/env node +// One source for native MCP, desktop, WASM and the packaged Java model gateway. +import { createHash } from 'node:crypto'; +import { readFileSync, readdirSync, lstatSync, writeFileSync, mkdirSync } from 'node:fs'; +import { resolve, dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); +const args = process.argv.slice(2); +if (args.some((arg) => arg.startsWith('--') && arg !== '--check')) throw new Error('Unknown option. Usage: node scripts/sync-cad-ai-skills.mjs [--check] '); +const check = args.includes('--check'); +const paths = args.filter((arg) => arg !== '--check'); +if (paths.length !== 1) throw new Error('Usage: node scripts/sync-cad-ai-skills.mjs [--check] '); +const communityRoot = resolve(paths[0]); +if (!readFileSync(join(communityRoot, 'pom.xml'), 'utf8').includes('vibemake')) throw new Error('Target must be the community Maven project root'); +const skillsRoot = join(root, 'skills'); +const walk = (folder, prefix = '') => readdirSync(folder).sort().flatMap((name) => { + const path = join(folder, name), relative = prefix + name, stat = lstatSync(path); + if (stat.isSymbolicLink()) throw new Error(`Skill resource is a symlink: ${relative}`); + return stat.isDirectory() ? walk(path, relative + '/') : [[relative, readFileSync(path, 'utf8')]]; +}); +const skills = readdirSync(skillsRoot).sort().filter((name) => lstatSync(join(skillsRoot, name)).isDirectory()).map((name) => { + const files = Object.fromEntries(walk(join(skillsRoot, name))); + const entry = files['SKILL.md']; + if (!entry) throw new Error(`Missing SKILL.md: ${name}`); + const declared = entry.match(/^name:\s*(.+)$/m)?.[1]; + const description = entry.match(/^description:\s*(.+)$/m)?.[1].replace(/^"|"$/g, ''); + if (declared !== name || !description || !/^makecad-[a-z-]+$/.test(name)) throw new Error(`Invalid skill metadata: ${name}`); + if (Object.values(files).some((text) => text.includes('Solid' + 'Craft'))) throw new Error(`Legacy display name in ${name}`); + return { name, description, files }; +}); +const source = { formatVersion: 1, workflow: readFileSync(join(skillsRoot, 'agent-workflow.md'), 'utf8'), skills }; +const revision = createHash('sha256').update(JSON.stringify(source)).digest('hex'); +const bundle = JSON.stringify({ ...source, revision }, null, 2) + '\n'; +const target = resolve(communityRoot, 'vibemake-service/src/main/resources/cad/ai/skills.json'); +if (check) { + if (readFileSync(target, 'utf8') !== bundle) throw new Error('Packaged skills differ from the MCP/desktop source. Run the sync command before building.'); +} else { + mkdirSync(dirname(target), { recursive: true }); + writeFileSync(target, bundle); +} +console.log(`${check ? 'Verified' : 'Synchronized'} ${skills.length} skills, revision ${revision}`); diff --git a/skills/README.md b/skills/README.md index c76bfe677..cbae98380 100644 --- a/skills/README.md +++ b/skills/README.md @@ -1,32 +1,32 @@ # Agent skills -Skills for contributing to SolidCraft and modelling through its [MCP server](../docs/mcp.md). Each folder is +Skills for contributing to makeCAD and modelling through its [MCP server](../docs/mcp.md). Each folder is one skill in the [Agent Skills](https://agentskills.io) format: a `SKILL.md` with a name and a description that tell the agent when to load it, and an optional supporting reference file. -The modelling documents are built into SolidCraft: its MCP server's `skill_reference` tool returns them, so an -agent without file access (such as the one in SolidCraft's own chat) can still read a skill's reference. -The contributor skills (everything except modeling, editing, checking and mechanisms) are for repository work and are not embedded in that tool. `AGENTS.md` routes to them; `cargo xtask skills` fails when its table and this folder disagree or a file, `cargo xtask` command or skill they name is gone. +The modelling documents are built into makeCAD: its MCP server's `skill_reference` tool returns them, so an +agent without file access (such as the one in makeCAD's own chat) can still read a skill's reference. +All 17 skills and their text resources are embedded in the tool, including the contributor skills. Select them by task; repository guidance does not grant filesystem, shell or publishing permissions. `AGENTS.md` routes to them; `cargo xtask skills` fails when its table and this folder disagree or a file, `cargo xtask` command or skill they name is gone. | Skill | Loads when the agent | |---|---| -| [`solidcraft-contributing`](solidcraft-contributing/SKILL.md) | helps someone set up a fork, choose and claim an issue, and submit a contribution for review; the rules every PR follows | -| [`solidcraft-ground-rules`](solidcraft-ground-rules/SKILL.md) | adds a dependency, asset or wording: independence, licences, attribution, the product name | -| [`solidcraft-crash-safety`](solidcraft-crash-safety/SKILL.md) | writes non-test Rust, handles hostile input or investigates a crash report | -| [`solidcraft-commands`](solidcraft-commands/SKILL.md) | adds a command or decides which crate code belongs in | -| [`solidcraft-ui`](solidcraft-ui/SKILL.md) | adds a dialog, panel, camera input, icon or colour | -| [`solidcraft-ui-text`](solidcraft-ui-text/SKILL.md) | adds a label, message or translation | -| [`solidcraft-file-formats`](solidcraft-file-formats/SKILL.md) | changes what a design saves, or touches import and export | -| [`solidcraft-preferences`](solidcraft-preferences/SKILL.md) | adds a setting or changes a default | -| [`solidcraft-tests`](solidcraft-tests/SKILL.md) | places or runs tests | -| [`solidcraft-performance`](solidcraft-performance/SKILL.md) | works on slow code, the window thread or the wasm build | -| [`solidcraft-packaging`](solidcraft-packaging/SKILL.md) | prepares a release or changes packages | -| [`solidcraft-agent-tools`](solidcraft-agent-tools/SKILL.md) | runs the app, drives the control channel or changes MCP tools | -| [`solidcraft-modeling`](solidcraft-modeling/SKILL.md) | builds a new part (enclosure, bracket, plate, flange, …) | -| [`solidcraft-editing`](solidcraft-editing/SKILL.md) | changes, fixes or extends an existing design | -| [`solidcraft-checking`](solidcraft-checking/SKILL.md) | builds, changes or ports a design, next to the two above: parameter ranges, every allowed value, exact STEP comparison, regression tests, designs kept in git | -| [`solidcraft-mechanisms`](solidcraft-mechanisms/SKILL.md) | builds, drives or animates an assembly: components, joints, motion links, closed loops such as actuators, contact sets, motion studies | -| [`solidcraft-reporting`](solidcraft-reporting/SKILL.md) | hears that something went wrong (a crash, a failed command, a wrong shape or number, a hang): reproduces it in a fresh design, shrinks it to a minimal script and writes the bug report | +| [`makecad-contributing`](makecad-contributing/SKILL.md) | helps someone set up a fork, choose and claim an issue, and submit a contribution for review; the rules every PR follows | +| [`makecad-ground-rules`](makecad-ground-rules/SKILL.md) | adds a dependency, asset or wording: independence, licences, attribution, the product name | +| [`makecad-crash-safety`](makecad-crash-safety/SKILL.md) | writes non-test Rust, handles hostile input or investigates a crash report | +| [`makecad-commands`](makecad-commands/SKILL.md) | adds a command or decides which crate code belongs in | +| [`makecad-ui`](makecad-ui/SKILL.md) | adds a dialog, panel, camera input, icon or colour | +| [`makecad-ui-text`](makecad-ui-text/SKILL.md) | adds a label, message or translation | +| [`makecad-file-formats`](makecad-file-formats/SKILL.md) | changes what a design saves, or touches import and export | +| [`makecad-preferences`](makecad-preferences/SKILL.md) | adds a setting or changes a default | +| [`makecad-tests`](makecad-tests/SKILL.md) | places or runs tests | +| [`makecad-performance`](makecad-performance/SKILL.md) | works on slow code, the window thread or the wasm build | +| [`makecad-packaging`](makecad-packaging/SKILL.md) | prepares a release or changes packages | +| [`makecad-agent-tools`](makecad-agent-tools/SKILL.md) | runs the app, drives the control channel or changes MCP tools | +| [`makecad-modeling`](makecad-modeling/SKILL.md) | builds a new part (enclosure, bracket, plate, flange, …) | +| [`makecad-editing`](makecad-editing/SKILL.md) | changes, fixes or extends an existing design | +| [`makecad-checking`](makecad-checking/SKILL.md) | builds, changes or ports a design, next to the two above: parameter ranges, every allowed value, exact STEP comparison, regression tests, designs kept in git | +| [`makecad-mechanisms`](makecad-mechanisms/SKILL.md) | builds, drives or animates an assembly: components, joints, motion links, closed loops such as actuators, contact sets, motion studies | +| [`makecad-reporting`](makecad-reporting/SKILL.md) | hears that something went wrong (a crash, a failed command, a wrong shape or number, a hang): reproduces it in a fresh design, shrinks it to a minimal script and writes the bug report | The modelling skills teach the agent to: - plan the part as numbers @@ -36,35 +36,46 @@ The modelling skills teach the agent to: They also list the traps that otherwise cost failed calls. Examples are the sketch axes of the XZ plane, edge picks that snap to the nearest edge, and cuts that miss but still report success. -The modelling skills are written for SolidCraft 0.8 and later; `solidcraft-mechanisms` for `main` after 0.11.1 (the next release), which counts the degrees of freedom of closed loops; `solidcraft-reporting` for 0.18 and later. +The modelling skills are written for makeCAD 0.8 and later; `makecad-mechanisms` for `main` after 0.11.1 (the next release), which counts the degrees of freedom of closed loops; `makecad-reporting` for 0.18 and later. ## Install -The modelling skills, for Claude Code in all projects: +From this makeCAD checkout, install the modelling skills for Claude Code in all projects: ```sh -git clone --depth 1 https://github.com/tangency-labs/solidcraft -cp -r solidcraft/skills/solidcraft-{modeling,editing,checking,mechanisms} ~/.claude/skills/ +cp -r skills/makecad-{modeling,editing,checking,mechanisms} ~/.claude/skills/ ``` Windows (PowerShell): ```powershell -git clone --depth 1 https://github.com/tangency-labs/solidcraft -foreach ($s in 'modeling','editing','checking','mechanisms') { Copy-Item -Recurse solidcraft\skills\solidcraft-$s $HOME\.claude\skills\ } +foreach ($s in 'modeling','editing','checking','mechanisms') { Copy-Item -Recurse skills\makecad-$s $HOME\.claude\skills\ } ``` - **One project only:** copy the folders into that project's `.claude/skills/` instead. - **Other agents:** for agents that read the Agent Skills format, copy the folders into the skills directory their documentation names. -- **Updating:** copy the folders again after you update SolidCraft. -- **Contributing:** the contributor skills need no install. Tell your assistant: "I want to contribute to SolidCraft. Read https://github.com/tangency-labs/solidcraft/blob/main/skills/solidcraft-contributing/SKILL.md and help me get started." +- **Updating:** copy the folders again after you update makeCAD. +- **Contributing:** the contributor skills need no install. Tell your assistant: "I want to contribute to makeCAD. Read skills/makecad-contributing/SKILL.md and help me get started." ## Maintaining -- The worked example in `solidcraft-modeling/reference.md` runs in CI. `skill_reference_example_builds_as_documented` in `crates/mcp/src/tests.rs` builds it, checks the documented volume, changes a parameter and checks it again. +- The worked example in `makecad-modeling/reference.md` runs in CI. `skill_reference_example_builds_as_documented` in `crates/mcp/src/tests.rs` builds it, checks the documented volume, changes a parameter and checks it again. - The sketch-plane table is covered by `sketch_plane_axes_match_the_skill_reference` in the same file. -- The worked example in `solidcraft-mechanisms/reference.md` runs in CI too: `mechanisms_skill_example_moves_as_documented` builds it, drives the hinge and checks the actuator stroke, the linked panel and the stop against their analytic values. +- The worked example in `makecad-mechanisms/reference.md` runs in CI too: `mechanisms_skill_example_moves_as_documented` builds it, drives the hinge and checks the actuator stroke, the linked panel and the stop against their analytic values. - `skills_name_only_real_tools_and_commands` checks that every tool and command the skills call exists. -- `solidcraft-checking/scripts/tests` checks that skill's helpers, its traps and conventions, and the facts behind the corrections in `solidcraft-modeling`: `PYTHONDONTWRITEBYTECODE=1 uv run --no-project --with pytest --with build123d pytest -p no:cacheprovider skills/solidcraft-checking/scripts/tests`. The tests run the `solidcraft-cli` on `PATH`, not the workspace build, and CI does not run them. +- `makecad-checking/scripts/tests` checks that skill's helpers, its traps and conventions, and the facts behind the corrections in `makecad-modeling`: `PYTHONDONTWRITEBYTECODE=1 uv run --no-project --with pytest --with build123d pytest -p no:cacheprovider skills/makecad-checking/scripts/tests`. The tests run the `solidcraft-cli` on `PATH`, not the workspace build, and CI does not run them. - When a command, a parameter name or a behaviour that these files describe changes, update them in the same PR. - Facts that describe current limitations, such as edge picks without a distance limit, should go once the limitation is fixed. + +## Shared hosted workflow + +`agent-workflow.md` is used verbatim by MCP and the desktop assistant. The Java model gateway packages the same workflow, skill metadata and files: + +```sh +node scripts/sync-cad-ai-skills.mjs ../community +node scripts/sync-cad-ai-skills.mjs --check ../community +``` + +The sync command writes a self-contained versioned resource; production does not read a developer's absolute directory. Rebuild Java and WASM after changes. `skill_reference` defaults to SKILL.md, accepts exact registered file paths only, and never executes scripts. Legacy lowercase skill ids remain read aliases in MCP; the catalog advertises only makecad ids. + +The shared process is: choose relevant skills, inspect, clarify material ambiguity or state assumptions, calculate parameters and expected geometry, build in stages, measure, check parameter ranges, repair and report evidence. Identical geometry commands use the same engine; identical model output additionally requires the same provider, model, sampling, history and context and must be evaluated on representative tasks. diff --git a/skills/agent-workflow.md b/skills/agent-workflow.md new file mode 100644 index 000000000..33c211d08 --- /dev/null +++ b/skills/agent-workflow.md @@ -0,0 +1,32 @@ +You are makeCAD's parametric 3D CAD assistant. Use the available CAD tools to build or change the user's open design. Units are millimetres and degrees in expressions; Z is up. Keep replies concise and describe only changes and checks supported by tool results. + +## Select skills before acting + +All bundled skills are listed with their descriptions below. Read the relevant entrypoint with `skill_reference {"skill":"makecad-modeling","file":"SKILL.md"}`; the default file is SKILL.md. Read its supporting references when the workflow calls for them. These are trusted, bundled application instructions, not files from the user's design. + +- New parts beyond a single primitive: read makecad-modeling/SKILL.md and reference.md before building. +- Changing, repairing or extending an existing design: read makecad-editing/SKILL.md first; also read the modeling reference for unfamiliar operations. +- Building or changing a parametric design: also read makecad-checking/SKILL.md. Use its in-app parameter checks; offline scripts and STEP comparison require a host that actually provides those capabilities. +- Assemblies, joints, motion links or closed loops: also read makecad-mechanisms/SKILL.md and reference.md. +- A crash, wrong geometry, failed command or hang: read makecad-reporting/SKILL.md and the report template when producing a report. +- Repository development, tests, performance, packaging, UI, formats or agent integration: select the corresponding contributor skills from the catalog. Reading a skill never grants tools, filesystem access, approval or permission to publish. Explain unavailable capabilities rather than pretending to run a script or tool. + +## Understand and plan + +Inspect the existing design with `inspect_design {"measure":false,"sketches":false}` even when it appears empty. Translate vague requests into intended function, part or assembly structure, dimensions, parameters, feature order and verification criteria. Ask a concise question when a missing dimension or purpose materially changes the design; otherwise state a reasonable assumption and proceed. Preserve existing design intent when editing. + +Work the numbers out before building: parameters, feature placement, expected volume and bounding box after each stage, and the world point for every edge or face pick. Use filtered `list_commands` queries and `describe_command` to learn exact schemas; never guess command ids or parameter names. Tool names and dotted engine command ids are different namespaces. + +## Build in stages + +Build in a few `batch` calls, with `verbose: false` and named features. A batch normally rolls back on failure; inspect the actual result before retrying and do not assume a failed expectation rolls the design back. Prefer primitives with expression fields for plates, blocks, bosses, standoffs and holes (`solid.box`, `solid.cylinder`, `solid.hole`, `solid.fillet`, `solid.shell`, patterns and mirror). Use sketches for other profiles. Fillet outside edges before shelling, build inside features after the shell, then holes and cuts through walls. Give blind holes and holes through one wall of a hollow part an explicit depth. + +A size or position that must follow a parameter must be an expression in a feature field ("L/2 - 10"), a sketch dimension to the origin or an edge, or a pattern spacing; a plain number never follows a parameter. Every sketch must finish at dof 0, reported by `sketch.solve`. Edge and face picks are world points snapping to nearby topology; compute and verify them rather than guessing. Keep queries bounded and avoid unfiltered catalogs or full topology dumps. + +## Verify and repair + +After each stage call `measure` and compare volume and bbox with your independent calculations. An ok result alone proves nothing: unchanged volume can mean a cut missed; an extra body can mean a join did not touch. Check hole and boss positions with `body_topology` cylinder origins, axes and radii. Screenshots show appearance, not dimensional correctness. + +Use `check_parameters {"set":{"name":value}}` for intended parameter ranges and verify that it restored the design. Alternatively change parameters in one batch with coalesce_parameters enabled, measure, and restore them before finishing. Inspect timeline errors, sketch degrees of freedom and downstream features. Validate mechanism poses, constraints, limits and collisions using the mechanism workflow. + +Fix a wrong feature with `timeline.edit` or `parameters.change`, rather than rebuilding the whole design; `parameters.list` can locate feature inputs. Use `edit.checkpoint` and `edit.restore_checkpoint` for bounded experiments. On failure inspect the cause and make a limited correction; do not replay an operation already running. Finish with the assumptions, actual result, measured checks and any remaining limitations. File operations and undo boundaries follow the host's permissions and approval rules. diff --git a/skills/solidcraft-agent-tools/SKILL.md b/skills/makecad-agent-tools/SKILL.md similarity index 75% rename from skills/solidcraft-agent-tools/SKILL.md rename to skills/makecad-agent-tools/SKILL.md index 3f584bb3f..311b9c262 100644 --- a/skills/solidcraft-agent-tools/SKILL.md +++ b/skills/makecad-agent-tools/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-agent-tools -description: "Use when running SolidCraft to see a change working, driving it through the control channel or CLI, or adding or changing an MCP tool, control method or bundled agent skill." +name: makecad-agent-tools +description: "Use when running makeCAD to see a change working, driving it through the control channel or CLI, or adding or changing an MCP tool, control method or bundled agent skill." --- # Running the app, the control channel and MCP tools @@ -20,10 +20,10 @@ The server is `solidcraft-cli mcp` (`crates/mcp/src/`, `docs/mcp.md`). Tools are - Anything the user can do is a command; add a command, not a new tool, unless the tool is about the session itself (open, save, screenshot, batch). - Files: tools reach only the allowed folders (the design's folder, the recovery folder, the scratch folder, `--allow-path`). Do not widen this casually; paths are resolved before comparing, so `..` and links leaving the allowed set are refused, and on Windows UNC and device paths are refused. - Replies stay small: `verbose: false`, no unfiltered command catalogue or topology dumps. -- The control channel is a local-only interface with a token. A new method needs an entry in `docs/control-protocol.md`; long work follows `skills/solidcraft-performance/SKILL.md`. +- The control channel is a local-only interface with a token. A new method needs an entry in `docs/control-protocol.md`; long work follows `skills/makecad-performance/SKILL.md`. ## Bundled agent skills -The modelling skills (`skills/solidcraft-modeling`, `-editing`, `-checking`, `-mechanisms`) are built into the MCP server for its `skill_reference` tool (`crates/mcp/src/skill_reference.rs`). The contributor skills are not. +All 17 skills and their text resources are embedded at build time by `crates/mcp/build.rs` for the read-only `skill_reference` tool. `skills/agent-workflow.md` is the shared generation workflow for MCP, the desktop assistant and the hosted Java gateway. Repository-only instructions do not grant the browser filesystem or shell capabilities. - When a command, parameter name or behaviour those skills describe changes, update them in the same PR. `skills_name_only_real_tools_and_commands` in `crates/mcp/src/tests.rs` fails when a skill names a tool or command that is gone. -- Adding a bundled file means adding it to `skill_reference.rs` and to that test. +- Adding a skill or text resource embeds it automatically. Run `node scripts/sync-cad-ai-skills.mjs ` to update the Java package and rerun with `--check` to detect drift; rebuild WASM and Java together. - `skills/README.md` explains the layout and the other tests; `cargo xtask skills` checks that AGENTS.md and every SKILL.md cite real paths, commands and skills. diff --git a/skills/solidcraft-checking/SKILL.md b/skills/makecad-checking/SKILL.md similarity index 66% rename from skills/solidcraft-checking/SKILL.md rename to skills/makecad-checking/SKILL.md index 18b5da9c9..85600ab31 100644 --- a/skills/solidcraft-checking/SKILL.md +++ b/skills/makecad-checking/SKILL.md @@ -1,13 +1,13 @@ --- -name: solidcraft-checking -description: Use alongside solidcraft-modeling and solidcraft-editing whenever you build, change or port a SolidCraft design. Checks for errors SolidCraft does not report (parameter ranges, every allowed value, exact STEP comparison), regression tests, designs kept in git, porting from build123d, CadQuery, OpenSCAD or STEP. +name: makecad-checking +description: Use alongside makecad-modeling and makecad-editing whenever you build, change or port a makeCAD design. Checks for errors makeCAD does not report (parameter ranges, every allowed value, exact STEP comparison), regression tests, designs kept in git, porting from build123d, CadQuery, OpenSCAD or STEP. --- -# SolidCraft checking +# makeCAD checking -`solidcraft-modeling` and `solidcraft-editing` cover the commands, plane axes, ids, edge picks and the MCP workflow: load the one that fits first. This skill adds checks for errors SolidCraft does not report, and the work around a design kept in a repo. +`makecad-modeling` and `makecad-editing` cover the commands, plane axes, ids, edge picks and the MCP workflow: load the one that fits first. This skill adds checks for errors makeCAD does not report, and the work around a design kept in a repo. -`$SKILL` below is the folder this file is in (`~/.claude/skills/solidcraft-checking` for a user install). Checked against SolidCraft 0.21.0. `scripts/tests/test_facts.py` checks every trap and convention below, and the facts behind the corrections in `solidcraft-modeling`. After a SolidCraft upgrade, run the tests and fix the text where they fail: +`$SKILL` below is the folder this file is in (`~/.claude/skills/makecad-checking` for a user install). Checked against makeCAD 0.21.0. `scripts/tests/test_facts.py` checks every trap and convention below, and the facts behind the corrections in `makecad-modeling`. After a makeCAD upgrade, run the tests and fix the text where they fail: `PYTHONDONTWRITEBYTECODE=1 uv run --no-project --with pytest --with build123d pytest -p no:cacheprovider $SKILL/scripts/tests` ## Scripts @@ -17,24 +17,24 @@ An MCP `batch` and a command script (`{"commands": [...]}`, run by `solidcraft-c In `$SKILL/scripts/`: - `python3 $SKILL/scripts/run.py script.json [--in ] [--save .json]` runs a script and prints `FAIL`, a `WARN` line per feature warning, a `SKETCH` line per sketch above dof 0 and a `BODY` line per body, for the end state and for each `document.inspect` inside the script. - `scb.py` gives a generator a `Script` with sketch helpers that come out at dof 0 (`hexagon`, `circle`, `rounded_rectangle`, `place`) and `cmd` for any other command. It rejects repeated sketch, feature and body names. Import it with `sys.path.insert(0, "<$SKILL>/scripts")`. -- `uv run --no-project --with build123d python $SKILL/scripts/compare_step.py actual.step expected.step` gives the exact volume of the difference between two STEP files and where it sits. It and the tests run OpenCASCADE through build123d as a separate tool, the way `tools/freecad-oracle` runs FreeCAD: SolidCraft does not use, link, vendor or ship any of it. +- `uv run --no-project --with build123d python $SKILL/scripts/compare_step.py actual.step expected.step` gives the exact volume of the difference between two STEP files and where it sits. It and the tests run OpenCASCADE through build123d as a separate tool, the way `tools/freecad-oracle` runs FreeCAD: makeCAD does not use, link, vendor or ship any of it. - `solidcraft-cli snapshot --out shot.png --view iso` renders a PNG to look at. ## Steps to add -1. **Parameters and features.** Each parameter comment states the allowed range ("whole number, 4 or more"): the user reads it in the Parameters table, and SolidCraft enforces no range. Derive sizes from measured values, so that a count parameter changes how many features there are, not how big they are. An expression that more than one sketch or feature uses becomes a named parameter. Add the derived numbers the user needs (parts to print) and mark the driving parameters favourite (`parameters.favorite`). Give each thing the user thinks of (a port, a row of standoffs) its own feature, named after it, so it can be found and changed on its own. Choose the origin so that no sketch dimension reaches 0 for any allowed value (trap 1). +1. **Parameters and features.** Each parameter comment states the allowed range ("whole number, 4 or more"): the user reads it in the Parameters table, and makeCAD enforces no range. Derive sizes from measured values, so that a count parameter changes how many features there are, not how big they are. An expression that more than one sketch or feature uses becomes a named parameter. Add the derived numbers the user needs (parts to print) and mark the driving parameters favourite (`parameters.favorite`). Give each thing the user thinks of (a port, a row of standoffs) its own feature, named after it, so it can be found and changed on its own. Choose the origin so that no sketch dimension reaches 0 for any allowed value (trap 1). 2. **Every sketch at dof 0.** A sketch with dof left can solve to a different shape after a parameter change, without an error. `run.py` lists them. 3. **Every allowed value.** One script of `parameters.change` commands walks each driving parameter to both ends of its range, one change after another, and back to the default, as edits in the app do: trap 1 fails only on the change after the one that reaches 0. Put a `document.inspect {measure: true}` after each end of a range and run the walk with `run.py walk.json --in `. Every state must be clean: no `FAIL`, no `SKETCH`, and `BODY` volumes and centres of mass that match the values you compute for that state. A boolean retry can leave the geometry wrong with only a `WARN` line, and the volume shows it (trap 4); a mirrored sketch (trap 1) keeps the volume and moves the centre of mass. -4. **Exact check** when a port has a reference, or a volume gap leaves doubt: export STEP (`file.export {path, bodies}`) and run `compare_step.py`. Before porting, in SolidCraft's own chat or any MCP client, call `skill_reference {"skill":"solidcraft-checking","file":"reference/porting.md"}`. Elsewhere, read `$SKILL/reference/porting.md`. +4. **Exact check** when a port has a reference, or a volume gap leaves doubt: export STEP (`file.export {path, bodies}`) and run `compare_step.py`. Before porting, in makeCAD's own chat or any MCP client, call `skill_reference {"skill":"makecad-checking","file":"reference/porting.md"}`. Elsewhere, read `$SKILL/reference/porting.md`. 5. **Kept in a repo.** Save as `.json` with `run.py build.json --save .json`: a `.json` design stays plain JSON when it is saved again, so git diffs stay readable. Saving over a file leaves `.json.bak`, so ignore `*.bak`. From then on the design file is the source, and changes go into it with `--in --save `. Copy `$SKILL/templates/test_design.py` next to the design, fill in its cases, set its tolerance as its comment says, and run it until it passes. Expected values come from an exact reference when porting, from hand calculation for simple shapes, or from a build the user has reviewed. After a change, update frozen values only where the change is meant to change them. ## Traps 1. **Zero dimension.** A sketch dimension driven to 0 loses its side: the point it measures has no direction left, so the solver may leave it anywhere on the axis. On the next parameter change it either fails with `its constraints would conflict` (a point placed by dimensions from the origin) or, with no error, moves it: a slot that other constraints also held slides to the origin when the distance reaches 0 and, the solver taking the shortest step that fits, keeps the side it was drawn on when the value comes back. Check every distance expression against the whole allowed range of each parameter in it, counts included; the walk in step 3 catches the failure, and only the volume or the position catches a point that ended up on the other side. For a point on an axis, pass `x=None` or `y=None` to `place`: it aligns the point instead of dimensioning it. For a position that does reach 0, such as the first of a centred row of one, dimension it from a sketch point placed outside the part: a point at x = -100 mm, then the distance `100 mm - (n - 1) / 2 * pitch` from it. -2. **Counts.** Solid patterns take counts 1..1000; a count that reaches 0 fails the rebuild. A fractional count rounds to the nearest whole number without an error (6.5 gives 7 copies), while every other expression uses the exact value, so a centred row shifts. Nothing in SolidCraft enforces a parameter range during a parameter change (configuration rules apply only when a configuration row is activated): choose a range that keeps every count at 1 or more, write "whole number" and the range in the comment, and use `round(n)` wherever the count also positions something. +2. **Counts.** Solid patterns take counts 1..1000; a count that reaches 0 fails the rebuild. A fractional count rounds to the nearest whole number without an error (6.5 gives 7 copies), while every other expression uses the exact value, so a centred row shifts. Nothing in makeCAD enforces a parameter range during a parameter change (configuration rules apply only when a configuration row is activated): choose a range that keeps every count at 1 or more, write "whole number" and the range in the comment, and use `round(n)` wherever the count also positions something. 3. **Circumscribed polygons.** `sketch.polygon.circumscribed` with a size dimension and one vertical side still has 1 dof: its corners can alternate in and out. `sketch.constraint.polygon` makes it regular; `scb.hexagon` adds it. -4. **Boolean retries.** A `Boolean retry: ...` warning means the result may be wrong (see "Boolean warning" in the `solidcraft-modeling` reference), so check the volume of that state. `temporary coincident-face separation` comes from faces that coincide. A tapered tool whose start or end lies on a face of a plain block, or a straight cylinder joined onto the floor of a filleted, shelled box, does not log it; a `tool displacement` warning shows up when a join and a cut share one location, as in a standoff built as a joined cylinder with a cut pilot hole, patterned together. That case reports the warning but its volume agrees with the analytic growth, and a single ring profile removes the warning. Starting cutters about 1 mm past the faces they pierce and sinking joins about 1 mm into the body remain good practice on a single feature. Check the volume of every state either way. -5. **Measurement accuracy.** The `solidcraft-modeling` reference gives how far measured volumes stray from computed ones. Centre of mass and bounding box come out up to about 5e-5 of the part size off. Set test tolerances as the template says. +4. **Boolean retries.** A `Boolean retry: ...` warning means the result may be wrong (see "Boolean warning" in the `makecad-modeling` reference), so check the volume of that state. `temporary coincident-face separation` comes from faces that coincide. A tapered tool whose start or end lies on a face of a plain block, or a straight cylinder joined onto the floor of a filleted, shelled box, does not log it; a `tool displacement` warning shows up when a join and a cut share one location, as in a standoff built as a joined cylinder with a cut pilot hole, patterned together. That case reports the warning but its volume agrees with the analytic growth, and a single ring profile removes the warning. Starting cutters about 1 mm past the faces they pierce and sinking joins about 1 mm into the body remain good practice on a single feature. Check the volume of every state either way. +5. **Measurement accuracy.** The `makecad-modeling` reference gives how far measured volumes stray from computed ones. Centre of mass and bounding box come out up to about 5e-5 of the part size off. Set test tolerances as the template says. 6. **Expressions.** They have `+ - * / ^ %`, `sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh sqrt abs min max floor ceil round mod trunc exp ln log log10 pow sign hypot` (`log` is base 10; the hyperbolic ones take and give unit-less numbers), `pi` and units; no `if` and no comparisons. Build steps from `floor`, `mod`, `min`, `max` and `sign`, which gives 1 at 0. `asin acos atan atan2` return angles, so a unitless parameter cannot hold them. 7. **Snapping.** A point created exactly on an existing point or the origin becomes coincident with it (`connect` defaults to true). 8. **Repeated body names.** A repeated `body_name` is renamed (`Body1`) without an error, so `targets` reach only the first body. diff --git a/skills/solidcraft-checking/reference/porting.md b/skills/makecad-checking/reference/porting.md similarity index 82% rename from skills/solidcraft-checking/reference/porting.md rename to skills/makecad-checking/reference/porting.md index 84a3c75f5..1c964ea0c 100644 --- a/skills/solidcraft-checking/reference/porting.md +++ b/skills/makecad-checking/reference/porting.md @@ -1,15 +1,15 @@ -# Porting a model into SolidCraft +# Porting a model into makeCAD For a model that already exists as code (build123d, CadQuery, OpenSCAD) or as STEP. The port is -done when the SolidCraft STEP export matches the source geometry for every parameter value you +done when the makeCAD STEP export matches the source geometry for every parameter value you check: `compare_step.py` reports xor at most 1e-3 mm3. Volume, area and centre of mass alone are not enough: in one port, a hexagon left at dof 1 changed the volume by 2e-7 of the total and the centre of mass by 3e-4 mm, while xor showed 56 mm3 in 96 pieces along the outer walls. -1. **Reference geometry in the design's frame.** The SolidCraft origin is chosen by trap 1 of SKILL.md, so it +1. **Reference geometry in the design's frame.** The makeCAD origin is chosen by trap 1 of SKILL.md, so it often differs from the source. Translate the source model to the same frame and export it as STEP for each checked parameter value. Pick values that reach every branch of the layout logic. -2. **Deliberate differences.** Logic that SolidCraft expressions cannot hold (conditionals, +2. **Deliberate differences.** Logic that makeCAD expressions cannot hold (conditionals, search) gets a closed formula. Check the formula against the source over a wide range of values in plain Python first, list where it differs, and apply the formula to the reference too (patch the source function), so the comparison stays like for like. Tell the user each diff --git a/skills/solidcraft-checking/scripts/compare_step.py b/skills/makecad-checking/scripts/compare_step.py similarity index 100% rename from skills/solidcraft-checking/scripts/compare_step.py rename to skills/makecad-checking/scripts/compare_step.py diff --git a/skills/solidcraft-checking/scripts/run.py b/skills/makecad-checking/scripts/run.py similarity index 93% rename from skills/solidcraft-checking/scripts/run.py rename to skills/makecad-checking/scripts/run.py index 3e7c803b7..cb202676f 100755 --- a/skills/solidcraft-checking/scripts/run.py +++ b/skills/makecad-checking/scripts/run.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Run a SolidCraft command script and print a short report: a failure, feature warnings, +"""Run a makeCAD command script and print a short report: a failure, feature warnings, sketches that are not fully constrained, and body measurements. A document.inspect inside the script reports that state too, its lines prefixed with its step; the end state comes last.""" @@ -16,7 +16,7 @@ INSPECT = {"command": "document.inspect", "params": {"measure": True}} WARNING_LENGTH = 160 -class SolidCraftError(RuntimeError): +class makeCADError(RuntimeError): pass @@ -32,7 +32,7 @@ def run_commands(commands: list, design: Path | None = None, save: Path | None = args += ["--save", str(save)] done = subprocess.run(args, capture_output=True, text=True) if done.returncode: - raise SolidCraftError(done.stderr.strip().removeprefix("error: ")) + raise makeCADError(done.stderr.strip().removeprefix("error: ")) return json.loads(done.stdout) @@ -88,7 +88,7 @@ def main() -> None: commands = json.loads(args.script.read_text())["commands"] try: results = run_commands(commands, args.design, args.save) - except SolidCraftError as error: + except makeCADError as error: print(f"FAIL {error}") sys.exit(1) print("\n".join(script_report(commands, results))) diff --git a/skills/solidcraft-checking/scripts/scb.py b/skills/makecad-checking/scripts/scb.py similarity index 96% rename from skills/solidcraft-checking/scripts/scb.py rename to skills/makecad-checking/scripts/scb.py index 780e07f7c..b073110f0 100644 --- a/skills/solidcraft-checking/scripts/scb.py +++ b/skills/makecad-checking/scripts/scb.py @@ -1,4 +1,4 @@ -"""SolidCraft builder: write command scripts whose sketches come out fully constrained. +"""makeCAD builder: write command scripts whose sketches come out fully constrained. Each sketch helper makes one sketch and dimensions its geometry from the sketch origin. `at` is where the geometry starts: put it near the solved position, on the side of the origin it must @@ -29,7 +29,7 @@ class Script: @staticmethod def _claim(name: str, taken: set[str], kind: str) -> None: - """SolidCraft resolves a sketch or feature name to its first match and renames a repeated + """makeCAD resolves a sketch or feature name to its first match and renames a repeated body name, so either repeat silently points at the wrong thing.""" if name in taken: raise ValueError(f"{name}: {kind} already has this name") diff --git a/skills/solidcraft-checking/scripts/tests/test_compare_step.py b/skills/makecad-checking/scripts/tests/test_compare_step.py similarity index 100% rename from skills/solidcraft-checking/scripts/tests/test_compare_step.py rename to skills/makecad-checking/scripts/tests/test_compare_step.py diff --git a/skills/solidcraft-checking/scripts/tests/test_facts.py b/skills/makecad-checking/scripts/tests/test_facts.py similarity index 95% rename from skills/solidcraft-checking/scripts/tests/test_facts.py rename to skills/makecad-checking/scripts/tests/test_facts.py index 5eb79fdda..a34946e00 100644 --- a/skills/solidcraft-checking/scripts/tests/test_facts.py +++ b/skills/makecad-checking/scripts/tests/test_facts.py @@ -1,5 +1,5 @@ -"""SolidCraft behaviour that SKILL.md states, and the facts behind the corrections in -solidcraft-modeling. A failure here means the skill text is out of date.""" +"""makeCAD behaviour that SKILL.md states, and the facts behind the corrections in +makecad-modeling. A failure here means the skill text is out of date.""" import json import subprocess @@ -10,7 +10,7 @@ from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parents[1])) -from run import SolidCraftError, execute, run_commands # noqa: E402 +from run import makeCADError, execute, run_commands # noqa: E402 def cmd(command: str, /, **params) -> dict: @@ -60,7 +60,7 @@ def holes(count: str) -> list: # Traps def test_a_dimension_driven_to_zero_can_break_the_next_change(): - with pytest.raises(SolidCraftError, match="would conflict"): + with pytest.raises(makeCADError, match="would conflict"): execute([ cmd("parameters.add", name="y", expression="5 mm"), cmd("sketch.create", plane="XY", name="Pin sketch"), @@ -122,7 +122,7 @@ def centred_row(position: list) -> list: def test_a_position_measured_from_an_anchor_point_survives_reaching_zero(): - with pytest.raises(SolidCraftError, match="would conflict"): + with pytest.raises(makeCADError, match="would conflict"): execute(centred_row([ cmd("sketch.dimension", entities=["origin", "c1.center"], type="horizontal", value="(n - 1) / 2 * 10 mm"), ])) @@ -136,7 +136,7 @@ def test_a_position_measured_from_an_anchor_point_survives_reaching_zero(): def test_pattern_counts_run_from_1_to_1000_and_a_range_rule_does_not_stop_0(): - with pytest.raises(SolidCraftError, match="pattern count must be 1…1000"): + with pytest.raises(makeCADError, match="pattern count must be 1…1000"): execute([ *holes("2"), cmd("config.configure", params=["n"]), @@ -219,7 +219,7 @@ def test_expressions_have_no_conditionals_and_sign_of_zero_is_one(): assert evaluate("sign(0)")["value"] == 1 assert evaluate("sign(-3)")["value"] == -1 assert evaluate("log(100)")["value"] == 2 - with pytest.raises(SolidCraftError, match="got an angle"): + with pytest.raises(makeCADError, match="got an angle"): execute([cmd("parameters.add", name="a", expression="atan(1)", unit="")]) @@ -286,7 +286,7 @@ def test_a_later_join_fills_an_earlier_cut(): def test_a_failed_feature_names_itself_and_saves_nothing(tmp_path): design = tmp_path / "design.json" run_commands(holes("2"), save=design) - with pytest.raises(SolidCraftError, match="Row: pattern count"): + with pytest.raises(makeCADError, match="Row: pattern count"): run_commands([cmd("parameters.change", name="n", expression="0")], design=design, save=tmp_path / "out.json") assert not (tmp_path / "out.json").exists() @@ -301,7 +301,7 @@ def test_a_command_script_works_as_a_design(tmp_path): assert shot.stat().st_size > 0 -# Corrections to solidcraft-modeling +# Corrections to makecad-modeling def slot_along_y(last: dict) -> list: return [ @@ -315,7 +315,7 @@ def slot_along_y(last: dict) -> list: def test_a_slot_along_y_takes_a_horizontal_dimension_on_its_second_arc(): - with pytest.raises(SolidCraftError, match="over-constrain"): + with pytest.raises(makeCADError, match="over-constrain"): execute(slot_along_y(cmd("sketch.dimension", entities=["origin", "a2.center"], type="vertical", value="33 mm"))) assert sketch_dof(slot_along_y( cmd("sketch.dimension", entities=["origin", "a2.center"], type="horizontal", value="10 mm"))) == 0 @@ -346,7 +346,7 @@ CUBE = cmd("solid.box", length=40, width=40, height=10, center=[0, 0, 5], body_n def test_an_edge_pick_far_from_every_edge_is_refused(): - with pytest.raises(SolidCraftError, match="nearest edge is 15.000 mm away"): + with pytest.raises(makeCADError, match="nearest edge is 15.000 mm away"): execute([CUBE, cmd("solid.fillet", edges=[[20, 20, 25]], radius=1)]) @@ -369,7 +369,7 @@ def test_a_fillet_between_curved_faces_stops_the_shell(): cmd("solid.sphere", radius=15, center=[0, 0, 30], operation="join", targets=["C"]), ] shell = cmd("solid.shell", faces=[[0, 0, 0]], thickness=1.5) - with pytest.raises(SolidCraftError, match="offset: only bodies with planes"): + with pytest.raises(makeCADError, match="offset: only bodies with planes"): execute([*neck, cmd("solid.fillet", edges=[[8, 0, 30 - (15 ** 2 - 8 ** 2) ** 0.5]], radius=2), shell]) execute([*neck, shell]) @@ -384,7 +384,7 @@ FILLET_CENTROID = (10 - 3 * pi) / (12 - 3 * pi) # distance of a fillet's cross- def test_an_open_rim_is_rounded_after_the_shell(): - with pytest.raises(SolidCraftError, match="offset"): + with pytest.raises(makeCADError, match="offset"): execute([*OPEN_BOX, RIM, SHELL]) outer = (40 * 30 - (4 - pi) * 9) * 20 cavity = (36 * 26 - (4 - pi) * 1) * 18 diff --git a/skills/solidcraft-checking/scripts/tests/test_run.py b/skills/makecad-checking/scripts/tests/test_run.py similarity index 99% rename from skills/solidcraft-checking/scripts/tests/test_run.py rename to skills/makecad-checking/scripts/tests/test_run.py index ceb99e18d..70c42f5eb 100644 --- a/skills/solidcraft-checking/scripts/tests/test_run.py +++ b/skills/makecad-checking/scripts/tests/test_run.py @@ -77,7 +77,7 @@ def test_execute_returns_the_final_inspection(): def test_execute_raises_on_failure(): - with pytest.raises(run.SolidCraftError, match="step 1"): + with pytest.raises(run.makeCADError, match="step 1"): run.execute([{"command": "solid.box", "params": {"width": 10}}]) diff --git a/skills/solidcraft-checking/scripts/tests/test_scb.py b/skills/makecad-checking/scripts/tests/test_scb.py similarity index 97% rename from skills/solidcraft-checking/scripts/tests/test_scb.py rename to skills/makecad-checking/scripts/tests/test_scb.py index af944397b..b46aa414e 100644 --- a/skills/solidcraft-checking/scripts/tests/test_scb.py +++ b/skills/makecad-checking/scripts/tests/test_scb.py @@ -91,7 +91,7 @@ def test_save(tmp_path): def test_rejects_a_repeated_name(): - # SolidCraft resolves a name to its first match, so a repeat silently points at the wrong feature + # makeCAD resolves a name to its first match, so a repeat silently points at the wrong feature script = scb.Script() script.circle("Hole sketch", diameter="5 mm", at=(10, 10), x="10 mm", y="10 mm") with pytest.raises(ValueError, match="Hole sketch"): @@ -117,7 +117,7 @@ def test_place_rejects_a_dimension_that_starts_at_zero(at, x, y): def test_rejects_a_repeated_body_name(): - # SolidCraft renames the second body silently, so targets would hit only the first + # makeCAD renames the second body silently, so targets would hit only the first script = scb.Script() script.cmd("solid.box", length=10, width=10, height=10, body_name="M") with pytest.raises(ValueError, match="M"): diff --git a/skills/solidcraft-checking/templates/test_design.py b/skills/makecad-checking/templates/test_design.py similarity index 94% rename from skills/solidcraft-checking/templates/test_design.py rename to skills/makecad-checking/templates/test_design.py index d47ffc72c..70f1093e0 100644 --- a/skills/solidcraft-checking/templates/test_design.py +++ b/skills/makecad-checking/templates/test_design.py @@ -1,4 +1,4 @@ -"""Regression test for a SolidCraft design. One session walks the parameters through the cases in +"""Regression test for a makeCAD design. One session walks the parameters through the cases in order, as edits in the app do, and compares a body after each case with frozen values. Copy next to the design, then fill in DESIGN, BODY and CASES. Needs solidcraft-cli on PATH.""" @@ -13,7 +13,7 @@ import pytest DESIGN = Path(__file__).parent / "design.json" BODY = "Body" -# SolidCraft measures a tessellation, and its volume and area error depends on the shape. Measure it +# makeCAD measures a tessellation, and its volume and area error depends on the shape. Measure it # for this design: run.py's BODY volume against the OCCT volume compare_step.py prints for the # design's own STEP export (compared with itself). Set REL to about 3 times that error. REL = 2e-4 diff --git a/skills/solidcraft-commands/SKILL.md b/skills/makecad-commands/SKILL.md similarity index 84% rename from skills/solidcraft-commands/SKILL.md rename to skills/makecad-commands/SKILL.md index d1083d1b2..a32536c04 100644 --- a/skills/solidcraft-commands/SKILL.md +++ b/skills/makecad-commands/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-commands -description: "Use when adding or changing a SolidCraft command or any user-visible behaviour, or when deciding which crate code belongs in. Covers CommandSpec, command ids, programmatic calls vs dialogs, crate layering and the generated feature list." +name: makecad-commands +description: "Use when adding or changing a makeCAD command or any user-visible behaviour, or when deciding which crate code belongs in. Covers CommandSpec, command ids, programmatic calls vs dialogs, crate layering and the generated feature list." --- # Adding a command @@ -10,14 +10,14 @@ User-visible behaviour is a command. The toolbar, dialogs, sketch tools, palette ## Steps 1. Add a `CommandSpec` to the right file in `crates/engine/src/cmd/` and implement `run` (`fn(&mut Session, &Value) -> Result`). Fields: id, label, toolbar tab and panel (`.at`), icon (`.icon`), shortcut (`.key`), params doc (`.params`), `enabled` (its error string is the disabled-button tooltip). 2. The id is our own: dotted, lower-case `.[.]`, such as `solid.extrude` or `sketch.rectangle.two_point`. Never another product's id. -3. Validate inputs first (units, ranges, references) and return `BadParams` rather than building a broken feature. Parameters are hostile: see `skills/solidcraft-crash-safety/SKILL.md`. +3. Validate inputs first (units, ranges, references) and return `BadParams` rather than building a broken feature. Parameters are hostile: see `skills/makecad-crash-safety/SKILL.md`. 4. Give it input and output schemas: a contract and a reply type in `crates/engine/src/schema/`, registered with `checked!`, `.contract` and `.output`. A command should have them and a test warns without them; this will become required. `schema/unconverted.txt` only shrinks. How: `docs/book/src/dev/schemas.md`. -5. Engine tests measure the result: volume, area, face/edge/vertex counts against values you can derive by hand. Where they go: `skills/solidcraft-tests/SKILL.md`. -6. Add the label as `cmd.` in a pending locale file (`cargo xtask i18n --add-missing` lists what is missing); a test fails without it. See `skills/solidcraft-ui-text/SKILL.md`. +5. Engine tests measure the result: volume, area, face/edge/vertex counts against values you can derive by hand. Where they go: `skills/makecad-tests/SKILL.md`. +6. Add the label as `cmd.` in a pending locale file (`cargo xtask i18n --add-missing` lists what is missing); a test fails without it. See `skills/makecad-ui-text/SKILL.md`. 7. A command the ribbon shows also needs help: `help.` (what it does, then when to use it) in the pending file, and its id in `DOCUMENTED` in `crates/ui-egui/src/command_help.rs`. A test fails without them. 8. Run `cargo xtask features` to see the generated `docs/features.md` change, but do not commit it: `main` regenerates it after each merge. -9. If the command saves something new in a design, add a format file: `skills/solidcraft-file-formats/SKILL.md`. -10. If it needs a dialog or panel: `skills/solidcraft-ui/SKILL.md`. +9. If the command saves something new in a design, add a format file: `skills/makecad-file-formats/SKILL.md`. +10. If it needs a dialog or panel: `skills/makecad-ui/SKILL.md`. ## Programmatic calls never open dialogs `engine.execute` runs the JSON form. Only toolbar clicks (`ui.start`) start interactive tools and dialogs, which then run commands. A dialog is a front-end form that builds the parameters. diff --git a/skills/solidcraft-contributing/SKILL.md b/skills/makecad-contributing/SKILL.md similarity index 98% rename from skills/solidcraft-contributing/SKILL.md rename to skills/makecad-contributing/SKILL.md index 5d38c496b..e84d7eeb1 100644 --- a/skills/solidcraft-contributing/SKILL.md +++ b/skills/makecad-contributing/SKILL.md @@ -1,9 +1,9 @@ --- -name: solidcraft-contributing -description: Use when someone wants to contribute code or documentation to SolidCraft, from setting up a fork and choosing an issue through submitting a pull request and responding to review. +name: makecad-contributing +description: Use when someone wants to contribute code or documentation to makeCAD, from setting up a fork and choosing an issue through submitting a pull request and responding to review. --- -# Contribute to SolidCraft +# Contribute to makeCAD Read [CONTRIBUTING.md](../../CONTRIBUTING.md), [AGENTS.md](../../AGENTS.md) (the router to the other skills), the [contributor book page](../../docs/book/src/dev/contributing.md), @@ -85,7 +85,7 @@ not modelling a part through MCP. reviewer rejects it. If something is not obvious, write it in English and keep it short. A user-visible string is not inline in the code: it goes to the message catalogs in `assets/locales/` (a new one to `assets/locales/pending/.json`), - and `skills/solidcraft-ui-text/SKILL.md` says how to name and translate it. + and `skills/makecad-ui-text/SKILL.md` says how to name and translate it. - **Parallel work runs in parallel.** When a task splits into independent parts (several files, several areas, several checks that do not depend on each other), dispatch one subagent per part and let them run concurrently instead of walking the list one item at diff --git a/skills/solidcraft-crash-safety/SKILL.md b/skills/makecad-crash-safety/SKILL.md similarity index 88% rename from skills/solidcraft-crash-safety/SKILL.md rename to skills/makecad-crash-safety/SKILL.md index bee78b86b..1ced9b8e7 100644 --- a/skills/solidcraft-crash-safety/SKILL.md +++ b/skills/makecad-crash-safety/SKILL.md @@ -1,11 +1,11 @@ --- -name: solidcraft-crash-safety -description: "Use when writing or reviewing non-test Rust in SolidCraft, handling design files, command parameters or control-channel input, calling the kernel, or investigating a crash report. A crash loses someone's work, so this outranks feature work." +name: makecad-crash-safety +description: "Use when writing or reviewing non-test Rust in makeCAD, handling design files, command parameters or control-channel input, calling the kernel, or investigating a crash report. A crash loses someone's work, so this outranks feature work." --- # Never crash -People trust SolidCraft with their designs. This outranks feature work. +People trust makeCAD with their designs. This outranks feature work. ## In non-test code - No `unwrap()`, `expect()`, `panic!`, `unreachable!`, `todo!` or `unimplemented!`. Every production crate root carries `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]`; `cargo xtask ci` runs clippy with `-D warnings`. @@ -20,7 +20,7 @@ People trust SolidCraft with their designs. This outranks feature work. ## Proving a crash fix - Every crash fix lands with a regression test. `hostile_params_never_panic` in `crates/engine/src/tests.rs` runs every command with junk parameters; a new command gets this for free. -- A crash report's `design.sc` and `replay.json` are the test's starting point. Put the test in the area's existing test file (see `skills/solidcraft-tests/SKILL.md`). +- A crash report's `design.sc` and `replay.json` are the test's starting point. Put the test in the area's existing test file (see `skills/makecad-tests/SKILL.md`). ## When someone says the app crashed The desktop app writes every panic and every unclean exit to a local crash folder, with the design and the commands that reproduce it (`solidcraft_engine::crash`, `docs/crash-reports.md`). Look there first: diff --git a/skills/solidcraft-editing/SKILL.md b/skills/makecad-editing/SKILL.md similarity index 91% rename from skills/solidcraft-editing/SKILL.md rename to skills/makecad-editing/SKILL.md index 590a32bf8..eab9eaffa 100644 --- a/skills/solidcraft-editing/SKILL.md +++ b/skills/makecad-editing/SKILL.md @@ -1,12 +1,12 @@ --- -name: solidcraft-editing -description: "Use when changing, fixing or extending an existing SolidCraft design through its MCP server - a .sc file (or an older .solidcraft one) or the design open in the app. Typical requests: resize it, move a cut, change a hole or standoff, add a fillet or chamfer, make a fixed value parametric, or a feature shows an error after a change or after the app crashed." +name: makecad-editing +description: "Use when changing, fixing or extending an existing makeCAD design through its MCP server - a .sc file (or an older .solidcraft one) or the design open in the app. Typical requests: resize it, move a cut, change a hole or standoff, add a fillet or chamfer, make a fixed value parametric, or a feature shows an error after a change or after the app crashed." --- -# SolidCraft editing +# makeCAD editing ## Overview -Edit an existing design through its parameters instead of rebuilding it. Every sketch dimension and feature input is already a parameter (`d1`, `d2`, ...), so most edits are a `parameters.change` each, sent together in one batch. Map the design with a few compact calls rather than walking the timeline one feature at a time. For command shapes and traps, in SolidCraft's own chat or any MCP client, call `skill_reference {"skill":"solidcraft-modeling"}`. Elsewhere, use `reference.md` from the `solidcraft-modeling` skill. +Edit an existing design through its parameters instead of rebuilding it. Every sketch dimension and feature input is already a parameter (`d1`, `d2`, ...), so most edits are a `parameters.change` each, sent together in one batch. Map the design with a few compact calls rather than walking the timeline one feature at a time. For command shapes and traps, in makeCAD's own chat or any MCP client, call `skill_reference {"skill":"makecad-modeling","file":"reference.md"}`. Elsewhere, use `reference.md` from the `makecad-modeling` skill. ## Map the design (3-4 calls) 1. **Open:** if the design is not open yet, run `open {path}`. When the server is bridged to the app and the current design is `dirty`, ask before opening anything. diff --git a/skills/solidcraft-file-formats/SKILL.md b/skills/makecad-file-formats/SKILL.md similarity index 84% rename from skills/solidcraft-file-formats/SKILL.md rename to skills/makecad-file-formats/SKILL.md index 794478c5b..95fe7199d 100644 --- a/skills/solidcraft-file-formats/SKILL.md +++ b/skills/makecad-file-formats/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-file-formats -description: "Use when a SolidCraft change saves something new in a design (a field, a feature type, a kind of name) or changes what older designs mean, and when touching STEP, IGES, 3MF, STL, OBJ, DXF or URDF import and export." +name: makecad-file-formats +description: "Use when a makeCAD change saves something new in a design (a field, a feature type, a kind of name) or changes what older designs mean, and when touching STEP, IGES, 3MF, STL, OBJ, DXF or URDF import and export." --- # Design file format, import and export @@ -18,7 +18,7 @@ Drawings follow the same rules with their own numbers, from 1: a drawing-format ## Import - Every import (STEP, IGES, 3MF, STL, OBJ; inserted, dropped, opened, or run as `file.insert_step`, `file.insert_mesh` or `doc.open`) becomes a new component named after the file, with the Import feature inside it. Bodies never land loose. -- Imported files are untrusted: sizes, entity counts and nesting are capped, and every kernel call is guarded (`skills/solidcraft-crash-safety/SKILL.md`). What cannot be read becomes a warning on the feature. +- Imported files are untrusted: sizes, entity counts and nesting are capped, and every kernel call is guarded (`skills/makecad-crash-safety/SKILL.md`). What cannot be read becomes a warning on the feature. - STEP is read by our own reader in `crates/kernel/src/step_in`, written from the public standards, with no third-party STEP code. The reader and what it supports: `docs/step-import.md`. - Imported assemblies are rigid by default; Unlock Contents releases them. - Kernel work (booleans, STEP/IGES import and export, tessellation) is paused except crashes and data loss: CONTRIBUTING.md, "Kernel work is paused". @@ -26,4 +26,4 @@ Drawings follow the same rules with their own numbers, from 1: a drawing-format ## Export - STEP, 3MF, STL, OBJ and URDF go through `file.export` and `file.save_mesh`; the MCP `export` tool calls them. URDF: `docs/urdf.md`. 3MF face tags: `docs/formats/3mf-face-tags.md`. - Mesh and design readers and writers live in `crates/io/src/`. Write files through `crates/io/src/safe_write.rs`. -- Reference tests for exports never take their expected values from SolidCraft's own output (`skills/solidcraft-tests/SKILL.md`). +- Reference tests for exports never take their expected values from makeCAD's own output (`skills/makecad-tests/SKILL.md`). diff --git a/skills/solidcraft-ground-rules/SKILL.md b/skills/makecad-ground-rules/SKILL.md similarity index 72% rename from skills/solidcraft-ground-rules/SKILL.md rename to skills/makecad-ground-rules/SKILL.md index a55e9619a..08bc37ffa 100644 --- a/skills/solidcraft-ground-rules/SKILL.md +++ b/skills/makecad-ground-rules/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-ground-rules -description: "Use before adding any dependency, icon, image, font, test reference data or product wording to SolidCraft, or when unsure whether something may be copied, read or named. Covers independence from other CAD products, GPL code, asset attribution and the product name." +name: makecad-ground-rules +description: "Use before adding any dependency, icon, image, font, test reference data or product wording to makeCAD, or when unsure whether something may be copied, read or named. Covers independence from other CAD products, GPL code, asset attribution and the product name." --- # Independence, licences, assets and the name @@ -21,14 +21,14 @@ The rules that cannot be broken in a PR. `AGENTS.md` lists them in one line each - Code adapted from other permissive projects (MIT OR Apache-2.0) is noted in ATTRIBUTION.md. Projects published by [storytold](https://github.com/storytold) can serve as references for implementation conventions. ## Assets: the most serious rule -- SolidCraft contains no iconography, images, fonts or artwork from commercial CAD products, ever. Screenshots of commercial CAD software are never committed. +- makeCAD contains no iconography, images, fonts or artwork from commercial CAD products, ever. Screenshots of commercial CAD software are never committed. - Every file asset is original or openly licensed and has a row in ATTRIBUTION.md. `cargo xtask assets` enforces it. - Command icons are the original SVG masters in `assets/icons/ui/design/svg/`, compiled through `crates/ui-egui/src/icon_svg.rs`. - Before any icon, icon assignment or media edit, read `assets/AGENTS.md`, `assets/icons/ui/AGENTS.md` and `assets/icons/ui/STYLE_GUIDE.md`. Use the canonical bases and named finished references there; never invent a parallel icon style. `cargo xtask icons` validates them. ## The name -- SolidCraft everywhere: crates `solidcraft-*`, binaries `solidcraft` and `solidcraft-cli`, `.sc` designs (`.solidcraft` still opens), the `solidcraft/N` format tag, `SOLIDCRAFT_*` environment variables, settings and recovery folders, the MCP server name, docs, CI and packaging. -- The old name survives only in the compatibility shims listed in `docs/compatibility.md`. Do not add new uses of it. -- Public docs, web and Flatpak deployments use project Pages `/solidcraft/`. Do not add permanent old-name Pages aliases. +- Product-facing prose, assistant replies and skill names use makeCAD (`makecad-*`). Do not introduce the previous display name. +- Existing crate and binary names (`solidcraft-*`, `solidcraft`, `solidcraft-cli`), `.sc`/`.solidcraft` designs, the `solidcraft/N` format tag, `SOLIDCRAFT_*` environment variables, settings paths and MCP bridge ids remain technical compatibility identifiers. Do not rename them as a wording change or break existing designs and integrations. +- Upstream repository URLs and licence attribution remain accurate. Deployment paths follow the host configuration. - Labels, parameter docs, messages and docs use the terms in the glossary (`docs/book/src/reference/glossary.md`): one term for each idea. A change that adds a new idea adds its term there. - Units are millimetres and radians internally; Z is up. diff --git a/skills/solidcraft-mechanisms/SKILL.md b/skills/makecad-mechanisms/SKILL.md similarity index 93% rename from skills/solidcraft-mechanisms/SKILL.md rename to skills/makecad-mechanisms/SKILL.md index c3f214ad0..5d1e43621 100644 --- a/skills/solidcraft-mechanisms/SKILL.md +++ b/skills/makecad-mechanisms/SKILL.md @@ -1,17 +1,17 @@ --- -name: solidcraft-mechanisms -description: Use when building, driving or animating an assembly or mechanism in SolidCraft through its MCP server - components, grounding, joints and joint origins, rigid groups, motion links, closed loops such as an actuator on a hinged panel or a linkage, contact sets, motion studies, degrees of freedom - or when a drive moves nothing, stops early or a part jumps when it is joined. To model the parts themselves, use solidcraft-modeling. +name: makecad-mechanisms +description: Use when building, driving or animating an assembly or mechanism in makeCAD through its MCP server - components, grounding, joints and joint origins, rigid groups, motion links, closed loops such as an actuator on a hinged panel or a linkage, contact sets, motion studies, degrees of freedom - or when a drive moves nothing, stops early or a part jumps when it is joined. To model the parts themselves, use makecad-modeling. --- -# SolidCraft mechanisms +# makeCAD mechanisms ## Overview -An assembly is components placed by joints. Work the mechanism out as world points and axes first: every pin, slide and hinge, which part each one joins, and the value you expect at each pose. Then give every joint origin by those coordinates, and check each step against a number you computed yourself. A drive that reports success can still have moved nothing. Command shapes, a worked example, the traps and reply sizes are in `reference.md` next to this file. To build the parts themselves, use `solidcraft-modeling`. +An assembly is components placed by joints. Work the mechanism out as world points and axes first: every pin, slide and hinge, which part each one joins, and the value you expect at each pose. Then give every joint origin by those coordinates, and check each step against a number you computed yourself. A drive that reports success can still have moved nothing. Command shapes, a worked example, the traps and reply sizes are in `reference.md` next to this file. To build the parts themselves, use `makecad-modeling`. -Written against SolidCraft `main` after 0.11.1, which counts the degrees of freedom of closed loops, carries motion links through chains made in any order, and answers drives in degrees with `moved` (and a `reason` when nothing could move). +Written against makeCAD `main` after 0.11.1, which counts the degrees of freedom of closed loops, carries motion links through chains made in any order, and answers drives in degrees with `moved` (and a `reason` when nothing could move). ## Before the first call -1. In SolidCraft's own chat or any MCP client, call `skill_reference {"skill":"solidcraft-mechanisms"}`. Elsewhere, read `reference.md`. +1. In makeCAD's own chat or any MCP client, call `skill_reference {"skill":"makecad-mechanisms","file":"reference.md"}`. Elsewhere, read `reference.md`. 2. **Open:** if the design is not open yet, run `open {path}`. When the server is bridged to the app and the current design is `dirty`, ask before opening anything. 3. **Map it:** run `inspect_design {"measure":false,"sketches":false}`, then `execute joint.list`. `joint.list` shows `fixed` (the grounded occurrences, always with the root, 0), `dof` per occurrence, `conflicts`, the joints, links and named origins, at about 0.5 KB per joint. `execute motion.list` lists the motion studies. 4. **Existing design:** take `edit.checkpoint` in its own call before you move bodies into components. `edit.restore_checkpoint {checkpoint}` goes back exactly, once: restoring uses the checkpoint up, so take a new one to go back again. diff --git a/skills/solidcraft-mechanisms/reference.md b/skills/makecad-mechanisms/reference.md similarity index 99% rename from skills/solidcraft-mechanisms/reference.md rename to skills/makecad-mechanisms/reference.md index c120a3bd8..f65a63cbb 100644 --- a/skills/solidcraft-mechanisms/reference.md +++ b/skills/makecad-mechanisms/reference.md @@ -1,4 +1,4 @@ -# SolidCraft mechanism reference for agents +# makeCAD mechanism reference for agents These are the shapes of the commands an assembly needs, so an agent rarely has to call `list_commands`. All of them run through the `execute` tool or a `batch`. The worked example below runs in CI (`mechanisms_skill_example_moves_as_documented` in `crates/mcp/src/tests.rs`). diff --git a/skills/solidcraft-modeling/SKILL.md b/skills/makecad-modeling/SKILL.md similarity index 92% rename from skills/solidcraft-modeling/SKILL.md rename to skills/makecad-modeling/SKILL.md index 282569ed0..ee9f7f3c1 100644 --- a/skills/solidcraft-modeling/SKILL.md +++ b/skills/makecad-modeling/SKILL.md @@ -1,17 +1,17 @@ --- -name: solidcraft-modeling -description: Use when building a new part, enclosure, bracket, plate, flange or any other 3D solid in SolidCraft through its MCP server (tools such as batch, execute, measure, screenshot), or when a SolidCraft session is using many tool calls or tokens. +name: makecad-modeling +description: Use when building a new part, enclosure, bracket, plate, flange or any other 3D solid in makeCAD through its MCP server (tools such as batch, execute, measure, screenshot), or when a makeCAD session is using many tool calls or tokens. --- -# SolidCraft modeling +# makeCAD modeling ## Overview Work the part out as numbers first. Then build it in a few large `batch` calls, and check each stage with `measure` against values you computed yourself. A clean build takes 3-4 build batches, about 10-13 calls with the checks. Command shapes, plane axes, ids, reply sizes and known traps are in `reference.md` next to this file, so you do not need to explore the command catalog. ## Before the first call -1. In SolidCraft's own chat or any MCP client, call `skill_reference {"skill":"solidcraft-modeling"}`. Elsewhere, read `reference.md`. +1. In makeCAD's own chat or any MCP client, call `skill_reference {"skill":"makecad-modeling","file":"reference.md"}`. Elsewhere, read `reference.md`. 2. Run `inspect_design {"measure":false,"sketches":false}`, even when you think the session is empty. - - The SolidCraft server's instructions end with `Backend: connected to the SolidCraft app` when it drives the user's open app, and with `Backend: headless` otherwise. + - The makeCAD server's instructions end with `Backend: connected to the makeCAD app` when it drives the user's open app, and with `Backend: headless` otherwise. - If the design has timeline features, ask before calling `new_design` or `open`, because both discard unsaved work. You can also build into the open design. 3. Write a plan: - the parameters diff --git a/skills/solidcraft-modeling/reference.md b/skills/makecad-modeling/reference.md similarity index 99% rename from skills/solidcraft-modeling/reference.md rename to skills/makecad-modeling/reference.md index a9b65b9a1..aa3e5efe8 100644 --- a/skills/solidcraft-modeling/reference.md +++ b/skills/makecad-modeling/reference.md @@ -1,4 +1,4 @@ -# SolidCraft command reference for agents +# makeCAD command reference for agents These are the shapes of the commands a part build needs, so an agent rarely has to call `list_commands`. The worked example at the end runs in CI (`skill_reference_example_builds_as_documented` in `crates/mcp/src/tests.rs`). diff --git a/skills/solidcraft-packaging/SKILL.md b/skills/makecad-packaging/SKILL.md similarity index 90% rename from skills/solidcraft-packaging/SKILL.md rename to skills/makecad-packaging/SKILL.md index 1d4d61cad..56e9f02b4 100644 --- a/skills/solidcraft-packaging/SKILL.md +++ b/skills/makecad-packaging/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-packaging -description: "Use when preparing or shipping a SolidCraft release, changing installers or packages (AppImage, MSI, dmg, Flatpak, Snap, WinGet, Nix, FreeBSD, web), release asset names, signing or the Pages deployment." +name: makecad-packaging +description: "Use when preparing or shipping a makeCAD release, changing installers or packages (AppImage, MSI, dmg, Flatpak, Snap, WinGet, Nix, FreeBSD, web), release asset names, signing or the Pages deployment." --- # Packaging and releases @@ -10,7 +10,7 @@ Development pushes are not application releases. Pushing to `main` or pushing a ## Preparing 1. Choose one version for the whole batch from the actual changes (patch, minor, major, `-rc.N`). Do not infer it from commit prefixes. Moving to `1.0` is the owner's decision. 2. Update `[workspace.package] version` in `Cargo.toml`, then `cargo update --workspace --offline`; only our own crates' `version =` lines in `Cargo.lock` change. -3. Fold the pending design-format changes with `scripts/fold-format-pending.sh` (`skills/solidcraft-file-formats/SKILL.md`). +3. Fold the pending design-format changes with `scripts/fold-format-pending.sh` (`skills/makecad-file-formats/SKILL.md`). 4. Run `cargo xtask ci` and the packaging checks in `.github/workflows/packaging-lint.yml`. Land the version commit on `main` through the normal review flow; never use `[skip ci]`. ## Building and publishing diff --git a/skills/solidcraft-performance/SKILL.md b/skills/makecad-performance/SKILL.md similarity index 89% rename from skills/solidcraft-performance/SKILL.md rename to skills/makecad-performance/SKILL.md index 742208da7..ac4647cb9 100644 --- a/skills/solidcraft-performance/SKILL.md +++ b/skills/makecad-performance/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-performance -description: "Use when a SolidCraft change is slow, blocks the window, runs long work, or must build for the browser. Covers keeping the window thread free, measuring a speed-up, the wasm build and what may be JavaScript or Python." +name: makecad-performance +description: "Use when a makeCAD change is slow, blocks the window, runs long work, or must build for the browser. Covers keeping the window thread free, measuring a speed-up, the wasm build and what may be JavaScript or Python." --- # Performance, threads and wasm @@ -16,7 +16,7 @@ description: "Use when a SolidCraft change is slow, blocks the window, runs long - Report medians with the range, the machine, and the cases. The pattern to follow is `docs/perf.md`: what was slow, why, the result, and proof that nothing changed (same bodies, volumes, areas and triangle counts). - A speed-up never skips work on a mesh's box: decide with the exact bounds (`Body::exact_bounds`, grown by the record's tolerance as `apart` in `crates/kernel/src/ops.rs` does). A mesh is for display, export, previews and mesh bodies. - Do not rewrite kernel code for speed: the kernel is being replaced, and kernel work is paused. Report a slow case with its file under the `kernel-perf` label (CONTRIBUTING.md, "Where help is wanted most"). -- Pull requests run only the tests for what they touch; geometry-heavy tests run in the merge queue. Use `cargo xtask test` with the `ci` profile locally (`skills/solidcraft-tests/SKILL.md`). +- Pull requests run only the tests for what they touch; geometry-heavy tests run in the merge queue. Use `cargo xtask test` with the `ci` profile locally (`skills/makecad-tests/SKILL.md`). ## The browser build - Everything below the apps must build for `wasm32-unknown-unknown`: `cargo xtask wasm` checks every library crate and the web app, and is part of `cargo xtask ci`. Do not add a dependency that cannot. diff --git a/skills/solidcraft-preferences/SKILL.md b/skills/makecad-preferences/SKILL.md similarity index 72% rename from skills/solidcraft-preferences/SKILL.md rename to skills/makecad-preferences/SKILL.md index 228ae4fa7..4100179bd 100644 --- a/skills/solidcraft-preferences/SKILL.md +++ b/skills/makecad-preferences/SKILL.md @@ -1,11 +1,11 @@ --- -name: solidcraft-preferences -description: "Use when a SolidCraft change alters a default behaviour, an existing shortcut or the look users already have, or adds a setting in Preferences. Covers keeping the old behaviour behind a preference and the PR's 'Changes a default' line." +name: makecad-preferences +description: "Use when a makeCAD change alters a default behaviour, an existing shortcut or the look users already have, or adds a setting in Preferences. Covers keeping the old behaviour behind a preference and the PR's 'Changes a default' line." --- # Preferences and defaults -People rely on how SolidCraft behaves today. A change that makes users see or do something different out of the box is a change of a default. +People rely on how makeCAD behaves today. A change that makes users see or do something different out of the box is a change of a default. ## The rule - Keep the old behaviour reachable. Add a preference whose old value gives the old behaviour, and test that it still does. @@ -16,10 +16,10 @@ People rely on how SolidCraft behaves today. A change that makes users see or do ## Adding a preference Settings live in the `preference_settings!` table in `crates/ui-egui/src/prefs.rs`: the field, its default, the page whose reset restores it, an optional accepted range for the control channel, and the form control. Add one row there. - A new setting that changes nothing by default needs no `yes` on the line; one that changes what users see by default does. -- Give it a label and help text through the catalogs (`skills/solidcraft-ui-text/SKILL.md`). +- Give it a label and help text through the catalogs (`skills/makecad-ui-text/SKILL.md`). - A reset on its page restores the default; fields left out of every page keep their values when defaults are restored. - Control channel: `ui.prefs {...}` reads and sets preferences by name (`docs/control-protocol.md`). -- Test it in a UI scenario or a `*_tests.rs` file next to the setting (`skills/solidcraft-tests/SKILL.md`). +- Test it in a UI scenario or a `*_tests.rs` file next to the setting (`skills/makecad-tests/SKILL.md`). ## What counts as a default Anything a user sees or does differently on first launch after the update: a changed shortcut, camera or navigation behaviour, unit, naming, theme or autosave behaviour, or a tool that appears unasked. A fix that makes the app do what it already claimed is not a default change; say so on the line. diff --git a/skills/solidcraft-reporting/SKILL.md b/skills/makecad-reporting/SKILL.md similarity index 88% rename from skills/solidcraft-reporting/SKILL.md rename to skills/makecad-reporting/SKILL.md index da3fccebb..e2bfc05d8 100644 --- a/skills/solidcraft-reporting/SKILL.md +++ b/skills/makecad-reporting/SKILL.md @@ -1,13 +1,13 @@ --- -name: solidcraft-reporting -description: Use when a SolidCraft user says something went wrong - the app crashed or closed, a command failed or gave the wrong shape, a number is off, a design no longer rebuilds, something hangs - and wants it reported or fixed upstream. Turns the problem into a minimal, reproducible bug report with exact steps, a command script, expected and actual results and a screenshot. +name: makecad-reporting +description: Use when a makeCAD user says something went wrong - the app crashed or closed, a command failed or gave the wrong shape, a number is off, a design no longer rebuilds, something hangs - and wants it reported or fixed upstream. Turns the problem into a minimal, reproducible bug report with exact steps, a command script, expected and actual results and a screenshot. --- -# SolidCraft reporting +# makeCAD reporting -A report the maintainers can act on reproduces in a fresh design, in as few steps as possible, with the exact message and numbers. Build that here, so nobody has to rebuild the problem from a description. Use `reference.md` from `solidcraft-modeling` for command shapes, and `reference/report-template.md` (next to this file) for the report. +A report the maintainers can act on reproduces in a fresh design, in as few steps as possible, with the exact message and numbers. Build that here, so nobody has to rebuild the problem from a description. Use `reference.md` from `makecad-modeling` for command shapes, and `reference/report-template.md` (next to this file) for the report. -Written against SolidCraft 0.18.2. Report what you observed, never a guessed cause: "the fillet fails with `…`", not "the kernel can't handle tangent edges". +Written against makeCAD 0.18.2. Report what you observed, never a guessed cause: "the fillet fails with `…`", not "the kernel can't handle tangent edges". ## 1. Gather (ask only for what you cannot find) - **Version and OS.** Help → About in the app, `solidcraft --version` or `solidcraft-cli --version`; the MCP server reports its version in `initialize` (`serverInfo.version`). Note whether the user built from source. @@ -41,7 +41,7 @@ Shrink while the same failure, with the same message, still happens. Re-run afte ## 5. Privacy - Never attach, upload or quote the user's design, a crash report's `design.sc`, or file contents without asking. The minimal synthetic script is the default attachment. -- GitHub does not accept `.sc` attachments. A design the user agrees to share goes up as a `.zip`: a `.sc` file is a ZIP already, so copy or rename it to `name.sc.zip`, or zip it. SolidCraft opens either kind of `.zip`. +- GitHub does not accept `.sc` attachments. A design the user agrees to share goes up as a `.zip`: a `.sc` file is a ZIP already, so copy or rename it to `name.sc.zip`, or zip it. makeCAD opens either kind of `.zip`. - Strip home folders, user names, part and project names and file paths from messages and logs (`/home/alice/clients/acme/bracket.sc` → `bracket.sc`). - Check screenshots for other windows, file names and anything personal. diff --git a/skills/solidcraft-reporting/reference/report-template.md b/skills/makecad-reporting/reference/report-template.md similarity index 90% rename from skills/solidcraft-reporting/reference/report-template.md rename to skills/makecad-reporting/reference/report-template.md index 194bfe125..d89c77d6a 100644 --- a/skills/solidcraft-reporting/reference/report-template.md +++ b/skills/makecad-reporting/reference/report-template.md @@ -3,7 +3,7 @@ Fill in every section and delete the hints in angle brackets. Keep it short: the script and the numbers say most of it. ````markdown -**Reproduced on:** SolidCraft (), , +**Reproduced on:** makeCAD (), , > ### Steps @@ -40,7 +40,7 @@ Minimal script (`solidcraft-cli run repro.json`): The shape filled in, for a command that fails with an error. (This one is expected behaviour; a real report would be one where Actual differs from Expected.) ````markdown -**Reproduced on:** SolidCraft 0.18.2 (release), Linux x86_64 +**Reproduced on:** makeCAD 0.18.2 (release), Linux x86_64 ### Steps 1. Box, 20 × 20 × 10 mm, corner at the origin. diff --git a/skills/solidcraft-tests/SKILL.md b/skills/makecad-tests/SKILL.md similarity index 88% rename from skills/solidcraft-tests/SKILL.md rename to skills/makecad-tests/SKILL.md index 5a38fc269..704a73889 100644 --- a/skills/solidcraft-tests/SKILL.md +++ b/skills/makecad-tests/SKILL.md @@ -1,6 +1,6 @@ --- -name: solidcraft-tests -description: "Use when writing, placing or running tests in SolidCraft: a regression test for a bug, an engine test for a command, a UI scenario, a reference (oracle) test, goldens, or when CI fails a test you did not touch." +name: makecad-tests +description: "Use when writing, placing or running tests in makeCAD: a regression test for a bug, an engine test for a command, a UI scenario, a reference (oracle) test, goldens, or when CI fails a test you did not touch." --- # Where tests go and how to run them @@ -11,8 +11,8 @@ The long form is `docs/book/src/dev/testing.md`. - A regression test goes into its area's existing test file (booleans, blends, shell, STEP, naming, ...), never a new file named after the bug (#3226). - Engine tests sit next to the code or in `*_tests.rs` files, measured against a value you can derive. - UI scenarios are JSON in `crates/ui-egui/tests/scenarios/*.json`. Put `{"pending": "why"}` in a scenario that records a bug before it is fixed, and remove it in the fixing PR. -- Reference tests are `tests/oracle//recipe.json` with an `expected.json` beside it, run by `cargo xtask oracle`, expected values in closed form (`tools/oracle-analytic/`) or from FreeCAD as a separate program (`tools/freecad-oracle/`). A known failure names its issue (`"known_failure": "#123"`). Never change an expected value to match SolidCraft's output, and never take one from a commercial CAD product. -- Crash fixes: a regression test from the report's `design.sc` and `replay.json` (`skills/solidcraft-crash-safety/SKILL.md`). +- Reference tests are `tests/oracle//recipe.json` with an `expected.json` beside it, run by `cargo xtask oracle`, expected values in closed form (`tools/oracle-analytic/`) or from FreeCAD as a separate program (`tools/freecad-oracle/`). A known failure names its issue (`"known_failure": "#123"`). Never change an expected value to match makeCAD's output, and never take one from a commercial CAD product. +- Crash fixes: a regression test from the report's `design.sc` and `replay.json` (`skills/makecad-crash-safety/SKILL.md`). ## Unit test or rig case - Unit tests assert the code's logic: which edges a chain picks, name resolution, history labels, refusal wording, hostile input, parsing and saving (`a_corner_round_wider_than_its_faces_overflows_and_takes_the_corners_other_edges`: per-edge radii, which no command takes). diff --git a/skills/solidcraft-ui-text/SKILL.md b/skills/makecad-ui-text/SKILL.md similarity index 91% rename from skills/solidcraft-ui-text/SKILL.md rename to skills/makecad-ui-text/SKILL.md index 29835dccf..9de81f176 100644 --- a/skills/solidcraft-ui-text/SKILL.md +++ b/skills/makecad-ui-text/SKILL.md @@ -1,11 +1,11 @@ --- -name: solidcraft-ui-text -description: "Use when adding or changing any user-visible text in SolidCraft: a label, tooltip, message, command label or a new language. Covers the message catalogs in assets/locales, sorted lists, which locales a new key needs, UK English and terminology." +name: makecad-ui-text +description: "Use when adding or changing any user-visible text in makeCAD: a label, tooltip, message, command label or a new language. Covers the message catalogs in assets/locales, sorted lists, which locales a new key needs, UK English and terminology." --- # UI text and translations -SolidCraft embeds its translations and works offline. The long form is `docs/localization.md`. +makeCAD embeds its translations and works offline. The long form is `docs/localization.md`. ## Adding a message 1. Add the id and English text in a new pending file (next section); `assets/locales/en.json` itself is only edited to change an existing message. Ids are stable: keep them when you change wording. diff --git a/skills/solidcraft-ui/SKILL.md b/skills/makecad-ui/SKILL.md similarity index 70% rename from skills/solidcraft-ui/SKILL.md rename to skills/makecad-ui/SKILL.md index cbb3b7222..7dac3505f 100644 --- a/skills/solidcraft-ui/SKILL.md +++ b/skills/makecad-ui/SKILL.md @@ -1,11 +1,11 @@ --- -name: solidcraft-ui -description: "Use when adding or changing a SolidCraft dialog, panel, menu, overlay, canvas, camera input, slider, icon or colour in crates/ui-egui. Covers the single UI container, the UI kit, navigation::handle, theme tokens, command icons and UI scenarios." +name: makecad-ui +description: "Use when adding or changing a makeCAD dialog, panel, menu, overlay, canvas, camera input, slider, icon or colour in crates/ui-egui. Covers the single UI container, the UI kit, navigation::handle, theme tokens, command icons and UI scenarios." --- # Dialogs and UI -The UI is thin: it reads engine state and acts through `app.run(id, params)` or `app.start(id)`. A dialog is a form that builds the parameters of a command (`skills/solidcraft-commands/SKILL.md`). The full control list is `docs/ui-kit.md`. +The UI is thin: it reads engine state and acts through `app.run(id, params)` or `app.start(id)`. A dialog is a form that builds the parameters of a command (`skills/makecad-commands/SKILL.md`). The full control list is `docs/ui-kit.md`. ## One outer container - All panels, floating sheets, menus, overlays and platform UI windows use `ui_kit::Container`, directly or through `Panel`, `Window`, `Confirm` and `Menu`. Declare the semantic `Surface`; workspace panels use its shared layout policy and chrome. @@ -22,10 +22,10 @@ The UI is thin: it reads engine state and acts through `app.run(id, params)` or Every page or canvas with a camera (viewport, Render preview, a flat pattern or drawing page) calls `navigation::handle` (`crates/ui-egui/src/navigation.rs`) with its `NavCaps` (orbit off for flat 2D pages). Never hand-roll camera input from drags, the wheel or pinch; `hand_rolled_camera_input_is_rejected` fails if a page does. ## Icons -Command icons are original SVG masters compiled through `crates/ui-egui/src/icon_svg.rs`. Read `assets/AGENTS.md`, `assets/icons/ui/AGENTS.md` and `assets/icons/ui/STYLE_GUIDE.md` first, add the ATTRIBUTION.md row, and run `cargo xtask icons` and `cargo xtask assets`. See `skills/solidcraft-ground-rules/SKILL.md`. +Command icons are original SVG masters compiled through `crates/ui-egui/src/icon_svg.rs`. Read `assets/AGENTS.md`, `assets/icons/ui/AGENTS.md` and `assets/icons/ui/STYLE_GUIDE.md` first, add the ATTRIBUTION.md row, and run `cargo xtask icons` and `cargo xtask assets`. See `skills/makecad-ground-rules/SKILL.md`. ## Text -Every label, tooltip and message goes through the catalogs: `skills/solidcraft-ui-text/SKILL.md`. A new behaviour that is on by default: `skills/solidcraft-preferences/SKILL.md`. +Every label, tooltip and message goes through the catalogs: `skills/makecad-ui-text/SKILL.md`. A new behaviour that is on by default: `skills/makecad-preferences/SKILL.md`. ## Look at the result -Run the app, drive it and read the screenshot: `skills/solidcraft-agent-tools/SKILL.md`. A UI scenario (`crates/ui-egui/tests/scenarios/*.json`) covers the clicks; see `skills/solidcraft-tests/SKILL.md`. Work that takes long must not block the window: `skills/solidcraft-performance/SKILL.md`. +Run the app, drive it and read the screenshot: `skills/makecad-agent-tools/SKILL.md`. A UI scenario (`crates/ui-egui/tests/scenarios/*.json`) covers the clicks; see `skills/makecad-tests/SKILL.md`. Work that takes long must not block the window: `skills/makecad-performance/SKILL.md`. diff --git a/xtask/src/skills.rs b/xtask/src/skills.rs index 7c88fe4e6..c3d4a7f3b 100644 --- a/xtask/src/skills.rs +++ b/xtask/src/skills.rs @@ -18,7 +18,7 @@ pub const ROUTER_MAX_CHARS: usize = 5000; pub const SKILL_MAX_CHARS: usize = 3600; /// Skills written before the size cap (the modelling skills carry their command shapes). const LONG_SKILLS: &[&str] = - &["solidcraft-checking", "solidcraft-contributing", "solidcraft-editing", "solidcraft-mechanisms", "solidcraft-modeling", "solidcraft-reporting"]; + &["makecad-checking", "makecad-contributing", "makecad-editing", "makecad-mechanisms", "makecad-modeling", "makecad-reporting"]; const SKIPPED_ROOTS: &[&str] = &["plan", "target", "target-wasm"]; /// A file that is checked: its path from the repository root and its text. @@ -300,7 +300,7 @@ mod tests { check(docs, &Repo { exists: &exists, roots: &roots, commands: &commands }) } - const SKILL: &str = "---\nname: solidcraft-a\ndescription: Use when a.\n---\n# A\n"; + const SKILL: &str = "---\nname: makecad-a\ndescription: Use when a.\n---\n# A\n"; fn router(table: &str) -> Doc { doc("AGENTS.md", &format!("# Router\n\n| Working on | Read |\n|---|---|\n{table}\n")) @@ -313,80 +313,79 @@ mod tests { #[test] fn a_consistent_router_passes() { - let docs = [router("| a | `skills/solidcraft-a/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", SKILL)]; - assert_eq!(problems(&docs, &["skills/solidcraft-a/SKILL.md"]), Vec::::new()); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", SKILL)]; + assert_eq!(problems(&docs, &["skills/makecad-a/SKILL.md"]), Vec::::new()); } #[test] fn a_missing_path_is_reported_and_placeholders_are_not() { let text = "See `docs/gone.md`, `docs/here.md`, `crates/doc/src/format/v/`, `crates/*/x.rs`, `plan/STATUS.md`, `~/.claude/skills/x`, `src/lib.rs`, `lib.rs`."; - let docs = [router("| a | `skills/solidcraft-a/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}{text}"))]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md", "docs/here.md"]); - assert_eq!(p, ["skills/solidcraft-a/SKILL.md: `docs/gone.md` does not exist"]); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", &format!("{SKILL}{text}"))]; + let p = problems(&docs, &["skills/makecad-a/SKILL.md", "docs/here.md"]); + assert_eq!(p, ["skills/makecad-a/SKILL.md: `docs/gone.md` does not exist"]); } #[test] fn links_resolve_from_the_file_and_fences_are_skipped() { let text = "[ok](../../docs/here.md#top) [bad](../../docs/no.md) [web](https://x.io/docs/no.md)\n```\n`docs/in-fence.md`\n```\n"; - let docs = [router("| a | `skills/solidcraft-a/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}{text}"))]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md", "docs/here.md"]); - assert_eq!(p, ["skills/solidcraft-a/SKILL.md: `../../docs/no.md` does not exist"]); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", &format!("{SKILL}{text}"))]; + let p = problems(&docs, &["skills/makecad-a/SKILL.md", "docs/here.md"]); + assert_eq!(p, ["skills/makecad-a/SKILL.md: `../../docs/no.md` does not exist"]); } #[test] fn a_skills_own_relative_path_resolves_from_its_folder() { let docs = [ - router("| a | `skills/solidcraft-a/SKILL.md` |"), - doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}`docs/scripts/x.py` `docs/other/y.py`")), + router("| a | `skills/makecad-a/SKILL.md` |"), + doc("skills/makecad-a/SKILL.md", &format!("{SKILL}`docs/scripts/x.py` `docs/other/y.py`")), ]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md", "skills/solidcraft-a/docs/scripts/x.py"]); - assert_eq!(p, ["skills/solidcraft-a/SKILL.md: `docs/other/y.py` does not exist"]); + let p = problems(&docs, &["skills/makecad-a/SKILL.md", "skills/makecad-a/docs/scripts/x.py"]); + assert_eq!(p, ["skills/makecad-a/SKILL.md: `docs/other/y.py` does not exist"]); } #[test] fn a_line_number_suffix_is_ignored() { - let docs = [router("| a | `skills/solidcraft-a/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}`docs/here.md:12-30`"))]; - assert!(problems(&docs, &["skills/solidcraft-a/SKILL.md", "docs/here.md"]).is_empty()); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", &format!("{SKILL}`docs/here.md:12-30`"))]; + assert!(problems(&docs, &["skills/makecad-a/SKILL.md", "docs/here.md"]).is_empty()); } #[test] fn an_unknown_xtask_command_is_reported() { let docs = [ - router("| a | `skills/solidcraft-a/SKILL.md` |"), - doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}Run `cargo xtask lists --fix` then `cargo xtask nope`.")), + router("| a | `skills/makecad-a/SKILL.md` |"), + doc("skills/makecad-a/SKILL.md", &format!("{SKILL}Run `cargo xtask lists --fix` then `cargo xtask nope`.")), ]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md"]); - assert_eq!(p, ["skills/solidcraft-a/SKILL.md: `cargo xtask nope` is not an xtask command"]); + let p = problems(&docs, &["skills/makecad-a/SKILL.md"]); + assert_eq!(p, ["skills/makecad-a/SKILL.md: `cargo xtask nope` is not an xtask command"]); } #[test] fn a_skill_that_does_not_exist_is_reported() { - let docs = - [router("| a | `skills/solidcraft-a/SKILL.md` |\n| b | `skills/solidcraft-b/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", SKILL)]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md"]); - assert!(p.contains(&"AGENTS.md: `skills/solidcraft-b` does not exist".to_string()), "{p:?}"); - assert!(p.contains(&"AGENTS.md: the router table lists skills/solidcraft-b/SKILL.md, which has no SKILL.md".to_string()), "{p:?}"); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |\n| b | `skills/makecad-b/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", SKILL)]; + let p = problems(&docs, &["skills/makecad-a/SKILL.md"]); + assert!(p.contains(&"AGENTS.md: `skills/makecad-b` does not exist".to_string()), "{p:?}"); + assert!(p.contains(&"AGENTS.md: the router table lists skills/makecad-b/SKILL.md, which has no SKILL.md".to_string()), "{p:?}"); } #[test] fn a_skill_missing_from_the_table_is_reported() { let docs = [ - router("| a | `skills/solidcraft-a/SKILL.md` |"), - doc("skills/solidcraft-a/SKILL.md", SKILL), - doc("skills/solidcraft-c/SKILL.md", &SKILL.replace("-a", "-c")), + router("| a | `skills/makecad-a/SKILL.md` |"), + doc("skills/makecad-a/SKILL.md", SKILL), + doc("skills/makecad-c/SKILL.md", &SKILL.replace("-a", "-c")), ]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md", "skills/solidcraft-c/SKILL.md"]); - assert_eq!(p, ["AGENTS.md: the router table does not list skills/solidcraft-c/SKILL.md"]); + let p = problems(&docs, &["skills/makecad-a/SKILL.md", "skills/makecad-c/SKILL.md"]); + assert_eq!(p, ["AGENTS.md: the router table does not list skills/makecad-c/SKILL.md"]); } #[test] fn prose_mentions_of_skills_outside_the_table_do_not_route() { - let docs = [doc("AGENTS.md", "Install into `~/.claude/skills/` or see skills/solidcraft-a.\n"), doc("skills/solidcraft-a/SKILL.md", SKILL)]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md"]); + let docs = [doc("AGENTS.md", "Install into `~/.claude/skills/` or see skills/makecad-a.\n"), doc("skills/makecad-a/SKILL.md", SKILL)]; + let p = problems(&docs, &["skills/makecad-a/SKILL.md"]); assert_eq!( p, [ - "AGENTS.md: the router table does not list skills/solidcraft-a/SKILL.md", + "AGENTS.md: the router table does not list skills/makecad-a/SKILL.md", "AGENTS.md: no router table (rows naming `skills//SKILL.md`)" ] ); @@ -394,20 +393,19 @@ mod tests { #[test] fn front_matter_must_match_the_folder() { - let docs = - [router("| a | `skills/solidcraft-a/SKILL.md` |"), doc("skills/solidcraft-a/SKILL.md", "---\nname: other\ndescription: \"\"\n---\n")]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md"]); + let docs = [router("| a | `skills/makecad-a/SKILL.md` |"), doc("skills/makecad-a/SKILL.md", "---\nname: other\ndescription: \"\"\n---\n")]; + let p = problems(&docs, &["skills/makecad-a/SKILL.md"]); assert_eq!( p, [ - "skills/solidcraft-a/SKILL.md: front matter name `other` is not the folder name `solidcraft-a`", - "skills/solidcraft-a/SKILL.md: front matter has no description" + "skills/makecad-a/SKILL.md: front matter name `other` is not the folder name `makecad-a`", + "skills/makecad-a/SKILL.md: front matter has no description" ] ); assert_eq!(front_matter("no front matter"), None); assert_eq!( - front_matter("---\r\nname: solidcraft-a\r\ndescription: Windows checkout\r\n---\r\n"), - Some(("solidcraft-a".into(), "Windows checkout".into())) + front_matter("---\r\nname: makecad-a\r\ndescription: Windows checkout\r\n---\r\n"), + Some(("makecad-a".into(), "Windows checkout".into())) ); } @@ -415,14 +413,14 @@ mod tests { fn sizes_are_capped_except_for_the_older_skills() { let long = "x".repeat(SKILL_MAX_CHARS); let docs = [ - doc("AGENTS.md", &format!("| `skills/solidcraft-a/SKILL.md` |{}", "y".repeat(ROUTER_MAX_CHARS))), - doc("skills/solidcraft-a/SKILL.md", &format!("{SKILL}{long}")), - doc("skills/solidcraft-modeling/SKILL.md", &format!("{}{long}", SKILL.replace("-a", "-modeling"))), + doc("AGENTS.md", &format!("| `skills/makecad-a/SKILL.md` |{}", "y".repeat(ROUTER_MAX_CHARS))), + doc("skills/makecad-a/SKILL.md", &format!("{SKILL}{long}")), + doc("skills/makecad-modeling/SKILL.md", &format!("{}{long}", SKILL.replace("-a", "-modeling"))), ]; - let p = problems(&docs, &["skills/solidcraft-a/SKILL.md", "skills/solidcraft-modeling/SKILL.md"]); + let p = problems(&docs, &["skills/makecad-a/SKILL.md", "skills/makecad-modeling/SKILL.md"]); assert!(p.iter().any(|m| m.starts_with("AGENTS.md is ")), "{p:?}"); - assert!(p.iter().any(|m| m.starts_with("skills/solidcraft-a/SKILL.md: ") && m.contains("split it")), "{p:?}"); - assert!(!p.iter().any(|m| m.contains("solidcraft-modeling/SKILL.md: ") && m.contains("split it")), "{p:?}"); + assert!(p.iter().any(|m| m.starts_with("skills/makecad-a/SKILL.md: ") && m.contains("split it")), "{p:?}"); + assert!(!p.iter().any(|m| m.contains("makecad-modeling/SKILL.md: ") && m.contains("split it")), "{p:?}"); } /// A SKILL.md filled to the size cap, read from a CRLF checkout: its front matter is found @@ -431,12 +429,12 @@ mod tests { fn a_crlf_checkout_is_checked_as_git_stores_it() { let root = std::env::temp_dir().join(format!("xtask-skills-crlf-{}", std::process::id())); let _ = std::fs::remove_dir_all(&root); - std::fs::create_dir_all(root.join("skills/solidcraft-a")).unwrap(); + std::fs::create_dir_all(root.join("skills/makecad-a")).unwrap(); let lines = "x\n".repeat((SKILL_MAX_CHARS - SKILL.len()) / 2); let skill = format!("{SKILL}{lines}{}", "x".repeat(SKILL_MAX_CHARS - SKILL.len() - lines.len())); let crlf = |t: &str| t.replace('\n', "\r\n"); - std::fs::write(root.join("AGENTS.md"), crlf("# Router\n\n| a | `skills/solidcraft-a/SKILL.md` |\n")).unwrap(); - std::fs::write(root.join("skills/solidcraft-a/SKILL.md"), crlf(&skill)).unwrap(); + std::fs::write(root.join("AGENTS.md"), crlf("# Router\n\n| a | `skills/makecad-a/SKILL.md` |\n")).unwrap(); + std::fs::write(root.join("skills/makecad-a/SKILL.md"), crlf(&skill)).unwrap(); let result = run(&root); let _ = std::fs::remove_dir_all(&root); assert_eq!(result, Ok(()));