@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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Oevery
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.md ADDED
@@ -0,0 +1,125 @@
1
+ # RSP: Rules, Spec, Plan
2
+
3
+ RSP = **Rules, Spec, Plan** — a lightweight AI-assisted development workflow.
4
+
5
+ ## Quick start
6
+
7
+ ```bash
8
+ # Install globally
9
+ npm install -g @oevery/rsp
10
+
11
+ # Or run directly with npx
12
+ npx @oevery/rsp init
13
+
14
+ # Scaffold a project
15
+ cd my-project && rsp init
16
+ ```
17
+
18
+ Then add \`.rsp/rules/rsp-rules.md\` to your AI tool's instructions. For example, in Kilo Code's \`kilo.jsonc\`:
19
+
20
+ ```json
21
+ {
22
+ "instructions": [
23
+ ".rsp/rules/rsp-rules.md"
24
+ ]
25
+ }
26
+ ```
27
+
28
+ For other tools (Cursor, Claude Code, Copilot), add the path to the appropriate config file. The same file works everywhere — see [Platform-agnostic](#platform-agnostic).
29
+
30
+ ## Project structure
31
+
32
+ ```text
33
+ .rsp/
34
+ ├── config.yaml # project config (custom statuses, priorities, sections)
35
+ ├── rules/ # technical constraints, long-lived
36
+ │ └── rsp-rules.md
37
+ ├── spec/ # project-level architecture
38
+ │ └── INDEX.md # extracted spec summaries from archived features
39
+ ├── features/ # feature files (flat or nested)
40
+ │ ├── login.md
41
+ │ ├── auth/
42
+ │ │ └── login.md
43
+ │ └── payments/
44
+ │ └── checkout.md
45
+ ├── active.d/ # active feature markers (path = feature name)
46
+ │ ├── login
47
+ │ ├── auth/
48
+ │ │ └── login
49
+ │ └── payments/
50
+ │ └── checkout
51
+ ├── archive/
52
+ │ ├── INDEX.md # auto-generated archive index
53
+ │ ├── 2026-05-22_login.md
54
+ │ └── payments/
55
+ │ └── 2026-05-22_checkout.md
56
+ ```
57
+
58
+ Each `active.d/` entry is an empty file whose path mirrors `features/`. Multiple entries mean parallel features. AI reads `active.d/` to find what's in progress. Features can be organized flat (`login.md`) or in domain subdirectories (`auth/login.md`, `payments/checkout.md`).
59
+
60
+ Each feature file is self-contained, with optional delta markers and structured scenarios:
61
+
62
+ ```markdown
63
+ ---
64
+ status: draft
65
+ priority: medium
66
+ tags:
67
+ - backend
68
+ ---
69
+ # Feature: User Login
70
+
71
+ ## Spec
72
+ - Summary: Users can log in with email and password
73
+ - Requirements:
74
+ - [ ] Login form submits email + password
75
+ - [ ] Backend validates credentials and returns JWT
76
+ ### ADDED # optional: delta markers
77
+ - OAuth 2.0 login support
78
+ ### Scenario: Valid credentials
79
+ - GIVEN a registered user
80
+ - WHEN they submit email + password
81
+ - THEN a JWT is returned
82
+ - Constraints:
83
+ - Passwords must be hashed with bcrypt
84
+
85
+ ## Plan
86
+ - [ ] Phase 1: Backend API
87
+ - [ ] Create /api/auth/login endpoint
88
+ - [ ] Implement password verification
89
+ - [ ] Phase 2: Frontend
90
+ - [ ] Design login form UI
91
+
92
+ ## Tests
93
+ - [ ] tests/auth/login_test.ts — successful login
94
+ - [ ] tests/auth/login_test.ts — invalid credentials
95
+
96
+ ## Blockers
97
+ -
98
+ ```
99
+
100
+ ## CLI
101
+
102
+ ```text
103
+ rsp init Scaffold .rsp/ + AGENTS.md
104
+ rsp new <name> [summary] Create .rsp/features/<name>.md
105
+ rsp close <name> Archive to .rsp/archive/ + update spec index
106
+ rsp status Show project dashboard (age, blocked, trends)
107
+ rsp check Validate features (frontmatter, sections, deps, deltas, scenarios)
108
+ rsp deps Show dependency table
109
+ rsp deps --mermaid Output Mermaid.js dependency graph
110
+ rsp archive-index Rebuild archive INDEX.md
111
+ ```
112
+
113
+ ## Customization
114
+
115
+ Edit `.rsp/config.yaml` to customize valid statuses, priorities, and required sections.
116
+
117
+ > **Note:** The built-in YAML parser supports a simple subset: `key: value` pairs, nested lists (`- item`), and `#` comments. Multi-line values, quoted strings, booleans, and nested maps are not supported.
118
+
119
+ ## Platform-agnostic
120
+
121
+ The \`.rsp/\` directory is a plain file convention — no tool lock-in. It works with Kilo Code, Cursor, Claude Code, Cline, GitHub Copilot, or any AI coding assistant that reads project files. Requires Node.js 18+.
122
+
123
+ ## License
124
+
125
+ MIT
@@ -0,0 +1,122 @@
1
+ # RSP:Rules, Spec, Plan
2
+
3
+ RSP = **Rules(规则)、Spec(规格)、Plan(计划)** — 轻量级 AI 辅助开发工作流。
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ # 全局安装
9
+ npm install -g @oevery/rsp
10
+
11
+ # 或用 npx 直接运行
12
+ npx @oevery/rsp init
13
+
14
+ # 在当前项目搭建脚手架
15
+ cd my-project && rsp init
16
+ ```
17
+
18
+ 然后将 \`.rsp/rules/rsp-rules.md\` 添加到 AI 工具的指令文件中。例如 Kilo Code 的 \`kilo.jsonc\`:
19
+
20
+ ```json
21
+ {
22
+ "instructions": [
23
+ ".rsp/rules/rsp-rules.md"
24
+ ]
25
+ }
26
+ ```
27
+
28
+ 其他工具(Cursor、Claude Code、Copilot)将同一路径添加到对应配置即可。详见[工具无关](#工具无关)。
29
+
30
+ ## 项目结构
31
+
32
+ ```text
33
+ .rsp/
34
+ ├── config.yaml # 项目配置
35
+ ├── rules/ # 技术约束
36
+ ├── spec/ # 项目级架构
37
+ │ └── INDEX.md # 从归档提取的 spec 摘要
38
+ ├── features/ # 特性文件
39
+ │ ├── auth/
40
+ │ │ └── login.md
41
+ │ └── payments/
42
+ │ └── checkout.md
43
+ ├── active.d/ # 活跃特性标记(路径即特性名)
44
+ │ ├── auth/
45
+ │ │ └── login # 空标记文件
46
+ │ └── payments/
47
+ │ └── checkout
48
+ ├── archive/
49
+ │ ├── INDEX.md # 自动生成的归档索引
50
+ │ ├── 2026-05-22_login.md
51
+ │ └── payments/
52
+ │ └── 2026-05-22_checkout.md
53
+ ```
54
+
55
+ \`active.d/\` 中的每个条目是一个空文件,路径与 \`features/\` 镜像。多个条目表示并行特性。AI 读取 \`active.d/\` 来确定当前进行中的工作。特性文件可以扁平放置(如 \`login.md\`),也可以按领域子目录组织(如 \`auth/login.md\`、\`payments/checkout.md\`)。
56
+
57
+ 每个功能文件独立自包含,支持可选的 delta 变更标记和结构化场景:
58
+
59
+ ```markdown
60
+ ---
61
+ status: draft
62
+ priority: medium
63
+ tags:
64
+ - backend
65
+ ---
66
+ # Feature: User Login
67
+
68
+ ## Spec
69
+ - Summary: 用户可通过邮箱和密码登录
70
+ - Requirements:
71
+ - [ ] 登录表单提交邮箱 + 密码
72
+ - [ ] 后端验证凭据并返回 JWT
73
+ ### ADDED # 可选:delta 变更标记
74
+ - OAuth 2.0 登录支持
75
+ ### Scenario: 有效凭据
76
+ - GIVEN 一个已注册用户
77
+ - WHEN 提交邮箱 + 密码
78
+ - THEN 返回 JWT
79
+ - Constraints:
80
+ - 密码必须用 bcrypt 哈希
81
+
82
+ ## Plan
83
+ - [ ] 阶段 1: 后端 API
84
+ - [ ] 创建 /api/auth/login 端点
85
+ - [ ] 实现密码验证
86
+ - [ ] 阶段 2: 前端
87
+ - [ ] 设计登录表单 UI
88
+
89
+ ## Tests
90
+ - [ ] tests/auth/login_test.ts — 成功登录
91
+ - [ ] tests/auth/login_test.ts — 无效凭据
92
+
93
+ ## Blockers
94
+ -
95
+ ```
96
+
97
+ ## CLI
98
+
99
+ ```text
100
+ rsp init 搭建 .rsp/ + AGENTS.md
101
+ rsp new <name> [summary] 创建新功能
102
+ rsp close <name> 归档到 archive/ + 更新 spec 索引
103
+ rsp status 查看项目仪表板(年龄、受阻、趋势)
104
+ rsp check 验证功能文件(frontmatter、sections、deps、deltas、scenarios)
105
+ rsp deps 查看依赖关系表
106
+ rsp deps --mermaid 输出 Mermaid.js 依赖图
107
+ rsp archive-index 重新生成归档索引
108
+ ```
109
+
110
+ ## 自定义
111
+
112
+ 编辑 `.rsp/config.yaml` 可自定义 status、priority 和必要的 sections。
113
+
114
+ > **注意:** 内置 YAML 解析器支持简单的子集:`key: value` 键值对、嵌套列表(`- item`)和 `#` 注释。不支持多行值、引号字符串、布尔值和嵌套映射。
115
+
116
+ ## 工具无关
117
+
118
+ \`.rsp/\` 目录是一个纯文件约定 — 不绑定任何工具。适用于 Kilo Code、Cursor、Claude Code、Cline、GitHub Copilot 或任何能读取项目文件的 AI 编码助手。需要 Node.js 18+。
119
+
120
+ ## License
121
+
122
+ MIT