agentleFS
learntocloudlearntocloud/learn-to-cloud-app/.github/skills/query-prod-db/SKILL.md

query-prod-db

Skill1.1k starsChanged 59 days agoMITView on GitHub

Query production PostgreSQL with Entra ID authentication for user investigation and data debugging. Use for production database lookups or ad-hoc queries.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    Default to read-only queries.

    line 8
  2. Distinctive:

    Use bounded results and parameter-safe SQL.

    line 25
  3. Distinctive:

    If temporary firewall access is necessary, obtain confirmation before adding a narrow rule for the current IP, record its name, and remove …

    line 29

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

Query Production Database

Default to read-only queries. Require Azure CLI authentication and discover the current PostgreSQL host from Terraform output or Azure; never hard-code its generated suffix.

Authenticate with an OSS RDBMS access token and the signed-in Entra principal:

export PGPASSWORD="$(az account get-access-token --resource-type oss-rdbms --query accessToken -o tsv)"
export PG_USER="$(az ad signed-in-user show --query displayName -o tsv)"
psql -h "$PG_HOST" -d learntocloud -U "$PG_USER" --set=sslmode=require -P pager=off

The current learner verification state is in verification_attempts, keyed by user_id and requirement_uuid; step progress is in learner_step_completions, keyed by user_id and step_uuid. Consult current models or migrations before querying other columns.

Use bounded results and parameter-safe SQL. Never print tokens. For writes, show the exact affected rows, explain rollback behavior, and obtain explicit confirmation before executing a transaction.

If temporary firewall access is necessary, obtain confirmation before adding a narrow rule for the current IP, record its name, and remove it after the query.

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.