Commit Graph

99 Commits

Author SHA1 Message Date
xianren 3f81cbb955 feat(v0.6): namespace all 14 master slash commands under /master-<slug> prefix
Slash command discoverability cleanup. Claude Code users typically have
50+ skills installed; bare-word commands like /atisha and /zhiyi got
scattered across the /-completion list. v0.6 prefixes all 14 master
slash commands with master- so they cluster under /m<tab> and clearly
signal "this is a Master-skill master skill".

Scope of rename
---------------
* Slash commands: /zhiyi → /master-zhiyi, /huineng → /master-huineng,
  ... all 14 affected.
* Directory layout: prebuilt/<slug>/ → prebuilt/master-<slug>/ for all
  14 masters (git mv preserves history).
* Frontmatter: each prebuilt/master-<slug>/SKILL.md updates `name:` to
  master-<slug>.
* compare-masters and create-master meta-skills are intentionally
  unchanged — they're already prefixed by their nature, and
  /master-compare-masters would be doublespeak.

Decoupling: fojin.app/chat is NOT affected
------------------------------------------
The fojin web frontend's master dropdown uses bare slug IDs (atisha,
huineng, ...) and is already grouped under "法师模式" in its UI. Backend
master_profiles.py keeps `id="atisha"` etc. unchanged. No fojin-side
migration required. The two surfaces (Claude Code slash + fojin
dropdown) are now formally decoupled by design, not coincidence.

Compatibility
-------------
* NPX installer accepts both forms: `npx master-skill install zhiyi`
  (short) and `install master-zhiyi` (full) both resolve to the same
  prebuilt/master-zhiyi/ source. Install destination is always
  ~/.claude/skills/master-<slug>/. Backward-compatible uninstall
  handles legacy non-prefixed installs (~/.claude/skills/zhiyi/).
* The cli.mjs already used `master-${name}` for install destinations
  (since v0.3 NPX installer was added), so existing v0.4/v0.5 NPX
  users were already getting the prefix in skills/ — only the source
  prebuilt/ layout and slash commands change in v0.6.

Files updated
-------------
* 14 directories renamed (28 files moved, 0 content changes).
* 14 SKILL.md frontmatter `name:` fields.
* prebuilt/compare/SKILL.md: 43 slug references updated to prefixed form.
* bin/cli.mjs: resolveMasterDir helper accepts both short and full;
  cmdInstall and cmdUninstall handle legacy paths.
* .github/workflows/validate-and-test.yml: fidelity-smoke MASTERS
  rotation array updated to all 14 prefixed names (was 8 hardcoded
  汉传 only — now properly rotates across the full set).
* scripts/{validate,cite,query,test-fidelity}.py: --master arg help
  text examples.
* README.md + README_EN.md: situational guidance table, install
  snippets, master cards. New v0.6 release banner.
* SKILL.md (project-level) preset list with new slash names.
* ETHICS.md Tier table slug references (4).
* All plugin manifests bumped 0.5.0 → 0.6.0 with description noting
  the /master-<slug> invocation pattern.
* CHANGELOG.md: [0.6.0] section with breaking-change notice and
  migration commands for existing NPX users.

Validation
----------
* python scripts/validate.py --strict           ✓ 15 masters pass
* python scripts/validate-fidelity.py           ✓ all valid
* python scripts/test-fidelity.py --all --dry-run  ✓
* pytest tests/                                  ✓ 31 passed, 6 skipped
* node bin/cli.mjs list                          ✓ shows all 14 with
                                                   master- prefix
* node bin/cli.mjs install zhiyi                 ✓ resolves to
                                                   prebuilt/master-zhiyi/
* node bin/cli.mjs install master-zhiyi          ✓ resolves to same

Migration for existing v0.4/v0.5 users
--------------------------------------
    npx master-skill@0.5 uninstall zhiyi huineng xuanzang ...
    # OR: rm -rf ~/.claude/skills/{zhiyi,huineng,...}
    npx master-skill@latest install --all

Then start a new Claude Code session; the new slash commands are
/master-zhiyi, /master-huineng, etc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 20:43:36 +08:00
Tim Ren 5d68deb963 Merge pull request #17 from xr843/feat/v0.5-batch2-4-masters
feat(v0.5): expand Tibetan + Theravāda each from 1 → 3 masters (15 total)
v0.5.0
2026-05-02 18:41:54 +08:00
xianren 9b2039e12a feat(v0.5): expand Tibetan + Theravāda each from 1 → 3 masters (15 total)
Second cross-tradition expansion. v0.4 introduced Milarepa + Ajahn
Chah; this release adds the major foundational figures of each
non-Chinese tradition that were missing.

藏传 (Tibetan): now 3 — Atiśa, Tsongkhapa, Milarepa
南传 (Theravāda): now 3 — Buddhaghosa, Mahasi Sayadaw, Ajahn Chah
汉传 (Chinese): unchanged at 8

