npx skills add https://github.com/bang404/langdocx --skill langdocx此技能将工作区转变为一个专业的技术文档工厂。它提供了一个结构化的工作流程,用于生成海量的 PDF/DOCX 交付物,并“克隆”任意参考文档(如政府标准或企业模板)的视觉样式。
content.md 文件,以最大化吞吐量并保持各章节间细节的一致性。structure.json 开始,然后初始化文件夹,并系统地填充各个部分。当用户要求“编写长篇文档”时,使用此工作流程。
分析与设计:
初始化结构:
structure.json。structure.json 中使用语义化名称,不带排序前缀(例如,Project_Overview、,而不是 )。This skill transforms the workspace into a professional Technical Document Factory. It provides a structured workflow for generating massive PDF/DOCX deliverables and "cloning" the visual style of arbitrary reference documents (like government standards or corporate templates).
content.md files in parallel to maximize throughput and maintain consistent detail across chapters.structure.json, then initialize the folders, and systematically fill the sections.Use this workflow when the user asks to "write a long-form document".
Analyze & Design:
Initialize Structure :
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Technical_Framework01_Project_Overviewbun run scripts/init_structure.ts structure.json <target_dir>01_Project_Background/01_Industry_Trends/content.md)。起草与填充占位符:
init_structure.ts 在磁盘上添加可排序的前缀。content.md 应绝对不包含 # 标题。所有结构 100% 由文件夹层次结构驱动。content.md 文件中的所有 <!-- content placeholder --> 替换为详细的技术描述。bun run scripts/check_stats.ts --md <target_dir> 来监控预估的字符数和页数。合并、构建与验证:
bun run scripts/md2docx.ts all --pkg-root <dir> --name "Project Name" --author "Your Name"md2docx.ts 保留带前缀的文件夹以确保确定的遍历顺序,然后自动从最终标题中移除这些前缀。bun run scripts/check_stats.ts --docx output.docx <target_pages> 以验证输出是否符合页数要求。content.md,然后重新构建,直到验证通过。触发条件:当用户要求“转移样式”、“克隆格式”或“使其看起来像[参考文件]”时。目标:创建一个高保真度的克隆,保留页眉/页脚(协议 B),而不仅仅是应用字体(协议 A)。
处理算法:
准备:
unzip)。解压参考文件:
提取参考 DOCX:
unzip Reference.docx -d Reference_Extracted/
结构:
Reference_Extracted/
├── [Content_Types].xml
├── word/
├── document.xml ← 内容和段落样式引用
├── styles.xml ← 样式定义
└── ...
脚本化样式重构:
xml.etree.ElementTree 来操作 word/styles.xml。Heading1-Heading6、BodyText、FirstParagraph),同时保留原始的视觉属性(字体大小、缩进、间距)。document.xml 创建自定义的规范化脚本。如果不存在特定的首段样式,则 FirstParagraph 样式应与 BodyText 匹配。验证与打包:
styles.xml 包含所有 Pandoc 标准样式,且 w:styleId 和 w:name 正确。scripts/md2docx.ts 以验证生成的文档是否正确继承了页眉、页脚和样式。Pandoc 标准样式映射:
| Pandoc 样式 ID | 样式名称 | 用途 | Markdown 对应项 |
|---|---|---|---|
Heading1 | 标题 1 | 一级标题 | # 标题 |
Heading2 | 标题 2 | 二级标题 | ## 标题 |
Heading3 | 标题 3 | 三级标题 | ### 标题 |
Heading4 | 标题 4 | 四级标题 | #### 标题 |
Heading5 | 标题 5 | 五级标题 | ##### 标题 |
Heading6 | 标题 6 | 六级标题 | ###### 标题 |
BodyText | 正文 | 标准段落 | 段落 |
FirstParagraph | 首段 | 标题后的第一段 | (自动) |
TableGrid | 表格网格 | 表格样式 | ` |
Title | 标题 | 文档标题 | title: (YAML) |
scripts/init_structure.ts搭建项目文件夹脚手架。
structure.json(递归节点数组,名称不带数字前缀)01_、02_、...)和 content.md 文件。scripts/md2docx.ts ⭐ 统一工作流程工具完整的 Markdown 到 DOCX 流水线。
all、merge、convert。pandoc 和一个通过 --template 指定的参考文档。scripts/check_stats.ts ⭐ 统一分析工具文档统计与验证。
--md、--docx。每周安装数
1
代码仓库
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
structure.jsonstructure.json (e.g., Project_Overview, Technical_Framework, not 01_Project_Overview).bun run scripts/init_structure.ts structure.json <target_dir>01_Project_Background/01_Industry_Trends/content.md).Draft & Fill Placeholders:
init_structure.ts to add sortable prefixes on disk.content.md should contain absolutely no# headers. All structure is driven 100% by the folder hierarchy.<!-- content placeholder --> in the generated content.md files with detailed technical descriptions.bun run scripts/check_stats.ts --md <target_dir> frequently to monitor the estimated character and page counts during drafting.Merge, Build & Validate:
bun run scripts/md2docx.ts all --pkg-root <dir> --name "Project Name" --author "Your Name"md2docx.ts keeps prefixed folders for deterministic traversal order, then automatically removes those prefixes from final headings.bun run scripts/check_stats.ts --docx output.docx <target_pages> to verify if the output meets the page count requirement.content.md, and rebuild until validation passes.Trigger : When user asks to "transfer styles", "clone format", or "make it look like [Reference File]". Goal : Create a high-fidelity clone that preserves headers/footers (Protocol B) rather than just applying fonts (Protocol A).
Process Algorithm :
Preparation :
unzip).Unzip Reference :
Extract the reference DOCX:
unzip Reference.docx -d Reference_Extracted/
Structure:
Reference_Extracted/
├── [Content_Types].xml
├── word/
├── document.xml ← Content and paragraph style references
├── styles.xml ← Style definitions
└── ...
Scripted Style Refactor :
xml.etree.ElementTree to manipulate word/styles.xml.Heading1-Heading6, BodyText, FirstParagraph) while preserving original visual attributes (font size, indentation, spacing).document.xml of the reference file. The FirstParagraph style should match BodyText if no specific first-paragraph style exists.Validate & Pack:
styles.xml contains all Pandoc standard styles with correct w:styleId and w:name.scripts/md2docx.ts to verify the generated document correctly inherits headers, footers, and styles.Pandoc Standard Style Mapping :
| Pandoc Style ID | Style Name | Usage | Markdown Equivalent |
|---|---|---|---|
Heading1 | Heading 1 | Level 1 Header | # Title |
Heading2 | Heading 2 | Level 2 Header | ## Title |
Heading3 | Heading 3 | Level 3 Header | ### Title |
Heading4 | Heading 4 | Level 4 Header | #### Title |
Heading5 | Heading 5 | Level 5 Header | ##### Title |
Heading6 | Heading 6 | Level 6 Header | ###### Title |
BodyText | Body Text | Standard Paragraph | Paragraph |
FirstParagraph | First Paragraph | First para after header | (Automatic) |
TableGrid | Table Grid | Table style | ` |
Title | Title | Document Title | title: (YAML) |
scripts/init_structure.tsScaffolds the project folder.
structure.json (Recursive node array, names without numeric prefixes)01_, 02_, ...) and content.md files.scripts/md2docx.ts ⭐ UNIFIED WORKFLOW TOOLComplete Markdown to DOCX pipeline.
all, merge, convert.pandoc and a reference document via --template.scripts/check_stats.ts ⭐ UNIFIED ANALYSIS TOOLDocument statistics and validation.
--md, --docx.Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
30,000 周安装