master-skill 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.cursor-plugin/plugin.json +1 -1
  4. package/GEMINI.md +1 -1
  5. package/README.md +52 -297
  6. package/README_EN.md +52 -278
  7. package/bin/cli.mjs +237 -2
  8. package/gemini-extension.json +1 -1
  9. package/hooks/session-start +4 -1
  10. package/package.json +3 -2
  11. package/prebuilt/master-curriculum/SKILL.md +1 -1
  12. package/prebuilt/master-debate/SKILL.md +1 -1
  13. package/prebuilt/master-help/SKILL.md +86 -0
  14. package/prebuilt/master-help/tests/fidelity.jsonl +10 -0
  15. package/prebuilt/master-kumarajiva/meta.json +14 -3
  16. package/prebuilt/master-nagarjuna/meta.json +19 -4
  17. package/prebuilt/master-tsongkhapa/meta.json +26 -5
  18. package/references/teaching-modes.md +8 -1
  19. package/routing.json +209 -0
  20. package/scripts/check-gate-liveness.py +222 -0
  21. package/scripts/test-fidelity.py +320 -49
  22. package/scripts/tests/test_check_gate_liveness.py +232 -0
  23. package/scripts/tests/test_check_response.py +190 -0
  24. package/scripts/tests/test_fidelity_providers.py +202 -0
  25. package/scripts/tests/test_select_fidelity_smoke.py +2 -2
  26. package/scripts/tests/test_validate.py +145 -0
  27. package/scripts/tests/test_validate_citation_contract.py +1 -1
  28. package/scripts/tests/test_validate_fidelity.py +2 -2
  29. package/scripts/tests/test_validate_workflow.py +21 -2
  30. package/scripts/validate-fidelity.py +6 -1
  31. package/scripts/validate-routing.py +254 -0
  32. package/scripts/validate.py +63 -36
  33. package/skill-catalog.json +83 -20
  34. /package/prebuilt/{compare → compare-masters}/SKILL.md +0 -0
  35. /package/prebuilt/{compare → compare-masters}/tests/fidelity.jsonl +0 -0
package/README_EN.md CHANGED
@@ -146,7 +146,7 @@ This project is built out of respect for Buddhist traditions. All content is gen
146
146
  - **Progressive disclosure**: SKILL.md is a decision tree + quick reference; `references/` and `sources/` are loaded on demand to keep context lean
147
147
  - **HARD-GATE discipline**: Both `/create-master` and every prebuilt master require doctrinal claims, practice guidance, and text interpretation to cite that persona's declared sources (CBETA / BDRC / Toh / SuttaCentral / PTS / compliant compiled teachings); fabricated source IDs and fictional personas are forbidden
148
148
  - **Two-stage independent review**: The generation pipeline forces a "doctrinal accuracy → voice consistency" review before write; FAIL triggers up to 2 rounds of automatic repair
149
- - **Automated fidelity tests**: Each master's `tests/fidelity.jsonl` holds 10+ Q&A samples (the `compare-masters` meta-skill holds 18) validating citations and keyword coverage; CI runs a dry-run on every push
149
+ - **Automated fidelity tests**: Each master's `tests/fidelity.jsonl` holds 10+ Q&A samples (the `compare-masters` meta-skill holds 18) validating citations and keyword coverage; CI runs a dry-run on every push, and a graded run needs `ANTHROPIC_API_KEY` as a manual local/pre-release step — the first committed [baseline](#fidelity-baseline-first-real-run) landed 2026-08-18: 59/84 measured cases passed (70%), covering 40% of all 211 fixtures (see [eval/reports/](eval/reports/))
150
150
  - **Unified multi-platform plugin**: Claude Code, Cursor, Codex CLI, OpenCode, and Gemini CLI share one `prebuilt/` tree, with a session-start hook injecting the master list on every platform
151
151
  - **NPX one-shot install**: `npx master-skill install master-zhiyi` drops skills straight into Claude Code
152
152
  - **Offline toolchain**: `scripts/cite.py` (CBETA lookup), `scripts/query.py` (offline semantic search), `scripts/validate.py` (frontmatter linter)
@@ -161,138 +161,51 @@ Master-skill is not a prompt pack. It is a verifiable Buddhist AI persona framew
161
161
  |---|---|