New masters
-----------
* prebuilt/atisha/ — Atiśa Dīpaṃkara (982-1054). 噶当派 founder,
  Indo-Tibetan bridge. Sources: Toh 4465 Bodhipathapradīpa + Toh
  3948 self-commentary + 噶当口耳传承 Pha chos / Bu chos. Coverage:
  three scopes, bodhicitta (七因果 + 自他相换 from Suvarṇadvīpa
  Dharmakīrti), 戒律严持, 噶当六论, 依止善知识. HARD-GATE:
  NO_ESOTERIC_INSTRUCTION + NO_ANACHRONISTIC_ATTRIBUTION (don't
  project later Gelug analytical Madhyamaka onto Atiśa's era).

* prebuilt/tsongkhapa/ — Tsongkhapa Lobsang Drakpa (1357-1419).
  Gelug founder, basis of Dalai Lama / Panchen Lama lineages.
  Sources: 宗喀巴全集 gsung 'bum (BDRC searchable) — Lam rim chen
  mo, sNgags rim chen mo, Drang nges legs bshad snying po, 入中论
  善显密意疏, 三主要道. Coverage: 三主要道 (出离心 / 菩提心 / 清净
  见), lamrim, 应成中观, 三聚戒, 闻思修, 五部大论. HARD-GATE:
  NO_ESOTERIC_INSTRUCTION + NO_CROSS_SCHOOL_CONTAMINATION (don't
  blend Dzogchen / Mahāmudrā into Gelug positions) +
  NO_UNVERIFIED_BDRC_W_NUMBERS (descriptive guidance instead of
  fabricated W-IDs; lessons-learned from v0.4 fixup).

* prebuilt/buddhaghosa/ — Buddhaghosa (5th century). 上座部
  commentarial summit. Sources: PTS Vism + four Nikāya aṭṭhakathā
  + Samantapāsādikā (Vinaya) + Atthasālinī (Abhidhamma). Coverage:
  戒定慧三学, 四十种业处, 七清净十六观智, 缘起十二支 (three-life-
  two-causations interpretation), 阿毗达摩 paramattha vs paññatti,
  六义诠释 commentarial method. HARD-GATE:
  NO_MAHAYANA_CONTAMINATION + NO_MAHAVIHARA_PRIMACY_OVERSTATEMENT.

* prebuilt/mahasi-sayadaw/ — Mahāsi Sayādaw U Sobhana (1904-1982).
  Burmese Vipassanā tradition / Mahasi Method. Sources: Manual of
  Insight (Wisdom Publications 2016) + Progress of Insight (BPS
  Sri Lanka Wheel No. 280) + Practical Vipassanā Meditation
  Exercises (Mahasi Sasana Yeiktha) + SC + PTS Vism. Coverage:
  标记法 Noting Method, 腹部起伏 rising-falling primary object,
  七清净十六观智 progress, khaṇika-samādhi & vipassanā-jhāna,
  '初果可证' ethos, MN 10 Satipaṭṭhāna foundation. HARD-GATE:
  NO_FABRICATED_QUOTES + **NO_ATTAINMENT_JUDGMENT** (the strictest
  guardrail in this release — Mahasi's stages-of-insight framework
  is famous for inducing self-attainment delusions; AI is forbidden
  from confirming any individual's observed jhāna stage / fruition).

Each master ships the standard v0.3 progressive-disclosure shape:
SKILL.md (decision tree + HARD-GATE + Quick Reference) + meta.json +
references/{voice,teaching}.md + sources/INDEX.md + ≥1 excerpts file
+ tests/fidelity.jsonl with 12-13 cases each.

ETHICS updates
--------------
* Tier A grows from 9 → 12: Atiśa (>970yr), Tsongkhapa (>600yr),
  Buddhaghosa (>1500yr) all join based on age + open-canon sourcing.
* Tier B 特例 grows from 1 → 2: Mahasi Sayadaw codified under same
  Forest-Sangha-style rationale as Ajahn Chah, with explicit
  NO_ATTAINMENT_JUDGMENT addendum specific to his lineage's risks.
* Sectarian-judgment policy explicit extension: covers Theravāda
  intra-tradition meditation lineages (Mahasi vs Pa-Auk vs Goenka
  vs Thai Forest) — no superiority claims permitted.

compare-masters meta-skill
--------------------------
prebuilt/compare/SKILL.md updated:
* 可用祖师 table now lists all 15 masters by tradition.
* Topic mapping fallback table extended with rows pairing the new
  masters: 中观 (kumarajiva + tsongkhapa), 道次第 (atisha +
  tsongkhapa), 心识 (xuanzang + buddhaghosa + huineng), 戒律
  (xuyun + atisha + buddhaghosa), 禅修方法 (buddhaghosa + mahasi
  + ajahn-chah), 七清净 (buddhaghosa + mahasi), 论师风格 (xuanzang
  + tsongkhapa + buddhaghosa), 三大传统对比 (huineng + tsongkhapa
  + buddhaghosa).
* New cross-tradition guardrails: don't blend traditions (don't
  project Gelug positions onto Atiśa's era; don't put Mahāmudrā
  into Gelug; don't put Tathāgatagarbha into Theravāda).

Surface bumps
-------------
* All 4 plugin manifests + package.json + gemini-extension.json
  bumped 0.4.0 → 0.5.0 with description updated to "15 prebuilt
  masters".
* SKILL.md (project-level) preset list expanded to 8/3/3.
* README.md + README_EN.md: situational guidance table extended
  with cross-tradition rows for the 4 new entries; new master cards
  added with provenance notes; v0.5 release banner appended above
  v0.4 banner.

Validation
----------
* python scripts/validate.py --strict   →  15 masters pass
* python scripts/validate-fidelity.py   →  all valid
* python scripts/test-fidelity.py --all --dry-run  → 
* pytest tests/                          →  31 passed, 6 skipped

Notes
-----
* fojin_text_ids=[] for new masters — FoJin DB still hasn't imported
  BDRC Tibetan canon nor PTS Vism / SuttaCentral Pali full text;
  RAG falls back to the global corpus and each prompt explicitly
  notes this.
* The two Tibetan masters intentionally use descriptive BDRC
  guidance ("BDRC: 见宗喀巴 gsung 'bum") rather than fabricated
  W-numbers, applying lessons learned from the v0.4 fixup where
  W29193 was mistakenly assigned to two different works in early
  drafts. Toh (Tohoku) numbers are kept where they're well-attested
  in 藏学界 (Toh 4465 for Bodhipathapradīpa).
* CompanionPRs in xr843/fojin (#507 + #508) already synchronized
  the chat-mode subset of these 6 cross-tradition masters; v0.5 of
  this repo brings the Master-skill side to parity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 18:39:58 +08:00
Tim Ren 75a31a9be8 Merge pull request #16 from xr843/feat/expand-tibetan-theravada
feat(v0.4): cross-tradition expansion — Milarepa (Tibetan) + Ajahn Chah (Theravāda)
v0.4.0
2026-05-02 13:02:51 +08:00
xianren d441c5d7dc fixup: address review — sectarian wording, stragglers, quote framing
- prebuilt/ajahn-chah/sources/sutta-excerpts.md: drop comparative
  claim against 摩诃僧祇律 / 四分律, switch to non-comparative
  description of Pali Vinaya core rules. Was a self-violation of
  ajahn-chah's own NO SECTARIAN JUDGMENT HARD-GATE.

- prebuilt/compare/SKILL.md: 可用祖师 table reorganized 8→10 by
  tradition (汉传 / 藏传 / 南传) — milarepa and ajahn-chah now
  surfaceable in cross-tradition compare. Add 跨传统对比注意事项
  block + extend 禁忌 with comparative-judgment ban.

- gemini-extension.json: description updated 8 → 10 / Chinese →
  Buddhist + version 0.3.0 → 0.4.0 (was missed by the v0.4 commit;
  reviewer flagged).

- README.md: "安装全部 8 位" → "安装全部 10 位(三大传统)".

- ETHICS.md: Tier A table now lists milarepa as 9th PD master with
  BDRC sourcing note. Tier B table adds Ajahn Chah (1918–1992,
  ~2042). New Tier B 特例 section codifies the ajahn-chah inclusion
  rationale: authorized non-commercial Forest Sangha translations,
  summary-only (no full passages), HARD-GATE-enforced provenance,
  24h takedown commitment. Fixes ETHICS being misaligned with the
  v0.4 reality.

- prebuilt/ajahn-chah/sources/teachings-excerpts.md: prominent
  banner at top clarifying that all > blockquote blocks are
  summarizations (主旨), not verbatim quotes, plus citation format
  bumped to require "(开示要旨)" suffix. Closes ambiguity that
  could lead downstream LLMs / readers to treat blocks as direct
  Ajahn Chah speech.

Validation
----------
• python scripts/validate.py --strict →  11 masters
• python scripts/validate-fidelity.py →  11 masters
• pytest tests/ →  31 passed, 6 skipped

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:01:32 +08:00
xianren 5b46be9890 feat: expand to Tibetan + Theravada — 10 masters across 三大传统 (v0.4)
Adds the project's first non-Chinese masters, taking the scope from
"Chinese Buddhist" to "Buddhist" and matching the project name's
broader implication.

New masters
-----------
• prebuilt/milarepa — Tibetan Kagyu yogi (1052–1135). Sources:
  The Hundred Thousand Songs of Milarepa (mGur 'bum, BDRC W1KG14334)
  and The Life of Milarepa (rNam thar, BDRC W22272). Coverage:
  Mahāmudrā view, Naro Chodruk (name-level only — no esoteric steps),
  retreat & austerity, guru yoga, karma & purification.

• prebuilt/ajahn-chah — Thai Forest Tradition founder of Wat Pah Pong
  (1918–1992). Sources: Pali Canon (SuttaCentral SC IDs) plus
  authorized English collections Food for the Heart, A Still Forest
  Pool, Living Dhamma. Coverage: sati & satipaṭṭhāna, ānāpānasati,
  three characteristics, letting go, sīla-samādhi-paññā, middle way.

HARD-GATE additions
-------------------
• no_esoteric_instruction — Tibetan tantric practice steps (tummo,
  generation/completion stages, empowerment-required visualizations
  and mantras) are never disclosed; queries are redirected to
  qualified teachers. Boundary registered in
  scripts/validate-fidelity.py.

• No fabricated quotes for Theravāda discourses — Ajahn Chah quotes
  must trace to authorized publications; no synthesized "Ajahn Chah
  said" dialogue.

Citation system
---------------
BDRC:Wxxxxx (Tibetan canon) and SuttaCentral SC IDs are now
first-class alongside CBETA Txxnxxxx in frontmatter sources lists.
validate.py already accepts non-cbeta sources via the existing
title-or-cbeta_id check, no schema change required.

Cross-tradition compare-masters mappings
----------------------------------------
prebuilt/compare/SKILL.md gets new fallback rows for: 苦行/闭关
(xuyun + milarepa), 正念/觉知 (huineng + ajahn-chah + xuyun),
出离心/无常 (yinguang + milarepa + ajahn-chah), 三大传统对比
(huineng + milarepa + ajahn-chah), and adds milarepa to 般若/空性,
ajahn-chah to 戒律/行持.

Surface updates
---------------
• Description across package.json, .claude-plugin/{plugin,marketplace}.json,
  .cursor-plugin/plugin.json: "Chinese Buddhist" → "Buddhist",
  "8 prebuilt masters" → "10 prebuilt masters across 汉传/藏传/南传".
• README.md + README_EN.md: cross-tradition rows in the situational
  guidance table; new master cards for Milarepa and Ajahn Chah with
  appropriate provenance notes; v0.4 release banner replaces v0.3.
• SKILL.md preset list reorganized by tradition.
• CHANGELOG.md gets a [0.4.0] section.
• package.json keywords add tibetan-buddhism, theravada, bdrc,
  suttacentral.

Validation
----------
• python scripts/validate.py --strict →  11 masters pass
• python scripts/validate-fidelity.py →  11 masters validated
  (12 + 13 fidelity cases for the two new masters)
• python scripts/test-fidelity.py --all --dry-run → 
• pytest tests/ →  31 passed, 6 skipped

The progressive-disclosure shape of v0.3 is preserved exactly, so
the fidelity-smoke CI cost cap is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 12:56:56 +08:00
xianren b96d31881e fix(ci): grant issues:write to verify-links workflow
Weekly scheduled run was failing with 'Resource not accessible by
integration' when trying to open a maintenance issue. Default
GITHUB_TOKEN is read-only for contents and has no access to issues
under restrictive repo defaults.
2026-04-20 17:26:51 +08:00
Tim Ren e4f9dc60fa Merge pull request #13 from xr843/chore/tier-a-community-and-npm
chore(community): contributing infra + npm publish workflow
2026-04-16 13:54:22 +08:00
xianren 3dfaa6bb62 chore(community): add contributing infra, issue/PR templates, npm publish workflow
Tier A infrastructure to convert 204★ momentum into durable community and
distribution. Pairs with PR #12 (ETHICS / CHANGELOG / fidelity smoke) — merge
PR #12 first, then this.

**Community docs**
- `CONTRIBUTING.md` — three-tier contribution flow (code vs docs vs master
  content), with a detailed §3 "how to contribute a new master" covering
  copyright tier self-check, `/create-master` vs manual path, SKILL.md
  frontmatter spec, voice.md Layer 0-3, fidelity.jsonl authoring.
- `CODE_OF_CONDUCT.md` — Contributor Covenant 2.1 + Buddhist-project-specific
  rules (no doctrinal supremacy, no using the repo as a dharma platform, no
  impersonating clergy, no apocryphal scripture citations).
- `SECURITY.md` — threat model (prompt injection, supply chain, secret leak,
  installer safety, religious-boundary adversarial input), SLA table, GH
  Security Advisory as primary channel.

**Issue / PR templates**
- `bug_report.yml` — area selector, master selector, repro template.
- `feature_request.yml` — non-master enhancement requests.
- `new_master.yml` — **MUST precede any new-master PR**; forces tier A/B/D
  self-judgment and citation planning before sunk cost.
- `boundary_violation.yml` — P0 template for ETHICS.md §3 violations.
- `config.yml` — directs users to Discussions for chatter, Security Advisory
  for vulnerabilities, email for urgent takedowns.
- `PULL_REQUEST_TEMPLATE.md` — change-type checkboxes, self-check list, new-
  master fields, local-test block.

**npm publish**
- `.github/workflows/npm-publish.yml` — release-tag + workflow_dispatch, with
  dry-run mode, tag-version match check, `npm publish --provenance`.
  First-time publish needs NPM_TOKEN secret (user action).
- `package.json` hardening:
  - `engines.node: >=18`
  - scripts: `validate`, `validate:fidelity`, `test`, `test:smoke`, `prepack`
  - `publishConfig` (public, npm registry)
  - `files` list expanded to include platform manifests + governance docs
  - richer `keywords`, `author`, `bugs`, `homepage` fields
  - expanded description mentions all 8 masters for search discoverability

**README**
- 贡献指南 section rewritten to point at CONTRIBUTING.md + Discussions +
  four issue templates, with "先开 New Master issue 征询" gate spelled out.

Discussions were enabled on the repo alongside this commit via `gh api`, so
the links in README/templates resolve immediately on merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 13:53:25 +08:00
Tim Ren a69fc85ead Merge pull request #12 from xr843/chore/tier-s-ethics-ci-changelog
chore(governance): ETHICS.md + CHANGELOG.md + PR fidelity smoke
2026-04-16 13:53:17 +08:00
xianren bd04ede817 chore(governance): add ETHICS.md, CHANGELOG.md, and PR fidelity smoke
Three governance-tier additions to convert Master-skill from a demo into a
defensible long-lived project:

**ETHICS.md** — mandatory governance document:
- AI transparency: outputs are AI-synthesized, not masters' own words
- Copyright tiers A (public domain, current 8), B (in-copyright, needs
  license), C (never admit: living masters, Buddhas/bodhisattvas, apocryphal
  figures), D (case-by-case)
- Religious boundary: AI must refuse precept transmission, awakening
  certification, karmic diagnosis, spirit-medium framing, etc.
- Dual-track content license: code MIT, master content CC BY-NC-SA 4.0,
  prompts CC BY 4.0
- Takedown + appeal channel with 48h / 7d SLAs

**CHANGELOG.md** — Keep a Changelog format:
- [Unreleased] captures the current governance + community + npm work
- [0.3.0] retroactively documents the architectural rebuild (provenance,
  fidelity, NPX, multi-platform, HARD-GATE, two-stage review)
- [0.2.0], [0.1.0] historical sections

**CI fidelity smoke** — make HARD-GATE a real gate, not just documentation:
- New `fidelity-smoke` job runs one basic-difficulty fixture against one
  master per PR; picks the master touched by the diff, else rotates by
  day-of-year for uniform coverage
- Cost cap ≈ $0.05/PR (~10k-token system prompt × 1 request × Sonnet 4.6
  pricing). Forks without ANTHROPIC_API_KEY get an advisory pass so
  external PRs can still land
- `scripts/test-fidelity.py` gains `--max-tests N` flag; when capping, it
  sorts by difficulty (basic → intermediate → advanced) so smoke runs hit
  the reliable floor, not stress cases
- Old `fidelity` job renamed to `fidelity-full` (still workflow_dispatch)

README 声明 section now links to ETHICS.md so every reader sees the AI
disclosure and boundary rules before copying master content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 13:45:56 +08:00
Tim Ren cfd18159e1 Merge pull request #11 from xr843/fix/verify-links-context-repo
fix(ci): use context.repo.repo in verify-links workflow
2026-04-13 16:14:23 +08:00
xianren 6ba49597e0 fix(ci): use context.repo.repo instead of context.repo.name
github-script's context.repo object has {owner, repo}, not {owner, name}.
The typo caused the weekly Verify FoJin Links workflow to POST to
repos/xr843//issues (double slash, empty repo name) and fail with 404.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 16:13:23 +08:00
Tim Ren 3deec3ef68 Merge pull request #10 from xr843/feat/non-cli-onboarding
feat(onboarding): browser-first README + starter_questions for 8 masters
2026-04-11 10:55:18 +08:00
Tim Ren e02921da99 Merge pull request #9 from xr843/feat/compare-divergence-radar
feat(compare): divergence radar + labeled differences + classic debate templates
2026-04-11 10:55:15 +08:00
xianren 7e2070318d feat(onboarding): browser-first README + starter_questions for 8 masters
Shift the README narrative so that non-developer users — the 99% of the
actual audience — find the browser entry point first and the CLI install
second. The old structure buried fojin.app/chat at line 48 under a wall
of developer badges.

Changes:

- README.md / README_EN.md: new "立即体验 / Try It Now" hero section
  right after the title block, with a big call-to-action linking to
  fojin.app/chat, a "which master should I ask" recommendation table,
  and an explicit redirect for CLI users to the developer section.
- Rename "快速开始 / Quick Start" → "开发者安装 / Developer Installation"
  with a clear "if you just want to try it, use the browser instead"
  callout at the top.
- Update TOC anchors in both languages to match.

- prebuilt/<master>/meta.json × 8: new `starter_questions` field with
  4 Q&A entries per master. Each entry has `q` (the question) and `why`
  (why this question is suited for this specific master's voice and
  source corpus). Intended consumer: fojin.app/chat can fetch the raw
  meta.json on master selection and render these as cold-start prompts
  — solving the empty-input-box problem for first-time users.

Rationale: the biggest onboarding gap for non-CLI users is "I don't
know what to ask this master." A curated 4-question starter per master
provides both a safe entry point and a teaching signal about what this
particular master is actually good at answering.

Validated: scripts/validate.py --strict passes (9/9 masters).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:46:32 +08:00
xianren 28e5436ff9 feat(compare): divergence radar + labeled differences + classic debate templates
Upgrade /compare-masters from a loose comparison table to a structured
divergence analysis framework. Core changes:

- 5-dim radar (否定/安立/入手处/根器/终极表达): force the LLM to locate
  exactly which layer the disagreement sits on, not just "A thinks X,
  B thinks Y" without axis.
- Mandatory divergence labels: every concrete difference must be tagged
  [宗派性] / [侧重性] / [表达性] / [根器性]. This prevents the most
  common mistake — treating a 根器性 difference as a 宗派性 conflict.
- Classic debate templates: 禅净之争 / 性相之辩 / 空有之争 / 顿渐之辩.
  Pre-load the real historical disputes so the LLM does not invent
  fake controversy and knows the actual cruxes.
- Meta-question follow-ups (Step 4): generate "why are they different"
  prompts to turn a single comparison into a learning session.
- HARD-GATE additions: NO UNLABELED DIVERGENCE, NO EMPTY RADAR CELL,
  with rationalization defenses and red flags.

Rationale: the loose 共通点/差异点 template was too permissive — it
let the LLM produce shallow "each has their own merits" summaries.
Forcing a 5-axis radar + typed labels surfaces the actual structural
divergence, which is the real educational value of multi-master
comparison.

Validated: scripts/validate.py --strict passes (9/9 masters).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:42:58 +08:00
Tim Ren 6b0ce62b20 Merge pull request #8 from xr843/fix/compare-meta-skill-lint
fix(lint): exempt meta-skills from lineage/source checks
2026-04-11 09:20:43 +08:00
xr843 a0c367c058 fix(lint): exempt meta-skills from lineage/source checks
The compare-masters skill is an aggregate meta-skill that borrows from
other masters and has no single lineage, dates, sources, or own corpus
directories. Treating it as a regular master made --strict CI fail on
all branches since 2026-04-08.

Introduce a kind field (default master) and skip the lineage/dates/
sources/citation_format and references/sources directory checks when
kind == meta-skill. compare/SKILL.md gains kind: meta-skill.

Required fields (name, description) and version/license are still
enforced for all skills.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 09:18:59 +08:00
Tim Ren 38e7eb09dd Merge pull request #7 from xr843/docs/sync-readme-v03
docs(readme): sync README to v0.3 reality, bring EN in lockstep with CN
2026-04-10 14:36:06 +08:00
Tim Ren 3f51fc7ee7 Merge pull request #6 from xr843/chore/sync-plugin-metadata
chore(plugin): sync Cursor plugin metadata with Claude plugin
2026-04-10 14:36:02 +08:00
xianren 4eb92ab048 docs(readme): sync README to v0.3 reality, bring EN in lockstep with CN
README.md and README_EN.md had drifted from the code. The Chinese README
still claimed "SKILL.md < 100 行" (actual: 386 lines at repo root,
124–159 lines in prebuilt/*), and the English README still advertised
the v0.2 release — completely missing NPX install, provenance,
fidelity tests, HARD-GATE, two-stage review, and multi-platform
plugins.

Changes in both languages:

- Remove the "SKILL.md < 100 lines" claim (it was never true of the
  rebuilt v0.3 files and made the whole doc feel aspirational)
- Add v0.3 post-iteration banner covering two-stage review, HARD-GATE,
  multi-platform plugin support, session-start hook, pressure tests,
  and CI validation
- Expand Features list with HARD-GATE, two-stage review, unified
  multi-platform plugin bullets
- Rewrite the architecture diagram so it shows the session-start hook,
  HARD-GATE placement, two-stage review step (Step 3.5), and the
  five-platform manifest layout
- Add a Troubleshooting / 常见问题 section covering: FoJin API
  unreachability and offline fallback, CBETA citation format and
  verification, `npx master-skill install` failure recovery,
  correction-mode for historical accuracy, and how to contribute
  a new prebuilt master
- Update Contributing to reference the actual v0.3 layout (references/,
  sources/, tests/fidelity.jsonl) and CI fidelity dry-run gate

Chinese-specific:

- Fix the "OpenClaw" typo in the usage environment list
  (Claude Code / Codex CLI / OpenClaw → Claude Code / Cursor /
  Codex CLI / OpenCode / Gemini CLI)

English-specific (larger catch-up):

- Replace the stale "v0.2 Update" banner with the v0.3 banner
- Replace the v0.2 Features list (Dual-mode output, Incremental
  evolution, Version management) with the current v0.3 feature set
- Add the missing "Compare Masters" section (the English README never
  documented /compare-masters at all)
- Rewrite the architecture diagram — it still showed teaching.md and
  voice.md at the top level of prebuilt/{slug}/ and referenced
  tools/version_manager.py, which is not the v0.3 layout
- Fix the same "OpenClaw" typo

No behavioral changes — docs only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:27:32 +08:00
xianren 1af80522dc chore(plugin): sync Cursor plugin metadata with Claude plugin
Keeps the two per-platform plugin manifests in lockstep so marketplace
listings don't diverge. Cursor now matches Claude on:

- description: adds "RAG-grounded in FoJin knowledge graph" tail so
  discovery text is identical across platforms
- keywords: adds chinese-buddhism, cbeta, fojin (8 keywords total,
  matching .claude-plugin/plugin.json)

No behavioral change — manifest metadata only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:22:34 +08:00
Tim Ren 7b2af14c7f Merge pull request #5 from xr843/feat/two-stage-review
feat: two-stage review for create-master generation pipeline
2026-04-08 21:45:05 +08:00
xianren f22204a75e feat: add two-stage review for create-master generation pipeline
Inspired by superpowers' spec-reviewer + code-quality-reviewer pattern,
add mandatory two-stage review between generation and preview:

Stage 1 — Doctrine Review (doctrine_reviewer.md):
  - Citation coverage check (target >= 90%)
  - CBETA ID attribution accuracy
  - Sectarian boundary validation
  - Auto-fix with max 2 retry rounds

Stage 2 — Voice Review (voice_reviewer.md):
  - Layer 0 hard rules completeness
  - Style-to-tradition matching
  - Layer structure clarity check
  - Historical plausibility

Both stages must PASS before entering Step 4 (preview).
Added as Step 3.5 in create-master SKILL.md workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:43:46 +08:00
Tim Ren a8513910cb Merge pull request #4 from xr843/feat/multi-platform-plugin
feat: multi-platform plugin support (Claude Code, Cursor, Codex, OpenCode, Gemini)
2026-04-08 21:41:56 +08:00
Tim Ren 12020444e0 Merge pull request #3 from xr843/feat/hard-gate-and-pressure-tests
feat: HARD-GATE discipline enforcement, pressure tests, and CI pipeline
2026-04-08 21:41:53 +08:00
xianren f3472d6254 feat: add multi-platform plugin support and session-start hook
Add support for 5 platforms beyond NPX:

- Claude Code: .claude-plugin/plugin.json + marketplace.json
- Cursor: .cursor-plugin/plugin.json + hooks-cursor.json
- Codex CLI: .codex/INSTALL.md with symlink setup
- OpenCode: .opencode/INSTALL.md with plugin config
- Gemini CLI: gemini-extension.json + GEMINI.md

Infrastructure:
- SessionStart hook with platform detection (Claude Code,
  Cursor, Copilot CLI) that injects available masters list
- Cross-platform run-hook.cmd polyglot wrapper (Windows + Unix)
- .version-bump.json for unified version management across
  all platform config files
- Update README/README_EN with multi-platform install instructions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:38:08 +08:00
xianren 45c0416bc3 feat: add HARD-GATE to compare and create-master skills
- compare: add NO COMPARATIVE RANKING and NO FABRICATED DIALOGUE
  iron laws with rationalization defense table
- create-master: add NO FABRICATED SOURCES iron law for the
  generation pipeline
- Add 2 boundary tests for compare (sectarian ranking, fabricated
  dialogue)
- Fix validate-fidelity.py to support compare's assertion fields
  and no_fabricated_dialogue boundary type

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:32:13 +08:00
xianren c654e7440f feat: add CI validation pipeline and boundary test support
- Update test-fidelity.py to support must_not_contain and
  must_not_contain_first_turn fields for boundary/pressure tests
- Add validate-fidelity.py for structural validation of all
  fidelity.jsonl files (no API needed)
- Add GitHub Actions workflow: runs validate + dry-run on every
  push/PR touching prebuilt/scripts/prompts/tools

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:30:23 +08:00
xianren da80665fa5 feat: add HARD-GATE discipline enforcement and pressure tests for all 8 masters
Inspired by obra/superpowers project patterns, add three-layer defense
to prevent AI hallucination and rule violation:

- Iron Laws: NO DOCTRINAL CLAIM WITHOUT CBETA CITATION,
  NO PERSONA BEFORE CONTEXT, NO SECTARIAN JUDGMENT
- Rationalization Defense Table: 6 common AI excuses with rebuttals
- Red Flag List: 5 observable violation signals

Also add 40 pressure test cases (5 per master) covering:
- Sectarian judgment boundary
- No prophecy boundary
- Neutral first turn boundary
- Citation bypass pressure
- Master-specific challenges (meta, hostile, misunderstanding, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:28:41 +08:00
xianren 29a17ea281 docs: remove redundant "(手动)" from Claude Code install heading
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:16:06 +08:00
xianren 7f26cb3239 docs: add online demo section linking to fojin.app/chat
Users can now try all pre-built masters directly in the browser
without installing Claude Code or Codex CLI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:10:38 +08:00
xianren 59767e96b9 docs: update README for v0.3 — NPX install, architecture diagram, provenance features 2026-04-06 07:24:01 +08:00
xianren 623d88aa3e feat: v0.3 architecture rebuild — progressive disclosure, provenance, fidelity tests, NPX installer v0.3.0 2026-04-06 07:21:43 +08:00
xianren 88debde58d refactor(4-masters): rebuild fazang, huineng, kumarajiva, xuanzang to v0.3 architecture
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:18:52 +08:00
xianren d88da7b091 feat(scripts): add cite.py and query.py offline tools
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:13:56 +08:00
xianren 936ce09069 feat: add NPX installer CLI (install/list/uninstall)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:13:51 +08:00
xianren 937b642da8 refactor(zhiyi): v0.3 architecture rebuild — progressive disclosure + provenance + fidelity tests
Sample master (zhiyi) rebuilt to new architecture:
- SKILL.md slimmed from 225→94 lines with decision tree + Quick Ref
- Provenance frontmatter: CBETA IDs, FoJin text IDs, citation_format
- voice.md/teaching.md moved to references/ (loaded on demand)
- sources/ with canonical excerpts (offline-capable)
- tests/fidelity.jsonl: 5 Q&A pairs with expected citations/keywords
- scripts/validate.py: cross-master frontmatter linter
- scripts/test-fidelity.py: Claude API-based fidelity test runner

Follows Anthropic Agent Skills patterns:
  - Progressive disclosure (metadata→body→references)
  - Decision tree for branching workflows
  - Task-gated reference loading
  - Quick Reference table
  - Scripts as black boxes (--help, never Read source)
2026-04-06 07:05:43 +08:00
xianren 5b30b081c5 docs: add Codex CLI installation instructions
Codex CLI natively supports AgentSkills standard via ~/.codex/skills/.
Verified with codex-cli 0.118.0 — 10 skills registered successfully.
2026-04-05 13:33:50 +08:00
xianren 1de3bb9388 fix: correct FoJin URL format for juan paths
FoJin frontend route is '/texts/:id/read?juan=N' (query param),
not '/texts/{id}/juan/{N}' (path segment). Old format fell through
to React router 404.

Verified against FoJin frontend App.tsx route definitions:
- /texts/:id         → TextDetailPage
- /texts/:id/read    → TextReaderPage (uses ?juan= query)
2026-04-05 12:11:36 +08:00
xianren eb87794773 docs: simplify Community section wording 2026-04-05 10:50:45 +08:00
xianren 799beb6ba6 docs: add Community section linking to LINUX DO 2026-04-05 10:46:01 +08:00
xianren 1e0947acc4 docs: simplify v0.2 update banner 2026-04-05 10:16:10 +08:00
xianren 1b8554242d docs: add hero section with Diamond Sutra epigraph, badges, and navigation
Inspired by colleague-skill's README layout, adapted with dignified
Buddhist tone:
- Diamond Sutra verse as epigraph (in quotation marks, with source)
- Badges row (License, Python, Claude Code, AgentSkills)
- Scholar-oriented hook paragraphs (studying Yogacara, Chan, etc.)
- Serious tagline (no marketing flourish)
- Navigation quick-links
- v0.2 update banner
2026-04-05 10:13:39 +08:00
xianren 25aea07f6a refactor: rename Buddha-skill → Master-skill
Matches internal architecture (create-master, master_xuanzang, etc.)
and accurately reflects content (historical Chinese Buddhist masters,
not the Buddha himself).

Changes:
- 32 text references across 9 files updated
- Sanskrit terms (buddha-dhātu, buddhatā) preserved in dictionary context
- GitHub repo renamed (preserves stars/forks/history, auto-redirects)
- Internal naming already uses master_* (unchanged)

All 79 tests pass.
2026-04-05 10:03:42 +08:00
xianren 9dffcf3379 fix: enforce per-master RAG queries in /compare-masters with tradition-specific terms
Previously LLM might run ONE combined semantic query, causing the non-dominant
master to get fallback search URLs (fojin.app/search?q=...) instead of precise
text_id links.

Now the skill:
- Explicitly requires N separate queries for N masters (emphasized with ⚠️)
- Provides a query-rewriting table: each master's query uses its tradition's
  terminology (唯识/中观/禅宗/天台/华严/净土 terms)
- Example: user asks '因缘果' → xuanzang queries '因缘果 六因 四缘 五果 种子',
  kumarajiva queries '因缘所生法 空 中道 无自性 四句'

This ensures both masters get precise text_id citations, not degraded search URLs.
2026-04-05 09:43:31 +08:00
xianren 9873d0514d feat: add --brief flag to rag_query.py to reduce output verbosity
- New --brief flag for semantic/search subcommands outputs one-line-per-result
  (title + link + 80-char snippet) instead of full 500-char excerpts
- Reduces output from ~60 lines to ~7 lines per query (3 results)
- /compare-masters now uses --brief by default (multiple queries no longer
  flood the terminal with long excerpts)
- Full output (default) preserved for single-master /ask and debugging
2026-04-05 09:32:55 +08:00
xianren 16cbda8e50 fix: robust tool path resolution + precise selection feedback in /compare-masters
- Add PROJECT_ROOT discovery with 3 fallback paths (dev/manual/OpenClaw)
- Replace ${CLAUDE_SKILL_DIR}/tools/... with $PROJECT_ROOT/tools/...
  (CLAUDE_SKILL_DIR in subskills points to skill dir, not project root)
- Add graceful degradation when rag_query.py unreachable
- Output selection reasoning explicitly (e.g. 'xuanzang: 强关键词匹配(5项)
  + kumarajiva: 主题互补视角') instead of vague '主题映射'
2026-04-05 09:17:11 +08:00
xianren 6446903daf feat: smart master selection + expanded keywords (6→24 per master)
- /compare-masters now uses keyword matching from meta.json search_scope.keywords
- 3-tier selection: user-specified → keyword matching → topic fallback
- Expanded each master's keywords to 15-25 core concepts (avg 24)
- Document --masters manual override in README

Selection improvements verified:
- '遍行因' → xuanzang (5 matches)
- '明心见性' → huineng (3 matches)
- '空性/中观' → kumarajiva + huineng
- '念佛' → yinguang + ouyi + xuyun
2026-04-05 09:07:24 +08:00