agentleFS
sohaibdevvsohaibdevv/project-template/.agents/skills/add-data/SKILL.md

add-data

Skill2 starsChanged 3 months agoMITView on GitHub

Add or change what the app stores. Use when the app needs to keep track of something new, when a stored record needs a new field, or when a table needs changing.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. daveebbelaar/project-template★ 4100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository8 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every table and every column arrives through a migration carrying its guardrail.

    line 8
  2. Very specific:

    Ask what they call it. Their word wins: if they say "jobs", the table is jobs, not projects.

    line 14
  3. Distinctive:

    Done when: every table has one of these three recorded.

    line 30
  4. Very specific:

    Use the template in docs/security/migrations.md exactly.

    line 38
  5. Distinctive:

    Keep the footer as it is. It is what refuses the migration when any table anywhere has row security off.

    line 42
  6. Distinctive:

    If the footer raises an exception, it names the table with the problem.

    line 52
  7. Very specific:

    Run the two-account test in docs/security/rls.md against the new table.

    line 72

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add data

Every table and every column arrives through a migration carrying its guardrail.

This is the moment where a mistake becomes a data leak, so there is one way to do it and the database itself refuses the alternatives.

1. Name the thing in their words

Ask what they call it. Their word wins: if they say "jobs", the table is jobs, not projects.

Then ask what they need to know about each one. Push for the smallest set. Columns are easy to add later and awkward to remove once something depends on them.

Done when: the table has a name they used themselves, and every column has a reason they gave.

2. Decide who each row belongs to

For each table, one of three:

  • One person owns it. Gets a user_id column pointing at their account. Levels 2 only.
  • Everyone shares it. A price list, a set of categories. Everyone signed in reads it.
  • Nobody, it is reference data. Country codes, tax rates. Written by migration, read by all.

At levels 1 and 3 everything is effectively shared, because the server decides who sees what.

Done when: every table has one of these three recorded.

3. Write the migration

pnpm dlx supabase@latest migration new create_<name>

Use the template in docs/security/migrations.md exactly. Read the "Rules that are easy to get wrong" section in that file before writing a policy: those five mistakes each produce an app that looks right and leaks.

Include the level 2 grant and policy block only at level 2. Levels 1 and 3 get the table, row security on, and no policies.

Keep the footer as it is. It is what refuses the migration when any table anywhere has row security off.

Done when: the migration file exists, carries the footer unchanged, and every column from step 1 is in it.

4. Push it

pnpm dlx supabase@latest db push

If the footer raises an exception, it names the table with the problem. Fix that table. The footer is reporting something true.

Then confirm local and remote agree:

pnpm dlx supabase@latest migration list

Done when: the push succeeded, and migration list shows the same migrations locally and remotely.

5. Check the database

./scripts/check-rls.sh

Done when: it reports nothing to fix. Any finding gets a follow-up migration, never a change to the script.

6. Prove it, at level 2

Run the two-account test in docs/security/rls.md against the new table.

Done when: the second account sees nothing of the first account's, and they watched that happen.

7. Say what changed

One line in their words: what the app now remembers, and who can see it.

Append to project/DECISIONS.md: the table, who owns each row, and what that rules out.

Changing an existing table

A new migration. The old ones stay as they are, because together they are the record of how the database got here.

pnpm dlx supabase@latest migration new add_<column>_to_<table>
alter table public.orders add column status text not null default 'new';

A new column on an existing table needs a default, or the migration fails on every row already there. Ask what an existing record should say, and make that the default.

The footer goes on this migration too.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.