agentleFS
saitotakeuchisaitotakeuchi/MichelangeloCC/CLAUDE.md

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.

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
  1. Very specific:

    Use to_mesh(tolerance) for trimesh conversion

    line 32
  2. Very specific:

    Use to_stl_bytes() for direct STL export

    line 33
  3. Distinctive:

    All new code must have tests

    line 63
  4. Very specific:

    Run make test-cov-check before pushing

    line 64
  5. Very specific:

    Use typer.Exit(1) for CLI errors

    line 93
  6. Very specific:

    Use pytest.mark.asyncio for async tests

    line 99
  7. Very specific:

    Use Path objects, not strings

    line 102
  8. Very specific:

    Add command in cli.py under appropriate app group

    line 120
  9. Very specific:

    Add tests in tests/integration/test_cli.py

    line 121
  10. Distinctive:

    Update help text if needed

    line 122
  11. Very specific:

    Add check method in MeshValidator class

    line 125
  12. Very specific:

    Update STLExporter in exporter.py

    line 130
  13. Distinctive:

    Update quality presets if needed

    line 131
  14. Distinctive:

    Add tests for new functionality

    line 132
  15. Very specific:

    Use print() - use Rich console

    line 137
  16. Very specific:

    Commit without running make test-cov-check

    line 140

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

MichelangeloCC Development Guide

Claude Code-powered 3D model generator for STL files

Quick Reference

  • Package: michelangelocc
  • Entry Point: mcc CLI 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-reload

Key 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 tolerance

Validation (core/validator.py)

  • Returns ValidationResult with is_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 checks

Testing Requirements

CRITICAL: 80% coverage minimum is enforced by CI

  • All new code must have tests
  • Run make test-cov-check before pushing
  • Tests in tests/unit/ for isolated logic
  • Tests in tests/integration/ for CLI and server

Test Fixtures (tests/conftest.py)

  • temp_dir - temporary directory
  • sample_stl - valid STL file
  • valid_mesh - watertight trimesh box
  • disconnected_mesh - two separate cubes
  • non_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 PyPI

Code 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.asyncio for async tests

File Operations

  • Use Path objects, not strings
  • Watchdog handles atomic writes (temp + rename)
  • 0.5s debounce on file changes

Dependencies

PackagePurpose
build123dCAD kernel
trimeshMesh processing
pymeshfixMesh repair
typerCLI framework
fastapiPreview server
watchdogFile monitoring

Common Tasks

Adding a New CLI Command

  1. Add command in cli.py under appropriate app group
  2. Add tests in tests/integration/test_cli.py
  3. Update help text if needed

Adding a New Validation Check

  1. Add check method in MeshValidator class
  2. Define new issue code constant
  3. Add tests in tests/unit/test_validator.py

Modifying Export Pipeline

  1. Update STLExporter in exporter.py
  2. Update quality presets if needed
  3. 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.