query-magic-references
Query this repository's optional generated Scryfall SQLite index for exact printings, set and collector metadata, card characteristics, faces, Oracle text, legalities, keywords, colors, related parts, and rulings. Use for fast UUID or name lookups, full-text searches, joins, aggregate analysis, batch audits, or comparisons while developing Penta. Do not use it as the authority for Comprehensive Rules, live prices, or printing languages outside the indexed sources; refresh the cache or use an authoritative online source when necessary.
- License 许可
- Apache-2.0
- 所属仓库
- lacker/penta
- 最近更新
- 2026-11-10
- Stars
- ★ 1
- Forks
- 3
01 前言 Front Matter
- name
- query-magic-references
- description
- Query this repository's optional generated Scryfall SQLite index for exact printings, set and collector metadata, card characteristics, faces, Oracle text, legalities, keywords, colors, related parts, and rulings. Use for fast UUID or name lookups, full-text searches, joins, aggregate analysis, batch audits, or comparisons while developing Penta. Do not use it as the authority for Comprehensive Rules, live prices, or printing languages outside the indexed sources; refresh the cache or use an authoritative online source when necessary.
02 资源文件 2
- 参考文档agents/openai.yaml309 B
- 参考文档references/schema.md13.5 KB
03 SKILL.md 正文
Query Magic References
Use the clone-wide, schema-versioned Scryfall index as a read-only development reference. It is shared by all linked worktrees. Keep results narrow enough to inspect; never dump the database into model context.
Start safely
The field map below is sufficient for exact UUID, exact name/set, exact set/collector, and bounded set-level queries; do not load a larger reference merely to repeat one of those common patterns. Read the schema reference before using unlisted fields, unfamiliar joins, FTS, broad aggregates, batch analysis, query planning, or changing the index tooling. It documents the full schema, examples, indexes, and interpretation limits. The link is written from the repository root so it resolves identically through both skill entrypoints.
Resolve the database path instead of constructing or hardcoding it:
REFERENCE_SCRIPT=.agents/skills/refresh-magic-references/scripts/reference_material.py
SCRYFALL_DB="$(python3 "$REFERENCE_SCRIPT" path scryfall-index)"
Check the database against its cached inputs without networking or refreshing:
python3 .agents/skills/refresh-magic-references/scripts/reference_material.py status scryfall-index
Path resolution and this local status check are low-friction reads. Use the database if it is current relative to its inputs; do not refresh merely because the worktree is new. For a genuinely freshness-sensitive task, separately compare the inputs with Scryfall:
python3 .agents/skills/refresh-magic-references/scripts/reference_material.py status default-cards rulings
If the database is missing, corrupt, or unavailable for the required schema,
use $refresh-magic-references to repair it with explicit human approval. Only
refresh intact source data when the current task truly needs newer material.
If shared mutation is unavailable or unwarranted, use retained source data or
an authoritative online source instead.
Choose the narrowest query
- Use
printings.scryfall_idfor an exact printing UUID. - Use
(printings.normalized_name, printings.set_code)when an exact UUID is absent or stale, retaining collector number and UUID in the result. Normalize lookup text with Unicode NFKC followed by case folding; set codes are stored lowercase. - Use
printingsfor set, collector-number, language, rarity, artist, and parent-image metadata. Keepscryfall_idin projected results when a lookup can match more than one printing. - Use
card_names.normalized_namefor an exact primary or face name, with the same NFKC-plus-case-fold normalization. - Use
cardsfor Oracle-level characteristics and compact JSON fields. - Use
card_facesfor face-specific cost, type, text, or stats. - Join
printingstocardsthrough nullablecard_id, and joincardstorulingsthroughoracle_id. - Use
card_keywords,card_colors, andcard_partsfor relationships. - Use
card_searchorruling_searchwithMATCHfor words and concepts. - Use bounded
LIKEqueries when FTS5 is unavailable or punctuation matters.
Open the database read-only:
sqlite3 -readonly -header -column "$SCRYFALL_DB"
Use -json for structured consumption. Project only needed columns, run
COUNT(*) before broad extraction, add LIMIT while exploring, and use
EXPLAIN QUERY PLAN for slow or repeated batch queries. Never modify the
generated database directly.
Interpret results carefully
default-cards supplies one default-language Scryfall object per printing:
English when available, otherwise the printing's only available language. It
does not contain every localized object; use all-cards or Scryfall online when
that distinction matters. Some Scryfall objects have no Oracle ID and therefore
have a printings row with no related cards row; preserve them with a
LEFT JOIN instead of silently dropping them.
Collector numbers are opaque text. Compare them exactly for identity, retain
suffixes and symbols, and do not assume the entire Scryfall corpus can be
sorted by parsing them as integers. Printing metadata and Scryfall legalities
do not establish Old School legality, and Scryfall format legality is not a
substitute for Eternal Central's rules. Oracle text may intentionally differ
from Penta's adapted historical behavior. Resolve compressed bulk-file paths
through the refresh script for unmodeled fields such as localized
printed_name values and exact-printing face images. Do not substitute
representative card_faces images for a different printing. Use an
appropriately live source for prices.
When repeated work exposes a missing indexed field, relationship, or query pattern, treat that as a reference-tooling change: update the builder, both skills, and the documented schema together, then rebuild and validate with the required shared-cache approval. Do not expand the tooling for an isolated one-off query.
04 同仓库更多 Skills
refresh-magic-references
暂无简介
query-magic-references
暂无简介
profile-engine-performance
暂无简介
play-penta
暂无简介
refresh-magic-references
Locate, inspect, migrate, refresh, and index this repository's optional shared Magic: The Gathering reference cache, including the Wizards Comprehensive Rules, Eternal Central 93/94 rules, Scryfall bulk card and ruling data, and schema-versioned SQLite indexes. Use when an agent needs reproducible local rules or card data, needs to diagnose cache freshness or locking, needs to build or repair the Scryfall index, or is asked to populate or update the clone-wide cache. Do not require it for questions that authoritative online sources can answer reliably.
profile-engine-performance
Benchmark and profile Penta's native engine with reproducible deterministic workloads, Hyperfine wall-clock measurements, saved Samply CPU captures, and allocation-profiler guidance. Use when investigating engine throughput, CPU hotspots, CPU spent in allocator routines, real allocation churn, before-and-after performance, or the next optimization target. Do not compare different workloads, seeds, build profiles, or machines, and do not treat sample percentages as benchmark speedups.