HIMKUG

Draft To Opus — Security skill for Claude Code

Security community

草稿到作品 · Draft-to-Opus — mid-project AI draft audit & model-tiered refactoring skill for Claude Code.

How to install Draft To Opus

This entry records only its repository, not the path inside it, so there is no exact command to give. Open HIMKUG/draft-to-opus and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Draft To Opus does

草稿到作品 · Draft-to-Opus — mid-project AI draft audit & model-tiered refactoring skill for Claude Code.

Alternatives in Security

  • Google Workspace Model Armor — Filter user-generated content for safety 21.6k ★
  • Security Threat Model — Generate repo-specific threat models identifying trust boundaries 14.6k ★
  • Pal — Multi-model AI integration — chat, debugging, code review, planning, security audit 11.3k ★

README

草稿到作品 · Draft-to-Opus

把 AI 写了一半的项目,审成能交付的工程。

[![Skill](https://img.shields.io/badge/type-Claude%20Code%20Skill-4c2a6b)](https://docs.claude.com/en/docs/claude-code/skills) [![Workflow](https://img.shields.io/badge/workflow-3--stage%20bottom--up-27593a)](#-三阶自底向上涌现扫描) [![Report](https://img.shields.io/badge/report-progressive%20disclosure-945d1f)](#-阶段-2-editorial-html-报告) [![Safety](https://img.shields.io/badge/mode-read--only%20first-993730)](#-阶段-3-安全优先的模型分层执行) [![License](https://img.shields.io/badge/license-MIT-1e4e68)](LICENSE)

**Draft-to-Opus** 是一个面向「中期 AI 草稿项目」的审查与重构 Skill。它不重写你的业务, 而是在动任何一行代码之前,先用**自底向上的三阶扫描**把项目从散乱的补丁状态里读清楚, 产出一份低认知负荷的体检报告,再按**风险 × 收益**和**模型算力分层**安全地执行修复。

适用于:一个已经能跑、但结构开始失控的仓库 —— 重复的前端控件、越写越厚的 `utils`、 随手加的 `catch {}`、藏在循环里的 `O(n²)`、没人敢动的核心模块。


目录


为什么需要它

AI 生成代码的典型形态不是「全错」,而是**「局部都对、全局失控」**:

现象 表面 真实代价
每个页面各自手写一套按钮 能点、能跑 改一处样式要改八个文件,令牌体系形同虚设
核心模块被反复热补丁 需求都满足了 没人说得清它当前的不变量,改一行怕崩三处
includes() 写在循环里 数据量小时无感 上真实数据后从秒级退化到分钟级
空 catch {} 吞掉失败 日志很干净 故障以「偶发数据不对」的形式出现在线上
重试没有退避与预算 平时正常 下游抖动时被打穿,形成雪崩

这些问题的共同点是:**它们不会在单文件 review 里暴露**,必须跨文件、跨层地看。 Draft-to-Opus 就是为这个视角设计的 —— 从叶子证据出发,让宏观问题**自己浮现**, 而不是先套一个架构模板再去找证据。


核心设计原则

原则 含义 落地方式
证据优先 任何结论必须可定位 每条发现强制标注 file:line,禁止「大概在哪」
自底向上涌现 宏观问题从叶子证据聚合而来 Stage 1 收集 → Stage 2 聚类 → Stage 3 综合,不做冗余全仓扫