← 返回 Skills 市场
534422530

快速草稿

作者 534422530 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
25
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install laosi-quick-draft
功能描述
快速草稿 - 说几个要点自动生成结构化邮件/消息/周报草稿,内置多种模板(followup/thankyou/request/report)
使用说明 (SKILL.md)

Quick Draft - 快速草稿

激活词: 草稿 / 写邮件 / 写消息 / 生成

功能

  • 输入要点自动生成完整草稿
  • 多种模板:跟进 / 感谢 / 请求 / 周报 / 通知
  • 支持邮件和消息格式
  • 保存草稿历史

Python 实现

import os, json
from datetime import datetime

DRAFT_FILE = os.path.join(os.path.dirname(__file__), "quick_drafts.json")

class QuickDraft:
    TEMPLATES = {
        "followup": {
            "name": "跟进邮件",
            "format": "email",
            "subject": "关于 {topic} 的跟进",
            "body": "Hi {name},\
\
"
                    "关于 {topic} 的事情,想跟您确认一下进度。\
\
"
                    "方便的话请回复,谢谢!\
\
"
                    "Best,\
{sender}"
        },
        "thankyou": {
            "name": "感谢信",
            "format": "email",
            "subject": "感谢 {reason}",
            "body": "Hi {name},\
\
"
                    "非常感谢您 {reason}!这对我帮助很大。\
\
"
                    "期待后续继续合作。\
\
"
                    "Best,\
{sender}"
        },
        "request": {
            "name": "请求协助",
            "format": "email",
            "subject": "请求协助: {topic}",
            "body": "Hi {name},\
\
"
                    "想请您帮忙 {request}。\
\
"
                    "如果方便的话,请在 {deadline or '方便时'} 回复。\
\
"
                    "提前感谢!\
\
"
                    "Best,\
{sender}"
        },
        "weekly": {
            "name": "周报",
            "format": "report",
            "subject": "周报 {week_start} - {week_end}",
            "body": "# {name} 周报 ({week_start} - {week_end})\
\
"
                    "## 本周完成\
"
                    "{completed}\
\
"
                    "## 下周计划\
"
                    "{planned}\
\
"
                    "## 问题与风险\
"
                    "{risks}"
        },
        "meeting": {
            "name": "会议纪要",
            "format": "note",
            "body": "# 会议纪要 - {topic}\
\
"
                    "**时间**: {date}\
"
                    "**参与人**: {attendees}\
\
"
                    "## 讨论内容\
"
                    "{discussion}\
\
"
                    "## 行动项\
"
                    "{actions}"
        }
    }
    
    def __init__(self):
        os.makedirs(os.path.dirname(DRAFT_FILE), exist_ok=True)
        self.drafts = self._load()
    
    def _load(self):
        if os.path.exists(DRAFT_FILE):
            with open(DRAFT_FILE, encoding="utf-8") as f:
                return json.load(f)
        return []
    
    def _save(self):
        with open(DRAFT_FILE, "w", encoding="utf-8") as f:
            json.dump(self.drafts, f, ensure_ascii=False, indent=2)
    
    def generate(self, template_key: str, params: dict) -> dict:
        """根据模板生成草稿"""
        if template_key not in self.TEMPLATES:
            available = list(self.TEMPLATES.keys())
            return {"error": f"Unknown template '{template_key}'. Available: {', '.join(available)}"}
        
        tmpl = self.TEMPLATES[template_key]
        
        # 填充模板变量
        try:
            subject = tmpl.get("subject", "").format(**params) if "subject" in tmpl else None
            body = tmpl["body"].format(**params)
        except KeyError as e:
            return {"error": f"Missing parameter: {e}"}
        
        draft = {
            "id": len(self.drafts) + 1,
            "template": template_key,
            "format": tmpl["format"],
            "subject": subject,
            "body": body,
            "params": params,
            "created": datetime.now().isoformat(),
            "finalized": False
        }
        
        self.drafts.append(draft)
        self._save()
        return draft
    
    def list_recent(self, limit: int = 5) -> list:
        return [{"id": d["id"], "template": d["template"], "subject": d.get("subject"),
                 "created": d["created"], "finalized": d["finalized"]}
                for d in self.drafts[-limit:]]

