# Document Compiler

> 将多个章节和练习题汇编成完整教材，添加封面、目录、排版优化

- **Type:** Skill
- **Install:** `agentstack add skill-ghostricke9-studyagent-document-compiler`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Ghostricke9](https://agentstack.voostack.com/s/ghostricke9)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Ghostricke9](https://github.com/Ghostricke9)
- **Source:** https://github.com/Ghostricke9/StudyAgent/tree/main/skills/document-compiler

## Install

```sh
agentstack add skill-ghostricke9-studyagent-document-compiler
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

## 技能：汇编最终教材

### 何时使用
当你已经完成所有章节的编撰和练习题的生成，需要将它们组装成一本完整、排版精良的教学教材时，调用此技能。

### 子资源文件

本技能目录下附带辅助资源，可按需使用：

| 文件 | 用途 | 何时使用 |
|------|------|----------|
| `templates/cover.md` | 教材封面模板 | 组装教材时引用，生成统一的封面页 |
| `templates/style_guide.md` | 排版风格指南 | 统稿时参考，确保全书风格一致 |
| `scripts/word_counter.py` | 字数统计脚本 | 执行 `python {skill_dir}/scripts/word_counter.py ` 检查篇幅 |

### 汇编步骤

1. **统稿**：阅读所有已生成的章节，检查术语一致性
   - 同一概念在不同章节是否用了相同叫法
   - 示例代码的变量命名风格是否一致
   - 参考 `templates/style_guide.md` 中的规范

2. **生成封面**：为教材添加标准封面
   - 使用 `templates/cover.md` 中的模板
   - 填入主题名称、章节数、生成日期

3. **组装目录**：为整本教材生成目录
   - 列出所有章节标题和对应页码（可用 Markdown 锚点替代）

4. **编排顺序**：按以下顺序组装最终教材：
   ```
   封面 → 目录 → 学习路线图（如有）→ 第1章 → 练习题1
   → 第2章 → 练习题2 → ... → 附录/参考资料
   ```

5. **控制篇幅**：统稿后如果某章过长或过短，可以用 `scripts/word_counter.py` 检查并调整

### 输出格式

最终教材使用以下 Markdown 结构：

```markdown
# [教材名称]

> **编著**: StudyHelper Agent
> **日期**: YYYY-MM-DD
> **章节**: N章 | **配套练习**: N套

---

## 目录

1. [第1章: 标题](#第1章)
   - 练习题
2. [第2章: 标题](#第2章)
   - 练习题
...

---

## 第1章: [标题]

[正文内容]

---

## 练习题: [第1章名称]

[练习题内容]

---

## 第2章: [标题]

...
```

### 完成动作
汇编完成后，使用 `save_document` 将完整教材保存为 Markdown 文件。

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Ghostricke9](https://github.com/Ghostricke9)
- **Source:** [Ghostricke9/StudyAgent](https://github.com/Ghostricke9/StudyAgent)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ghostricke9-studyagent-document-compiler
- Seller: https://agentstack.voostack.com/s/ghostricke9
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
