by weidu12123
梨园 Liyuan — 以 rp agent为主体的ai角色扮演应用
# Add to your Claude Code skills
git clone https://github.com/weidu12123/LiyuanLast scanned: 7/29/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@hono/node-server: Node.js Adapter for Hono: Path traversal in `serve-static` on Windows via encoded backslash (`%5C`)",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "@modelcontextprotocol/sdk: Vulnerability found",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "brace-expansion: brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash",
"severity": "high"
},
{
"type": "npm-audit",
"message": "fast-uri: fast-uri vulnerable to host confusion via literal backslash authority delimiter",
"severity": "high"
},
{
"type": "npm-audit",
"message": "playwright: Playwright downloads and installs browsers without verifying the authenticity of the SSL certificate",
"severity": "high"
},
{
"type": "npm-audit",
"message": "postcss: PostCSS: Path Traversal in Previous Source Map Auto-Loading (sourceMappingURL) leads to Arbitrary .map File Disclosure",
"severity": "high"
},
{
"file": "README.md",
"line": 100,
"type": "remote-install",
"message": "Install command (remote install script piped to a shell — review the source before running): \"curl -fsSL https://raw.githubusercontent.com/weidu12123/Liyuan/v1.0.0/deploy/ins\"",
"severity": "low"
}
],
"status": "WARNING",
"scannedAt": "2026-07-29T06:31:05.079Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how Liyuan compares with popular alternatives.
Liyuan is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by weidu12123. 梨园 Liyuan — 以 rp agent为主体的ai角色扮演应用. It has 287 GitHub stars.
Liyuan returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/weidu12123/Liyuan" and add it to your Claude Code skills directory (see the Installation section above).
Liyuan is primarily written in TypeScript. It is open-source under weidu12123 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh Liyuan against similar tools.
No comments yet. Be the first to share your thoughts!
Requires a passing catalog security scan.
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
English · 简体中文
An RP Agent built on pi, bringing coding agent superpowers to role-playing.
📖 Documentation · 🚀 Releases · 🌐 Website

Liyuan (梨园) is a next-generation Role-Play Agent built on top of pi. By reimagining coding agent primitives for creative storytelling and roleplay, Liyuan tackles the chronic limitations of traditional RP frontends—such as context bloat, setting drift, ungrounded hallucination, prompt clutter, and vendor lock-in—delivering an immersive, transparent, and deterministic role-playing experience.
Liyuan's core architecture translates proven software engineering agent paradigms directly into roleplay mechanics:
| Coding Agent Primitive | Liyuan RP Equivalent | Description |
|---|---|---|
| Workspace / cwd | Isolated Card Space | One directory per character card, isolating assets, sessions, memory, and state |
| Code | Story Prose | The narrative text treated as living creative output |
| Edit / Patch | In-Place Targeted Revisions | Surgical prose edits and adjustments without regenerating entire paragraphs |
| Grep / Search | Text & Lore Retrieval | On-demand search across lorebooks and past chapters without bloating context |
| Rewind / Checkpoint | Branch Rollback & Revision | Non-destructive story branching and checkpoint restore for alternate storylines |
| Context Compaction | Narrative Compaction (Story Recap) | Summarizing past chapters into faithful story recaps while keeping recent prose pristine |
| Cross-Session Memory | Card-Level Memory & Forgetting | Per-card consolidation across sessions with synchronized physical forgetting |
| Permission Gate | Narrative Fork Decision Cards | Interactive decision prompts (ask tool) at crucial plot junctures for user choice |
| SYSTEM.md / AGENTS.md | Engine Protocols & World Laws | Fully transparent, file-based prompt layers with modular toggles |

SYSTEM.md (engine protocol) and AGENTS.md (world rules and character lore) for transparent, file-level editing with entry-by-entry toggles.
ask tool to present branching choices and free-form inputs, co-authoring the story with you.For complete visual guides and interface walkthroughs, see the Liyuan Documentation (docs.liyuan.pro).
# Copy example configuration files
cp liyuan.agent.example.json liyuan.agent.json
cp liyuan.config.example.json liyuan.config.json
# Edit liyuan.agent.json to set your apiKey, baseURL, and model ID
# Install dependencies and start
npm install
npm run web:build # Build frontend (can be skipped if web/dist already exists)
npm run web # Launch server
start.batchmod +x start.sh && ./start.shhttp://127.0.0.1:7620 in your browser.Security Note: Port 7620 does not enforce authentication by default. Do not expose it directly to the public internet without a reverse proxy and authentication layer.
git clone --depth 1 https://github.com/weidu12123/Liyuan.git && cd Liyuan
docker compose up -d --build
Data and configurations persist in local mapped volumes.
You can also use prebuilt multi-arch images directly from GHCR without building from source:
mkdir -p liyuan && cd liyuan
curl -fsSL -o docker-compose.yml https://raw.githubusercontent.com/weidu12123/Liyuan/master/deploy/compose.ghcr.yml
docker compose up -d
Domain Layer src/ Character cards, lorebooks, staging, memory, timelines
Wiring Layer .liyuan/extensions/roleplay.ts pi extension hooks and tool registrations
Web Layer server/ + web/ Backend orchestration, WebSocket/REST protocols, and Web UI
Core Layer packages/@liyuan/* Locally maintained pi agent core framework
Running unit tests:
node --test test/*.test.ts