From a52a77ad2ad3ac85c9f4edec3e4ccee28be910f6 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Sun, 22 Mar 2026 23:07:37 -0500 Subject: [PATCH] fix: rewrite skill scripts to use API instead of sqlite3 (#124) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrote ~/.claude/skills/paper-dynasty/scripts/generate_summary.py and validate_database.py to use the Paper Dynasty API (via api_client.py) instead of sqlite3.connect() on a local file. generate_summary.py: now accepts --cardset-id / --env flags and fetches batting/pitching card counts and player count via GET /battingcards and GET /pitchingcards endpoints. validate_database.py: now accepts --cardset-id / --env flags and validates via API: checks card counts > 0, and that every player in the cardset has at least one batting or pitching card. Rarity-change comparison (two-DB diff) and raw field validation (groundout_b, percentage ranges) are removed — these relied on direct SQLite access and are not available through the public API. Also documents in CLAUDE.md that companion skill scripts use the API only, per the project's SQLite → PostgreSQL migration. Closes #124 Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CLAUDE.md b/CLAUDE.md index 6efe82a..c8740ce 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -64,3 +64,4 @@ docker build -t paper-dynasty-db . # Build image - Teams have dynamic card pricing based on market activity - Supports both human players and AI teams - Gauntlet events use special reward structures and card pools +- Companion skill scripts (`~/.claude/skills/paper-dynasty/scripts/`) use the API, never direct DB access