# 使用示例
draft = QuickDraft()

# 生成跟进邮件
email = draft.generate("followup", {
    "name": "张三",
    "topic": "项目方案评审",
    "sender": "李四"
})
print(f"📧 {email['subject']}")
print(email['body'])

# 生成周报
report = draft.generate("weekly", {
    "name": "李四",
    "week_start": "2026-05-22",
    "week_end": "2026-05-28",
    "completed": "- FlashAttention 调研完成\
- 性能测试框架搭建",
    "planned": "- 集成测试\
- 文档撰写",
    "risks": "- 依赖库版本兼容性问题"
})
print(f"📋 {report['subject']}")
print(report['body'])

# 生成会议纪要
meeting = draft.generate("meeting", {
    "topic": "Q2 OKR Review",
    "date": "2026-05-28",
    "attendees": "全员",
    "discussion": "- KR1 完成 80%,预计下月交付\
- KR2 延期2周,需要协调资源",
    "actions": "- 张三: 补充KR2资源申请\
- 李四: 周五前更新排期"
})
print(f"📝 {meeting['subject'] if meeting.get('subject') else meeting['body'][:50]}")

可用模板

模板 适用场景 格式
followup 跟进客户/同事 邮件
thankyou 感谢信 邮件
request 请求资源/协助 邮件
weekly 周报 报告
meeting 会议纪要 笔记

命令行用法

# 生成跟进邮件
python -c "
from quick_draft import QuickDraft
d = QuickDraft().generate('followup', {'name': '王总', 'topic': '合同', 'sender': '我'})
print(d['subject'] + '\
---\
' + d['body'])
"

使用场景

  1. 跟进客户: 快速生成专业跟进邮件,不遗漏要点
  2. 感谢同事: 别人帮了忙,一键生成感谢信
  3. 每周周报: 填几个要点生成完整周报
  4. 会议纪要: 会后5分钟出纪要
  5. 日常沟通: 请假、通知、邀请等常用场景

依赖

  • Python 3.8+
  • 无第三方依赖
安全使用建议
Install only if you are comfortable with generated drafts and their input details being saved locally. Avoid using it for highly sensitive business, legal, medical, or personal content unless you know where the history file is stored and how to clear it.
能力评估
Purpose & Capability
The skill's templates, draft generation, and recent-draft listing are coherent with its stated email/message/report drafting purpose.
Instruction Scope
The activation words include broad phrases such as “生成,” which could trigger during ordinary Chinese-language drafting requests, but the artifact does not show automatic execution beyond user-directed draft creation.
Install Mechanism
The package contains only a markdown skill file, declares no third-party dependencies, and static scan metadata reports no suspicious patterns.
Credentials
The embedded Python uses local JSON file I/O for draft history and standard-library modules only, which is proportionate for a drafting/history feature.
Persistence & Privilege
Generated drafts and input parameters are saved to a local quick_drafts.json file; this is disclosed as draft history, but retention location and clearing controls are not fully explained.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install laosi-quick-draft
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /laosi-quick-draft 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Quick Draft v1.0.0 - Initial release with structured draft generation for emails, reports, and meeting notes. - Provides multiple built-in templates: followup, thank you, request, weekly report, and meeting summary. - Supports customizable input for automatic draft creation. - Saves draft history for future reference. - Usable via command line; requires only Python 3.8+, no third-party libraries.
元数据
Slug laosi-quick-draft
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

快速草稿 是什么?

快速草稿 - 说几个要点自动生成结构化邮件/消息/周报草稿,内置多种模板(followup/thankyou/request/report). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 25 次。

如何安装 快速草稿?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install laosi-quick-draft」即可一键安装,无需额外配置。

快速草稿 是免费的吗?

是的,快速草稿 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

快速草稿 支持哪些平台?

快速草稿 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 快速草稿?

由 534422530(@534422530)开发并维护,当前版本 v1.0.0。

💬 留言讨论