life360ng-patterns

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

A set of coding rules for a Life360 adapter in ioBroker, a platform for connecting devices and services to home automation. It describes the project structure, Life360 API access, authentication, polling, and custom places.

In plain words
What is it for?
Use it when changing the Life360 cloud or database connectors, location tracking, polling timers, authentication, notifications, custom places, or shared helper code.
Why use it?
It gives contributors consistent rules for communicating with Life360, handling expired tokens and rate limits, and managing repeated location checks. This reduces incompatible implementations across the adapter.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when changing the Life360 cloud or database connectors, location tracking, polling timers, authentication, notifications, custom places, or shared helper code.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/inventwo/iobroker.life360ng/life360ng-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.life360ng

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 life360ng-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/inventwo/iobroker.life360ng/life360ng-patterns/github.svg)](https://agentmods.dev/rules/inventwo/iobroker.life360ng/life360ng-patterns)
Your own site
<a href="https://agentmods.dev/rules/inventwo/iobroker.life360ng/life360ng-patterns"><img src="https://agentmods.dev/badge/rules/inventwo/iobroker.life360ng/life360ng-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 life360ng-patterns

Your own site · 80×15
<a href="https://agentmods.dev/rules/inventwo/iobroker.life360ng/life360ng-patterns"><img src="https://agentmods.dev/badge/rules/inventwo/iobroker.life360ng/life360ng-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 582 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.00582
Opus 5 $0.00000 $0.00291
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

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

Security

Grade A, and why

life360ng-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 10d 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/life360ng-patterns.mdc · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Life360ng Patterns

Architecture

  • main.js — adapter entry (Life360 extends utils.Adapter); wires connectors and Life360Tracker
  • lib/life360CloudConnector.js — Life360 REST API, polling, HTTP
  • lib/life360DbConnector.js — ioBroker states/objects, notifications, places integration
  • lib/life360Tracker.js — location tracking and HTML map generation
  • lib/iobHelpers.js — shared helpers

API communication

  • Base URL: https://api.life360.com/v3/
  • Auth: Authorization: Bearer <token> header (adapter.config.life360_token)
  • Token-only auth (no password/phone login — required for EU users)
  • Use native node:https only
  • HTTP 401 → expired/invalid token; set info.connection false, log warning
  • Cloudflare/rate-limit responses: log clearly; do not tight-loop retries

Polling

  • Managed in life360CloudConnector.js via chained adapter.setTimeout (not setInterval)
  • Stop with disablePolling()adapter.clearTimeout(objIntervalPoll)
  • Interval: adapter.config.life360_polling_interval (seconds, minimum 15)
  • setupPolling(callback) called from main.js onReady()

Custom places (My Places)

  • Defined in admin/jsonConfig.json table on _myplaces tab → config.places
  • Presence via Haversine formula against member lat/lon
  • Custom places take priority over Life360 cloud places in locationName

State naming

  • People: life360ng.<instance>.people.<name>.<state>
  • Places: life360ng.<instance>.places.<name>.<state>
  • My places: life360ng.<instance>.myplaces.<name>.<state>
  • Connection: life360ng.<instance>.info.connection

Optional integrations

  • Forward location data to ioBroker places adapter when configured
  • Notifications: Telegram, Alexa, per-datapoint overrides (notify_place_overrides)
  • Admin messages: testTelegram, testAlexa, getPlacesList, getPersonsList in main.js onMessage()

Pitfalls

  • Do not add axios or other HTTP libraries
  • Do not use clearInterval for polling — use clearTimeout on objIntervalPoll
  • Bearer token in config without the word Bearer, spaces, or quotes
  • On unload: stop tracker, disable polling, clear DB connector timers, set info.connection false

Read the full file on GitHub · 58 lines

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. 10d ago First seen · 58 lines · 0 tokens per session scan A 39b177bf2779

Subscribe to this mod's changes

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