opencode-mobile AGENTS.md

Repository instructions for opencode-mobile, a mobile app whose shared provider manages domain state while screens and components handle routing and display.

In plain words
What is it for?
Use them when adding screens, components, API behavior, session handling, or other changes to the app architecture.
Why use it?
They prevent business logic, network calls, and shared state from being placed in the wrong parts of the app.

Instructions file for CodexOpenCode

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.

agentmods
npx agentmods add instructions/alvarolorentedev/opencode-mobile/agents-md
Clone the repo
git clone --depth 1 https://github.com/alvarolorentedev/opencode-mobile

Made for: Codex, OpenCode.

Per session 1,310 This file is loaded in full into every session.
When invoked 1,310 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01310 $0.01310
Opus 5 $0.00655 $0.00655
Sonnet 5 $0.00262 $0.00262
Haiku 4.5 $0.00131 $0.00131

Measured 2d ago against content hash 1949f8e2a171, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode-mobile AGENTS.md 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 2d 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.

AGENTS.md · 244 lines

How it starts

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

AGENTS.md

Follow the current implementation docs in docs/. Do not invent a new architecture.

Read first:

  1. docs/architecture.md
  2. docs/state-and-data.md
  3. docs/component-inventory.md
  4. docs/testing-and-validation.md

Architecture Rule

This app is provider-centric.

  • providers/opencode-provider.tsx owns domain state and orchestration.
  • app/ owns routing and thin screen wiring.
  • components/ owns presentation and local UI state.
  • providers/services/ owns provider-facing API aggregation.
  • lib/ owns protocol, formatting, storage keys, notifications, and voice helpers.
  • tests/fake-opencode/ and tests/e2e/ define the behavioral contract.

Do not move domain behavior into screens or presentational components.

Placement Rules

app/

Put:

  • route entrypoints
  • tab/layout wiring
  • thin screen controllers
  • calls into useOpencode()

Do not put:

  • fetch logic
  • session orchestration
  • capability reconciliation
  • protocol shaping

components/

Put:

  • rendering
  • local UI state
  • chat/settings UI composition
  • surface-specific helpers

Do not put:

  • API calls
  • persistence
  • shared domain state
  • cross-session caches

providers/

Put:

  • connection flow
  • workspace/session state
  • refresh logic
  • permission/question handling
  • capability reconciliation
  • conversation mode state machine
  • SSE and polling fallback
  • persistence hydration and write-back

Shared behavior across tabs belongs here.

providers/services/

Put:

  • session fetch helpers
  • capability/config/provider discovery helpers

Services aggregate requests. They do not own app state.

lib/opencode/

Put:

  • client construction
  • endpoint wrappers
  • protocol types
  • message formatting
  • transcript transformation

Raw server-shape handling belongs here, not in UI code.

lib/

Put:

  • notifications
  • speech input/output
  • storage keys
  • platform integration helpers

Platform side effects should start here or from the root shell, not from arbitrary components.

Read the full file on GitHub · 244 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. 2d ago First seen · 244 lines · 1,310 tokens per session scan A 1949f8e2a171

Subscribe to this mod's changes

opencode-mobile AGENTS.md is an instructions file published in the GitHub repository alvarolorentedev/opencode-mobile (154 stars, last pushed 19d ago), licensed Apache-2.0. It adds 1,310 tokens to every session, about $0.0066 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-08-30.