<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Zaharia</title>
    <description>The latest articles on DEV Community by Daniel Zaharia (@zdaniel16).</description>
    <link>https://dev.to/zdaniel16</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1381503%2Fe1188692-6bec-47c2-ba6a-b8f2a2513b4a.jpeg</url>
      <title>DEV Community: Daniel Zaharia</title>
      <link>https://dev.to/zdaniel16</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zdaniel16"/>
    <language>en</language>
    <item>
      <title>AGENTS.md as a rulebook: how I keep Claude Code from breaking Expo releases</title>
      <dc:creator>Daniel Zaharia</dc:creator>
      <pubDate>Fri, 27 Nov 2026 12:04:32 +0000</pubDate>
      <link>https://dev.to/zdaniel16/agentsmd-as-a-rulebook-how-i-keep-claude-code-from-breaking-expo-releases-1964</link>
      <guid>https://dev.to/zdaniel16/agentsmd-as-a-rulebook-how-i-keep-claude-code-from-breaking-expo-releases-1964</guid>
      <description>&lt;p&gt;I build and ship a real subscription app on my own: Expo for iOS and Android, a web app next to it, Supabase for the backend and RevenueCat for subscriptions. Claude Code does most of the typing.&lt;/p&gt;

&lt;p&gt;The agent is fast at features. Releases are where it hurts. Every painful moment I've had came from the same kind of mistake: the agent did something reasonable that turned out to have a side effect nobody could see in the diff. It ran &lt;code&gt;supabase db push&lt;/code&gt; against whichever project happened to be linked. It made a harmless-looking &lt;code&gt;eas.json&lt;/code&gt; tweak, and the next push became a store submission. It changed a web-only dependency and every phone got a no-op OTA update.&lt;/p&gt;

&lt;p&gt;None of these were prompting problems. They were missing rules. Here's how I structure those rules now so they actually reach the agent at the moment they matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  An index, not a rulebook
&lt;/h2&gt;

&lt;p&gt;My first &lt;code&gt;CLAUDE.md&lt;/code&gt; was one long file. It kept growing, the agent skimmed it, and the rule that mattered was always buried somewhere near the bottom.&lt;/p&gt;

&lt;p&gt;What works better is treating &lt;code&gt;AGENTS.md&lt;/code&gt; as an &lt;strong&gt;index&lt;/strong&gt;. It's a short table that says "before you touch X, read Y," followed by a handful of rules that apply everywhere. The detail lives in topic files under &lt;code&gt;docs/agents/&lt;/code&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Before you touch…&lt;/th&gt;
&lt;th&gt;Read&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;anything under &lt;code&gt;apps/mobile&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;code&gt;mobile-architecture.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RevenueCat, the entitlement gate, trials, the paywall&lt;/td&gt;
&lt;td&gt;&lt;code&gt;subscriptions.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;supabase/&lt;/code&gt;, migrations, &lt;code&gt;supabase:*&lt;/code&gt; commands&lt;/td&gt;
&lt;td&gt;&lt;code&gt;supabase.md&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;env vars, &lt;code&gt;eas.json&lt;/code&gt;, CI and deploy workflows&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;environment.md&lt;/code&gt;, then the &lt;code&gt;store-release&lt;/code&gt; skill&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Three details make this work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every topic file has &lt;code&gt;paths:&lt;/code&gt; front matter&lt;/strong&gt; and is symlinked into &lt;code&gt;.claude/rules/&lt;/code&gt;. In Claude Code, that means the Supabase rules load into context as soon as the agent reads a migration. You don't have to rely on it remembering to look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every rule carries its reason.&lt;/strong&gt; "Never use the interactive &lt;code&gt;supabase link&lt;/code&gt;" is easy to ignore. "...because the linked project is invisible local state, and a push goes wherever it points" is much harder to argue with, for an agent and for future me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;CLAUDE.md&lt;/code&gt; is a symlink to &lt;code&gt;AGENTS.md&lt;/code&gt;&lt;/strong&gt; (&lt;code&gt;ln -s AGENTS.md CLAUDE.md&lt;/code&gt;). Claude Code, Codex, Cursor and anything else read the same file, so there's only ever one copy of the rules.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Three lanes on EAS
&lt;/h2&gt;

