planetscale-codebase-sqlcommenter-instrumentation
This skill inspects a application codebase to detect its language, framework, ORM, and deployment configuration, then recommends SQLCommenter-compatible query…
Identity proven by GitHub's verified organisation badge (planetscale)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- 95c80f9pinned Oct 9, 2026
- Context cost
- about 1,200 tokenswhen the skill loads
- GitHub stars
- 5on planetscale/claude-plugin
- Scripts
- None found
What it does
“Inspect an application repository connected to PlanetScale and recommend SQLCommenter-compatible query tagging packages and conventions.”
Generated summary from the skill's own text
This skill inspects a application codebase to detect its language, framework, ORM, and deployment configuration, then recommends SQLCommenter-compatible query instrumentation packages and tag schemas for use with PlanetScale Insights and Postgres Traffic Control. It analyzes the existing query tagging approach and proposes a standardized tag structure without making changes unless approved.
When to use it
- Instrumenting queries in a PlanetScale-connected app for better observability
- Adding SQL comment tags to an ORM or query builder for query attribution
- Standardizing query tracing across multiple frameworks or services
- Evaluating which SQLCommenter package fits a detected tech stack
When not to
- Already using a non-SQLCommenter query tracing system incompatible with PlanetScale
- Directly modifying application code without agent approval needed first
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add planetscale/claude-plugin --skill planetscale-codebase-sqlcommenter-instrumentationInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install planetscale/claude-plugin planetscale-codebase-sqlcommenter-instrumentation@95c80f9f391be9b1b6172bf82d4191e1ec11b637Installs the commit we checked (95c80f9).
Copy by hand
Download the folder at 95c80f9 and put it in .claude/skills/planetscale-codebase-sqlcommenter-instrumentation for Claude Code and in .agents/skills/planetscale-codebase-sqlcommenter-instrumentation for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install planetscale@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "planetscale-codebase-sqlcommenter-instrumentation" by PlanetScale. Source, pinned to commit 95c80f9f391be9b1b6172bf82d4191e1ec11b637: https://github.com/planetscale/claude-plugin/tree/95c80f9f391be9b1b6172bf82d4191e1ec11b637/planetscale-skills/08-codebase-sqlcommenter-instrumentation 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/planetscale-codebase-sqlcommenter-instrumentation/ for Claude Code and .agents/skills/planetscale-codebase-sqlcommenter-instrumentation/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/planetscale/planetscale-codebase-sqlcommenter-instrumentation
SKILL.md at the pin
--- name: planetscale-codebase-sqlcommenter-instrumentation description: Inspect an application repository connected to PlanetScale and recommend SQLCommenter-compatible query tagging packages and conventions. --- # Codebase SQLCommenter instrumentation ## Purpose Inspect the application repository connected to PlanetScale and recommend the correct SQLCommenter-style instrumentation so PlanetScale Insights and Postgres Traffic Control can attribute queries to application code paths. Do not edit files or install dependencies without approval. ## Repository inspection Identify: - Language and framework. - ORM or query builder. - Database adapter. - Migration tool. - Background job system. - Routing framework. - Deployment metadata source, such as git SHA or release ID. - Existing SQL comments, query tags, tracing, OpenTelemetry, or database middleware. - PlanetScale connection configuration. - Whether the repository connects to Vitess, Postgres, or both. ## Recommended package mapping Use the most native maintained option for the detected stack. ### Ruby on Rails / ActiveRecord Preferred for PlanetScale tag compatibility: - `activerecord-sql_commenter` from PlanetScale when Rails query comments need SQLCommenter format for PlanetScale Query Insights. Other options: - Rails built-in query logs when sufficient and compatible with the target database/Insights behavior. - `marginalia` for older Rails or when Basecamp-style ActiveRecord query attribution is already in use. - `sqlcommenter_rails` where the project already uses the OpenTelemetry SQLCommenter ecosystem. Recommend tags: - `application` - `controller` - `action` - `job` - `route` - `release_sha` ### Laravel / PHP Preferred: - `spatie/laravel-sql-commenter` for SQLCommenter-format comments compatible with PlanetScale Query Insights. Recommend tags: - `application` - `route` - `controller` - `action` - `job` - `queue` - `release_sha` ### Prisma / TypeScript / JavaScript Preferred: - Prisma’s first-party SQL comments packages when Prisma is detected: - `@prisma/sqlcommenter` - `@prisma/sqlcommenter-query-tags` - `@prisma/sqlcommenter-trace-context` Note: PlanetScale’s Postgres query-tag docs may list Prisma as lacking official SQLCommenter support, but Prisma’s own current docs provide first-party SQLCommenter packages. Prefer current Prisma docs when Prisma is detected. Recommend tags: - `application` - `service` - `route` - `operation` - `feature` - `release_sha` ### Knex / Sequelize / Express / Node Use SQLCommenter-compatible middleware or instrumentation from the OpenTelemetry SQLCommenter ecosystem where maintained and compatible. Recommend tags: - `application` - `service` - `route` - `controller` - `action` - `feature` - `release_sha` ### Kysely / Drizzle / Bun / custom query builders If there is no maintained SQLCommenter package, recommend manual tagging at the database client boundary or query builder extension layer. Requirements: - Tags must be structured SQL comments. - Tags must be inserted before the statement terminator. - Tags must survive ORM, proxy, and pooler behavior. - Values must be URL encoded and safe for SQL comments. - Tags must be low-cardinality. ### Django / SQLAlchemy / psycopg2 / Flask / Python Use SQLCommenter instrumentation from the OpenTelemetry SQLCommenter ecosystem where compatible. Recommend tags: - `application` - `framework` - `route` - `view` - `job` - `release_sha` ### Java / Hibernate / Spring Use SQLCommenter-compatible instrumentation for Hibernate/Spring where compatible. Recommend tags: - `application` - `service` - `controller` - `action` - `route` - `release_sha` ### Go / database/sql / net/http / gorilla/mux Use SQLCommenter-compatible instrumentation or a database wrapper at the query boundary. Recommend tags: - `application` - `service` - `handler` - `route` - `job` - `release_sha` ## Standard tag policy Recommend this baseline across all frameworks: - Stable, bounded values only. - Normalize routes before tagging. - Include app/service/job attribution. - Include deploy SHA. - Include source type for agents, scripts, BI, workers, and integrations. - Do not include secrets, PII, user IDs, request IDs, raw tenant IDs, or raw URLs. ## Validation plan Before recommending merge: - Confirm generated SQL comments appear in local/staging query logs. - Confirm comments survive the ORM, driver, pooler, and PlanetScale connection path. - Confirm Insights displays tags. - Confirm tag cardinality is bounded. - Confirm Traffic Control can match the intended tags for Postgres. - Confirm no sensitive data is present. ## Output Return: - Detected stack. - Current query tagging state. - Recommended package or manual instrumentation path. - Proposed tag schema. - Files likely to change. - Validation steps. - Risks. - Proposed changes requiring approval. End with: “No repository files or dependencies have been changed.”
From planetscale/claude-plugin at 95c80f9, shown as plain text under its license: MIT (permissive). The license text is in planetscale-skills/LICENSE.
View SKILL.md on GitHub at 95c80f9Files
- SKILL.md5.0 KB · 9890331329f3
1 file, 5.0 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 95c80f9More from PlanetScale
neki
This skill guides agents on Neki, PlanetScale's distributed sharded Postgres system.
Claude Code, Codex, Cursor +4 · about 2K tokens · pinned 6 days ago
postgres
This skill provides PostgreSQL best practices, optimization guidance, and operational knowledge across schema design, indexing, query patterns, and…
Claude Code, Codex, Cursor +4 · about 1.7K tokens · pinned 6 days ago
planetscale-safe-orchestrator
This master skill orchestrates a comprehensive PlanetScale best-practices assessment across inventory, engine configuration, query performance, traffic…
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago
mysql
This skill guides the agent through MySQL and InnoDB schema design, indexing strategies, query optimization, transaction handling, and operational tasks.
Claude Code, Codex, Cursor +4 · about 1.3K tokens · pinned 6 days ago
neki
This skill provides guidance on Neki, PlanetScale's sharded Postgres product designed for horizontal scaling.
Claude Code, Codex, Cursor +4 · about 420 tokens · pinned 6 days ago
planetscale-autonomous-execution-mode
This skill enables an agent to execute PlanetScale database changes end-to-end without per-step approval when the operator provides explicit risk…
Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago
Related in Observability
sentry-php-sdk
Guides setup of Sentry error monitoring, tracing, profiling, logging, metrics, and cron tracking for PHP applications.
by SentryOfficial publisher
Claude Code · about 3.6K tokens · pinned 6 days ago
sentry-setup-ai-monitoring
Configures Sentry to monitor LLM calls, agent execution, and token consumption across JavaScript, Python, and PHP/Laravel applications.
by SentryOfficial publisher
Claude Code · about 5.3K tokens · pinned 6 days ago
dd-code-generation
This skill enables agents to interact with Datadog through the pup CLI tool for immediate queries and operations, or generate code for integrating Datadog…
by DatadogOfficial publisher
Claude Code, Codex, Cursor +3 · about 4.3K tokens · pinned 6 days ago
sentry-fix-stack-traces
This skill helps fix unreadable stack traces in Sentry by uploading the correct debug artifacts (source maps for JavaScript/TypeScript, or debug files like…
by SentryOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
sentry-instrument
This skill instruments applications with Sentry to capture errors, tracing, logging, profiling, metrics, session replay, user feedback, and AI/LLM monitoring…
by SentryOfficial publisher
Claude Code, Codex, Cursor +4 · about 3K tokens · pinned 6 days ago
planetscale-query-insights-and-tags
This skill analyzes PlanetScale database query performance using Insights API to identify expensive and anomalous queries, then recommends SQLCommenter-style…
by PlanetScaleOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.4K tokens · pinned 6 days ago