An open API service indexing awesome lists of open source software.

https://github.com/helloruru/claude-zhenhuan

甄嬛傳模式 Claude Code Skill | Empresses in the Palace roleplay for Claude Code
https://github.com/helloruru/claude-zhenhuan

Last synced: 14 days ago
JSON representation

甄嬛傳模式 Claude Code Skill | Empresses in the Palace roleplay for Claude Code

Awesome Lists containing this project

README

          

[繁體中文](./README.md) | **English**

# claude-zhenhuan

You're in the middle of coding, and Claude suddenly says: "Your Ladyship, please don't worry. Allow this humble servant to investigate carefully."

It's not a bug. It's ***Zhen Huan Mode*** (甄嬛傳模式).

![Claude Code](https://img.shields.io/badge/Claude_Code-Skill-D4A5A5?style=flat-square&logo=anthropic&logoColor=white)
![Characters](https://img.shields.io/badge/Characters-5-B8A9C9?style=flat-square)
![Quotes](https://img.shields.io/badge/Quotes-161-A8B5A0?style=flat-square)
![Drama](https://img.shields.io/badge/Empresses_in_the_Palace-2011-E8B4B8?style=flat-square)

---

## :link: What is this?

A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) Skill that transforms Claude into a character from *"Empresses in the Palace"* (後宮甄嬛傳), one of the most iconic Chinese historical TV dramas.

Type `/qing`, and Claude becomes your personal palace attendant — maybe the bold and loyal Liuzhu (流朱), the brilliant strategist Jinxi (槿汐), the well-connected eunuch Su Peisheng (蘇培盛), the gentle physician Wen Shichu (溫實初), or the sharp-minded Huanbi (浣碧). Each activation rolls a random character with unique personality, mood, and palace gossip.

Your code stays precise. You just get a more entertaining companion.

When debugging, the character says "Your Ladyship, please stay calm." When deployment succeeds: "It has been announced to the Six Palaces." When you hit a Git conflict: "Two forces meet on a narrow road — allow me to mediate."

**v2.1 New**: stderr Palace Easter Egg — when a command fails, a drama quote fires automatically, scaled by severity. Summon the Imperial Physician!

## :brain: What does it look like?

```text
/qing
```

Claude responds with something like:

> Greetings, Your Ladyship! This humble servant Liuzhu pays her respects.
> The palace is peaceful today, the mood is light.
> I heard the Imperial Kitchen just got your favorite osmanthus wine — perfect for after we finish today's work.
>
> "Shoot the horse before the rider, capture the king before the soldiers." — Whatever you need, just say the word!

Then you code as usual. The character stays in role throughout, but technical quality never drops.

## :wrench: Installation

Requires [jq](https://jqlang.github.io/jq/) (JSON processing tool):

Install jq (per platform)

```bash
# macOS
brew install jq

# Linux
sudo apt install jq

# Windows
winget install jqlang.jq
```

Then:

```bash
git clone https://github.com/HelloRuru/claude-zhenhuan.git
cd claude-zhenhuan
bash install.sh
```

This creates four slash commands:

| Command | Function |
| :--------------- | :---------------------- |
| `/我是小主` | Enter character mode |
| `/我不是小主` | Exit character mode |
| `/qing` | Enter (English alias) |
| `/qing-off` | Exit (English alias) |

## :detective: What's inside

- **5 playable characters**: Liuzhu (流朱, bold), Huanbi (浣碧, perceptive), Jinxi (槿汐, strategist), Su Peisheng (蘇培盛, intel), Wen Shichu (溫實初, gentle)
- **161 quotes**: Spanning 29 characters from the drama
- **stderr Palace Easter Egg**: Bash errors auto-trigger drama quotes, tiered by severity (breeze vs. emperor's demise)
- **8-character core relationship map**: Zhen Huan (甄嬛), Consort Hua (華妃), An Lingrong (安陵容), Prince Guo (果郡王), Liuzhu (流朱), Su Peisheng (蘇培盛), Jinxi (槿汐), Wen Shichu (溫實初)
- **Contextual callbacks**: The character remembers what you did earlier in the conversation and weaves it back naturally

File structure

```
claude-zhenhuan/
├── README.md ← Chinese version
├── README.en.md ← This file (English)
├── SKILL.md ← Skill config & behavior rules
├── quotes.json ← Quote database (single source of truth)
├── quotes.md ← Human-readable quote list (auto-generated)
├── roll.sh ← Dice roll script for random character
├── gen-quotes-md.sh ← Generate quotes.md from quotes.json
├── install.sh ← Global install / uninstall script
├── characters-full.md ← 21 non-core character relationships
├── LICENSE-QUOTES.md ← Copyright & fair use notice
└── hooks/
└── zhenhuan-stderr.js ← stderr Palace Easter Egg hook
```

## :bulb: Adding quotes

All quotes live in `quotes.json` — the single source of truth.

```bash
# After editing quotes.json, regenerate the markdown version
bash gen-quotes-md.sh > quotes.md
```

## :wrench: Update / Uninstall

```bash
# Update (symlink points to latest automatically)
cd claude-zhenhuan && git pull

# Uninstall
bash install.sh remove
```

## :pray: Inspiration & Credits

This Skill didn't start from scratch.

### Original Skill concept

Inspired by [htlin222](https://github.com/htlin222)'s open-source project [htlin222/dotfiles](https://github.com/htlin222/dotfiles) (path: [claude.symlink/skills/qing](https://github.com/htlin222/dotfiles/tree/main/claude.symlink/skills/qing)).

The original was a generic Qing Dynasty palace roleplay (eunuch, minister, maid, empress), which introduced the core idea of activating a palace character via slash command + roll.sh dice roll. Inspired by this concept, I independently rewrote all code and content — adapting characters and quotes to *"Empresses in the Palace"* (後宮甄嬛傳), and adding interaction mechanisms, a core relationship map, distinct character voices, and other v2.0 features. Without htlin222's creativity and open-source sharing, this project would not exist.

### Quote sources

Quotes in `quotes.json` were compiled from these public resources:

- [Ariel Hsu](https://arielhsu.tw/empresses-in-the-palace-quotes/)
- [ETtoday](https://star.ettoday.net/news/2415056)
- [BEAUTY321](https://www.beauty321.com/post/27834)
- [BEAUTY321](https://www.beauty321.com/post/46430)
- [KKNews](https://kknews.cc/zh-tw/culture/389lpr3.html)
- [Tatler Asia](https://www.tatlerasia.com/lifestyle/entertainment/empresses-in-the-palace-zh-hant)

### Original novel & TV drama

- **Novel**: *"Legend of Zhen Huan"* (後宮·甄嬛傳) by Liu Lianzi (流瀲紫, pen name of Wu Xuelan), originally serialized on JJWXC
- **TV Drama**: *"Empresses in the Palace"* (後宮甄嬛傳, 2011), directed by Zheng Xiaolong, written by Liu Lianzi & Wang Xiaoping, produced by Beijing Television Art Center

### Tools

- [jq](https://jqlang.github.io/jq/) — Used by the character roll script to process JSON data

## :classical_building: Copyright & Legal

Expand full legal notice

### Intellectual property

All dialogue, character names, and story elements from the TV drama *"Empresses in the Palace"* (後宮甄嬛傳) and the novel *"Legend of Zhen Huan"* (後宮·甄嬛傳) are the intellectual property of their respective rights holders, including but not limited to:

- Author Liu Lianzi (流瀲紫 / Wu Xuelan)
- Director Zheng Xiaolong
- Beijing Television Art Center
- Erhai Film & Television Culture Communication Co.

### Fair use

Quotes included in this project are used solely for **personal learning, research, and non-commercial purposes** under fair use principles (and Article 52/65 of the R.O.C. Copyright Act):

- **Purpose**: Non-profit, educational, and personal entertainment — adding personality to an AI coding assistant
- **Amount**: Only a small selection of representative quotes (161 lines), not a complete script or work
- **Market impact**: Does not substitute the viewing experience of the original work, nor affect its commercial value

### Non-commercial

This project **does not claim** any rights over the quoted dialogue, and **does not generate revenue** in any form.

### Contact for takedown

If rights holders believe any content in this project constitutes infringement, please reach out via [GitHub Issues](https://github.com/HelloRuru/claude-zhenhuan/issues) or Email (hello@helloruru.com). Infringing content will be removed immediately.

### Original Skill

This project was inspired by [htlin222/dotfiles](https://github.com/htlin222/dotfiles). All code and content were independently rewritten, not directly copied from the original.

See [LICENSE-QUOTES.md](./LICENSE-QUOTES.md) for details.

---

by [HelloRuru](https://ohruru.com) | Coding can be fun