&lt;p&gt;I run three lanes: development, preview and production. &lt;code&gt;APP_ENV&lt;/code&gt; drives the app config, so each lane has its own bundle identifier, name and Supabase project. Development is the local Docker stack only. Preview is a real build that testers install next to the production app. Production goes to the stores.&lt;/p&gt;

&lt;p&gt;Preview feels like overhead until the first time it catches a native config change that would have shipped straight to the App Store. Since then, it has more than paid for itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fingerprint deploy
&lt;/h2&gt;

&lt;p&gt;The core of the release setup is a small script, &lt;code&gt;eas-deploy.sh&lt;/code&gt;, that a path-filtered GitHub Action runs on pushes to the preview and production branches. With &lt;code&gt;runtimeVersion: { policy: "fingerprint" }&lt;/code&gt;, the native fingerprint decides what a push does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a build for the current fingerprint already exists, it publishes an &lt;strong&gt;OTA update&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If none exists, it queues a &lt;strong&gt;new cloud build&lt;/strong&gt;, and on production that build auto-submits to the stores.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few decisions in that script came straight from things that went wrong:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A queued build counts.&lt;/strong&gt; The lookup treats &lt;code&gt;NEW&lt;/code&gt;, &lt;code&gt;IN_QUEUE&lt;/code&gt; and &lt;code&gt;IN_PROGRESS&lt;/code&gt; builds as existing, not only &lt;code&gt;FINISHED&lt;/code&gt; ones. Otherwise a second push during a 20-minute build spends another build on the same native code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It fails closed.&lt;/strong&gt; If the build lookup errors out, the script exits. It doesn't treat the error as "no build found" and queue a store submission.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;DRY_RUN=1&lt;/code&gt;&lt;/strong&gt; prints what would ship without shipping anything. It's wired to &lt;code&gt;mobile:deploy:check:production&lt;/code&gt;, so the agent can answer "would this push build or update?" against the real EAS project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the traps that the rules now spell out:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;eas.json&lt;/code&gt; and any &lt;code&gt;env.ts&lt;/code&gt; that &lt;code&gt;app.config&lt;/code&gt; imports are fingerprint sources.&lt;/strong&gt; Adding a build profile changes the fingerprint, so the next production push becomes a store build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A version bump alone doesn't change the fingerprint&lt;/strong&gt; if you skip the version fields in the fingerprint config. A version-only release needs a forced build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A lockfile change from a web-only dependency&lt;/strong&gt; triggers the mobile workflow and sends a no-op OTA. Those commits get &lt;code&gt;[eas skip]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Supabase rules
&lt;/h2&gt;

&lt;p&gt;Most of my Supabase rules exist because Postgres and the CLI do something sensible that surprises you later:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The linked project is invisible state&lt;/strong&gt; in &lt;code&gt;supabase/.temp/project-ref&lt;/code&gt;. Never use the interactive &lt;code&gt;supabase link&lt;/code&gt;. Link production with an explicit script and check &lt;code&gt;supabase:status&lt;/code&gt; before every push. Production is read-only for the agent unless I say otherwise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check migration history before pushing.&lt;/strong&gt; Run &lt;code&gt;migration list --linked&lt;/code&gt; before &lt;code&gt;db push&lt;/code&gt;. If SQL was applied another way, for example through an MCP tool that records its own timestamp, the history drifts and a push can re-apply old migrations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Postgres grants EXECUTE to PUBLIC on every new function.&lt;/strong&gt; A &lt;code&gt;SECURITY DEFINER&lt;/code&gt; function created in a seed is callable with your anon key. So seeds never create functions, and migrations revoke and grant explicitly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RLS only checks a row's own &lt;code&gt;user_id&lt;/code&gt;.&lt;/strong&gt; Without more, a user can attach their row to someone else's record. Composite foreign keys, &lt;code&gt;(parent_id, user_id) → parent(id, user_id)&lt;/code&gt;, make the database enforce same-owner relationships.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test isolation with two users.&lt;/strong&gt; The kit's RLS test signs in as two users and checks that neither can read or write the other's rows. It refuses to run against anything that isn't a local host, so the agent can't accidentally point it at production.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  RevenueCat rules
&lt;/h2&gt;

