MichelangeloCC
CLAUDE.md4 starsChanged 10 months agoMITView on GitHub
Claude Code-powered 3D model generator for STL files CRITICAL: 80% coverage minimum is enforced by CI
In this repositoryOne other file it gives its agents.
- 3d-modelingSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 32
Use to_mesh(tolerance) for trimesh conversion
- Very specific: line 33
Use to_stl_bytes() for direct STL export
- Distinctive: line 63
All new code must have tests
- Very specific: line 64
Run make test-cov-check before pushing
- Very specific: line 93
Use typer.Exit(1) for CLI errors
- Very specific: line 99
Use pytest.mark.asyncio for async tests
- Very specific: line 102
Use Path objects, not strings
- Very specific: line 120
Add command in cli.py under appropriate app group
- Very specific: line 121
Add tests in tests/integration/test_cli.py
- Distinctive: line 122
Update help text if needed
- Very specific: line 125
Add check method in MeshValidator class
- Very specific: line 130
Update STLExporter in exporter.py
- Distinctive: line 131
Update quality presets if needed
- Distinctive: line 132
Add tests for new functionality
- Very specific: line 137
Use print() - use Rich console
- Very specific: line 140
Commit without running make test-cov-check
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MichelangeloCC Development Guide
Claude Code-powered 3D model generator for STL files
Quick Reference
- Package:
michelangelocc - Entry Point:
mccCLI command - Python: 3.10+
- Test Coverage: 80% minimum (enforced by CI)
Project Structure
src/michelangelocc/
├── cli.py # Typer CLI - all commands
├── session.py # Interactive tmux sessions with Claude
├── core/
│ ├── modeler.py # MichelangeloModel wrapper for build123d
│ ├── exporter.py # STL export with quality presets
│ ├── validator.py # 3D printing validation checks
│ └── repairer.py # Mesh repair (PyMeshFix)
└── server/
├── app.py # FastAPI preview server
└── watcher.py # File watching for hot-reloadKey Classes & Patterns
MichelangeloModel (core/modeler.py)
- Wraps build123d Part/Solid objects
- Use
to_mesh(tolerance)for trimesh conversion - Use
to_stl_bytes()for direct STL export info()returns dict with dimensions, volume, triangle count
Export Pipeline (core/exporter.py)
ExportQuality.DRAFT # 0.1mm tolerance
ExportQuality.STANDARD # 0.01mm tolerance
ExportQuality.HIGH # 0.001mm tolerance
ExportQuality.ULTRA # 0.0001mm toleranceValidation (core/validator.py)
- Returns
ValidationResultwithis_valid,is_watertight,issues[] - Issue codes:
NOT_WATERTIGHT,DISCONNECTED_PARTS,DEGENERATE_FACES
Development Commands
make install-dev # Setup dev environment
make test # Run tests
make test-cov # Tests with coverage report
make test-cov-check # Fail if coverage < 80%
make lint # Ruff linting
make check # All checksTesting Requirements
CRITICAL: 80% coverage minimum is enforced by CI
- All new code must have tests
- Run
make test-cov-checkbefore pushing - Tests in
tests/unit/for isolated logic - Tests in
tests/integration/for CLI and server
Test Fixtures (tests/conftest.py)
temp_dir- temporary directorysample_stl- valid STL filevalid_mesh- watertight trimesh boxdisconnected_mesh- two separate cubesnon_watertight_mesh- box with hole
CI/CD Pipeline
Push/PR to main → ci.yml
├── Tests on Python 3.10, 3.11, 3.12
└── Coverage must be ≥ 80%
Release (GitHub Actions UI) → release.yml
├── Run tests
├── Bump version (patch/minor/major)
├── Tag and push
└── Publish to PyPICode Patterns to Follow
Error Handling
- Return result objects (ExportResult, ValidationResult) instead of exceptions
- Use
typer.Exit(1)for CLI errors - Graceful degradation (PyMeshFix is optional)
Async Code
- Server uses FastAPI async routes
- File watcher uses asyncio callbacks
- Use
pytest.mark.asynciofor async tests
File Operations
- Use
Pathobjects, not strings - Watchdog handles atomic writes (temp + rename)
- 0.5s debounce on file changes
Dependencies
| Package | Purpose |
| build123d | CAD kernel |
| trimesh | Mesh processing |
| pymeshfix | Mesh repair |
| typer | CLI framework |
| fastapi | Preview server |
| watchdog | File monitoring |
Common Tasks
Adding a New CLI Command
- Add command in
cli.pyunder appropriate app group - Add tests in
tests/integration/test_cli.py - Update help text if needed
Adding a New Validation Check
- Add check method in
MeshValidatorclass - Define new issue code constant
- Add tests in
tests/unit/test_validator.py
Modifying Export Pipeline
- Update
STLExporterinexporter.py - Update quality presets if needed
- Add tests for new functionality
DO NOT
- Skip tests - 80% coverage is mandatory
- Use
print()- use Rich console - Hardcode paths - use Path objects
- Block the main thread in server code
- Commit without running
make test-cov-check
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

