docs-from-code
Skill6 starsChanged 50 days agoApache-2.0View on GitHub
从代码反推需求文档(L1 补写)的通用方法论 skill。任何项目里需要为已有代码补写需求文档时使用。提供 7 步操作流程、前后端代码阅读重点、归档使用规则、不确定信息处理、需求文档模板。项目特定约定(目录结构、版本制、命名规则)见该项目自己的项目级补丁 skill。触发词:"补写需求文档"、"从代码反推"、"L1 补写"、"反推 L1"。
2 other projects use a version of this.
Adopted by
Most recently taken up by
- vishnujchandran/.agentstheir own version, first seen Oct 20, 2026
- 00PrabalK00/claude-skillstheir own version, first seen Mar 16, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- 00PrabalK00/claude-skills★ 1same name
- vishnujchandran/.agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-reviewSkill
- ask-codexSkill
- closed-remediation-reviewSkill
- code-to-7layerSkill
- code-to-guideSkill
- codex-reviewSkill
- commit-changesSkill
- controlSkill
- deep-research-gateSkill
- design-previewSkill
- doc-html-styleSkill
- doc-layer-systemSkill
- git-worktreeSkill
- goal-charterSkill
- legacy-archaeologySkill
- lightweight-designSkill
- long-doc-governanceSkill
- one-by-oneSkill
- plan-goalSkill
- read-togetherSkill
- site-previewSkill
- task-control-docSkill
- test-case-designSkill
- test-execution-routerSkill
- test-standardsSkill
The file
Files
从代码反推需求文档(L1 补写)
项目特定约定(目录结构、版本制、命名规则)优先参考该项目自己的项目级补丁 skill(见
templates/项目级补丁模板/)。 本 skill 只提供通用方法论。
1. 操作流程
补写 <项目>/docs/01-需求/ 时,按以下顺序操作:
1. 确定模块边界
2. 从前端找:页面、入口、交互动作
3. 从后端找:接口、业务能力、规则与状态
4. 从枚举和模型补充:状态、类型、边界条件
5. 查看项目归档目录,与代码证据交叉核对;任一来源都不能自动取得裁决权
6. 用业务语言重写成需求文档
7. 最后清理:"是否写进了实现细节?"2. 代码阅读重点
前端
- 页面名称与层级、tab 与分包结构
- 服务调用名称、按钮文案
- 空状态 / 错误状态处理、页面跳转关系
后端
- Controller 对外能力
- 枚举体现的状态和值域
- Biz / Service 中的规则与限制
- 权限校验、状态流转、外部依赖
3. 归档使用规则
可以用归档补充:模块命名、业务意图、代码中不明显的边界规则
不能用归档:覆盖代码事实、把旧方案当成当前事实
4. 不确定信息处理
- 回到代码继续验证
- 用归档做交叉核对
- 仍无法确认 → 写入任务底稿的「待确认」清单,不得混入正式 L1
5. 需求文档推荐模板
代码只能反推候选业务语义。正式 L1 只保留裁决后的当前需求;来源、置信度、实现状态和“待确认”统一留在任务底稿。若意图仍未闭合,交付候选底稿而不是缩水版正式 L1。
每个模块的编号 README(例如 01-xx-00-README.md)或模块说明文档推荐章节:
0. 版本归属 / 适用版本
1. 模块目标
2. 用户价值
3. 页面与入口
4. 功能列表
5. 业务规则
6. 状态流转
7. 系统支撑能力
8. 异常与边界场景
9. 与其他模块的关系
10. 验收标准Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

