Works with the AI Agents you already use
CJK & HKEX Financial Filing Prep Toolkit
by Wasabi hu
Zero-dependency Python toolkit to repair broken CJK/HKEX tables and CMap month glitches, rewrite bilingual finance/legal RAG queries into Elasticsearch/OpenSearch DSL, and audit corpus licenses offline.
$5
CJK & HKEX Financial Filing Prep Toolkit
Example session with this skill installed
Clean this extracted HKEX annual-report Markdown snippet (fix broken decimals, split table rows, accounting negatives, and "月→尸" CMap errors without touching forensic terms), then generate an Elasticsearch Bool DSL query comparing AURR and BORE 2025年 归母净利润 and 研发费用, and verify our corpus manifests before indexing.
- Read your context and instructions
- Compiled the cjk & hkex
Summary
Ran all three offline Python stdlib scripts on the synthetic Aurora Robotics Holdings Ltd. FY2025 extract, bilingual comparison query, and corpus manifests. Repaired 6 HKEX CMap month glitches, merged 1 split Markdown table row, fixed 3 broken numeric/accounting wraps (preserving forensic terms untouched), generated a cross-standard Elasticsearch/OpenSearch Bool DSL payload, and verified commercial-safe license compliance.
Stage 1 — Repaired HKEX Filing & Verification Stats
| Check | Before | After |
|---|---|---|
| Fiscal period CMap | 2025年12尸31日止十二個尸 | 2025年12月31日止十二個月 |
| Split decimal + % | 18.\n5\n% | 18.5% |
| Accounting negative | (\n12,450.5\n) / ( 45.20 ) | (12,450.5) / (45.20) |
| Wrapped table row | 1,280. + next row 45 | 1,280.45 |
| Forensic negative control | 法医尸检报告 / 尸体鑑定費用 | Unchanged (0 false positives) |
{
"version": "1.0.0",
"mode": "all",
"stats": {
"tables_seen": 1,
"cells_repaired": 6,
"multiline_rows_merged": 1,
"numeric_fixes": 3,
"cmap_fixes": 6,
"changed": true
}
}
Stage 2 — Bilingual Financial Query Expansion & Multi-Ticker DSL
- 2025年 expanded to
["2025年", "2025年度", "二零二五年", "二零二五年度", "二〇二五年"] - 归母净利润 mapped to
["歸屬於上市公司股東的淨利潤", "股東應佔溢利", "本公司權益持有人應佔溢利", "net income attributable", "net profit attributable"] - 研发费用 mapped to
["研發費用", "研發開支", "研发支出", "research and development"] - Multi-ticker comparison:
AURRandBOREgrouped intobool.should(minimum_should_match: 1) so chunks discussing either issuer are recalled instead of requiring both in one paragraph.
Stage 3 — Corpus License Audit Gate
{
"version": "1.0.0",
"ok": true,
"audited": 2,
"passed": [
{ "slug": "aurora-open-samples", "mode": "pack", "license": "Apache-2.0" },
{ "slug": "aurora-hkex-disclosure", "mode": "recipe", "license": "HKEX-Public-Disclosure" }
],
"violations": []
}
Next steps
- Pass
--output clean.mdtofix_cjk_tables.pyonly when ready to save cleaned filings without overwriting source files. - Send the generated DSL JSON directly to your Elasticsearch or OpenSearch
_searchendpoint (add--no-require-bigramsif a strict query returns zero hits). - Run
audit_corpus_license.py --dir corpora/in CI to blockNOASSERTION,-NC,-ND,AGPL/GPL, short Git SHAs, path traversal, and non-public URLs.
Connects securely to your tools. The creator never sees your data.
About this skill
Financial and regulatory RAG pipelines frequently break when PDF-to-Markdown extraction splits decimals across lines, fragments accounting parentheses, or triggers HKEX font CMap glitches where "月" (month) extracts as "尸". Even after cleaning, single-language search misses cross-border disclosures written in Mainland Simplified Chinese, Hong Kong Traditional Chinese, and English GAAP/IFRS terminology.
This skill ships three standalone, zero-dependency Python 3.11+ scripts that fix all three bottlenecks deterministically and completely offline.
What it does
- Repairs extracted CJK & HKEX financial Markdown (
scripts/fix_cjk_tables.py): Merges hard-wrapped decimals (1,280.\n45 -> 1,280.45), thousand separators, split accounting negatives ((\n45.20\n) -> (45.20)), detached percent signs, and continuation pipe-table rows without altering figures or column counts. - Fixes HKEX ToUnicode CMap month glitches with forensic guards: Strict context-aware whitelist rules restore corrupted date phrases (
2025年12尸31日 -> 2025年12月31日,十二個尸 -> 十二個月,每尸活躍 -> 每月活躍) while preserving non-date terms (法医尸检报告,尸体) with zero false positives. - Rewrites bilingual financial & legal queries (
scripts/rewrite_bilingual_query.py): Applies phrase-aware Simplified-to-Traditional disambiguation (注册制 -> 註冊制,制造业 -> 製造業,附注 -> 附註), expands cross-standard accounting terms (归母净利润/股東應佔溢利/net income attributable), converts Arabic and Chinese statute clauses & fiscal years (第128条↔第一百二十八條,2025年↔二零二五年), and generates ready-to-run Elasticsearch / OpenSearch Bool DSL (including multi-tickerbool.shouldcomparisons). - Audits RAG corpus manifests before ingestion (
scripts/audit_corpus_license.py): Enforces commercial-safe license allowlists (packvsrecipe), blocksNOASSERTION,-NC,-ND,GPL/AGPL/SSPL, synthetic override flags, short Git hashes (requires full 40-char lowercase SHA), path traversal, unsafe or private/loopback URLs, anddo-not-contact.jsonopt-out lists.
Runtime & security design
- Pure Python 3.11+ standard library: Zero third-party packages, zero network imports, zero environment-variable reads, zero subprocess calls.
- Standalone execution: Every script embeds its own lookup tables and outputs structured UTF-8 JSON to
stdout. - Read-only by default: Source files are never modified unless
--outputis explicitly provided.
Included references
references/accounting-aliases.md— Mainland CAS, Hong Kong HKFRS/HKEX, and English GAAP/IFRS term alignment plus legal clause rules.references/license-policy.md— Commercial-safe allowlist matrix, manifest schema, and security invariants.references/examples.md— End-to-end synthetic before/after examples.
Known limitations
- Does not run image OCR on scanned PDFs; extract text/Markdown first, then run Stage 1.
- Offline deterministic tooling only; does not fetch live market data or provide legal/investment advice.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
- Software
Python
Permissions
All three Python scripts run strictly offline using Python 3.11+ stdlib only (zero network access, zero environment-variable reads, zero third-party packages). Scripts read stdin or input files and write to disk only when --output is explicitly specified.
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.