ralphy-spec 0.1.0 → 0.1.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.ja.md ADDED
@@ -0,0 +1,182 @@
1
+ # ralphy-spec
2
+
3
+ [English](README.md) | [简体中文](README.zh.md) | [한국어](README.ko.md) | [日本語](README.ja.md)
4
+
5
+ 以下のツール向けに **Ralph ループ + OpenSpec** ワークフローを1つのコマンドでセットアップ:
6
+ - Cursor
7
+ - OpenCode
8
+ - Claude Code
9
+
10
+ **ウェブサイト:** [https://ralphy-spec.org](https://ralphy-spec.org)
11
+
12
+ ## Ralphy-Specとは?
13
+
14
+ Ralphy-Specは2つの強力なAI開発方法論を組み合わせています:
15
+
16
+ ### Ralph Wiggumループ
17
+
18
+ Ralph方法論([Geoffrey Huntley](https://ghuntley.com/ralph)が提唱)は、AIエージェントがタスクを完了するまで**同じプロンプトを繰り返し**受け取る開発アプローチです。各イテレーションで、AIはファイルとgit履歴で以前の作業を確認し、自己修正フィードバックループを形成します。
19
+
20
+ ```
21
+ while true; do
22
+ ai_agent "機能Xを構築してください。完了したら<promise>DONE</promise>を出力してください。"
23
+ # AIは以前の作業を見て、ミスを修正し、進捗を続けます
24
+ done
25
+ ```
26
+
27
+ ### OpenSpec(スペック駆動開発)
28
+
29
+ [OpenSpec](https://github.com/Fission-AI/OpenSpec)は、コードの前にスペックを要求することでAIコーディングに構造をもたらします:
30
+ - `openspec/specs/` - 真実の情報源となるスペック
31
+ - `openspec/changes/` - 受け入れ基準を含む変更提案
32
+ - 完了した変更をマージするアーカイブワークフロー
33
+
34
+ ### なぜ組み合わせるのか?
35
+
36
+ | 問題 | 解決策 |
37
+ |------|--------|
38
+ | チャット履歴の曖昧な要件 | OpenSpecが意図を構造化されたスペックに固定 |
39
+ | AIが途中で停止したりミスをする | Ralphループが完了するまでリトライ |
40
+ | 正確性を検証する方法がない | 受け入れ基準 + テストで出力を検証 |
41
+ | ツール固有のセットアップが面倒 | 1つのコマンドでCursor、OpenCode、Claude Codeをセットアップ |
42
+
43
+ ## プロジェクトにインストールされるもの
44
+
45
+ - `openspec/` スキャフォールド:
46
+ - `openspec/specs/`(真実の情報源)
47
+ - `openspec/changes/`(アクティブな変更)
48
+ - `openspec/archive/`(完了した変更)
49
+ - `openspec/project.md`(プロジェクトコンテキスト)
50
+ - ツール統合:
51
+ - Cursor: `.cursor/prompts/ralphy-*.md`
52
+ - Claude Code: `.claude/commands/ralphy-*.md`
53
+ - OpenCode: `AGENTS.md`
54
+ - Ralphループ状態/設定:
55
+ - `.ralphy/config.json`
56
+ - `.ralphy/ralph-loop.state.json`
57
+
58
+ ## インストール
59
+
60
+ ### npm(グローバル)
61
+
62
+ ```bash
63
+ npm install -g ralphy-spec
64
+ ```
65
+
66
+ ### npx(インストール不要)
67
+
68
+ ```bash
69
+ npx ralphy-spec init
70
+ ```
71
+
72
+ ### curlインストールスクリプト
73
+
74
+ ```bash
75
+ curl -fsSL https://raw.githubusercontent.com/anthropics/ralphy-openspec/main/scripts/install.sh | sh
76
+ ```
77
+
78
+ ## 使用方法
79
+
80
+ ### プロジェクトで初期化
81
+
82
+ ```bash
83
+ cd your-project
84
+ ralphy-spec init
85
+ ```
86
+
87
+ 非対話的なツール選択:
88
+
89
+ ```bash
90
+ ralphy-spec init --tools cursor,claude-code,opencode
91
+ ```
92
+
93
+ 既存ファイルの上書き:
94
+
95
+ ```bash
96
+ ralphy-spec init --force
97
+ ```
98
+
99
+ ### セットアップの検証
100
+
101
+ ```bash
102
+ ralphy-spec validate
103
+ ```
104
+
105
+ ### テンプレートの更新
106
+
107
+ ```bash
108
+ ralphy-spec update --force
109
+ ```
110
+
111
+ ## ワークフロー(PRD -> リリース)
112
+
113
+ ```
114
+ PRD/要件 --> OpenSpec(スペック + タスク + 受け入れ基準)
115
+ |
116
+ v
117
+ Ralphループ(テストが通るまで反復)
118
+ |
119
+ v
120
+ アーカイブ(ソーススペックにマージ)
121
+ ```
122
+
123
+ ### 1) 計画:PRD -> OpenSpec変更
124
+
125
+ AIツールで`/ralphy:plan`(Cursor / Claude Code)を使用するか、OpenCodeに`AGENTS.md`に従うよう依頼します。
126
+
127
+ リポジトリでの期待される出力:
128
+
129
+ ```
130
+ openspec/changes/<change-name>/
131
+ proposal.md
132
+ tasks.md
133
+ specs/
134
+ <domain>/
135
+ spec.md
136
+ ```
137
+
138
+ ### 2) 実装:完了するまで反復
139
+
140
+ `/ralphy:implement`を使用してタスクを実装し、テストを追加します。
141
+
142
+ Ralphループランナーで実行する場合、エージェントは**すべてのタスクが完了しテストが通った場合のみ**以下を出力します:
143
+
144
+ ```
145
+ <promise>TASK_COMPLETE</promise>
146
+ ```
147
+
148
+ ### 3) 検証:テストで受け入れ基準を証明
149
+
150
+ `/ralphy:validate`を使用してテストを実行し、通過したテストをOpenSpecシナリオにマッピングします。
151
+
152
+ ### 4) アーカイブ:変更をスペックにマージ
153
+
154
+ `/ralphy:archive`を使用し、利用可能であればOpenSpec CLIを使用します:
155
+
156
+ ```bash
157
+ openspec archive <change-name> --yes
158
+ ```
159
+
160
+ ## 謝辞
161
+
162
+ Ralphy-Specは巨人の肩の上に立っています:
163
+
164
+ - **Ralph Wiggum方法論** - [Geoffrey Huntley](https://ghuntley.com/ralph)が考案。AIエージェントが反復を通じて自己修正できるという洞察は、AI支援開発についての私たちの考え方を変えました。
165
+
166
+ - **[opencode-ralph-wiggum](https://github.com/Th0rgal/opencode-ralph-wiggum)** by [@Th0rgal](https://github.com/Th0rgal) - 私たちの統合アプローチにインスピレーションを与えたOpenCode用のクリーンなRalphループCLI実装。
167
+
168
+ - **[OpenSpec](https://github.com/Fission-AI/OpenSpec)** by [Fission-AI](https://github.com/Fission-AI) - AIコーディングに構造と予測可能性をもたらすスペック駆動開発フレームワーク。
169
+
170
+ これらのアプローチを開拓したこれらのプロジェクトとメンテナーに感謝します。
171
+
172
+ ## 開発
173
+
174
+ ```bash
175
+ npm install
176
+ npm run build
177
+ node bin/ralphy-spec.js --help
178
+ ```
179
+
180
+ ## ライセンス
181
+
182
+ BSD-3-Clause
package/README.ko.md ADDED
@@ -0,0 +1,182 @@
1
+ # ralphy-spec
2
+
3
+ [English](README.md) | [简体中文](README.zh.md) | [한국어](README.ko.md) | [日本語](README.ja.md)
4
+
5
+ 다음 도구를 위한 **Ralph 루프 + OpenSpec** 워크플로우를 한 번의 명령으로 설정:
6
+ - Cursor
7
+ - OpenCode
8
+ - Claude Code
9
+
10
+ **웹사이트:** [https://ralphy-spec.org](https://ralphy-spec.org)
11
+
12
+ ## Ralphy-Spec이란?
13
+
14
+ Ralphy-Spec은 두 가지 강력한 AI 개발 방법론을 결합합니다:
15
+
16
+ ### Ralph Wiggum 루프
17
+
18
+ Ralph 방법론([Geoffrey Huntley](https://ghuntley.com/ralph)가 제안)은 AI 에이전트가 작업을 완료할 때까지 **동일한 프롬프트를 반복적으로** 받는 개발 방식입니다. 각 반복에서 AI는 파일과 git 히스토리에서 이전 작업을 보고 자기 수정 피드백 루프를 형성합니다.
19
+
20
+ ```
21
+ while true; do
22
+ ai_agent "기능 X를 구축하세요. 완료되면 <promise>DONE</promise>을 출력하세요."
23
+ # AI가 이전 작업을 보고, 실수를 수정하고, 진행을 계속합니다
24
+ done
25
+ ```
26
+
27
+ ### OpenSpec (스펙 기반 개발)
28
+
29
+ [OpenSpec](https://github.com/Fission-AI/OpenSpec)은 코드 전에 스펙을 요구하여 AI 코딩에 구조를 부여합니다:
30
+ - `openspec/specs/` - 진실의 원천 스펙
31
+ - `openspec/changes/` - 인수 기준이 있는 변경 제안
32
+ - 완료된 변경을 다시 병합하는 아카이브 워크플로우
33
+
34
+ ### 왜 결합하는가?
35
+
36
+ | 문제 | 해결책 |
37
+ |------|--------|
38
+ | 채팅 기록의 모호한 요구사항 | OpenSpec이 의도를 구조화된 스펙에 고정 |
39
+ | AI가 중간에 멈추거나 실수함 | Ralph 루프가 완료될 때까지 재시도 |
40
+ | 정확성을 검증할 방법 없음 | 인수 기준 + 테스트로 출력 검증 |
41
+ | 도구별 설정이 번거로움 | 한 번의 명령으로 Cursor, OpenCode, Claude Code 설정 |
42
+
43
+ ## 프로젝트에 설치되는 내용
44
+
45
+ - `openspec/` 스캐폴드:
46
+ - `openspec/specs/` (진실의 원천)
47
+ - `openspec/changes/` (활성 변경)
48
+ - `openspec/archive/` (완료된 변경)
49
+ - `openspec/project.md` (프로젝트 컨텍스트)
50
+ - 도구 통합:
51
+ - Cursor: `.cursor/prompts/ralphy-*.md`
52
+ - Claude Code: `.claude/commands/ralphy-*.md`
53
+ - OpenCode: `AGENTS.md`
54
+ - Ralph 루프 상태/설정:
55
+ - `.ralphy/config.json`
56
+ - `.ralphy/ralph-loop.state.json`
57
+
58
+ ## 설치
59
+
60
+ ### npm (전역)
61
+
62
+ ```bash
63
+ npm install -g ralphy-spec
64
+ ```
65
+
66
+ ### npx (설치 없이)
67
+
68
+ ```bash
69
+ npx ralphy-spec init
70
+ ```
71
+
72
+ ### curl 설치 스크립트
73
+
74
+ ```bash
75
+ curl -fsSL https://raw.githubusercontent.com/anthropics/ralphy-openspec/main/scripts/install.sh | sh
76
+ ```
77
+
78
+ ## 사용법
79
+
80
+ ### 프로젝트에서 초기화
81
+
82
+ ```bash
83
+ cd your-project
84
+ ralphy-spec init
85
+ ```
86
+
87
+ 비대화형 도구 선택:
88
+
89
+ ```bash
90
+ ralphy-spec init --tools cursor,claude-code,opencode
91
+ ```
92
+
93
+ 기존 파일 덮어쓰기:
94
+
95
+ ```bash
96
+ ralphy-spec init --force
97
+ ```
98
+
99
+ ### 설정 검증
100
+
101
+ ```bash
102
+ ralphy-spec validate
103
+ ```
104
+
105
+ ### 템플릿 업데이트
106
+
107
+ ```bash
108
+ ralphy-spec update --force
109
+ ```
110
+
111
+ ## 워크플로우 (PRD -> 출시)
112
+
113
+ ```
114
+ PRD/요구사항 --> OpenSpec (스펙 + 작업 + 인수 기준)
115
+ |
116
+ v
117
+ Ralph 루프 (테스트 통과까지 반복)
118
+ |
119
+ v
120
+ 아카이브 (소스 스펙에 병합)
121
+ ```
122
+
123
+ ### 1) 계획: PRD -> OpenSpec 변경
124
+
125
+ AI 도구에서 `/ralphy:plan` (Cursor / Claude Code)을 사용하거나 OpenCode에 `AGENTS.md`를 따르도록 요청합니다.
126
+
127
+ 저장소에 예상되는 출력:
128
+
129
+ ```
130
+ openspec/changes/<change-name>/
131
+ proposal.md
132
+ tasks.md
133
+ specs/
134
+ <domain>/
135
+ spec.md
136
+ ```
137
+
138
+ ### 2) 구현: 완료될 때까지 반복
139
+
140
+ `/ralphy:implement`를 사용하여 작업을 구현하고 테스트를 추가합니다.
141
+
142
+ Ralph 루프 러너를 통해 실행하는 경우, 에이전트는 **모든 작업이 완료되고 테스트가 통과했을 때만** 다음을 출력해야 합니다:
143
+
144
+ ```
145
+ <promise>TASK_COMPLETE</promise>
146
+ ```
147
+
148
+ ### 3) 검증: 테스트로 인수 기준 증명
149
+
150
+ `/ralphy:validate`를 사용하여 테스트를 실행하고 통과한 테스트를 OpenSpec 시나리오에 매핑합니다.
151
+
152
+ ### 4) 아카이브: 변경을 스펙에 병합
153
+
154
+ `/ralphy:archive`를 사용하고, 가능하다면 OpenSpec CLI를 사용합니다:
155
+
156
+ ```bash
157
+ openspec archive <change-name> --yes
158
+ ```
159
+
160
+ ## 감사의 말
161
+
162
+ Ralphy-Spec은 거인의 어깨 위에 서 있습니다:
163
+
164
+ - **Ralph Wiggum 방법론** - [Geoffrey Huntley](https://ghuntley.com/ralph)가 고안. AI 에이전트가 반복을 통해 자기 수정할 수 있다는 통찰력은 AI 지원 개발에 대한 우리의 생각을 바꾸었습니다.
165
+
166
+ - **[opencode-ralph-wiggum](https://github.com/Th0rgal/opencode-ralph-wiggum)** by [@Th0rgal](https://github.com/Th0rgal) - 우리의 통합 방식에 영감을 준 OpenCode용 깔끔한 Ralph 루프 CLI 구현.
167
+
168
+ - **[OpenSpec](https://github.com/Fission-AI/OpenSpec)** by [Fission-AI](https://github.com/Fission-AI) - AI 코딩에 구조와 예측 가능성을 부여하는 스펙 기반 개발 프레임워크.
169
+
170
+ 이러한 접근 방식을 개척한 이 프로젝트들과 유지 관리자들에게 감사드립니다.
171
+
172
+ ## 개발
173
+
174
+ ```bash
175
+ npm install
176
+ npm run build
177
+ node bin/ralphy-spec.js --help
178
+ ```
179
+
180
+ ## 라이선스
181
+
182
+ BSD-3-Clause
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ralphy-spec
2
2
 
3
+ [English](README.md) | [简体中文](README.zh.md) | [한국어](README.ko.md) | [日本語](README.ja.md)
4
+
3
5
  One-command setup for **Ralph loop + OpenSpec** workflows across:
4
6
  - Cursor
5
7
  - OpenCode
package/README.zh.md ADDED
@@ -0,0 +1,182 @@
1
+ # ralphy-spec
2
+
3
+ [English](README.md) | [简体中文](README.zh.md) | [한국어](README.ko.md) | [日本語](README.ja.md)
4
+
5
+ 一条命令为以下工具设置 **Ralph 循环 + OpenSpec** 工作流:
6
+ - Cursor
7
+ - OpenCode
8
+ - Claude Code
9
+
10
+ **官网:** [https://ralphy-spec.org](https://ralphy-spec.org)
11
+
12
+ ## 什么是 Ralphy-Spec?
13
+
14
+ Ralphy-Spec 结合了两种强大的 AI 开发方法:
15
+
16
+ ### Ralph Wiggum 循环
17
+
18
+ Ralph 方法论(由 [Geoffrey Huntley](https://ghuntley.com/ralph) 提出)是一种开发方式,AI 代理会**重复接收相同的提示**直到完成任务。每次迭代,AI 都能看到之前在文件和 git 历史中的工作成果,形成自我纠正的反馈循环。
19
+
20
+ ```
21
+ while true; do
22
+ ai_agent "构建功能 X。完成后输出 <promise>DONE</promise>。"
23
+ # AI 看到之前的工作,修复错误,继续进展
24
+ done
25
+ ```
26
+
27
+ ### OpenSpec(规范驱动开发)
28
+
29
+ [OpenSpec](https://github.com/Fission-AI/OpenSpec) 通过在编码前要求规范来为 AI 编码带来结构:
30
+ - `openspec/specs/` - 真实来源的规范
31
+ - `openspec/changes/` - 带验收标准的变更提案
32
+ - 归档工作流将已完成的变更合并回来
33
+
34
+ ### 为什么要结合使用?
35
+
36
+ | 问题 | 解决方案 |
37
+ |------|----------|
38
+ | 聊天记录中的需求模糊 | OpenSpec 将意图锁定在结构化规范中 |
39
+ | AI 中途停止或出错 | Ralph 循环重试直到完成 |
40
+ | 无法验证正确性 | 验收标准 + 测试验证输出 |
41
+ | 特定工具的设置很繁琐 | 一条命令设置 Cursor、OpenCode、Claude Code |
42
+
43
+ ## 安装到项目中的内容
44
+
45
+ - `openspec/` 脚手架:
46
+ - `openspec/specs/`(真实来源)
47
+ - `openspec/changes/`(活跃变更)
48
+ - `openspec/archive/`(已完成的变更)
49
+ - `openspec/project.md`(项目上下文)
50
+ - 工具集成:
51
+ - Cursor:`.cursor/prompts/ralphy-*.md`
52
+ - Claude Code:`.claude/commands/ralphy-*.md`
53
+ - OpenCode:`AGENTS.md`
54
+ - Ralph 循环状态/配置:
55
+ - `.ralphy/config.json`
56
+ - `.ralphy/ralph-loop.state.json`
57
+
58
+ ## 安装
59
+
60
+ ### npm(全局安装)
61
+
62
+ ```bash
63
+ npm install -g ralphy-spec
64
+ ```
65
+
66
+ ### npx(无需安装)
67
+
68
+ ```bash
69
+ npx ralphy-spec init
70
+ ```
71
+
72
+ ### curl 安装脚本
73
+
74
+ ```bash
75
+ curl -fsSL https://raw.githubusercontent.com/anthropics/ralphy-openspec/main/scripts/install.sh | sh
76
+ ```
77
+
78
+ ## 使用方法
79
+
80
+ ### 在项目中初始化
81
+
82
+ ```bash
83
+ cd your-project
84
+ ralphy-spec init
85
+ ```
86
+
87
+ 非交互式工具选择:
88
+
89
+ ```bash
90
+ ralphy-spec init --tools cursor,claude-code,opencode
91
+ ```
92
+
93
+ 覆盖现有文件:
94
+
95
+ ```bash
96
+ ralphy-spec init --force
97
+ ```
98
+
99
+ ### 验证设置
100
+
101
+ ```bash
102
+ ralphy-spec validate
103
+ ```
104
+
105
+ ### 更新模板
106
+
107
+ ```bash
108
+ ralphy-spec update --force
109
+ ```
110
+
111
+ ## 工作流程(PRD -> 交付)
112
+
113
+ ```
114
+ PRD/需求 --> OpenSpec(规范 + 任务 + 验收标准)
115
+ |
116
+ v
117
+ Ralph 循环(迭代直到测试通过)
118
+ |
119
+ v
120
+ 归档(合并回源规范)
121
+ ```
122
+
123
+ ### 1)规划:PRD -> OpenSpec 变更
124
+
125
+ 使用 AI 工具的 `/ralphy:plan`(Cursor / Claude Code),或让 OpenCode 遵循 `AGENTS.md`。
126
+
127
+ 仓库中的预期输出:
128
+
129
+ ```
130
+ openspec/changes/<change-name>/
131
+ proposal.md
132
+ tasks.md
133
+ specs/
134
+ <domain>/
135
+ spec.md
136
+ ```
137
+
138
+ ### 2)实现:迭代直到完成
139
+
140
+ 使用 `/ralphy:implement` 实现任务并添加测试。
141
+
142
+ 如果通过 Ralph 循环运行器运行,代理应该只在**所有任务完成且测试通过**时输出:
143
+
144
+ ```
145
+ <promise>TASK_COMPLETE</promise>
146
+ ```
147
+
148
+ ### 3)验证:测试证明验收标准
149
+
150
+ 使用 `/ralphy:validate` 运行测试并将通过的测试映射回 OpenSpec 场景。
151
+
152
+ ### 4)归档:将变更合并回规范
153
+
154
+ 使用 `/ralphy:archive`,如果可用的话,使用 OpenSpec CLI:
155
+
156
+ ```bash
157
+ openspec archive <change-name> --yes
158
+ ```
159
+
160
+ ## 致谢
161
+
162
+ Ralphy-Spec 站在巨人的肩膀上:
163
+
164
+ - **Ralph Wiggum 方法论** - 由 [Geoffrey Huntley](https://ghuntley.com/ralph) 构思。AI 代理可以通过迭代进行自我纠正的洞见改变了我们对 AI 辅助开发的看法。
165
+
166
+ - **[opencode-ralph-wiggum](https://github.com/Th0rgal/opencode-ralph-wiggum)** by [@Th0rgal](https://github.com/Th0rgal) - 一个简洁的 OpenCode Ralph 循环 CLI 实现,启发了我们的集成方式。
167
+
168
+ - **[OpenSpec](https://github.com/Fission-AI/OpenSpec)** by [Fission-AI](https://github.com/Fission-AI) - 为 AI 编码带来结构和可预测性的规范驱动开发框架。他们的 `specs/` + `changes/` 模型优雅而实用。
169
+
170
+ 我们感谢这些项目及其维护者开创了这些方法。
171
+
172
+ ## 开发
173
+
174
+ ```bash
175
+ npm install
176
+ npm run build
177
+ node bin/ralphy-spec.js --help
178
+ ```
179
+
180
+ ## 许可证
181
+
182
+ BSD-3-Clause
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ function buildProgram() {
9
9
  program
10
10
  .name("ralphy-spec")
11
11
  .description("One-command setup for Ralph loop + OpenSpec workflows across Cursor, OpenCode, and Claude Code.")
12
- .version("0.1.0");
12
+ .version("0.1.1");
13
13
  (0, init_1.registerInitCommand)(program);
14
14
  (0, validate_1.registerValidateCommand)(program);
15
15
  (0, update_1.registerUpdateCommand)(program);
@@ -0,0 +1,22 @@
1
+ # /ralphy:archive (Archive completed change)
2
+
3
+ You are archiving a completed OpenSpec change.
4
+
5
+ ## Preconditions
6
+ - All tasks are complete
7
+ - Tests are green
8
+ - Spec deltas reflect final behavior
9
+
10
+ ## Steps
11
+ 1. Run tests to confirm green.
12
+ 2. If OpenSpec CLI is available, archive via:
13
+ - `openspec archive <change-name> --yes`
14
+ 3. Otherwise, move the change folder from:
15
+ - `openspec/changes/<change-name>/`
16
+ to:
17
+ - `openspec/archive/<change-name>/`
18
+ 4. Confirm `openspec/specs/` is updated appropriately.
19
+
20
+ ## Output
21
+ Provide a short summary and a test plan.
22
+
@@ -0,0 +1,30 @@
1
+ # /ralphy:implement (Implement OpenSpec tasks)
2
+
3
+ You are implementing an OpenSpec change located under `openspec/changes/<change-name>/`.
4
+
5
+ ## Goal
6
+ Complete all tasks in `tasks.md` and satisfy the acceptance criteria from the spec scenarios.
7
+
8
+ ## Ralph loop compatibility
9
+ If this command is being executed in an iterative loop:
10
+ - Make progress each iteration
11
+ - Run tests frequently
12
+ - Only declare success when verification passes
13
+
14
+ ## Steps
15
+ 1. Identify the active change folder under `openspec/changes/`.
16
+ 2. Read the change artifacts:
17
+ - `proposal.md`
18
+ - `tasks.md`
19
+ - spec deltas under `specs/`
20
+ 3. Implement tasks in order:
21
+ - Update code
22
+ - Add/update tests
23
+ - Run tests
24
+ - Mark tasks complete ONLY when verified
25
+
26
+ ## Completion promise
27
+ Only output this exact text when ALL tasks are complete and tests pass:
28
+
29
+ <promise>TASK_COMPLETE</promise>
30
+
@@ -0,0 +1,31 @@
1
+ # /ralphy:plan (PRD -> OpenSpec change)
2
+
3
+ You are an AI coding assistant. Convert the user's PRD/requirements into an OpenSpec change proposal with clear, testable acceptance criteria.
4
+
5
+ ## Deliverables (create/modify files)
6
+ Create a new change folder:
7
+ - `openspec/changes/<change-name>/proposal.md`
8
+ - `openspec/changes/<change-name>/tasks.md`
9
+ - `openspec/changes/<change-name>/specs/<domain>/spec.md` (and others as needed)
10
+
11
+ ## Rules
12
+ - Use MUST/SHALL language for requirements.
13
+ - Every `### Requirement:` MUST include at least one `#### Scenario:`.
14
+ - Include acceptance criteria that can be validated by tests or deterministic commands.
15
+ - Keep scope explicit; list non-goals.
16
+
17
+ ## Procedure
18
+ 1. Read `openspec/project.md` and relevant specs under `openspec/specs/`.
19
+ 2. Propose a kebab-case change name (e.g. `add-profile-filters`).
20
+ 3. Create `proposal.md` explaining why/what and the constraints.
21
+ 4. Write spec deltas under `specs/` using:
22
+ - `## ADDED Requirements`
23
+ - `## MODIFIED Requirements`
24
+ - `## REMOVED Requirements`
25
+ 5. Write `tasks.md` as a numbered checklist. Each task includes:
26
+ - Implementation notes
27
+ - Test plan (what to run, what to assert)
28
+
29
+ ## Output
30
+ Summarize created files and tell the user what to run next (typically implementation).
31
+
@@ -0,0 +1,21 @@
1
+ # /ralphy:validate (Validate against acceptance criteria)
2
+
3
+ You are validating an OpenSpec change.
4
+
5
+ ## Goal
6
+ Prove that the implementation matches the requirements/scenarios and that tests pass.
7
+
8
+ ## Steps
9
+ 1. Identify the active change folder under `openspec/changes/`.
10
+ 2. Extract acceptance criteria from:
11
+ - spec scenarios in `openspec/changes/<change-name>/specs/**`
12
+ - test plan notes in `tasks.md`
13
+ 3. Run tests and/or deterministic verification commands.
14
+ 4. If failures occur, fix them and re-run until green.
15
+
16
+ ## Output
17
+ Report:
18
+ - What passed
19
+ - What failed (with next actions)
20
+ - Any missing tests needed to satisfy acceptance criteria
21
+
@@ -0,0 +1,20 @@
1
+ # /ralphy:archive (Archive completed change)
2
+
3
+ You are an AI coding assistant archiving a completed OpenSpec change.
4
+
5
+ ## Preconditions
6
+ - All tasks in `openspec/changes/<change-name>/tasks.md` are complete
7
+ - Tests pass
8
+ - Spec deltas are correct and reflect the final behavior
9
+
10
+ ## Steps
11
+ 1. Run validation (tests) and ensure green.
12
+ 2. Archive the change by moving it into `openspec/archive/` (or using the OpenSpec CLI if available).
13
+ - If OpenSpec CLI is installed, prefer:
14
+ - `openspec archive <change-name> --yes`
15
+ 3. Confirm the source-of-truth specs in `openspec/specs/` are updated appropriately.
16
+ 4. Provide a short release-style summary:
17
+ - What changed
18
+ - How to test
19
+ - Any follow-up work
20
+
@@ -0,0 +1,31 @@
1
+ # /ralphy:implement (Implement OpenSpec tasks)
2
+
3
+ You are an AI coding assistant implementing an existing OpenSpec change.
4
+
5
+ ## Goal
6
+ Implement tasks from `openspec/changes/<change-name>/tasks.md` until acceptance criteria are met and tests pass.
7
+
8
+ ## Operating mode (Ralph loop compatible)
9
+ If you are being run in an iterative loop, you may see the same prompt repeatedly. You MUST:
10
+ - Use test failures as feedback
11
+ - Keep making progress on the next incomplete task
12
+ - Only claim completion when verification passes
13
+
14
+ ## Steps
15
+ 1. Identify the active change folder under `openspec/changes/` (ask the user if multiple exist).
16
+ 2. Read:
17
+ - `openspec/changes/<change-name>/proposal.md`
18
+ - `openspec/changes/<change-name>/tasks.md`
19
+ - Relevant spec deltas in `openspec/changes/<change-name>/specs/`
20
+ - Current specs in `openspec/specs/` as the baseline
21
+ 3. Implement tasks in order. For each task:
22
+ - Make the smallest correct change
23
+ - Update or add tests required by acceptance criteria
24
+ - Run tests and fix failures
25
+ - Mark the task as complete in `tasks.md` ONLY when verified
26
+
27
+ ## Completion promise (for Ralph loop runners)
28
+ Only output this exact text when ALL tasks are complete AND tests pass:
29
+
30
+ <promise>TASK_COMPLETE</promise>
31
+
@@ -0,0 +1,39 @@
1
+ # /ralphy:plan (PRD -> OpenSpec change)
2
+
3
+ You are an AI coding assistant. Your job is to convert user requirements into an OpenSpec change proposal with clear acceptance criteria.
4
+
5
+ ## Goal
6
+ Create a new OpenSpec change folder under `openspec/changes/<change-name>/` containing:
7
+ - `proposal.md`
8
+ - `tasks.md`
9
+ - `specs/<domain>/spec.md` (or multiple specs if needed)
10
+
11
+ ## Inputs
12
+ - A PRD, feature request, or requirements description from the user.
13
+ - Existing specs in `openspec/specs/` (source of truth).
14
+
15
+ ## Requirements
16
+ - Use MUST/SHALL language in requirements.
17
+ - Every requirement MUST have at least one `#### Scenario:` block.
18
+ - Add acceptance criteria that can be validated via tests/commands.
19
+ - Keep changes scoped and explicitly list what is out-of-scope.
20
+
21
+ ## Steps
22
+ 1. Read `openspec/project.md` and any relevant specs in `openspec/specs/`.
23
+ 2. Propose a short, kebab-case `<change-name>` (e.g. `add-profile-filters`).
24
+ 3. Create `openspec/changes/<change-name>/proposal.md` describing:
25
+ - Summary
26
+ - Motivation
27
+ - Scope / Non-goals
28
+ - Risks
29
+ 4. Create `openspec/changes/<change-name>/specs/...` as spec deltas:
30
+ - `## ADDED Requirements`
31
+ - `## MODIFIED Requirements`
32
+ - `## REMOVED Requirements`
33
+ 5. Create `openspec/changes/<change-name>/tasks.md`:
34
+ - Break into numbered tasks with checkboxes
35
+ - Each task includes test plan notes (what to run, what to assert)
36
+
37
+ ## Output
38
+ When the OpenSpec change artifacts are created and consistent, summarize what you created and what the next command should be.
39
+
@@ -0,0 +1,24 @@
1
+ # /ralphy:validate (Validate against acceptance criteria)
2
+
3
+ You are an AI coding assistant validating an OpenSpec change against its acceptance criteria.
4
+
5
+ ## Goal
6
+ Confirm the implementation satisfies the requirements/scenarios in:
7
+ - `openspec/changes/<change-name>/specs/**`
8
+ and that all tests pass.
9
+
10
+ ## Steps
11
+ 1. Identify the active change folder under `openspec/changes/`.
12
+ 2. Extract acceptance criteria from the spec scenarios and `tasks.md` test plan notes.
13
+ 3. Run the project test command (prefer package scripts), for example:
14
+ - `npm test`
15
+ - `pnpm test`
16
+ - `bun test`
17
+ 4. If tests fail:
18
+ - Diagnose the failure
19
+ - Fix code/tests
20
+ - Re-run tests
21
+ 5. Report results:
22
+ - Which requirements are proven (by which tests/commands)
23
+ - Any gaps (missing tests or unclear acceptance criteria)
24
+
@@ -0,0 +1,46 @@
1
+ # Ralphy-OpenSpec Agent Instructions (OpenCode)
2
+
3
+ You are an AI coding assistant operating in a repository that uses:
4
+ - **OpenSpec** for spec-driven development (`openspec/specs/` + `openspec/changes/`)
5
+ - **Ralph loop** for iterative execution (the same prompt may be repeated)
6
+
7
+ ## Golden rules
8
+ - Treat `openspec/specs/` as the source of truth (current behavior).
9
+ - Treat `openspec/changes/<change-name>/` as the proposed/active change.
10
+ - Only mark tasks complete when verification (tests) passes.
11
+ - Keep changes small, deterministic, and test-backed.
12
+
13
+ ## Workflow
14
+
15
+ ### 1) Plan (PRD -> OpenSpec)
16
+ When asked to plan or create specs:
17
+ 1. Read `openspec/project.md` and relevant files in `openspec/specs/`.
18
+ 2. Create a new change folder under `openspec/changes/<change-name>/` with:
19
+ - `proposal.md` (why/what/scope/non-goals/risks)
20
+ - `tasks.md` (checklist with test plan notes)
21
+ - `specs/**/spec.md` (deltas: ADDED/MODIFIED/REMOVED)
22
+ 3. Ensure requirements use MUST/SHALL and each requirement has at least one scenario.
23
+
24
+ ### 2) Implement (Tasks -> Code)
25
+ When asked to implement:
26
+ 1. Identify the active change folder under `openspec/changes/`.
27
+ 2. Implement tasks in order from `tasks.md`.
28
+ 3. Run tests frequently and fix failures.
29
+ 4. Update the checkbox status in `tasks.md` only when verified.
30
+
31
+ ### 3) Validate (Acceptance criteria)
32
+ When asked to validate:
33
+ 1. Map scenarios/acceptance criteria to tests/commands.
34
+ 2. Run the project test command (commonly `npm test`).
35
+ 3. Report which requirements are proven and what gaps remain.
36
+
37
+ ### 4) Archive
38
+ When asked to archive:
39
+ - Prefer `openspec archive <change-name> --yes` if OpenSpec CLI is available.
40
+ - Otherwise, move the change into `openspec/archive/` and ensure `openspec/specs/` reflects the final state.
41
+
42
+ ## Ralph loop completion promise
43
+ If you are being run in a loop, only output this exact text when ALL tasks are complete and tests are green:
44
+
45
+ <promise>TASK_COMPLETE</promise>
46
+
@@ -0,0 +1,28 @@
1
+ # OpenSpec Tasks Template
2
+
3
+ Use this structure for `openspec/changes/<change-name>/tasks.md`.
4
+
5
+ ## 1. Planning / Scaffolding
6
+ - [ ] 1.1 Confirm scope and affected modules
7
+ - Test plan: N/A
8
+
9
+ ## 2. Implementation
10
+ - [ ] 2.1 Implement feature behavior
11
+ - Acceptance criteria:
12
+ - GIVEN ...
13
+ - WHEN ...
14
+ - THEN ...
15
+ - Test plan:
16
+ - Run: `npm test`
17
+ - Assert: ...
18
+
19
+ ## 3. Validation
20
+ - [ ] 3.1 Add/adjust tests to cover all scenarios
21
+ - Test plan:
22
+ - Run: `npm test`
23
+
24
+ ## 4. Documentation / Archive
25
+ - [ ] 4.1 Update specs and archive change
26
+ - Test plan:
27
+ - Run: `npm test`
28
+
@@ -0,0 +1,25 @@
1
+ # Ralph Loop Prompt Template (OpenSpec task runner)
2
+
3
+ Use this template when running an AI agent in a loop (Ralph methodology). The same prompt may be repeated until the completion promise is printed.
4
+
5
+ ## Context
6
+ You are implementing OpenSpec change: `{{change_name}}`
7
+
8
+ ## Current Task
9
+ {{current_task_from_tasks_md}}
10
+
11
+ ## Acceptance Criteria
12
+ {{acceptance_criteria}}
13
+
14
+ ## Instructions
15
+ 1. Read the spec at `openspec/changes/{{change_name}}/` and the baseline specs in `openspec/specs/`.
16
+ 2. Implement the current task.
17
+ 3. Run tests to verify the acceptance criteria.
18
+ 4. If tests pass, mark the task complete and output `<promise>TASK_COMPLETE</promise>`.
19
+ 5. If tests fail, fix issues and continue iterating.
20
+
21
+ ## Important
22
+ - Do NOT output the promise until tests pass.
23
+ - Prefer small, incremental changes.
24
+ - Keep tests aligned with OpenSpec scenarios.
25
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralphy-spec",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "One-command setup for Ralph loop + OpenSpec workflows across Cursor, OpenCode, and Claude Code.",
5
5
  "license": "BSD-3-Clause",
6
6
  "author": "Wenqing Yu",
@@ -33,6 +33,9 @@
33
33
  "dist/",
34
34
  "scripts/",
35
35
  "README.md",
36
+ "README.zh.md",
37
+ "README.ko.md",
38
+ "README.ja.md",
36
39
  "LICENSE"
37
40
  ],
38
41
  "engines": {
@@ -16,7 +16,8 @@ async function copyDir(srcDir, dstDir) {
16
16
  }
17
17
  }
18
18
 
19
- const root = path.resolve(new URL(".", import.meta.url).pathname, "..", "..");
19
+ const scriptsDir = path.dirname(new URL(import.meta.url).pathname);
20
+ const root = path.resolve(scriptsDir, "..");
20
21
  const srcTemplates = path.join(root, "src", "templates");
21
22
  const dstTemplates = path.join(root, "dist", "templates");
22
23