awesome-requirements-writer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README-zh.md +149 -0
- package/README.md +145 -0
- package/SKILL.md +65 -0
- package/adapters/claude/.claude/skills/awesome-requirements-writer/SKILL.md +65 -0
- package/adapters/claude/.claude/skills/awesome-requirements-writer/references/automotive-context.md +59 -0
- package/adapters/claude/.claude/skills/awesome-requirements-writer/references/requirement-patterns-en.md +121 -0
- package/adapters/claude/.claude/skills/awesome-requirements-writer/references/requirement-patterns-zh.md +119 -0
- package/adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/RULE.mdc +50 -0
- package/adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/references/automotive-context.md +59 -0
- package/adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/references/requirement-patterns-en.md +121 -0
- package/adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/references/requirement-patterns-zh.md +119 -0
- package/adapters/codex/.agents/skills/awesome-requirements-writer/SKILL.md +65 -0
- package/adapters/codex/.agents/skills/awesome-requirements-writer/references/automotive-context.md +59 -0
- package/adapters/codex/.agents/skills/awesome-requirements-writer/references/requirement-patterns-en.md +121 -0
- package/adapters/codex/.agents/skills/awesome-requirements-writer/references/requirement-patterns-zh.md +119 -0
- package/adapters/cursor/.cursor/rules/awesome-requirements-writer.mdc +48 -0
- package/adapters/cursor/.cursor/rules/references/automotive-context.md +59 -0
- package/adapters/cursor/.cursor/rules/references/requirement-patterns-en.md +121 -0
- package/adapters/cursor/.cursor/rules/references/requirement-patterns-zh.md +119 -0
- package/adapters/gemini/.gemini/awesome-requirements-writer/references/automotive-context.md +59 -0
- package/adapters/gemini/.gemini/awesome-requirements-writer/references/requirement-patterns-en.md +121 -0
- package/adapters/gemini/.gemini/awesome-requirements-writer/references/requirement-patterns-zh.md +119 -0
- package/adapters/gemini/GEMINI.md +43 -0
- package/adapters/github-copilot/.github/copilot-instructions.md +22 -0
- package/adapters/github-copilot/.github/instructions/awesome-requirements-writer.instructions.md +36 -0
- package/adapters/github-copilot/.github/instructions/references/automotive-context.md +59 -0
- package/adapters/github-copilot/.github/instructions/references/requirement-patterns-en.md +121 -0
- package/adapters/github-copilot/.github/instructions/references/requirement-patterns-zh.md +119 -0
- package/adapters/opencode/.opencode/awesome-requirements-writer/references/automotive-context.md +59 -0
- package/adapters/opencode/.opencode/awesome-requirements-writer/references/requirement-patterns-en.md +121 -0
- package/adapters/opencode/.opencode/awesome-requirements-writer/references/requirement-patterns-zh.md +119 -0
- package/adapters/opencode/AGENTS.snippet.md +43 -0
- package/adapters/opencode/opencode.json +3 -0
- package/adapters/trae/.trae/project_rules.md +48 -0
- package/adapters/trae/.trae/references/automotive-context.md +59 -0
- package/adapters/trae/.trae/references/requirement-patterns-en.md +121 -0
- package/adapters/trae/.trae/references/requirement-patterns-zh.md +119 -0
- package/adapters/trae/.trae/rules/project_rules.md +48 -0
- package/adapters/trae/.trae/rules/references/automotive-context.md +59 -0
- package/adapters/trae/.trae/rules/references/requirement-patterns-en.md +121 -0
- package/adapters/trae/.trae/rules/references/requirement-patterns-zh.md +119 -0
- package/adapters/trae/README.md +12 -0
- package/bin/awesome-requirements-writer.js +353 -0
- package/package.json +44 -0
- package/references/automotive-context.md +59 -0
- package/references/requirement-patterns-en.md +121 -0
- package/references/requirement-patterns-zh.md +119 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mucheng
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README-zh.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Awesome Requirements Writer
|
|
2
|
+
|
|
3
|
+
作为一个具有十多年工作经验的汽车软件工程师和带领工程团队获得ASPICE认证的技术经理,我把多年来参与编写/评审技术产品需求的心得总结出来,写成了这个可复用的 AI agent skill,用于把工程笔记、客户输入、标准条款和测试期望转换为清晰、可测试的技术产品需求。
|
|
4
|
+
|
|
5
|
+
对于这个skill中提到的一些内容,我曾经写过一篇文章,具体请浏览:https://zhuanlan.zhihu.com/p/338598640
|
|
6
|
+
|
|
7
|
+
[English](./README.md) | 简体中文
|
|
8
|
+
|
|
9
|
+
## 聚焦的问题
|
|
10
|
+
|
|
11
|
+
对于初级工程师而言,撰写的技术需求总会遇到一些常见的问题,例如:
|
|
12
|
+
|
|
13
|
+
- 口语化工程笔记直接变成了模糊需求;
|
|
14
|
+
- 需求正文混入了原因解释、例子、图示或测试建议;
|
|
15
|
+
- 复合条件里的 `AND` / `OR` 逻辑不清楚;
|
|
16
|
+
- 一个需求 ID 同时覆盖多个行为或多个测试点;
|
|
17
|
+
- 静态数值直接写进需求,没有命名变量和变量表;
|
|
18
|
+
- 输入、输出、状态和验收标准不可测试;
|
|
19
|
+
- 中间级需求不能和上下级作出清晰关联等等。
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 解决方案
|
|
23
|
+
|
|
24
|
+
这个仓库把一个 `SKILL.md` 文件和中英文需求写作模板打包成可给 AI agent 调用的 skill,以解决工程师经验不足的问题。
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
| 原则 | 防止的问题 |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| **干净直接** | 原因解释或背景信息混进规范性需求正文 |
|
|
30
|
+
| **无歧义** | 主观词、隐藏假设、不明确的布尔逻辑 |
|
|
31
|
+
| **原子化** | 一个 ID 覆盖多个义务或条件 |
|
|
32
|
+
| **正向定义** | 通过否定相反条件来定义需求 |
|
|
33
|
+
| **没有魔法数字** | 硬编码数值缺少静态变量表 |
|
|
34
|
+
| **可直接测试** | 测试团队无法控制输入或观察输出 |
|
|
35
|
+
| **需求和信息分离** | 把需求、说明、上下文、例子和图混在一起 |
|
|
36
|
+
| **可追溯** | 需求缺少来源、测试、设计或验收链接 |
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## 安装
|
|
41
|
+
|
|
42
|
+
**方法一(推荐):**
|
|
43
|
+
直接告诉你的agent:安装awesome-requirements-writer。
|
|
44
|
+
|
|
45
|
+
**方法二:**
|
|
46
|
+
|
|
47
|
+
前置条件:先安装 Node.js 18 或更新版本。
|
|
48
|
+
|
|
49
|
+
Linux/macOS 可用 nvm 安装 Node.js LTS:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash && . "$HOME/.nvm/nvm.sh" && nvm install --lts
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
检查当前环境:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
node --version
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
确认node.js已安装后,运行:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx awesome-requirements-writer install
|
|
66
|
+
```
|
|
67
|
+
备注:
|
|
68
|
+
这个包也提供可选安装器 CLI,用于安装特定工具的 adapter。例如,若只想安装到 Codex 专用目录:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx awesome-requirements-writer install codex
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
查看支持的目标:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx awesome-requirements-writer list
|
|
78
|
+
```
|
|
79
|
+
ß
|
|
80
|
+
## 使用
|
|
81
|
+
|
|
82
|
+
显式调用 skill:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
Use $awesome-requirements-writer to turn these engineering notes into product requirements:
|
|
86
|
+
...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
这个 skill 会跟随用户语言输出。用户用中文输入时,默认输出中文需求,除非明确要求英文。
|
|
90
|
+
|
|
91
|
+
## 仓库结构
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
package.json
|
|
95
|
+
bin/awesome-requirements-writer.js
|
|
96
|
+
SKILL.md
|
|
97
|
+
references/
|
|
98
|
+
automotive-context.md
|
|
99
|
+
requirement-patterns-en.md
|
|
100
|
+
requirement-patterns-zh.md
|
|
101
|
+
adapters/
|
|
102
|
+
codex/
|
|
103
|
+
claude/
|
|
104
|
+
cursor/
|
|
105
|
+
gemini/
|
|
106
|
+
opencode/
|
|
107
|
+
codebuddy/
|
|
108
|
+
github-copilot/
|
|
109
|
+
trae/
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`SKILL.md` 是核心 agent 指令。`references/` 里的文件只在任务需要详细模板或汽车工程上下文时读取。
|
|
113
|
+
|
|
114
|
+
## 平台适配
|
|
115
|
+
|
|
116
|
+
| 目标平台 | Adapter 来源 | 安装目标 |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| 通用 Agent Skills | `adapters/codex/.agents/skills/awesome-requirements-writer/` | `~/.agents/skills/awesome-requirements-writer/` 或项目 `.agents/skills/awesome-requirements-writer/` |
|
|
119
|
+
| 仅 Codex | `adapters/codex/.agents/skills/awesome-requirements-writer/` | `~/.codex/skills/awesome-requirements-writer/` 或项目 `.codex/skills/awesome-requirements-writer/` |
|
|
120
|
+
| Claude Code | `adapters/claude/.claude/skills/awesome-requirements-writer/` | `.claude/skills/awesome-requirements-writer/` 或 `~/.claude/skills/awesome-requirements-writer/` |
|
|
121
|
+
| Cursor | `adapters/cursor/.cursor/rules/` | `.cursor/rules/`,包含 `references/` |
|
|
122
|
+
| Gemini CLI | `adapters/gemini/` | 合并到 `GEMINI.md`;把 references 复制到 `.gemini/awesome-requirements-writer/` |
|
|
123
|
+
| OpenCode | `adapters/opencode/` | 将 `AGENTS.snippet.md` 合并到 `AGENTS.md`;把 references 复制到 `.opencode/awesome-requirements-writer/` |
|
|
124
|
+
| CodeBuddy | `adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/` | `.codebuddy/rules/awesome-requirements-writer/`,包含 `RULE.mdc` 和 `references/` |
|
|
125
|
+
| GitHub Copilot | `adapters/github-copilot/.github/` | `.github/`,包含 `copilot-instructions.md`、`instructions/` 和 `instructions/references/` |
|
|
126
|
+
| Trae | `adapters/trae/.trae/` | Trae 项目规则路径,需确认当前版本使用 `.trae/project_rules.md` 还是 `.trae/rules/project_rules.md` |
|
|
127
|
+
|
|
128
|
+
规则型 adapter 现在也包含 `references/`,但入口文件会明确要求 agent 不要默认加载全部 reference,只在任务需要时读取对应语言模板或汽车工程上下文。对于 `AGENTS.md` 或 `GEMINI.md` 这类固定入口文件,应把提供的 snippet 合并进用户已有文件,而不是覆盖。
|
|
129
|
+
|
|
130
|
+
CLI 安装器会自动用带标记的文本块完成合并。重复运行安装器会更新同一个标记块,不会反复追加重复内容。
|
|
131
|
+
|
|
132
|
+
## 如何判断它在起作用
|
|
133
|
+
|
|
134
|
+
如果输出满足以下特征,说明 skill 正在发挥作用:
|
|
135
|
+
|
|
136
|
+
- 需求和解释性信息分开。
|
|
137
|
+
- 使用稳定 ID,例如 `SYS-001`、`SWE-001` 或 `HW-001`。
|
|
138
|
+
- 明确触发条件、状态、输入、输出和验收标准。
|
|
139
|
+
- 用命名静态变量替代未解释的数字。
|
|
140
|
+
- 复合条件中的 `AND` / `OR` 逻辑清晰。
|
|
141
|
+
- 对缺失工程值提出开放问题,而不是编造阈值。
|
|
142
|
+
|
|
143
|
+
## 个性化修改
|
|
144
|
+
|
|
145
|
+
用户可修改 `SKILL.md` 来调整核心行为,可在## Project-Specific Guidelines 一节中加入自己公司/团队的定制化规则。修改 `references/requirement-patterns-en.md` 和 `references/requirement-patterns-zh.md` 来调整语言相关的示例、模板和术语。
|
|
146
|
+
|
|
147
|
+
## 许可
|
|
148
|
+
|
|
149
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Awesome Requirements Writer
|
|
2
|
+
|
|
3
|
+
As an automotive software engineer with more than ten years of experience, and as a technical manager who has led engineering teams through ASPICE certification, I summarized what I have learned from years of writing and reviewing technical product requirements into this reusable AI agent skill. It helps turn engineering notes, customer inputs, standards, and test expectations into clear, testable technical product requirements.
|
|
4
|
+
|
|
5
|
+
Some of the ideas behind this skill are discussed in an article I wrote: https://zhuanlan.zhihu.com/p/338598640
|
|
6
|
+
|
|
7
|
+
English | [简体中文](./README-zh.md)
|
|
8
|
+
|
|
9
|
+
## Problems Addressed
|
|
10
|
+
|
|
11
|
+
Junior engineers often run into recurring problems when writing technical requirements, such as:
|
|
12
|
+
|
|
13
|
+
- Conversational engineering notes becoming vague requirements;
|
|
14
|
+
- Requirement text mixing normative behavior with rationale, examples, diagrams, or test advice;
|
|
15
|
+
- Compound conditions with unclear `AND` / `OR` logic;
|
|
16
|
+
- One requirement ID covering multiple behaviors or multiple test points;
|
|
17
|
+
- Static values written directly into requirements without named variables or a variable table;
|
|
18
|
+
- Inputs, outputs, states, and acceptance criteria that are not testable;
|
|
19
|
+
- Intermediate-level requirements that cannot be clearly linked to upper-level or lower-level requirements.
|
|
20
|
+
|
|
21
|
+
## Solution
|
|
22
|
+
|
|
23
|
+
This repository packages one `SKILL.md` file plus English and Chinese requirement-writing templates as an AI-agent skill to help compensate for gaps in requirement-writing experience.
|
|
24
|
+
|
|
25
|
+
| Principle | Prevents |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| **Clean and direct** | Rationale or background information leaking into normative requirement text |
|
|
28
|
+
| **Unambiguous** | Subjective wording, hidden assumptions, unclear Boolean logic |
|
|
29
|
+
| **Atomic** | One ID covering multiple obligations or conditions |
|
|
30
|
+
| **Positively defined** | Requirements defined by negating the opposite condition |
|
|
31
|
+
| **No magic numbers** | Hard-coded values without a static-variable table |
|
|
32
|
+
| **Directly testable** | Inputs or outputs that verification teams cannot control or observe |
|
|
33
|
+
| **Separate requirements from information** | Requirements, explanations, context, examples, and diagrams mixed together |
|
|
34
|
+
| **Traceable** | Requirements without source, test, design, or acceptance links |
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
**Method 1 (Recommended):**
|
|
39
|
+
Tell your agent directly: install `awesome-requirements-writer` skill.
|
|
40
|
+
|
|
41
|
+
**Method 2:**
|
|
42
|
+
|
|
43
|
+
Prerequisite: install Node.js 18 or newer.
|
|
44
|
+
|
|
45
|
+
Install Node.js LTS on Linux/macOS with nvm:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash && . "$HOME/.nvm/nvm.sh" && nvm install --lts
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Check your environment:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
node --version
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
After confirming Node.js is installed, run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx awesome-requirements-writer install
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Note:
|
|
64
|
+
This package also provides an optional installer CLI for target-specific adapters. For example, if you only want to install to the Codex-specific directory:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx awesome-requirements-writer install codex
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
List supported targets:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx awesome-requirements-writer list
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Use
|
|
77
|
+
|
|
78
|
+
Invoke the skill explicitly:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Use $awesome-requirements-writer to turn these engineering notes into product requirements:
|
|
82
|
+
...
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The skill follows the user's language. Chinese input produces Chinese requirements unless English is requested.
|
|
86
|
+
|
|
87
|
+
## Repository Layout
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
package.json
|
|
91
|
+
bin/awesome-requirements-writer.js
|
|
92
|
+
SKILL.md
|
|
93
|
+
references/
|
|
94
|
+
automotive-context.md
|
|
95
|
+
requirement-patterns-en.md
|
|
96
|
+
requirement-patterns-zh.md
|
|
97
|
+
adapters/
|
|
98
|
+
codex/
|
|
99
|
+
claude/
|
|
100
|
+
cursor/
|
|
101
|
+
gemini/
|
|
102
|
+
opencode/
|
|
103
|
+
codebuddy/
|
|
104
|
+
github-copilot/
|
|
105
|
+
trae/
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`SKILL.md` is the core agent instruction. The files in `references/` are loaded only when the task needs detailed templates or automotive engineering context.
|
|
109
|
+
|
|
110
|
+
## Adapters
|
|
111
|
+
|
|
112
|
+
| Target | Adapter source | Install target |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| Shared Agent Skills | `adapters/codex/.agents/skills/awesome-requirements-writer/` | `~/.agents/skills/awesome-requirements-writer/` or project `.agents/skills/awesome-requirements-writer/` |
|
|
115
|
+
| Codex-only | `adapters/codex/.agents/skills/awesome-requirements-writer/` | `~/.codex/skills/awesome-requirements-writer/` or project `.codex/skills/awesome-requirements-writer/` |
|
|
116
|
+
| Claude Code | `adapters/claude/.claude/skills/awesome-requirements-writer/` | `.claude/skills/awesome-requirements-writer/` or `~/.claude/skills/awesome-requirements-writer/` |
|
|
117
|
+
| Cursor | `adapters/cursor/.cursor/rules/` | `.cursor/rules/`, including `references/` |
|
|
118
|
+
| Gemini CLI | `adapters/gemini/` | Merge into `GEMINI.md`; copy references under `.gemini/awesome-requirements-writer/` |
|
|
119
|
+
| OpenCode | `adapters/opencode/` | Merge `AGENTS.snippet.md` into `AGENTS.md`; copy references under `.opencode/awesome-requirements-writer/` |
|
|
120
|
+
| CodeBuddy | `adapters/codebuddy/.codebuddy/rules/awesome-requirements-writer/` | `.codebuddy/rules/awesome-requirements-writer/`, including `RULE.mdc` and `references/` |
|
|
121
|
+
| GitHub Copilot | `adapters/github-copilot/.github/` | `.github/`, including `copilot-instructions.md`, `instructions/`, and `instructions/references/` |
|
|
122
|
+
| Trae | `adapters/trae/.trae/` | Trae project rules path, confirm whether your version uses `.trae/project_rules.md` or `.trae/rules/project_rules.md` |
|
|
123
|
+
|
|
124
|
+
Rule-style adapters include bundled `references/`, but their entry files explicitly tell the agent not to load every reference by default. The agent should read only the matching language or automotive-context reference when the task needs it. For fixed entry filenames such as `AGENTS.md` or `GEMINI.md`, merge the provided snippet into the user's existing file instead of overwriting it.
|
|
125
|
+
|
|
126
|
+
The CLI installer performs this merge automatically by using a marked block. Re-running the installer updates that block instead of appending duplicates.
|
|
127
|
+
|
|
128
|
+
## How to Know It's Working
|
|
129
|
+
|
|
130
|
+
The skill is working if the output has:
|
|
131
|
+
|
|
132
|
+
- Requirements separated from explanatory information.
|
|
133
|
+
- Stable IDs such as `SYS-001`, `SWE-001`, or `HW-001`.
|
|
134
|
+
- Explicit triggers, states, inputs, outputs, and acceptance criteria.
|
|
135
|
+
- Named static variables instead of unexplained numbers.
|
|
136
|
+
- Clear `AND` / `OR` logic for compound conditions.
|
|
137
|
+
- Open questions for missing engineering values instead of invented thresholds.
|
|
138
|
+
|
|
139
|
+
## Customization
|
|
140
|
+
|
|
141
|
+
Users can edit `SKILL.md` to adjust the core behavior, and can add company- or team-specific rules under a `## Project-Specific Guidelines` section. Edit `references/requirement-patterns-en.md` and `references/requirement-patterns-zh.md` to adjust language-specific examples, templates, and terminology.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: awesome-requirements-writer
|
|
3
|
+
description: Use when drafting, rewriting, reviewing, or decomposing technical product requirements for product systems, micro-processors, sensors, actuators, or functions, diagnostics, interfaces, or specifications, engineering change requests. Helps turn engineering know-how, notes, standards, customer notes and test expectations from conversational casual writing into clear, atomic, measurable, traceable,unambiguous requirements with acceptance criteria.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Awesome Requirements Writer
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Turn engineering intent into requirements that can be designed, reviewed, implemented, verified, and traced. Prefer precise requirements over broad product prose, and flag missing engineering inputs instead of inventing thresholds.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Requirement Principles
|
|
14
|
+
|
|
15
|
+
A strong requirement is:
|
|
16
|
+
|
|
17
|
+
- **Clean and direct:** include only necessary normative or definitional content in the requirement statement, no rationale content.
|
|
18
|
+
- **Unambiguous:** avoid subjective terms, vague modifiers, and implicit Boolean logic; use explicit `AND` / `OR` for compound conditions.
|
|
19
|
+
- **Atomic:** assign one requirement ID to one indivisible obligation, condition, or behavior.
|
|
20
|
+
- **Positively defined:** describe when the system shall perform the required behavior; avoid defining behavior by negating the opposite condition.
|
|
21
|
+
- **No magic numbers:** all static numbers shall be expressed by a static variable name with a table of all static variables with its real engineering value.
|
|
22
|
+
- **Directly testable:** make required inputs controllable and required outputs observable by the intended verification method.
|
|
23
|
+
- **Separate from information:** keep rationale, examples, diagrams, repeated context, and verification notes outside the normative requirement text.
|
|
24
|
+
- **Traceable:** link upward to source, system, safety, customer, regulatory, or design-constraint needs, and sideways or downward to test and design evidence.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
1. Identify the item under requirement: product system, subsystem, feature, variant, and lifecycle phase.
|
|
30
|
+
2. Extract stakeholder intent, system behavior, constraints, interfaces and validation expectations.
|
|
31
|
+
3. Determine if the content is "information" or "requirement". Information is the content which is rationale, examples, diagrams, repeated else-defined requirements, and verification notes outside the normative requirement text.
|
|
32
|
+
4. Classify requirements by type: functional (direct related to a specific feature or design), non-functional (performance, efficiency, expansion etc).
|
|
33
|
+
5. Draft atomic "shall" statements with a single subject, condition, behavior, measurable target, operating bounds, and verification path.
|
|
34
|
+
6. Add metadata: type(information/requirement), ID , content body and acceptance criteria.
|
|
35
|
+
7. List all functional requirements and related information in one chapter, while all non-functional requirements in another.
|
|
36
|
+
8. In a new chapter make a table of all static variables and its value. If no value is given, type TBD.
|
|
37
|
+
9. Audit the result for ambiguity, hidden design decisions, unverifiable claims, duplicate requirements, conflicting limits, missing fault behavior, and missing open questions.
|
|
38
|
+
|
|
39
|
+
## Requirement Shape
|
|
40
|
+
|
|
41
|
+
Use this format unless the user asks for another one:
|
|
42
|
+
|
|
43
|
+
for information:
|
|
44
|
+
- [Info] `<information body>`
|
|
45
|
+
|
|
46
|
+
for requirement:
|
|
47
|
+
- [Req `<ID>`] `<requirement body>` | `<acceptance criteria>`
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Output Rules
|
|
51
|
+
|
|
52
|
+
- Match the user's language. If the user writes in Chinese, draft requirements in Chinese unless they request English.
|
|
53
|
+
- If source notes are incomplete, produce the best draft plus a short "Open Questions" list.
|
|
54
|
+
- If multiple interpretations are plausible, state the assumption used.
|
|
55
|
+
- Generate output as a .md file.
|
|
56
|
+
|
|
57
|
+
## Project-Specific Guidelines
|
|
58
|
+
User can add their customized project-specific guidelines in this section.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## References
|
|
62
|
+
|
|
63
|
+
- Read `references/requirement-patterns-en.md` when drafting many requirements or converting informal engineering notes in English.
|
|
64
|
+
- Read `references/requirement-patterns-zh.md` when drafting many requirements or converting informal engineering notes in Chinese.
|
|
65
|
+
- Read `references/automotive-context.md` when the work involves automotive engineering.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: awesome-requirements-writer
|
|
3
|
+
description: Use when drafting, rewriting, reviewing, or decomposing technical product requirements for product systems, micro-processors, sensors, actuators, or functions, diagnostics, interfaces, or specifications, engineering change requests. Helps turn engineering know-how, notes, standards, customer nots and test expectations from conversational casual writing into clear, atomic, measurable, traceable,unambiguous requirements with acceptance criteria.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Awesome Requirements Writer
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Turn engineering intent into requirements that can be designed, reviewed, implemented, verified, and traced. Prefer precise requirements over broad product prose, and flag missing engineering inputs instead of inventing thresholds.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Requirement Principles
|
|
14
|
+
|
|
15
|
+
A strong requirement is:
|
|
16
|
+
|
|
17
|
+
- **Clean and direct:** include only necessary normative or definitional content in the requirement statement, no rationale content.
|
|
18
|
+
- **Unambiguous:** avoid subjective terms, vague modifiers, and implicit Boolean logic; use explicit `AND` / `OR` for compound conditions.
|
|
19
|
+
- **Atomic:** assign one requirement ID to one indivisible obligation, condition, or behavior.
|
|
20
|
+
- **Positively defined:** describe when the system shall perform the required behavior; avoid defining behavior by negating the opposite condition.
|
|
21
|
+
- **No magic numbers:** all static numbers shall be expressed by a static variable name with a table of all stactic variables with its real engineering value.
|
|
22
|
+
- **Directly testable:** make required inputs controllable and required outputs observable by the intended verification method.
|
|
23
|
+
- **Separate from information:** keep rationale, examples, diagrams, repeated context, and verification notes outside the normative requirement text.
|
|
24
|
+
- **Traceable:** link upward to source, system, safety, customer, regulatory, or design-constraint needs, and sideways or downward to test and design evidence.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
1. Identify the item under requirement: product system, subsystem, feature, variant, and lifecycle phase.
|
|
30
|
+
2. Extract stakeholder intent, system behavior, constraints, interfaces and validation expectations.
|
|
31
|
+
3. Determine if the content is "information" or "requirement". Information is the content which is rationale, examples, diagrams, repeated else-defined requirements, and verification notes outside the normative requirement text.
|
|
32
|
+
4. Classify requirements by type: functional (direct related to a specific feature or design), non-functional (performance, efficiency, expansion etc).
|
|
33
|
+
5. Draft atomic "shall" statements with a single subject, condition, behavior, measurable target, operating bounds, and verification path.
|
|
34
|
+
6. Add metadata: type(information/requirement), ID , content body and acceptance criteria.
|
|
35
|
+
7. List all functinal requirements and related information in one chapter, while all non-functional requirements in another.
|
|
36
|
+
8. In a new chapter make a table of all static variables and its value. If no value is given, type TBD.
|
|
37
|
+
9. Audit the result for ambiguity, hidden design decisions, unverifiable claims, duplicate requirements, conflicting limits, missing fault behavior, and missing open questions.
|
|
38
|
+
|
|
39
|
+
## Requirement Shape
|
|
40
|
+
|
|
41
|
+
Use this format unless the user asks for another one:
|
|
42
|
+
|
|
43
|
+
for information:
|
|
44
|
+
- [Info] `<information body>`
|
|
45
|
+
|
|
46
|
+
for requirement:
|
|
47
|
+
- [Req `<ID>`] `<requirement body>` | `<acceptance criteria>`
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## Output Rules
|
|
51
|
+
|
|
52
|
+
- Match the user's language. If the user writes in Chinese, draft requirements in Chinese unless they request English.
|
|
53
|
+
- If source notes are incomplete, produce the best draft plus a short "Open Questions" list.
|
|
54
|
+
- If multiple interpretations are plausible, state the assumption used.
|
|
55
|
+
- Generate output as a .md file.
|
|
56
|
+
|
|
57
|
+
## Project-Specific Guidelines
|
|
58
|
+
User can add their customized project-spicific guidelines in this section.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## References
|
|
62
|
+
|
|
63
|
+
- Read `references/requirement-patterns-en.md` when drafting many requirements or converting informal engineering notes in English.
|
|
64
|
+
- Read `references/requirement-patterns-zh.md` when drafting many requirements or converting informal engineering notes in Chinese.
|
|
65
|
+
- Read `references/automotive-context.md` when the work involves automotive engineering.
|
package/adapters/claude/.claude/skills/awesome-requirements-writer/references/automotive-context.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Automotive Context
|
|
2
|
+
|
|
3
|
+
Use this reference when requirements touch automotive engineering concerns beyond basic product wording.
|
|
4
|
+
|
|
5
|
+
## Common Requirement Categories
|
|
6
|
+
|
|
7
|
+
- Vehicle function behavior
|
|
8
|
+
- ECU or controller behavior
|
|
9
|
+
- Sensor and actuator behavior
|
|
10
|
+
- Signal and network interfaces
|
|
11
|
+
- Diagnostic and service behavior
|
|
12
|
+
- Safety-derived behavior
|
|
13
|
+
- Cybersecurity and access control
|
|
14
|
+
- Calibration and variant behavior
|
|
15
|
+
- Environmental, electrical, EMC, thermal, vibration, and durability constraints
|
|
16
|
+
- Manufacturing, end-of-line, service, and repair constraints
|
|
17
|
+
- Over-the-air update and software lifecycle behavior
|
|
18
|
+
- Regulatory, homologation, emissions, and market-specific constraints
|
|
19
|
+
|
|
20
|
+
## Safety and Cybersecurity Discipline
|
|
21
|
+
|
|
22
|
+
Do not infer formal classifications from general knowledge. If safety or cybersecurity is involved, ask for or preserve:
|
|
23
|
+
|
|
24
|
+
- Item definition and operational design context
|
|
25
|
+
- Hazard or threat source
|
|
26
|
+
- Safety goal, safety requirement, or security goal
|
|
27
|
+
- ASIL, QM, cybersecurity impact, or other classification supplied by responsible experts
|
|
28
|
+
- Safe state, degraded mode, driver warning, fallback, or diagnostic reaction
|
|
29
|
+
- Fault detection time, fault tolerant time interval, debounce, confirmation, and clearing criteria
|
|
30
|
+
- Trace to safety concept, cybersecurity concept, regulation, customer specification, or validation evidence
|
|
31
|
+
|
|
32
|
+
If the user asks for a safety or regulatory requirement without source material, draft a placeholder requirement and clearly mark the missing source and owner.
|
|
33
|
+
|
|
34
|
+
## Interfaces
|
|
35
|
+
|
|
36
|
+
For signal, network, API, or electrical interfaces, capture:
|
|
37
|
+
|
|
38
|
+
- Sender and receiver
|
|
39
|
+
- Message, signal, pin, connector, topic, or API name
|
|
40
|
+
- Data type, units, range, resolution, accuracy, scaling, default, invalid value, and initialization value
|
|
41
|
+
- Cycle time, latency, timeout, debounce, freshness, and synchronization behavior
|
|
42
|
+
- Behavior on missing, stale, implausible, or conflicting data
|
|
43
|
+
- Ownership of the interface definition and compatibility constraints
|
|
44
|
+
|
|
45
|
+
## Diagnostics
|
|
46
|
+
|
|
47
|
+
For diagnostic requirements, capture:
|
|
48
|
+
|
|
49
|
+
- Fault conditions
|
|
50
|
+
- Enable conditions
|
|
51
|
+
- Suppress conditions
|
|
52
|
+
- Detection threshold and debounce
|
|
53
|
+
- Fault reaction
|
|
54
|
+
- Diagnostic trouble code, status bit, event, or service record
|
|
55
|
+
- Driver or service notification
|
|
56
|
+
- Clearing and healing conditions
|
|
57
|
+
- Freeze-frame, snapshot, log, or service data
|
|
58
|
+
- Verification method and required evidence
|
|
59
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Requirement Patterns
|
|
2
|
+
|
|
3
|
+
Use these patterns to convert engineering notes into precise automotive requirements.
|
|
4
|
+
|
|
5
|
+
Write requirements in this form:
|
|
6
|
+
|
|
7
|
+
- "When `<trigger/condition>`, the `<system/item>` shall `<observable response>` within `<measurable limit>` under `<operating conditions>`."
|
|
8
|
+
- "While `<state>`, the `<system/item>` shall `<maintain/limit/prohibit behavior>`."
|
|
9
|
+
- "If `<fault or invalid input>` is detected, the `<system/item>` shall `<safe/diagnostic/degraded response>`."
|
|
10
|
+
- "Where `<variant/configuration>` is equipped, the `<system/item>` shall `<behavior>`."
|
|
11
|
+
|
|
12
|
+
## Core Patterns
|
|
13
|
+
|
|
14
|
+
Functional:
|
|
15
|
+
|
|
16
|
+
`When <trigger>, the <system> shall <response>.`
|
|
17
|
+
|
|
18
|
+
Performance:
|
|
19
|
+
|
|
20
|
+
`When <condition>, the <system> shall <response> within <limit> under <operating range>.`
|
|
21
|
+
|
|
22
|
+
State behavior:
|
|
23
|
+
|
|
24
|
+
`While <state>, the <system> shall <maintain/prohibit behavior>.`
|
|
25
|
+
|
|
26
|
+
Fault behavior:
|
|
27
|
+
|
|
28
|
+
`If <fault/invalid input/loss of communication> is present, the <system> shall <safe state/degraded mode/diagnostic response>.`
|
|
29
|
+
|
|
30
|
+
Interface:
|
|
31
|
+
|
|
32
|
+
`The <sender> shall transmit <signal/message> to <receiver> with <content, range, resolution, timing, timeout, and validity rules>.`
|
|
33
|
+
|
|
34
|
+
Diagnostic:
|
|
35
|
+
|
|
36
|
+
`If <fault condition> persists for <debounce criteria>, the <system> shall set <fault status> and <fault mitigation response>`
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## ID Pattern
|
|
40
|
+
|
|
41
|
+
Use stable, readable IDs:
|
|
42
|
+
|
|
43
|
+
- `SYS-001` for system functional behavior
|
|
44
|
+
- `SWE-001` for software behavior
|
|
45
|
+
- `HW-001` for hardware and mechanical requirements
|
|
46
|
+
|
|
47
|
+
information do not have IDs.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Do not renumber existing IDs unless the user asks. New requirements should append to the current sequence.
|
|
51
|
+
|
|
52
|
+
## Variable and Keywords Pattern
|
|
53
|
+
|
|
54
|
+
In all information and requirements,
|
|
55
|
+
- to express local variables/ process variables, use all lower case and italic letters, for example: "*lateral speed*".
|
|
56
|
+
- to express gobal variables/ calibrateable variables, use all uppercase letters and Bold, for example: "**TIMEOUT THRESHOLD**"
|
|
57
|
+
- The logic expressons "and, or, not, xor" shall be marked as "**AND**", "**OR**", "**NOT**", and "**XOR**", respectively.
|
|
58
|
+
- The keywords expresson "true, false,active, inactive, activated, deactivated, suppressed, enabled, disabled, valid, invalid" shall be marked all upper letters as "TRUE", "FALSE", "ACTIVE", "INACTIVE", "ACTIVATED", "DEACTIVATED", "SUPPRESSED", "ENABLED", "DISABLED", "VALID" and "INVALID" respectively.
|
|
59
|
+
- The signal name shall use italic with each first letter in a word in uppercase (unless the word is an acronym), for example: "*ACC Active State*" ,"*Steering Angle*"
|
|
60
|
+
|
|
61
|
+
## Rewrite Examples
|
|
62
|
+
|
|
63
|
+
### Example 1 (Clear and direct)
|
|
64
|
+
Weak:
|
|
65
|
+
|
|
66
|
+
"The signal *ACC Active State* shall always be set to DEACTIVATED if each of the following conditions are fulfilled:
|
|
67
|
+
|
|
68
|
+
- Camera Status is invalid, OR
|
|
69
|
+
- Radar Status is invalid. "
|
|
70
|
+
|
|
71
|
+
Better:
|
|
72
|
+
|
|
73
|
+
"The signal *ACC Active State* shall be set to DEACTIVATED if the following conditions are fulfilled:
|
|
74
|
+
|
|
75
|
+
- [Req-SWE-001]*Camera Status* is invalid, **OR**
|
|
76
|
+
- [Req-SWE-002]*Radar Status* is invalid. "
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Example 2 (Unambiguous)
|
|
80
|
+
|
|
81
|
+
Weak:
|
|
82
|
+
|
|
83
|
+
"The controller shall quickly detect low voltage."
|
|
84
|
+
|
|
85
|
+
Better:
|
|
86
|
+
|
|
87
|
+
"[Req-SWE-003]When the supply voltage is below THRESHOLD for DEBUNCE TIME, the controller shall detect an undervoltage condition and report the corresponding diagnostic status."
|
|
88
|
+
|
|
89
|
+
### Example 3 (Atomic)
|
|
90
|
+
|
|
91
|
+
Weak:
|
|
92
|
+
|
|
93
|
+
"[Req-SWE-004]The current steering torque shall be set to zero if steering torque sensor losts connection or estimated rackposition is invalid."
|
|
94
|
+
|
|
95
|
+
Better:
|
|
96
|
+
|
|
97
|
+
"The *current steering torque* shall be set to zero if the following conditions are fulfilled:
|
|
98
|
+
- [Req-SWE-004]Steering torque sensor lost communication fault occurred, **OR**
|
|
99
|
+
- [Req-SWE-005]*estimated rackposition* is INVALID."
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Example 4 (Positively defined)
|
|
103
|
+
|
|
104
|
+
Weak:
|
|
105
|
+
|
|
106
|
+
"The signal ACC Active State shall not be set to DEACTIVATED if the following conditions are fulfilled:
|
|
107
|
+
|
|
108
|
+
Camera Status is valid,OR
|
|
109
|
+
Radar Status is valid .
|
|
110
|
+
|
|
111
|
+
Better:
|
|
112
|
+
|
|
113
|
+
"The signal *ACC Active State* shall be set to DEACTIVATED if the following conditions are fulfilled:
|
|
114
|
+
|
|
115
|
+
- [Req-SWE-001]*Camera Status* is invalid, **OR**
|
|
116
|
+
- [Req-SWE-002]*Radar Status* is invalid. "
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
## Handling Missing Data
|
|
120
|
+
|
|
121
|
+
Use "TBD" as a placeholder in variable table when a required engineering value is missing. Keep placeholders visible in the requirement and repeat them in open questions.
|