Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/mslavov/shelly-forge/shelly-development-standardsgit clone --depth 1 https://github.com/mslavov/shelly-forgeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/mslavov/shelly-forge/shelly-development-standards)<a href="https://agentmods.dev/rules/mslavov/shelly-forge/shelly-development-standards"><img src="https://agentmods.dev/badge/rules/mslavov/shelly-forge/shelly-development-standards.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01265 | $0.01265 |
| Opus 5 | $0.00633 | $0.00633 |
| Sonnet 5 | $0.00253 | $0.00253 |
| Haiku 4.5 | $0.00127 | $0.00127 |
Grade A, and why
shelly-development-standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 208 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Shelly Development Standards
This rule defines standards and best practices for developing solutions for Shelly devices.
Overview
Shelly scripts run on a modified version of mJS (a subset of JavaScript) and operate in a non-blocking environment that shares CPU time with device firmware. Development must follow specific patterns to ensure reliability and prevent device crashes.
TypeScript Requirements
- Always use TypeScript for all Shelly solution development
- Use types from the shelly-forge library when available:
node_modules/shelly-forge/types/**/* - Define custom types for all data structures and API responses
✅ Correct:
export type ThermostatState = "On" | "Off";
export interface Schedule {
weekDays: boolean[];
startTime: number;
endTime: number;
temperature: number;
}
❌ Incorrect:
// Using plain JavaScript without types
let state = "Off";
let schedule = {
weekDays: [false, true, true, true, true, true, false],
startTime: 6,
endTime: 9,
temperature: 39
};
Callback Functions
Due to limitations in the JavaScript engine, avoid deep nesting of anonymous functions as this can crash the device:
✅ Correct:
function processResponse(result: any, error_code: number, error_message: string) {
if (error_code !== 0) {
print("Error: " + error_message);
return;
}
// Process result
}
Shelly.call("HTTP.GET", { url: "http://example.com/" }, processResponse);
❌ Incorrect:
Shelly.call(
"HTTP.GET",
{ url: "http://example.com/" },
function(result, error_code, error_message) {
if (error_code !== 0) {
print("Error: " + error_message);
Shelly.call(
"Switch.Set",
{ id: 0, on: false },
function(res, err_code, err_msg) {
// More nested callbacks - DANGEROUS!
}
);
}
}
);
State Management
- Use the Storage/KVS API for persistent state storage
- Create a typed interface around the Storage API for type safety
- Implement the store as a singleton to ensure consistent access
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 208 lines · 1,265 tokens per session scan A d2f251ea419a
shelly-development-standards is a cursor rule published in the GitHub repository mslavov/shelly-forge (20 stars, last pushed 1y ago), licensed MIT. It adds 1,265 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other cursor rules, from other repositories
vue-typescript-patterns
Cursor rule "vue-typescript-patterns" from soaring-xiongkulu/easyaiot, covering vue3 + typescript 开发规范, vue 组件规范, vue sfc 组件规范, typescript 规范 and 状态管理.
nextjs-typescript-app-cursorrules-prompt-file
Cursor rules for Next.js development with TypeScript integration.
ts
Cursor rule "ts" from un-pany/v3-admin-vite, covering ts 开发规范, 类型, 命名, 代码组织 and 错误处理.
platform-pattern-2-filesystem-operations
Cursor rule "platform-pattern-2-filesystem-operations" from PaulJPhilp/EffectPatterns, covering platform pattern 2: filesystem operations and example.
handle-unexpected-errors-by-inspecting-the-cause
Cursor rule "handle-unexpected-errors-by-inspecting-the-cause" from PaulJPhilp/EffectPatterns, covering handle unexpected errors by inspecting the cause and example.
modeling-tagged-unions-with-datacase
Cursor rule "modeling-tagged-unions-with-datacase" from PaulJPhilp/EffectPatterns, covering modeling tagged unions with data.case and example.