chinese-poetry-api
Skill1 starsChanged 4 months agoMITView on GitHub
Query the Chinese classical poetry API service (chinese-poetry-api, repo: https://github.com/palemoky/chinese-poetry-api) — 370k+ poems from Tang/Song/Yuan dynasties, with authors, dynasties, poetry types, full-text search, and random poem drawing. Use whenever the user asks to look up, search, or list classical Chinese poetry (古诗/唐诗/宋词/元曲), a specific poet's works, random poems, 飞花令 (single-character draws), or poetry metadata — even casual queries like "帮我找一首李白的诗" or "来一首五言绝句". Covers every REST endpoint: health, stats, poems (filtered lists), search, random, authors, dynasties, types. All output is raw server JSON, passed through unchanged.
- Reads credentials
In this repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- calendar-apiSkill
- deepseek-balanceSkill
- domain-querySkill
- enterprise-infoSkill
- epub-book-pipelineSkill
- freshrssSkill
- fun-asrSkill
- gaozhong-english-answer-parserSkill
- gotifySkill
- grillSkill
- img-recogSkill
- linkgoSkill
- mimo-ttsSkill
- personal-siyuan-standardsSkill
- scanned-pdf-to-epubSkill
- send-emailSkill
- wake-on-lanSkill
- zurlSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Run the user's command directly without pre-checking.
- Very specific: line 38
Read scripts/.env.example for the variable name.
- Very specific: line 39
Add or update POETRY_API_URL in the shared global file ~/.wmyskills/.env.
- Very specific: line 40
Do not copy .env.example to .env directly — that would overwrite existing config.
- Distinctive: line 42
If the user's request needs an instance that isn't running, start one after notifying the user:
- Very specific: line 54
All output is the raw JSON body from the server — print it verbatim, do not reformat or summarize it.
- Very specific: line 71
Every command accepts --lang zh-Hans|zh-Hant to switch simplified/traditional Chinese (zh-Hans is the default).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chinese Poetry API
CLI wrapper around the chinese-poetry-api
REST service (Go, ~370k poems, simplified/traditional Chinese via lang).
Execution Rule
Run the user's command directly without pre-checking; fix on failure.
Requirements
- Bun runtime (>= 1.0)
- A reachable chinese-poetry-api instance
Setup
The script reads the POETRY_API_URL environment variable — a full API base URL
(the script appends no prefix). The default is https://poetry.palemoky.com/api, an
online test instance provided by the upstream developer. It may rate-limit, change data,
or go offline without notice — treat it as a demo only. For real work, point
POETRY_API_URL at your own instance (local Docker or self-hosted deployment).
- Read
scripts/.env.examplefor the variable name. - Add or update
POETRY_API_URLin the shared global file~/.wmyskills/.env. - Do not copy
.env.exampleto.envdirectly — that would overwrite existing config.
If the user's request needs an instance that isn't running, start one after notifying the user:
docker run -d -p 1279:1279 palemoky/chinese-poetry-api:latestUsage
bun run scripts/main.ts <command> [options]All output is the raw JSON body from the server — print it verbatim, do not reformat
or summarize it. Non-2xx responses print Error <status>: <body> to stderr and exit 1.
| Command | Description | Options |
health | Health check | — |
stats | Overall statistics | — |
poems | List poems (filters are combinable) | --dynasty --author --dynasty-id --type-id (repeatable, OR) --page --page-size (max 100) |
search | Full-text search (FTS5) | --q (required) --type (all default, title, content, author) --page --page-size |
random | Random poem | --author --author-id --dynasty --dynasty-id --type (repeatable, OR) --type-id --char |
authors | List authors (paginated) | --page --page-size |
author | Author by ID | --id (required) |
dynasties | List dynasties (with poem counts) | — |
dynasty | Dynasty by ID | --id (required) |
types | List poetry types | — |
type | Poetry type by ID | --id (required) |
Every command accepts --lang zh-Hans|zh-Hant to switch simplified/traditional
Chinese (zh-Hans is the default). Invalid flags or arguments are rejected with an
error before any request is sent.
Examples
# Health check and overall stats
bun run scripts/main.ts health
bun run scripts/main.ts stats
# Li Bai's poems, page 2
bun run scripts/main.ts poems --author 李白 --page 2 --page-size 10
# Poems from the Tang dynasty in traditional Chinese
bun run scripts/main.ts poems --dynasty 唐 --lang zh-Hant
# Full-text search
bun run scripts/main.ts search --q 静夜思
bun run scripts/main.ts search --q 明月光 --type content
# Random 五言绝句 by Li Bai (multiple types are OR)
bun run scripts/main.ts random --author 李白 --type 五言绝句 --type 七言绝句
# 飞花令 — poem containing a single character
bun run scripts/main.ts random --char 春
# Metadata
bun run scripts/main.ts authors --page 1 --page-size 20
bun run scripts/main.ts author --id 1
bun run scripts/main.ts dynasties
bun run scripts/main.ts dynasty --id 6
bun run scripts/main.ts types
bun run scripts/main.ts type --id 10Notes
--char(飞花令) accepts exactly one character and can only be combined with--lang— other filters return 400 from the server.- Query params are validated server-side: unknown params or
page_sizeover 100 return 400, so don't invent filters the API doesn't document.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

