Repository navigation
Docs: Claude Code driver authoring guide - #14
Conversation
Adds docs/writing-a-driver-with-claude-code.md — a hands-on recipe for using Claude Code to bootstrap a new 42W Lua driver from a vendor-supplied Modbus or MQTT register map. Covers prerequisites, a prompt recipe (including the starter prompt and catalog-loader iteration), a 15-item porting checklist, pitfalls Claude Code falls into (single-arg host.log, missing endianness suffix on decoders, missing set_sn/default_mode, bare modbus_read, wrong sign convention), a sim + curl + log-tail iteration loop, and PR review criteria. Links the new guide from README.md under a new "Driver development" section placed after Quick Start. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
0828039 to
a086fca
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0828039cff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| 17 drivers covering 15 manufacturers across 2 protocols. Read-only: 11. | ||
| With control: 6. |
There was a problem hiding this comment.
Align shipped-driver counts with repository state
This section declares 17 shipped drivers across 15 manufacturers, but the repository currently only contains two Lua drivers under drivers/ (ferroamp.lua and sungrow.lua). Since this new catalog is linked as the authoritative support list, readers will be told devices are supported when no driver file exists, which can send integrations down a dead path. Please either restrict the catalog/counts to checked-in drivers or clearly mark non-existent entries as planned.
Useful? React with 👍 / 👎.
| Now run `cd go && go test -count=1 -run TestCatalog ./internal/drivers/` | ||
| and fix anything the catalog loader rejects. |
There was a problem hiding this comment.
Replace nonexistent catalog test command
The guide asks contributors to run go test -count=1 -run TestCatalog ./internal/drivers/, but there is no TestCatalog test in go/internal/drivers, so this command does not validate catalog parsing as described. That gives a false pass signal and can let malformed DRIVER metadata through this checkpoint; the doc should reference an actual test target (or add one) for catalog-loader validation.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
docs/writing-a-driver-with-claude-code.md: a hands-on recipe for contributors using Claude Code to bootstrap a new 42W Lua driver from a vendor-supplied Modbus or MQTT register map. Covers prerequisites, the starter prompt (with catalog-loader iteration step), a 15-item porting checklist, common Claude Code pitfalls (single-arghost.log, missing endianness suffix on decoders, missingset_sn/driver_default_mode, baremodbus_read, wrong sign convention), a sim + curl + log-tail iteration loop, and PR review criteria.README.md(placed after Quick Start) linking the new guide alongsidedocs/writing-a-driver.mdand the two reference drivers.Test plan
cd go && go test ./...passes locally (all packages green).docs/testing-drivers-live.mdis an intentional forward reference to a sibling unit currently under development.Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]