autodarts-patterns

autodarts-patterns is a cursor rule for Cursor from inventwo/ioBroker.autodarts. It costs 0 tokens per session (532 once invoked), scanned A, original, MIT.

Project-specific rules for an Autodarts Board Manager ioBroker adapter, including its files, local HTTP API, polling, and state creation patterns.

In plain words
What is it for?
Add or modify board communication, throw and visit handling, traffic-light states, hardware control, configuration checks, system information, and polling.
Why use it?
They help keep new code aligned with the adapter’s existing structure and define how it should react to network problems and repeated data.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Add or modify board communication, throw and visit handling, traffic-light states, hardware control, configuration checks, system information, and polling.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/inventwo/iobroker.autodarts/autodarts-patterns
Install

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.

Clone the repo
git clone --depth 1 https://github.com/inventwo/ioBroker.autodarts

Made for: Cursor.

Wrote 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.

agentmods badge for autodarts-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/inventwo/iobroker.autodarts/autodarts-patterns/github.svg)](https://agentmods.dev/rules/inventwo/iobroker.autodarts/autodarts-patterns)
Your own site
<a href="https://agentmods.dev/rules/inventwo/iobroker.autodarts/autodarts-patterns"><img src="https://agentmods.dev/badge/rules/inventwo/iobroker.autodarts/autodarts-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for autodarts-patterns

Your own site · 80×15
<a href="https://agentmods.dev/rules/inventwo/iobroker.autodarts/autodarts-patterns"><img src="https://agentmods.dev/badge/rules/inventwo/iobroker.autodarts/autodarts-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 532 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00532
Opus 5 $0.00000 $0.00266
Sonnet 5 $0.00000 $0.00106
Haiku 4.5 $0.00000 $0.00053

Measured 9d ago against content hash d84224f4ec7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

autodarts-patterns 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 9d 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.

.cursor/rules/autodarts-patterns.mdc · 69 lines

What it actually says

Autodarts Patterns

Architecture

  • main.js — adapter entry (Autodarts extends utils.Adapter); polling loop, state routing
  • lib/throw.js — single throw logic
  • lib/visit.js — visit logic (3 darts)
  • lib/trafficLight.js — traffic light state management
  • lib/hardware.js — hardware control (lighting, power)
  • lib/config.js — configuration validation
  • lib/httpHelper.js — HTTP helper functions
  • lib/systemInfo.js — system info (version, host)
  • lib/tools.js — Tools addon integration

API communication

  • Local Board Manager at http://<host>:<port>/
  • No authentication required (local network only)
  • Endpoints: /api/state, /api/version, /api/config, /api/host
  • Use native node:http via lib/httpHelper.makeRequest()
  • On network error: set online to false, traffic light to red

Polling

  • Managed in main.js via chained setTimeout (not setInterval)
  • Interval: adapter.config.intervalSec (seconds, default 1)
  • Slower interval when offline (offlineIntervalMs)
  • Signature-based deduplication prevents processing duplicate throw data

State creation

Use extendObjectAsync (not setObjectNotExistsAsync):

await this.extendObjectAsync("throw.current", {
  type: "state",
  common: {
    name: { en: "Current throw score", de: "Aktueller Wurf-Score" },
    type: "number",
    role: "value",
    read: true,
    write: false,
  },
  native: {},
});

State naming

  • Throws: throw.*, visits: visit.*
  • Traffic light: trafficLight.*
  • Connection: online
  • System info: systemInfo.*
  • Hardware: hardware.*
  • Tools addon: tools.*

Pitfalls

  • Do not add axios or other HTTP libraries
  • Always provide bilingual state names (en + de)
  • Clean up pollTimer, versionTimer, and resetTimers in onUnload
  • Use setState() without callback (returns Promise) — not deprecated setStateAsync()
Changes

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.

  1. 9d ago First seen · 69 lines · 0 tokens per session scan A d84224f4ec7b

Subscribe to this mod's changes

autodarts-patterns is a cursor rule published in the GitHub repository inventwo/ioBroker.autodarts (4 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 532 tokens. 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-08-31.