Enforcement scripts
This skill includes programmatic enforcement of the catalog-first retrieval invariant:
scripts/retrieve.py— CSV-based semantic retrieval with authority rankingscripts/verify.py— PageIndex MCP tool call plan generatorscripts/pipeline.py— End-to-end: semantic query → catalog → rerank → verification plan
See scripts/README.md for full usage.
PageIndex Semantic Retrieval Best Practices
Use this skill to answer corpus-grounded questions over the PageIndex library with high recall and high precision.
It is a retrieval-and-verification skill, not a raw indexing skill.
This skill is designed to be standalone. It ships with a bundled catalog snapshot under:
data/current/
So it can be used remotely in Claude.ai without depending on another local skill installation.
If the user needs a fresher live crawl than the bundled snapshot, then refresh separately with:
pageindex-reference-index
What "best practice" means here
Use a hybrid workflow:
- catalog-first retrieval for breadth
- authority-aware reranking for trustworthiness
- work / section / topic clustering for semantic coverage
- live PageIndex page extraction for exact verification
- citation-rich synthesis in the final answer
Do not jump straight to get_page_content across random PDFs.
Do not rely on filenames alone when the catalog already has work_title, topic_category, tags, and relations.
Primary retrieval workflow
1. Check whether the catalog is current enough
Use the bundled snapshot in:
data/current/
Inspect at least:
data/current/pageindex_summary.jsondata/current/pageindex_diff.mddata/current/pageindex_enrichment.mddata/current/pageindex_work_index.csvdata/current/pageindex_topic_index.csvdata/current/pageindex_verification_index.csv
If the user's request depends on the newest live library state and the bundle is stale, note that limitation explicitly and, if available, refresh separately with pageindex-reference-index.
2. Generate candidates from the catalog
Prefer hybrid candidate generation:
topictopic_categoryspecific_topicwork_titlework_section_titlesource_familydocument_typeauthorityexam_domain- hierarchical tags
Remote-first use:
data/current/pageindex_work_index.csvdata/current/pageindex_topic_index.csvdata/current/pageindex_verification_index.csvdata/current/pageindex_catalog.csv
If you have an execution environment, you may also use bundled query helpers or SQL mirrors, but the skill should remain effective even without them.
3. Rerank by authority and coverage
Default ranking order:
officialsyllabi / examiner reports / guidelinestextbookjournalreferencenotes/ community-style material
Then balance for breadth:
- prefer multiple
source_familyvalues over many hits from one work - prefer section diversity when synthesizing a topic
- include both full-book anchors and chapter-level hits when useful
4. Verify with live PageIndex only after narrowing the set
Once you have the best candidate documents:
- use
get_documentto confirm readiness - for docs >20 pages, use
get_document_structurefirst - then use
get_page_contentfor tight ranges only
Always preserve exact document / page provenance in your notes.
5. Answer with explicit grounding
Your answer should distinguish:
- metadata-level retrieval
- live page-verified retrieval
When verified, cite:
- document name
- folder path
- page range
- why that source was chosen
Retrieval patterns
Pattern A — "Which texts cover X?"
- search
topic,topic_category,specific_topic, and FTS text - cluster by
source_family - surface 5–10 best works
- optionally verify the top 2–3
Pattern B — "Compare what different sources say about X"
- retrieve from at least 3 distinct
source_familyvalues - prioritize textbooks + official sources
- verify representative passages live
- synthesize agreements, disagreements, and level of specificity
Pattern C — "Find the best source to answer X"
- use
verification_index - filter by likely
topic_category - rank by
authority,work_title,work_section_title - verify the best 1–3 sources live
Pattern D — "Build a reading stack for X"
- official syllabus / examiner reports first
- core textbook chapters next
- supplementary texts after
- BJA / notes only as adjuncts
Important heuristics
- Prefer
work_titleandwork_section_titleover bare filenames. - Prefer
topic_categoryfor recall andspecific_topicfor precision. - Use
material_kindto separate full books from chapters, front matter, back matter, and problem sets. - Use
source_familyto avoid overcounting multiple chapter hits from the same work. - Use
exam_domainto keep ANZCA / CICM filtering intentional. - Treat
pageindex_discrepancies.mdas a warning surface, not a footnote.
Rich semantic retrieval checklist
Before finalizing an answer, ask yourself:
- Did I retrieve from the catalog first?
- Did I include the highest-authority sources available?
- Did I avoid collapsing everything into one work?
- Did I verify exact pages when making strong claims?
- Did I cite folder path + page range?
- Did I mention uncertainty if the result is metadata-only?
Recommended references
Read as needed:
references/retrieval-playbook.mdreferences/query-recipes.mdreferences/citation-template.mdreferences/remote-usage.mddata/current/README.md
Output contract
For retrieval tasks, usually return:
- best candidate works
- best candidate documents
- verified page-backed evidence where available
- a brief synthesis
- suggested next retrieval moves if confidence is partial