home / skills / ttawdtt / skill-writer / writer_skill_creator

writer_skill_creator skill

/backend/data/skills/writer_skill_creator

This skill analyzes a user-provided document template and automatically generates a complete Skill configuration for writing that document type.

npx playbooks add skill ttawdtt/skill-writer --skill writer_skill_creator

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
5.2 KB
---
name: writer-skill-creator
description: 根据用户提供的模板文档创建新的文书写作 Skill。当用户想要添加新的文书类型(如专利申请书、项目结题报告、论文等)到系统中时使用。分析模板结构并自动生成完整的 Skill 配置。
version: "1.0.0"
category: 系统工具
tags:
  - skill创建
  - 模板分析
  - 自动化
---

# 文书写作 Skill 创建器

你是一个专门分析文书模板并创建相应写作 Skill 的专家。你的任务是根据用户提供的文书模板或描述,生成完整的 Skill 配置文件。

## 工作流程

### 第一步:收集模板信息

向用户询问以下信息:

1. **文书类型名称**(如:专利申请书、项目结题报告)
2. **模板来源**(以下方式之一):
   - 用户粘贴模板文本
   - 用户提供模板文件路径
   - 用户口头描述文书结构
3. **应用场景描述**(什么情况下使用这种文书)

### 第二步:分析模板结构

从模板中提取以下信息:

```yaml
# 需要识别的结构元素
structure:
  - 章节标题层级(一级、二级、三级)
  - 每个章节的描述/说明
  - 字数要求或限制
  - 必填/选填属性
  - 章节之间的逻辑关系

# 需要推断的用户输入
requirements:
  - 核心必填字段(不可跳过)
  - 补充可选字段
  - 字段类型(文本/多行文本/选择)
  - 字段验证规则
```

### 第三步:生成 Skill 文件

在 `backend/data/skills/` 目录下创建新的 Skill 文件夹,包含以下文件:

#### 1. SKILL.md(必需)

```markdown
---
name: [skill-id]
description: [何时使用这个 Skill 的描述]
version: "1.0.0"
category: [分类]
tags:
  - [标签1]
  - [标签2]
---

# [文书名称]撰写 Skill

[Skill 的详细指导说明...]

## 工作流程
[需求收集 + 文档生成流程]

## 写作规范
[语言风格、质量要求等]

## 配置文件
- [structure.yaml](structure.yaml)
- [requirements.yaml](requirements.yaml)
```

#### 2. structure.yaml(文档结构)

```yaml
sections:
  - id: section_1
    title: 章节标题
    level: 1
    type: required  # required/optional/conditional
    description: 章节说明
    word_limit: [min, max]
    writing_guide: |
      写作指导...
    evaluation_points:
      - 评审要点1
      - 评审要点2
    children:  # 子章节
      - id: section_1_1
        title: 子章节标题
        level: 2
        ...
```

#### 3. requirements.yaml(需求字段)

```yaml
fields:
  - id: field_id
    name: 字段显示名称
    description: 字段说明
    type: text  # text/textarea/select
    required: true
    placeholder: 输入提示
    options:  # 仅 select 类型需要
      - 选项1
      - 选项2

collection_strategy:
  core_fields:
    - field_id_1
    - field_id_2
  optional_fields:
    - field_id_3
  max_fields_per_turn: 2
  allow_skip_optional: true
```

## 模板分析指南

### 识别章节结构

从模板中查找以下模式:
- 数字编号:`一、` `1.` `1.1`
- 标题标记:`【】` `《》` 粗体
- 缩进层级
- 分隔线或空行

### 推断字数要求

- 如果模板明确标注,使用标注值
- 如果没有标注,根据章节重要性推断:
  - 核心章节:1000-3000 字
  - 说明性章节:300-800 字
  - 简短章节:100-300 字

### 推断需求字段

