mirror of
https://github.com/xr843/Master-skill.git
synced 2026-05-10 05:16:25 +00:00
Merge pull request #8 from xr843/fix/compare-meta-skill-lint
fix(lint): exempt meta-skills from lineage/source checks
This commit is contained in:
@@ -3,6 +3,7 @@ name: compare-masters
|
|||||||
description: Use when user asks to compare masters, compare schools, compare perspectives, 对比, 各宗怎么看, 不同宗派, 禅净之争, 性相之辩, 空有之争, or wants multiple masters to answer the same question. Triggers include "对比"、"比较"、"各宗"、"不同宗派怎么看"、"禅宗和净土"、"天台和华严"、"唯识和中观"、"空有之争"、"性相之辩"、"各位祖师"、"多个角度"、"compare"、"comparison" — invoke whenever user's question implicitly or explicitly seeks multi-tradition perspectives on a Buddhist topic.
|
description: Use when user asks to compare masters, compare schools, compare perspectives, 对比, 各宗怎么看, 不同宗派, 禅净之争, 性相之辩, 空有之争, or wants multiple masters to answer the same question. Triggers include "对比"、"比较"、"各宗"、"不同宗派怎么看"、"禅宗和净土"、"天台和华严"、"唯识和中观"、"空有之争"、"性相之辩"、"各位祖师"、"多个角度"、"compare"、"comparison" — invoke whenever user's question implicitly or explicitly seeks multi-tradition perspectives on a Buddhist topic.
|
||||||
version: 0.3.0
|
version: 0.3.0
|
||||||
license: MIT
|
license: MIT
|
||||||
|
kind: meta-skill
|
||||||
verified_by: xr843
|
verified_by: xr843
|
||||||
verified_at: 2026-04-06
|
verified_at: 2026-04-06
|
||||||
---
|
---
|
||||||
|
|||||||
+20
-13
@@ -24,6 +24,8 @@ PREBUILT_DIR = Path(__file__).resolve().parent.parent / "prebuilt"
|
|||||||
|
|
||||||
REQUIRED_FIELDS = {"name", "description"}
|
REQUIRED_FIELDS = {"name", "description"}
|
||||||
RECOMMENDED_FIELDS = {"version", "license", "lineage", "dates", "sources", "citation_format"}
|
RECOMMENDED_FIELDS = {"version", "license", "lineage", "dates", "sources", "citation_format"}
|
||||||
|
# Fields not applicable to meta-skills (aggregate/comparison skills with no single lineage)
|
||||||
|
META_SKILL_EXCLUDED = {"lineage", "dates", "sources", "citation_format"}
|
||||||
MAX_DESCRIPTION_CHARS = 500
|
MAX_DESCRIPTION_CHARS = 500
|
||||||
MAX_SKILL_LINES = 500
|
MAX_SKILL_LINES = 500
|
||||||
|
|
||||||
@@ -104,7 +106,10 @@ def lint_master(master_dir: Path, strict: bool = False) -> list[str]:
|
|||||||
issues.append(f"[ERROR] {name}: missing required field '{field}'")
|
issues.append(f"[ERROR] {name}: missing required field '{field}'")
|
||||||
|
|
||||||
# --- Recommended fields ---
|
# --- Recommended fields ---
|
||||||
|
kind = fm.get("kind", "master")
|
||||||
for field in RECOMMENDED_FIELDS:
|
for field in RECOMMENDED_FIELDS:
|
||||||
|
if kind == "meta-skill" and field in META_SKILL_EXCLUDED:
|
||||||
|
continue
|
||||||
if field not in fm:
|
if field not in fm:
|
||||||
issues.append(f"[WARN] {name}: missing recommended field '{field}'")
|
issues.append(f"[WARN] {name}: missing recommended field '{field}'")
|
||||||
|
|
||||||
@@ -126,21 +131,23 @@ def lint_master(master_dir: Path, strict: bool = False) -> list[str]:
|
|||||||
issues.append(f"[WARN] {name}: sources[{i}] missing 'title' or 'cbeta_id'")
|
issues.append(f"[WARN] {name}: sources[{i}] missing 'title' or 'cbeta_id'")
|
||||||
|
|
||||||
# --- Directory structure checks ---
|
# --- Directory structure checks ---
|
||||||
refs_dir = master_dir / "references"
|
# Meta-skills (e.g. compare-masters) borrow from other masters and have no own corpus
|
||||||
sources_dir = master_dir / "sources"
|
if kind != "meta-skill":
|
||||||
|
refs_dir = master_dir / "references"
|
||||||
|
sources_dir = master_dir / "sources"
|
||||||
|
|
||||||
if not refs_dir.exists():
|
if not refs_dir.exists():
|
||||||
issues.append(f"[WARN] {name}: missing references/ directory")
|
issues.append(f"[WARN] {name}: missing references/ directory")
|
||||||
else:
|
else:
|
||||||
if not (refs_dir / "voice.md").exists():
|
if not (refs_dir / "voice.md").exists():
|
||||||
issues.append(f"[WARN] {name}: missing references/voice.md")
|
issues.append(f"[WARN] {name}: missing references/voice.md")
|
||||||
if not (refs_dir / "teaching.md").exists():
|
if not (refs_dir / "teaching.md").exists():
|
||||||
issues.append(f"[WARN] {name}: missing references/teaching.md")
|
issues.append(f"[WARN] {name}: missing references/teaching.md")
|
||||||
|
|
||||||
if not sources_dir.exists():
|
if not sources_dir.exists():
|
||||||
issues.append(f"[WARN] {name}: missing sources/ directory")
|
issues.append(f"[WARN] {name}: missing sources/ directory")
|
||||||
elif not list(sources_dir.glob("*.md")):
|
elif not list(sources_dir.glob("*.md")):
|
||||||
issues.append(f"[WARN] {name}: sources/ directory is empty")
|
issues.append(f"[WARN] {name}: sources/ directory is empty")
|
||||||
|
|
||||||
# --- Check for tests ---
|
# --- Check for tests ---
|
||||||
tests_dir = master_dir / "tests"
|
tests_dir = master_dir / "tests"
|
||||||
|
|||||||
Reference in New Issue
Block a user