ワンクリックで
latex-modular
LaTeX 模块化组合技能。提取 LaTeX 文档头/组件(表格、图片、列表、章节样式)作为可组合模块,通过 Python 脚本稳定组合生成不报错的 lualatex 文档,支持从原始 LaTeX 代码重构进模块化体系。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
LaTeX 模块化组合技能。提取 LaTeX 文档头/组件(表格、图片、列表、章节样式)作为可组合模块,通过 Python 脚本稳定组合生成不报错的 lualatex 文档,支持从原始 LaTeX 代码重构进模块化体系。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
全平台统一发布工具。支持 skills 和 agents 的 Gitee/GitHub/ClawHub/SkillHub/PyPI 同步与 Release 创建,LLM 驱动的文件过滤与脱敏。
本地 RAG 系统搭建技能,支持环境检测修复、嵌入模型多源下载、5种切分策略 + GuardStack + 后处理 + 插件注册、多知识库管理 + 自动分类规则、可调 Prompt、Web 可视化配置 + 极客模式 + 模板管理
调用链编排技能 — 既是调用链编辑器,也是粗粒度规划器。理解用户意图 → 规划 Skill 参与顺序 → 更新/保存/推荐调用链 → 拼接为调用链(支持循环/分支编排、子步骤拓扑排序、准确步骤计数)。
Skill 标准化规范引擎。支持 R-01~R-26 规范审查(audit / create / update / refactor / bump / readonly 六模式),含权限扫描、数据目录合规检查、渐进式加载、LLM 二次筛分类。
结构化小说写作辅助技能。场景配置→大纲生成→因果链双重验证→pipeline 流程门禁→子结构先行规划→情绪混合系统→文风约束→人格驱动→分段写作→连通性补充→风格校验+逻辑检查(含实体状态+关系链)+大纲忠实度+结尾收束验证+实体关系追踪+角色别名识别+跨章行为摘要。全流程硬约束+门禁跟踪。
8种原子组件自由组合 + 3级约束, cell merging, two-level module system (base + composite), 7+ built-in templates, grid-aware visual editor, style presets, post-generation audit, user template save-as, Chinese error handling
| name | latex-modular |
| data_dir | ../.standardization/latex-modular/data |
| version | 1.3.0 |
| author | wUwproject |
| license | MIT |
| description | LaTeX 模块化组合技能。提取 LaTeX 文档头/组件(表格、图片、列表、章节样式)作为可组合模块,通过 Python 脚本稳定组合生成不报错的 lualatex 文档,支持从原始 LaTeX 代码重构进模块化体系。 |
| tags | ["latex","modular","template","luatex","xelatex","document-generation","refactor"] |
| trigger | ["latex-modular","latex 模块化","模块化模板","LaTeX 文档 模块化"] |
| trigger_negative | false |
| external_data_dir | false |
| sensitive_access | false |
| critical_write | false |
| permission_weight | LOW |
| h1_position | true |
| meta_field_sync | true |
| data_dir_compliance | true |
本技能的
.md文件禁止使用 Write/Edit 工具更新。 必须用scripts/下的 Python 脚本原子写入(tmp + os.replace())。
| 文件 | 更新方式 | 脚本 |
|---|---|---|
SKILL.md frontmatter | Python 原子写入 | scripts/update_frontmatter.py |
SKILL.md 正文 | Python 直接重建 | scripts/safe_write.py 的 safe_write() |
scripts/components/*.txt | Python 写入 | scripts/component_manager.py |
references/*.md | scripts/safe_write.py | 随技能自带 |
不触发:
📚 渐进式加载:本技能采用渐进式 MD 体系,
SKILL.md为入口(≤230行),详细内容拆分到references/*.md按需加载。
--template 按名加载、--save-as 保存自定义模板、--content 注入正文、--list-templates 等,内置 article/report 两种预设模板(scripts/template.py + scripts/templates/)scripts/component_inject.py)scripts/convert.py)| 文件 | 位置 | 说明 |
|---|---|---|
references/guide.md | 使用指南 | 完整使用指南(触发词、工作流程、输出格式) |
references/architecture.md | 架构说明 | 内部架构(组件分类、组合引擎、验证器) |
references/antipatterns.md | 反模式 | 常见 LaTeX 错误 + 正确做法 |
references/faq.md | FAQ | 常见问题解答(宏包冲突、字体问题、编译错误) |
references/changelog.md | 更新日志 | 版本更新记录 |
references/component-spec.md | 组件规范 | 命名、参数、依赖声明 |
| 脚本 | 功能 |
|---|---|
scripts/compose.py | 模块组合引擎,按依赖顺序组合组件 |
scripts/extract.py | 从 LaTeX 源文件提取组件 |
scripts/validate.py | 编译验证,调用 lualatex 并检查输出 |
scripts/refactor.py | 重构引擎,将原始 LaTeX 转为模块化结构 |
scripts/template.py | 模板库管理 |
scripts/component_manager.py | 组件库管理(增删改查) |
scripts/component_inject.py | 增量注入:向现有 .tex 插入组件 |
scripts/convert.py | 引擎转换:pdfLaTeX → LuaLaTeX |
scripts/workflow_router.py | 语义路由:分析用户输入 → 匹配流程线 |
scripts/write_guard.py | 写入守卫:扫描直接 open()/os.remove() 调用,强制使用 safe_write |
scripts/safe_write.py | 原子写入工具 + safe_delete() 安全删除 |
scripts/workflow_state.py | 流程守卫:步骤依赖检查 + 状态持久化 |
scripts/update_frontmatter.py | 更新 SKILL.md frontmatter |
--engine xelatex 切换,组件库完全兼容长篇 .tex 文件处理策略:
--lines START-END 参数限定处理行范围,避免加载全文--encoding 指定文件编码(默认 utf-8)本技能内置 4 条流程线 + 独立模式,通过语义路由器自动匹配用户意图。
用户输入
│
▼
语义路由器 (scripts/workflow_router.py)
├── 路由分析 → 匹配流程线或独立模式
├── 验证钩子 → 检查路由与输入语义的一致性
│ ├── 高置信度 + 无冲突 → 走匹配路线
│ └── 低置信度 + 有冲突 → 降级为独立模式
└── 文件大小钩子 → 检测源文件体积
├── >500KB → 建议 --lines 分块
└── >2MB → 强制 --lines,拒绝无参数执行
│
├── workflow 模式 → 严格步骤守卫 (workflow_state.py)
│ 每步执行前检查前置步骤是否完成,跳过则报错
│ 状态持久化在 .standardization/latex-modular/data/workflow_state/ 目录
│
└── standalone 模式 → 独立操作,无步骤约束
AI 自行决断,不设守卫
| 流程线 | 步骤链 | 强制备份 | 强制验证 | 报告 |
|---|---|---|---|---|
| Line 1 创建文档 | template → inject_params → compose → validate → report | ❌ | ✅ | ✅ |
| Line 2 改造 | backup → convert → branch → final_validate → report | ✅ 第一步 | ✅ | ✅ |
| Line 3 增量编辑 | backup → inject → final_validate → report | ✅ 第一步 | ✅ | ✅ |
| Line 4 组件复用 | extract → compose → template → reuse → final_validate → report | ❌ | ✅ | ✅ |
| 独立模式 | execute → final_validate → report | ❌ | 推荐 | ✅ |
| 大小 | 级别 | 行为 |
|---|---|---|
| <500KB | normal | 正常处理 |
| 500KB~2MB | large | 建议使用 --lines 限定范围 |
| >2MB | huge | 强制 --lines,拒绝无参数执行 |
scripts/workflow_router.py — 语义路由 + 验证钩子 + 文件大小钩子scripts/workflow_state.py — 流程守卫:步骤依赖检查 + 状态持久化scripts/workflow_report.py — 结构化报告生成(Markdown 表格)scripts/components/:
preamble/*.tex — 宏包引入、颜色定义、字体配置environments/*.tex — 自定义环境(mylist、mycolumns 等)commands/*.tex — 自定义命令(\timu、\seeref 等)styles/*.tex — 章节样式、目录样式、页眉页脚tables/*.tex — 表格样式模板graphics/*.tex — 图片插入模板scripts/components/manifest.jsonscripts/components/manifest.json 获取可用组件列表scripts/compose.py 按正确顺序组合:
scripts/components/
├── manifest.json # 组件索引
├── preamble/ # 导言区组件
│ ├── class-settings.txt
│ └── packages.txt
├── environments/ # 自定义环境
│ ├── mylist.txt
│ ├── mycolumns.txt
│ └── abstract-env.txt
├── commands/ # 自定义命令
│ ├── title-commands.txt
│ └── background.txt
├── styles/ # 样式配置
│ ├── section-style.txt
│ ├── toc-style.txt
│ └── header-footer.txt
├── tables/ # 表格模板
│ └── table-style.txt
└── graphics/ # 图片模板
└── figure-insert.txt
scripts/components/ 对应目录scripts/validate.py