Refresh CLAUDE.md for v1.2.0 and add a user-facing skill#100
Merged
Conversation
Problem: CLAUDE.md had drifted from the v1.2.0 codebase (it still
warned that directory-wide pytest collection returns zero tests, did
not mention DeviceController, described the laser-source family as a
single base class rather than capability mixins, and had no Thorlabs
Kinesis backend or release/versioning guidance). There was also no
concise, runnable guide for people who only want to *use* the library
to control hardware.
Solution:
- Refine CLAUDE.md in place (structure and house rules preserved):
- pytest now collects hardwarelibrary/tests/ via pyproject.toml
(python_files=["test*.py"], testpaths); note CI + Sphinx/RTD.
- Add DeviceController to the core architecture.
- Correct the laser-source family to capability mixins (OnOffControl,
ShutterControl, PowerControl, WavelengthControl, ...); document the
same shape for DAQ; add the Thorlabs Kinesis/pylablib dispatcher
and the thorlabs extra.
- New "Versioning and releases" section: tag vX.Y.Z -> publish.yml
(PyPI Trusted Publishing + GitHub Release), setuptools-scm version,
CHANGELOG.md is the source of truth.
- Cheatsheet: whole-suite run + testDeviceController/testThorlabs.
- Add .claude/skills/pyhardwarelibrary/SKILL.md: a user-facing skill
covering the device lifecycle, discovery, debug devices, per-family
public API, NotificationCenter events, and DeviceController. All code
examples were smoke-tested against the installed library.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Problem: review of the new guides surfaced three inaccuracies.
- CLAUDE.md said test_pylablib_kinesis.py uses skipUnless; it uses
skipTest().
- LinearMotionDevice.mapPositions had a wrong docstring: it claimed
the direction values were "leftRight"/"zigzag" (the Direction enum
is unidirectional/bidirectional) and that it returns position tuples
usable directly in moveTo, when it actually returns
{"index", "position"} dicts with positions in microns (so they suit
moveInMicronsTo, not moveTo).
- SKILL.md mirrored that wrong mapPositions usage.
Solution: correct the CLAUDE.md wording, rewrite the mapPositions
docstring to match the real return shape and direction values, and
update the SKILL.md example to iterate the dicts and feed
point["position"] to moveInMicronsTo.
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Two documentation additions, no code changes.
CLAUDE.md— refined in place (for AI-assisted contributors)Updated the parts that drifted with the v1.2.0 release, keeping the existing structure and house rules:
pyproject.tomlnow setspython_files=["test*.py"]+testpaths, sopytest hardwarelibrary/tests/works. Added the CI / Sphinx / ReadTheDocs note.DeviceController(v1.2.0 headless worker-thread wrapper).OnOffControl,ShutterControl,PowerControl,WavelengthControl, …); documented the same shape for DAQ; added the Thorlabs Kinesis/pylablib backend dispatcher and thethorlabsextra.vX.Y.Z→publish.yml(PyPI Trusted Publishing + GitHub Release),setuptools-scm-derived version,CHANGELOG.mdas source of truth.testDeviceController.py/testThorlabs.py..claude/skills/pyhardwarelibrary/SKILL.md— new user-facing skillAn auto-discoverable Claude Code skill for people who want to use the library to control hardware: device lifecycle, discovery (
Spectrometer.any()vs. constructing concrete classes), hardware-freeDebugXxxDeviceusage, a per-family quick reference with exact public methods,NotificationCenterevents, theDeviceControllerpattern, and gotchas.Testing
Every code example in the skill was smoke-tested against the installed library (debug devices for motion, DAQ, and laser;
Spectrometer.any()/DeviceControllerimport checks) — all pass.🤖 Generated with Claude Code