planetscale-schema-recommendations-agent-loop

작성자: planetscale

PlanetScale 스키마 권장 사항을 안전하게 분류하고, 프로덕션 변경 사항을 적용하지 않고 검토된 브랜치, 마이그레이션, 이슈 또는 풀 리퀘스트로 전환합니다.

npx skills add https://github.com/planetscale/skills --skill planetscale-schema-recommendations-agent-loop

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.”

planetscale의 다른 스킬

neki
planetscale
PlanetScale의 샤딩된 Postgres 제품인 Neki에 대한 개요 및 정보. Neki 관련 작업 및 확장 또는 샤딩이 필요할 때 로드합니다...
vitess
planetscale
Vitess 모범 사례, 쿼리 최적화, PlanetScale Vitess 데이터베이스 연결 문제 해결. Vitess 데이터베이스, 샤딩 작업 시 로드…
planetscale-autonomous-execution-mode
planetscale
승인된 PlanetScale 변경 사항을 운영자가 명시적으로 위험을 인지한 경우 단계별 승인 없이 처음부터 끝까지 실행합니다. 다음을 정의합니다…
planetscale-best-practices-matrix
planetscale
엔진별로 어떤 PlanetScale 안전, 관찰 가능성 및 자동화 권장 사항이 적용되는지 결정하기 위한 간결한 기능 매트릭스입니다.
planetscale-change-gates-and-approval-contract
planetscale
PlanetScale, 데이터베이스, 리포지토리, 자격 증명, 네트워크 또는 자동화 변형에 대해 명시적 승인 게이트를 적용합니다.
planetscale-codebase-sqlcommenter-instrumentation
planetscale
PlanetScale에 연결된 애플리케이션 저장소를 검사하고 SQLCommenter 호환 쿼리 태깅 패키지와 규칙을 추천합니다.
planetscale-customer-report-template
planetscale
인벤토리 및 관련 검토 스킬을 실행한 후 최종 PlanetScale 모범 사례 보고서를 생성합니다.
planetscale-mcp-agent-operating-model
planetscale
PlanetScale MCP, Insights, 스키마 권장 사항 및 리포지토리 작업에서 자율적인 프로덕션 변경 없이 안전한 에이전트 동작을 구성합니다.