Hello everyone,
Many of you have asked me how I manage to produce so many external integrations. Here’s the method, including what works and its limitations. Today, 380 of my integrations are published in the store. The initial prompt that sets everything up is provided at the end of this post.
1. The Environment
I use Claude Code (Anthropic’s development agent) on a dedicated Linux VM. It also works on Windows.
The first thing to ask the agent is to install everything needed to develop and test locally before pushing anything to GitHub. For example:
Install everything needed on this machine to develop Gladys external integrations and test them locally before pushing to GitHub: Node.js (versions 24 and 22, like the CI), Docker, git, and the GitHub CLI
gh. Clone the SDK (GladysAssistant/integration-sdk-js), the template (GladysAssistant/integration-template-js), the store (GladysAssistant/integration-store), and Gladys itself, to read the documentation locally instead of going to the web. Write a script that replays the entire CI of a repository locally: Prettier, ESLint, tests under Node 24 and 22, Docker build, and store validator. Also set up a test Gladys in Docker to install an integration like on a real box. Explain each installation to me, and don’t touch anything else on the machine.
I’ve connected GitHub and this forum in the built-in browser of Claude Code: I log in myself once, and the agent then uses it to read and post without ever seeing or typing a password. And with the Remote Control option, I can monitor everything from my phone: agent progress, pending questions, validations.
2. Choosing the Modules
- I start with the list of the 1000 most used Home Assistant integrations, published by Pierre-Gilles, taking the highest available ranks.
- Before proposing a module, the agent checks that it’s not already taken: in @Will_71’s tracker, in the reservation thread, in the store, on GitHub (including other developers), and in Gladys’s core. If in doubt, it doesn’t take it.
- It proposes a batch of 15 modules in 3 waves of 5. Nothing is developed before my approval.
- Once validated: creation of repositories from the official template, reservation on the forum (« I’m taking… »), then development.
3. Development and Review, Always by Two Different Agents
- The developer writes the module based on the official documentation of the manufacturer or service. It reuses an existing library if its license allows it (never GPL code). No application imitation, no anti-bot bypass.
- The reviewer, a second agent that didn’t write the code, actively tries to break it:
- it replays scenarios on fake servers written based on the documentation;
- it launches « mutants »: it intentionally breaks a protection and checks that a test fails;
- it runs the tests 20 times in a row to find unstable tests.
- The reviewer works with maximum effort for anything that physically acts or touches security (alarm, lock, gate, water valve, heating, energy), and with less effort for the rest.
- Up to 5 review rounds. From the 4th round, corrections go to a more advanced agent. If the 5th round doesn’t pass, we stop and the module isn’t published.
- When possible, the agent tests against the real software running in a container, for example gpsd, CasaOS, or Mosquitto.
- For a topic that’s been lingering with a member, the agent first does an in-depth web search (manufacturer documentation, forums, firmwares) before coding.
4. Non-Negotiable Security Rules
- Disabled by default: open, unlock, and disarm are behind an option, recheckedjust before sending.
- Never blocked: stop, close, turn off, arm, cut off water. If the command fails, it is kept and resent until confirmation.
- No switch: never for a command that an “all off” would accidentally trigger.
- Confirmation: a command is only considered successful if a device re-read shows it.
- Secrets: none in the logs or in the integration data.
- Values: cloud service quotas are respected, and an unknown value is never published as 0.
5. The publication
- As soon as the reviewer approves and the local CI passes: release by the GitHub workflow, public amd64 and arm64 image, verification by the store validator.
- Every publication is announced: a summary on the reservation thread in waves of 5, or a response in the member’s topic who requested or tested the module.
- Over the weeks: SDK updates in waves, fixes, and Dependabot follow-up.
6. Limit the tokens
Agents are expensive. Here’s what works for me:
- Compressed command outputs: a tool (rtk) filters the outputs to keep only the useful parts. Tests and local CI only display the summary and failures.
- A single sheet: each agent reads a single sheet of rules and lessons, about 5,000 tokens, instead of the entire history, plus the line of its module.
- A shared test kit: fake servers, test clocks, and simulated devices are reused instead of being rewritten for each module (see below).
- The right model for each task: the strongest model for development and high-risk reviews, a lighter model for simple reviews and small fixes.
- Self-verification: before submitting, the developer goes through a checklist, which avoids review rounds.
- A weekly reserve: I always keep enough to respond to the forum and fix existing modules. Member feedback takes precedence over new modules.
- One heavy command at a time on the machine: memory is limited and tests are capped in RAM.
To set everything up at once, I give this prompt to the agent:
Configure yourself once and for all to save tokens on this project, then save everything in your memory and in the CLAUDE.md for future sessions.
- Install rtk and hook it to your shell commands (hook before each command) to compress the outputs of git, grep, ls, docker, gh, npm, etc. Check with
rtk gainthat it really saves tokens.- Make sure your test and CI scripts only display the summary and failures, never the full output.
- Write a single sheet (5,000 tokens max) with the rules, method, and lessons learned, which each developer or reviewer agent will read instead of the history. Keep it up to date with each new lesson.
- Choose the model according to the task: the strongest one for development and high-risk reviews, a lighter one for simple reviews and small fixes. A reviewer keeps their model from one round to the next.
- Add a “before submitting” checklist for the developer, to go through before each milestone commit.
- Always keep a reserve on the weekly limit for the forum and fixes. Check your consumption before launching a wave of agents.
- Limit heavy commands (tests, builds) to one at a time on the machine, with a memory ceiling, to avoid saturating the RAM.
- Save each of these rules in your persistent memory, with the reason, so you don’t have to ask me again.
7. The forum and GitHub
- Access: the agent goes through the built-in browser, where I am logged into the forum and GitHub. It reads the forum in JSON, which saves tokens. On GitHub, it uses the CLI
ghwith a token with limited rights; invitations to repositories are accepted from the browser. - Monitoring: at each restart, the agent first reads the notifications and new messages from the topics being followed. It handles member feedback before anything else.
- What it posts on my behalf: only reservations, publication summaries, and responses on a module that a member has requested or tested. For everything else, it asks me.
8. The test kit
It is available here: GitHub - LM1LC3N7/gladys-testkit: Fake devices, clocks and a mutation runner for testing Gladys Assistant external integrations (Node 22/24, no dependency) · GitHub (Apache-2.0, no dependencies, Node 22 and 24). It provides:
- fake TCP, HTTP, HTTPS, and WebSocket devices, with latency, single client, silent device or one that cuts off, huge responses;
- a fake certificate and an “imposter” that responds before the request, to test fingerprint pinning;
- a test clock that advances on demand, and a real accelerated clock to measure periods;
- a fake Gladys and a mutant launcher.
To create one to your liking, here is the prompt:
Write a small reusable test kit for Gladys external integrations: ESM modules, Node 22 and 24, no dependencies, under Apache-2.0 license. All servers listen on 127.0.0.1, on a free port, and close properly. It must provide:
- a fake TCP device that reads like firmware (requests glued into the same packet, latency, one client at a time, device that goes silent or cuts the connection), with connection counters;
- fake HTTP and HTTPS servers with routes, response applied with delay, bursts of 503, huge responses, and list of received requests;
- a test certificate with its fingerprint, plus an “imposter” that presents another certificate and responds before the request;
- a fake WebSocket server;
- a port that never responds and a port that refuses the connection;
- an injectable test clock (
now, monotonic, timers,advance(ms)), an accelerated real clock, and a way to measure the period of a call;- a mutant launcher: it first runs the unmodified suite and exits with an error if it is red, then applies each mutant one at a time to a copy of the repository and reports which ones survive.
Test the kit itself and document each function in the README with a one-line example.
9. The limits, honestly
- I almost never have the hardware or the accounts: most integrations are tested on simulated servers based on the official documentation. Your feedback on real hardware is essential. It has already corrected several modules: thank you @cce66, @XDECO, @tikipoof, @JKBS64…
- Automatic review catches many defects, but not those we don’t know how to simulate.
- Some modules resist: eedomus was rejected 6 times in review and remains at its previous version.
- It costs tokens and the machine has its limits, so I have to make choices.
The starting prompt
This is the prompt that gives all this to the agent. I put it in a CLAUDE.md file at the root of the working folder, which Claude Code re-reads at each session:
You develop external integrations for Gladys Assistant, in gladys-<service> repositories created from the
official template. First, read the SDK README and the external integration specs from the Gladys repository (locally).
Organization
- Never take a module announced or reserved by someone else: check the integration tracking, the
reservation thread on the forum, the store, GitHub, and the Gladys core. If in doubt, don't take it.
- Propose batches of 15 modules in 3 waves of 5, chosen from Pierre-Gilles' list of 1000. Don't develop
anything before my approval. Then: repositories created from the template, reservation "I'm taking…" on the forum.
- For each module: a developer agent, then a separate reviewer agent (maximum effort if the module acts
physically or touches security). Up to 5 rounds; beyond that, we stop and ask me.
- Before any push: full CI locally (Prettier, ESLint, tests for Node 24 and 22, Docker build, store validator),
and a test in the test Gladys.
Security (non-negotiable)
- Open, unlock, disarm: disabled by default, behind an option reviewed just before sending.
- Stop, close, turn off, arm, cut water: never blocked; kept and returned until confirmation.
- Never a switch for a command that a "turn everything off" could trigger.
- A command is only successful if a review shows it. An unknown value is never published as 0.
- No secrets in logs, statuses, or data. Service quotas respected.
- Never GPL code, application imitation, or anti-bot bypassing.
Tests
- Fake servers based on the official documentation, mutants on each protection, suite run 20 times before submission.
- Test against the real software in a container when possible.
Publication
- If the reviewer approves and the CI passes: release, amd64 + arm64 image, store validator.
- Every publication is announced: summary on the reservation thread by wave, or response to the concerned member.
Forum and GitHub
- At each restart, first read the forum notifications and prioritize member feedback.
- Only post on my behalf for reservations, summaries, and responses to a module requested or tested by a
member. For the rest, ask me.
- Never enter a password: I log in myself in the browser.
Tokens
- Compressed command outputs, a single rule sheet for agents, a shared test kit.
- Light model for simple reviews and small corrections.
- Always keep a weekly reserve for the forum and fixes.
Your questions and feedback are welcome!