Source profileQuality 94/100

event4u-app/agent-config/src/skills/sql-writing/SKILL.md

sql-writing

Use when writing raw SQL — MariaDB/MySQL syntax, parameterization, raw migrations, seeders with `DB::statement`; fires even on a pasted query asking 'why is this slow'.

Source repository stars
7
Declared platforms
0
Static risk flags
0
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Grounded corpus: tuning decisions (indexes, keyset pagination, N+1, trigram search, lock contention) ground via the database corpus — ./scripts-run /corpus-grounding/scripts/ground search --manifest /database/data/manifest.json "".

Best for

  • Eloquent/Query Builder queries (use eloquent or database skill)
  • Schema design (use database skill)

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/sql-writing"
Safe inspection promptEditorial

Inspect the Agent Skill "sql-writing" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/sql-writing/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Procedure: Write raw SQL

    1. Inspect call site & choose approach — identify every dynamic value flowing into the query, then pick: query builder when possible. Raw SQL only when query builder can't express the query. 2. Parameterize — Every variable must use ? binding or named :param. Never interpolate P…

    Inspect call site & choose approach — identify every dynamic value flowing into the query, then pick: query builder when possible. Raw SQL only when query builder can't express the query.Parameterize — Every variable must use ? binding or named :param. Never interpolate PHP variables into SQL strings.Use MariaDB syntax — Not PostgreSQL or MSSQL. Check php/sql.md for MariaDB-specific patterns.
  2. 02

    When to use

    Use when writing or reviewing raw SQL queries, migrations with raw statements, or seeders with raw SQL.

    Eloquent/Query Builder queries (use eloquent or database skill)Schema design (use database skill)Use when writing or reviewing raw SQL queries, migrations with raw statements, or seeders with raw SQL.
  3. 03

    Conventions

    → See guideline php/sql.md for parameterization patterns, common mistakes, MariaDB syntax reference.

    → See guideline php/sql.md for parameterization patterns, common mistakes, MariaDB syntax reference.
  4. 04

    Quick reference

    1. Verify every variable in SQL uses parameter binding (? or named :param). 2. Confirm MariaDB/MySQL syntax — not PostgreSQL or MSSQL. 3. Run EXPLAIN on complex queries to check index usage. 4. Check that no PHP variable interpolation ("$var", '{$var}') appears in SQL strings.

    Verify every variable in SQL uses parameter binding (? or named :param).Confirm MariaDB/MySQL syntax — not PostgreSQL or MSSQL.Run EXPLAIN on complex queries to check index usage.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score94/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars7SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
event4u-app/agent-config
Skill path
src/skills/sql-writing/SKILL.md
Commit
0adf49a8ae84b0ff6e2de8759eea43257e020eff
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

sql

Grounded corpus: tuning decisions (indexes, keyset pagination, N+1, trigram search, lock contention) ground via the database corpus — ./scripts-run <skills-root>/corpus-grounding/scripts/ground search --manifest <skills-root>/database/data/manifest.json "<symptom>".

When to use

Use when writing or reviewing raw SQL queries, migrations with raw statements, or seeders with raw SQL.

Do NOT use when:

  • Eloquent/Query Builder queries (use eloquent or database skill)
  • Schema design (use database skill)

Procedure: Write raw SQL

  1. Inspect call site & choose approach — identify every dynamic value flowing into the query, then pick: query builder when possible. Raw SQL only when query builder can't express the query.
  2. Parameterize — Every variable must use ? binding or named :param. Never interpolate PHP variables into SQL strings.
  3. Use MariaDB syntax — Not PostgreSQL or MSSQL. Check php/sql.md for MariaDB-specific patterns.
  4. Verify — Run EXPLAIN on complex queries. Check that no PHP interpolation ("$var", '{$var}') appears in SQL.
NEVER build SQL strings with PHP variable interpolation or concatenation.
ALWAYS use parameterized queries or query builder.

Conventions

→ See guideline php/sql.md for parameterization patterns, common mistakes, MariaDB syntax reference.

Quick reference

// ✅ Safe
DB::select('SELECT * FROM users WHERE email = ?', [$email]);

// ❌ SQL injection
DB::select("SELECT * FROM users WHERE email = '{$email}'");

Validate

  1. Verify every variable in SQL uses parameter binding (? or named :param).
  2. Confirm MariaDB/MySQL syntax — not PostgreSQL or MSSQL.
  3. Run EXPLAIN on complex queries to check index usage.
  4. Check that no PHP variable interpolation ("$var", '{$var}') appears in SQL strings.

Output format

  1. Parameterized SQL query using MariaDB/MySQL syntax
  2. EXPLAIN output for performance-critical queries

Gotcha

  • MariaDB and MySQL have subtle syntax differences.
  • The model writes $variable in SQL strings instead of ? placeholders.
  • GROUP BY with ONLY_FULL_GROUP_BY requires all non-aggregated columns.
  • Use SQL types (NULL, 1/0, JSON_ARRAY()) — not PHP equivalents.

Do NOT

  • Do NOT interpolate PHP variables into SQL strings — always parameterize.
  • Do NOT use PHP syntax (arrays, booleans, null) in raw SQL — use SQL equivalents.
  • Do NOT write raw SQL when the query builder can express the same thing clearly.

Auto-trigger keywords

  • raw SQL
  • SQL query
  • parameterized query
  • MariaDB syntax
  • SQL injection

Alternatives

Compare before choosing

Computed 9831,966

K-Dense-AI/scientific-agent-skills

dask

Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.

Computed 9831,966

K-Dense-AI/scientific-agent-skills

imaging-data-commons

Query and download public cancer imaging data from NCI Imaging Data Commons using idc-index. Use for accessing large-scale radiology (CT, MR, PET) and pathology datasets for AI training or research. No authentication required. Query by metadata, visualize in browser, check licenses.

Computed 9737,126

github/awesome-copilot

geofeed-tuner

Use this skill whenever the user mentions IP geolocation feeds, RFC 8805, geofeeds, or wants help creating, tuning, validating, or publishing a self-published IP geolocation feed in CSV format. Intended user audience is a network operator, ISP, mobile carrier, cloud provider, hosting company, IXP, or satellite provider asking about IP geolocation accuracy, or geofeed authoring best practices. Helps create, refine, and improve CSV-format IP geolocation feeds with opinionated recommendations beyon

Computed 9631,966

K-Dense-AI/scientific-agent-skills

neuropixels-analysis

Analyze Neuropixels extracellular recordings end-to-end with SpikeInterface. Covers loading SpikeGLX/Open Ephys/NWB data, preprocessing, drift/motion correction, Kilosort4 (and CPU) spike sorting, quality metrics, and unit curation (threshold-based, model-based UnitRefine, and AI-assisted visual review). Use when working with Neuropixels 1.0/2.0 recordings, spike sorting, or extracellular electrophysiology analysis.