This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Claude Code skill marketplace for academic research on Chinese historical and geographical data. Each skill wraps an external API and is primarily documentation-driven. Skills are registered in .claude-plugin/marketplace.json.
Each skill follows a consistent layout:
<skill-name>/
├── SKILL.md # Main documentation (YAML frontmatter + usage guide)
└── references/
└── api_reference.md # Technical API spec (endpoints, params, responses)
Optional: a scripts/ directory for utility code (see wikidata-search/scripts/wikidata_api.py).
- cbdb-api — China Biographical Database (500K+ historical figures, 7th c. BCE–19th c. CE)
- chgis-tgaz — China Historical GIS Temporal Gazetteer (placenames, 222 BCE–1911 CE)
- wikidata-search — Wikidata integration (keyword, vector, SPARQL, entity retrieval)
There is no build system, package manager, test suite, or CI pipeline. This is a documentation-first project. The only code is wikidata-search/scripts/wikidata_api.py (Python 3, zero external dependencies).
- Create a directory with a hyphenated name (e.g.,
new-skill-name/) - Add
SKILL.mdwith YAML frontmatter (name, description, version, license, author, contributors) - Add
references/api_reference.mdwith endpoint details, parameters, and examples - Register in
.claude-plugin/marketplace.jsonunderplugins
Each SKILL.md follows this pattern: Overview → When to Use → Quick Start / Workflow → Best Practices → Example Code → Resources.
- Rate-limit requests (0.5–1s minimum between calls)
- Set
User-Agentheaders with contact info (required by Wikidata Vector DB and WDQS) - Respect HTTP 429 /
Retry-Afterheaders - Use
maxlagparameter for Wikidata Action API queries
- UTF-8 for all Chinese characters — do not URL-encode Chinese text into hex
- URL-encode spaces and special characters normally
- CHGIS TGAZ ID lookups: Format is in the URL path (
/placename/json/{id}), NOT a query param. The?fmt=jsonparam only works for faceted search. - CHGIS TGAZ search: Uses prefix/wildcard matching (
beijingmatches 北京路, 北井县, etc.) - CBDB JSON path: Response data is deeply nested under
Package.PersonAuthority.PersonInfo.Person - Wikidata Vector DB: Requires a descriptive
User-Agentheader or returns 403
- Type hints on all signatures
- Private methods prefixed with
_ - Rate limiting and retry with exponential backoff built in
- Environment variable
WIKIDATA_VECTORDB_API_SECRETfor vector DB auth