@oevery/rsp 1.0.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.md +125 -0
- package/README.zh-CN.md +122 -0
- package/dist/cli.mjs +1137 -0
- package/package.json +55 -0
- package/rules/rsp-rules.md +123 -0
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oevery/rsp",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "RSP (Rules, Spec, Plan) workflow for AI-assisted development",
|
|
6
|
+
"author": "oevery",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/oevery/rsp#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/oevery/rsp.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/oevery/rsp/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"rsp",
|
|
16
|
+
"rules",
|
|
17
|
+
"spec",
|
|
18
|
+
"plan",
|
|
19
|
+
"ai",
|
|
20
|
+
"coding",
|
|
21
|
+
"workflow"
|
|
22
|
+
],
|
|
23
|
+
"bin": {
|
|
24
|
+
"rsp": "./dist/cli.mjs"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist/",
|
|
28
|
+
"rules/"
|
|
29
|
+
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"prepare": "pnpm run build",
|
|
35
|
+
"prepublishOnly": "pnpm run test",
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"dev": "tsup --watch",
|
|
38
|
+
"lint": "eslint .",
|
|
39
|
+
"lint:fix": "eslint --fix .",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"test:watch": "vitest"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"citty": "^0.2.2",
|
|
45
|
+
"picocolors": "^1.1.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
49
|
+
"@types/node": "^22.19.19",
|
|
50
|
+
"eslint": "^10.4.0",
|
|
51
|
+
"tsup": "^8.4.0",
|
|
52
|
+
"typescript": "^5.8.0",
|
|
53
|
+
"vitest": "^4.1.7"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rsp-rules
|
|
3
|
+
description: RSP rules for Rules, Spec, and Plan driven development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RSP
|
|
7
|
+
|
|
8
|
+
RSP = Rules, Spec, Plan.
|
|
9
|
+
|
|
10
|
+
## Structure
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
.rsp/
|
|
14
|
+
├── rules/ # technical constraints, long-lived
|
|
15
|
+
├── spec/ # project-level architecture (optional)
|
|
16
|
+
├── features/ # active features
|
|
17
|
+
│ ├── <name>.md # or <domain>/<name>.md for grouping
|
|
18
|
+
├── active.d/ # active feature markers
|
|
19
|
+
│ └── <name> # empty marker file, mirrors features/
|
|
20
|
+
├── archive/
|
|
21
|
+
│ ├── INDEX.md # auto-generated index
|
|
22
|
+
│ └── YYYY-MM-DD_<name>.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## File roles
|
|
26
|
+
|
|
27
|
+
- `rules/` — stable technical constraints, coding conventions, architecture decisions. One or more files, split by domain (e.g., `frontend.md`, `api.md`). Do not put business requirements here.
|
|
28
|
+
- `spec/` — project-level architecture and design reference. Use for cross-cutting concerns, system diagrams, ADRs. Per-feature details go in `features/`.
|
|
29
|
+
- `features/<name>.md` — a complete feature definition, optionally grouped by domain subdirectory (e.g., `features/auth/login.md`). Contains YAML frontmatter, `## Spec` (what), `## Plan` (how), `## Tests`, and optional `## Notes`.
|
|
30
|
+
- `active.d/` — active feature tracking. Mirrors the `features/` directory structure (e.g., `active.d/payments/checkout`). Each file is an empty marker; the file path is the source of truth. All features in `active.d/` are considered active.
|
|
31
|
+
|
|
32
|
+
## Reading order
|
|
33
|
+
|
|
34
|
+
1. Read `active.d/` to find active features.
|
|
35
|
+
2. If multiple entries exist, ask which to focus on.
|
|
36
|
+
3. If empty, ask the user or suggest `rsp new <name>`.
|
|
37
|
+
4. Read the referenced `features/<name>.md`.
|
|
38
|
+
5. Read `rules/` for technical constraints.
|
|
39
|
+
6. Optionally read `spec/` for architecture context and `config.yaml` for customized statuses/priorities.
|
|
40
|
+
|
|
41
|
+
## Token optimization
|
|
42
|
+
|
|
43
|
+
If [RTK (Token Killer)](https://kilo.ai) is available in the environment, prefix all `rsp` commands with `rtk` (e.g. `rtk rsp status`, `rtk rsp new`, `rtk rsp check`, `rtk rsp deps`) to reduce token consumption. RTK is detected by availability in `$PATH`.
|
|
44
|
+
|
|
45
|
+
## Semantic checkboxes
|
|
46
|
+
|
|
47
|
+
Use in all checklists (Requirements, Plan, Tests):
|
|
48
|
+
|
|
49
|
+
- `[ ]` = todo.
|
|
50
|
+
- `[/]` = in progress.
|
|
51
|
+
- `[-]` = dropped.
|
|
52
|
+
- `[x]` = done and verified.
|
|
53
|
+
- Use `[/]` to signal active ownership.
|
|
54
|
+
- Use `[x]` only after validation.
|
|
55
|
+
|
|
56
|
+
## Feature file template
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
---
|
|
60
|
+
status: draft # draft | ready | in-progress | blocked | done
|
|
61
|
+
priority: medium # low | medium | high | critical
|
|
62
|
+
depends-on: # optional: features this depends on
|
|
63
|
+
- <other-feature-name>
|
|
64
|
+
tags: # optional: categorization
|
|
65
|
+
- backend
|
|
66
|
+
---
|
|
67
|
+
# Feature: <name>
|
|
68
|
+
|
|
69
|
+
## Spec
|
|
70
|
+
- Summary: <one-line>
|
|
71
|
+
- Requirements:
|
|
72
|
+
- [ ] <verifiable item>
|
|
73
|
+
- Constraints:
|
|
74
|
+
- <binding constraint>
|
|
75
|
+
|
|
76
|
+
## Plan
|
|
77
|
+
- [ ] Phase 1: <name>
|
|
78
|
+
- [ ] <task>
|
|
79
|
+
- [ ] Phase 2: <name>
|
|
80
|
+
|
|
81
|
+
## Tests
|
|
82
|
+
- [ ] <test file or scenario>
|
|
83
|
+
|
|
84
|
+
## Notes (optional)
|
|
85
|
+
- <design decisions discovered during implementation>
|
|
86
|
+
|
|
87
|
+
## Blockers
|
|
88
|
+
-
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Evolution rules
|
|
92
|
+
|
|
93
|
+
- If requirements change during implementation, update `## Spec` explicitly — do not silently diverge.
|
|
94
|
+
- If the scope grows beyond the original spec, consider closing the current feature and starting a new one (`close` then `new`).
|
|
95
|
+
- Complex features may split into sub-features using subdirectories (`features/parent/child.md`).
|
|
96
|
+
- After closing a feature, update or regenerate `archive/INDEX.md` via `rsp archive-index`.
|
|
97
|
+
|
|
98
|
+
## Parallel features (always on)
|
|
99
|
+
|
|
100
|
+
All features in `active.d/` are tracked as active by default. Parallelism is inherent:
|
|
101
|
+
|
|
102
|
+
- `rsp new` always creates an entry in `active.d/`.
|
|
103
|
+
- `rsp close` removes the entry from `active.d/`.
|
|
104
|
+
- When `active.d/` has a single entry, that is the primary focus. When multiple entries exist, AI should ask the user which to focus on.
|
|
105
|
+
|
|
106
|
+
## Agent behavior
|
|
107
|
+
|
|
108
|
+
- Read `active.d/` first. If empty, ask what to work on. Also read `AGENTS.md` for project context.
|
|
109
|
+
- **`rsp init`**: scaffold `.rsp/` + `AGENTS.md`. Detects project name from package.json.
|
|
110
|
+
- Post-init: confirm created paths, suggest `rsp new`, `rsp status`, `rsp deps`.
|
|
111
|
+
- **`rsp new <name> [summary]`**: create `.rsp/features/<name>.md`. Name is kebab-case, supports subdirectories (`auth/login`). Optional one-line summary.
|
|
112
|
+
- After creation: confirm file exists, confirm `active.d/` marker was created.
|
|
113
|
+
- **`rsp close <name>`**: archive to `.rsp/archive/YYYY-MM-DD_<name>.md`. Mirror subdirectory structure in archive.
|
|
114
|
+
- After archive: suggest `git add .rsp/archive/… && git commit`.
|
|
115
|
+
- Runs `rsp check` automatically if the feature had dependents.
|
|
116
|
+
- **`rsp check`**: validate feature file integrity (frontmatter, sections, dependencies, cycles).
|
|
117
|
+
- **`rsp deps`**: inspect dependency relationships before large refactors.
|
|
118
|
+
- **`rsp status`**: view project dashboard at any time.
|
|
119
|
+
- For cross-cutting or dependent features, add `depends-on:` in frontmatter.
|
|
120
|
+
- Update the feature file as work progresses. Check off tasks and tests.
|
|
121
|
+
- Before finishing, confirm code matches `## Spec` and `## Plan` reflects reality.
|
|
122
|
+
|
|
123
|
+
> **Token tip**: If [RTK](https://kilo.ai) is installed, prefix shell commands with `rtk` (e.g. `rtk rsp status`) to reduce token consumption.
|