victron
CLAUDE.md4 starsChanged 13 days agoMITView on GitHub
Node-RED control for a Victron Cerbo GX (Venus OS): battery / grid control under Norwegian capacity tariffs, a Tuya heat pump with boiler (DHW), room sensors and the dashboards. The live GX runs flows.json; everything else is source, tools, tests and docs. camera-ai/ is a separate project with its own README and PLAN. 1. git fetch origin; master tip and d# / i# (node tools/flows.js version); what the GX runs (last Deploy GX code run). 2. Open PRs and checks:…
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- claude-review-tokenSkill
- deploy-gxSkill
- gx-camera-keySkill
- gx-reachSkill
- loop-tokenSkill
- ship-prSkill
- test-gx-localSkill
- victron-statusSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Self-improvement: when the process costs time or fails, fix it, then update the rule (this file, the guide, docs/agent-workflow.md, …
- Very specific: line 62
Branches and PRs: every change on its own branch from a fresh origin/master, in its own worktree, PR into master.
- Very specific: line 68
Tasks live only in
BACKLOG.md: add the task before the branch, set "in progress" with branch / PR, move to Done with PR and d# in the … - Very specific: line 74
Live GX, secrets, real backups: never touch without an explicit owner request.
- Distinctive: line 94
Every report ends with the branch name.
- Very specific: line 107
Write .copilot-brief-<branch>.md in that worktree (goal, context, steps, tests, delivery: PR, then auto-merge after review feedback is …
- Very specific: line 110
After the PR merges: herdr-task.ps1 close <branch>.
- Very specific: line 127
Test GX takes ~70 min (slowest file).
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md: working in this repository
Node-RED control for a Victron Cerbo GX (Venus OS): battery / grid control under Norwegian capacity tariffs, a Tuya
heat pump with boiler (DHW), room sensors and the dashboards. The live GX runs flows.json; everything else is source,
tools, tests and docs. camera-ai/ is a separate project with its own README and PLAN.
Start of every session (before any work)
git fetch origin; master tip andd#/i#(node tools/flows.js version); what the GX runs (last Deploy GX code run).- Open PRs and checks:
gh pr list --state open,gh pr checks <N>. - Herdr:
herdr status→running, else startherdrin its own terminal tab viarun_in_terminalso Claude canread_terminalit (never restart a running server without the owner).herdr agent list, thenreadevery worker. BACKLOG.md: in progress / next. Then tell the owner in a few lines what is running.
Full rules (from Claude's memory and the owner's decisions): docs/claude-operating-guide.md.
Self-improvement: when the process costs time or fails, fix it, then update the rule (this file, the guide,
docs/agent-workflow.md, .github/copilot-instructions.md, a skill or memory) in the same session and add a line to
docs/agent-process-log.md, the dated log of what is going on.
Where things are
| Path | What |
NN Name.js / NN Name.html (root) | Source of every function node / dashboard template. Edit these, never flows.json by hand. |
NN Name.init.js | The node's "On Start" code |
lib/heat-pump/*.js, lib/grid/*.js | Pulled in by // #include lib/…js at build time (tools/includes.js): same scope as the node, not modules. A library may serve multiple sources only with //! @shared in its header. //! header lines are not embedded. |
flows.json | Built from the NN sources by tools/flows.js sync; the tab label carries the version d#<n> |
tests/*.test.js | Unit tests (node:test); tests/harness.js loads a node with fake flow / context |
tools/flows.js | sync, check, bump |
tools/test-gx/ | Test GX: Venus simulator + Node-RED in Docker, scenario runner, scenarios/*.yml |
tools/gx/, scripts/gx-*.ps1 | Deploy tooling (compare, gate, deploy) |
.github/workflows/ | check, pr-tests, test-gx (scenarios), claude-code-review, deploy-gx-code, deploy-victron |
config/ | Device configs and install notes (serialbattery, MultiPlus) |
docs/ | How things work (design, deploy, Test GX). docs/archive/ = old handoffs, read only |
BACKLOG.md | The one file for tasks, plans, test plans, open PRs, deploy state and progress |
Big nodes: 40 Heat pump automations.js (header, state, load, ui, tick; the parts are in lib/heat-pump/: curves,
heating-decide, dhw-helpers, dhw-tick, heating-tick, kick) and 01 Battery + Grid Controller.js (main flow;
lib/grid/constants, lib/grid/helpers). Read the header comment of the node first: it lists every d# change.
A lib edit is a change of that node: sync bumps d# and it deploys like any flow change.
Commands
node tools/flows.js sync # after editing NN sources: rebuild flows.json, bump d# once
node tools/flows.js check # sources and flows.json in sync (CI runs this)
node tools/flows.js version # d#N · i#M
node tools/infra-version.js bump "Short description" # once per infrastructure branch; optional PR number after description
node tools/infra-version.js check # compare against the merge base with origin/master
node --test "tests/*.test.js" # all unit tests
node --test tests/heat-curve-follow.test.js # one file
.\tools\test-gx\up.ps1 -Sim emu # local Test GX stack (Docker); .\up.ps1 -Down to stop
node tools/test-gx/run-scenarios.js --file heating-review.yml # scenarios of one file against the local stackRules
- Every flow change: edit the
NNsource,node tools/flows.js sync(bumpsd#),check, unit tests. Never hand-editflows.json. Ifmastermoved, merge it,syncagain. - A unit test for every new or changed decision. Pure decisions (e.g.
heatDecide) are tested directly; behaviour throughtests/harness.jswith ticks. A test must fail without the change. - Branches and PRs: every change on its own branch from a fresh
origin/master, in its own worktree, PR intomaster. Address all review feedback and resolve every thread before enabling auto-merge withgh pr merge <N> --auto --merge.masterrequirescheck,tests,secret-files,review,scenarios. Never push tomasterdirectly; merge commits. One open PR at a time: rebase the branch onorigin/masterright before opening its PR (force-with-lease only for that); see the operating guide §2a. - Tasks live only in
BACKLOG.md: add the task before the branch, set "in progress" with branch / PR, move to Done with PR andd#in the same PR as the work. - Deploys: a green Test GX run on a master push deploys that commit to the live GX automatically
(
deploy-gx-code.yml, envvictron-gx-auto). Manual: Actions → Deploy GX code, dry run then apply, owner approval. The whole-flow deploy stops on drift from the recorded common Git baseline. Review field names withtools/gx/compare.js; use the manual-onlyoverwrite_driftonly after the owner approves replacing the drift. - Live GX, secrets, real backups: never touch without an explicit owner request. Real backups and keys stay outside
the repo and the Docker image.
secret-filesCI blocks private hosts / keys. - Test GX work does not change production sources. A bug found by a scenario is marked
expected_fail; the fix gets its own PR. New scenario file → add it to thefilesmatrix intest-gx.yml(a unit test checks this). - English in code, docs, commits and PRs.
- Owner's own rules (in the owner's global CLAUDE.md) win: e.g. commits / pushes only when asked in that session.
- Every infrastructure change bumps
i#once per PR:tools/,scripts/,.github/workflows/,tests/,.claude/skills/,CLAUDE.md,docs/claude-operating-guide.md,docs/agent-workflow.mdand.github/copilot-instructions.md. Production-only and other docs-only changes (includingBACKLOG.md) do not bumpi#.syncstill changes onlyd#. If a concurrent bump lands, merge master, keep its ledger history, and regenerate your single bump.
Agents
Claude plans, reviews and may implement when the owner asks; GitHub Copilot CLI implements from a brief file.
Claude picks a Copilot worker tier per task with
tools/herdr/herdr-task.ps1 and new <branch> -Tier <tier>. The repo's
tools/herdr/models.json defines the tiers; the owner's skill copy is kept in sync.
New workers use low reasoning effort unless the tier specifies otherwise;
-Model and -Effort override the tier. One agent per worktree. Copilot's rules: .github/copilot-instructions.md.
Every report ends with the branch name.
Every new Copilot task runs as a Herdr worker (since 2026-11-21), so Claude can send corrections and ask for progress instead of the owner relaying text:
herdr statusmust sayrunning(else startherdrin its own terminal; never restart a running server without the owner: it kills all workers).- From the main checkout, run
.\tools\herdr\herdr-task.ps1 new <branch> -Repo (Get-Location).Path -Base origin/master -Tier <tier>→ worktree~\.herdr\worktrees\victron\<branch>, Copilot with--allow-allas agentw-<branch>. Check the status bar shows the intended model; an unknown model ID falls back to Copilot's default. Without--allow-allthe worker stops at a permission prompt for every command and nobody can answer it through the harness (21 Nov: a worker waited 6 min ongit fetch). Check the firstreadaftersend: a "Do you want to run this command?" box means it was started without it; close and start it again with the current script. - Write
.copilot-brief-<branch>.mdin that worktree (goal, context, steps, tests, delivery: PR, then auto-merge after review feedback is addressed and threads are resolved). herdr-task.ps1 send <branch> "Read .copilot-brief-<branch>.md and do all of it."; latersendfor corrections / "progress?",read <branch>to look without interrupting,wait <branch>until idle / blocked.- After the PR merges:
herdr-task.ps1 close <branch>. The owner'sherdr-workerskill (~\.claude\skills\herdr-worker\) also provides the launcher. A plaincopilot --allow-all --model gpt-6.2-sol --reasoning-effort low -i 'Read <brief> and do it'in a terminal is the standard-tier fallback when Herdr is not available; then nobody can type into it except the owner.
Project skills (.claude/skills/): ship-pr (sync, test, backlog, PR, review before auto-merge), test-gx-local (Docker
scenarios), deploy-gx (dry run, GX-only lines, apply, confirm), victron-status (live status via MCP), gx-reach
(GX reachable + NR1 baseline command), claude-review-token (owner-run rotation of the Claude review secret), loop-token (rotate the Windows dev loop's GitHub token: Claude prepares the page, the owner generates and pastes it into tools/dev-loop/rotate-token.ps1; loop cycles failing with "error connecting to api.github.com" can mean a bad token). Only the Windows loop runs, never the Omarchy one.
The review check fails when the Claude review finds a failing test or a High / Critical problem (verdict gate in
claude-code-review.yml); fix it and push, or comment @claude review to re-run. .github/CODEOWNERS requests the
owner's review on live-control, CI and deploy files.
Gotchas
flows.jsonis ~1 MB: search it withnode tools/flows.jsor grep theNNsources instead.- The fixture test compares new dotted strings with committed
HEAD; it fails until a change is committed. - Test GX takes ~70 min (slowest file); scenarios run at their
faketimerate (@… x60). - Files in
docs/archive/and the*-handoff*.mddocs are history, not current instructions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

