Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/ryanzhao1011/workframenpx agentmods add skills/ryanzhao1011/workframe/code-to-docWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ryanzhao1011/workframe/code-to-doc)<a href="https://agentmods.dev/skills/ryanzhao1011/workframe/code-to-doc"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/code-to-doc/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ryanzhao1011/workframe/code-to-doc"><img src="https://agentmods.dev/badge/skills/ryanzhao1011/workframe/code-to-doc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00201 | $0.05959 |
| Opus 5.5 | $0.00080 | $0.02384 |
| Sonnet 5.5 | $0.00040 | $0.01192 |
| Haiku 4.5 | $0.00020 | $0.00596 |
Grade A, and why
code-to-doc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 21d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code to Doc Skill
前置依赖
调用本 skill 前需读 skill: document-norms §1(归属)/ §2(frontmatter,特别是 current-state 类)/ §5.3(current-state 正文 source path 行级 anchor 强约束)。
参考插件根 reference/module-architecture.md §4.1(current-state 双向闭环)/ §6.2(跨形态适配)。
定位
双向闭环的"代码 → 文档"半边。LLM 解析 code_paths 涉及的代码文件,输出结构化 current-state/,让 PM 不读代码也能理解架构、API、数据模型。
适用范围:
- 子模块已创建(
submodule.yaml存在)且code_paths已配置 - 代码可读(本仓 ∪ dev 已 paste 跨仓代码到 tmp 目录)
不适用:
- 子模块未创建 → 先调
module-init code_paths为空 → 先在submodule.yaml配置submodule.yaml里code_map_coverage: exempt→ 该子模块有意不设 code-map(纯文档档等裁量), 不要为它生成 current-state/;豁免理由写在该子模块 overview,module-close-check的检查 6 会跳过它并报一条 info- 仅刷新 frontmatter
updated→ 不需要本 skill - 写 PRD / 测试用例 →
prd-writer/test-case-design
输入
| 模式 | 输入 |
|---|---|
| 单子模块(推荐) | 二段式 <basic>/<sub> |
| 多子模块批量 | 数组 [<basic1>/<sub1>, <basic2>/<sub2>, ...] |
| stale 触发 | 读 .workframe/state/stale-modules.yaml,按列表处理 |
可选:dev_paste_path(代码在外部仓库时,dev 把跨仓代码导出到本地 tmp,本 skill 解析此路径)。
工作流
Step 1: 形态适配 + 路径解析
1.1 读项目配置
- 读
.workframe-config.json获取monorepo.workspaces(如有) - 读
project.config.json获取miniprogramRoot(如有) - 读
package.json推断框架(next / nuxt / nestjs / 等)
1.2 解析 code_paths 实际位置
按 tech_stack[].stack + 配置自动加正确根前缀:
| stack | 适配规则 |
|---|---|
wechat-miniprogram |
miniprogramRoot=miniprogram/ 时已包含前缀;./ 时需加 |
wechat-cloudfunction |
项目根直接(cloudfunctions/...) |
nextjs 单仓 |
项目根直接(app/... / pages/...) |
nextjs Monorepo |
检查 workspaces,如 apps/web/ 则补前缀 |
| 跨技术栈数组 | 按数组 path 字段逐条处理 |
报告:
解析 code_paths:
- miniprogram/pages/profile/edit/** → ./miniprogram/pages/profile/edit/ (12 个 .js + 3 个 .wxml)
- cloudfunctions/profile/get/** → ./cloudfunctions/profile/get/ (2 个 .js + 1 个 .json)
...
Step 2: 代码扫描
按 stack 类型采用不同解析策略:
| stack | 解析重点 |
|---|---|
wechat-miniprogram |
Page({}) / Component({}) 入口 + data / methods / lifetimes + usingComponents |
wechat-cloudfunction |
exports.main 入口 + event.action 路由 + cloud.database() 集合 |
nextjs (App Router) |
app/<route>/page.tsx / route.ts + Server Component 标记 + 中间件 |
nestjs |
@Controller / @Module / @Injectable 装饰器 + DTO + 数据库 entity |
express |
app.get/post/... 路由 + middleware + handler |
| 通用 | grep TODO / FIXME / HACK 标记 |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 21d ago Changed · +42 lines · +90 tokens per session scan B → A 2844aaba2be3
- 1mo ago First seen · 290 lines · 111 tokens per session scan B 5f025336f751
code-to-doc is a skill published in the GitHub repository ryanzhao1011/workframe (7 stars, last pushed 23d ago), licensed MIT. It adds 201 tokens to every session and 5,959 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
migration-review
A review workflow for database migration files, which change the structure or data rules of a database. It checks the requested migration files and the code needed to assess their compatibility.
ocr
AI-powered multi-agent code review. Simulates a team of Principal Engineers reviewing code from different perspectives. Use when asked to review code, check a PR, analyze changes, or perform code review.
OCR Review-to-Approval Loop
Drive a PR to an approved code review by looping OCR's multi-agent review and address steps. Runs /ocr:review then /ocr:address repeatedly until the review verdict is APPROVE, then one final /ocr:address for leftover suggestions, posting every review and every address round to the GitHub PR as comments. Use when the…
pr-triage
4-phase PR backlog management with audit, deep code review, validated comments, and optional worktree setup. Use when triaging pull requests, catching up on pending code reviews, or managing a backlog of open PRs. Args: 'all' to review all, PR numbers to focus (e.g. '42 57'), 'en'/'fr' for language, no arg = audit…
audit-agents-skills
Audit Claude Code agents, skills, and commands for quality and production readiness. Use when evaluating skill quality, checking production readiness scores, or comparing agents against best-practice templates.
review-pr
Perform a comprehensive code review of a pull request.