agentleFS
cobusgreylingcobusgreyling/grok-bot-templates/skills/draft-sql/SKILL.md

draft-sql

Skill14 starsChanged 3 months agoMITView on GitHub

Paste this into Grok Bot after a successful run: Save the process we just used as a skill called “Draft SQL”. A useful skill states the six fields from Skills and routines. The owner needs SQL explained or written from a schema in the repo, as a draft only — never executed as a write against a live database. Every column exists in the schema you read. Writes are labeled unrun. No connection string or password appears in the draft.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the named schema. Quote tables and columns you will use.

    line 22
  2. Distinctive:

    Prefer a SELECT that answers the question.

    line 23
  3. Distinctive:

    Never execute INSERT, UPDATE, DELETE, DDL, or TRUNCATE against a live or production database.

    line 25
  4. Distinctive:

    Every column exists in the schema you read.

    line 29
  5. Distinctive:

    Do not run writes against a live database.

    line 39

≈ “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

Draft SQL

Paste this into Grok Bot after a successful run:

Save the process we just used as a skill called “Draft SQL”.

A useful skill states the six fields from Skills and routines.

1. When to use it

The owner needs SQL explained or written from a schema in the repo, as a draft only — never executed as a write against a live database.

2. Required inputs and access

  • Schema source (migration files, schema.rb, SQL dump, or attached DDL)
  • The question or the change they want expressed in SQL
  • Rule that live writes are forbidden

3. Sequence of work

  1. Read the named schema. Quote tables and columns you will use. If a table is missing, stop.
  2. Prefer a SELECT that answers the question. Label destructive SQL as DRAFT — DO NOT RUN.
  3. Explain what the statement does, what it locks, and what it can destroy.
  4. Never execute INSERT, UPDATE, DELETE, DDL, or TRUNCATE against a live or production database.

4. How to validate the result

Every column exists in the schema you read. Writes are labeled unrun. No connection string or password appears in the draft.

5. What to return

Draft SQL, explanation, risk notes, and an action log of schema files read.

6. What requires approval

Do not run writes against a live database. Do not change production data. Even a production SELECT waits for an explicit ask.

Type / in the composer to reference a saved skill. If it does not appear, open Settings → Plugins → Yours and enable it for this Bot.

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.