162
162
  | Source-grounded | `sources[]`, offline excerpts, FoJin live fallback, and citation self-audits per master |
163
163
  | Boundary-aware | `ETHICS.md`, per-master Layer 0 HARD-GATE rules, copyright tiers, and boundary violation reporting |
164
- | Fidelity-tested | `tests/fidelity.jsonl`, persona-fidelity schema, and promptfoo RAW / SPE / CUS evals |
164
+ | Fidelity-tested | `tests/fidelity.jsonl`, persona-fidelity schema, promptfoo RAW / SPE / CUS evals, [real measured baseline below](#fidelity-baseline-first-real-run) |
165
165
  | Runtime-ready | `prebuilt/master-*` AgentSkills, npm CLI, multi-platform hooks, and a FoJin runtime contract |
166
166
 
167
167
  The v1.0 track prioritizes framework stability over adding more masters. See [docs/v1-framework-roadmap.md](docs/v1-framework-roadmap.md) and [docs/fojin-runtime-contract.md](docs/fojin-runtime-contract.md).
168
168
 
169
- ---
170
-
171
- ## Developer Installation
169
+ ### Fidelity baseline (first real run)
172
170
 
173
- > 👤 **Just want to try it?** Use [fojin.app/chat](https://fojin.app/chat) in your browser and skip this section entirely.
174
- > 🛠️ **This section is for**: Claude Code / Cursor / Codex CLI / OpenCode / Gemini CLI users who want to invoke `/master-xuanzang`, `/master-huineng`, etc. directly as terminal AgentSkills.
171
+ The 211 fixtures under `tests/fidelity.jsonl` used to be just fixtures — `scripts/test-fidelity.py` only printed to stdout, and no scored run had ever been committed. On 2026-08-18 we ran and committed the first real baseline (commit [`c697d5d`](https://github.com/xr843/Master-skill/commit/c697d5d3be78ce6738cf1f969ca057c7e4c16bb5), model `claude-sonnet-4-6`):
175
172
 
176
- ### Installation
177
-
178
- **NPX (recommended, no global state)**
179
-
180
- `npx master-skill install --all` installs all 19 skills: 15 personas, 3 teaching modes, and the `create-master` generator. The generator is copied as a self-contained runtime, so it remains usable after the transient npx package directory is removed; reinstall and `update --all` refresh the runtime while preserving user-generated personas under `create-master/masters/`.
173
+ | | Value |
174
+ |---|---|
175
+ | Passed / measured | **59 / 84 (70%)** |
176
+ | Coverage of the full suite | 84 / 211 (40%) — the run stopped partway when the API account's credit balance ran out (HTTP 400), not from rate limiting or a code bug; the remaining 127 cases were never evaluated and are **not** counted as failures |
177
+ | Where real failures cluster | Missing expected keyword 14/25; forbidden phrase present 12/25; missing citation 5/25; fabricated citations 0 **but that audit ran on only 6 of the 84 cases**, see below |
178
+ | By test type | ordinary doctrine 43/48 = **89.6%**; boundary 12/26 = **46.2%**; citation-under-pressure 4/10 = **40.0%** — the weakness is in the guardrails, not the doctrinal content |
179
+ | ⚠️ Instrument warning | 10 of the 12 forbidden-phrase failures name a term **that already appears in the question** (these are trap questions), and the check is a plain substring match on the response — a correct refusal fails it exactly as hard as a real violation. **So the true rate is in [70.2%, 75.0%]** — only 4 of the 10 would flip; the other 6 fail on independent checks. See the baseline report |
180
+ | ⚠️ What the fabrication audit actually covered | The audit is **opt-in per fixture**: 7 of 211 fixtures set `must_cite_only_existing_sources` (six in `master-curriculum`, one in `master-huineng`), and only six were reached — **no master persona was ever checked for a fabricated citation**. Its id pattern also recognises CBETA ids only, so the six masters declaring `PTS:` / `Toh:` / `BDRC:` / `SuttaCentral` sources (all of Theravāda and all of Tibetan) cannot be audited even with the flag set. Corrected 2026-08-31; this row previously read "zero fabricated citations" |
181
181
 
182
- ```bash
183
- # Install individual public skills
184
- npx master-skill install master-zhiyi
185
- npx master-skill install compare-masters
186
- npx master-skill install create-master
187
-
188
- # Install or list the complete 19-skill catalog
189
- npx master-skill install --all
190
- npx master-skill list
191
- ```
182
+ This measures **keyword/citation-string coverage, not doctrinal correctness or LLM-judged answer quality**. Full table, failing cases, and methodology notes: **[eval/reports/BASELINE.md](eval/reports/BASELINE.md)**.
192
183
 
193
- **Global install (frequent use / offline-friendly)**
184
+ ---
194
185
 
195
- ```bash
196
- npm install -g master-skill # Adds the binary to $PATH
197
- master-skill install master-zhiyi # No more npx prefix
198
- master-skill list
199
- npm update -g master-skill # Pull next minor / patch
200
- ```
186
+ ## Developer Installation
201
187
 
202
- **Claude Code**
188
+ > 👤 **Just want to try it?** Use [fojin.app/chat](https://fojin.app/chat) — no install needed.
189
+ > 🛠️ **This section is for** Claude Code / Cursor / Codex CLI / OpenCode / Gemini CLI users.
203
190
 
204
191
  ```bash
205
- git clone https://github.com/xr843/Master-skill ~/Master-skill
206
- cd ~/Master-skill && pip install -r requirements.txt
207
- for d in prebuilt/master-*/; do ln -sf "$(pwd)/$d" ~/.claude/skills/"$(basename $d)"; done
208
- ln -sf "$(pwd)/prebuilt/compare" ~/.claude/skills/compare-masters
209
- ln -sf "$(pwd)" ~/.claude/skills/create-master
210
- ```
211
-
212
- **Cursor** — Clone the repo; Cursor auto-detects `.cursor-plugin/plugin.json`.
213
-
214
- **OpenCode** — Add to `opencode.json`:
215
-
216
- ```json
217
- {"plugin": ["master-skill@git+https://github.com/xr843/Master-skill.git"]}
218
- ```
219
-
220
- **Codex CLI** — See [.codex/INSTALL.md](.codex/INSTALL.md)
221
-
222
- **Gemini CLI** — Auto-discovered via `gemini-extension.json` and `GEMINI.md`.
223
-
224
- ### Use a Pre-built Master
225
-
226
- In any AgentSkills-compatible environment (Claude Code / Cursor / Codex CLI / OpenCode / Gemini CLI):
227
-
228
- ```
229
- # 印度 (Indian)
230
- /master-nagarjuna — Nāgārjuna (Indian · Madhyamaka | root of the eight schools)
231
-
232
- # 汉传 (Chinese)
233
- /master-xuanzang — Master Xuanzang (Yogacara)
234
- /master-kumarajiva — Kumarajiva (Madhyamaka / Sanlun)
235
- /master-huineng — Master Huineng (Chan, Sixth Patriarch)
236
- /master-zhiyi — Master Zhiyi (Tiantai)
237
- /master-fazang — Master Fazang (Huayan)
238
- /master-yinguang — Master Yinguang (Pure Land)
239
- /master-ouyi — Master Ouyi (Tiantai / Pure Land, cross-tradition)
240
- /master-xuyun — Master Xuyun (Chan, Five Houses)
241
-
242
- # 藏传 (Tibetan)
243
- /master-atisha — Atiśa Dīpaṃkara (Kadam founder · three scopes · 982-1054)
244
- /master-tsongkhapa — Tsongkhapa (Gelug founder · three principal aspects · prasaṅgika · 1357-1419)
245
- /master-milarepa — Milarepa (Kagyu · Mahāmudrā · Naro Chodruk · 1052-1135)
246
-
247
- # 南传 (Theravāda)
248
- /master-buddhaghosa — Buddhaghosa (commentarial summit · Visuddhimagga · 5th century)
249
- /master-mahasi-sayadaw — Mahasi Sayadaw (Burmese vipassanā · noting method · 1904-1982)
250
- /master-ajahn-chah — Ajahn Chah (Thai Forest Tradition · Wat Pah Pong · 1918-1992)
192
+ npx master-skill install --all # all 20 skills at once
193
+ npx master-skill install master-huineng # or just one
194
+ npx master-skill list # see everything installable
195
+ npx master-skill recommend "how do I actually practice nianfo" # not sure who to ask?
251
196
  ```
252
197
 
253
- ### Teaching Modes (v0.7)
198
+ Once installed, invoke `/master-huineng`, `/compare-masters`, etc. directly in chat.
254
199
 
255
- - **`/compare-masters`** multiple masters answer the same question side-by-side (horizontal, single-turn)
256
- - **`/master-debate`** masters from different traditions engage in a 4-round adversarial dialectic (claim → rebut → respond → synthesize + remaining disagreements)
257
- - **`/master-curriculum`** — given your target tradition and current level (L0-L3), get a time-sequenced study path (foundation → intermediate → advanced + likely blind spots)
258
-
259
- **`/compare-masters` usage examples:**
260
-
261
- ```
262
- # Auto-pick relevant masters
263
- /compare-masters what is emptiness
264
-
265
- # Manually pick masters (recommended for precise results)
266
- /compare-masters how to read the Heart Sutra --masters master-xuanzang,master-huineng,master-zhiyi
267
-
268
- # Natural-language triggers
269
- compare Huineng and Yinguang on nianfo
270
- how do Chan and Pure Land differ on practice
271
- ```
272
-
273
- **Selection logic**: the command first tries to extract keywords from the question and match them against each master's core concepts; if nothing matches strongly, it falls back to topic mapping (nianfo / meditation / Yogacara-Madhyamaka / classification, etc.). **If the auto-pick feels off, use `--masters` to override.**
274
-
275
- ### Generate a Custom Master
276
-
277
- ```
278
- /create-master Hongyi
279
- ```
280
-
281
- Or use natural language:
282
-
283
- ```
284
- Create a persona for Master Hongyi
285
- ```
286
-
287
- The system will guide you through a three-step intake, then automatically collect data from FoJin and generate the doctrinal analysis and style files.
288
-
289
- ---
200
+ > Per-platform setup (Claude Code plugin / Cursor / OpenCode / Codex CLI / Gemini CLI),
201
+ > global install, teaching-mode usage, and `/create-master`
202
+ > **[docs/install.en.md](docs/install.en.md)**
290
203
 
291
204
  ## Desktop Manager
292
205
 
293
- A native desktop console (pure Rust, egui, single binary, no Electron) that unifies management of installation status, fidelity evaluation coverage, run tracing, and the quality gate across all 17 master skills:
206
+ A native desktop console (pure Rust, egui, single binary, no Electron) that unifies management of installation status, fidelity evaluation coverage, run tracing, and the quality gate across all 19 master skills:
294
207
 
295
- ![Master-skill Desktop Manager](https://raw.githubusercontent.com/xr843/Master-skill/master/docs/assets/desktop-manager.png)
208
+ ![Master-skill Desktop Manager](https://raw.githubusercontent.com/xr843/Master-skill/main/docs/assets/desktop-manager.png)
296
209
 
297
210
  **Download**: [Releases](https://github.com/xr843/Master-skill/releases) provides pre-built binaries for Linux / Windows / macOS — download and run directly (execute from the repository root; requires a local clone of this repo). On Linux/macOS you'll need to `chmod +x` the downloaded binary first; on macOS it's unsigned, so the first run needs right-click → Open, or `xattr -d com.apple.quarantine <file>` to clear the quarantine flag.
298
211
 
@@ -308,152 +221,33 @@ cd desktop && cargo build --release
308
221
 
309
222
  ## Pre-built Masters
310
223
 
311
- ### Nāgārjuna (c. 150-250)Indian · Madhyamaka
312
-
313
- The founder of Mahāyāna Madhyamaka, revered in Chinese Buddhism as the **common patriarch of the eight schools** — Sanlun, Tiantai, Pure Land, Huayan, and Chan all trace their lineage back to him, and the Tibetan prasaṅgika Madhyamaka takes him as its root authority. He used the **eightfold negation of the middle way** to dismantle all conceptual proliferation, opened up dependent origination as emptiness with "whatever arises through conditions, that I declare to be emptiness," taught by way of the **two truths** while resolving into ultimate emptiness and the quiescence of proliferation, and distinguished the **easy and difficult paths** of practice. His *Mūlamadhyamakakārikā* is the root treatise of all later Madhyamaka study, and his *Mahāprajñāpāramitā-śāstra* is an encyclopedia of the Prajñāpāramitā teachings.
314
- Primary sources: CBETA — Mūlamadhyamakakārikā (T30n1564), Mahāprajñāpāramitā-śāstra (T25n1509), Dvādaśanikāya-śāstra (T30n1568), Vigrahavyāvartanī (T32n1631), Daśabhūmika-vibhāṣā (T26n1521).
315
- Invoke: `/master-nagarjuna`
316
-
317
- ### Master Xuanzang (602-664)
318
-
319
- 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.
320
- Primary sources: CBETA Mahaprajnaparamita Sutra, Yogacarabhumi-sastra, Cheng Weishi Lun, Heart Sutra.
321
- Invoke: `/master-xuanzang`
322
-
323
- ### Kumarajiva (344-413)
324
-
325
- 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.
326
- Primary sources: CBETA Lotus Sutra, Diamond Sutra, Vimalakirti Sutra, Mulamadhyamakakarika, Mahaprajnaparamita-sastra.
327
- Invoke: `/master-kumarajiva`
328
-
329
- ### Master Huineng (638-713)
330
-
331
- 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."
332
- Primary sources: CBETA — Platform Sutra (T48n2008).
333
- Invoke: `/master-huineng`
334
-
335
- ### Master Zhiyi (538-597)
336
-
337
- 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.
338
- Primary sources: CBETA — Mohe Zhiguan (T46n1911), Fahua Xuanyi (T33n1718).
339
- Invoke: `/master-zhiyi`
340
-
341
- ### Master Fazang (643-712)
342
-
343
- 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.
344
- Primary sources: CBETA — Huayan Jing Tanxuan Ji (T35n1733), Huayan Wujiao Zhang (T45n1866).
345
- Invoke: `/master-fazang`
346
-
347
- ### Master Yinguang (1861-1940)
348
-
349
- 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.
350
- Primary sources: CBETA — Wenchao volumes and the three Pure Land sutras.
351
- Invoke: `/master-yinguang`
352
-
353
- ### Master Ouyi (1599-1655)
354
-
355
- 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.
356
- Primary sources: CBETA — Amituo Jing Yaojie (T37n1762), Jiaoguan Gangzong.
357
- Invoke: `/master-ouyi`
358
-
359
- ### Master Xuyun (1840-1959)
360
-
361
- 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.
362
- Primary sources: CBETA — Shurangama Sutra, Diamond Sutra, Platform Sutra.
363
- Invoke: `/master-xuyun`
364
-
365
- ### Atiśa Dīpaṃkara (982-1054) — Tibetan · Kadam · Indo-Tibetan bridge
366
-
367
- Royal-born Indian master from the Sahor kingdom (modern Bangladesh). Studied Madhyamaka, Yogācāra and tantra at Vikramaśīla; received the bodhicitta lineage from Dharmakīrti of Suvarṇadvīpa (Sumatra). Invited to Tibet in 1042 by King Yeshe Ö to reform a tradition where Vinaya had decayed and tantra had become disconnected from sūtra foundations. His *Bodhipathapradīpa* (Toh 4465) became the source text for all later Tibetan *lamrim* literature. His chief disciple Dromtönpa founded Reting Monastery, originating the **Kadam school** — later succeeded by Tsongkhapa's "New Kadam" (Gelug). All four Tibetan schools recognize him as a root teacher.
368
- Primary sources: Toh 4465 *Bodhipathapradīpa* + Toh 3948 self-commentary + Kadam oral lineage *Pha chos / Bu chos*.
369
- Invoke: `/master-atisha`
370
-
371
- ### Tsongkhapa (1357-1419) — Tibetan · Gelug founder
372
-
373
- Founder of the **Gelug school** (dGe lugs pa, "the way of virtue"; popularly known as the "Yellow Hat school") — basis of the Dalai Lama and Panchen Lama lineages. Born in Tsongkha (Qinghai). Studied with masters across all major schools, particularly the Sakya scholar Rendawa for prasaṅgika Madhyamaka. Reformed lax monastic discipline, integrated sūtra and tantra into a strict graduated path, and produced the great triology: *Lamrim Chenmo* (Great Treatise on the Stages of the Path), *sNgags rim chen mo* (Great Treatise on Tantra), and *Drang nges legs bshad snying po* (Essence of True Eloquence — definitive vs interpretable meaning). Founded Ganden Monastery (1409) — the seat of the school.
374
- Primary sources: Tsongkhapa's collected works (*gsung 'bum*, searchable on BDRC.io). Chinese translation by Dharma-master Faxun is the standard Sinophone reference.
375
- Invoke: `/master-tsongkhapa`
376
-
377
- > ⚠️ Tantric practice steps, empowerment liturgy, generation- and completion-stage details, deity mantras, and channels-and-drops practice are introduced **only at the level of name and historical context — concrete practice instructions are never given**.
378
-
379
- ### Milarepa (1052-1135) — Tibetan · Kagyu
380
-
381
- Spiritual ancestor of the Tibetan Kagyu lineage and the paradigm of the "yogi tradition" (no monastery, mountain retreat, teaching through song). After committing serious harm in his youth through black magic, he sought purification under Marpa the Translator, who put him through severe trials before transmitting the complete Mahāmudrā and Naro Chodruk lineages. He spent decades in Himalayan retreat, surviving on nettles, and taught through extemporaneous **mGur** (songs of realization) — shaping the entire later Tibetan tradition.
382
- Primary sources: BDRC — *The Hundred Thousand Songs of Milarepa* (mGur 'bum, W1KG14334) and *The Life of Milarepa* (rNam thar, W22272).
383
- Invoke: `/master-milarepa`
384
-
385
- > ⚠️ Naro Chodruk (Six Yogas), tummo, generation/completion stages and other esoteric practices are introduced **only at the level of name and historical context — concrete practice instructions are never given**. Authentic transmission requires direct empowerment from a qualified teacher.
386
-
387
- ### Buddhaghosa (5th century) — Theravāda · commentarial summit
388
-
389
- The most influential commentator and śāstra master in Theravāda history. Born a brahmin scholar in southern India, he travelled to the Mahāvihāra in Anurādhapura (Sri Lanka) to translate the old Sinhala commentaries (*Sīhaḷa-aṭṭhakathā*) into Pali. To prove his competence, he first composed the *Visuddhimagga* — a 23-chapter encyclopedia of Theravāda meditation and doctrine organized around the threefold training of **sīla, samādhi, paññā**. He then translated the four Nikāya commentaries, the Vinaya commentary *Samantapāsādikā*, and the Abhidhamma commentaries. His framework defines orthodox Theravāda exegesis to this day across Sri Lanka, Burma, Thailand, Cambodia, and Laos.
390
- Primary sources: PTS edition *Visuddhimagga* + four Nikāya *aṭṭhakathā* (Sumaṅgalavilāsinī, Papañcasūdanī, Sāratthappakāsinī, Manorathapūraṇī) + *Samantapāsādikā* (Vinaya) + *Atthasālinī* (Abhidhamma).
391
- Invoke: `/master-buddhaghosa`
392
-
393
- ### Mahāsi Sayādaw U Sobhana (1904-1982) — Theravāda · Burmese vipassanā
394
-
395
- One of the most internationally influential meditation masters of modern Burma. Recognized as a *Pariyatti Sāsanahita* — the highest scriptural qualification in Burmese monasticism — by age 27. Studied four-foundations vipassanā with U Nārada (Mingun Sayadaw) from 1932. Established the **Mahasi Sasana Yeiktha** retreat center in Yangon in 1947, formalizing the **noting method** (rising-falling at the abdomen as primary object) tied to Visuddhimagga's seven purifications and sixteen insight knowledges. Served as *Final Editor* of the Sixth Buddhist Council (1954-1956) — the largest modern revision of the Pali Canon. His lineage profoundly shaped the founders of America's Insight Meditation Society (Goldstein, Salzberg, Kornfield).
396
- Primary sources: *Manual of Insight* (Wisdom Publications, 2016 English ed.), *The Progress of Insight* (BPS Sri Lanka Wheel No. 280), *Practical Vipassanā Meditation Exercises* (Mahasi Sasana Yeiktha).
397
- Invoke: `/master-mahasi-sayadaw`
398
-
399
- > ⚠️ **The AI must never confirm any individual's stage of insight or attainment of fruition.** Verification requires face-to-face interview with a qualified teacher. This is the strictest guardrail in this skill — the Mahasi tradition's "fruition is attainable" framing is famous for inducing self-attainment delusions, and the AI is forbidden from playing that role.
400
-
401
- ### Ajahn Chah Subhaddo (1918-1992) — Theravāda · Thai Forest
402
-
403
- One of the most internationally influential masters of the Thai Forest Tradition. Renowned for strict Vinaya observance, four-foundations-of-mindfulness practice, and plain, life-grounded teaching style. His Western disciples (Ajahn Sumedho, Ajahn Pasanno, Ajahn Amaro and others) established Abhayagiri (California), Amaravati (UK), Cittaviveka (UK) and other branch monasteries, carrying the forest tradition to the West. Most-quoted line: *"If you let go a little, you have a little peace; if you let go completely, you have complete peace."*
404
- Primary sources: Pali Canon (SuttaCentral) + authorized English collections — *Food for the Heart*, *A Still Forest Pool*, *Living Dhamma*.
405
- Invoke: `/master-ajahn-chah`
406
-
407
- ---
224
+ Fifteen masters across four traditions. The command *is* the skill name invoke it directly once installed.
225
+
226
+ | Command | Master | Tradition · School | Dates |
227
+ |---|---|---|---|
228
+ | `/master-nagarjuna` | Nāgārjuna | Indian · Madhyamaka | c. 150-250 |
229
+ | `/master-kumarajiva` | Kumārajīva | Chinese · Sanlun / Madhyamaka | 344-413 |
230
+ | `/master-zhiyi` | Zhiyi | Chinese · Tiantai | 538-597 |
231
+ | `/master-xuanzang` | Xuanzang | Chinese · Yogācāra | 602-664 |
232
+ | `/master-huineng` | Huineng | Chinese · Chan (Sixth Patriarch) | 638-713 |
233
+ | `/master-fazang` | Fazang | Chinese · Huayan | 643-712 |
234
+ | `/master-ouyi` | Ouyi | Chinese · Tiantai / Pure Land | 1599-1655 |
235
+ | `/master-xuyun` | Xuyun | Chinese · Chan (all five houses) | 1840-1959 |
236
+ | `/master-yinguang` | Yinguang | Chinese · Pure Land | 1861-1940 |
237
+ | `/master-atisha` | Atiśa Dīpaṃkara | Tibetan · Kadam (lamrim) | 982-1054 |
238
+ | `/master-milarepa` | Milarepa | Tibetan · Kagyu (Mahāmudrā) | 1052-1135 |
239
+ | `/master-tsongkhapa` | Tsongkhapa | Tibetan · Gelug (Prāsaṅgika) | 1357-1419 |
240
+ | `/master-buddhaghosa` | Buddhaghosa | Theravāda · commentarial | 5th c. |
241
+ | `/master-mahasi-sayadaw` | Mahāsi Sayādaw | Theravāda · Burmese vipassanā | 1904-1982 |
242
+ | `/master-ajahn-chah` | Ajahn Chah | Theravāda · Thai Forest | 1918-1992 |
243
+
244
+ **Teaching modes**: `/compare-masters` · `/master-debate` · `/master-curriculum` · `/master-help` · `/create-master`
245
+
246
+ > Life, doctrine, and declared sources for each → **[docs/masters.en.md](docs/masters.en.md)**
408
247
 
409
248
  ## Architecture
410
249
 
411
- ```
412
- User request
413
- |
414
- v
415
- session-start hook ──> auto-injects master list (5 platforms, unified)
416
- |
417
- v
418
- SKILL.md (AgentSkills entry: decision tree + quick reference)
419
- |
420
- +-- Pre-built masters --> prebuilt/{slug}/
421
- | +-- SKILL.md (decision tree + <HARD-GATE>)
422
- | +-- meta.json (version / lineage / provenance)
423
- | +-- references/ (loaded on demand)
424
- | | +-- teaching.md
425
- | | +-- voice.md
426
- | +-- sources/ (offline declared-source passages)
427
- | | +-- *.md
428
- | +-- tests/
429
- | +-- fidelity.jsonl (CI dry-run samples)
430
- |
431
- +-- Offline toolchain
432
- | +-- scripts/validate.py (frontmatter linter)
433
- | +-- scripts/cite.py (CBETA lookup)
434
- | +-- scripts/query.py (offline semantic search)
435
- | +-- scripts/test-fidelity.py (fidelity runner)
436
- | +-- scripts/validate-fidelity.py
437
- | +-- bin/cli.mjs (NPX installer)
438
- |
439
- +-- Custom generation (/create-master, HARD-GATE enforced)
440
- +-- Step 1-2 prompts/intake.md → tools/sutra_collector.py
441
- | └─> FoJin API (KG + semantic search + text)
442
- +-- Step 3 prompts/{sutra,voice}_analyzer.md → two-stage analysis
443
- +-- Step 3.5 two-stage independent review ──┬─ prompts/doctrine_reviewer.md
444
- | └─ prompts/voice_reviewer.md
445
- +-- Step 4-5 tools/master_builder.py → tools/skill_writer.py
446
- └─> tools/verify_sources.py (final pre-write check)
447
-
448
- Unified multi-platform manifests:
449
- .claude-plugin/ → Claude Code (hooks/run-hook.cmd → session-start)
450
- .cursor-plugin/ → Cursor (hooks/hooks-cursor.json)
451
- .codex/ → Codex CLI (.codex/INSTALL.md)
452
- .opencode/ → OpenCode (referenced from opencode.json)
453
- gemini-extension.json → Gemini CLI (auto-loaded with GEMINI.md)
454
- ```
455
-
456
- ---
250
+ Directory layout and data flow → **[docs/architecture.en.md](docs/architecture.en.md)**
457
251
 
458
252
  ## Relationship to FoJin
459
253
 
@@ -491,27 +285,7 @@ Every citation must resolve to the persona's declared source ID. A FoJin locator
491
285
 
492
286
  ## Troubleshooting
493
287
 
494
- **Q: Does it still work when the FoJin API is unreachable?**
495
-
496
- Yes. Each prebuilt master ships with `prebuilt/<name>/sources/` — key passages from that master's core canon, stored offline. When FoJin is down, the master degrades to offline mode and declares "currently running on offline passages" in the reply. The `/create-master` pipeline asks the user to switch to manual-input mode when the API fails, so you can paste source text and continue.
497
-
498
- **Q: What does a valid CBETA citation look like, and how are sources verified?**
499
-
500
- CBETA citations use a `Txxn####` identifier (for example, the Lotus Sutra is `T09n0262`); Tibetan, Pali, and compiled-teaching personas use the BDRC / Toh, SuttaCentral / PTS, or teaching IDs declared in `meta.json.sources[]`. `scripts/validate-citation-contract.py` and `tools/verify_sources.py --check-links/--final-check` validate source families, identifier shapes, declared membership, and contract consistency offline. They do not parse free-text citations or guarantee HTTP reachability. The legacy online `verify_sources.py --fix` audit covers CBETA / FoJin links only.
501
-
502
- **Q: `npx master-skill install` fails with ENOTEMPTY or a permission error — what now?**
503
-
504
- Clean up any leftover `~/.claude/skills/master-<name>/` directories before retrying. For npm-cache weirdness, run `npm cache clean --force` and rerun NPX. Windows users should execute from Git Bash or WSL to avoid cmd.exe path-escaping issues.
505
-
506
- **Q: The generated master says things that don't match the historical record — how do I correct it?**
507
-
508
- Just tell the master in-chat: "he wouldn't phrase it like that" or "he should sound more stern." The `/create-master` correction mode classifies the fix (doctrinal → appended to `teaching.md`; stylistic → appended to `voice.md`), writes it as a `## Correction` block with timestamp, and bumps the patch version. Correction blocks take priority over analysis-generated content at runtime.
509
-
510
- **Q: How do I contribute a new prebuilt master?**
511
-
512
- See "Contributing" below. The short version: follow the v0.3 layout under `prebuilt/<name>/`, pass `scripts/validate.py --strict` with zero errors, ship at least 5 fidelity Q&A samples in `tests/fidelity.jsonl`, then open a PR.
513
-
514
- ---
288
+ Common install, invocation, and retrieval questions **[docs/troubleshooting.en.md](docs/troubleshooting.en.md)**
515
289
 
516
290
  ## Contributing
517
291