Skip to main content
skill CX Codex

planetscale-traffic-control-recommendations — Claude Code skill

This skill drafts a recommendation plan for PlanetScale Postgres Traffic Control budgets and rules, and applies nothing without approval.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add planetscale/skills --skill planetscale-traffic-control-recommendations -a claude-code
Open on GitHub

What planetscale-traffic-control-recommendations does

The skill runs against PlanetScale Postgres. It inspects current budgets and rules, query patterns in Insights, query tags, application routes and jobs, plus known critical and known expensive paths. From that it proposes which traffic slices to bound: exports, reports, search endpoints, admin dashboards, backfills, workers and queues, third-party webhooks, BI tools, agent-generated reads, and high-frequency polling.

Rollout order is fixed. Start in warn, watch the warnings and false positives, tune tags and thresholds, and move to enforce only with explicit approval and an emergency rollback path. If query tags are missing, the skill recommends tagging first, unless a fingerprint rule is clearly needed for an immediate known offender. One budget per materially different traffic class — combining unrelated traffic hides who is consuming the budget.

Each proposal spells out the budget name, target branch, mode, matched slice, rule type, limit rationale, the Insights queries behind it, safety risk, and a test and rollback plan. The skill also states the limits plainly: Traffic Control does not replace query tuning, is not a web application firewall, and does not replace application-level rate limits. Bad tags create bad rules, and enforce can reject queries and change how your app behaves — worth checking your tags before you flip it on.

What it helps with

  • shield critical traffic from runaway queries
  • carve out budgets for agent and MCP queries
  • keep backfills and retries from starving interactive traffic
  • isolate unpredictable third-party integration behavior
  • write an observe-and-rollback plan before switching to enforce

Example prompts for the agent

  • Draft a Traffic Control budget plan for PlanetScale Postgres, don't apply anything
  • Propose rules for traffic tagged source=agent and feature=export
  • Which fingerprint rules do we need for the expensive queries in Insights?

How to install planetscale-traffic-control-recommendations

1Skills CLI (Vercel)

npx skills add planetscale/skills --skill planetscale-traffic-control-recommendations -a claude-code

2Manually: put the files in place

~/.claude/skills/planetscale-traffic-control-recommendations/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/planetscale-traffic-control-recommendations/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about planetscale-traffic-control-recommendations

How do I install planetscale-traffic-control-recommendations in Claude?

Run npx skills add planetscale/skills --skill planetscale-traffic-control-recommendations -a claude-code. The skill lands at ~/.claude/skills/planetscale-traffic-control-recommendations/SKILL.md.

What does planetscale-traffic-control-recommendations do?

It builds a recommendation plan for PlanetScale Postgres Traffic Control budgets and rules. It does not create or change budgets without approval.

Can I go straight to enforce mode?

The skill recommends starting in warn, observing false positives, and tuning tags and thresholds. Move to enforce only with explicit approval and an emergency rollback path.

Source text

SKILL.md · MIT
---
name: planetscale-traffic-control-recommendations
description: Build a safe recommendation plan for PlanetScale Postgres Database Traffic Control budgets and rules without applying them.
---

# Database Traffic Control recommendations

## Purpose

For PlanetScale Postgres, recommend Traffic Control budgets and rules that protect critical traffic from runaway queries, traffic spikes, batch jobs, agents, and third-party integrations. Do not create or change budgets without approval.

## Preconditions

Run this skill only for PlanetScale Postgres.

Before recommending rules, inspect:

- Current budgets and rules.
- Insights query patterns.
- Current query tags.
- Application routes and jobs.
- Known critical paths.
- Known expensive non-critical paths.
- Active incidents or recent anomalies.

If query tags are missing, recommend tagging first unless a fingerprint-specific rule is clearly needed for an immediate known offender.

## Candidate traffic slices

Look for:

- Exports.
- Reports.
- Search endpoints.
- Admin dashboards.
- Backfills.
- Workers and queues.
- Webhooks from third-party systems.
- BI tools.
- Agent-generated read queries.
- High-frequency polling.
- Known expensive query fingerprints.
- Customer-triggered endpoints with high variance.

## Budget modes

Recommend in this order:

1. `warn` mode first for normal rollout.
2. Observe warnings and false positives.
3. Tune tags, fingerprints, and thresholds.
4. Move to `enforce` only with explicit approval and an emergency rollback path.

Do not recommend starting directly in `enforce` unless there is an active incident and the operator explicitly asks for emergency mitigation.

