Generated banner for Planetscale Schema Recommendations Agent Loop
Generated logo for Planetscale Schema Recommendations Agent Loop

Planetscale Schema Recommendations Agent Loop

PlanetScaleOfficialPublished by PlanetScale

  • Skill
  • Workflow
  • Software development
  • MIT
  • No issues found

From the author

Safely triage PlanetScale schema recommendations and turn them into reviewed branches, migrations, issues, or pull requests without applying production changes.
— the description by PlanetScale

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a systematic approach for developers and agents to process PlanetScale schema recommendations. It focuses on converting database insights into actionable, safe implementation plans such as pull requests, migration files, or issues. By enforcing a strict 'no direct application' policy, it ensures that all schema changes are reviewed, tested, and aligned with the application's existing migration framework and codebase before any production impact occurs.

What it does

  • Collects and categorizes open PlanetScale schema recommendations.
  • Correlates database insights with application code, ORM models, and existing migrations.
  • Evaluates recommendations against safety criteria to prevent unnecessary or harmful changes.
  • Defines engine-specific implementation paths for both Vitess and Postgres environments.
  • Generates detailed implementation proposals including validation and rollback plans.
  • Ensures all outputs remain in a planning state, preventing automated production DDL execution.

When to use it

  • When managing database schema health in PlanetScale environments.
  • When you need to turn automated database insights into tracked engineering tasks.
  • When you want to ensure schema changes are reviewed within your standard CI/CD and migration workflows.
  • When you need to assess the impact of index changes or table maintenance before applying them.

Advantages

  • Prevents accidental or unreviewed production schema changes.
  • Integrates database optimization directly into the application development lifecycle.
  • Provides a clear audit trail for schema modifications.
  • Reduces risk by requiring validation and rollback plans for every recommendation.

Usage examples

“Triage the latest PlanetScale schema recommendations for the user-service repository.”
The agent will list open recommendations, correlate them with the user-service codebase, and generate a report detailing the proposed migration, validation steps, and potential risks for each item.
“Create a migration PR for the 'add index' recommendation ID 402.”
The agent will verify the recommendation, draft the necessary migration code within the project's framework, and provide a summary of the expected performance impact and rollback procedure.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/planetscale/planetscale-schema-recommendations-agent-loop/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip planetscale-schema-recommendations-agent-loop.zip -d .agents/skills

Documentation by PlanetScale

Schema recommendations agent loop

Purpose

Use PlanetScale schema recommendations as high-quality input to agents. Convert recommendations into safe implementation plans, issues, branches, migrations, or pull requests. Do not apply recommendations directly.

Inputs

Collect:

  • Open schema recommendations.

  • Recommendation type.

  • Affected table, keyspace, schema, and query pattern.

  • Suggested DDL.

  • Supporting Insights evidence.

  • Application repository and migration system.

  • Engine: Vitess or Postgres.

  • Target branch.

Recommendation types to recognize

  • Add index for inefficient query.

  • Remove redundant index.

  • Prevent primary key ID exhaustion.

  • Drop unused table.

  • Upgrade legacy charset or collation.

  • Other DDL recommendation.

Triage questions

For each recommendation, answer:

  • Is this still open and relevant?

  • Which query patterns triggered it?

  • Which application code paths generate those queries?

  • Is the recommendation safely expressible in the application’s migration framework?

  • Does the ORM/schema source of truth need to change?

  • Can it be tested on a non-production branch?

  • What is the expected impact on reads, writes, storage, and deploy time?

  • Is there a rollback or revert path?

  • Is there a competing recommendation or migration?

Engine-specific implementation path

Vitess

Recommended path:

  1. Create or use a development branch.

  2. Apply the schema change to that branch only after approval.

  3. Open a deploy request only after approval.

  4. Use deploy request review to inspect schema, shard impact, data-loss warnings, lint errors, and conflicts.

  5. Use normal safe migration path unless instant deployment is explicitly justified.

  6. Deploy only after approval.

  7. Monitor Insights and anomaly state after deployment.

Default output before approval: issue or PR with migration proposal, not a live deploy request.

Postgres

Recommended path:

  1. Convert DDL into the application’s migration framework where possible.

  2. Test against a non-production branch.

  3. Run application tests and relevant query checks.

  4. Open PR.

  5. Apply production migration only after approval.

  6. Use backups/PITR runbook as recovery plan, not as a substitute for migration review.

Default output before approval: migration PR or issue, not production DDL.

Codebase correlation

When a repository is available:

  • Search for the table and column names.

  • Search for ORM model definitions.

  • Search for migrations.

  • Search for query fingerprints, route tags, job names, and controller/action names from Insights.

  • Identify whether the recommendation should be implemented in database DDL, ORM schema, raw migration, or application query code.

Safety checks before proposing implementation

Block direct application when:

  • The recommendation is stale or already addressed.

  • The affected table is small enough that the benefit is unclear.

  • The index would be redundant with an existing index.

  • The index would hurt write-heavy workloads without enough read benefit.

  • The table appears unused but repository references are ambiguous.

  • Dropping a table or index lacks owner confirmation.

  • The migration framework has a different schema source of truth.

  • The recommendation targets production and no branch/test plan exists.

Output

For each recommendation, produce:

  • Recommendation ID/number.

  • Type.

  • Severity and expected benefit.

  • Evidence from Insights.

  • Affected schema.

  • Suggested DDL.

  • Application code owner or likely location.

  • Safe implementation path.

  • Validation plan.

  • Rollback/revert plan.

  • Approval requirement.

End with:

“No schema recommendations have been applied.”

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
PlanetScale
Publisher
PlanetScale (Official)
Source
planetscale/skills · planetscale-schema-recommendations-agent-loop · commit 999045c
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by PlanetScale.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download planetscale-schema-recommendations-agent-loop.zip