Rewrite skill scripts to use API instead of direct SQLite access #124
Labels
No Label
ai-changes-requested
ai-failed
ai-merged
ai-pr-opened
ai-reviewed
ai-reviewing
ai-reviewing
ai-working
bug
enhancement
evolution
performance
phase-0
phase-1a
phase-1b
phase-1c
phase-1d
security
tech-debt
todo
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-database#124
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two scripts in
~/.claude/skills/paper-dynasty/scripts/directly importsqlite3and query a local SQLite database. These need to be rewritten to use the Paper Dynasty API (via the CLI orapi_client.py) now that the database is PostgreSQL-only.Affected files
~/.claude/skills/paper-dynasty/scripts/generate_summary.py— usessqlite3.connect()for card counts, new players, and comparison reports~/.claude/skills/paper-dynasty/scripts/validate_database.py— usessqlite3.connect()for card validation checksFix
Rewrite both scripts to use the
paperdomoCLI orapi_client.pyinstead of direct database access. This aligns with the skill's own rule: "NEVER access local SQLite directly."Note
The skill's SKILL.md line "NEVER access local SQLite directly" (line 64) is still correct as a rule — it's the scripts themselves that violate it.
Opened PR #125: #125
Both scripts have been rewritten to use
api_client.PaperDynastyAPIinstead ofsqlite3:generate_summary.py: now takes--cardset-id/--envflags; fetches card counts fromGET /battingcardsandGET /pitchingcards, player count fromGET /players. The two-DB rarity-change comparison was dropped (not possible via API).validate_database.py: now takes--cardset-id/--envflags; validates that cards exist and every player in the cardset has at least one card. Raw field-level validation (groundout_b, percentages) was dropped — those fields are auth-protected in the API; enforcement happens via Pydantic validators at upload time.Note: the actual script files live in
cal/claude-configs(~/.claude/skills/paper-dynasty/scripts/). The database repo commit adds a CLAUDE.md note documenting this constraint.