@xenonbyte/req-2-plan 0.6.0 → 0.6.1

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 CHANGED
@@ -43,7 +43,7 @@ important behavior, or when you want a durable handoff between agents.
43
43
  - **Four supported platforms**: installs matching surfaces for Claude Code (`claude`), Codex (`codex`), Gemini (`gemini`), and opencode (`opencode`).
44
44
  - **One lifecycle CLI**: `r2p install`, `r2p uninstall`, `r2p status`, `r2p version`, and `r2p help`.
45
45
  - **Manifest-backed install safety**: pre-existing files are backed up, and uninstall removes only managed paths.
46
- - **Project Context Pack**: `--repo-path` captures real repository facts for tiering and PLAN checks.
46
+ - **Project Context Pack**: real repository facts (the current directory by default, or `--repo-path <dir>`) ground tiering and PLAN checks.
47
47
  - **Repair paths**: reopen closed runs, route upstream gaps, and resolve repaired decisions.
48
48
  - **Execution handoff**: `r2p-execute` can drive an approved PLAN through an in-place implementation loop.
49
49
 
@@ -109,20 +109,19 @@ r2p install --platform claude,codex,gemini,opencode
109
109
  Install the platform skills, then start a workflow from your agent:
110
110
 
111
111
  ```text
112
- /r2p-start --repo-path . "Add rate limiting"
112
+ /r2p-start "Add rate limiting"
113
113
  /r2p-continue
114
114
  ```
115
115
 
116
116
  Start from a requirement file instead of inline text:
117
117
 
118
118
  ```text
119
- /r2p-start --repo-path . --file change-req.md
119
+ /r2p-start --file change-req.md
120
120
  ```
121
121
 
122
- For repositories used as requirement context, pass `--repo-path`. Use `.` for the
123
- current repository or a path to the target repository for cross-project work.
124
- This builds the Project Context Pack used by tier estimation and PLAN reference
125
- checks.
122
+ Tier estimation and the Project Context Pack are grounded in the current
123
+ directory by default. Pass `--repo-path <dir>` to ground them in a different
124
+ repository instead - for example, a target repository for cross-project work.
126
125
 
127
126
  The workflow stops whenever it needs a human or agent action: tier lock,
128
127
  artifact content, quality-gate repair, checkpoint approval, subagent review, or
package/README.zh-CN.md CHANGED
@@ -38,7 +38,7 @@ AI agent 执行很快,但模糊需求容易变成含糊计划、隐藏范围
38
38
  - **支持 4 个平台**:为 Claude Code(`claude`)、Codex(`codex`)、Gemini(`gemini`)、opencode(`opencode`)安装匹配入口。
39
39
  - **单一生命周期 CLI**:`r2p install`、`r2p uninstall`、`r2p status`、`r2p version`、`r2p help`。
40
40
  - **Manifest-backed 安装安全**:覆盖前备份已存在文件,卸载只删除受管路径。
41
- - **Project Context Pack**:`--repo-path` 捕获真实仓库事实,用于 tier 估算和 PLAN 校验。
41
+ - **Project Context Pack**:以真实仓库事实(默认当前目录,或用 `--repo-path <dir>`)支撑 tier 估算和 PLAN 校验。
42
42
  - **修复路径**:可重开 closed run、路由上游缺口,并关闭已修复的决策路线。
43
43
  - **执行交接**:`r2p-execute` 可以把获批 PLAN 接入当前分支上的实现循环。
44
44
 
@@ -101,18 +101,18 @@ r2p install --platform claude,codex,gemini,opencode
101
101
  安装平台 skill 后,在 agent 里启动一次工作流:
102
102
 
103
103
  ```text
104
- /r2p-start --repo-path . "Add rate limiting"
104
+ /r2p-start "Add rate limiting"
105
105
  /r2p-continue
106
106
  ```
107
107
 
108
108
  也可以从需求文件启动,而不是传内联文本:
109
109
 
110
110
  ```text
111
- /r2p-start --repo-path . --file change-req.md
111
+ /r2p-start --file change-req.md
112
112
  ```
113
113
 
114
- 只要需求以代码仓库为上下文,就传 `--repo-path`。当前仓库传 `.`,跨项目需求传目标仓库路径。
115
- 这会构建 Project Context Pack,供 tier 估算和 PLAN 引用校验使用。
114
+ tier 估算和 Project Context Pack 默认以当前目录为基准。传 `--repo-path <dir>`
115
+ 可改为以另一个仓库为基准——例如跨项目需求里的目标仓库。
116
116
 
117
117
  工作流会在需要人或 agent 动作时停下:锁定 tier、填写 artifact、修复 quality gate、
118
118
  批准 checkpoint、执行 subagent review,或解决 gap。按输出里的 `next:` 命令执行,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenonbyte/req-2-plan",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Requirement-to-PLAN workflow CLI and agent integration installer.",
5
5
  "bin": {
6
6
  "r2p": "bin/r2p.js"
@@ -936,9 +936,9 @@ def _cmd_gap_open(args):
936
936
  )
937
937
  mgr.save(record)
938
938
  except Exception as e:
939
- run_md_path.write_text(run_md_before, encoding="utf-8")
939
+ atomic_write_text(run_md_path, run_md_before)
940
940
  for _d, _aa, _artifact_file, artifact_path, artifact_before in reversed(affected):
941
- artifact_path.write_text(artifact_before, encoding="utf-8")
941
+ atomic_write_text(artifact_path, artifact_before)
942
942
  print_and_exit(
943
943
  format_error(
944
944
  f"Cannot gap-open: failed to mark downstream stale atomically ({e})",
@@ -18,6 +18,7 @@ from pathlib import Path
18
18
  from typing import Any
19
19
 
20
20
  from tools.workflow_cli.version import R2P_VERSION
21
+ from tools.workflow_cli.atomic import atomic_write_text
21
22
 
22
23
 
23
24
  # ---------------------------------------------------------------------------
@@ -1120,6 +1121,6 @@ def _safe_write(
1120
1121
  backup = _backup_path(backup_dir, dest)
1121
1122
  shutil.copy2(str(dest), str(backup))
1122
1123
  backups.append({"target": str(dest), "backup": str(backup)})
1123
- dest.write_text(content, encoding="utf-8")
1124
+ atomic_write_text(dest, content)
1124
1125
  installed_paths.append(str(dest))
1125
1126
  written.append(dest)
@@ -1 +1 @@
1
- R2P_VERSION = "0.6.0"
1
+ R2P_VERSION = "0.6.1"