@oevery/rsp 2.0.3 → 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 +214 -61
- package/README.zh-CN.md +196 -59
- package/bin/rsp.mjs +2 -2
- package/dist/chunk-QLXIDVKK.mjs +2618 -0
- package/dist/cli.mjs +2466 -1230
- 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 -95
- package/skills/rsp/SKILL.md +164 -119
- 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,103 +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
|
-
|
|
16
|
-
## Read order
|
|
17
|
-
|
|
18
|
-
1. Read `AGENTS.md`.
|
|
19
|
-
2. Read `.rsp/rules/rsp-rules.md` in full.
|
|
20
|
-
3. Read `focus.d/`.
|
|
21
|
-
4. If `focus.d/` is empty, ask the user what to work on or suggest `npx -y @oevery/rsp create <name>`.
|
|
22
|
-
5. Read each `changes/<name>.md` file marked in `focus.d/`.
|
|
23
|
-
6. Read `specs/design.md` and `specs/INDEX.md`.
|
|
24
|
-
`specs/INDEX.md` lists only additional spec files beyond `specs/design.md`.
|
|
25
|
-
7. Read only the relevant additional `rules/` and `specs/` files.
|
|
26
|
-
|
|
27
|
-
## Core rules
|
|
28
|
-
|
|
29
|
-
- 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/`.
|
|
30
15
|
- Treat `focus.d/` as the only current-focus source.
|
|
31
|
-
-
|
|
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
|
-
- `rsp archive <name>` never blocks. It warns but always completes the move.
|
|
89
|
-
- Make a durable-update decision before `npx -y @oevery/rsp archive <name>`.
|
|
90
|
-
- If `Blockers` still contains a real blocker, set `Archive ready: no`.
|
|
91
|
-
- If the change produced durable knowledge that has not been written to `specs/` or `rules/`, set `Archive ready: no`.
|
|
92
|
-
- If `Verify` is incomplete but there is no active blocker and no missing durable update, treat archive readiness as a judgment call.
|
|
93
|
-
- A durable update should contain stable facts only, not task history, debugging notes, or one-off implementation context.
|
|
94
|
-
- Default to no spec writeback unless the change produced project-level durable knowledge that future work must reread.
|
|
95
|
-
|
|
96
|
-
## Prohibitions
|
|
97
|
-
|
|
98
|
-
- Do not create placeholder or empty-shell files merely for completeness.
|
|
99
|
-
- Do not create archive entries directly under `.rsp/archives/`; use `npx -y @oevery/rsp archive <name>`.
|
|
100
|
-
- Do not create spec files that duplicate `specs/design.md` or another durable file.
|
|
101
|
-
- Do not create a catch-all summary file like `specs/changes.md`.
|
|
102
|
-
- Do not create supplementary files alongside a single change file.
|
|
103
|
-
- 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.
|