用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/polyipseity/information --skill pytextgen命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | pytextgen |
| description | Regenerate programmatically-generated content blocks in knowledge base notes using pytextgen. |
Continuous improvement: see
continuous_improvement.mdin this folder for documented lessons and evolving best practices.
Use this skill when working with pytextgen-powered content generation, including regenerating flashcards, clearing generated regions, managing caches, and debugging generation issues.
Agent note: the examples below describe how the
init generatetool works when a human runs it. Agents should not trigger this command on their own while editing notes—flashcard and other generated content are rebuilt automatically during normal build and packaging workflows.
pytextgen is a Python library (git submodule in scripts/pytextgen/) that generates content programmatically in Markdown files:
{@{ }@}, ::@::, :@:)Command: uv run -m init generate [pytextgen flags] <paths?>
The init.py wrapper:
.md files (excluding .git, .obsidian, tools)(mtime, inode, text) to skip unchanged files\n before passing to pytextgenCommon flags:
-C / --no-cached: Rebuild init.py cache from scratch--no-code-cache: Disable pytextgen compile cache (in __pycache__/)--init-flashcards: Initialize or re-seed flashcard state<paths>: Optional; limit regeneration to specific files/directoriesExample: uv run -m init generate -C --init-flashcards
Command: uv run -m init clear --type CONTENT <paths?>
Clears generated content blocks without regenerating. Useful for:
Other ClearType values (see scripts/pytextgen/io.py):
CONTENT: Clear generated text onlyUse templates in scripts/templates/ to create new pytextgen fences:
pytextgen generate flashcards.md: Flashcard section templatepytextgen generate code.md: Code block template# pytextgen generate module="path.to.module" function="function_name"
# pytextgen generate data="./relative/path/to/data.json" format="table"
Critical rules:
# pytextgen generate ... comment linereturn export_seq(...) signatures exactly<!--pytextgen generate section="unique-id" format="list"-->
Generated content appears here
<!--/pytextgen-->
Critical rules:
pytextgen recognises three distinct patterns that drive flashcard creation. Keep them exactly as shown and understand their semantics:
Cloze flashcards use {@{hidden text}@}. The text between the
delimiters is hidden during review and replaced with a blank that the user
must recall. Clozes may appear anywhere in a paragraph and multiple clozes
can coexist on a single line.
Two-sided cards use a single line with a separator ::@::. Example:
term ::@:: definition. Two cards are generated: one showing the left
side and asking for the right, and vice versa. The entire source must be
on one Markdown line; visual breaks are represented with <br/> or <p>.
One-sided cards use a single line with separator :@:. Only one card
is produced (recall right side from left). The same single-line rule
applies.
Editing guidance:
{@{ }@} and around the ::@:: or :@:
separators.(The earlier term "cloze markup" is retained only for historical reasons.)
Syntax errors in fence comments:
# pytextgen generate ... linesFence delimiters broken:
Cache issues:
-C / --no-cached to rebuild init.py cache--no-code-cache to bypass pytextgen compile cache__pycache__/ for stale compiled modulesCloze markup broken:
{@{ }@} pairs are balanced::@::, :@:) are not modified# Regenerate with fresh caches
uv run -m init generate -C --no-code-cache
# Clear and regenerate specific file
uv run -m init clear --type CONTENT path/to/file.md
uv run -m init generate path/to/file.md
# Check for syntax errors (manual inspection)
grep -n "# pytextgen generate" path/to/file.md
-C when unsure if cache is stale--init-flashcards when creating new flashcard-enabled notesgit submodule update --remote scripts/pytextgen)scripts/pytextgen/**, ask user for permission (it's a submodule)convert_wiki, use init generate to create flashcards from cloze markuptemplates section of tools/SKILL.md for fence templates