@oevery/rsp 2.0.4 → 3.1.0-beta.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 +195 -62
- package/README.zh-CN.md +177 -60
- package/bin/rsp.mjs +2 -2
- package/dist/chunk-QLXIDVKK.mjs +2618 -0
- package/dist/cli.mjs +1997 -1355
- package/dist/entry-LAPR3TNI.mjs +966 -0
- package/dist/locale-HT44UIUP.mjs +21 -0
- package/package.json +13 -4
- package/rules/rsp-rules.md +63 -91
- package/skills/rsp/SKILL.md +142 -60
- package/skills/rsp-address-review/SKILL.md +61 -0
- package/skills/rsp-design/SKILL.md +48 -0
- package/skills/rsp-design/references/domain-modeling.md +11 -0
- package/skills/rsp-design/references/module-seams.md +11 -0
- package/skills/rsp-design/references/reversible-exploration.md +19 -0
- package/skills/rsp-diagnose/SKILL.md +46 -0
- package/skills/rsp-implement/NOTICE.md +27 -0
- package/skills/rsp-implement/SKILL.md +52 -0
- package/skills/rsp-manage/SKILL.md +53 -0
- package/skills/rsp-release-docs/SKILL.md +120 -0
- package/skills/rsp-release-docs/references/convention-discovery.md +65 -0
- package/skills/rsp-release-docs/references/output-contracts.md +115 -0
- package/skills/rsp-review/SKILL.md +98 -0
- package/skills/rsp-shape/SKILL.md +65 -0
- package/skills/rsp-shape/references/complex-shaping.md +30 -0
- package/skills/rsp-shape/references/deep-clarification.md +29 -0
- package/skills/rsp-tdd/SKILL.md +48 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/tui/i18n/locale.ts
|
|
4
|
+
function normalizeLocale(value) {
|
|
5
|
+
if (!value)
|
|
6
|
+
return null;
|
|
7
|
+
const normalized = value.replaceAll("_", "-").split(".")[0].toLowerCase();
|
|
8
|
+
if (normalized === "en")
|
|
9
|
+
return "en";
|
|
10
|
+
if (normalized === "zh" || normalized === "zh-cn" || normalized.startsWith("zh-cn-") || normalized === "zh-hans" || normalized.startsWith("zh-hans-"))
|
|
11
|
+
return "zh-CN";
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function resolveUiLocale(explicit, environmentLocale, hostLocale) {
|
|
15
|
+
if (explicit !== "auto")
|
|
16
|
+
return explicit;
|
|
17
|
+
return normalizeLocale(environmentLocale) ?? normalizeLocale(hostLocale) ?? "en";
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
resolveUiLocale
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oevery/rsp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "RSP (
|
|
4
|
+
"version": "3.1.0-beta.0",
|
|
5
|
+
"description": "RSP (Reliable Software Practice), a repository-native engineering workflow for humans and AI agents",
|
|
6
6
|
"author": "oevery",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/oevery/rsp#readme",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"bugs": "https://github.com/oevery/rsp/issues",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"rsp",
|
|
16
|
+
"reliable-software-practice",
|
|
17
|
+
"repository-native",
|
|
18
|
+
"engineering-workflow",
|
|
16
19
|
"rules",
|
|
17
20
|
"specs",
|
|
18
21
|
"plans",
|
|
@@ -30,28 +33,34 @@
|
|
|
30
33
|
"skills/"
|
|
31
34
|
],
|
|
32
35
|
"engines": {
|
|
33
|
-
"node": ">=
|
|
36
|
+
"node": ">=22"
|
|
34
37
|
},
|
|
35
38
|
"scripts": {
|
|
36
39
|
"prepare": "pnpm run build",
|
|
37
|
-
"release:check": "pnpm run build && pnpm run lint && pnpm run test &&
|
|
40
|
+
"release:check": "pnpm run build && pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run release:package-check",
|
|
41
|
+
"release:package-check": "node scripts/clean-install-check.mjs",
|
|
38
42
|
"prepublishOnly": "pnpm run release:check",
|
|
39
43
|
"build": "tsup",
|
|
40
44
|
"dev": "tsup --watch",
|
|
41
45
|
"lint": "eslint .",
|
|
42
46
|
"lint:fix": "eslint --fix .",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
43
48
|
"test": "vitest run",
|
|
44
49
|
"test:watch": "vitest"
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
52
|
"citty": "^0.2.2",
|
|
53
|
+
"ink": "~7.1.1",
|
|
48
54
|
"picocolors": "^1.1.1",
|
|
55
|
+
"react": "~19.2.3",
|
|
49
56
|
"yaml": "^2.9.0"
|
|
50
57
|
},
|
|
51
58
|
"devDependencies": {
|
|
52
59
|
"@antfu/eslint-config": "^9.0.0",
|
|
53
60
|
"@types/node": "^22.19.19",
|
|
61
|
+
"@types/react": "19.2.14",
|
|
54
62
|
"eslint": "^10.4.0",
|
|
63
|
+
"ink-testing-library": "4.0.0",
|
|
55
64
|
"tsup": "^8.4.0",
|
|
56
65
|
"typescript": "^5.8.0",
|
|
57
66
|
"vitest": "^4.1.7"
|
package/rules/rsp-rules.md
CHANGED
|
@@ -1,99 +1,71 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rsp-rules
|
|
3
|
-
description:
|
|
3
|
+
description: Minimal fallback protocol for Rules, Specs, and Plans driven development.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# RSP
|
|
6
|
+
# RSP fallback protocol
|
|
7
7
|
|
|
8
|
-
This file is the
|
|
8
|
+
This file is the minimal fallback protocol for agents that cannot load the `rsp` skill. It is not the project instruction or design store.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Entry
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- If the
|
|
15
|
-
- Keep this file compact because it is the always-read canonical truth source; put operational procedure in the RSP skill and explanatory detail in README or design docs.
|
|
16
|
-
|
|
17
|
-
## Read order
|
|
18
|
-
|
|
19
|
-
1. Read `AGENTS.md`.
|
|
20
|
-
2. Read `.rsp/rules/rsp-rules.md` in full.
|
|
21
|
-
3. Read `focus.d/`.
|
|
22
|
-
4. If `focus.d/` is empty and the user has not provided a concrete task, ask what to work on or suggest `npx -y @oevery/rsp create <name>` for tracked work.
|
|
23
|
-
5. Read each `changes/<name>.md` file marked in `focus.d/`.
|
|
24
|
-
6. Read `specs/design.md` and `specs/INDEX.md`.
|
|
25
|
-
`specs/INDEX.md` lists only additional spec files beyond `specs/design.md`.
|
|
26
|
-
7. Read only the relevant additional `rules/` and `specs/` files.
|
|
27
|
-
|
|
28
|
-
## Core rules
|
|
29
|
-
|
|
30
|
-
- Treat `rules/` as the canonical rules source.
|
|
12
|
+
- Read nearest `AGENTS.md` and relevant `CONTEXT.md` before RSP work. Use root `CONTEXT-MAP.md` when present.
|
|
13
|
+
- Prefer the `rsp` skill for setup, focused work, readiness, repair, and durable review.
|
|
14
|
+
- If the `rsp` skill is unavailable, read this file before operating `.rsp/`.
|
|
31
15
|
- Treat `focus.d/` as the only current-focus source.
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
- Make a durable-update decision before archive. Set `Archive ready: no` when real blockers remain or required durable updates are missing.
|
|
89
|
-
- Change `Spec` delta markers (`### ADDED`, `### MODIFIED`, `### REMOVED`) are planning aids only and are never auto-merged.
|
|
90
|
-
- Durable updates should contain stable facts only. Default to no spec writeback unless future work must reread the fact.
|
|
91
|
-
|
|
92
|
-
## Prohibitions
|
|
93
|
-
|
|
94
|
-
- Do not create placeholder or empty-shell files merely for completeness.
|
|
95
|
-
- Do not create archive entries directly under `.rsp/archives/`; use `npx -y @oevery/rsp archive <name>`.
|
|
96
|
-
- Do not create spec files that duplicate `specs/design.md` or another durable file.
|
|
97
|
-
- Do not create a catch-all summary file like `specs/changes.md`.
|
|
98
|
-
- Do not create supplementary files alongside a single change file.
|
|
99
|
-
- Do not promote archive history, temporary troubleshooting notes, or task-by-task execution logs into `specs/` or `rules/`.
|
|
16
|
+
- If `focus.d/` is empty and the user has not provided a concrete task, ask what to work on or suggest `npx -y @oevery/rsp create <name>`.
|
|
17
|
+
- For grouped work, read the sibling Group Brief before the focused child Change. Then read only the relevant Specs and Decision Records under the configured authoritative path.
|
|
18
|
+
|
|
19
|
+
## Core
|
|
20
|
+
|
|
21
|
+
- Choose response language and artifact language independently. Localize human-facing response headings, labels, explanations, and conclusions according to the requested response language, response-specific project instructions, then conversation language. Write artifact prose according to the requested artifact language, artifact-specific project instructions, existing artifact language, then conversation language. Preserve canonical RSP artifact headings, WorkRef values, paths, commands, identifiers, and machine-consumed values. Response-only Continuation and Durable Decision labels are not artifact headings; a technical token may appear in parentheses but cannot replace the localized label.
|
|
22
|
+
- Write persistent artifact prose in domain, system, user, or operator language. Mention AI or agents only when they are real product actors, consumers, interface participants, or constraints; agent authorship, execution narration, or convenience for a hypothetical future agent is not durable content.
|
|
23
|
+
- `changes/` stores open work; `archives/` stores completed history; `specs/` stores stable current facts; the configured Decision Record path stores lasting rationale.
|
|
24
|
+
- Every Change is one Markdown file with explicit `kind` and the fixed `Proposal`, `Spec`, `Design`, `Tasks`, `Verify`, and `Blockers` sections.
|
|
25
|
+
- A Change is a convergent current-plan and final-evidence snapshot, not an append-only execution log. Keep Tasks aligned with current delivery and Verify limited to final decisive commands or scenarios, results, proven scope, omitted or unavailable coverage, and remaining risk. Replace superseded plans and evidence; retain an earlier failure only when it still explains a current blocker, coverage gap, or risk.
|
|
26
|
+
- In a Change `Blockers` section, `- requires \`<change-work-ref>\`: <reason>` declares an exact dependency on another executable Change. Other meaningful blocker prose remains external and is never inferred as a dependency.
|
|
27
|
+
- Executable Change identities are either `<change>` or `<group>/<change>`. Recursive work paths are unsupported.
|
|
28
|
+
- A Change Group is the only composite work shape. Use it only when at least two independently executable direct child Changes share one goal or completion contract.
|
|
29
|
+
- `<group>/brief`, physically stored as `<group>/00-brief.md`, owns Goal, Scope, Shared Constraints, Slices, Completion Conditions, Durable Outcomes, and Blockers. Every direct child must be declared by `Slices`, and every declared slice must be open or archived.
|
|
30
|
+
- A Group Brief is not executable or focusable. Read it before a grouped child, archive children independently, and use `rsp group close <group>` only after derived completion passes. Archived Group identities cannot be reopened.
|
|
31
|
+
- A file and directory cannot claim the same work identity.
|
|
32
|
+
- `changes/` must exist as a real directory. Existing `focus.d/`, `archives/`, and direct group prefixes must also be real directories; symlinks, missing open-work roots, and incomplete inspection fail closed.
|
|
33
|
+
- Initialization, repair, status inspection, Spec creation, and index generation use the same no-follow managed-path rules; recursive Specs may use only real directories and regular files.
|
|
34
|
+
- Final managed files, including the project `AGENTS.md`, focus markers, fallback/config files, indexes, and placeholders, must be regular files rather than symlinks or special entries.
|
|
35
|
+
- `status`, `check`, and `doctor` share work-tree, Change Group, and dependency inspection. They fail visibly on unsupported structure, membership mismatches, malformed or missing dependency targets, self-dependencies, and cycles. With no focus, status uses Group Brief declaration order and derived blockers to recommend the first executable slice.
|
|
36
|
+
- `status` derives minimal graph nodes, dependency edges with their reasons, ready Changes, blockers, and stable execution waves from exact blocker references. Filtered plans retain transitive prerequisite context and distinguish selected nodes from prerequisite nodes; human output renders the same flat graph as a dependency forest whose parent requires its children. Archived prerequisites resolve automatically; incomplete dependency or archive inspection fails closed and marks open Changes blocked for readiness; no graph file or delivery state is persisted; and Group Briefs are not dependency targets.
|
|
37
|
+
- Parallel Changes in one Group follow the Brief `Slices` declaration order in plan output; unrelated work uses stable lexical ordering.
|
|
38
|
+
- A Group Brief blocker is inherited by its direct child Changes as an external blocker; it does not create inferred dependency edges.
|
|
39
|
+
- Persist only `open` and `archived`; readiness, blockers, verification, and next actions are derived.
|
|
40
|
+
- Ordinary implementation is the default after unexplained failures have been ruled out. Use test-first work only when user, Change, or project authority requires it or a concrete changed risk makes a focused pre-mutation failure materially safer. Retain a new test only when it protects observable behavior or a real boundary, adds distinct future confidence, avoids duplicate or implementation-detail coverage, and has proportionate maintenance cost; otherwise remove the temporary probe and use the smallest decisive final verification.
|
|
41
|
+
- Route one isolated domain, module/seam, or evidence-seeking design question to `rsp-design` when available, or use a compact manual design pass. Return evidence, alternatives, owner decisions, and any authorized planned-design update to the same selected Change; do not implement or write durable current truth from that pass.
|
|
42
|
+
- Route release documentation only when the selected Change explicitly owns a confirmed release identity or range and still has unfinished changelog, release-note, or migration work. Select `rsp-release-docs` when available, or use the same evidence-led manual fallback; lifecycle stage, completed implementation, and archive readiness alone are insufficient. This route never grants commit, tag, push, release creation, publication, deployment, or approval authority.
|
|
43
|
+
- Do not infer current work from open Changes or filenames.
|
|
44
|
+
- Prefer RSP commands for deterministic setup, status, validation, repair, focus, index, and archive operations.
|
|
45
|
+
|
|
46
|
+
## Durable review
|
|
47
|
+
|
|
48
|
+
- Route artifacts by semantic owner: planned future design stays in the selected Change; implemented stable current facts go to the smallest authoritative Spec or, with explicit authority, project-owned context/instructions; lasting rationale is judged independently for the configured Decision Record path; temporary continuation stays in the response unless a path is explicitly authorized.
|
|
49
|
+
- Project-owned `CONTEXT.md` owns stable navigation or scoped current context, while project-owned `AGENTS.md` owns stable operating instructions. Preserve their conventions and never treat RSP as their owner.
|
|
50
|
+
- Before archive, decide independently whether current facts need a Spec or scoped-instruction update and whether lasting rationale needs a Decision Record.
|
|
51
|
+
- Before archive, compress the Change to its final outcome, current design, completed delivery tasks, final decisive verification, and unresolved risks. Keep RED/GREEN/REFACTOR cycles, temporary probes, command transcripts, and step-by-step review corrections in the response instead of the Change or Archive.
|
|
52
|
+
- After required durable updates, Core recommends explicit archive before final Git delivery. Core does not execute archive or grant authority to stage, commit, push, or publish.
|
|
53
|
+
- Decision Records are for hard-to-reverse choices with real tradeoffs; they do not duplicate current facts.
|
|
54
|
+
- Change Spec deltas are planning aids and are never promoted automatically into Specs or Decision Records.
|
|
55
|
+
- Keep task history, debugging notes, and transient execution state out of Specs and Decision Records.
|
|
56
|
+
- Generated indexes and archives are not current-truth owners.
|
|
57
|
+
|
|
58
|
+
## Continuation and conflicts
|
|
59
|
+
|
|
60
|
+
- When execution stops with accepted work remaining, return one compact continuation with the semantic fields `WorkRef`, `Authority`, `Current state`, `Changed artifacts`, `Fresh verification`, `Blockers`, and `Next action`. Keep this field order, but localize the human-facing title and labels to the response language without changing referenced artifact prose or canonical technical values. Reopen its authority pointers, inspect drift, and refresh verification before resuming; it is not durable truth or a second state store.
|
|
61
|
+
- Write a continuation file only when explicitly authorized. Never persist hidden handoff or controller state.
|
|
62
|
+
- If an active merge, rebase, or cherry-pick conflict intersects authorized implementation, inspect the exact operation and conflicted paths, then compare base/ours/theirs semantics in that operation. Resolve only evidenced in-scope content while preserving unrelated work.
|
|
63
|
+
- Stop on unrelated user work, an unresolved product decision, incomplete side/base evidence, or scope beyond the WorkRef. Name the exact conflict and required owner input; do not choose a side, stage a resolution, continue or abort the Git operation, commit, or infer any Git authority.
|
|
64
|
+
- After an authorized working-tree resolution, rerun affected checks and return the continuation. Conflict-resolution authority alone does not grant Git continuation or delivery.
|
|
65
|
+
|
|
66
|
+
## Safety
|
|
67
|
+
|
|
68
|
+
- Do not create RSP-managed files directly when a command owns the operation.
|
|
69
|
+
- Do not create archive entries directly; use `npx -y @oevery/rsp archive <name>`.
|
|
70
|
+
- Do not modify content outside the managed RSP block in `AGENTS.md` unless explicitly requested.
|
|
71
|
+
- Archive reports warnings but does not grant commit, push, publication, deletion, or external approval authority.
|
package/skills/rsp/SKILL.md
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rsp
|
|
3
3
|
description: Use this skill when initializing RSP, operating an existing .rsp project, auditing or repairing .rsp state, or deciding whether a change needs durable updates before archive.
|
|
4
|
-
|
|
5
|
-
agents:
|
|
6
|
-
- any agent that supports the Agent Skills format
|
|
7
|
-
requirements:
|
|
8
|
-
- Node.js 18+
|
|
9
|
-
- local filesystem read/write access
|
|
10
|
-
- shell access for `rsp` or `npx -y @oevery/rsp`
|
|
11
|
-
optional_requirements:
|
|
12
|
-
- network access for first-run `npx` installation or skill refresh
|
|
4
|
+
license: MIT
|
|
13
5
|
metadata:
|
|
14
6
|
author: oevery
|
|
15
|
-
version:
|
|
7
|
+
version: "2026.07.24.1"
|
|
16
8
|
---
|
|
17
9
|
|
|
18
10
|
# RSP Skill
|
|
19
11
|
|
|
20
12
|
Load this skill when you need to initialize RSP, operate `.rsp/`, audit or repair RSP state, or make a durable-update decision before archive.
|
|
21
13
|
|
|
22
|
-
This skill
|
|
14
|
+
This skill is the preferred operational guide. `.rsp/rsp-rules.md` is the only runtime fallback protocol when this skill is unavailable; old projects migrate to it with `rsp update`.
|
|
23
15
|
|
|
24
16
|
Prefer exact file paths, exact commands, and exact durable facts over vague summaries.
|
|
25
17
|
|
|
18
|
+
Choose response language and artifact language independently. Render human-facing response headings, field labels, explanations, and conclusions in the language explicitly requested for the response; otherwise follow response-specific project instructions, then the conversation language. Write artifact prose in the language explicitly requested for that artifact; otherwise follow artifact-specific project instructions, then the existing artifact's language, then the conversation language. Preserve canonical RSP artifact headings, keywords, identifiers, paths, commands, and machine-consumed values unchanged. Response-only Continuation and Durable Decision headings and labels are not canonical artifact headings and must be localized.
|
|
19
|
+
|
|
20
|
+
Write persistent artifacts in domain, system, user, or operator language. Mention AI or agents only when they are actual product actors, consumers, interface participants, or constraints; using AI to perform the work is not itself a durable fact.
|
|
21
|
+
|
|
26
22
|
## When to use
|
|
27
23
|
|
|
28
24
|
- Use for RSP setup, repair, focused RSP work, and pre-archive durable decisions.
|
|
@@ -33,7 +29,43 @@ Prefer exact file paths, exact commands, and exact durable facts over vague summ
|
|
|
33
29
|
- Do not load for general coding tasks unrelated to `.rsp/`.
|
|
34
30
|
- Do not load when the repository does not use RSP and the user did not ask to adopt it.
|
|
35
31
|
- Do not create an RSP change for a simple current-session task unless the user explicitly wants RSP tracking.
|
|
36
|
-
- Do not
|
|
32
|
+
- Do not treat this skill or the fallback protocol as a replacement for nearest project `AGENTS.md` instructions or relevant module `CONTEXT.md`.
|
|
33
|
+
|
|
34
|
+
## Derive one next action
|
|
35
|
+
|
|
36
|
+
Before operating the workflow, derive the current stage from user intent, nearest project authority, `rsp status --json`, the selected Change's readiness, fresh verification evidence, and blockers. Stages are derived guidance, never persisted state.
|
|
37
|
+
|
|
38
|
+
### Route implementation evidence
|
|
39
|
+
|
|
40
|
+
When work has reached implementation, classify the decisive evidence before selecting a capability:
|
|
41
|
+
|
|
42
|
+
- **Diagnosis:** an observed failure is reproducible or materially evidenced, but its cause or owning layer remains unexplained. Conflicting, intermittent, or multi-layer symptoms also take this branch. Select `rsp-diagnose` only when it is available; otherwise use the manual diagnosis fallback: reproduce, locate, test the smallest discriminating hypothesis, and return the evidenced cause without speculative production edits.
|
|
43
|
+
- **TDD:** there is no unexplained failure, the required or corrected behavior is clear, and test-first work is explicitly required by the user, selected Change, or project instructions, or a concrete changed risk makes an observed pre-mutation RED materially safer. Concrete risks include public APIs or protocols, persisted data, security or money, concurrency or cancellation, complex state transitions, and defects that escaped to production. Select `rsp-tdd` only when it is available; otherwise use the manual TDD fallback: observe the focused RED, make the minimum GREEN change, optionally REFACTOR while green, then rerun required checks. Behavior being testable, a test being possible, or the work being a fix is not sufficient by itself.
|
|
44
|
+
- **Ordinary implementation:** this is the default when diagnosis does not apply and no TDD gate above is met. Continue with ordinary `rsp-implement` when the required behavior, cause, or edit is sufficiently evidenced, or use the single manual implementation/verification action when that Skill is unavailable.
|
|
45
|
+
|
|
46
|
+
Diagnosis takes precedence over TDD: do not encode an unexplained symptom as a guessed regression test. Fresh verification is required, but a new test is only one evidence option; prefer the cheapest decisive existing test, static check, build, or acceptance evidence that covers the changed risk. Each branch returns its evidence, Tasks, Verify updates, and unresolved Blockers to the same selected Change. Capability availability changes execution assistance, not the owner or required outcome.
|
|
47
|
+
|
|
48
|
+
### Route release documentation
|
|
49
|
+
|
|
50
|
+
Use the release-documentation branch only when the selected Change explicitly owns a confirmed release identity or range and still has unfinished changelog, release-note, or migration work. Lifecycle stage, completed implementation, or archive readiness alone is insufficient; ordinary Changes continue to the Core durable decision.
|
|
51
|
+
|
|
52
|
+
When both conditions hold, select `rsp-release-docs` when available. Otherwise use the manual release-documentation fallback against the same Change: confirm the release range and audience, build one net-release evidence ledger, and project it into the repository-owned changelog, release notes, and applicable migration guidance. This route prepares or audits documentation only; it does not grant commit, tag, push, release creation, publication, deployment, or approval authority.
|
|
53
|
+
|
|
54
|
+
Apply these gates in order:
|
|
55
|
+
|
|
56
|
+
1. If authority, selection, or a material owner decision is ambiguous, return the one decision or evidence needed to proceed. If a declared blocker prevents the next operation, return its owning artifact or person; do not route around it.
|
|
57
|
+
2. If the user explicitly requests managed continuation, select `rsp-manage` only when it is available. Its eligibility gate activates only for one focused ready Change with genuinely independent slices, long authorized continuation, or interruption recovery; an ineligible request returns the exact ordinary Core or Discipline next action without mutation or controller artifacts. Managed routing is never implicit and grants no lifecycle, Git, publication, deployment, approval, or human-acceptance authority.
|
|
58
|
+
3. If the user requests a report-only review against a fixed scope, select `rsp-review` only when it is available; otherwise name the manual read-only review and return its findings to the selected Change's Tasks, Verify, or Blockers.
|
|
59
|
+
4. If no Change is selected, use the status plan to name one ready WorkRef and the direct focus action. For tiny settled work, return the direct engineering action without creating RSP state. For unclear non-trivial work, select `rsp-shape` only when it is available and the user authorized its Change mutation; otherwise give the manual fallback of creating or refining one Change.
|
|
60
|
+
5. If the user or Shape has isolated one material domain, module/seam, or evidence-seeking design question for the selected Change, select `rsp-design` when available; otherwise return the compact manual design fallback: inspect project authority and the live path, compare credible alternatives, separate evidence from owner choice, and return the result to the same WorkRef without implementation or durable-truth mutation.
|
|
61
|
+
6. If the selected Change is not shape-ready and no bounded design question has been isolated, select `rsp-shape` under the same authority rule or give the manual fallback of completing its Proposal, Spec, Design, Tasks, Verify, and Blockers.
|
|
62
|
+
7. If a shape-ready Change has incomplete implementation tasks, or its required verification is missing, stale, or failed, apply the implementation-evidence routing above. Select only its resulting available capability when authorized; otherwise name its manual fallback owned by that Change.
|
|
63
|
+
8. If implementation Tasks and required verification pass with no blocker, and the selected Change meets both release-documentation conditions above, select `rsp-release-docs` under the same availability rule or use its manual fallback. Return its evidence and artifact dispositions to the same Change.
|
|
64
|
+
9. Otherwise, when required Tasks and verification pass with no blocker, perform the Core durable decision. Archive only after required current facts and rationale are written or explicitly judged unnecessary. Recommend explicit archive as the next action before final Git delivery; Core does not execute archive or grant authority to stage, commit, push, or publish.
|
|
65
|
+
|
|
66
|
+
State the derived stage, one next action, required input, returned owner, and decisive evidence. Name at most one available optional capability. Only name an optional capability when it is the one next action, and treat it as available only when it appears in the host's loaded skill inventory. Missing optional capabilities never invalidate RSP; always provide the manual fallback against the same owner.
|
|
67
|
+
|
|
68
|
+
Do not preload, enumerate, or recursively invoke optional capabilities. Do not infer implementation, review, Git, publication, or approval authority from routing, readiness, or capability availability.
|
|
37
69
|
|
|
38
70
|
## Workflows
|
|
39
71
|
|
|
@@ -41,45 +73,100 @@ Prefer exact file paths, exact commands, and exact durable facts over vague summ
|
|
|
41
73
|
|
|
42
74
|
1. Initialize with `npx -y @oevery/rsp init [--agents-mode managed|print] [--with-project-setup]`.
|
|
43
75
|
2. `--with-project-setup` creates and focuses `changes/project-setup.md`; otherwise create it with `npx -y @oevery/rsp create project-setup` only when explicit bootstrap tracking is still needed.
|
|
44
|
-
3. Fill the bootstrap change if it exists,
|
|
76
|
+
3. Fill the bootstrap change if it exists, write durable architecture facts to `.rsp/specs/design.md`, and keep stable scoped operating instructions in the nearest project-owned `AGENTS.md`.
|
|
45
77
|
4. For diagnostics, run `npx -y @oevery/rsp doctor`.
|
|
46
78
|
5. For safe deterministic repairs, run `npx -y @oevery/rsp doctor --fix` or `npx -y @oevery/rsp update`.
|
|
47
|
-
6. When auditing manually, verify `.rsp
|
|
79
|
+
6. When auditing manually, verify `.rsp/`, managed roots, and nested Spec parents are real directories; the project `AGENTS.md`, managed markers, fallback/config files, indexes, and placeholders are regular files; `AGENTS.md` has the managed block; `specs/design.md` and the configured Decision Record directory exist; every group has one valid brief with matching direct children; work and archive trees are flat or one group level; and `focus.d/` markers match executable Changes.
|
|
48
80
|
7. Treat `doctor --fix` `fixed` entries as actual filesystem changes. An empty `fixed` array or `No safe fixes needed.` means the repair pass changed nothing.
|
|
49
81
|
8. Do not use repair commands for semantic decisions such as stale focus removal, durable updates, or archive readiness.
|
|
50
82
|
|
|
51
83
|
### Focused work
|
|
52
84
|
|
|
53
|
-
1. Follow the read order
|
|
85
|
+
1. Follow the managed `AGENTS.md` read order: nearest instructions, relevant context, this skill or fallback protocol, focus, optional sibling Group Brief, selected Change, then relevant Specs and Decision Records.
|
|
54
86
|
2. Treat only `focus.d/` markers as current RSP work; do not treat unfocused files in `changes/` as current work unless the user explicitly asks or you run `npx -y @oevery/rsp focus <name>`.
|
|
55
|
-
3.
|
|
56
|
-
4.
|
|
57
|
-
5.
|
|
58
|
-
6.
|
|
59
|
-
7. Use `npx -y @oevery/rsp
|
|
60
|
-
8.
|
|
61
|
-
9.
|
|
62
|
-
10.
|
|
63
|
-
11.
|
|
87
|
+
3. Resolve executable Change names as either `<change>` or one direct `<group>/<change>` child. Require a real `changes/` root and real existing `focus.d/`, `archives/`, and group prefixes; reject symlinks, incomplete inspection, deeper paths, and file/directory identity collisions.
|
|
88
|
+
4. Use a Change Group only for at least two independently executable Changes sharing one goal or completion contract. Create it with `npx -y @oevery/rsp group create <group> [goal]`, then replace the brief placeholders and declare every direct child identity and boundary under `Slices` before creating children.
|
|
89
|
+
5. Treat logical `<group>/brief`, physically stored as `<group>/00-brief.md`, as non-executable and non-focusable. For grouped work, read it before the selected child Change. Its `Slices` declaration order guides navigation; a Brief blocker is inherited as an external blocker by every direct child without creating edges. Archive children independently, then close only the brief with `npx -y @oevery/rsp group close <group>` when all group gates pass.
|
|
90
|
+
6. Declare an exact prerequisite only as `- requires \`<change-work-ref>\`: <reason>` under the dependent Change's `Blockers`. Targets must be executable Changes, not Group Briefs. Keep external blockers as ordinary prose and never infer an edge from them.
|
|
91
|
+
7. Use `npx -y @oevery/rsp status --json` as the derived dependency view. Read `plan.nodes`, `plan.ready`, `plan.edges`, `plan.blocked`, and `plan.waves`; nodes distinguish selected Changes from prerequisite context, and each edge reads as “`change` requires `requires`” with `reason` and `state`. Filtered plans retain the transitive prerequisite closure needed to explain the selection. Human status renders the same flat graph as a dependency forest; do not infer nested JSON ownership from that presentation. Do not create or maintain a separate graph or copy live delivery state into a Group Brief. Archived prerequisites resolve without rewriting the dependent Change, while incomplete archive inspection produces no ready plan.
|
|
92
|
+
8. Read the focused change before editing code.
|
|
93
|
+
9. If a focused change is missing an explicit `kind`, repair the frontmatter before continuing.
|
|
94
|
+
10. Run `npx -y @oevery/rsp check --focused` before treating focused work as ready; resolve dependency errors, placeholders, or clarification warnings when they represent real unfinished content.
|
|
95
|
+
11. Treat `rsp check` warnings as deterministic hygiene signals, not as the durable-update decision.
|
|
96
|
+
12. Use `npx -y @oevery/rsp create <name> --lite` only when the user explicitly wants RSP tracking for a small, straightforward change.
|
|
97
|
+
13. Convert actionable `## Tasks` checkboxes into your agent-local task tracker when one is available.
|
|
98
|
+
14. Keep implementation sequential by default; parallelize only independent read-only discovery or mechanical checks.
|
|
99
|
+
15. Update `## Tasks`, `## Verify`, and any invalidated `## Proposal`, `## Spec`, or `## Design` content in the same working session as implementation facts change.
|
|
100
|
+
16. Keep the selected Change as a convergent snapshot of the current plan and final decisive evidence. Replace stale or superseded content; keep routine attempts, RED/GREEN loops, command transcripts, and correction chronology in the response, then compress any material history to final outcomes, coverage, omissions, and unresolved risks before archive.
|
|
101
|
+
17. Keep temporary debugging notes, task history, and command transcripts out of `specs/` and project-owned `AGENTS.md` instructions.
|
|
102
|
+
|
|
103
|
+
### Route artifacts by owner
|
|
104
|
+
|
|
105
|
+
Use one semantic routing matrix throughout shaping, execution, and pre-archive review:
|
|
106
|
+
|
|
107
|
+
| Content | Owner | Boundary |
|
|
108
|
+
| --- | --- | --- |
|
|
109
|
+
| Planned future design | selected Change `## Design` | Never write planned state as current truth. |
|
|
110
|
+
| Implemented stable current facts | smallest relevant Spec, usually `.rsp/specs/design.md` or an existing domain Spec | Write only observed stable facts under authority. |
|
|
111
|
+
| Lasting rationale and tradeoffs | one exact file under `durableReview.decisionRecordsPath` | Judge independently from current facts; do not duplicate them. |
|
|
112
|
+
| Stable scoped navigation or current context | project-owned `CONTEXT.md`, when that convention exists | Preserve project ownership and edit only with explicit authority. |
|
|
113
|
+
| Stable operating instructions | nearest project-owned `AGENTS.md` outside the managed RSP block | Preserve project ownership and edit only with explicit authority. |
|
|
114
|
+
| Temporary execution state | response continuation | Not durable truth; write a file only when explicitly authorized. |
|
|
115
|
+
|
|
116
|
+
When accepted work remains, return this compact artifact-scoped continuation in the response:
|
|
117
|
+
|
|
118
|
+
```md
|
|
119
|
+
## <localized RSP Continuation heading>
|
|
120
|
+
- <localized WorkRef label>: <selected Change>
|
|
121
|
+
- <localized Authority label>: <project, Change, Spec, decision, or report pointers>
|
|
122
|
+
- <localized Current state label>: <completed, partial, failed, unavailable, or blocked plus decisive state>
|
|
123
|
+
- <localized Changed artifacts label>: <paths or none>
|
|
124
|
+
- <localized Fresh verification label>: <command and result, or pending reason>
|
|
125
|
+
- <localized Blockers label>: <exact blocker and owner, or none>
|
|
126
|
+
- <localized Next action label>: <smallest bounded action and owner>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Treat this continuation shape as semantic field order rather than fixed English wording. Localize its human-facing title and labels to the response language while preserving WorkRefs, paths, commands, identifiers, and machine-consumed values. A localized label may retain a technical token in parentheses but must not use that English token alone; for example, use `工作引用(WorkRef)` in a Chinese response. Do not use the response language to rewrite referenced project artifact prose.
|
|
130
|
+
|
|
131
|
+
The continuation points to existing owners; it is not a second state store. On resume, reopen every authority pointer, inspect worktree and artifact drift, and refresh any verification supporting the next action. Never create hidden handoff/controller state or persist the continuation without explicit path authority.
|
|
132
|
+
|
|
133
|
+
### Handle an active Git conflict
|
|
134
|
+
|
|
135
|
+
When a merge, rebase, or cherry-pick conflict intersects authorized implementation:
|
|
136
|
+
|
|
137
|
+
1. Inspect the exact Git operation, conflicted paths, current index/worktree, and pre-existing user changes.
|
|
138
|
+
2. Interpret base, ours, and theirs in that operation; trace the relevant behavior and authority instead of choosing a side mechanically.
|
|
139
|
+
3. Resolve only evidenced content inside the WorkRef and mutation authority. Preserve unrelated work and do not stage the resolution unless separately authorized.
|
|
140
|
+
4. Stop when the conflict includes unrelated user work, an unresolved product decision, incomplete side/base evidence, or out-of-scope content. Return the exact conflict and required owner input in the continuation.
|
|
141
|
+
5. After an authorized working-tree resolution, rerun affected checks and return their fresh result.
|
|
142
|
+
|
|
143
|
+
Do not continue or abort the Git operation, commit, push, or infer Git delivery authority from implementation or conflict-resolution authority. RSP does not need a separate merge-conflict Skill for this fallback.
|
|
64
144
|
|
|
65
145
|
### Pre-archive durable decision
|
|
66
146
|
|
|
67
147
|
1. Run `npx -y @oevery/rsp check --focused` for focused work, or `npx -y @oevery/rsp check` when reviewing all open changes.
|
|
68
148
|
2. Run `npx -y @oevery/rsp show --focused --json` or `npx -y @oevery/rsp ready <name> --json` to collect readiness, warnings, context paths, and `durableReview` guidance.
|
|
69
|
-
3. Treat `durableReview.
|
|
149
|
+
3. Treat `durableReview.factCandidateTargets` and `durableReview.decisionRecordsPath` as advisory routing context, not as permission to edit generated indexes or invent a Decision Record filename.
|
|
70
150
|
4. Treat `Spec` delta markers (`### ADDED`, `### MODIFIED`, `### REMOVED`) as planning aids only; do not merge them automatically.
|
|
71
|
-
5. Read only the current
|
|
151
|
+
5. Read only the current Change, relevant Specs and Decision Records, nearest project-owned `AGENTS.md`, and code files needed for the semantic decision.
|
|
72
152
|
6. Produce the durable decision output before archiving.
|
|
73
153
|
|
|
74
154
|
## Durable decision
|
|
75
155
|
|
|
76
|
-
|
|
156
|
+
Choose one current-fact decision and one rationale decision independently.
|
|
77
157
|
|
|
78
|
-
|
|
79
|
-
- `Update existing spec or rule`
|
|
80
|
-
- `Create a new durable spec` only when the knowledge is project-level, reusable, and does not fit `specs/design.md`, an existing spec, or a rule file
|
|
158
|
+
Current facts:
|
|
81
159
|
|
|
82
|
-
|
|
160
|
+
- `No current-fact update needed`
|
|
161
|
+
- `Update existing spec or scoped instruction`
|
|
162
|
+
- `Create a new durable spec` only when the knowledge is project-level, reusable, and does not fit `specs/design.md`, an existing spec, or a scoped project instruction
|
|
163
|
+
|
|
164
|
+
Rationale:
|
|
165
|
+
|
|
166
|
+
- `No Decision Record needed`
|
|
167
|
+
- `Create or update a Decision Record`
|
|
168
|
+
|
|
169
|
+
Prefer no update on either axis when there is no concrete stable fact or lasting rationale worth rereading.
|
|
83
170
|
|
|
84
171
|
Write a durable update only when one of these is true:
|
|
85
172
|
|
|
@@ -88,52 +175,47 @@ Write a durable update only when one of these is true:
|
|
|
88
175
|
- future agents or developers would likely make mistakes without the fact
|
|
89
176
|
- the fact is worth rereading in later sessions as durable project knowledge
|
|
90
177
|
|
|
91
|
-
|
|
178
|
+
Create or update a Decision Record only when the choice is hard to reverse, would be surprising without context, and reflects a real tradeoff. Decision Records own rationale, alternatives, tradeoffs, and consequences; Specs own what is currently true.
|
|
179
|
+
|
|
180
|
+
Apply the artifact-routing matrix and choose the smallest correct target:
|
|
92
181
|
|
|
93
182
|
- project-wide design, boundaries, defaults, and durable context -> `.rsp/specs/design.md`
|
|
94
|
-
- stable
|
|
95
|
-
-
|
|
183
|
+
- stable project or module operating instructions -> nearest project-owned `AGENTS.md`, only with authority to edit its non-managed content
|
|
184
|
+
- stable navigation or scoped current context -> project-owned `CONTEXT.md`, only when the project uses it and authority permits the edit
|
|
96
185
|
- an additional reusable project-level spec -> `.rsp/specs/<name>.md`
|
|
186
|
+
- lasting rationale -> one exact Markdown file under `durableReview.decisionRecordsPath`
|
|
97
187
|
|
|
98
|
-
Do not choose generated indexes
|
|
188
|
+
Do not choose generated indexes, `.rsp/rsp-rules.md`, or the managed RSP block in `AGENTS.md` as ordinary durable writeback targets.
|
|
99
189
|
|
|
100
190
|
Prefer `.rsp/specs/design.md` or an existing durable file before creating a new spec file.
|
|
101
191
|
|
|
102
|
-
Write stable facts, not narrative history, task-by-task notes, temporary debugging history, or archive-only detail. If you cannot identify concrete durable
|
|
192
|
+
Write stable facts or lasting rationale, not narrative history, task-by-task notes, temporary debugging history, or archive-only detail. Do not duplicate current facts into a Decision Record or rationale into a Spec. If you cannot identify concrete durable content, do not invent it.
|
|
103
193
|
|
|
104
194
|
## Output template
|
|
105
195
|
|
|
106
|
-
Use this exact
|
|
196
|
+
Use these semantic fields in this exact order. Localize the heading and human-facing labels to the response language; preserve the decision values shown in angle brackets as canonical values.
|
|
107
197
|
|
|
108
198
|
```md
|
|
109
|
-
## Durable Decision
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
- <
|
|
114
|
-
-
|
|
115
|
-
|
|
116
|
-
-
|
|
199
|
+
## <localized Durable Decision heading>
|
|
200
|
+
- <localized Current facts label>: <No current-fact update needed | Update existing spec or scoped instruction | Create a new durable spec>
|
|
201
|
+
- <localized Current-fact target label>: <exact file path or N/A>
|
|
202
|
+
- <localized Facts to write label>:
|
|
203
|
+
- <durable fact or none>
|
|
204
|
+
- <localized Decision Record label>: <No Decision Record needed | Create or update a Decision Record>
|
|
205
|
+
- <localized Decision Record target label>: <exact file path or N/A>
|
|
206
|
+
- <localized Rationale to write label>:
|
|
207
|
+
- <lasting rationale or none>
|
|
208
|
+
- <localized Archive ready label>: <yes | no>
|
|
117
209
|
```
|
|
118
210
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
```md
|
|
122
|
-
## Durable Decision
|
|
123
|
-
- Decision: Update existing spec or rule
|
|
124
|
-
- Target: .rsp/specs/design.md
|
|
125
|
-
- Why:
|
|
126
|
-
- The change introduced a stable default that future agents must follow.
|
|
127
|
-
- Facts to write:
|
|
128
|
-
- Default API retries are capped at 3 attempts.
|
|
129
|
-
- Archive ready: no
|
|
130
|
-
```
|
|
211
|
+
These are response labels, not canonical RSP artifact headings. A localized label may retain its technical field identity in parentheses; for example, a Chinese response may use `## 持久化决策`, `决策记录(Decision Record)`, and `可归档(Archive ready)`, but not their English labels alone.
|
|
131
212
|
|
|
132
213
|
Rules for the output:
|
|
133
214
|
|
|
134
|
-
-
|
|
215
|
+
- Each target must be an exact file path when its decision requires an update; `durableReview.decisionRecordsPath` is a directory, not the final target.
|
|
135
216
|
- `Facts to write` must contain durable facts, not task history or debugging notes.
|
|
136
|
-
-
|
|
137
|
-
- If
|
|
217
|
+
- `Rationale to write` must contain lasting rationale, alternatives, tradeoffs, or consequences, not a duplicate of current facts.
|
|
218
|
+
- If real blockers remain or a required fact or rationale update is not yet written, `Archive ready` must be `no`.
|
|
219
|
+
- If neither axis has a missing update and remaining verify risk is consciously accepted, `Archive ready` may be `yes`.
|
|
138
220
|
- Do not use CLI warning text as a substitute for semantic durable-update judgment.
|
|
139
221
|
- CLI `archiveReady: judgment` means the skill or a human must decide; it is not automatic approval.
|