#406·mobilerun

Add CLAUDE.md / AGENTS.md to mobilerun-portal (encode invariants)

Author: linear-code[bot]Created Jul 31, 2026Updated Sep 10, 2026

Why

The repo has Claude wired into the PR flow but only a 4-line code-style.md. The agent can't see the invariants a human reviewer knows. This is the root-cause fix.

Task

Add a root CLAUDE.md (and/or AGENTS.md) that encodes at least:

  • Enum-mapping invariant: every EventType that should fire a trigger needs a matching arm in TriggerRuntime.handlePortalEvent; prefer exhaustive when (no else) so the compiler enforces it. Point to the existing exhaustiveness test in TriggerCoreTest as the pattern to copy.
  • isNotificationSource intent: document the deliberate difference between the editor/permissions version (POSTED||REMOVED) and the runtime debounce version (POSTED only), or reconcile (see sibling ticket).
  • visibilityFor / capabilitiesFor / defaultCooldownSecondsFor: a new TriggerSource must be added here too, or it silently gets no cooldown/run-limit and is invisible.
  • Test + CI expectations, module layout, code-style rules.

Definition of Done

  • CLAUDE.md / AGENTS.md at repo root, referenced from README
  • Invariants above written down with file/function pointers