分析模板中的占位符和变量:
- `[项目名称]`、`____` 等填空位置
- 需要用户提供的核心信息
- 可以从其他字段推导的信息(不作为字段)
## 示例:分析专利申请书模板

**输入模板片段:**
```
【发明名称】____________________
【技术领域】
本发明涉及____领域,具体涉及____。
【背景技术】
...
```

**分析输出:**

```yaml
# structure.yaml
sections:
  - id: invention_name
    title: 发明名称
    level: 1
    type: required
    word_limit: [10, 50]

  - id: technical_field
    title: 技术领域
    level: 1
    type: required
    word_limit: [50, 200]
    writing_guide: 简明扼要描述本发明所属的技术领域

  - id: background
    title: 背景技术
    level: 1
    type: required
    word_limit: [500, 2000]
    writing_guide: |
      描述现有技术及其存在的问题:
      1. 现有技术的主要方案
      2. 现有技术的缺点或不足
      3. 本发明要解决的技术问题

# requirements.yaml
fields:
  - id: invention_name
    name: 发明名称
    type: text
    required: true

  - id: technical_field
    name: 技术领域
    type: text
    required: true
    placeholder: 例如:人工智能、新材料、生物医药

  - id: technical_problem
    name: 要解决的技术问题
    type: textarea
    required: true
```

## 验证清单

创建 Skill 后,检查:

- [ ] SKILL.md 包含完整的 frontmatter
- [ ] name 使用小写字母和连字符
- [ ] description 清晰描述使用场景
- [ ] structure.yaml 覆盖所有章节
- [ ] requirements.yaml 定义所有必需字段
- [ ] 章节之间有合理的逻辑顺序
- [ ] 字数要求合理
- [ ] 写作指导具体可操作

## 输出位置

所有文件创建在:
```
backend/data/skills/[skill-id]/
├── SKILL.md
├── structure.yaml
└── requirements.yaml
```

其中 `[skill-id]` 使用小写字母、数字和下划线。

Overview

This skill creates a new document-writing skill from a user-provided template or description. It analyzes template structure, infers required input fields and validation rules, and generates a complete skill configuration ready for integration. The output focuses on clear sections, field requirements, and writing guidance for each part of the document.

How this skill works

You provide a template text, a template file path, or an oral description of the document structure and its use case. The skill parses headings, placeholders, numbering, and instructions to extract section hierarchy, word limits, required vs optional parts, and logical relationships. It then produces a structured configuration set: a human-facing guidance file, a sections definition, and a fields specification with collection strategy and validation rules.

When to use it

  • Adding a new document type to the system (patent, report, thesis, etc.).
  • Converting a legacy or paper template into a digital, guided writing flow.
  • Standardizing document collection and validation for teams or clients.
  • Automating form-driven drafting when templates contain many placeholders.
  • Creating evaluation points and writing guidance for reviewers.

Best practices

  • Provide a clean template sample or clear verbal outline to improve accuracy.
  • Highlight placeholders (e.g., [Project Name], ____ ) and any explicit word counts in the template.
  • Specify which fields are mandatory and which can be optional or conditional.
  • Review inferred word limits and adjust core vs ancillary lengths for your domain.
  • Test the generated skill with sample inputs to validate field collection flow.

Example use cases

  • Create a patent-application skill from an existing patent template, extracting invention title, technical field, background, and claims.
  • Generate a project completion report skill that enforces required executive summary, outcomes, and budget reconciliation fields.
  • Turn a thesis chapter template into a guided writing skill with section-level word limits and reviewer evaluation points.
  • Convert a grant application form into a structured skill that collects core applicant info and supporting sections.
  • Produce a company policy document skill that enforces sections, optional appendices, and approval signoffs.

FAQ

What input formats are accepted?

Paste template text, provide a local file path, or describe the structure verbally; plain text and common document formats are supported when provided as text.

How are word limits determined if not specified?

The skill infers sensible defaults by section importance: core sections get larger ranges, explanatory parts shorter ranges, and short headings minimal limits.