&lt;p&gt;Subscriptions are where a wrong guess costs money or trust:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Entitlement has three states: active, inactive and unknown.&lt;/strong&gt; Treat "unknown" as "no," and a paying subscriber lands on the paywall during a slow network moment. Treat it as "yes," and the app appears and then gets yanked away. The gate waits on "unknown," and the rule file says why.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trial eligibility differs by platform.&lt;/strong&gt; Android always reports intro eligibility as unknown, so a client-side eligibility check hides the trial from every Android user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;offerings.current&lt;/code&gt; isn't versioned.&lt;/strong&gt; Swapping it reprices every installed app version at once, so the swap only happens after the new version is approved.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto-renewable subscriptions need a Terms of Use (EULA) link in the App Store description&lt;/strong&gt; (guideline 3.1.2). A link inside the app doesn't count.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Skills that end sessions cleanly
&lt;/h2&gt;

&lt;p&gt;Rules tell the agent what not to do. Skills give it a procedure for the moments that matter. Two I use all the time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;release-preflight&lt;/code&gt;&lt;/strong&gt; answers "what will this push actually do?" before anything reaches a release branch. It lists the changed paths, compares them with the workflow's path filter, flags fingerprint sources in the diff, runs the dry-run deploy check in a clean worktree, and reports the exact &lt;code&gt;eas build&lt;/code&gt; or &lt;code&gt;eas update&lt;/code&gt; it would run. If the answer is a production build, it says plainly that this is a store submission. It never pushes on its own.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;handoff&lt;/code&gt;&lt;/strong&gt; closes a session with a written summary: what changed, what was verified, and what's left. The next session, or the next agent, starts from facts instead of guesses.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A starter you can copy
&lt;/h2&gt;

&lt;p&gt;Here's a skeleton you can drop into any Expo repo today:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;# AGENTS.md
&lt;/span&gt;
This file is an index, not the whole rulebook. Read the topic file for the
area you're about to touch before touching it.

| Before you touch… | Read |
|---|---|
| the mobile app | docs/agents/mobile-architecture.md |
| subscriptions / paywall | docs/agents/subscriptions.md |
| supabase/, migrations | docs/agents/supabase.md |
| env, eas.json, CI, releases | docs/agents/environment.md |

&lt;span class="gu"&gt;## Rules that apply everywhere
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Never guess which Supabase project is linked. Check &lt;span class="sb"&gt;`supabase:status`&lt;/span&gt;.
&lt;span class="k"&gt;- &lt;/span&gt;A push to the production branch can be a store submission.
&lt;span class="k"&gt;- &lt;/span&gt;Nothing that affects sales (prices, products, offerings) changes without an explicit yes.
&lt;span class="k"&gt;- &lt;/span&gt;Secrets never enter a chat or a commit.
&lt;span class="k"&gt;- &lt;/span&gt;Anything public stops at a draft.

&lt;span class="gu"&gt;## Conventions
&lt;/span&gt;&lt;span class="k"&gt;- &lt;/span&gt;Every rule gets its reason next to it.
&lt;span class="k"&gt;- &lt;/span&gt;New detail goes into the topic file it belongs to, not into this index.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run &lt;code&gt;ln -s AGENTS.md CLAUDE.md&lt;/code&gt;, and add a rule with its reason every time something breaks. After a few releases, you'll have a rulebook that knows your project better than any prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Put structure on your agent's rules: a short index, plus topic files that load by path.&lt;/li&gt;
&lt;li&gt;Write the reason next to every rule.&lt;/li&gt;
&lt;li&gt;Make release side effects visible before the push, not after it.&lt;/li&gt;
&lt;li&gt;Fail closed whenever a wrong guess means a store submission or a production write.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you'd rather start from the full version, the kit has the AGENTS.md template, the topic files for Supabase, RevenueCat and EAS, four Claude Code skills, the deploy script and GitHub Action, the RLS test suite and four checklists: &lt;a href="https://danielzaharia.gumroad.com/l/expo-ship-kit" rel="noopener noreferrer"&gt;Expo + Claude Code Ship Kit on Gumroad&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I wrote this with help from an AI assistant, from my own notes and the rules in my repo. The setups and mistakes are mine.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>expo</category>
      <category>reactnative</category>
      <category>supabase</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
