Restructure CLAUDE.md into skills; add Sphinx docs on GitHub Pages - #2
Merged
Merged
Conversation
CLAUDE.md was carrying ~170 lines of architecture prose on every agent run, much of it only relevant to one task in twenty. Cut it to 129 lines - what this is, commands, conventions, and a short architecture summary that routes to skills - and move the detail into three new orientation skills: - pytweezer-architecture: server/client split, CONFIG, launch protocol, messaging fabric, logging - pytweezer-device-framework: device server/client, addressing, composites and coordinators, RPC blocking rules, running calls concurrently - pytweezer-gui-internals: shell and panels, the three status sources, Device Status service, teardown The skills are self-contained rather than pointers into docs/, which is being retired: the conventions, constraints and rationale that aren't readable off the code now live in them. Same for the InfluxDB setup recipe, which moves into add-logger. Also corrects the "two-PC split" framing - it is one server PC and arbitrarily many clients - and de-dangles the docs/*.md references left in source, tests and tools. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sphinx docs under docs/: a curated API reference auto-generated from docstrings by sphinx-apidoc at build time (not checked in), plus a light narrative skeleton (index, getting-started, architecture). Furo theme, MyST for Markdown pages, hardware/GPU imports mocked so the build runs anywhere. - pyproject.toml: new optional "docs" dependency group - docs/Makefile: `make html` runs sphinx-apidoc then sphinx-build - .github/workflows/docs.yml: build on every push/PR, deploy main to GitHub Pages (https://coldmatter.github.io/pytweezer/) - docs/notes/: the 7 pre-existing design notes, moved (not rendered) - excluded from the API reference: GUI/, bin/, servers/model_sync.py (reads an absent CONFIG key), and the two Thorlabs camera wrappers (module-level work the import mock can't satisfy) Minor source fixes for a warning-free build: - projections.py: bullet-list indentation in the module docstring - device_status.py: docstring on the status_received signal Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch has two parts.
Part 2 — Sphinx documentation + GitHub Pages (commit
21f20f2)Adds a Sphinx build and deploys it to GitHub Pages.
sphinx-apidocat build time (not checked in), coveringservers/,configuration/,coordinators/,loggers/,analysis/,drivers/.index,getting-started,architecture(Markdown via MyST) — deliberately short..github/workflows/docs.yml: build on every push/PR (fails CI if the docs don't build); deploymainto https://coldmatter.github.io/pytweezer/ (Pages source already set to "GitHub Actions").Interaction with Part 1
Part 1 said
docs/was being retired and its deletion was left to @twalker27. That is now superseded: the 7 design notes move todocs/notes/(byte-identical, not rendered) anddocs/becomes the Sphinx source root.Excluded from the API reference (rationale in
docs/Makefile)GUI/,bin/— out of scope for nowservers/model_sync.py— readsCONFIG["Servers"]["Model Sync"]at import, not always present (looks like a latent bug)drivers/thorcam.py,drivers/tweezermonitorcam.py— module-levelpll.par[...] = ...the import mock can't satisfyMinor source fixes (warning-free build)
projections.py: bullet-list indentation in the module docstringdevice_status.py: one-line docstring on thestatus_receivedsignalCI note
The docs job runs
poetry install --with docs, installing the full dependency tree (autodoc imports the real modules). If a heavy wheel fails in CI, a leaner docs-only install can be carved out.Part 1 — Restructure CLAUDE.md into on-demand skills (commit
b5a657e)Why
CLAUDE.mdwas 267 lines, ~170 of them architecture prose loaded into context on every agent run — most of it relevant to maybe one task in twenty. Its own opening section says situational material belongs in a skill; this makes it follow its own advice.What changed
CLAUDE.md: 267 → 129 lines. Keeps what applies to every run (what this is, commands, docstring/comment/TODO/git conventions) plus a short architecture summary that routes to skills. Adds theget_loggerconvention, which is broad enough to stay always-on.Three new orientation skills, covering understanding and modifying the frameworks — the existing
add-*skills already cover creating new instances:pytweezer-architectureget_config()vspaths.py, launch protocol and dual-modemain(), messaging fabric, loggingpytweezer-device-frameworkget_device()addressing, simulation, composites and coordinators, what blocks what over RPC, running calls concurrentlypytweezer-gui-internalsTabbedGUIvs the legacyBWidgetstack, teardown, dock-based tabs, the three status sources, Device Status serviceSkills are self-contained. The conventions, constraints and rationale that can't be read off the code now live in the skills — including the one-command InfluxDB setup, which moves into
add-logger. Thedocs/*.mdpointers left in source, tests and tools are rewritten to stand on their own; the SLM preload/hardware-trigger optimisation is preserved in therearrangement.pydocstring.Correction: the old "two-PC role split" framing is wrong — it's one server PC and arbitrarily many client PCs, each running whatever devices are attached to it. Fixed throughout.
add-loggertrimmed 279 → 217 lines: dropped the walkthrough ofbase.pybehaviour that's readable off the code, kept every gotcha.Verification
ruff checkandruff format --checkclean; 126 tests pass. Source changes are docstrings and comments only.🤖 Generated with Claude Code