Skip to content

Restructure CLAUDE.md into skills; add Sphinx docs on GitHub Pages - #2

Merged
taw181 merged 2 commits into
mainfrom
documentation
Aug 27, 2026
Merged

taw181 merged 2 commits into
mainfrom
documentation

Conversation

@taw181

@taw181 taw181 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

This branch has two parts.


Part 2 — Sphinx documentation + GitHub Pages (commit 21f20f2)

Adds a Sphinx build and deploys it to GitHub Pages.

  • API reference auto-generated from docstrings by sphinx-apidoc at build time (not checked in), covering servers/, configuration/, coordinators/, loggers/, analysis/, drivers/.
  • Narrative skeleton: index, getting-started, architecture (Markdown via MyST) — deliberately short.
  • Furo theme; hardware/GPU imports mocked so the build runs anywhere.

.github/workflows/docs.yml: build on every push/PR (fails CI if the docs don't build); deploy main to https://coldmatter.github.io/pytweezer/ (Pages source already set to "GitHub Actions").

poetry install --with docs
cd docs && poetry run make html

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 to docs/notes/ (byte-identical, not rendered) and docs/ becomes the Sphinx source root.

Excluded from the API reference (rationale in docs/Makefile)

  • GUI/, bin/ — out of scope for now
  • servers/model_sync.py — reads CONFIG["Servers"]["Model Sync"] at import, not always present (looks like a latent bug)
  • drivers/thorcam.py, drivers/tweezermonitorcam.py — module-level pll.par[...] = ... the import mock can't satisfy

Minor source fixes (warning-free build)

  • projections.py: bullet-list indentation in the module docstring
  • device_status.py: one-line docstring on the status_received signal

CI 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.md was 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 the get_logger convention, 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:

Skill Covers
pytweezer-architecture server/client split, CONFIG categories, get_config() vs paths.py, launch protocol and dual-mode main(), messaging fabric, logging
pytweezer-device-framework get_device() addressing, simulation, composites and coordinators, what blocks what over RPC, running calls concurrently
pytweezer-gui-internals TabbedGUI vs the legacy BWidget stack, teardown, dock-based tabs, the three status sources, Device Status service

Skills 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. The docs/*.md pointers left in source, tests and tools are rewritten to stand on their own; the SLM preload/hardware-trigger optimisation is preserved in the rearrangement.py docstring.

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-logger trimmed 279 → 217 lines: dropped the walkthrough of base.py behaviour that's readable off the code, kept every gotcha.

Verification

ruff check and ruff format --check clean; 126 tests pass. Source changes are docstrings and comments only.

🤖 Generated with Claude Code

twalker27 and others added 2 commits August 27, 2026 13:07
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>
@taw181 taw181 changed the title Restructure CLAUDE.md into on-demand skills Restructure CLAUDE.md into skills; add Sphinx docs on GitHub Pages Aug 27, 2026
@taw181
taw181 merged commit ffee264 into main Aug 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant