Change the repository
This page is for an agent that changes the code, the site or the documentation in this repository.
- Write all comments and docstrings in English.
- Keep
geom.py,expr.py,frames.py,csg.py,options.py,interference.py,mjcf.pyand__init__.pyfree of imports outside the standard library at module level. The browser runs these files in Pyodide. - When you change how a solid is built in
src/asfinger/mesh.py, make the same change insite/src/engine/csg.ts. Do the same in the other direction. - Do not rename these names. They are part of file formats or stored data:
ipush_tool.xml,ipush_print, the MJCF bodyipush, the classesipush_colandipush_vis, the local storage keysipush.editor.v3andipush.theme, the frame names, the config keys and the config file names, the HTTP path/ipush/apply, the port 47910, the health replyipush-fusion, and the attribute groupipushwith its keys in a Fusion design. - Change the product name only in
PRODUCT_NAME(src/asfinger/__init__.py) and inPRODUCTandEDITOR_NAME(site/src/i18n/index.ts). - If a change is not meant to change geometry, build the default config before and after it and confirm that every STL file and
ipush_tool.xmlare identical. - Do not edit a stored
resultof a solved frame by hand. Runasfinger build CONFIG -o OUT --resolve. - When you change a page in
docs/en/, make the same change indocs/zh/. Do the same in the other direction. Write the Chinese text as original Chinese. - Do not edit generated files:
site/public/py,site/public/configs,site/public/assets,site/public/pyodide,site/public/docs,site/public/zh,site/public/llms.txt,site/public/llms-full.txt,site/src/content/docs. - Do not commit files from
docs/internal/, and do not link to them from public pages. - Every file in
hardware/configs/is published with the site. Do not add a config there unless the user asks for it. - Add third-party material only with its licence, and record it in
NOTICE. - Change the version only in
pyproject.toml. - The code in
hardware/cad/fusion/runs inside Autodesk Fusion. Do not start Fusion, do not load the add-in, and do not change a Fusion document to test it. Run the tests, and tell the user to try the change in Fusion. - The code in
robot/moves a real arm. Never run a command that connects to the real arm or to a phone from an agent session unless the operator is at the arm and asked for that command. Everything with--simis free to run. - Do not refactor
robot/. A change that can alter a motion needs a run on the real arm by the owner of the setup. Say in your report what was run in the simulator and that nothing was run on the arm. - Do not commit
sim/twin_registration.yaml, records of a calibration or a registration (the recordings used, dates, residuals), or raw measurements. A result file holds the values in use and nothing else. - Do not commit the arm meshes in
sim/assets/meshes/b601_rs_official/. They are downloaded bysim/fetch_arm_meshes.py; onlySOURCE.mdandSHA256SUMSare in git. - Do not write an address, a device id or a host name of the setup into a tracked file. They belong in
robot/cameras.local.yaml. Do not commit files fromcalibration/data/ordata/, and do not add photos of the setup. robot/arm_sign_check.pyandrobot/arm_listen_ab.pyconnect to the arm at once, also with--help. Do not start them to read their usage; read the docstring.- Do not push tags and do not change the deployment settings. Tell the user what to do.
Code map
Section titled “Code map”| Path | Content |
|---|---|
src/asfinger/__init__.py |
Model: load, set, resolve, check, interference, build. PRODUCT_NAME. |
src/asfinger/__main__.py |
The command line (build, frames, send). |
src/asfinger/expr.py |
Parameter expressions. |
src/asfinger/frames.py |
Frame tree and solvers. |
src/asfinger/csg.py |
Shape trees. |
src/asfinger/options.py |
Options. |
src/asfinger/interference.py |
Interference rules. |
src/asfinger/mesh.py |
Solids, STL, mass (numpy, manifold3d). |
src/asfinger/mjcf.py, preview.py, build.py |
Writers of the output files. |
tests/test_default.py |
Tests of the configs in hardware/configs/. |
tests/test_docs.py |
Tests of the documentation: same pages in both languages, the example config builds. |
src/asfinger/designer/ |
The designer: catalog, tool heads (heads.py writes hardware/configs/tool_rod.json), brief, rules, loop, models, asfinger design, asfinger-mcp, and web.py for the designer page. See Architecture. |
plugin/, .claude-plugin/marketplace.json |
The designer as a plugin: the MCP server entry and the skill. plugin/mcpb/ holds the manifest, the dependency list and the entry point of the file for Claude Desktop. |
tests/test_designer.py |
Tests of the designer. |
tests/test_send.py, tests/test_fusion_addin.py |
Tests of asfinger send, and of the Fusion add-in with stand-ins for the adsk modules. |
tests/test_release.py |
Tests of the release zips: each bundle packs, and the Fusion zip works outside the repository. |
hardware/configs/, hardware/assets/ |
Configs and the meshes they import. |
robot/ |
Scripts for the real arm. arm is the rebot-control wrapper; arm_*.py are arm tools and calibration; teleop*.py teleoperation; episode.py, record.py, to_lerobot.py data; snapshot.py, tags.py, make_tags.py, calibrate_color.py cameras and markers. |
calibration/ |
The calibration files that the tools read. calibration/data/ is local and ignored. |
sim/ |
The first MuJoCo scene (scene.py, scene.yaml) with its registration (register.py, registration.yaml), and the twin scene (twin.py, twin.yaml, twin_view.py, twin_filament.py, fetch_arm_meshes.py). The camera poses and the board geometry of the twin are parameters in twin.yaml. |
tests/robot/ |
Tests of the robot side in the simulator. They need uv sync --group robot. |
hardware/objects/flip_cube/ |
The flip cube, a task object: the CAD source flip_cube_cq.py and its STL files, the sticker sheets (flip_cube_tags.py), and the marker layout with its generated files (flip_cube_markers.py). tests/test_flip_cube.py checks the STL files, tests/robot/test_flip_cube.py the markers and the model. |
hardware/cad/fusion/ |
The Fusion add-in (asFingerAddIn), its script (asFingerFromJSON) and their shared module (asfinger_fusion). In each folder, the folder, the .py file and the .manifest file have the same name. |
site/scripts/sync-core.mjs, sync-docs.mjs |
Copy the package, the configs and the docs into the site before a build. |
site/src/engine/ |
The web worker (Pyodide and Manifold). |
site/src/editor/, site/src/data/, site/src/i18n/ |
The editor, its catalog, its text. |
site/src/designer/ |
The designer page. |
site/src/pages/, site/src/components/ |
The landing page, the editor page and the designer page. |
site/astro.config.mjs |
Site address, base path, Starlight sidebar. |
docs/en/, docs/zh/ |
The documentation source. |
.github/workflows/ |
CI, the deployment of the site, and the release (release.yml). |
release/ |
The files of a release: bundles.toml lists the zips, pack.py makes them, readme/ holds the README of each zip. |
Checks
Section titled “Checks”Run these commands before you finish. All of them must pass.
uv run ruff checkuv run ruff format --checkuv run pytestIf the change touches site/, docs/, src/asfinger/ or hardware/, also run:
cd site && npm ci && npm run buildIf the change touches robot/, sim/ or calibration/, also run:
uv sync --group robot --python 3.12 && uv run --group robot pytest tests/robotCommon tasks
Section titled “Common tasks”Add a parameter to a config
Section titled “Add a parameter to a config”- Add the parameter to
paramsin the config, and use it in a frame or a shape. - If a solver uses it, run
uv run asfinger build CONFIG -o out/x --resolveto store the new result. - If the editor must show it, add an entry to
site/src/data/pusherParams.tswith a label in English and in Chinese. - Add or change a test in
tests/test_default.py. - Run the checks.
Add a shape type or a frame feature
Section titled “Add a shape type or a frame feature”- Add the resolution to
csg.pyorframes.py. - For a new leaf shape, add it to
mesh.py, tomjcf.pyand tosite/src/engine/csg.ts. - Describe it in
docs/en/user/config-file.mdorframes.md, and in the Chinese pages. - Add a test. Run the checks and the site build.
Add an interference rule
Section titled “Add an interference rule”- Add the rule to
interferencein the config, withid,msg(Chinese) andmsg_en. - Add a test that makes the rule fail and a test that the default passes.
- Add the rule to the table in
docs/en/user/checks.mdanddocs/zh/user/checks.md.
Add a documentation page
Section titled “Add a documentation page”- Create the page with the same file name in
docs/en/anddocs/zh/. - Add the file name to
ORDERinsite/scripts/sync-docs.mjs. - Link the page from the index page of its section in both languages.
- Run
uv run pytestandcd site && npm run build.
Change text in the editor
Section titled “Change text in the editor”- Change the entry in
site/src/i18n/index.ts, in English and in Chinese. - For catalog items and parameter labels, change
site/src/data/catalog.tsorpusherParams.ts. - For the guide, change
site/src/data/guide.ts. - Run
cd site && npm run build.
Release a version
Section titled “Release a version”- Change
versioninpyproject.toml, and the sameversioninplugin/.claude-plugin/plugin.json,plugin/mcpb/manifest.jsonandplugin/mcpb/pyproject.toml. A test compares them. - Run the checks.
- Tell the user to create the tag
v<version>. Do not push tags yourself.
When the tag is pushed, the workflow release.yml runs python release/pack.py --tag v<version> and puts the zips, SHA256SUMS.txt and the notes on the GitHub Release of the tag. It stops when the tag does not match the version in pyproject.toml. To look at the zips before a tag, run python release/pack.py (they go to dist/release/), or run the workflow by hand without a tag.
Publish another file with the releases
Section titled “Publish another file with the releases”- Add a
[[bundle]]torelease/bundles.tomlwithname,titleandinclude, and a README inrelease/readme/if people install the bundle by hand. The keys are described at the top of the file. An archive that a program opens, such as the.mcpbfile for Claude Desktop, also setsflat,topandext. - Only files tracked by git go into a zip. Do not add files that must not be published (see the rules above).
- If the bundle must work on its own, add a test to
tests/test_release.pythat extracts it and uses it. - Run the checks. To add the bundle to a release that exists, ask the user to run the workflow Release by hand with that tag.