@oevery/rsp 1.1.0 → 1.2.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/README.md +24 -8
- package/README.zh-CN.md +24 -8
- package/dist/cli.mjs +56 -12
- package/package.json +1 -1
- package/rules/rsp-rules.md +3 -2
package/README.md
CHANGED
|
@@ -11,6 +11,15 @@ npx -y @oevery/rsp init
|
|
|
11
11
|
npx -y @oevery/rsp doctor
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
Recommended bootstrap flow:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx -y @oevery/rsp init --with-project-setup
|
|
18
|
+
# fill .rsp/features/project-setup.md
|
|
19
|
+
# fill .rsp/specs/design.md
|
|
20
|
+
npx -y @oevery/rsp doctor
|
|
21
|
+
```
|
|
22
|
+
|
|
14
23
|
## Core idea
|
|
15
24
|
|
|
16
25
|
- `rules/` stores durable constraints.
|
|
@@ -42,6 +51,8 @@ npx -y @oevery/rsp doctor
|
|
|
42
51
|
- `.rsp/archives/INDEX.md`: auto-generated. Rebuild with `rsp archive-index`.
|
|
43
52
|
- `.rsp/specs/design.md`: created by `rsp init`, then owned by the project.
|
|
44
53
|
- `.rsp/rules/project-rules.md`: optional; create only when the project has durable local rules.
|
|
54
|
+
- Keep durable architecture, boundaries, and cross-cutting technical constraints in `.rsp/specs/design.md`.
|
|
55
|
+
- Keep stable workflow rules, validation expectations, and local operating constraints in `.rsp/rules/project-rules.md`.
|
|
45
56
|
|
|
46
57
|
## AGENTS integration
|
|
47
58
|
|
|
@@ -72,9 +83,11 @@ Use `skills/rsp/SKILL.md` for step-by-step setup, workflow, and auditing guidanc
|
|
|
72
83
|
Example optional installation flow:
|
|
73
84
|
|
|
74
85
|
```bash
|
|
75
|
-
npx skills add
|
|
86
|
+
npx skills add oevery/rsp --skill rsp
|
|
76
87
|
```
|
|
77
88
|
|
|
89
|
+
This repository publishes a skill named `rsp` under `skills/rsp/`.
|
|
90
|
+
|
|
78
91
|
Then load the installed RSP skill only when you are adopting RSP, auditing setup, or reorganizing project-level rules/specs.
|
|
79
92
|
|
|
80
93
|
## Recommended workflow
|
|
@@ -82,10 +95,11 @@ Then load the installed RSP skill only when you are adopting RSP, auditing setup
|
|
|
82
95
|
New project:
|
|
83
96
|
|
|
84
97
|
1. `npx -y @oevery/rsp init`
|
|
85
|
-
2.
|
|
86
|
-
3.
|
|
87
|
-
4. Use `rsp add
|
|
88
|
-
5.
|
|
98
|
+
2. Prefer `npx -y @oevery/rsp init --with-project-setup`, or run `rsp new project-setup` manually
|
|
99
|
+
3. Fill `.rsp/specs/design.md`
|
|
100
|
+
4. Use `rsp add spec <name>` only when a new durable project doc is needed
|
|
101
|
+
5. Use `rsp add rules project-rules` only when the project has stable local rules
|
|
102
|
+
6. Start work with `rsp new <name>`
|
|
89
103
|
|
|
90
104
|
Existing project with a rich `AGENTS.md`:
|
|
91
105
|
|
|
@@ -96,15 +110,17 @@ Existing project with a rich `AGENTS.md`:
|
|
|
96
110
|
|
|
97
111
|
AI-assisted setup:
|
|
98
112
|
|
|
99
|
-
1. `npx -y @oevery/rsp init --agents-mode print`
|
|
113
|
+
1. `npx -y @oevery/rsp init --agents-mode print --with-project-setup`
|
|
100
114
|
2. Let the AI adapt the managed block in `AGENTS.md`
|
|
101
|
-
3. Have the AI fill `.rsp/
|
|
102
|
-
4.
|
|
115
|
+
3. Have the AI review and fill `.rsp/features/project-setup.md`
|
|
116
|
+
4. Have the AI fill `.rsp/specs/design.md`
|
|
117
|
+
5. Run `rsp doctor`
|
|
103
118
|
|
|
104
119
|
## CLI
|
|
105
120
|
|
|
106
121
|
```text
|
|
107
122
|
rsp init --agents-mode <mode> Scaffold .rsp/ + AGENTS.md
|
|
123
|
+
rsp init --with-project-setup Also create .rsp/features/project-setup.md
|
|
108
124
|
rsp add rules <name> Create .rsp/rules/<name>.md
|
|
109
125
|
rsp add spec <name> Create .rsp/specs/<name>.md and rebuild specs index
|
|
110
126
|
rsp new <name> [summary] Create .rsp/features/<name>.md
|
package/README.zh-CN.md
CHANGED
|
@@ -11,6 +11,15 @@ npx -y @oevery/rsp init
|
|
|
11
11
|
npx -y @oevery/rsp doctor
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
推荐启动流程:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx -y @oevery/rsp init --with-project-setup
|
|
18
|
+
# 填写 .rsp/features/project-setup.md
|
|
19
|
+
# 填写 .rsp/specs/design.md
|
|
20
|
+
npx -y @oevery/rsp doctor
|
|
21
|
+
```
|
|
22
|
+
|
|
14
23
|
## 核心概念
|
|
15
24
|
|
|
16
25
|
- `rules/` 存放长期稳定的约束。
|
|
@@ -42,6 +51,8 @@ npx -y @oevery/rsp doctor
|
|
|
42
51
|
- `.rsp/archives/INDEX.md`:自动生成,使用 `rsp archive-index` 重建。
|
|
43
52
|
- `.rsp/specs/design.md`:由 `rsp init` 创建,之后由项目维护。
|
|
44
53
|
- `.rsp/rules/project-rules.md`:可选,仅在项目确有长期本地规则时创建。
|
|
54
|
+
- 将长期架构、边界和跨模块技术约束放在 `.rsp/specs/design.md`。
|
|
55
|
+
- 将稳定的工作流规则、验证要求和本地运行约束放在 `.rsp/rules/project-rules.md`。
|
|
45
56
|
|
|
46
57
|
## AGENTS 接入
|
|
47
58
|
|
|
@@ -72,9 +83,11 @@ Read in order:
|
|
|
72
83
|
可选安装示例:
|
|
73
84
|
|
|
74
85
|
```bash
|
|
75
|
-
npx skills add
|
|
86
|
+
npx skills add oevery/rsp --skill rsp
|
|
76
87
|
```
|
|
77
88
|
|
|
89
|
+
这个仓库发布的 skill 名称是 `rsp`,位于 `skills/rsp/`。
|
|
90
|
+
|
|
78
91
|
然后只在接入 RSP、审计设置或整理项目级 rules/specs 时加载这个 skill。
|
|
79
92
|
|
|
80
93
|
## 推荐工作流
|
|
@@ -82,10 +95,11 @@ npx skills add @oevery/rsp
|
|
|
82
95
|
新项目:
|
|
83
96
|
|
|
84
97
|
1. `npx -y @oevery/rsp init`
|
|
85
|
-
2.
|
|
86
|
-
3.
|
|
87
|
-
4.
|
|
88
|
-
5.
|
|
98
|
+
2. 优先使用 `npx -y @oevery/rsp init --with-project-setup`,或手动执行 `rsp new project-setup`
|
|
99
|
+
3. 填写 `.rsp/specs/design.md`
|
|
100
|
+
4. 只有在需要长期项目文档时才用 `rsp add spec <name>`
|
|
101
|
+
5. 只有在存在稳定本地规则时才用 `rsp add rules project-rules`
|
|
102
|
+
6. 使用 `rsp new <name>` 开始工作
|
|
89
103
|
|
|
90
104
|
已有复杂 `AGENTS.md` 的项目:
|
|
91
105
|
|
|
@@ -96,15 +110,17 @@ npx skills add @oevery/rsp
|
|
|
96
110
|
|
|
97
111
|
AI 协助接入:
|
|
98
112
|
|
|
99
|
-
1. `npx -y @oevery/rsp init --agents-mode print`
|
|
113
|
+
1. `npx -y @oevery/rsp init --agents-mode print --with-project-setup`
|
|
100
114
|
2. 让 AI 处理 `AGENTS.md` 的受管块
|
|
101
|
-
3. 让 AI
|
|
102
|
-
4.
|
|
115
|
+
3. 让 AI 审阅并填写 `.rsp/features/project-setup.md`
|
|
116
|
+
4. 让 AI 填写 `.rsp/specs/design.md`
|
|
117
|
+
5. 运行 `rsp doctor`
|
|
103
118
|
|
|
104
119
|
## CLI
|
|
105
120
|
|
|
106
121
|
```text
|
|
107
122
|
rsp init --agents-mode <mode> 搭建 .rsp/ + AGENTS.md
|
|
123
|
+
rsp init --with-project-setup 同时创建 .rsp/features/project-setup.md
|
|
108
124
|
rsp add rules <name> 创建 .rsp/rules/<name>.md
|
|
109
125
|
rsp add spec <name> 创建 .rsp/specs/<name>.md 并重建 specs 索引
|
|
110
126
|
rsp new <name> [summary] 创建 .rsp/features/<name>.md
|
package/dist/cli.mjs
CHANGED
|
@@ -112,17 +112,51 @@ function featureNameFromPath(featuresDir, filePath) {
|
|
|
112
112
|
return rel.replace(/\.md$/, "");
|
|
113
113
|
}
|
|
114
114
|
function generateFeatureContent(name, summary = "") {
|
|
115
|
+
if (name === "project-setup") {
|
|
116
|
+
return `---
|
|
117
|
+
status: draft
|
|
118
|
+
priority: medium
|
|
119
|
+
tags:
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
# Feature: project-setup
|
|
123
|
+
|
|
124
|
+
## Spec
|
|
125
|
+
- Summary: ${summary || "Capture the project model, boundaries, and stable local constraints"}
|
|
126
|
+
- Requirements:
|
|
127
|
+
- Project purpose, scope, and structure are reflected in .rsp/specs/design.md
|
|
128
|
+
- Stable validation or workflow constraints are reflected in .rsp/rules/project-rules.md when needed
|
|
129
|
+
- Constraints:
|
|
130
|
+
- Avoid duplicating durable project facts across feature notes, specs, and rules
|
|
131
|
+
|
|
132
|
+
## Plan
|
|
133
|
+
- [ ] Review the repository structure, entrypoints, and primary outputs
|
|
134
|
+
- [ ] Fill .rsp/specs/design.md with durable architecture facts
|
|
135
|
+
- [ ] Add .rsp/rules/project-rules.md if stable local rules or validation steps exist
|
|
136
|
+
|
|
137
|
+
## Tests
|
|
138
|
+
- [ ] Run rsp doctor
|
|
139
|
+
- [ ] Run project-native validation if available
|
|
140
|
+
|
|
141
|
+
## Notes (optional)
|
|
142
|
+
- <facts discovered during project setup>
|
|
143
|
+
|
|
144
|
+
## Blockers
|
|
145
|
+
-
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
115
148
|
return `---
|
|
116
149
|
status: draft
|
|
117
150
|
priority: medium
|
|
118
151
|
tags:
|
|
119
152
|
---
|
|
153
|
+
|
|
120
154
|
# Feature: ${name}
|
|
121
155
|
|
|
122
156
|
## Spec
|
|
123
157
|
- Summary: ${summary || "<one-line summary>"}
|
|
124
158
|
- Requirements:
|
|
125
|
-
-
|
|
159
|
+
- <verifiable requirement>
|
|
126
160
|
- Constraints:
|
|
127
161
|
-
|
|
128
162
|
|
|
@@ -155,7 +189,6 @@ Guidelines:
|
|
|
155
189
|
- .rsp/rules/project-rules.md is optional
|
|
156
190
|
- Keep project design in .rsp/specs/
|
|
157
191
|
- Add extra spec files only when they have durable value
|
|
158
|
-
- Do not create a feature named 'init'
|
|
159
192
|
${RSP_AGENTS_END}`;
|
|
160
193
|
}
|
|
161
194
|
function upsertRspAgentsBlock(content) {
|
|
@@ -192,7 +225,7 @@ function generateDesignContent(projectName) {
|
|
|
192
225
|
- <important directory or subsystem> \u2014 <responsibility>
|
|
193
226
|
|
|
194
227
|
## Constraints
|
|
195
|
-
- <cross-cutting technical or operational constraint>
|
|
228
|
+
- <cross-cutting technical or operational constraint, when it affects architecture>
|
|
196
229
|
`;
|
|
197
230
|
}
|
|
198
231
|
function generateProjectRulesContent(projectName) {
|
|
@@ -204,10 +237,10 @@ description: Project-specific rules for ${projectName}
|
|
|
204
237
|
# Project Rules
|
|
205
238
|
|
|
206
239
|
## Scope
|
|
207
|
-
- <rules
|
|
240
|
+
- <stable local rules, workflow constraints, or validation expectations>
|
|
208
241
|
|
|
209
242
|
## Validation
|
|
210
|
-
- <preferred validation commands>
|
|
243
|
+
- <preferred stable validation commands, not temporary troubleshooting steps>
|
|
211
244
|
|
|
212
245
|
## Conventions
|
|
213
246
|
- <project-specific conventions>
|
|
@@ -1197,6 +1230,12 @@ async function initProject(args = {}) {
|
|
|
1197
1230
|
created = await ensureFile(join11(RSP_DIR, ".gitignore"), "# Transient files that should not be committed\n.lock\n") || created;
|
|
1198
1231
|
if (args.withProjectRules)
|
|
1199
1232
|
created = await ensureFile(join11(RSP_DIR, "rules", "project-rules.md"), generateProjectRulesContent(projectName)) || created;
|
|
1233
|
+
if (args.withProjectSetup) {
|
|
1234
|
+
const featurePath = join11(RSP_DIR, "features", "project-setup.md");
|
|
1235
|
+
const activeMarker = join11(RSP_DIR, "active.d", "project-setup");
|
|
1236
|
+
created = await ensureFile(featurePath, generateFeatureContent("project-setup")) || created;
|
|
1237
|
+
created = await ensureFile(activeMarker, "") || created;
|
|
1238
|
+
}
|
|
1200
1239
|
if (createdSpecsIndex || createdDesign)
|
|
1201
1240
|
await buildSpecsIndex({ acquireLock: false });
|
|
1202
1241
|
if (createdArchivesIndex)
|
|
@@ -1230,6 +1269,8 @@ ${managed}
|
|
|
1230
1269
|
`);
|
|
1231
1270
|
}
|
|
1232
1271
|
if (isNew) {
|
|
1272
|
+
const createdProjectSetup = args.withProjectSetup ? "\n .rsp/features/project-setup.md\n .rsp/active.d/project-setup" : "";
|
|
1273
|
+
const next = args.withProjectSetup ? "fill .rsp/features/project-setup.md" : "rsp new project-setup";
|
|
1233
1274
|
console.log(`
|
|
1234
1275
|
${pc.green("RSP scaffolded.")}
|
|
1235
1276
|
`);
|
|
@@ -1240,10 +1281,11 @@ ${managed}
|
|
|
1240
1281
|
.rsp/archives/
|
|
1241
1282
|
.rsp/.gitignore
|
|
1242
1283
|
.rsp/config.yaml
|
|
1243
|
-
.rsp/specs/design.md
|
|
1284
|
+
.rsp/specs/design.md${createdProjectSetup}
|
|
1244
1285
|
AGENTS.md
|
|
1245
1286
|
`);
|
|
1246
|
-
console.log(` ${pc.cyan("Next:")}
|
|
1287
|
+
console.log(` ${pc.cyan("Next:")} ${next}
|
|
1288
|
+
${pc.dim("Then:")} fill .rsp/specs/design.md
|
|
1247
1289
|
${pc.dim("Also:")} rsp status rsp deps
|
|
1248
1290
|
`);
|
|
1249
1291
|
} else if (created) {
|
|
@@ -1271,10 +1313,6 @@ async function newFeature(name, summary = "") {
|
|
|
1271
1313
|
console.error(` ${pc.red("Error:")} feature name must be kebab-case with optional subdirectory (lowercase, digits, hyphens, slashes)`);
|
|
1272
1314
|
process.exit(1);
|
|
1273
1315
|
}
|
|
1274
|
-
if (name === "init") {
|
|
1275
|
-
console.error(` ${pc.red("Error:")} "init" is a reserved workflow name, not a feature name`);
|
|
1276
|
-
process.exit(1);
|
|
1277
|
-
}
|
|
1278
1316
|
const rspRulesPath = join12(RSP_DIR, "rules", "rsp-rules.md");
|
|
1279
1317
|
const designPath = join12(RSP_DIR, "specs", "design.md");
|
|
1280
1318
|
if (!existsSync12(rspRulesPath) || !existsSync12(designPath)) {
|
|
@@ -1470,12 +1508,18 @@ var initCommand = defineCommand({
|
|
|
1470
1508
|
type: "boolean",
|
|
1471
1509
|
description: "Create .rsp/rules/project-rules.md",
|
|
1472
1510
|
default: false
|
|
1511
|
+
},
|
|
1512
|
+
"with-project-setup": {
|
|
1513
|
+
type: "boolean",
|
|
1514
|
+
description: "Create .rsp/features/project-setup.md and mark it active",
|
|
1515
|
+
default: false
|
|
1473
1516
|
}
|
|
1474
1517
|
},
|
|
1475
1518
|
async run({ args }) {
|
|
1476
1519
|
await initProject({
|
|
1477
1520
|
agentsMode: args["agents-mode"] === "skip" || args["agents-mode"] === "print" ? args["agents-mode"] : "managed",
|
|
1478
|
-
withProjectRules: Boolean(args["with-project-rules"])
|
|
1521
|
+
withProjectRules: Boolean(args["with-project-rules"]),
|
|
1522
|
+
withProjectSetup: Boolean(args["with-project-setup"])
|
|
1479
1523
|
});
|
|
1480
1524
|
}
|
|
1481
1525
|
});
|
package/package.json
CHANGED
package/rules/rsp-rules.md
CHANGED
|
@@ -26,6 +26,8 @@ RSP = Rules, Specs, Plans.
|
|
|
26
26
|
- `archives/INDEX.md` is auto-generated. Rebuild it with `rsp archive-index` instead of editing it manually.
|
|
27
27
|
- `design.md` is created by `rsp init` and then owned by the project.
|
|
28
28
|
- `project-rules.md` is optional.
|
|
29
|
+
- Keep durable architecture, boundaries, and cross-cutting technical constraints in `specs/design.md`.
|
|
30
|
+
- Keep stable workflow rules, validation expectations, and local operating constraints in `rules/project-rules.md`.
|
|
29
31
|
|
|
30
32
|
## Reading order
|
|
31
33
|
|
|
@@ -68,12 +70,12 @@ Every feature file should contain these sections:
|
|
|
68
70
|
## Init constraints
|
|
69
71
|
|
|
70
72
|
- `rsp init` scaffolds project structure only. It must not create a feature file.
|
|
73
|
+
- `rsp init --with-project-setup` may additionally seed `features/project-setup.md` and the matching `active.d` marker for onboarding.
|
|
71
74
|
- `rsp init` should create `features/`, `active.d/`, `archives/`, and `specs/design.md` up front.
|
|
72
75
|
- `rsp init --agents-mode managed|skip|print` controls whether `AGENTS.md` is updated, skipped, or printed.
|
|
73
76
|
- `managed` should update only the managed AGENTS block.
|
|
74
77
|
- `skip` should leave `AGENTS.md` untouched.
|
|
75
78
|
- `print` should scaffold `.rsp/` and print the managed AGENTS block without writing it.
|
|
76
|
-
- `init` is a reserved workflow name. Do not create a feature named `init`.
|
|
77
79
|
|
|
78
80
|
## Agent behavior
|
|
79
81
|
|
|
@@ -89,7 +91,6 @@ Every feature file should contain these sections:
|
|
|
89
91
|
## Prohibitions
|
|
90
92
|
|
|
91
93
|
- Do not manually maintain `specs/INDEX.md` or `archives/INDEX.md`.
|
|
92
|
-
- Do not create a feature named `init`.
|
|
93
94
|
- Do not create `project-rules.md` by default when the project has no durable local rules.
|
|
94
95
|
- Do not use `AGENTS.md` as the long-term storage location for project design or rules.
|
|
95
96
|
- Do not create `specs` files that duplicate information already stored in `design.md` or durable rules files.
|