weishao2/tizhuang-agent-skills / skills/tizhuang-local-bank
tizhuang-local-bank
Verified老师的本地题库(Obsidian 兼容,不需要账号或插件):把 PDF 试卷还原成可编辑题目入库、下载题庄知识树并给题目分类、按教材/章节/考点/标签检索、核对后组卷并生成无答案 Word/打印稿与教师答案稿。用于“本地题库、Obsidian 题库、PDF 试卷入库、题目分类、找题、组卷、出 Word 试卷、导出题目包”。仅供教师备课打印,不做学生端。在线取题属于可选的旧 question-bank skill。Teacher-side local question bank: PDF import, knowledge-tree classification, search, paper assembly (DOCX/HTML).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.0 KB |
| agents/openai.yaml | config | 174 B |
| references/conversation-guide.md | markdown | 2.6 KB |
| references/family.md | markdown | 2.0 KB |
| references/install.md | markdown | 4.9 KB |
| references/paper-basket.md | markdown | 5.6 KB |
| references/pdf-import.md | markdown | 5.2 KB |
| references/question-contract.md | markdown | 4.2 KB |
| references/teacher-workspace.md | markdown | 6.2 KB |
| references/tree-and-textbook.md | markdown | 3.1 KB |
| scripts/auto_classify.py | script | 5.3 KB |
| scripts/doctor.py | script | 3.5 KB |
| scripts/docx_export.py | script | 11.0 KB |
| scripts/install_local_bank.py | script | 20.1 KB |
| scripts/local_bank.py | script | 58.0 KB |
| scripts/paper-print.css | other | 2.1 KB |
| scripts/paper_builder.py | script | 11.3 KB |
| scripts/paper_links.py | script | 2.7 KB |
| scripts/pdf_import.py | script | 23.2 KB |
| scripts/requirements.txt | manifest | 150 B |
| scripts/teacher_library.py | script | 15.9 KB |
| scripts/ui_layout.py | script | 7.4 KB |
| version.json | config | 52 B |
scripts/doctor.py
View on GitHub#!/usr/bin/env python3
"""Stdlib-only preflight for the local question bank. Safe to run before anything is installed.
Usage: python doctor.py [--vault <dir>]
Prints one JSON object: ok / checks / next_steps. Never modifies anything.
"""
import argparse
import importlib
import json
import os
import shlex
import subprocess
import sys
from pathlib import Path
REQUIRED = (("yaml", "PyYAML"), ("markdown", "Markdown"), ("latex2mathml", "latex2mathml"),
("pdfplumber", "pdfplumber"), ("pypdfium2", "pypdfium2"), ("PIL", "Pillow"),
("docx", "python-docx"), ("mathml2omml", "mathml2omml"))
def pip_command(python, requirements):
"""A command that survives paths with spaces (e.g. C:\\Program Files\\Python312) when pasted into a terminal."""
if os.name == "nt": # PowerShell needs the call operator before a quoted path
return f'& "{python}" -m pip install -r "{requirements}"'
return f"{shlex.quote(python)} -m pip install -r {shlex.quote(requirements)}"
def check(name, ok, detail="", fix=""):
return {"name": name, "ok": bool(ok), "detail": detail, "fix": "" if ok else fix}
def main():
parser = argparse.ArgumentParser(description="题庄本地题库环境体检(只读)")
parser.add_argument("--vault")
args = parser.parse_args()
here = Path(__file__).resolve().parent
checks = [check("Python 3.10+", sys.version_info >= (3, 10), sys.version.split()[0],
"安装 Python 3.10 或更新版本,并为本 skill 建立独立虚拟环境。")]
missing = []
for module, package in REQUIRED:
try:
importlib.import_module(module)
except ImportError:
missing.append(package)
checks.append(check("运行依赖", not missing, "齐全" if not missing else "缺少:" + "、".join(missing),
pip_command(sys.executable, str(here / "requirements.txt"))))
result = {"checks": checks, "python": sys.executable, "status": None}
if args.vault:
vault = Path(args.vault)
initialized = (vault / ".bank/config.json").is_file()
checks.append(check("题库目录", initialized, str(vault),
"题库尚未初始化:python local_bank.py --vault <目录> init;不要对已有的其他资料目录直接初始化。"))
if initialized and not missing:
run = subprocess.run([sys.executable, str(here / "local_bank.py"), "--vault", str(vault), "status"],
capture_output=True, text=True, encoding="utf-8", timeout=120)
try:
result["status"] = json.loads(run.stdout)
except ValueError:
result["status"] = {"ok": False, "error": (run.stderr or run.stdout)[-400:]}
status = result["status"]
if args.vault and status is not None and not status.get("ok"):
checks.append(check("题库读取", False, str(status.get("error", ""))[:300],
status.get("hint") or "题库无法读取:先确认目录正确,再运行 local_bank.py status 查看原因。"))
ok = all(c["ok"] for c in checks)
steps = [c["fix"] for c in checks if not c["ok"]]
if isinstance(result["status"], dict) and result["status"].get("ok"):
steps += result["status"]["result"].get("next_steps", [])
result.update(ok=ok, next_steps=steps)
sys.stdout.reconfigure(encoding="utf-8")
sys.stdout.write(json.dumps(result, ensure_ascii=False, indent=2) + "\n")
sys.exit(0 if ok else 1)
if __name__ == "__main__":
main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |