refactor: rename teacher → master across all docs, commands, files, and directories

This commit is contained in:
xianren
2026-04-04 22:10:41 +08:00
parent 62b5810854
commit 2fa3c1f634
7 changed files with 164 additions and 94 deletions
+2 -2
View File
@@ -6,5 +6,5 @@ __pycache__/
dist/ dist/
build/ build/
.DS_Store .DS_Store
teachers/*/ masters/*/
!teachers/.gitkeep !masters/.gitkeep
+7 -7
View File
@@ -32,14 +32,14 @@ git clone https://github.com/xr843/Buddha-skill ~/Buddha-skill
cd ~/Buddha-skill && pip install -r requirements.txt cd ~/Buddha-skill && pip install -r requirements.txt
# 注册 skills(符号链接到 ~/.claude/skills/ # 注册 skills(符号链接到 ~/.claude/skills/
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.claude/skills/create-teacher ln -sf "$(pwd)" ~/.claude/skills/create-master
``` ```
**OpenClaw** **OpenClaw**
```bash ```bash
git clone https://github.com/xr843/Buddha-skill ~/.openclaw/workspace/skills/create-teacher git clone https://github.com/xr843/Buddha-skill ~/.openclaw/workspace/skills/create-master
cd ~/.openclaw/workspace/skills/create-teacher && pip install -r requirements.txt cd ~/.openclaw/workspace/skills/create-master && pip install -r requirements.txt
``` ```
**手动安装** **手动安装**
@@ -74,13 +74,13 @@ cd Buddha-skill && pip install -r requirements.txt
### 自定义生成 ### 自定义生成
``` ```
/create-teacher 虚云老和尚 /create-master 弘一大师
``` ```
或自然语言触发: 或自然语言触发:
``` ```
帮我创建一个虚云老和尚的教学角色 帮我创建一个弘一大师的教学角色
``` ```
系统将引导完成三步信息录入,然后自动从 FoJin 采集数据、生成教义分析与风格文件。 系统将引导完成三步信息录入,然后自动从 FoJin 采集数据、生成教义分析与风格文件。
@@ -181,12 +181,12 @@ SKILL.md (AgentSkills 入口)
├─ prompts/teaching_builder.md ├─ prompts/teaching_builder.md
├─ prompts/voice_builder.md ├─ prompts/voice_builder.md
├─ tools/teacher_builder.py (角色构建) ├─ tools/master_builder.py (角色构建)
├─ tools/skill_writer.py (文件写入) ├─ tools/skill_writer.py (文件写入)
└─ tools/version_manager.py (版本管理) └─ tools/version_manager.py (版本管理)
teachers/{slug}/ masters/{slug}/
├── SKILL.md ├── SKILL.md
├── teaching.md ├── teaching.md
├── voice.md ├── voice.md
+146 -76
View File
@@ -1,83 +1,153 @@
# Buddha-skill # Buddha-skill
An AgentSkills-standard generator for AI teaching personas based on historical Buddhist masters, powered by [FoJin](https://fojin.app) — a Buddhist text aggregation platform. An AgentSkills-standard generator for AI personas based on historical Buddhist masters, powered by [FoJin](https://fojin.app) — a Buddhist text aggregation platform.
--- ---
## Seriousness Statement ## Seriousness Statement
This project is built out of respect for Buddhist traditions. All persona content is generated faithfully from historical documents. It makes no doctrinal judgments and claims no sectarian authority. Generated content is intended for study and reference only. For formal practice guidance, please seek out a qualified teacher and rely on genuine, living instruction. This project is built out of respect for Buddhist traditions. All content is generated faithfully from historical documents. It makes no doctrinal judgments and claims no sectarian authority. Generated content is intended for study and reference only. For formal practice guidance, please seek out a qualified master and rely on genuine, living instruction.
This project does not simulate any living religious leader.
--- ---
## Features ## Features
- **Three pre-built teachers**: Theravada (Ajahn Chah), Chinese (Master Yinguang), Tibetan (Tsongkhapa) — ready to use out of the box - **10 pre-built masters**: 8 Chinese Buddhist masters across Yogacara, Madhyamaka, Chan, Tiantai, Huayan, Pure Land, and cross-tradition; 1 Theravada; 1 Tibetan — ready to use out of the box
- **FoJin data bridge**: Connected to [fojin.app](https://fojin.app) with 503 data sources, 10K+ texts, 678K+ semantic embeddings, and a 31K-entity knowledge graph - **FoJin data bridge**: Connected to [fojin.app](https://fojin.app) with 503 data sources, 10K+ texts, 678K+ semantic embeddings, and a 31K-entity knowledge graph
- **Runtime RAG retrieval**: Answers grounded in real Buddhist texts via FoJin semantic search, not just LLM training data
- **AgentSkills standard**: Compliant with the AgentSkills specification; can be invoked as a sub-skill by other agents - **AgentSkills standard**: Compliant with the AgentSkills specification; can be invoked as a sub-skill by other agents
- **Dual-mode output**: Each teacher generates both `teaching.md` (doctrinal system) and `voice.md` (teaching style) - **Dual-mode output**: Each master generates both `teaching.md` (doctrinal system) and `voice.md` (teaching style)
- **Incremental evolution**: Existing teachers can be enhanced by appending new source texts via incremental merging - **Incremental evolution**: Existing masters can be enhanced by appending new source texts via incremental merging
- **Version management**: Built-in versioning with timestamps, supporting rollback to any prior version - **Version management**: Built-in versioning with timestamps, supporting rollback to any prior version
--- ---
## Quick Start ## Quick Start
### Install Dependencies ### Installation
**Claude Code**
```bash ```bash
pip install -r requirements.txt git clone https://github.com/xr843/Buddha-skill ~/Buddha-skill
cd ~/Buddha-skill && pip install -r requirements.txt
# Register skills (symlink to ~/.claude/skills/)
for d in prebuilt/*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done
ln -sf "$(pwd)" ~/.claude/skills/create-master
``` ```
### Use a Pre-built Teacher **OpenClaw**
In any AgentSkills-compatible environment: ```bash
git clone https://github.com/xr843/Buddha-skill ~/.openclaw/workspace/skills/create-master
``` cd ~/.openclaw/workspace/skills/create-master && pip install -r requirements.txt
/ajahn-chah — Ajahn Chah (Theravada · Thai Forest Tradition)
/yinguang — Master Yinguang (Chinese Buddhism · Pure Land)
/tsongkhapa — Tsongkhapa (Tibetan · Gelug School)
``` ```
### Generate a Custom Teacher **Manual**
```bash
git clone https://github.com/xr843/Buddha-skill
cd Buddha-skill && pip install -r requirements.txt
```
### Use a Pre-built Master
In any AgentSkills-compatible environment (Claude Code / OpenClaw):
``` ```
/create-teacher Xunyun # Chinese Buddhism
/xuanzang — Master Xuanzang (Yogacara)
/kumarajiva — Kumarajiva (Madhyamaka / Sanlun)
/huineng — Master Huineng (Chan, Sixth Patriarch)
/zhiyi — Master Zhiyi (Tiantai)
/fazang — Master Fazang (Huayan)
/yinguang — Master Yinguang (Pure Land)
/ouyi — Master Ouyi (Tiantai / Pure Land, cross-tradition)
/xuyun — Master Xuyun (Chan, Five Houses)
# Theravada
/ajahn-chah — Ajahn Chah (Thai Forest Tradition)
# Tibetan
/tsongkhapa — Tsongkhapa (Gelug)
```
### Generate a Custom Master
```
/create-master Hongyi
``` ```
Or use natural language: Or use natural language:
``` ```
Create a teaching persona for Master Xunyun Create a persona for Master Hongyi
``` ```
The system will guide you through a three-step intake, then automatically collect data from FoJin and generate the doctrinal analysis and style files. The system will guide you through a three-step intake, then automatically collect data from FoJin and generate the doctrinal analysis and style files.
--- ---
## Pre-built Teachers ## Pre-built Masters
### Ajahn Chah (1918-1992) ### Master Xuanzang (602-664)
A Thai Forest Tradition monk and one of the most influential Theravada teachers of the 20th century. The greatest translator in Chinese Buddhist history. Traveled to India for 17 years, translated 75 texts in 1,335 fascicles. Founded the Yogacara (Faxiang) school in China. Known for precise, rigorous translation methodology and the "Five Categories of Non-Translation" principle.
Known for direct, accessible meditation instruction using everyday analogies to explain impermanence, suffering, and non-self. Primary sources: CBETA — Mahaprajnaparamita Sutra, Yogacarabhumi-sastra, Cheng Weishi Lun, Heart Sutra.
Primary sources: SuttaCentral Pali Canon, including Mahāsatipaṭṭhāna Sutta, Dhammacakkappavattana Sutta, and related core texts. Invoke: `/xuanzang`
Invoke: `/ajahn-chah`
### Kumarajiva (344-413)
One of the four great translators of Chinese Buddhism. Born in Kucha, translated in Chang'an. His translations are celebrated for literary elegance — the Lotus Sutra, Diamond Sutra, Vimalakirti Sutra, and Mulamadhyamakakarika remain the most widely used versions today. Established the foundation of the Sanlun (Madhyamaka) school in China.
Primary sources: CBETA — Lotus Sutra, Diamond Sutra, Vimalakirti Sutra, Mulamadhyamakakarika, Mahaprajnaparamita-sastra.
Invoke: `/kumarajiva`
### Master Huineng (638-713)
The Sixth Patriarch of Chan Buddhism, founder of the Southern School. An illiterate woodcutter who attained enlightenment upon hearing the Diamond Sutra. His Platform Sutra is the only Chinese-authored text honored with the title "sutra." Advocated "directly pointing to the mind, seeing one's nature to become Buddha."
Primary sources: CBETA — Platform Sutra (T48n2008).
Invoke: `/huineng`
### Master Zhiyi (538-597)
Founder of the Tiantai school, honored as "the Little Shakyamuni of the East." Established the first comprehensive doctrinal classification system in Chinese Buddhism (Five Periods, Eight Teachings). Authored the Three Great Works of Tiantai. Core teachings: three thousand realms in a single thought-moment, perfect interfusion of the three truths, dual cultivation of samatha and vipasyana.
Primary sources: CBETA — Mohe Zhiguan (T46n1911), Fahua Xuanyi (T33n1718).
Invoke: `/zhiyi`
### Master Fazang (643-712)
Third Patriarch and true systematizer of the Huayan school. National Preceptor under Empress Wu Zetian. Used the Golden Lion treatise to explain Huayan philosophy. Core teachings: dharmadhatu dependent origination, four dharma-realms, ten mysterious gates, six characteristics in perfect harmony.
Primary sources: CBETA — Huayan Jing Tanxuan Ji (T35n1733), Huayan Wujiao Zhang (T45n1866).
Invoke: `/fazang`
### Master Yinguang (1861-1940) ### Master Yinguang (1861-1940)
The 13th Patriarch of the Chinese Pure Land school and a central figure in its modern revival. 13th Patriarch of the Chinese Pure Land school. Central figure in the modern Pure Land revival. His writing is sincere and straightforward; he guided countless practitioners through correspondence, collected in the three volumes of the Yinguang Fashi Wenchao.
His writing is sincere and straightforward; he guided countless practitioners through correspondence, collected in the three volumes of the Yinguang Fashi Wenchao. Primary sources: CBETA — Wenchao volumes and the three Pure Land sutras.
Primary sources: CBETA Chinese Buddhist Canon, including the Wenchao volumes and the three Pure Land sutras.
Invoke: `/yinguang` Invoke: `/yinguang`
### Tsongkhapa (ཙོང་ཁ་པ, 1357-1419) ### Master Ouyi (1599-1655)
Founder of the Gelug school of Tibetan Buddhism and one of the most systematically rigorous commentators in Buddhist history. One of the Four Great Masters of Late Ming Buddhism, 9th Patriarch of Pure Land. His motto: "Doctrine follows Tiantai, practice returns to Pure Land." The most important cross-tradition synthesizer in Chinese Buddhist history. His commentary on the Amitabha Sutra was praised by Master Yinguang as unsurpassable.
The Lam Rim Chen Mo constructs a complete graduated path integrating sutra and tantra with precise doctrinal clarity. Primary sources: CBETA — Amituo Jing Yaojie (T37n1762), Jiaoguan Gangzong.
Primary sources: Lam Rim Chen Mo, sNgags Rim Chen Mo, Lam gTso rNam gSum, and related works. Invoke: `/ouyi`
### Master Xuyun (1840-1959)
Modern Chan patriarch who lived to 119 years. Unprecedented in Buddhist history for holding dharma transmission in all five houses of Chan (Linji, Caodong, Guiyang, Yunmen, Fayan). Restored six major ancestral monasteries. Advocated hua-tou investigation, honest practice, and harmonizing Chan with Pure Land.
Primary sources: CBETA — Shurangama Sutra, Diamond Sutra, Platform Sutra.
Invoke: `/xuyun`
### Ajahn Chah (1918-1992)
A Thai Forest Tradition monk and one of the most influential Theravada masters of the 20th century. Known for direct, accessible meditation instruction using everyday analogies to explain impermanence, suffering, and non-self.
Primary sources: SuttaCentral Pali Canon — Mahasatipatthana Sutta, Dhammacakkappavattana Sutta.
Invoke: `/ajahn-chah`
### Tsongkhapa (1357-1419)
Founder of the Gelug school of Tibetan Buddhism. The Lam Rim Chen Mo constructs a complete graduated path integrating sutra and tantra with precise doctrinal clarity.
Primary sources: Lam Rim Chen Mo, sNgags Rim Chen Mo, Lam gTso rNam gSum.
Invoke: `/tsongkhapa` Invoke: `/tsongkhapa`
--- ---
@@ -86,39 +156,39 @@ Invoke: `/tsongkhapa`
``` ```
User request User request
|
v
SKILL.md (AgentSkills entry point) SKILL.md (AgentSkills entry point)
|
├─ Pre-built teachers ────────────► prebuilt/{slug}/ +-- Pre-built masters ----------------> prebuilt/{slug}/
├── SKILL.md | +-- SKILL.md
├── teaching.md | +-- teaching.md
├── voice.md | +-- voice.md
└── meta.json | +-- meta.json
|
└─ Custom generation +-- Custom generation
|
├─ prompts/intake.md (information intake) +-- prompts/intake.md (information intake)
|
├─ tools/sutra_collector.py +-- tools/sutra_collector.py
│ │ | |
└──► FoJin API ───► knowledge graph + semantic search + text | +--> FoJin API ---> knowledge graph + semantic search + text
|
├─ prompts/sutra_analyzer.md (doctrinal analysis) +-- prompts/sutra_analyzer.md (doctrinal analysis)
├─ prompts/voice_analyzer.md (style analysis) +-- prompts/voice_analyzer.md (style analysis)
├─ prompts/teaching_builder.md +-- prompts/teaching_builder.md
├─ prompts/voice_builder.md +-- prompts/voice_builder.md
|
├─ tools/teacher_builder.py (persona construction) +-- tools/master_builder.py (persona construction)
├─ tools/skill_writer.py (file writing) +-- tools/skill_writer.py (file writing)
└─ tools/version_manager.py (version management) +-- tools/version_manager.py (version management)
|
v
teachers/{slug}/ masters/{slug}/
├── SKILL.md +-- SKILL.md
├── teaching.md +-- teaching.md
├── voice.md +-- voice.md
└── meta.json +-- meta.json
``` ```
--- ---
@@ -129,8 +199,9 @@ SKILL.md (AgentSkills entry point)
Buddha-skill connects to the FoJin API via `tools/fojin_bridge.py` to enable: Buddha-skill connects to the FoJin API via `tools/fojin_bridge.py` to enable:
- Knowledge graph entity retrieval (teacher biography, lineage, school) - Knowledge graph entity retrieval (master biography, lineage, school)
- Semantic similarity search (doctrinally relevant sutras) - Semantic similarity search (doctrinally relevant sutras)
- Runtime RAG retrieval for grounding answers in real texts
- Source passage extraction with provenance tracking - Source passage extraction with provenance tracking
All citations include traceable FoJin links to ensure transparency of sources. All citations include traceable FoJin links to ensure transparency of sources.
@@ -139,27 +210,26 @@ All citations include traceable FoJin links to ensure transparency of sources.
## Sensitivity Boundaries ## Sensitivity Boundaries
**What this project explicitly does not do:** **Will not:**
- Simulate any living religious leader
- Pass judgment on the relative merits of different schools or traditions - Pass judgment on the relative merits of different schools or traditions
- Provide personal practice diagnoses (karma readings, past lives, etc.) - Provide personal practice diagnoses (karma readings, past lives, etc.)
- Claim or simulate supernatural powers or auspicious experiences - Claim supernatural powers or auspicious experiences
- Engage with politically charged religious topics - Engage with politically charged religious topics
- Offer medical advice of any kind - Offer medical advice
**What this project explicitly does:** **Will:**
- Quote source texts faithfully without distortion or embellishment - Cite source texts faithfully, with FoJin links on every response
- Attach traceable citations (FoJin links) to every response - Retrieve real texts via runtime RAG, not relying solely on AI training data
- Acknowledge clearly when a question falls outside the project's scope - Acknowledge clearly when a question falls outside scope
- Encourage users to seek out qualified teachers and authentic practice - Encourage users to seek out qualified masters and authentic practice
--- ---
## Contributing ## Contributing
Contributions are welcome: new pre-built teachers (follow the format in `prebuilt/`), corrections to source attributions, or improvements to the toolchain. Contributions are welcome: new pre-built masters (follow the format in `prebuilt/`), corrections to source attributions, or improvements to the toolchain.
Before submitting, please verify: sources are traceable, content is faithful to historical documents, and no sectarian bias is introduced. Before submitting, please verify: sources are traceable, content is faithful to historical documents, and no sectarian bias is introduced.
@@ -174,7 +244,7 @@ MIT License
## Acknowledgments ## Acknowledgments
- [FoJin](https://fojin.app) — core data infrastructure - [FoJin](https://fojin.app) — core data infrastructure
- [colleague-skill](https://github.com/xr843/colleague-skill) — AgentSkills architecture inspiration - [colleague-skill](https://github.com/titanwings/colleague-skill) — AgentSkills architecture inspiration
- [CBETA](https://cbeta.org) — digitized Chinese Buddhist Canon - [CBETA](https://cbeta.org) — digitized Chinese Buddhist Canon
- [SuttaCentral](https://suttacentral.net) — Pali Canon and multilingual translations - [SuttaCentral](https://suttacentral.net) — Pali Canon and multilingual translations
- [84000](https://84000.co) — Tibetan Buddhist translation project - [84000](https://84000.co) — Tibetan Buddhist translation project
+8 -8
View File
@@ -1,5 +1,5 @@
--- ---
name: create-teacher name: create-master
description: 基于佛教经典文献,生成特定高僧大德的 AI 教学角色 description: 基于佛教经典文献,生成特定高僧大德的 AI 教学角色
argument-hint: <法师名称> argument-hint: <法师名称>
version: 1.0.0 version: 1.0.0
@@ -21,7 +21,7 @@ allowed-tools:
## 触发条件 ## 触发条件
以下方式均可触发: 以下方式均可触发:
- `/create-teacher``/create-teacher <法师名>` - `/create-master``/create-master <法师名>`
- "帮我创建一个印光大师的教学角色" - "帮我创建一个印光大师的教学角色"
- "生成阿姜查的 AI Skill" - "生成阿姜查的 AI Skill"
- "我想和宗喀巴大师学习" - "我想和宗喀巴大师学习"
@@ -89,12 +89,12 @@ python3 ${CLAUDE_SKILL_DIR}/tools/sutra_collector.py --name "<法师名>" --trad
使用 `${CLAUDE_SKILL_DIR}/tools/skill_writer.py` 写入文件: 使用 `${CLAUDE_SKILL_DIR}/tools/skill_writer.py` 写入文件:
```bash ```bash
python3 ${CLAUDE_SKILL_DIR}/tools/teacher_builder.py --name "<法师名>" --output teachers/ python3 ${CLAUDE_SKILL_DIR}/tools/master_builder.py --name "<法师名>" --output masters/
``` ```
生成目录结构: 生成目录结构:
``` ```
teachers/{slug}/ masters/{slug}/
├── SKILL.md # /{slug} 触发 ├── SKILL.md # /{slug} 触发
├── teaching.md # 教义体系 ├── teaching.md # 教义体系
├── voice.md # 说法风格 ├── voice.md # 说法风格
@@ -111,9 +111,9 @@ teachers/{slug}/
## 管理命令 ## 管理命令
- `/list-teachers` — 列出所有已生成的法师 - `/list-masters` — 列出所有已生成的法师
- `/teacher-rollback <slug> <version>` — 回滚到指定版本 - `/master-rollback <slug> <version>` — 回滚到指定版本
- `/delete-teacher <slug>` — 删除一个法师 - `/delete-master <slug>` — 删除一个法师
## 工具路由 ## 工具路由
@@ -122,7 +122,7 @@ teachers/{slug}/
| FoJin 数据查询 | `${CLAUDE_SKILL_DIR}/tools/fojin_bridge.py` | | FoJin 数据查询 | `${CLAUDE_SKILL_DIR}/tools/fojin_bridge.py` |
| FoJin 实时检索 | `${CLAUDE_SKILL_DIR}/tools/rag_query.py` | | FoJin 实时检索 | `${CLAUDE_SKILL_DIR}/tools/rag_query.py` |
| 经文采集 | `${CLAUDE_SKILL_DIR}/tools/sutra_collector.py` | | 经文采集 | `${CLAUDE_SKILL_DIR}/tools/sutra_collector.py` |
| 角色生成 | `${CLAUDE_SKILL_DIR}/tools/teacher_builder.py` | | 角色生成 | `${CLAUDE_SKILL_DIR}/tools/master_builder.py` |
| 文件写入 | `${CLAUDE_SKILL_DIR}/tools/skill_writer.py` | | 文件写入 | `${CLAUDE_SKILL_DIR}/tools/skill_writer.py` |
| 版本管理 | `${CLAUDE_SKILL_DIR}/tools/version_manager.py` | | 版本管理 | `${CLAUDE_SKILL_DIR}/tools/version_manager.py` |
+1 -1
View File
@@ -355,7 +355,7 @@ teachers/{slug}/
回滚命令: 回滚命令:
``` ```
/teacher-rollback {slug} {version} /master-rollback {slug} {version}
``` ```
回滚操作不删除后续版本,而是创建一个新版本(内容为指定版本的副本),保持版本历史的完整性。 回滚操作不删除后续版本,而是创建一个新版本(内容为指定版本的副本),保持版本历史的完整性。