refactor(halcon): single-skill plugin layout → invoke as /halcon (not /halcon:halcon)
Move SKILL.md + references/ scripts/ evals/ from skills/halcon/ up to the plugin root. Per Claude Code plugins-reference, a plugin with SKILL.md at its root and no skills/ subdir is auto-loaded as a single-skill plugin (v2.1.142+), so the invocation name = frontmatter name = halcon → clean /halcon. Bump plugin.json 2.0.0 → 2.0.1 so existing installs receive the update. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Executable
+34
@@ -0,0 +1,34 @@
|
||||
"""Rebuild the bundled PDF table-of-contents index (references/pdf/_toc.json).
|
||||
|
||||
Self-contained: reads every PDF bundled under the skill's references/pdf/ and
|
||||
writes the multi-level TOC next to them. Run after adding/updating manuals.
|
||||
|
||||
/mnt/c/Users/NAURA/.local/bin/uv.exe run --no-project --with pymupdf \
|
||||
python .claude/skills/halcon/scripts/extract_toc.py
|
||||
"""
|
||||
import fitz, os, glob, json
|
||||
|
||||
# references/pdf/ relative to this script (scripts/ -> ../references/pdf)
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
PDF_DIR = os.path.normpath(os.path.join(HERE, "..", "references", "pdf"))
|
||||
OUT = os.path.join(PDF_DIR, "_toc.json")
|
||||
|
||||
out = {}
|
||||
for p in sorted(glob.glob(os.path.join(PDF_DIR, "*.pdf"))):
|
||||
name = os.path.basename(p)
|
||||
try:
|
||||
doc = fitz.open(p)
|
||||
out[name] = {"pages": doc.page_count, "toc": doc.get_toc()} # [level,title,page]
|
||||
doc.close()
|
||||
except Exception as e:
|
||||
out[name] = {"error": str(e)}
|
||||
|
||||
with open(OUT, "w", encoding="utf-8") as f:
|
||||
json.dump(out, f, ensure_ascii=False, indent=1)
|
||||
|
||||
for name, v in out.items():
|
||||
if "error" in v:
|
||||
print(f"{name}: ERROR {v['error']}")
|
||||
else:
|
||||
print(f"{name}: {v['pages']} pages, {len(v['toc'])} toc entries")
|
||||
print("wrote", OUT)
|
||||
Reference in New Issue
Block a user