## Rule strategy

Prefer tag-based rules when tags are stable and bounded:

- `source=agent`
- `source=bi`
- `feature=export`
- `feature=report`
- `route=/admin/reports`
- `job=DailyBackfill`
- `service=analytics-worker`

Use fingerprint rules when:

- A specific known query pattern is dangerous.
- Tagging is missing or unreliable.
- The query source is hard to attribute.

Use a separate budget for each materially different traffic class.

Do not combine unrelated traffic in one budget because it hides who is consuming the budget.

## Suggested default budgets

Use these as recommendation patterns, not as values to apply blindly.

### Agent budget

Target: queries tagged `source=agent` or `source=mcp`.

Intent: prevent agents from starving application traffic.

Mode: start in `warn`.

Recommendation: agents should prefer replicas and read-only scopes. Writes require human approval.

### Export/reporting budget

Target: `feature=export`, `feature=report`, or specific report route/job.

Intent: keep customer-triggered reporting from consuming all database resources.

Mode: start in `warn`; consider `enforce` after observation.

### Background job budget

Target: worker service, queue, or job tags.

Intent: prevent backfills and retries from starving interactive traffic.

Mode: `warn` first; enforce only after confirming queue backpressure behavior.

### Third-party integration budget

Target: `source=integration`, partner-specific bounded tags, or route templates for inbound integration calls.

Intent: isolate unpredictable partner behavior.

Mode: `warn` first.

### Known fingerprint budget

Target: specific expensive query fingerprint.

Intent: contain a known pathological query while code or schema fixes are developed.

Mode: `warn` first unless emergency.

## “Each tag value” strategy

When PlanetScale supports applying a budget separately for each unique value of a selected tag, recommend it for bounded tags such as:

- `application`
- `service`
- `route` when normalized
- `job`
- `feature`
- `source`

Do not recommend it for unbounded tags such as user IDs, request IDs, raw tenant IDs, emails, UUIDs, or raw URLs.

## Limits and caveats to include

Every recommendation must explain:

- Traffic Control limits resource use; it does not replace query tuning.
- It is not a web application firewall.
- It does not replace application-level rate limits.
- Limits are guardrails, not exact guarantees for every failure mode.
- Bad tags create bad rules.
- Enforce mode can reject queries and affect application behavior.

## Output format

For each proposed budget:

- Budget name.
- Target branch.
- Mode: off, warn, or enforce.
- Matched traffic slice.
- Rule type: tag, fingerprint, keyspace, query kind.
- Proposed tags or fingerprint.
- Limit rationale.
- Queries seen in Insights that justify it.
- Safety risk.
- Test/observe plan.
- Rollback plan.
- Approval requirement.

End with:

“No Traffic Control budgets or rules have been created, updated, deleted, or enforced.”

© planetscale · MIT · planetscale/skills

Similar skills

All skills for Data and databases →

From the same set14

planetscale-postgres-safety-review Reviews PlanetScale Postgres setups across roles, pg_strict, Traffic Control, and backups. It flags database reliability gaps without applying unapproved changes. CX Codex +1 1,800installs planetscale-best-practices-matrix The skill maps database findings to PlanetScale recommendations and tells you what applies to Vitess and what to Postgres. CX Codex +1 1,800installs planetscale-vitess-safety-review Reviews a PlanetScale Vitess database for safe migrations, deploy requests, Insights and webhooks. Produces a report, applies nothing. CX Codex +1 1,700installs planetscale-webhook-automation-recommendations Recommends PlanetScale webhook subscriptions and safe automation patterns for database alerts, anomalies, and deploy requests. CX Codex +1 1,700installs planetscale-customer-report-template Turns inventory and review results into the final PlanetScale best-practices report for a customer database, with recommendations tied to measurements. CX Codex +1 1,700installs planetscale-readonly-inventory Collects read-only inventory data from PlanetScale databases, branches, backups, and Query Insights. It audits infrastructure setup without risking mutations or secret generation. CX Codex +1 1,700installs planetscale-codebase-sqlcommenter-instrumentation Inspects a repo connected to PlanetScale and recommends an SQLCommenter-compatible package for tagging queries. Use it when queries in Insights and Traffic Control need to map back to code paths. CX Codex +1 1,700installs planetscale-pscale-cli-automation Teaches coding agents to run the PlanetScale CLI non-interactively with JSON output. Useful when automating database tasks and verifying authentication. CX Codex +1 1,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor