module-brief

Read a backend module's code and produce two module briefs: requirements.md (business-facing) and design.md (technical white-box, ending with 'Pitfalls and Guards'). Briefs are concise, re-generable, and fit-for-purpose, intended to provide requirement/design awareness, help onboard new engineers, or be invoked via /module-brief <module name>. Replace the spec baseline with module-spec-baseline.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "module-brief" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-553e00284bf55a9c1f1114fe95e73ca4af9324055cc233999c9f685a4e643d03. Verify the upstream source and version against https://skillhub.cn/skills/user_9e2ba202/module-brief before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Read a backend module's code and produce two module briefs: requirements.md (business-facing) and design.md (technical white-box, ending with 'Pitfalls and Guards'). Briefs are concise, re-generable, and fit-for-purpose, intended to provide requirement/design awareness, help onboard new engineers, or be invoked via /module-brief <module name>. Replace the spec baseline with module-spec-baseline.

0 Downloads

Introduction source: third_party · user_9e2ba202 · 1.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Translation pending; see source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: module-brief
description: 读一个后端模块的代码,产出两份给人看的**模块简报**——requirements.md(业务视角)+ design.md(技术白盒,末尾含「陷阱与护栏」)。简报扼要、可随时重生成、够用即止不深挖。用于为某模块产出需求/设计认知材料、帮新人快速上手一个模块,或显式 /module-brief <模块名> 调用。要机器可验、可演进的规范基线(openspec specs),改用 module-spec-baseline。

模块认知简报(module-brief)

读一个后端模块的代码,产出两份给人看的模块简报,帮开发者快速建立心智模型。简报的本分就是扼要:一气写完、可随时重生成、够用即止——不穷尽、不深挖。要可验证、可演进的规范,那是 spec 的活(见下「brief ≠ spec」)。

产物 视角 受众
docs/module-brief/<module>/requirements.md 业务(脱离实现) PM / 测试 / 业务新人
docs/module-brief/<module>/design.md 技术(白盒,允许类/方法/SQL/路径) 接手/维护本模块的开发者;末尾「陷阱与护栏」小节给改这块的人避坑

brief ≠ spec:本 Skill 产简报(给人速读、一次性、可读);穷举字段、全量状态机、跨层/跨模块接缝校验、完整性对账,简报一概不做(写 design 时的取舍清单见 references/design-format.md)。要机器可验、可演进的规范基线(openspec/specs/、过 validate --strict),用 module-spec-baseline;要 bug 清单,用 code-review。两者运行时独立、无读写依赖。

调用方式

/module-brief <module-name>

<module-name> 支持 kebab-case 或中文。

执行流程(单上下文,4 步)

Step 1:定位确认(定模块名 + 范围 + 输出目录)
Step 2:读模块、蒸馏认知、按格式写两份文档
Step 3:核对门(grep 自核 design.md 的代码标识,查无的标 [待确认])
Step 4:报告产出

全程单上下文、亲手通写,不外包给子 agent——读 + 写 + 核对都由当前上下文一气干完(真实环境有 Agent 工具,但这里刻意不用)。简报这点份量(读十几个文件 + 写两份文档 + 几条 rg 自核)单上下文绰绰有余;fan-out 起子 agent 只徒增范围/落点的传递损耗。不并行、不起验证 agent、不做跨模块接缝 join、不做完整性对账门;写完只做一道廉价 grep 自核(Step 3)兜幻觉,查无的标 [待确认],仅此而已。

Step 1:定位确认

  1. 输入归一化:kebab / 中文 / camelCase 都接受,归一为候选名(仅用于定位)。
  2. 存在性校验:Grep 候选名在后端源码 service/dao/controller 等包路径出现;未命中列相近模块名供选择。
  3. 范围预判(双侧):扁平分层 / 一包多模块时模块边界有歧义——给出建议前缀集合;若候选模块几乎无 Controller/Service 实现(疑似空脚手架),提示真实现可能散在调用方/上游、确认是否换定位或扩范围。用一次 AskUserQuestion 跟用户敲定模块名 + 纳入/排除范围(一次问完,不加回合)。模块有独立子包时范围即子包、可跳过。
  4. {{OUTPUT_DIR}} = {{PROJECT_ROOT}}/docs/module-brief/{{MODULE_NAME}}/。

简报原则:几句话定位完即进 Step 2,不写 module_aliases、不缓存技术栈。

Step 2:读模块、蒸馏、写两份文档

按以下约定,自己读模块代码、蒸馏认知、直接写出两份文档。

简报约定

  • 反幻觉:每条事实附代码证据(ClassName.method() / mapper.xml#id 等);给人看的文档更不能编造类名/方法/SQL——拿不准的标 [待确认],别凭直觉补。
  • 扫描卫生:Glob/Grep 排除 target/ build/ dist/ out/ node_modules/(编译副本会让计数翻倍、读到过期事实)。
  • 失败处理:任何阶段出错,报告单行 [错误] <阶段>:<原因>,由人确认重试/跳过。
  • 计划模式(交互):若 Write 不可用(plan mode),先 AskUserQuestion 问是否退出,同意则 ExitPlanMode 后继续。

1. 定位与栈识别(简报粒度)

  • 栈识别(认特征即可,不求穷尽):@SpringBootApplication→Spring Boot;pom.xml/build.gradle 含 mybatis-plus/mybatis/jpa→对应 ORM;@FeignClient→Feign、dubbo→Dubbo;*-domain/*-app 子模块→DDD 分层。识别用于读代码时认得入口注解。
  • 范围划界:{{MODULE_SCOPE}} 非空(扁平分层)时,按类名前缀圈定本模块文件——同目录里属他模块前缀的类不算本模块,别把它们的逻辑写进来。模块有独立子包时范围即子包。
  • 用 Glob 列出本模块的 Controller/Service/DAO(Mapper)/PO 文件清单(小模块全量、大模块按关键词定向)。
  • 对外入口:有些项目把对外查询/保存集中在共用网关 Controller(而非各模块自己的 Controller)——梳理对外入口时留意项目是否有这类网关(如 CLAUDE.md 所述的项目约定),否则会漏掉本模块的对外查询面。

2. 蒸馏认知(白盒视角,简报粒度——点到为止,不穷举)

  • 入口 / 分层:Controller/Service/DAO 怎么分层,关键类与职责。
  • 核心调用链(1–2 条):挑最主干的业务流程 Controller→Service→DAO 走一遍;有远程调用(Feign/HTTP)时点出降级吞错 / 重试幂等这类坑。
  • 数据模型骨架:核心实体 + 关系(可画极简 ER),不穷举每个字段;用 @TableLogic/逻辑删除位等只点关键约束。
  • 状态:点名全部状态字段,但只挑最核心的一个画 stateDiagram,其余一句话带过。取值以代码真 set 的为准,别照抄注释/枚举;存疑标 [待确认]。
  • 业务规则 / 术语 / 最狠的几条坑:边读边记,供两份文档分别取用。

3. 写两份文档 —— 写入 {{OUTPUT_DIR}}(Step 1 已定的绝对路径,直接用):

  1. {{OUTPUT_DIR}}/requirements.md —— 业务视角,禁代码标识。骨架与写作要点见 references/requirements-format.md。
  2. {{OUTPUT_DIR}}/design.md —— 技术白盒,允许标识,末尾含「陷阱与护栏」小节。骨架与写作要点见 references/design-format.md。

两份写完各自按对应格式文件的「自检」过一遍(requirements 无代码标识;design 节齐全、陷阱条目过"模块替换测试")。

Step 3:核对门(grep 自核 design.md 标识)

拦截 LLM 自信编造的类名/方法名/表名/列名——这类幻觉模型靠自觉标 [待确认] 防不住(模型自己监考自己),用一道廉价 grep 反查兜底。

只核 design.md;requirements.md 跳过(它本就禁代码标识、无可核之物)。

做法:

  1. 从 design.md 提取所有代码标识:CamelCase 类型名、含下划线的表名/视图名、xxx() 形式的方法名、反引号内的标识。
  2. 逐个用 rg 在本模块范围内核验。以下细节必须照做,否则会误报:
    • 大小写不敏感:用 rg -i —— SQL 的表名/列名常与代码里的大小写不一致。
    • 不止查内容、也查文件名:用 find <模块范围> -iname '*<标识>*' 兜一道 —— 形如 XxxMapper 的标识往往只作为 XxxMapper.xml 的文件名存在、内容里不出现。
    • 假阴性红旗:命中率异常(整批 0% 或离谱地低)时,先怀疑是命令写法把 rg 搞成全 MISS(多路径位置参数、-- 分隔、转义),换逐目录/逐标识写法重核——别据此判文档全错。
  3. 命中(内容或文件名任一)= 保留;查无 = 在 design.md 就地标 [待确认](不删,保留线索给人判断)。

项目无关:核的是"文档自己写下的标识 vs 仓库真相",不依赖任何技术栈假设,故任意栈通用。

Step 4:报告

报告两份文档路径 + 概况(模块栈、核心实体数、场景数、陷阱条数)。 追加核验统计:标识总数 / 命中数 / 标记 [待确认] 数 / 命中率;命中率作为该次产出的可信度指标。


共享约定与变量

变量 含义 来源
{{MODULE_NAME}} kebab-case 模块名(也是输出子目录名) Step 1 归一化 + 用户确认
{{MODULE_CN_NAME}} 中文模块名(两份文档 H1 标题) 用户输入或 Step 1 顺手推断(grep @Api(tags=) / JavaDoc 中文名;推断不出用 kebab 占位)
{{MODULE_SCOPE}} 扁平分层时的前缀范围+排除项 Step 1 与用户敲定;有独立子包时为空
{{PROJECT_ROOT}} 项目根目录 当前工作目录
{{OUTPUT_DIR}} 产出目录 {{PROJECT_ROOT}}/docs/module-brief/{{MODULE_NAME}}/

输出位置与产物

docs/module-brief/<module>/
├── requirements.md   # 业务视角(禁代码标识)
└── design.md         # 技术白盒(允许标识;末尾「陷阱与护栏」小节)

两份文档的骨架、抽象层次约束、写作要点:见 references/requirements-format.md 与 references/design-format.md。

Current listing version

1.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 为后端模块生成业务需求与技术设计简报,帮助新人快速上手,实用价值高
  • 产出 requirements.md 和 design.md 两份文档,分别面向业务和技术受众,分工明确
Trigger Precision90/100

Highlights

  • 触发方式清晰:/module-brief <模块名>,支持 kebab-case 和中文
  • 边界明确,不易与其他 Skill 混淆
Structure and Standards95/100

Areas to improve

  • description 写错位置 Reported severity: Minor

    顶层 frontmatter 有 description,但 skill_body 内部重复写 description,轻微错位

    Recommendation: 建议将详细 description 移至顶层 frontmatter,skill_body 内避免重复

Highlights

  • 执行流程清晰分为 4 步,每步有明确目标和出口条件
  • 包含完整的调用方式、产物说明、共享约定和变量定义
  • 文档结构完整,frontmatter 齐全
Execution Reliability90/100

Highlights

  • 包含输入归一化、存在性校验、用户确认等多重可靠性机制
  • 设计核对门(grep 自核)防止 LLM 幻觉,查无的标识标 [待确认]
  • 失败处理明确,计划模式有退出机制
  • 工具使用规范(rg -i、find -iname),参数正确
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.