@oevery/rsp 1.2.0 → 2.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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@oevery/rsp",
3
3
  "type": "module",
4
- "version": "1.2.0",
5
- "description": "RSP (Rules, Specs, Plans) workflow for AI-assisted development",
4
+ "version": "2.0.0",
5
+ "description": "RSP (Rules, Specs, Plans) workflow for lightweight AI-assisted change management",
6
6
  "author": "oevery",
7
7
  "license": "MIT",
8
8
  "homepage": "https://github.com/oevery/rsp#readme",
@@ -26,14 +26,16 @@
26
26
  "files": [
27
27
  "bin/",
28
28
  "dist/",
29
- "rules/"
29
+ "rules/",
30
+ "skills/"
30
31
  ],
31
32
  "engines": {
32
33
  "node": ">=18"
33
34
  },
34
35
  "scripts": {
35
36
  "prepare": "pnpm run build",
36
- "prepublishOnly": "pnpm run test",
37
+ "release:check": "pnpm run build && pnpm run lint && pnpm run test && npm pack --dry-run --ignore-scripts",
38
+ "prepublishOnly": "pnpm run release:check",
37
39
  "build": "tsup",
38
40
  "dev": "tsup --watch",
39
41
  "lint": "eslint .",
@@ -43,7 +45,8 @@
43
45
  },
44
46
  "dependencies": {
45
47
  "citty": "^0.2.2",
46
- "picocolors": "^1.1.1"
48
+ "picocolors": "^1.1.1",
49
+ "yaml": "^2.9.0"
47
50
  },
