@c-d-cc/reap 0.9.1 → 0.10.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.ja.md +47 -29
- package/README.ko.md +44 -26
- package/README.md +74 -43
- package/README.zh-CN.md +47 -29
- package/dist/cli.js +1 -1
- package/dist/templates/commands/reap.back.md +1 -1
- package/dist/templates/commands/reap.completion.md +4 -4
- package/dist/templates/commands/reap.help.md +1 -1
- package/dist/templates/commands/reap.next.md +12 -3
- package/dist/templates/commands/reap.start.md +1 -1
- package/dist/templates/hooks/reap-guide.md +13 -15
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -101,7 +101,7 @@ claude
|
|
|
101
101
|
> ...
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
## ライフサイクル
|
|
104
|
+
## ライフサイクル [↗](https://reap.cc/docs/lifecycle)
|
|
105
105
|
|
|
106
106
|
各Generation(世代)は5段階のライフサイクルを経ます:
|
|
107
107
|
|
|
@@ -118,9 +118,9 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
118
118
|
| **Validation** | テスト実行、完了条件の確認 | `04-validation.md` |
|
|
119
119
|
| **Completion** | レトロスペクティブ + Genome変更反映 + Hook提案 + アーカイブ | `05-completion.md` |
|
|
120
120
|
|
|
121
|
-
## コアコンセプト
|
|
121
|
+
## コアコンセプト [↗](https://reap.cc/docs/core-concepts)
|
|
122
122
|
|
|
123
|
-
### Genome
|
|
123
|
+
### Genome [↗](https://reap.cc/docs/genome)
|
|
124
124
|
|
|
125
125
|
アプリケーションの遺伝情報 — アーキテクチャ原則、ビジネスルール、開発コンベンション、技術制約の集合。
|
|
126
126
|
|
|
@@ -137,7 +137,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
137
137
|
|
|
138
138
|
**Environment不変原則**: 現在の世代ではEnvironmentを直接変更しません。外部環境の変化を発見した場合はbacklogに記録し、Completionステージで反映します。
|
|
139
139
|
|
|
140
|
-
### Backlog
|
|
140
|
+
### Backlog [↗](https://reap.cc/docs/backlog)
|
|
141
141
|
|
|
142
142
|
`.reap/life/backlog/`に次に反映するすべての項目を保存します。各項目はmarkdown + frontmatter形式:
|
|
143
143
|
|
|
@@ -154,13 +154,13 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
154
154
|
|
|
155
155
|
**部分完了は正常** — Genome変更に依存するタスクは`[deferred]`とマークし、次の世代に引き継ぎます。
|
|
156
156
|
|
|
157
|
-
### 4軸構造
|
|
157
|
+
### 4軸構造 [↗](https://reap.cc/docs/core-concepts)
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
.reap/
|
|
161
161
|
├── genome/ # 遺伝情報(世代を超えて進化)
|
|
162
162
|
├── environment/ # 外部環境(APIドキュメント、インフラ、ビジネス制約)
|
|
163
|
-
├── life/ # 現在の世代の状態と成果物
|
|
163
|
+
├── life/ # ライフサイクル — 現在の世代の状態と成果物
|
|
164
164
|
└── lineage/ # 完了した世代のアーカイブ
|
|
165
165
|
```
|
|
166
166
|
|
|
@@ -213,7 +213,7 @@ Machine A:
|
|
|
213
213
|
- **サーバー不要** — すべてがローカル + Git。外部サービスは不要です。
|
|
214
214
|
- **DAG lineage** — 各世代はハッシュベースのID(`gen-046-a3f8c2`)で親を参照し、有向非巡回グラフを形成するため、並行作業を自然にサポートします。
|
|
215
215
|
|
|
216
|
-
## CLIコマンド
|
|
216
|
+
## CLIコマンド [↗](https://reap.cc/docs/cli-reference)
|
|
217
217
|
|
|
218
218
|
| コマンド | 説明 |
|
|
219
219
|
|----------|------|
|
|
@@ -235,7 +235,7 @@ reap update --dry-run # 変更のプレビュー
|
|
|
235
235
|
|
|
236
236
|
REAPはスラッシュコマンドとセッションフックを通じてAIエージェントと統合します。現在サポートされているエージェント:**Claude Code**、**OpenCode**。
|
|
237
237
|
|
|
238
|
-
### スラッシュコマンド
|
|
238
|
+
### スラッシュコマンド [↗](https://reap.cc/docs/command-reference)
|
|
239
239
|
|
|
240
240
|
スラッシュコマンドが`.claude/commands/`にインストールされ、ワークフロー全体を駆動します:
|
|
241
241
|
|
|
@@ -246,13 +246,17 @@ REAPはスラッシュコマンドとセッションフックを通じてAIエ
|
|
|
246
246
|
| `/reap.planning` | タスク分解 + 実装計画 |
|
|
247
247
|
| `/reap.implementation` | AI+Human協力でコード実装 |
|
|
248
248
|
| `/reap.validation` | テスト実行、完了条件の確認 |
|
|
249
|
-
| `/reap.completion` | レトロスペクティブ + Genome変更反映 |
|
|
249
|
+
| `/reap.completion` | レトロスペクティブ + Genome変更反映 + lineage圧縮 |
|
|
250
250
|
| `/reap.next` | 次のライフサイクルステージへ前進 |
|
|
251
251
|
| `/reap.back` | 前のステージに回帰(micro loop) |
|
|
252
|
+
| `/reap.abort` | 現在のGenerationを中断(rollback/stash/hold + backlog保存) |
|
|
252
253
|
| `/reap.status` | 現在のGeneration状態とプロジェクト健全性を表示 |
|
|
253
|
-
| `/reap.sync` |
|
|
254
|
-
| `/reap.
|
|
255
|
-
| `/reap.
|
|
254
|
+
| `/reap.sync` | GenomeとEnvironmentを同時に同期 |
|
|
255
|
+
| `/reap.sync.genome` | ソースコードベースでGenomeを最新化 |
|
|
256
|
+
| `/reap.sync.environment` | 外部環境依存関係の発見と文書化 |
|
|
257
|
+
| `/reap.report` | REAPプロジェクトにバグ/フィードバックを報告(プライバシー保護) |
|
|
258
|
+
| `/reap.help` | 24+トピックのcontextual AIヘルプ |
|
|
259
|
+
| `/reap.update` | REAPパッケージのアップグレード + コマンド/テンプレート/hook同期 |
|
|
256
260
|
| **`/reap.evolve`** | **1つのGeneration全体を最初から最後まで実行(推奨)** |
|
|
257
261
|
| **`/reap.pull <branch>`** | **Fetch + マージGeneration全体を実行(分散版 `/reap.evolve`)** |
|
|
258
262
|
| **`/reap.merge <branch>`** | **ローカルブランチのマージGeneration全体を実行(fetchなし)** |
|
|
@@ -265,7 +269,7 @@ REAPはスラッシュコマンドとセッションフックを通じてAIエ
|
|
|
265
269
|
| `/reap.merge.validation` | 機械的テストを実行(bun test、tsc、build) |
|
|
266
270
|
| **`/reap.merge.evolve`** | **マージライフサイクル全体を自動実行** |
|
|
267
271
|
|
|
268
|
-
### SessionStart Hook
|
|
272
|
+
### SessionStart Hook [↗](https://reap.cc/docs/hooks)
|
|
269
273
|
|
|
270
274
|
毎セッション開始時に自動実行され、AIエージェントに以下を注入します:
|
|
271
275
|
|
|
@@ -305,7 +309,7 @@ strict:
|
|
|
305
309
|
|
|
306
310
|
Strictモードはデフォルトで無効です(`strict: false`)。
|
|
307
311
|
|
|
308
|
-
### REAP Hooks
|
|
312
|
+
### REAP Hooks [↗](https://reap.cc/docs/hooks)
|
|
309
313
|
|
|
310
314
|
Hookはファイルベースで`.reap/hooks/`に保存されます。各Hookは`{event}.{name}.{md|sh}`形式のファイルです:
|
|
311
315
|
|
|
@@ -314,33 +318,47 @@ Hookはファイルベースで`.reap/hooks/`に保存されます。各Hookは`
|
|
|
314
318
|
|
|
315
319
|
```
|
|
316
320
|
.reap/hooks/
|
|
317
|
-
├──
|
|
318
|
-
├──
|
|
319
|
-
├──
|
|
320
|
-
├──
|
|
321
|
-
└──
|
|
321
|
+
├── onLifeStarted.context-load.md
|
|
322
|
+
├── onLifeCompleted.version-bump.md
|
|
323
|
+
├── onLifeCompleted.readme-update.md
|
|
324
|
+
├── onLifeTransited.notify.sh
|
|
325
|
+
└── onLifeRegretted.alert.sh
|
|
322
326
|
```
|
|
323
327
|
|
|
324
328
|
各Hookファイルは以下のフィールドを持つfrontmatterをサポートします:
|
|
325
329
|
|
|
326
330
|
```yaml
|
|
327
331
|
---
|
|
328
|
-
condition: has-code-changes #
|
|
332
|
+
condition: has-code-changes # .reap/hooks/conditions/内のスクリプト名
|
|
329
333
|
order: 10 # 実行順序(小さいほど先に実行)
|
|
330
334
|
---
|
|
331
335
|
```
|
|
332
336
|
|
|
337
|
+
**Normal Lifecycle Events:**
|
|
338
|
+
|
|
339
|
+
| イベント | トリガー |
|
|
340
|
+
|----------|----------|
|
|
341
|
+
| `onLifeStarted` | `/reap.start`で新しいGeneration作成後 |
|
|
342
|
+
| `onLifeObjected` | objectiveステージ完了後 |
|
|
343
|
+
| `onLifePlanned` | planningステージ完了後 |
|
|
344
|
+
| `onLifeImplemented` | implementationステージ完了後 |
|
|
345
|
+
| `onLifeValidated` | validationステージ完了後 |
|
|
346
|
+
| `onLifeCompleted` | completion + archiving後(git commit後に実行) |
|
|
347
|
+
| `onLifeTransited` | すべてのstage遷移時(汎用) |
|
|
348
|
+
| `onLifeRegretted` | `/reap.back` regression時 |
|
|
349
|
+
|
|
350
|
+
**Merge Lifecycle Events:**
|
|
351
|
+
|
|
333
352
|
| イベント | トリガー |
|
|
334
353
|
|----------|----------|
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
|
|
343
|
-
HookはAIエージェントがプロジェクトルートディレクトリで実行します。`onGenerationComplete` Hookには自動バージョンバンプ判定が含まれています — patchレベルは自動適用され、minor/majorバンプはユーザー確認が必要です。
|
|
354
|
+
| `onMergeStarted` | `/reap.merge.start`でマージGeneration作成後 |
|
|
355
|
+
| `onMergeDetected` | detectステージ完了後 |
|
|
356
|
+
| `onMergeMated` | mateステージ完了後(genome確定) |
|
|
357
|
+
| `onMergeMerged` | mergeステージ完了後(ソースマージ) |
|
|
358
|
+
| `onMergeSynced` | syncステージ完了後 |
|
|
359
|
+
| `onMergeValidated` | merge validation完了後 |
|
|
360
|
+
| `onMergeCompleted` | merge completion + archiving後 |
|
|
361
|
+
| `onMergeTransited` | すべてのmerge stage遷移時(汎用) |
|
|
344
362
|
|
|
345
363
|
## `reap init`後のプロジェクト構造
|
|
346
364
|
|
package/README.ko.md
CHANGED
|
@@ -118,9 +118,9 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
118
118
|
| **Validation** | 테스트 실행, 완료 조건 점검 | `04-validation.md` |
|
|
119
119
|
| **Completion** | 회고 + Genome 변경 반영 + Hook 제안 + 아카이빙 | `05-completion.md` |
|
|
120
120
|
|
|
121
|
-
## 핵심 개념
|
|
121
|
+
## 핵심 개념 [↗](https://reap.cc/docs/core-concepts)
|
|
122
122
|
|
|
123
|
-
### Genome
|
|
123
|
+
### Genome [↗](https://reap.cc/docs/genome)
|
|
124
124
|
|
|
125
125
|
Application의 유전 정보 — 아키텍처 원칙, 비즈니스 규칙, 개발 컨벤션, 기술 제약의 집합.
|
|
126
126
|
|
|
@@ -137,7 +137,7 @@ Application의 유전 정보 — 아키텍처 원칙, 비즈니스 규칙, 개
|
|
|
137
137
|
|
|
138
138
|
**Environment 불변 원칙**: 현재 세대에서는 Environment를 직접 수정하지 않습니다. 외부 환경 변화를 발견하면 backlog에 기록하고, Completion 단계에서 반영합니다.
|
|
139
139
|
|
|
140
|
-
### Backlog
|
|
140
|
+
### Backlog [↗](https://reap.cc/docs/backlog)
|
|
141
141
|
|
|
142
142
|
`.reap/life/backlog/`에 다음에 반영할 모든 항목을 저장합니다. 각 항목은 markdown + frontmatter 형식:
|
|
143
143
|
|
|
@@ -154,13 +154,13 @@ Application의 유전 정보 — 아키텍처 원칙, 비즈니스 규칙, 개
|
|
|
154
154
|
|
|
155
155
|
**부분 완료는 정상** — Genome 변경에 의존하는 태스크는 `[deferred]`로 마킹하고 다음 세대로 인계합니다.
|
|
156
156
|
|
|
157
|
-
### 4축 구조
|
|
157
|
+
### 4축 구조 [↗](https://reap.cc/docs/core-concepts)
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
.reap/
|
|
161
161
|
├── genome/ # 유전 정보 (세대를 거치며 진화)
|
|
162
162
|
├── environment/ # 외부 환경 (API 문서, 인프라, 비즈니스 제약)
|
|
163
|
-
├── life/ # 현재 세대의 상태와 산출물
|
|
163
|
+
├── life/ # 라이프사이클 — 현재 세대의 상태와 산출물
|
|
164
164
|
└── lineage/ # 완료된 세대들의 아카이브
|
|
165
165
|
```
|
|
166
166
|
|
|
@@ -246,13 +246,17 @@ Slash command가 `.claude/commands/`에 설치되어 전체 워크플로우를
|
|
|
246
246
|
| `/reap.planning` | 태스크 분해 + 구현 계획 |
|
|
247
247
|
| `/reap.implementation` | AI+Human 협업 코드 구현 |
|
|
248
248
|
| `/reap.validation` | 테스트 실행, 완료 조건 점검 |
|
|
249
|
-
| `/reap.completion` | 회고 + Genome 변경 반영 |
|
|
249
|
+
| `/reap.completion` | 회고 + Genome 변경 반영 + lineage 압축 |
|
|
250
250
|
| `/reap.next` | 다음 Life Cycle stage로 전진 |
|
|
251
251
|
| `/reap.back` | 이전 stage로 복귀 (micro loop) |
|
|
252
|
+
| `/reap.abort` | 현재 Generation 중단 (rollback/stash/hold + backlog 저장) |
|
|
252
253
|
| `/reap.status` | 현재 Generation 상태 및 프로젝트 건강 상태 표시 |
|
|
253
|
-
| `/reap.sync` |
|
|
254
|
-
| `/reap.
|
|
255
|
-
| `/reap.
|
|
254
|
+
| `/reap.sync` | Genome + Environment 동시 동기화 |
|
|
255
|
+
| `/reap.sync.genome` | 소스 코드 기반 Genome 최신화 |
|
|
256
|
+
| `/reap.sync.environment` | 외부 환경 의존성 탐색 및 문서화 |
|
|
257
|
+
| `/reap.report` | REAP 프로젝트에 버그/피드백 보고 (개인정보 보호) |
|
|
258
|
+
| `/reap.help` | 24+ 주제의 contextual AI 도움말 |
|
|
259
|
+
| `/reap.update` | REAP 패키지 업그레이드 + 커맨드/템플릿/훅 동기화 |
|
|
256
260
|
| **`/reap.evolve`** | **한 Generation 전체를 처음부터 끝까지 실행 (권장)** |
|
|
257
261
|
| **`/reap.pull <branch>`** | **Fetch + 전체 머지 Generation 실행 (분산 `/reap.evolve`)** |
|
|
258
262
|
| **`/reap.merge <branch>`** | **로컬 브랜치 전체 머지 Generation 실행 (fetch 없음)** |
|
|
@@ -265,7 +269,7 @@ Slash command가 `.claude/commands/`에 설치되어 전체 워크플로우를
|
|
|
265
269
|
| `/reap.merge.validation` | 기계적 테스트 실행 (bun test, tsc, build) |
|
|
266
270
|
| **`/reap.merge.evolve`** | **전체 머지 라이프사이클 자동 실행** |
|
|
267
271
|
|
|
268
|
-
### SessionStart Hook
|
|
272
|
+
### SessionStart Hook [↗](https://reap.cc/docs/hooks)
|
|
269
273
|
|
|
270
274
|
매 세션 시작 시 자동으로 실행되어 AI 에이전트에게 다음을 주입합니다:
|
|
271
275
|
|
|
@@ -305,7 +309,7 @@ strict:
|
|
|
305
309
|
|
|
306
310
|
Strict 모드는 기본적으로 비활성화되어 있습니다 (`strict: false`).
|
|
307
311
|
|
|
308
|
-
### REAP Hooks
|
|
312
|
+
### REAP Hooks [↗](https://reap.cc/docs/hooks)
|
|
309
313
|
|
|
310
314
|
Hook은 파일 기반이며 `.reap/hooks/`에 저장됩니다. 각 Hook은 `{event}.{name}.{md|sh}` 형식의 파일입니다:
|
|
311
315
|
|
|
@@ -314,33 +318,47 @@ Hook은 파일 기반이며 `.reap/hooks/`에 저장됩니다. 각 Hook은 `{eve
|
|
|
314
318
|
|
|
315
319
|
```
|
|
316
320
|
.reap/hooks/
|
|
317
|
-
├──
|
|
318
|
-
├──
|
|
319
|
-
├──
|
|
320
|
-
├──
|
|
321
|
-
└──
|
|
321
|
+
├── onLifeStarted.context-load.md
|
|
322
|
+
├── onLifeCompleted.version-bump.md
|
|
323
|
+
├── onLifeCompleted.readme-update.md
|
|
324
|
+
├── onLifeTransited.notify.sh
|
|
325
|
+
└── onLifeRegretted.alert.sh
|
|
322
326
|
```
|
|
323
327
|
|
|
324
328
|
각 Hook 파일은 다음 필드를 가진 frontmatter를 지원합니다:
|
|
325
329
|
|
|
326
330
|
```yaml
|
|
327
331
|
---
|
|
328
|
-
condition: has-code-changes #
|
|
332
|
+
condition: has-code-changes # .reap/hooks/conditions/ 내 스크립트 이름
|
|
329
333
|
order: 10 # 실행 순서 (낮을수록 먼저 실행)
|
|
330
334
|
---
|
|
331
335
|
```
|
|
332
336
|
|
|
337
|
+
**Normal Lifecycle Events:**
|
|
338
|
+
|
|
339
|
+
| 이벤트 | 트리거 |
|
|
340
|
+
|--------|--------|
|
|
341
|
+
| `onLifeStarted` | `/reap.start`로 새 Generation 생성 후 |
|
|
342
|
+
| `onLifeObjected` | objective 단계 완료 후 |
|
|
343
|
+
| `onLifePlanned` | planning 단계 완료 후 |
|
|
344
|
+
| `onLifeImplemented` | implementation 단계 완료 후 |
|
|
345
|
+
| `onLifeValidated` | validation 단계 완료 후 |
|
|
346
|
+
| `onLifeCompleted` | completion + archiving 후 (git commit 이후 실행) |
|
|
347
|
+
| `onLifeTransited` | 모든 stage 전환 시 (범용) |
|
|
348
|
+
| `onLifeRegretted` | `/reap.back` regression 시 |
|
|
349
|
+
|
|
350
|
+
**Merge Lifecycle Events:**
|
|
351
|
+
|
|
333
352
|
| 이벤트 | 트리거 |
|
|
334
353
|
|--------|--------|
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
|
|
343
|
-
Hook은 AI 에이전트가 프로젝트 루트 디렉토리에서 실행합니다. `onGenerationComplete` Hook에는 자동 버전 범프 판단이 포함되어 있습니다 — patch 수준은 자동으로 적용되고, minor/major 범프는 사용자 확인을 거칩니다.
|
|
354
|
+
| `onMergeStarted` | `/reap.merge.start`로 머지 Generation 생성 후 |
|
|
355
|
+
| `onMergeDetected` | detect 단계 완료 후 |
|
|
356
|
+
| `onMergeMated` | mate 단계 완료 후 (genome 확정) |
|
|
357
|
+
| `onMergeMerged` | merge 단계 완료 후 (소스 병합) |
|
|
358
|
+
| `onMergeSynced` | sync 단계 완료 후 |
|
|
359
|
+
| `onMergeValidated` | merge validation 완료 후 |
|
|
360
|
+
| `onMergeCompleted` | merge completion + archiving 후 |
|
|
361
|
+
| `onMergeTransited` | 모든 merge stage 전환 시 (범용) |
|
|
344
362
|
|
|
345
363
|
## `reap init` 후 프로젝트 구조
|
|
346
364
|
|
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ You can also drive each stage manually if you need finer control:
|
|
|
101
101
|
> ...
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
## Life Cycle
|
|
104
|
+
## Life Cycle [↗](https://reap.cc/docs/lifecycle)
|
|
105
105
|
|
|
106
106
|
Each generation goes through a five-stage life cycle:
|
|
107
107
|
|
|
@@ -117,9 +117,9 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
117
117
|
| **Validation** | Run tests, verify completion criteria | `04-validation.md` |
|
|
118
118
|
| **Completion** | Retrospective + apply Genome changes + hook suggestion + archive | `05-completion.md` |
|
|
119
119
|
|
|
120
|
-
## Core Concepts
|
|
120
|
+
## Core Concepts [↗](https://reap.cc/docs/core-concepts)
|
|
121
121
|
|
|
122
|
-
### Genome
|
|
122
|
+
### Genome [↗](https://reap.cc/docs/genome)
|
|
123
123
|
|
|
124
124
|
The application's genetic information — a collection of architecture principles, business rules, development conventions, and technical constraints.
|
|
125
125
|
|
|
@@ -136,7 +136,7 @@ The application's genetic information — a collection of architecture principle
|
|
|
136
136
|
|
|
137
137
|
**Environment Immutability Principle**: The Environment is never modified directly during the current generation. External changes are recorded in the backlog and applied at the Completion stage.
|
|
138
138
|
|
|
139
|
-
### Backlog
|
|
139
|
+
### Backlog [↗](https://reap.cc/docs/backlog)
|
|
140
140
|
|
|
141
141
|
All items to be addressed next are stored in `.reap/life/backlog/`. Each item uses markdown + frontmatter format:
|
|
142
142
|
|
|
@@ -153,17 +153,17 @@ At archiving time (`/reap.next` from Completion), `consumed` items move to linea
|
|
|
153
153
|
|
|
154
154
|
**Partial completion is normal** — Tasks that depend on Genome changes are marked `[deferred]` and handed off to the next generation.
|
|
155
155
|
|
|
156
|
-
### Four-Axis Structure
|
|
156
|
+
### Four-Axis Structure [↗](https://reap.cc/docs/core-concepts)
|
|
157
157
|
|
|
158
158
|
```
|
|
159
159
|
.reap/
|
|
160
160
|
├── genome/ # Genetic information (evolves across generations)
|
|
161
161
|
├── environment/ # External context (API docs, infra, business constraints)
|
|
162
|
-
├── life/ #
|
|
162
|
+
├── life/ # Lifecycle — current generation's state and artifacts
|
|
163
163
|
└── lineage/ # Archive of completed generations
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
## Distributed Workflow
|
|
166
|
+
## Distributed Workflow [↗](https://reap.cc/docs/distributed-workflow)
|
|
167
167
|
|
|
168
168
|
> **⚠ Early Stage** — The distributed workflow requires further testing. Use with caution in production. We're collecting feedback — [open an issue](https://github.com/c-d-cc/reap/issues).
|
|
169
169
|
|
|
@@ -212,7 +212,7 @@ All distributed operations run through your AI agent:
|
|
|
212
212
|
- **No server** — Everything is local + Git. No external services.
|
|
213
213
|
- **DAG lineage** — Each generation references its parents via a hash-based ID (`gen-046-a3f8c2`), forming a directed acyclic graph that naturally supports parallel work.
|
|
214
214
|
|
|
215
|
-
## CLI Commands
|
|
215
|
+
## CLI Commands [↗](https://reap.cc/docs/cli-reference)
|
|
216
216
|
|
|
217
217
|
| Command | Description |
|
|
218
218
|
|---------|-------------|
|
|
@@ -234,7 +234,7 @@ reap update --dry-run # Preview changes before applying
|
|
|
234
234
|
|
|
235
235
|
REAP integrates with AI agents through slash commands and session hooks. Currently supported agents: **Claude Code** and **OpenCode**.
|
|
236
236
|
|
|
237
|
-
### Slash Commands
|
|
237
|
+
### Slash Commands [↗](https://reap.cc/docs/command-reference)
|
|
238
238
|
|
|
239
239
|
Slash commands are installed in `.claude/commands/` and drive the entire workflow:
|
|
240
240
|
|
|
@@ -245,13 +245,17 @@ Slash commands are installed in `.claude/commands/` and drive the entire workflo
|
|
|
245
245
|
| `/reap.planning` | Task decomposition + implementation plan |
|
|
246
246
|
| `/reap.implementation` | Code implementation with AI + human |
|
|
247
247
|
| `/reap.validation` | Run tests, verify completion criteria |
|
|
248
|
-
| `/reap.completion` | Retrospective + apply Genome changes |
|
|
248
|
+
| `/reap.completion` | Retrospective + apply Genome changes + lineage compression |
|
|
249
249
|
| `/reap.next` | Advance to the next life cycle stage |
|
|
250
250
|
| `/reap.back` | Return to a previous stage (micro loop) |
|
|
251
|
+
| `/reap.abort` | Abort current generation (rollback/stash/hold + backlog save) |
|
|
251
252
|
| `/reap.status` | Show current generation state and project health |
|
|
252
|
-
| `/reap.sync` | Synchronize Genome
|
|
253
|
-
| `/reap.
|
|
254
|
-
| `/reap.
|
|
253
|
+
| `/reap.sync` | Synchronize both Genome and Environment |
|
|
254
|
+
| `/reap.sync.genome` | Synchronize Genome with current source code |
|
|
255
|
+
| `/reap.sync.environment` | Discover and document external environment dependencies |
|
|
256
|
+
| `/reap.report` | Report a bug or feedback to the REAP project (privacy-safe) |
|
|
257
|
+
| `/reap.help` | Contextual AI help with 24+ topics |
|
|
258
|
+
| `/reap.update` | Upgrade REAP package + sync commands/templates/hooks |
|
|
255
259
|
| **`/reap.evolve`** | **Run an entire generation from start to finish (recommended)** |
|
|
256
260
|
| **`/reap.pull <branch>`** | **Fetch + run full merge generation (distributed `/reap.evolve`)** |
|
|
257
261
|
| **`/reap.merge <branch>`** | **Run full merge generation for a local branch (no fetch)** |
|
|
@@ -264,19 +268,21 @@ Slash commands are installed in `.claude/commands/` and drive the entire workflo
|
|
|
264
268
|
| `/reap.merge.validation` | Run mechanical testing (bun test, tsc, build) |
|
|
265
269
|
| **`/reap.merge.evolve`** | **Run the full merge lifecycle automatically** |
|
|
266
270
|
|
|
267
|
-
### SessionStart Hook
|
|
271
|
+
### SessionStart Hook [↗](https://reap.cc/docs/hooks)
|
|
268
272
|
|
|
269
273
|
Runs automatically at the start of every session, injecting the following into the AI agent:
|
|
270
274
|
|
|
271
275
|
- The full REAP workflow guide (Genome, Life Cycle, Four-Axis Structure, etc.)
|
|
272
276
|
- Current generation state (which stage you're in, what to do next)
|
|
277
|
+
- Environment summary (`environment/summary.md`) — external system context
|
|
273
278
|
- Rules to follow the REAP lifecycle
|
|
274
|
-
- Genome staleness detection — checks if code-related commits
|
|
275
|
-
- Source-map drift detection — compares documented components
|
|
279
|
+
- Genome staleness detection — checks if code-related commits have occurred since the last Genome update
|
|
280
|
+
- Source-map drift detection — compares documented components against actual files
|
|
281
|
+
- Slash command installation — copies commands from `~/.reap/commands/` to project `.claude/commands/`
|
|
276
282
|
|
|
277
283
|
This ensures the agent immediately understands the project context even in a brand-new session.
|
|
278
284
|
|
|
279
|
-
### Strict Mode
|
|
285
|
+
### Strict Mode [↗](https://reap.cc/docs/configuration)
|
|
280
286
|
|
|
281
287
|
Strict mode controls what the AI agent is allowed to do. It supports two granular options:
|
|
282
288
|
|
|
@@ -304,7 +310,7 @@ Both are disabled by default. `strict: true` enables both.
|
|
|
304
310
|
|
|
305
311
|
Strict mode is disabled by default (`strict: false`).
|
|
306
312
|
|
|
307
|
-
### REAP Hooks
|
|
313
|
+
### REAP Hooks [↗](https://reap.cc/docs/hooks)
|
|
308
314
|
|
|
309
315
|
Hooks are file-based and stored in `.reap/hooks/`. Each hook is a file named `{event}.{name}.{md|sh}`:
|
|
310
316
|
|
|
@@ -313,33 +319,47 @@ Hooks are file-based and stored in `.reap/hooks/`. Each hook is a file named `{e
|
|
|
313
319
|
|
|
314
320
|
```
|
|
315
321
|
.reap/hooks/
|
|
316
|
-
├──
|
|
317
|
-
├──
|
|
318
|
-
├──
|
|
319
|
-
├──
|
|
320
|
-
└──
|
|
322
|
+
├── onLifeStarted.context-load.md
|
|
323
|
+
├── onLifeCompleted.reap-update.sh
|
|
324
|
+
├── onLifeCompleted.docs-update.md
|
|
325
|
+
├── onLifeTransited.notify.sh
|
|
326
|
+
└── onLifeRegretted.alert.sh
|
|
321
327
|
```
|
|
322
328
|
|
|
323
329
|
Each hook file supports frontmatter with the following fields:
|
|
324
330
|
|
|
325
331
|
```yaml
|
|
326
332
|
---
|
|
327
|
-
condition: has-code-changes #
|
|
333
|
+
condition: has-code-changes # script name in .reap/hooks/conditions/
|
|
328
334
|
order: 10 # execution order (lower runs first)
|
|
329
335
|
---
|
|
330
336
|
```
|
|
331
337
|
|
|
338
|
+
**Normal Lifecycle Events:**
|
|
339
|
+
|
|
332
340
|
| Event | Trigger |
|
|
333
341
|
|-------|---------|
|
|
334
|
-
| `
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
342
|
+
| `onLifeStarted` | After `/reap.start` creates a new generation |
|
|
343
|
+
| `onLifeObjected` | After objective stage completes |
|
|
344
|
+
| `onLifePlanned` | After planning stage completes |
|
|
345
|
+
| `onLifeImplemented` | After implementation stage completes |
|
|
346
|
+
| `onLifeValidated` | After validation stage completes |
|
|
347
|
+
| `onLifeCompleted` | After completion + archiving (runs after git commit) |
|
|
348
|
+
| `onLifeTransited` | After any stage transition (generic) |
|
|
349
|
+
| `onLifeRegretted` | After `/reap.back` regression |
|
|
350
|
+
|
|
351
|
+
**Merge Lifecycle Events:**
|
|
341
352
|
|
|
342
|
-
|
|
353
|
+
| Event | Trigger |
|
|
354
|
+
|-------|---------|
|
|
355
|
+
| `onMergeStarted` | After `/reap.merge.start` creates a merge generation |
|
|
356
|
+
| `onMergeDetected` | After detect stage completes |
|
|
357
|
+
| `onMergeMated` | After mate stage completes (genome resolved) |
|
|
358
|
+
| `onMergeMerged` | After merge stage completes (source merged) |
|
|
359
|
+
| `onMergeSynced` | After sync stage completes |
|
|
360
|
+
| `onMergeValidated` | After merge validation completes |
|
|
361
|
+
| `onMergeCompleted` | After merge completion + archiving |
|
|
362
|
+
| `onMergeTransited` | After any merge stage transition (generic) |
|
|
343
363
|
|
|
344
364
|
## Project Structure After `reap init`
|
|
345
365
|
|
|
@@ -355,27 +375,38 @@ my-project/
|
|
|
355
375
|
│ ├── constraints.md
|
|
356
376
|
│ └── source-map.md
|
|
357
377
|
├── hooks/ # Lifecycle hooks (.md/.sh)
|
|
358
|
-
├── environment/ # External context
|
|
378
|
+
├── environment/ # External context (3-layer)
|
|
379
|
+
│ ├── summary.md # Session context (~100 lines, auto-loaded)
|
|
380
|
+
│ ├── docs/ # Main reference docs
|
|
381
|
+
│ └── resources/ # Raw materials (user-managed)
|
|
359
382
|
├── life/ # Current generation
|
|
360
383
|
│ ├── current.yml
|
|
361
384
|
│ └── backlog/
|
|
362
385
|
└── lineage/ # Completed generation archive
|
|
363
386
|
|
|
364
|
-
~/.
|
|
365
|
-
├── commands/
|
|
366
|
-
└──
|
|
387
|
+
~/.reap/ # User-level (installed by reap init)
|
|
388
|
+
├── commands/ # Slash command originals
|
|
389
|
+
└── templates/ # Artifact templates
|
|
390
|
+
|
|
391
|
+
~/.claude/
|
|
392
|
+
└── settings.json # SessionStart hook registration
|
|
393
|
+
|
|
394
|
+
.claude/commands/ # Project-level (copied by session-start hook)
|
|
395
|
+
└── reap.*.md # Active slash commands (auto-synced)
|
|
367
396
|
```
|
|
368
397
|
|
|
369
|
-
## Lineage Compression
|
|
398
|
+
## Lineage Compression [↗](https://reap.cc/docs/lineage)
|
|
399
|
+
|
|
400
|
+
As generations accumulate, the lineage directory grows. REAP manages this with automatic two-level compression during the Completion stage:
|
|
370
401
|
|
|
371
|
-
|
|
402
|
+
| Level | Input | Output | Trigger | Protection |
|
|
403
|
+
|-------|-------|--------|---------|------------|
|
|
404
|
+
| **Level 1** | Generation folder (5 artifacts) | `gen-XXX-{hash}.md` (40 lines) | lineage > 5,000 lines + 5+ generations | Recent 3 generations + DAG leaf nodes |
|
|
405
|
+
| **Level 2** | 100+ Level 1 files | Single `epoch.md` | Level 1 files > 100 | Recent 9 Level 1 files + fork points |
|
|
372
406
|
|
|
373
|
-
|
|
374
|
-
|-------|-------|--------|-----------|---------|
|
|
375
|
-
| **Level 1** | Generation folder (5 artifacts) | `gen-XXX-{hash}.md` | 40 lines | lineage > 5,000 lines + 5+ generations |
|
|
376
|
-
| **Level 2** | 5 Level 1 files | `epoch-XXX.md` | 60 lines | 5+ Level 1 files |
|
|
407
|
+
**DAG preservation**: Level 1 files retain DAG metadata (id, parents, genomeHash) in frontmatter. Level 2 `epoch.md` stores a `generations` hash chain in frontmatter for DAG traversal.
|
|
377
408
|
|
|
378
|
-
|
|
409
|
+
**Fork guard**: Before Level 2 compression, all local and remote branches are scanned. Generations that serve as fork points for other branches are protected from epoch compression. Epoch-compressed generations cannot be used as merge bases.
|
|
379
410
|
|
|
380
411
|
## Evolution Flow
|
|
381
412
|
|
package/README.zh-CN.md
CHANGED
|
@@ -101,7 +101,7 @@ claude
|
|
|
101
101
|
> ...
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
## 生命周期
|
|
104
|
+
## 生命周期 [↗](https://reap.cc/docs/lifecycle)
|
|
105
105
|
|
|
106
106
|
每个Generation经历5个阶段的生命周期:
|
|
107
107
|
|
|
@@ -118,9 +118,9 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
118
118
|
| **Validation** | 执行测试、检查完成条件 | `04-validation.md` |
|
|
119
119
|
| **Completion** | 回顾 + 应用Genome变更 + Hook建议 + 归档 | `05-completion.md` |
|
|
120
120
|
|
|
121
|
-
## 核心概念
|
|
121
|
+
## 核心概念 [↗](https://reap.cc/docs/core-concepts)
|
|
122
122
|
|
|
123
|
-
### Genome
|
|
123
|
+
### Genome [↗](https://reap.cc/docs/genome)
|
|
124
124
|
|
|
125
125
|
应用程序的遗传信息 — 架构原则、业务规则、开发约定、技术约束的集合。
|
|
126
126
|
|
|
@@ -137,7 +137,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
137
137
|
|
|
138
138
|
**Environment不变原则**:当前世代不直接修改Environment。发现外部环境变化时记录在backlog中,在Completion阶段反映。
|
|
139
139
|
|
|
140
|
-
### Backlog
|
|
140
|
+
### Backlog [↗](https://reap.cc/docs/backlog)
|
|
141
141
|
|
|
142
142
|
`.reap/life/backlog/`中存储所有待反映的项目。每个项目使用markdown + frontmatter格式:
|
|
143
143
|
|
|
@@ -154,13 +154,13 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
154
154
|
|
|
155
155
|
**部分完成是正常的** — 依赖Genome变更的任务标记为`[deferred]`并交接到下一个世代。
|
|
156
156
|
|
|
157
|
-
### 四轴结构
|
|
157
|
+
### 四轴结构 [↗](https://reap.cc/docs/core-concepts)
|
|
158
158
|
|
|
159
159
|
```
|
|
160
160
|
.reap/
|
|
161
161
|
├── genome/ # 遗传信息(跨世代进化)
|
|
162
162
|
├── environment/ # 外部环境(API文档、基础设施、业务约束)
|
|
163
|
-
├── life/ # 当前世代的状态和产出物
|
|
163
|
+
├── life/ # 生命周期 — 当前世代的状态和产出物
|
|
164
164
|
└── lineage/ # 已完成世代的归档
|
|
165
165
|
```
|
|
166
166
|
|
|
@@ -213,7 +213,7 @@ Machine A:
|
|
|
213
213
|
- **无需服务器** — 一切基于本地 + Git,无需外部服务。
|
|
214
214
|
- **DAG lineage** — 每个世代通过基于哈希的ID(`gen-046-a3f8c2`)引用其父代,形成有向无环图,天然支持并行工作。
|
|
215
215
|
|
|
216
|
-
## CLI命令
|
|
216
|
+
## CLI命令 [↗](https://reap.cc/docs/cli-reference)
|
|
217
217
|
|
|
218
218
|
| 命令 | 说明 |
|
|
219
219
|
|------|------|
|
|
@@ -235,7 +235,7 @@ reap update --dry-run # 预览变更
|
|
|
235
235
|
|
|
236
236
|
REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理:**Claude Code**、**OpenCode**。
|
|
237
237
|
|
|
238
|
-
### 斜杠命令
|
|
238
|
+
### 斜杠命令 [↗](https://reap.cc/docs/command-reference)
|
|
239
239
|
|
|
240
240
|
斜杠命令安装在`.claude/commands/`中,驱动整个工作流:
|
|
241
241
|
|
|
@@ -246,13 +246,17 @@ REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理
|
|
|
246
246
|
| `/reap.planning` | 任务分解 + 实施计划 |
|
|
247
247
|
| `/reap.implementation` | AI+人类协作编写代码 |
|
|
248
248
|
| `/reap.validation` | 执行测试、检查完成条件 |
|
|
249
|
-
| `/reap.completion` | 回顾 + 应用Genome变更 |
|
|
249
|
+
| `/reap.completion` | 回顾 + 应用Genome变更 + lineage压缩 |
|
|
250
250
|
| `/reap.next` | 前进到下一个生命周期阶段 |
|
|
251
251
|
| `/reap.back` | 回到前一个阶段(micro loop) |
|
|
252
|
+
| `/reap.abort` | 中止当前Generation(rollback/stash/hold + backlog保存) |
|
|
252
253
|
| `/reap.status` | 显示当前Generation状态和项目健康度 |
|
|
253
|
-
| `/reap.sync` |
|
|
254
|
-
| `/reap.
|
|
255
|
-
| `/reap.
|
|
254
|
+
| `/reap.sync` | 同时同步Genome和Environment |
|
|
255
|
+
| `/reap.sync.genome` | 基于源代码同步Genome |
|
|
256
|
+
| `/reap.sync.environment` | 发现和记录外部环境依赖 |
|
|
257
|
+
| `/reap.report` | 向REAP项目报告bug/反馈(隐私保护) |
|
|
258
|
+
| `/reap.help` | 24+主题的上下文AI帮助 |
|
|
259
|
+
| `/reap.update` | 升级REAP包 + 同步命令/模板/hook |
|
|
256
260
|
| **`/reap.evolve`** | **从头到尾运行一个完整的Generation(推荐)** |
|
|
257
261
|
| **`/reap.pull <branch>`** | **Fetch + 运行完整合并Generation(分布式 `/reap.evolve`)** |
|
|
258
262
|
| **`/reap.merge <branch>`** | **本地分支完整合并Generation(无需fetch)** |
|
|
@@ -265,7 +269,7 @@ REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理
|
|
|
265
269
|
| `/reap.merge.validation` | 运行机械化测试(bun test、tsc、build) |
|
|
266
270
|
| **`/reap.merge.evolve`** | **自动运行完整的合并生命周期** |
|
|
267
271
|
|
|
268
|
-
### SessionStart Hook
|
|
272
|
+
### SessionStart Hook [↗](https://reap.cc/docs/hooks)
|
|
269
273
|
|
|
270
274
|
每次会话开始时自动运行,向AI代理注入以下内容:
|
|
271
275
|
|
|
@@ -305,7 +309,7 @@ strict:
|
|
|
305
309
|
|
|
306
310
|
Strict模式默认禁用(`strict: false`)。
|
|
307
311
|
|
|
308
|
-
### REAP Hooks
|
|
312
|
+
### REAP Hooks [↗](https://reap.cc/docs/hooks)
|
|
309
313
|
|
|
310
314
|
Hook基于文件,存储在`.reap/hooks/`中。每个Hook是一个以`{event}.{name}.{md|sh}`命名的文件:
|
|
311
315
|
|
|
@@ -314,33 +318,47 @@ Hook基于文件,存储在`.reap/hooks/`中。每个Hook是一个以`{event}.{
|
|
|
314
318
|
|
|
315
319
|
```
|
|
316
320
|
.reap/hooks/
|
|
317
|
-
├──
|
|
318
|
-
├──
|
|
319
|
-
├──
|
|
320
|
-
├──
|
|
321
|
-
└──
|
|
321
|
+
├── onLifeStarted.context-load.md
|
|
322
|
+
├── onLifeCompleted.version-bump.md
|
|
323
|
+
├── onLifeCompleted.readme-update.md
|
|
324
|
+
├── onLifeTransited.notify.sh
|
|
325
|
+
└── onLifeRegretted.alert.sh
|
|
322
326
|
```
|
|
323
327
|
|
|
324
328
|
每个Hook文件支持包含以下字段的frontmatter:
|
|
325
329
|
|
|
326
330
|
```yaml
|
|
327
331
|
---
|
|
328
|
-
condition: has-code-changes #
|
|
332
|
+
condition: has-code-changes # .reap/hooks/conditions/中的脚本名称
|
|
329
333
|
order: 10 # 执行顺序(数值越小越先执行)
|
|
330
334
|
---
|
|
331
335
|
```
|
|
332
336
|
|
|
337
|
+
**Normal Lifecycle Events:**
|
|
338
|
+
|
|
339
|
+
| 事件 | 触发时机 |
|
|
340
|
+
|------|----------|
|
|
341
|
+
| `onLifeStarted` | `/reap.start`创建新Generation后 |
|
|
342
|
+
| `onLifeObjected` | objective阶段完成后 |
|
|
343
|
+
| `onLifePlanned` | planning阶段完成后 |
|
|
344
|
+
| `onLifeImplemented` | implementation阶段完成后 |
|
|
345
|
+
| `onLifeValidated` | validation阶段完成后 |
|
|
346
|
+
| `onLifeCompleted` | completion + 归档后(git commit之后运行) |
|
|
347
|
+
| `onLifeTransited` | 所有stage转换时(通用) |
|
|
348
|
+
| `onLifeRegretted` | `/reap.back` regression时 |
|
|
349
|
+
|
|
350
|
+
**Merge Lifecycle Events:**
|
|
351
|
+
|
|
333
352
|
| 事件 | 触发时机 |
|
|
334
353
|
|------|----------|
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
|
|
343
|
-
Hook由AI代理在项目根目录中执行。`onGenerationComplete` Hook包含自动版本号升级判断 — patch级别自动应用,minor/major级别需要用户确认。
|
|
354
|
+
| `onMergeStarted` | `/reap.merge.start`创建合并Generation后 |
|
|
355
|
+
| `onMergeDetected` | detect阶段完成后 |
|
|
356
|
+
| `onMergeMated` | mate阶段完成后(genome确定) |
|
|
357
|
+
| `onMergeMerged` | merge阶段完成后(源代码合并) |
|
|
358
|
+
| `onMergeSynced` | sync阶段完成后 |
|
|
359
|
+
| `onMergeValidated` | merge validation完成后 |
|
|
360
|
+
| `onMergeCompleted` | merge completion + 归档后 |
|
|
361
|
+
| `onMergeTransited` | 所有merge stage转换时(通用) |
|
|
344
362
|
|
|
345
363
|
## `reap init`后的项目结构
|
|
346
364
|
|
package/dist/cli.js
CHANGED
|
@@ -11070,7 +11070,7 @@ async function fixProject(projectRoot) {
|
|
|
11070
11070
|
// src/cli/index.ts
|
|
11071
11071
|
init_fs();
|
|
11072
11072
|
import { join as join12 } from "path";
|
|
11073
|
-
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.
|
|
11073
|
+
program.name("reap").description("REAP — Recursive Evolutionary Autonomous Pipeline").version("0.10.0");
|
|
11074
11074
|
program.command("init").description("Initialize a new REAP project (Genesis)").argument("[project-name]", "Project name (defaults to current directory name)").option("-m, --mode <mode>", "Entry mode: greenfield, migration, adoption", "greenfield").option("-p, --preset <preset>", "Bootstrap with a genome preset (e.g., bun-hono-react)").action(async (projectName, options) => {
|
|
11075
11075
|
try {
|
|
11076
11076
|
const cwd = process.cwd();
|
|
@@ -46,7 +46,7 @@ description: "REAP Back — Return to a previous lifecycle stage"
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
### Hook Execution (Regression)
|
|
49
|
-
7. Scan `.reap/hooks/` for files matching `
|
|
49
|
+
7. Scan `.reap/hooks/` for files matching `onLifeRegretted.*`
|
|
50
50
|
- For each matched file (sorted by `order` from frontmatter, then alphabetically):
|
|
51
51
|
1. Read the frontmatter (`condition`, `order`)
|
|
52
52
|
2. Evaluate `condition` by running `.reap/hooks/conditions/{condition}.sh` (exit 0 = met, non-zero = skip):
|
|
@@ -81,10 +81,10 @@ Do NOT finalize Genome changes without running Validation Commands.
|
|
|
81
81
|
a. **Describe the pattern**: "최근 N개 generation에서 '[작업 설명]'이 반복적으로 수행되었습니다."
|
|
82
82
|
b. **Ask if it should be a hook**: "이 작업을 hook으로 자동화할까요? (yes/no)"
|
|
83
83
|
c. If yes, ask **event**: "어떤 이벤트에서 실행할까요?"
|
|
84
|
-
- `
|
|
85
|
-
- `
|
|
86
|
-
- `
|
|
87
|
-
- `
|
|
84
|
+
- `onLifeCompleted` — generation 완료 후
|
|
85
|
+
- `onLifeTransited` — stage 전환 시
|
|
86
|
+
- `onLifeStarted` — generation 시작 시
|
|
87
|
+
- `onLifeRegretted` — stage 회귀 시
|
|
88
88
|
d. Ask **condition**: "실행 조건은 무엇인가요?"
|
|
89
89
|
- `always` — 항상
|
|
90
90
|
- `has-code-changes` — src/ 변경이 있을 때
|
|
@@ -82,7 +82,7 @@ For command-name topics: read `reap.{name}.md` from the same directory as this f
|
|
|
82
82
|
- **backlog** — `.reap/life/backlog/`. genome-change, environment-change, task. status: pending/consumed. consumed → lineage, pending → 이월.
|
|
83
83
|
- **strict** — `strict: true`: no generation = 코드 수정 차단, non-implementation = 차단, implementation = plan scope만. Escape: "override"/"bypass strict".
|
|
84
84
|
- **agents** — AgentAdapter 추상화. auto-detect (Claude Code, OpenCode). config.yml `agents` 오버라이드.
|
|
85
|
-
- **hooks** — config.yml:
|
|
85
|
+
- **hooks** — config.yml: onLifeStarted, onLifeTransited, onLifeCompleted, onLifeRegretted. command/prompt 타입.
|
|
86
86
|
- **config** — `.reap/config.yml`: version, project, entryMode, strict, language, agents, autoUpdate, hooks.
|
|
87
87
|
- **evolve** — `/reap.evolve`: 전체 lifecycle 자율 실행. 사람 확인 없이 objective~completion 순차 진행.
|
|
88
88
|
- **regression** — `/reap.back`: 이전 stage 회귀. timeline + artifact에 Regression 섹션 기록.
|
|
@@ -23,8 +23,17 @@ This command is the **ONLY legitimate way** to advance the lifecycle stage. All
|
|
|
23
23
|
- Immediately create the next stage's artifact file from template (empty, ready to fill)
|
|
24
24
|
|
|
25
25
|
### Hook Execution (Stage Transition)
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Execute two sets of hooks in order:
|
|
27
|
+
|
|
28
|
+
1. **Stage-specific hook** — based on the stage that just completed:
|
|
29
|
+
- objective → planning: `onLifeObjected.*`
|
|
30
|
+
- planning → implementation: `onLifePlanned.*`
|
|
31
|
+
- implementation → validation: `onLifeImplemented.*`
|
|
32
|
+
- validation → completion: `onLifeValidated.*`
|
|
33
|
+
|
|
34
|
+
2. **Generic transition hook** — `onLifeTransited.*` (fires on every transition)
|
|
35
|
+
|
|
36
|
+
For each matched file (sorted by `order` from frontmatter, then alphabetically):
|
|
28
37
|
1. Read the frontmatter (`condition`, `order`)
|
|
29
38
|
2. Evaluate `condition` by running `.reap/hooks/conditions/{condition}.sh` (exit 0 = met, non-zero = skip):
|
|
30
39
|
- If `condition` is absent: treat as `always`
|
|
@@ -64,7 +73,7 @@ This command is the **ONLY legitimate way** to advance the lifecycle stage. All
|
|
|
64
73
|
- If there are no code changes (REAP-only generation), use `chore(reap): [goal summary]`
|
|
65
74
|
|
|
66
75
|
### Hook Execution (Generation Complete)
|
|
67
|
-
- Scan `.reap/hooks/` for files matching `
|
|
76
|
+
- Scan `.reap/hooks/` for files matching `onLifeCompleted.*`
|
|
68
77
|
- For each matched file (sorted by `order` from frontmatter, then alphabetically):
|
|
69
78
|
1. Read the frontmatter (`condition`, `order`)
|
|
70
79
|
2. Evaluate `condition` by running `.reap/hooks/conditions/{condition}.sh` (exit 0 = met, non-zero = skip):
|
|
@@ -41,7 +41,7 @@ description: "REAP Start — Start a new Generation"
|
|
|
41
41
|
7. Immediately create `.reap/life/01-objective.md` from the artifact template with the Goal section filled in
|
|
42
42
|
|
|
43
43
|
### Hook Execution (Generation Start)
|
|
44
|
-
8. Scan `.reap/hooks/` for files matching `
|
|
44
|
+
8. Scan `.reap/hooks/` for files matching `onLifeStarted.*`
|
|
45
45
|
- For each matched file (sorted by `order` from frontmatter, then alphabetically):
|
|
46
46
|
1. Read the frontmatter (`condition`, `order`)
|
|
47
47
|
2. Evaluate `condition` by running `.reap/hooks/conditions/{condition}.sh` (exit 0 = met, non-zero = skip):
|
|
@@ -110,19 +110,18 @@ Hooks are defined as individual files in `.reap/hooks/` with the naming conventi
|
|
|
110
110
|
|
|
111
111
|
```
|
|
112
112
|
.reap/hooks/
|
|
113
|
-
├──
|
|
114
|
-
├──
|
|
115
|
-
├──
|
|
116
|
-
└──
|
|
113
|
+
├── onLifeCompleted.reap-update.sh
|
|
114
|
+
├── onLifeCompleted.docs-update.md
|
|
115
|
+
├── onLifeImplemented.lint-check.sh
|
|
116
|
+
└── onMergeMated.notify.md
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
File naming: `{event}.{name}.{extension}`
|
|
120
|
-
- Event: onGenerationStart, onStageTransition, onGenerationComplete, onRegression
|
|
121
120
|
- Extension: `.md` (AI prompt) or `.sh` (shell script)
|
|
121
|
+
- Frontmatter: `condition` (default: `always`), `order` (default: 50, lower runs first)
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- `order`: execution order within the same event (default: 50, lower runs first)
|
|
123
|
+
Normal events: `onLifeStarted`, `onLifeObjected`, `onLifePlanned`, `onLifeImplemented`, `onLifeValidated`, `onLifeCompleted`, `onLifeTransited`, `onLifeRegretted`
|
|
124
|
+
Merge events: `onMergeStarted`, `onMergeDetected`, `onMergeMated`, `onMergeMerged`, `onMergeSynced`, `onMergeValidated`, `onMergeCompleted`, `onMergeTransited`
|
|
126
125
|
|
|
127
126
|
### Conditions
|
|
128
127
|
|
|
@@ -135,14 +134,13 @@ Default conditions (installed by `reap init`):
|
|
|
135
134
|
|
|
136
135
|
Custom conditions: add any `.sh` script to `.reap/hooks/conditions/`. The hook's `condition` field matches the filename (without `.sh`).
|
|
137
136
|
|
|
138
|
-
|
|
139
|
-
|-------|---------|
|
|
140
|
-
| `onGenerationStart` | After `/reap.start` creates a new generation |
|
|
141
|
-
| `onStageTransition` | After `/reap.next` advances to the next stage |
|
|
142
|
-
| `onGenerationComplete` | After `/reap.next` archives a completed generation (after commit) |
|
|
143
|
-
| `onRegression` | After `/reap.back` returns to a previous stage |
|
|
137
|
+
### Execution
|
|
144
138
|
|
|
145
|
-
Hooks are executed by the AI agent by scanning `.reap/hooks/` for files matching the current event
|
|
139
|
+
Hooks are executed by the AI agent by scanning `.reap/hooks/` for files matching the current event:
|
|
140
|
+
- `.md` files: read as AI prompt and follow the instructions
|
|
141
|
+
- `.sh` files: run as shell script in the project root directory
|
|
142
|
+
- Within the same event, hooks run in `order` (lower first), then alphabetically
|
|
143
|
+
- `onLifeCompleted`/`onMergeCompleted` hooks run after git commit — changes are uncommitted
|
|
146
144
|
|
|
147
145
|
## Multi-Agent Support
|
|
148
146
|
|