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/paper_links.py
View on GitHub"""Repair only known generated paper links and empty accidental HTML-name notes."""
import datetime as dt
import re
import uuid
import zipfile
def repair(bank):
import local_bank as lb
root = bank.root.resolve()
changes, empty, papers = [], [], []
for note in (root / '试卷').glob('*/试卷.md'):
if not (note.parent / 'manifest.json').is_file():
continue
old = note.read_bytes()
text = old.decode('utf-8-sig')
if (note.parent / '打印稿/试卷.html').is_file():
text = text.replace('](试卷/历史打印稿/试卷.html)', '](打印稿/试卷.html)')
if '```tizhuang-paper' not in text:
text += '\n```tizhuang-paper\n```\n'
if text.encode('utf-8') != old:
changes.append((note, old, text.encode('utf-8')))
manifest = lb.read_json(note.parent / 'manifest.json')
papers.append((note, str(manifest.get('title') or note.parent.name).replace('|', '|')))
history = root / '试卷/历史打印稿'
if history.exists():
for note in history.iterdir():
if note.is_file() and re.fullmatch(r'试卷\.html(?: \d+)?\.md', note.name) and note.stat().st_size == 0:
empty.append(note)
if not changes and not empty:
return {'repaired': 0, 'archived_empty': 0}
folder = root / '.bank/paper-repair' / (dt.datetime.now().strftime('%Y%m%d-%H%M%S') + '-' + uuid.uuid4().hex[:6])
folder.mkdir(parents=True)
with zipfile.ZipFile(folder / 'backup.zip', 'w', zipfile.ZIP_DEFLATED) as z:
for path, old, _ in changes:
z.writestr(path.relative_to(root).as_posix(), old)
for path in empty:
z.writestr(path.relative_to(root).as_posix(), b'')
written, removed = [], []
try:
for path, old, new in changes:
if path.read_bytes() != old:
raise ValueError('试卷记录正在编辑,停止修复')
lb.atomic(path, new)
written.append((path, old, new))
for path in empty:
# Every path is resolved and verified inside the known history directory.
if path.resolve().parent != history.resolve() or path.read_bytes() != b'':
raise ValueError('历史笔记已改变,停止收起')
path.unlink()
removed.append(path)
except Exception:
for path in removed:
if not path.exists():
lb.atomic(path, b'')
for path, old, new in reversed(written):
if path.read_bytes() == new:
lb.atomic(path, old)
raise
return {'repaired': len(changes), 'archived_empty': len(empty), 'backup': str(folder / 'backup.zip')}
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 |