48
51
  "devDependencies": {
49
52
  "@antfu/eslint-config": "^9.0.0",
@@ -5,95 +5,92 @@ description: Core RSP rules for Rules, Specs, and Plans driven development.
5
5
 
6
6
  # RSP
7
7
 
8
- RSP = Rules, Specs, Plans.
9
-
10
- ## Core structure
11
-
12
- ```text
13
- .rsp/
14
- ├── rules/
15
- ├── specs/
16
- ├── features/
17
- ├── active.d/
18
- ├── archives/
19
- └── config.yaml
20
- ```
21
-
22
- ## Managed boundaries
23
-
24
- - `AGENTS.md` is partially managed. RSP owns only the `<!-- rsp:begin --> ... <!-- rsp:end -->` block.
25
- - `specs/INDEX.md` is auto-generated. Rebuild it with `rsp specs-index` instead of editing it manually.
26
- - `archives/INDEX.md` is auto-generated. Rebuild it with `rsp archive-index` instead of editing it manually.
27
- - `design.md` is created by `rsp init` and then owned by the project.
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`.
31
-
32
- ## Reading order
33
-
34
- 1. Read `AGENTS.md` for entrypoint guidance.
35
- 2. Read `active.d/` to find active features.
36
- 3. If `active.d/` is empty, ask the user what to work on or suggest `npx -y @oevery/rsp new <name>`.
37
- 4. Read the referenced `features/<name>.md`.
38
- 5. Read `rules/` for technical constraints.
39
- 6. Read `specs/design.md` and other project-level specs only when relevant to the current task.
40
-
41
- ## File creation rules
42
-
43
- - `specs/design.md`: create by default with `rsp init`.
44
- - `rules/project-rules.md`: create only when the project has durable local rules worth preserving.
45
- - `rules/<name>.md`: create only for other durable rule sets.
46
- - `specs/<name>.md`: create only when the new document has durable project-level value and does not duplicate `design.md`.
47
- - `features/<name>.md`: create only for active work that should be tracked as a feature.
48
- - Do not create files merely for completeness.
49
-
50
- ## Command-first creation
51
-
52
- - Prefer RSP commands over direct file creation when creating new RSP-managed files.
53
- - Use `rsp init` to scaffold the base RSP structure.
54
- - Use `rsp add rules <name>` to create new durable rules files under `rules/`.
55
- - Use `rsp add spec <name>` to create new durable project-level spec files under `specs/`.
56
- - Use `rsp new <name>` to create new feature files under `features/`.
57
- - Use `rsp close <name>` to move completed work into `archives/`.
58
- - Direct file creation is acceptable only when no RSP command covers the target file.
59
- - After a file is created by command, edit its contents in place as needed.
60
-
61
- ## Feature requirements
62
-
63
- Every feature file should contain these sections:
64
-
8
+ This file is the canonical RSP rules source.
9
+
10
+ ## Read order
11
+
12
+ 1. Read `AGENTS.md`.
13
+ 2. Read `.rsp/rules/rsp-rules.md` in full.
14
+ 3. Read `focus.d/`.
15
+ 4. If `focus.d/` is empty, ask the user what to work on or suggest `npx -y @oevery/rsp create <name>`.
16
+ 5. Read each `changes/<name>.md` file marked in `focus.d/`.
17
+ 6. Read `specs/design.md` and `specs/INDEX.md`.
18
+ 7. Read only the relevant additional `rules/` and `specs/` files.
19
+
20
+ ## Core rules
21
+
22
+ - Treat `rules/` as the canonical rules source.
23
+ - Treat `focus.d/` as the only current-focus source.
24
+ - Treat `changes/` as open work.
25
+ - Treat `archives/` as completed history.
26
+ - Treat each change as a single `.md` file under `changes/`. Do not create multi-file change bundles or supplementary files alongside a change.
27
+ - RSP uses only two lifecycle states: `open` (in `changes/`) and `archived` (in `archives/`). Do not introduce intermediate states such as "in review" or "verified".
28
+ - Keep every change file in the fixed six-section structure.
29
+ - Use an RSP command first when an RSP command already covers the action.
30
+ - Do not infer current work from `changes/` alone.
31
+ - Do not treat `AGENTS.md` as the long-term rules or design store.
32
+ - Do not redefine the core change structure through project config.
33
+
34
+ ## File ownership
35
+
36
+ - Manage only the `<!-- rsp:begin --> ... <!-- rsp:end -->` block in `AGENTS.md`.
37
+ - Do not modify content outside the managed AGENTS block unless the user explicitly asks for it.
38
+ - Do not edit `specs/INDEX.md` or `archives/INDEX.md` manually; use `npx -y @oevery/rsp update`.
39
+ - Treat `specs/design.md` as the durable design file. Prefer sections: `Purpose`, `Stable Facts`, `Boundaries`, `Constraints`.
40
+ - Treat all `specs/<name>.md` as durable-truth documents. Use the same section structure as `specs/design.md`.
41
+ - Treat `rules/project-rules.md` as the durable local-rules file.
42
+ - Create `rules/project-rules.md` only when the project has stable local rules worth keeping.
43
+ - Create or update `specs/` only for durable project-level facts that are stable, reusable, and worth rereading in later sessions.
44
+ - Prefer updating `specs/design.md` or an existing durable file before creating a new spec file.
45
+ - Create a new `specs/<name>.md` only when the knowledge forms a distinct durable project topic that does not fit `specs/design.md` or an existing durable file.
46
+ - Write stable facts to the smallest correct durable file. Do not duplicate the same fact across multiple durable files without a clear long-term reason.
47
+
48
+ ## Command rules
49
+
50
+ - Use `npx -y @oevery/rsp init` to scaffold the base RSP structure.
51
+ - Use `npx -y @oevery/rsp add rules <name>` to create a durable rules file.
52
+ - Use `npx -y @oevery/rsp add spec <name>` to create a durable spec file.
53
+ - Use `npx -y @oevery/rsp create <name>` to create an open change.
54
+ - Use `npx -y @oevery/rsp focus <name>` to foreground an existing open change.
55
+ - Use `npx -y @oevery/rsp unfocus <name>` to remove an open change from the current focus set.
56
+ - Use `npx -y @oevery/rsp archive <name>` to archive a completed change.
57
+ - Use `npx -y @oevery/rsp update` to refresh bundled rules, repair the managed `AGENTS.md` block, and rebuild generated indices.
58
+ - Use `npx -y @oevery/rsp doctor` for diagnostics only.
59
+ - If RTK is available, you may prefix RSP commands with `rtk`.
60
+ - Do not use `npx -y @oevery/rsp create <name>` to re-focus an existing change.
61
+ - Do not create RSP-managed files directly when an RSP command already exists for that file type.
62
+
63
+ ## Change rules
64
+
65
+ Every change file must contain:
66
+
67
+ - an explicit `kind` field in frontmatter
68
+ - `## Proposal`
65
69
  - `## Spec`
66
- - `## Plan`
67
- - `## Tests`
70
+ - `## Design`
71
+ - `## Tasks`
72
+ - `## Verify`
68
73
  - `## Blockers`
69
74
 
70
- ## Init constraints
75
+ Do not leave `kind` unresolved.
71
76
 
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.
74
- - `rsp init` should create `features/`, `active.d/`, `archives/`, and `specs/design.md` up front.
75
- - `rsp init --agents-mode managed|skip|print` controls whether `AGENTS.md` is updated, skipped, or printed.
76
- - `managed` should update only the managed AGENTS block.
77
- - `skip` should leave `AGENTS.md` untouched.
78
- - `print` should scaffold `.rsp/` and print the managed AGENTS block without writing it.
77
+ If a section does not apply, keep it and write `- none` or `- not needed: <reason>`.
79
78
 
80
- ## Agent behavior
79
+ ## Archive gate
81
80
 
82
- - Read `active.d/` first.
83
- - Treat `AGENTS.md` as a navigation layer, not the long-term knowledge base.
84
- - Preserve content outside the managed AGENTS block unless explicitly asked to change it.
85
- - Keep project-wide design and durable context in `specs/design.md`.
86
- - Keep stable local rules in `rules/project-rules.md` or another durable rules file only when needed.
87
- - Use `rsp add rules project-rules` for the canonical optional project rules file.
88
- - Do not push long-lived project knowledge back into `AGENTS.md`.
89
- - `rsp doctor` is diagnostic only and must not mutate project files.
81
+ - `rsp archive <name>` never blocks. It warns but always completes the move.
82
+ - Make a durable-update decision before `npx -y @oevery/rsp archive <name>`.
83
+ - If `Blockers` still contains a real blocker, set `Archive ready: no`.
84
+ - If the change produced durable knowledge that has not been written to `specs/` or `rules/`, set `Archive ready: no`.
85
+ - If `Verify` is incomplete but there is no active blocker and no missing durable update, treat archive readiness as a judgment call.
86
+ - A durable update should contain stable facts only, not task history, debugging notes, or one-off implementation context.
87
+ - Default to no spec writeback unless the change produced project-level durable knowledge that future work must reread.
90
88
 
91
89
  ## Prohibitions
92
90
 
93
- - Do not manually maintain `specs/INDEX.md` or `archives/INDEX.md`.
94
- - Do not create `project-rules.md` by default when the project has no durable local rules.
95
- - Do not use `AGENTS.md` as the long-term storage location for project design or rules.
96
- - Do not create `specs` files that duplicate information already stored in `design.md` or durable rules files.
97
91
  - Do not create placeholder or empty-shell files merely for completeness.
98
- - Do not create new files under `.rsp/rules/`, `.rsp/specs/`, or `.rsp/features/` directly when an RSP command already exists for that file type.
99
- - Do not create archive entries directly under `.rsp/archives/`; use `rsp close <name>`.
92
+ - Do not create archive entries directly under `.rsp/archives/`; use `npx -y @oevery/rsp archive <name>`.
93
+ - Do not create spec files that duplicate `specs/design.md` or another durable file.
94
+ - Do not create a catch-all summary file like `specs/changes.md`.
95
+ - Do not create supplementary files alongside a single change file.
96
+ - Do not promote archive history, temporary troubleshooting notes, or task-by-task execution logs into `specs/` or `rules/`.
@@ -0,0 +1,137 @@
1
+ ---
2
+ name: rsp
3
+ description: Use this skill when adopting, operating, auditing, or repairing an RSP project and its .rsp structure.
4
+ ---
5
+
6
+ # RSP Skill
7
+
8
+ Load this skill when you need to initialize RSP, operate an existing RSP project, audit or repair `.rsp/`, or decide whether a change needs durable updates before archive.
9
+
10
+ This skill operationalizes the rules in `.rsp/rules/rsp-rules.md`. Always load and follow those rules first.
11
+
12
+ Prefer exact file paths, exact commands, and exact durable facts over vague summaries.
13
+
14
+ ## Workflow
15
+
16
+ ### Adopt or initialize
17
+
18
+ 1. Use one of these commands:
19
+ - `npx -y @oevery/rsp init --agents-mode managed`
20
+ - `npx -y @oevery/rsp init --agents-mode print`
21
+ - `npx -y @oevery/rsp init --with-project-setup --agents-mode managed`
22
+ - `npx -y @oevery/rsp init --with-project-setup --agents-mode print`
23
+ 2. If the repository still needs an explicit bootstrap change and you did not use `--with-project-setup`, run `npx -y @oevery/rsp create project-setup`.
24
+ 3. Fill `changes/project-setup.md`.
25
+ 4. Set an explicit `kind` in the change frontmatter.
26
+ 5. Write durable architecture, boundaries, defaults, and constraints into `specs/design.md`.
27
+ 6. Write stable local workflow or validation rules into `rules/project-rules.md` only when they are long-lived.
28
+ 7. Run `npx -y @oevery/rsp doctor`.
29
+
30
+ ### Operate an existing project
31
+
32
+ 1. Follow the read order in `.rsp/rules/rsp-rules.md`.
33
+ 2. If a focused change is missing an explicit `kind`, repair the frontmatter before continuing.
34
+ 3. If an existing open change should become current work, use `npx -y @oevery/rsp focus <name>`.
35
+ 4. Do not treat unfocused files in `changes/` as current work unless the user explicitly asks for them or you first run `npx -y @oevery/rsp focus <name>`.
36
+
37
+ ### Audit or repair
38
+
39
+ 1. Check that `.rsp/` exists.
40
+ 2. Check that `AGENTS.md` contains the managed RSP block.
41
+ 3. Check that `specs/design.md` exists.
42
+ 4. Check that `specs/INDEX.md` and `archives/INDEX.md` are still generated files.
43
+ 5. Check that `focus.d/` markers and `changes/` files are in sync.
44
+ 6. If generated indices or the managed AGENTS block drift, run `npx -y @oevery/rsp update`.
45
+
46
+ ## Durable decision
47
+
48
+ Before `npx -y @oevery/rsp archive <name>`:
49
+
50
+ 1. Read the current change.
51
+ 2. Read only the relevant `specs/` and `rules/` files.
52
+ 3. Inspect code only if needed.
53
+ 4. Return exactly one decision:
54
+
55
+ - `No durable update needed`
56
+ - `Update existing spec or rule`
57
+ - `Create a new durable spec` only when the knowledge is truly project-level, reusable, and does not fit `specs/design.md`, an existing spec, or a rule file
58
+
59
+ Write a durable update only when one of these is true:
60
+
61
+ - the change altered stable system behavior
62
+ - the change changed a project boundary, default, or constraint
63
+ - future agents or developers would likely make mistakes without the fact
64
+ - the fact is worth rereading in later sessions as durable project knowledge
65
+
66
+ When unsure whether a fact is truly durable, prefer `No durable update needed` over speculative promotion.
67
+
68
+ Default to no spec writeback unless the change produced project-level durable knowledge that future work must reread.
69
+
70
+ Do not write these into `specs/` or `rules/`:
71
+
72
+ - temporary debugging history
73
+ - task-by-task execution notes
74
+ - one-off implementation context
75
+ - archive-only historical detail
76
+ - a catch-all summary file like `specs/changes.md`
77
+
78
+ Choose the smallest correct target:
79
+
80
+ - project-wide design, boundaries, defaults, and durable context -> `specs/design.md`
81
+ - stable local workflow or validation rules -> `rules/project-rules.md`
82
+ - another durable rule set -> `rules/<name>.md`
83
+ - an additional reusable project-level spec -> `specs/<name>.md`
84
+
85
+ Prefer `specs/design.md` or an existing durable file before creating a new spec file.
86
+
87
+ When writing the durable update:
88
+
89
+ - write stable facts, not narrative history
90
+ - prefer concrete facts and boundaries over summaries like "implemented X" or "investigated Y"
91
+ - if you cannot identify a concrete durable target or concrete durable facts, do not invent them
92
+
93
+ Set archive readiness like this:
94
+
95
+ - If `Blockers` still contains a real blocker, set `Archive ready: no`.
96
+ - If a durable update is required but not yet written, set `Archive ready: no`.
97
+ - If no durable update is missing and the remaining `Verify` risk is consciously accepted, set `Archive ready: yes`.
98
+ - Do not use CLI warning text as a substitute for semantic durable-update judgment.
99
+
100
+ ## Output template
101
+
102
+ Use this exact format:
103
+
104
+ ```md
105
+ ## Durable Decision
106
+ - Decision: <No durable update needed | Update existing spec or rule | Create a new durable spec>
107
+ - Target: <path or N/A>
108
+ - Why:
109
+ - <reason>
110
+ - Facts to write:
111
+ - <durable fact>
112
+ - Archive ready: <yes | no>
113
+ ```
114
+
115
+ Minimal example:
116
+
117
+ ```md
118
+ ## Durable Decision
119
+ - Decision: Update existing spec or rule
120
+ - Target: .rsp/specs/design.md
121
+ - Why:
122
+ - The change introduced a stable default and boundary that future work must follow.
123
+ - Facts to write:
124
+ - Default API retries are capped at 3 attempts.
125
+ - Background sync stops retrying after a permanent authentication failure.
126
+ - Archive ready: no
127
+ ```
128
+
129
+ Rules for the output:
130
+
131
+ - `Target` must be a concrete file path when the decision is not `No durable update needed`.
132
+ - `Facts to write` must contain durable facts, not task history or debugging notes.
133
+ - If the decision requires a durable update that is not yet written, `Archive ready` must be `no`.
134
+
135
+ ## Refresh guidance
136
+
137
+ - After rule or skill changes, prefer a fresh session and reread `AGENTS.md` plus `.rsp/rules/*.md`.