RUO Supabase Guardrails
Use this skill whenever an agent is asked to read, change, configure, migrate, sync, inspect, or automate Supabase for RUO Peptides / PeptraLabs.
This skill separates read-only analysis from mutation ownership. Hermes is the sole agent allowed to execute RUO Supabase mutations. Codex, Claude Code, Genie, OpenClaw helpers, and other non-Hermes agents may inspect read-only state and prepare a mutation instruction set, but they must never write directly.
Quick Rule
RUO Supabase is read-only for every non-Hermes agent.
There is no approval exception for direct Codex/API writes. Pafi approval authorizes Hermes to evaluate and execute the exact instruction set; it never authorizes the preparing agent to execute the mutation.
For every proposed mutation, the preparing agent must:
- keep all Supabase access read-only;
- assemble the Hermes Supabase Mutation Instruction Set defined by
ruo-supabase-mutation-audit;
- validate the instruction set locally;
- deliver it to Hermes or return it as a ready-to-send handoff if Hermes is unavailable; and
- wait for Hermes execution evidence before describing the database as changed.
Non-Hermes Hard Boundary
Non-Hermes agents must not perform or invoke:
POST, PATCH, PUT, or DELETE against Supabase REST or Storage endpoints;
- mutating RPC or Edge Function calls;
- SQL
INSERT, UPDATE, UPSERT, DELETE, DDL, grants, or policy changes;
- Supabase CLI migration apply,
db push, deployment, secret, RLS, storage, or configuration mutations;
- a local helper whose execution path can mutate RUO Supabase; or
- any compensating or rollback mutation after a failed read or Hermes execution.
If a direct-write helper already exists, it may be inspected as historical implementation evidence, but it must not be run in mutation mode. Convert the requested change into a Hermes instruction set instead.
Explicit Pafi approval for a business change does not override this executor boundary. Changing the executor boundary itself requires a separate, explicit policy change and a new skill/procedure version.
Credential Boundary
Non-Hermes agents must use only a credential or mediated access path that is technically restricted to read-only operations.
- Never load or use the RUO Supabase service-role credential in a non-Hermes runtime.
- Never print, quote, commit, log, copy, or embed Supabase credentials in a handoff.
- Reference secrets by owner-managed handle only; Hermes resolves them inside its own runtime.
- If no read-only credential/path is available, ask Hermes to run the read and return a redacted snapshot. Do not fall back to the service-role key.
- If a user pastes a key, do not replay it in commands or files.
This credential rule is required for capability separation: a policy-only block is not a technical write barrier while a write-capable credential remains available to the preparing agent.
Trigger Conditions
Use this skill for:
- RUO/PeptraLabs Supabase reads, schema inspection, exports, imports, syncs, payments, transactions, balances, stock, SKU states, approvals, evidence links, or exception statuses;
- Airtable-to-Supabase migration planning or legacy Airtable reconciliation;
- Codex, Claude Code, Genie, Hermes, OpenClaw, dashboard, or automation access to RUO Supabase; and
- any request involving Supabase credentials, runtime access, schema/config, RLS, storage, RPC, Edge Functions, migrations, or mutation helpers.
Do not use this skill for generic Supabase tutorials or unrelated applications.
Source Of Truth
- Airtable is frozen and read-only as legacy evidence.
- Supabase/dashboard is the active operational source for payments, transactions, balances, stock movements, SKU states, approvals, evidence, exceptions, and reports.
- Hermes owns all Supabase mutations and mutation credentials.
- Non-Hermes agents own read-only analysis, preflight evidence, instruction-set preparation, and independent post-execution verification when a read-only path exists.
- If project cards, dashboards, Cortex, LLM-Wiki, or chat summaries disagree with Supabase, report the conflict. Do not invent a merged state.
Read Workflow
For read-only work:
- Confirm the request concerns RUO/PeptraLabs Supabase.
- Confirm the action is genuinely read-only: select, schema inspect, export, checksum, count, diff, or validation.
- Use only a technically read-only credential/path. If unavailable, route the read to Hermes.
- Run the smallest query needed.
- Redact customer, payment, credential, and other sensitive fields unless the request requires them.
- Report source table/view, query scope, timestamp, row count, and limits.
- State
Writes performed: none.
Hermes Mutation Instruction Gate
Before any proposed insert, update, upsert, delete, RPC mutation, storage change, migration, backfill, trigger, RLS policy, schema/config change, runtime access change, or dashboard-to-Supabase sync, create an instruction set containing at least:
contract_version: hermes-supabase-instruction.v1
instruction_set_id: stable unique reference
execution_owner: Hermes-main
executor: hermes
executor_profile: default
codex_direct_write_forbidden: true
approval_explicit: true only when Pafi approved this exact business change
approval_source: exact chat/thread/channel/message or approval artifact
approval_timestamp: ISO timestamp
operation: requested mutation type
surface: data_row/financial_stock/schema_config/rls_policy/storage/rpc_function/runtime_secret_config/dashboard_sync
objects: exact tables, rows, buckets, functions, policies, or config objects
scope: exact IDs or precise filter and expected count
payload_summary: intended change without secrets
mutation_steps: ordered exact operations for Hermes
preflight_diff: observed state versus intended state
required_markers: Pafi-authorized plus Hermes owner attribution
idempotency: duplicate-prevention rule
rollback: exact undo or compensating plan
domain_invariants: money/stock/account/config/compliance checks
post_write_verification: read-back checks and expected values
artifact_sync: required follow-up surfaces or explicit no-sync reason
return_contract: evidence Hermes must return
Run ruo-supabase-mutation-audit against this packet. A valid result is HANDOFF_READY, never permission for the preparing agent to execute.
If approval is missing, the packet may be prepared as DRAFT_AWAITING_PAFI_APPROVAL, but it must not be presented to Hermes as executable.
Hermes Execution And Return Contract
Hermes-main using the explicit default profile must independently:
- verify the approval, current state, exact scope, and expected count;
- select its owner-managed execution path without exposing credentials;
- apply required audit actor/markers and idempotency controls;
- execute only the approved scope;
- read back affected records/objects;
- run domain invariants and rollback if required; and
- return structured evidence with status, timestamps, affected IDs/counts, redacted before/after values, markers/actor, invariant results, rollback status, artifact-sync status, and exceptions.
Codex or another preparing agent may perform an independent read-only verification after Hermes returns. It must not repair a mismatch directly; it prepares a follow-up Hermes instruction set.
RUO Stock Model Facts For Hermes Instructions
stock_movements is the movement ledger.
location_stock.qty is the per-location quantity for Ibiza and other non-main locations.
skus.stock_qty is the Bucharest/main basis used by v_stock_by_location, not a global stock total.
- An Ibiza-only movement must target
stock_movements and location_stock; it must not decrement skus.stock_qty.
- A Bucharest/main movement must use the Bucharest/main basis and must not be described as a global correction.
Every stock instruction set must require Hermes to verify the movement row, the affected location aggregate, v_stock_by_location, and the absence of accidental customer/payment records.
Airtable Freeze Rule
Do not write new operational state to Airtable. Treat Airtable as historical evidence only. Any proposed Airtable-to-Supabase sync becomes a Hermes instruction set after source reconciliation and exact approval.
Financial And Stock Data
When a proposed mutation affects money, payments, balances, stock, SKU disposition, customer credit, owner investment, restocks, costs, or published audit figures, also apply ruo-financial-audit-controller before marking the instruction set ready.
The control matrix and invariants are inputs to Hermes. They do not authorize direct execution by the preparing agent.
Output Contract
For read-only work:
Mode: READ_ONLY
Source: table/view and query scope
Rows reviewed: ...
Findings: ...
Writes performed: none
For an incomplete mutation handoff:
Mode: HANDOFF_BLOCKED
Missing/failed fields: ...
Hermes delivery: not executable
Supabase writes performed: none
For a valid mutation handoff:
Mode: HANDOFF_READY
Executor: Hermes
Instruction set: ...
Approval/scope/invariants/rollback: ...
Supabase writes performed by preparing agent: none
For returned Hermes evidence:
Mode: HERMES_EXECUTION_REPORTED
Hermes result: ...
Independent read-only verification: verified/not_run/exception
Residual exceptions: ...
Supabase writes performed by preparing agent: none
Test Cases
- A payment lookup uses a technically read-only path and reports
Writes performed: none.
- A mutation request without exact approval returns
HANDOFF_BLOCKED or a non-executable draft.
- Pafi approves one exact row update. The preparing agent emits
HANDOFF_READY for Hermes and performs no write.
- Pafi asks Codex to call Supabase REST directly. The skill refuses the executor path and converts the request into a Hermes instruction set.
- An Ibiza BAC Water adjustment becomes a Hermes stock instruction with location-specific invariants; Codex does not insert or update rows.
- Only a service-role credential is available to Codex. Codex does not load it and routes the read or mutation to Hermes.
1---2name: ruo-supabase-guardrails3description: Enforce read-only RUO Peptides/PeptraLabs Supabase access for non-Hermes agents and route every mutation as a validated instruction set to Hermes-main/default, the sole mutation owner. Use for RUO reads, write requests, migrations, schema/config/RLS/storage/RPC changes, syncs, or agent access. ANTI-PATTERN: Never use this skill to authorize or execute a direct non-Hermes Supabase write.4---56<!-- GENERATED by forgebuild portable-skill v0.1.1; runtime=codex; core_sha256=2415cb41dfad6cf016eeda4f23c72a481124a9a55d26eae09fcf89b87ef71636; target_sha256=9782a2a66316f4b027d7209ed5fc508f3fa8c5148f0194ce64101efdc107982e; do not hand edit -->78# RUO Supabase Guardrails910Use this skill whenever an agent is asked to read, change, configure, migrate, sync, inspect, or automate Supabase for RUO Peptides / PeptraLabs.1112This skill separates read-only analysis from mutation ownership. Hermes is the sole agent allowed to execute RUO Supabase mutations. Codex, Claude Code, Genie, OpenClaw helpers, and other non-Hermes agents may inspect read-only state and prepare a mutation instruction set, but they must never write directly.1314## Quick Rule1516RUO Supabase is read-only for every non-Hermes agent.1718There is no approval exception for direct Codex/API writes. Pafi approval authorizes Hermes to evaluate and execute the exact instruction set; it never authorizes the preparing agent to execute the mutation.1920For every proposed mutation, the preparing agent must:21221. keep all Supabase access read-only;232. assemble the Hermes Supabase Mutation Instruction Set defined by `ruo-supabase-mutation-audit`;243. validate the instruction set locally;254. deliver it to Hermes or return it as a ready-to-send handoff if Hermes is unavailable; and265. wait for Hermes execution evidence before describing the database as changed.2728## Non-Hermes Hard Boundary2930Non-Hermes agents must not perform or invoke:3132- `POST`, `PATCH`, `PUT`, or `DELETE` against Supabase REST or Storage endpoints;33- mutating RPC or Edge Function calls;34- SQL `INSERT`, `UPDATE`, `UPSERT`, `DELETE`, DDL, grants, or policy changes;35- Supabase CLI migration apply, `db push`, deployment, secret, RLS, storage, or configuration mutations;36- a local helper whose execution path can mutate RUO Supabase; or37- any compensating or rollback mutation after a failed read or Hermes execution.3839If a direct-write helper already exists, it may be inspected as historical implementation evidence, but it must not be run in mutation mode. Convert the requested change into a Hermes instruction set instead.4041Explicit Pafi approval for a business change does not override this executor boundary. Changing the executor boundary itself requires a separate, explicit policy change and a new skill/procedure version.4243## Credential Boundary4445Non-Hermes agents must use only a credential or mediated access path that is technically restricted to read-only operations.4647- Never load or use the RUO Supabase service-role credential in a non-Hermes runtime.48- Never print, quote, commit, log, copy, or embed Supabase credentials in a handoff.49- Reference secrets by owner-managed handle only; Hermes resolves them inside its own runtime.50- If no read-only credential/path is available, ask Hermes to run the read and return a redacted snapshot. Do not fall back to the service-role key.51- If a user pastes a key, do not replay it in commands or files.5253This credential rule is required for capability separation: a policy-only block is not a technical write barrier while a write-capable credential remains available to the preparing agent.5455## Trigger Conditions5657Use this skill for:5859- RUO/PeptraLabs Supabase reads, schema inspection, exports, imports, syncs, payments, transactions, balances, stock, SKU states, approvals, evidence links, or exception statuses;60- Airtable-to-Supabase migration planning or legacy Airtable reconciliation;61- Codex, Claude Code, Genie, Hermes, OpenClaw, dashboard, or automation access to RUO Supabase; and62- any request involving Supabase credentials, runtime access, schema/config, RLS, storage, RPC, Edge Functions, migrations, or mutation helpers.6364Do not use this skill for generic Supabase tutorials or unrelated applications.6566## Source Of Truth6768- Airtable is frozen and read-only as legacy evidence.69- Supabase/dashboard is the active operational source for payments, transactions, balances, stock movements, SKU states, approvals, evidence, exceptions, and reports.70- Hermes owns all Supabase mutations and mutation credentials.71- Non-Hermes agents own read-only analysis, preflight evidence, instruction-set preparation, and independent post-execution verification when a read-only path exists.72- If project cards, dashboards, Cortex, LLM-Wiki, or chat summaries disagree with Supabase, report the conflict. Do not invent a merged state.7374## Read Workflow7576For read-only work:77781. Confirm the request concerns RUO/PeptraLabs Supabase.792. Confirm the action is genuinely read-only: select, schema inspect, export, checksum, count, diff, or validation.803. Use only a technically read-only credential/path. If unavailable, route the read to Hermes.814. Run the smallest query needed.825. Redact customer, payment, credential, and other sensitive fields unless the request requires them.836. Report source table/view, query scope, timestamp, row count, and limits.847. State `Writes performed: none`.8586## Hermes Mutation Instruction Gate8788Before any proposed insert, update, upsert, delete, RPC mutation, storage change, migration, backfill, trigger, RLS policy, schema/config change, runtime access change, or dashboard-to-Supabase sync, create an instruction set containing at least:8990```text91contract_version: hermes-supabase-instruction.v192instruction_set_id: stable unique reference93execution_owner: Hermes-main94executor: hermes95executor_profile: default96codex_direct_write_forbidden: true97approval_explicit: true only when Pafi approved this exact business change98approval_source: exact chat/thread/channel/message or approval artifact99approval_timestamp: ISO timestamp100operation: requested mutation type101surface: data_row/financial_stock/schema_config/rls_policy/storage/rpc_function/runtime_secret_config/dashboard_sync102objects: exact tables, rows, buckets, functions, policies, or config objects103scope: exact IDs or precise filter and expected count104payload_summary: intended change without secrets105mutation_steps: ordered exact operations for Hermes106preflight_diff: observed state versus intended state107required_markers: Pafi-authorized plus Hermes owner attribution108idempotency: duplicate-prevention rule109rollback: exact undo or compensating plan110domain_invariants: money/stock/account/config/compliance checks111post_write_verification: read-back checks and expected values112artifact_sync: required follow-up surfaces or explicit no-sync reason113return_contract: evidence Hermes must return114```115116Run `ruo-supabase-mutation-audit` against this packet. A valid result is `HANDOFF_READY`, never permission for the preparing agent to execute.117118If approval is missing, the packet may be prepared as `DRAFT_AWAITING_PAFI_APPROVAL`, but it must not be presented to Hermes as executable.119120## Hermes Execution And Return Contract121122Hermes-main using the explicit `default` profile must independently:1231241. verify the approval, current state, exact scope, and expected count;1252. select its owner-managed execution path without exposing credentials;1263. apply required audit actor/markers and idempotency controls;1274. execute only the approved scope;1285. read back affected records/objects;1296. run domain invariants and rollback if required; and1307. return structured evidence with status, timestamps, affected IDs/counts, redacted before/after values, markers/actor, invariant results, rollback status, artifact-sync status, and exceptions.131132Codex or another preparing agent may perform an independent read-only verification after Hermes returns. It must not repair a mismatch directly; it prepares a follow-up Hermes instruction set.133134## RUO Stock Model Facts For Hermes Instructions135136- `stock_movements` is the movement ledger.137- `location_stock.qty` is the per-location quantity for Ibiza and other non-main locations.138- `skus.stock_qty` is the Bucharest/main basis used by `v_stock_by_location`, not a global stock total.139- An Ibiza-only movement must target `stock_movements` and `location_stock`; it must not decrement `skus.stock_qty`.140- A Bucharest/main movement must use the Bucharest/main basis and must not be described as a global correction.141142Every stock instruction set must require Hermes to verify the movement row, the affected location aggregate, `v_stock_by_location`, and the absence of accidental customer/payment records.143144## Airtable Freeze Rule145146Do not write new operational state to Airtable. Treat Airtable as historical evidence only. Any proposed Airtable-to-Supabase sync becomes a Hermes instruction set after source reconciliation and exact approval.147148## Financial And Stock Data149150When a proposed mutation affects money, payments, balances, stock, SKU disposition, customer credit, owner investment, restocks, costs, or published audit figures, also apply `ruo-financial-audit-controller` before marking the instruction set ready.151152The control matrix and invariants are inputs to Hermes. They do not authorize direct execution by the preparing agent.153154## Output Contract155156For read-only work:157158```text159Mode: READ_ONLY160Source: table/view and query scope161Rows reviewed: ...162Findings: ...163Writes performed: none164```165166For an incomplete mutation handoff:167168```text169Mode: HANDOFF_BLOCKED170Missing/failed fields: ...171Hermes delivery: not executable172Supabase writes performed: none173```174175For a valid mutation handoff:176177```text178Mode: HANDOFF_READY179Executor: Hermes180Instruction set: ...181Approval/scope/invariants/rollback: ...182Supabase writes performed by preparing agent: none183```184185For returned Hermes evidence:186187```text188Mode: HERMES_EXECUTION_REPORTED189Hermes result: ...190Independent read-only verification: verified/not_run/exception191Residual exceptions: ...192Supabase writes performed by preparing agent: none193```194195## Test Cases1961971. A payment lookup uses a technically read-only path and reports `Writes performed: none`.1982. A mutation request without exact approval returns `HANDOFF_BLOCKED` or a non-executable draft.1993. Pafi approves one exact row update. The preparing agent emits `HANDOFF_READY` for Hermes and performs no write.2004. Pafi asks Codex to call Supabase REST directly. The skill refuses the executor path and converts the request into a Hermes instruction set.2015. An Ibiza BAC Water adjustment becomes a Hermes stock instruction with location-specific invariants; Codex does not insert or update rows.2026. Only a service-role credential is available to Codex. Codex does not load it and routes the read or mutation to Hermes.