Skip to content

Refresh CLAUDE.md for v1.2.0 and add a user-facing skill#100

Merged
dccote merged 2 commits into
masterfrom
docs/claude-and-skill-guides
Jun 28, 2026
Merged

Refresh CLAUDE.md for v1.2.0 and add a user-facing skill#100
dccote merged 2 commits into
masterfrom
docs/claude-and-skill-guides

Conversation

@dccote

@dccote dccote commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Running things: corrected the stale "directory collection returns zero tests" note — pyproject.toml now sets python_files=["test*.py"] + testpaths, so pytest hardwarelibrary/tests/ works. Added the CI / Sphinx / ReadTheDocs note.
  • Architecture: added DeviceController (v1.2.0 headless worker-thread wrapper).
  • Device families: corrected the laser-source family to capability mixins (OnOffControl, ShutterControl, PowerControl, WavelengthControl, …); documented the same shape for DAQ; added the Thorlabs Kinesis/pylablib backend dispatcher and the thorlabs extra.
  • New "Versioning and releases" section: tag vX.Y.Zpublish.yml (PyPI Trusted Publishing + GitHub Release), setuptools-scm-derived version, CHANGELOG.md as source of truth.
  • Cheatsheet: whole-suite run + testDeviceController.py / testThorlabs.py.

.claude/skills/pyhardwarelibrary/SKILL.md — new user-facing skill

An 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-free DebugXxxDevice usage, a per-family quick reference with exact public methods, NotificationCenter events, the DeviceController pattern, 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() / DeviceController import checks) — all pass.

🤖 Generated with Claude Code

dccote and others added 2 commits June 27, 2026 19:38
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>
@dccote
dccote merged commit dd06a52 into master Jun 28, 2026
14 checks passed
@dccote
dccote deleted the docs/claude-and-skill-guides branch June 28, 2026 04:06
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