Repository navigation
Harden Postgres skills, add reference material, CI, and evals (v0.2.0) - #1
Merged
Merged
Conversation
…v0.2.0) Adds the production rules the original six skills were missing, corrects two factual errors, and puts a validation gate and an eval harness in the repo. Skills: - writing-safe-migrations: lock_timeout and the lock-queue failure mode (a waiting ACCESS EXCLUSIVE blocks every query behind it), invalid-index cleanup after a failed CREATE INDEX CONCURRENTLY, SET NOT NULL via a validated CHECK, batched backfills, expand-and-contract for column type changes. - writing-performant-queries: restructured around an evidence-first diagnostic sequence; adds pg_stat_statements and pg_stat_user_tables triage. - managing-postgres-connections: pgbouncer pooling modes and what breaks under transaction pooling; pool sizing from the database inward. - tuning-autovacuum-and-bloat: concrete per-table parameter values and transaction-ID age monitoring. - postgres-advanced-patterns: atomic UPDATE ... FROM (SELECT ... FOR UPDATE SKIP LOCKED) ... RETURNING claim, lease expiry, partial index, COPY for bulk load. - designing-postgres-schemas: design-time partitioning and retention. Corrections: - timestamptz stores an instant and discards the original offset; it does not store "UTC + offset" as previously documented. - Removed an unverifiable claim that PostgreSQL 19 adds native REPACK ... CONCURRENTLY. Reference material moved to skills/*/reference/, one level deep: DDL lock levels, pgbouncer pooling modes, autovacuum settings and wraparound monitoring. Adds .github/workflows/validate-skills.yml, a dependency-free check on every SKILL.md: frontmatter parses, name and description satisfy the documented limits, name matches its directory, and relative links resolve. Adds evals/ with 18 cases and a two-arm runner. No improvement claim is published: at one run per case the noise floor and the measured effect are the same size. evals/FINDINGS.md records what was measured and what the design needs before a number is meaningful.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (18)
📝 WalkthroughWalkthroughThe change adds repository metadata and skill validation, introduces a two-arm evaluation harness, and revises PostgreSQL guidance for schemas, connections, operational patterns, vacuum, query diagnosis, and safe migrations. ChangesPostgres skills repository update
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant EvaluationCases
participant EvaluationRunner
participant ClaudeCLI
participant GradeReport
EvaluationCases->>EvaluationRunner: load cases
EvaluationRunner->>ClaudeCLI: generate baseline and treatment responses
ClaudeCLI-->>EvaluationRunner: return responses
EvaluationRunner->>ClaudeCLI: grade responses against rubrics
ClaudeCLI-->>GradeReport: return verdicts
GradeReport-->>EvaluationRunner: aggregate skill scores
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The six skills were good structurally but had real gaps and two factual errors. This adds the missing production rules, corrects the errors, and puts a validation gate and an eval harness in the repo.
Highest-value additions
lock_timeoutand the lock-queue failure mode. The outage people actually hit is not the rewrite — it is a statement waiting forACCESS EXCLUSIVEwhile every query behind it queues too. The table goes down without the migration ever acquiring its lock. This was absent entirely.CREATE INDEX CONCURRENTLYleaves an invalid index that must be dropped before retrying. The skill taught the command, not the recovery.skills/writing-safe-migrations/reference/lock-levels.md) — which operations rewrite, which are catalog-only, which allow concurrent traffic.LISTEN/NOTIFY, session variables, temp tables.pg_stat_statements. The performance skill previously began at "you already know which query is slow."UPDATE ... FROM (SELECT ... FOR UPDATE SKIP LOCKED) ... RETURNING, plus lease expiry, a partial index, and idempotency.Corrections
timestamptzstores an instant and discards the original offset. The previous text said it stores "UTC + offset", which is wrong and would mislead anyone deciding whether to keep a separate timezone column.REPACK … CONCURRENTLY.CI
.github/workflows/validate-skills.ymlvalidates everySKILL.mdwith no dependencies: frontmatter parses,nameanddescriptionmeet the documented limits,namematches its directory, and every relative link resolves.Evals — read before citing any number
18 cases, three per skill, with a two-arm runner comparing responses with and without the skills.
No improvement claim is published, deliberately. Measured on Sonnet: baseline 66/90, with skills 76/90. But between two runs of the same configuration, 20% of items flipped verdict — a noise floor of roughly ±10 on 90, the same size as the effect. At one run per case these numbers cannot separate a real effect from sampling variation.
evals/FINDINGS.mddocuments this in full, including the two design flaws that must be fixed before any published number is honest: the rubric was written after reading the skills (teaching to the test), and there are no repeats per cell.The skills are better on inspection. That claim rests on review, not on the eval.
Verification
SKILL.mdunder 500 lines; reference files one level deep.Skills grew from ~470 to ~650 words each. That length bought prominence for rules that were being dropped from responses when they lived in reference files — a tradeoff worth revisiting later.
Summary by CodeRabbit
Documentation
Quality Improvements