PI

pinyin-conversion-rules

Ensures accurate and consistent Pinyin tone conversion and rule processing.

Install

mkdir -p .claude/skills/pinyin-conversion-rules && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12821" && unzip -o skill.zip -d .claude/skills/pinyin-conversion-rules && rm skill.zip

Installs to .claude/skills/pinyin-conversion-rules

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Maintain the pure Hanyu Pinyin conversion logic for this project. Use when changing token parsing, tone placement rules, umlaut/v handling, case preservation, neutral tone behavior, or tests around src/pinyin_tones/pinyin_converter.py and tests/test_converter.py.
263 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Inspect `pinyin_converter.py` and `test_converter.py`
  • Preserve existing public helpers
  • Add or update `unittest` cases for behavior changes
  • Run tests for pinyin conversion
  • Maintain pure and deterministic conversion logic
  • Enforce tone placement rules

How it works

The skill guides inspection of relevant files, enforces pure conversion logic, preserves public helpers, requires new unit tests for changes, and specifies test execution.

Inputs & outputs

You give it
Changes to pinyin conversion logic or tests
You get back
Updated `pinyin_converter.py` and `test_converter.py` with preserved rules and new test cases

When to use pinyin-conversion-rules

  • Fix tone placement rules
  • Update conversion logic
  • Add new Pinyin tests

About this skill

Pinyin Conversion Rules

Workflow

  1. Inspect src/pinyin_tones/pinyin_converter.py and tests/test_converter.py before editing.
  2. Keep conversion pure and deterministic: no clipboard, keyboard, UI, logging, config, or platform logic belongs in this area.
  3. Preserve the existing public helpers unless the request explicitly allows a breaking change: convert_pinyin_token, apply_tone, get_tone_target_index, and has_vowel.
  4. Add or update focused unittest cases for every behavior change.
  5. Run at least python tools/run_tests.py when possible; for a narrow change, also mention that the relevant coverage is tests/test_converter.py.

Rules To Preserve

  • Only full tokens shaped like pinyin letters plus a trailing tone digit 1-5 are converted.
  • Tone 5 is neutral and currently returns the original token because no diacritic is applied.
  • Tone placement priority is a, then o, then e, then special iu/ui, then the last valid i/u/v/ü vowel.
  • v and ü represent the umlaut vowel; uppercase input should preserve uppercase output where applicable.
  • Non-matching or unconvertible input returns the original token.

Reference

Read references/conversion-map.md when you need a compact map of owned files, tests, and common edge cases.

When not to use it

  • When the request involves clipboard, keyboard, UI, logging, config, or platform logic
  • When a breaking change to public helpers is not explicitly allowed
  • When changes do not involve `pinyin_converter.py` or `test_converter.py`

Limitations

  • Conversion logic must remain pure and deterministic
  • Public helpers must be preserved unless breaking changes are explicitly allowed
  • Only full tokens shaped like pinyin letters plus a trailing tone digit `1`-`5` are converted

How it compares

This skill provides a strict workflow for maintaining Hanyu Pinyin conversion logic, ensuring determinism and test coverage, unlike ad-hoc modifications that might introduce inconsistencies.

Compared to similar skills

pinyin-conversion-rules side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
pinyin-conversion-rules (this skill)02moNo flagsIntermediate
jupyter-notebook306moReviewIntermediate
unsloth158moNo flagsIntermediate
clojure-write163moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

jupyter-notebook

davila7

Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer the bundled templates and run the helper script `new_notebook.py` to generate a clean starting notebook.

30158

unsloth

zechenzhangAGI

Expert guidance for fast fine-tuning with Unsloth - 2-5x faster training, 50-80% less memory, LoRA/QLoRA optimization

15117

clojure-write

metabase

Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.

1690

add-uint-support

pytorch

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

1883

python-pro

sickn33

Master Python 3.12+ with modern features, async programming, performance optimization, and production-ready practices. Expert in the latest Python ecosystem including uv, ruff, pydantic, and FastAPI. Use PROACTIVELY for Python development, optimization, or advanced Python patterns.

2358

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

Search skills

Search the agent skills registry