@c-d-cc/reap 0.2.1 → 0.3.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 +36 -20
- package/README.ko.md +36 -20
- package/README.md +36 -20
- package/README.zh-CN.md +36 -20
- package/dist/cli.js +35 -21
- package/dist/templates/commands/reap.back.md +12 -4
- package/dist/templates/commands/reap.completion.md +33 -0
- package/dist/templates/commands/reap.help.md +1 -1
- package/dist/templates/commands/reap.next.md +23 -7
- package/dist/templates/commands/reap.start.md +12 -4
- package/dist/templates/conditions/always.sh +3 -0
- package/dist/templates/conditions/has-code-changes.sh +13 -0
- package/dist/templates/conditions/version-bumped.sh +17 -0
- package/dist/templates/genome/constraints.md +1 -1
- package/dist/templates/genome/conventions.md +1 -1
- package/dist/templates/genome/principles.md +3 -7
- package/dist/templates/genome/source-map.md +22 -0
- package/dist/templates/hooks/reap-guide.md +31 -19
- package/dist/templates/hooks/session-start.cjs +245 -0
- package/dist/templates/presets/bun-hono-react/source-map.md +22 -0
- package/package.json +1 -1
- package/dist/templates/hooks/session-start.sh +0 -200
package/README.ja.md
CHANGED
|
@@ -38,6 +38,7 @@ REAPは**世代ベースの進化モデル**でこれらの問題を解決しま
|
|
|
38
38
|
- AIエージェントが毎セッション開始時に現在のコンテキストを自動認識(SessionStart Hook)
|
|
39
39
|
- 実装中に発見した設計問題はbacklogに記録、Completionで反映
|
|
40
40
|
- レトロスペクティブ(Completion)で導き出した教訓がGenomeに蓄積
|
|
41
|
+
- 世代を重ねて繰り返される手作業を自動検出し、ユーザー確認の上でHookとして生成
|
|
41
42
|
|
|
42
43
|
## インストール
|
|
43
44
|
|
|
@@ -97,7 +98,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
97
98
|
| **Planning** | タスク分解、実装アプローチ、依存関係 | `02-planning.md` |
|
|
98
99
|
| **Implementation** | AI+Human協力でコード実装 | `03-implementation.md` |
|
|
99
100
|
| **Validation** | テスト実行、完了条件の確認 | `04-validation.md` |
|
|
100
|
-
| **Completion** | レトロスペクティブ + Genome変更反映 + アーカイブ | `05-completion.md` |
|
|
101
|
+
| **Completion** | レトロスペクティブ + Genome変更反映 + Hook提案 + アーカイブ | `05-completion.md` |
|
|
101
102
|
|
|
102
103
|
## コアコンセプト
|
|
103
104
|
|
|
@@ -110,7 +111,8 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
110
111
|
├── principles.md # アーキテクチャ原則/決定
|
|
111
112
|
├── domain/ # ビジネスルール(モジュール別)
|
|
112
113
|
├── conventions.md # 開発ルール/コンベンション
|
|
113
|
-
|
|
114
|
+
├── constraints.md # 技術制約/選択
|
|
115
|
+
└── source-map.md # C4 Container/Componentダイアグラム(Mermaid)
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
**Genome不変原則**: 現在の世代ではGenomeを直接変更しません。問題を発見した場合はbacklogに記録し、Completionステージでのみ反映します。
|
|
@@ -182,7 +184,7 @@ REAPはスラッシュコマンドとセッションフックを通じてAIエ
|
|
|
182
184
|
| `/reap.back` | 前のステージに回帰(micro loop) |
|
|
183
185
|
| `/reap.status` | 現在のGeneration状態とプロジェクト健全性を表示 |
|
|
184
186
|
| `/reap.sync` | ソースコードベースでGenomeを最新化 |
|
|
185
|
-
| `/reap.help` |
|
|
187
|
+
| `/reap.help` | 24+トピックのcontextual AIヘルプ(workflow, genome, backlog, strict, agents, hooks, config, evolve, regression, authorおよび全コマンド名) |
|
|
186
188
|
| `/reap.update` | REAPのアップデート確認と最新バージョンへのアップグレード |
|
|
187
189
|
| **`/reap.evolve`** | **1つのGeneration全体を最初から最後まで実行(推奨)** |
|
|
188
190
|
|
|
@@ -193,6 +195,8 @@ REAPはスラッシュコマンドとセッションフックを通じてAIエ
|
|
|
193
195
|
- REAPワークフロー全体のガイド(Genome、ライフサイクル、4軸構造など)
|
|
194
196
|
- 現在のGeneration状態(どのステージにいるか、次に何をすべきか)
|
|
195
197
|
- REAPライフサイクルに従うルール
|
|
198
|
+
- Genome鮮度検出 — 最後のGenome更新以降にコード関連のコミット(`src/`、`tests/`、`package.json`、`tsconfig.json`、`scripts/`)があったかを確認(ドキュメントのみの変更は除外)
|
|
199
|
+
- Source-mapドリフト検出 — `source-map.md`に記録されたコンポーネントとプロジェクト内の実際のファイルを比較
|
|
196
200
|
|
|
197
201
|
これにより、新しいセッションを開いてもエージェントがプロジェクトコンテキストを即座に把握します。
|
|
198
202
|
|
|
@@ -220,22 +224,28 @@ Strictモードはデフォルトで無効です(`strict: false`)。
|
|
|
220
224
|
|
|
221
225
|
### REAP Hooks
|
|
222
226
|
|
|
223
|
-
|
|
227
|
+
Hookはファイルベースで`.reap/hooks/`に保存されます。各Hookは`{event}.{name}.{md|sh}`形式のファイルです:
|
|
228
|
+
|
|
229
|
+
- `.md`ファイルはAIプロンプトを含みます(AIエージェントが実行)
|
|
230
|
+
- `.sh`ファイルはシェルスクリプトを含みます(直接実行)
|
|
224
231
|
|
|
225
|
-
```yaml
|
|
226
|
-
hooks:
|
|
227
|
-
onGenerationStart:
|
|
228
|
-
- command: "echo 'Generation started'"
|
|
229
|
-
onStageTransition:
|
|
230
|
-
- command: "echo 'Stage changed'"
|
|
231
|
-
onGenerationComplete:
|
|
232
|
-
- command: "reap update"
|
|
233
|
-
- prompt: "今回のGenerationで変更された機能があればREADMEに反映せよ。"
|
|
234
|
-
onRegression:
|
|
235
|
-
- command: "echo 'Regressed'"
|
|
236
232
|
```
|
|
233
|
+
.reap/hooks/
|
|
234
|
+
├── onGenerationStart.context-load.md
|
|
235
|
+
├── onGenerationComplete.version-bump.md
|
|
236
|
+
├── onGenerationComplete.readme-update.md
|
|
237
|
+
├── onStageTransition.notify.sh
|
|
238
|
+
└── onRegression.alert.sh
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
各Hookファイルは以下のフィールドを持つfrontmatterをサポートします:
|
|
237
242
|
|
|
238
|
-
|
|
243
|
+
```yaml
|
|
244
|
+
---
|
|
245
|
+
condition: has-code-changes # always | has-code-changes | version-bumped
|
|
246
|
+
order: 10 # 実行順序(小さいほど先に実行)
|
|
247
|
+
---
|
|
248
|
+
```
|
|
239
249
|
|
|
240
250
|
| イベント | トリガー |
|
|
241
251
|
|----------|----------|
|
|
@@ -244,7 +254,7 @@ hooks:
|
|
|
244
254
|
| `onGenerationComplete` | `/reap.next`で完了したGenerationをアーカイブ後 |
|
|
245
255
|
| `onRegression` | `/reap.back`で前のステージに回帰後 |
|
|
246
256
|
|
|
247
|
-
HookはAI
|
|
257
|
+
HookはAIエージェントがプロジェクトルートディレクトリで実行します。`onGenerationComplete` Hookには自動バージョンバンプ判定が含まれています — patchレベルは自動適用され、minor/majorバンプはユーザー確認が必要です。
|
|
248
258
|
|
|
249
259
|
## `reap init`後のプロジェクト構造
|
|
250
260
|
|
|
@@ -257,7 +267,9 @@ my-project/
|
|
|
257
267
|
│ ├── principles.md
|
|
258
268
|
│ ├── domain/
|
|
259
269
|
│ ├── conventions.md
|
|
260
|
-
│
|
|
270
|
+
│ ├── constraints.md
|
|
271
|
+
│ └── source-map.md
|
|
272
|
+
├── hooks/ # Lifecycle hooks (.md/.sh)
|
|
261
273
|
├── environment/ # 外部環境
|
|
262
274
|
├── life/ # 現在の世代
|
|
263
275
|
│ ├── current.yml
|
|
@@ -275,10 +287,10 @@ my-project/
|
|
|
275
287
|
|
|
276
288
|
| レベル | 入力 | 出力 | 最大行数 | トリガー |
|
|
277
289
|
|--------|------|------|----------|----------|
|
|
278
|
-
| **Level 1** | 世代フォルダ(5つの成果物) | `gen-XXX.md` | 40行 | lineage >
|
|
290
|
+
| **Level 1** | 世代フォルダ(5つの成果物) | `gen-XXX.md` | 40行 | lineage > 5,000行 + 5世代以上 |
|
|
279
291
|
| **Level 2** | Level 1ファイル5つ | `epoch-XXX.md` | 60行 | Level 1が5つ以上 |
|
|
280
292
|
|
|
281
|
-
|
|
293
|
+
圧縮は世代完了時に自動実行されます。直近3世代は常に圧縮から保護されます。圧縮されたファイルは目標(Objective)と結果(Completion)を中心に保存し、中間過程は特記事項のみを残します。
|
|
282
294
|
|
|
283
295
|
## 進化フロー(Evolution Flow)
|
|
284
296
|
|
|
@@ -316,6 +328,10 @@ reap init my-project --preset bun-hono-react
|
|
|
316
328
|
| `migration` | 既存システムを参照しながら新規構築 |
|
|
317
329
|
| `adoption` | 既存コードベースにREAPを適用 |
|
|
318
330
|
|
|
331
|
+
## 作者
|
|
332
|
+
|
|
333
|
+
**HyeonIL Choi** — [hichoi@c-d.cc](mailto:hichoi@c-d.cc) | [c-d.cc](https://c-d.cc) | [LinkedIn](https://www.linkedin.com/in/hichoi-dev) | [GitHub](https://github.com/casamia918)
|
|
334
|
+
|
|
319
335
|
## ライセンス
|
|
320
336
|
|
|
321
337
|
MIT
|
package/README.ko.md
CHANGED
|
@@ -38,6 +38,7 @@ REAP은 **세대 기반 진화 모델**로 이 문제들을 해결합니다:
|
|
|
38
38
|
- AI 에이전트가 매 세션 시작 시 현재 맥락을 자동으로 인식 (SessionStart Hook)
|
|
39
39
|
- 구현 중 발견한 설계 문제는 backlog에 기록, Completion에서 반영
|
|
40
40
|
- 회고(Completion)에서 도출한 교훈이 Genome에 축적
|
|
41
|
+
- 세대를 거듭하며 반복되는 수작업을 자동 감지하고, 사용자 확인 후 Hook으로 생성
|
|
41
42
|
|
|
42
43
|
## 설치
|
|
43
44
|
|
|
@@ -97,7 +98,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
97
98
|
| **Planning** | 태스크 분해, 구현 접근법, 의존관계 | `02-planning.md` |
|
|
98
99
|
| **Implementation** | AI+Human 협업으로 코드 구현 | `03-implementation.md` |
|
|
99
100
|
| **Validation** | 테스트 실행, 완료 조건 점검 | `04-validation.md` |
|
|
100
|
-
| **Completion** | 회고 + Genome 변경 반영 + 아카이빙 | `05-completion.md` |
|
|
101
|
+
| **Completion** | 회고 + Genome 변경 반영 + Hook 제안 + 아카이빙 | `05-completion.md` |
|
|
101
102
|
|
|
102
103
|
## 핵심 개념
|
|
103
104
|
|
|
@@ -110,7 +111,8 @@ Application의 유전 정보 — 아키텍처 원칙, 비즈니스 규칙, 개
|
|
|
110
111
|
├── principles.md # 아키텍처 원칙/결정
|
|
111
112
|
├── domain/ # 비즈니스 규칙 (모듈별)
|
|
112
113
|
├── conventions.md # 개발 규칙/컨벤션
|
|
113
|
-
|
|
114
|
+
├── constraints.md # 기술 제약/선택
|
|
115
|
+
└── source-map.md # C4 Container/Component 다이어그램 (Mermaid)
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
**Genome 불변 원칙**: 현재 세대에서는 Genome을 직접 수정하지 않습니다. 문제를 발견하면 backlog에 기록하고, Completion 단계에서만 반영합니다.
|
|
@@ -182,7 +184,7 @@ Slash command가 `.claude/commands/`에 설치되어 전체 워크플로우를
|
|
|
182
184
|
| `/reap.back` | 이전 stage로 복귀 (micro loop) |
|
|
183
185
|
| `/reap.status` | 현재 Generation 상태 및 프로젝트 건강 상태 표시 |
|
|
184
186
|
| `/reap.sync` | 소스 코드 기반 Genome 최신화 |
|
|
185
|
-
| `/reap.help` |
|
|
187
|
+
| `/reap.help` | 24+ 주제의 contextual AI 도움말 (workflow, genome, backlog, strict, agents, hooks, config, evolve, regression, author 및 모든 커맨드 이름) |
|
|
186
188
|
| `/reap.update` | REAP 업데이트 확인 및 최신 버전으로 업그레이드 |
|
|
187
189
|
| **`/reap.evolve`** | **한 Generation 전체를 처음부터 끝까지 실행 (권장)** |
|
|
188
190
|
|
|
@@ -193,6 +195,8 @@ Slash command가 `.claude/commands/`에 설치되어 전체 워크플로우를
|
|
|
193
195
|
- REAP 워크플로우 전체 가이드 (Genome, Life Cycle, 4축 구조 등)
|
|
194
196
|
- 현재 Generation 상태 (어떤 stage인지, 다음에 뭘 해야 하는지)
|
|
195
197
|
- REAP lifecycle을 따르라는 규칙
|
|
198
|
+
- Genome 최신성 감지 — 마지막 Genome 업데이트 이후 코드 관련 커밋(`src/`, `tests/`, `package.json`, `tsconfig.json`, `scripts/`)이 있었는지 확인 (문서 전용 변경은 제외)
|
|
199
|
+
- Source-map 드리프트 감지 — `source-map.md`에 기록된 컴포넌트와 프로젝트의 실제 파일을 비교
|
|
196
200
|
|
|
197
201
|
이를 통해 새 세션을 열어도 에이전트가 프로젝트 맥락을 즉시 파악합니다.
|
|
198
202
|
|
|
@@ -220,22 +224,28 @@ Strict 모드는 기본적으로 비활성화되어 있습니다 (`strict: false
|
|
|
220
224
|
|
|
221
225
|
### REAP Hooks
|
|
222
226
|
|
|
223
|
-
`.reap/
|
|
227
|
+
Hook은 파일 기반이며 `.reap/hooks/`에 저장됩니다. 각 Hook은 `{event}.{name}.{md|sh}` 형식의 파일입니다:
|
|
228
|
+
|
|
229
|
+
- `.md` 파일은 AI 프롬프트를 담고 있습니다 (AI 에이전트가 실행)
|
|
230
|
+
- `.sh` 파일은 셸 스크립트를 담고 있습니다 (직접 실행)
|
|
224
231
|
|
|
225
|
-
```yaml
|
|
226
|
-
hooks:
|
|
227
|
-
onGenerationStart:
|
|
228
|
-
- command: "echo 'Generation started'"
|
|
229
|
-
onStageTransition:
|
|
230
|
-
- command: "echo 'Stage changed'"
|
|
231
|
-
onGenerationComplete:
|
|
232
|
-
- command: "reap update"
|
|
233
|
-
- prompt: "이번 Generation 변경사항을 README에 반영하라."
|
|
234
|
-
onRegression:
|
|
235
|
-
- command: "echo 'Regressed'"
|
|
236
232
|
```
|
|
233
|
+
.reap/hooks/
|
|
234
|
+
├── onGenerationStart.context-load.md
|
|
235
|
+
├── onGenerationComplete.version-bump.md
|
|
236
|
+
├── onGenerationComplete.readme-update.md
|
|
237
|
+
├── onStageTransition.notify.sh
|
|
238
|
+
└── onRegression.alert.sh
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
각 Hook 파일은 다음 필드를 가진 frontmatter를 지원합니다:
|
|
237
242
|
|
|
238
|
-
|
|
243
|
+
```yaml
|
|
244
|
+
---
|
|
245
|
+
condition: has-code-changes # always | has-code-changes | version-bumped
|
|
246
|
+
order: 10 # 실행 순서 (낮을수록 먼저 실행)
|
|
247
|
+
---
|
|
248
|
+
```
|
|
239
249
|
|
|
240
250
|
| 이벤트 | 트리거 |
|
|
241
251
|
|--------|--------|
|
|
@@ -244,7 +254,7 @@ hooks:
|
|
|
244
254
|
| `onGenerationComplete` | `/reap.next`로 완료된 Generation 아카이빙 후 |
|
|
245
255
|
| `onRegression` | `/reap.back`으로 이전 stage 복귀 후 |
|
|
246
256
|
|
|
247
|
-
Hook은 AI 에이전트가 프로젝트 루트 디렉토리에서 실행합니다.
|
|
257
|
+
Hook은 AI 에이전트가 프로젝트 루트 디렉토리에서 실행합니다. `onGenerationComplete` Hook에는 자동 버전 범프 판단이 포함되어 있습니다 — patch 수준은 자동으로 적용되고, minor/major 범프는 사용자 확인을 거칩니다.
|
|
248
258
|
|
|
249
259
|
## `reap init` 후 프로젝트 구조
|
|
250
260
|
|
|
@@ -257,7 +267,9 @@ my-project/
|
|
|
257
267
|
│ ├── principles.md
|
|
258
268
|
│ ├── domain/
|
|
259
269
|
│ ├── conventions.md
|
|
260
|
-
│
|
|
270
|
+
│ ├── constraints.md
|
|
271
|
+
│ └── source-map.md
|
|
272
|
+
├── hooks/ # Lifecycle hooks (.md/.sh)
|
|
261
273
|
├── environment/ # 외부 환경
|
|
262
274
|
├── life/ # 현재 세대
|
|
263
275
|
│ ├── current.yml
|
|
@@ -275,10 +287,10 @@ my-project/
|
|
|
275
287
|
|
|
276
288
|
| 레벨 | 입력 | 출력 | 최대 줄 수 | 트리거 |
|
|
277
289
|
|------|------|------|-----------|--------|
|
|
278
|
-
| **Level 1** | 세대 폴더 (5개 산출물) | `gen-XXX.md` | 40줄 | lineage >
|
|
290
|
+
| **Level 1** | 세대 폴더 (5개 산출물) | `gen-XXX.md` | 40줄 | lineage > 5,000줄 + 5세대 이상 |
|
|
279
291
|
| **Level 2** | Level 1 파일 5개 | `epoch-XXX.md` | 60줄 | Level 1이 5개 이상 |
|
|
280
292
|
|
|
281
|
-
압축은 세대 완료 시 자동 실행됩니다. 압축된 파일은 목표(Objective)와 결과(Completion)를 중심으로 보존하고, 중간 과정은 특이사항만 남깁니다.
|
|
293
|
+
압축은 세대 완료 시 자동 실행됩니다. 가장 최근 3개 세대는 항상 압축에서 보호됩니다. 압축된 파일은 목표(Objective)와 결과(Completion)를 중심으로 보존하고, 중간 과정은 특이사항만 남깁니다.
|
|
282
294
|
|
|
283
295
|
## 진화 흐름 (Evolution Flow)
|
|
284
296
|
|
|
@@ -316,6 +328,10 @@ reap init my-project --preset bun-hono-react
|
|
|
316
328
|
| `migration` | 기존 시스템을 참조하여 새로 구축 |
|
|
317
329
|
| `adoption` | 기존 코드베이스에 REAP을 적용 |
|
|
318
330
|
|
|
331
|
+
## 저자
|
|
332
|
+
|
|
333
|
+
**HyeonIL Choi** — [hichoi@c-d.cc](mailto:hichoi@c-d.cc) | [c-d.cc](https://c-d.cc) | [LinkedIn](https://www.linkedin.com/in/hichoi-dev) | [GitHub](https://github.com/casamia918)
|
|
334
|
+
|
|
319
335
|
## 라이선스
|
|
320
336
|
|
|
321
337
|
MIT
|
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ REAP solves these with a **generation-based evolution model**:
|
|
|
38
38
|
- The AI agent automatically picks up current context at every session start (SessionStart Hook)
|
|
39
39
|
- Design issues discovered during implementation are logged in the backlog and addressed at Completion
|
|
40
40
|
- Lessons drawn from retrospectives (Completion) accumulate in the Genome
|
|
41
|
+
- Repeated manual tasks are automatically detected across generations, with user-confirmed hook creation
|
|
41
42
|
|
|
42
43
|
## Installation
|
|
43
44
|
|
|
@@ -96,7 +97,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
96
97
|
| **Planning** | Break down tasks, choose approach, map dependencies | `02-planning.md` |
|
|
97
98
|
| **Implementation** | Build with AI + human collaboration | `03-implementation.md` |
|
|
98
99
|
| **Validation** | Run tests, verify completion criteria | `04-validation.md` |
|
|
99
|
-
| **Completion** | Retrospective + apply Genome changes + archive | `05-completion.md` |
|
|
100
|
+
| **Completion** | Retrospective + apply Genome changes + hook suggestion + archive | `05-completion.md` |
|
|
100
101
|
|
|
101
102
|
## Core Concepts
|
|
102
103
|
|
|
@@ -109,7 +110,8 @@ The application's genetic information — a collection of architecture principle
|
|
|
109
110
|
├── principles.md # Architecture principles/decisions
|
|
110
111
|
├── domain/ # Business rules (per module)
|
|
111
112
|
├── conventions.md # Development rules/conventions
|
|
112
|
-
|
|
113
|
+
├── constraints.md # Technical constraints/choices
|
|
114
|
+
└── source-map.md # C4 Container/Component diagram (Mermaid)
|
|
113
115
|
```
|
|
114
116
|
|
|
115
117
|
**Genome Immutability Principle**: The Genome is never modified directly during the current generation. When an issue is found, it is recorded in the backlog and only applied at the Completion stage.
|
|
@@ -181,7 +183,7 @@ Slash commands are installed in `.claude/commands/` and drive the entire workflo
|
|
|
181
183
|
| `/reap.back` | Return to a previous stage (micro loop) |
|
|
182
184
|
| `/reap.status` | Show current generation state and project health |
|
|
183
185
|
| `/reap.sync` | Synchronize Genome with current source code |
|
|
184
|
-
| `/reap.help` | Contextual AI help
|
|
186
|
+
| `/reap.help` | Contextual AI help with 24+ topics (workflow, genome, backlog, strict, agents, hooks, config, evolve, regression, author, and all command names) |
|
|
185
187
|
| `/reap.update` | Check for REAP updates and upgrade to the latest version |
|
|
186
188
|
| **`/reap.evolve`** | **Run an entire generation from start to finish (recommended)** |
|
|
187
189
|
|
|
@@ -192,6 +194,8 @@ Runs automatically at the start of every session, injecting the following into t
|
|
|
192
194
|
- The full REAP workflow guide (Genome, Life Cycle, Four-Axis Structure, etc.)
|
|
193
195
|
- Current generation state (which stage you're in, what to do next)
|
|
194
196
|
- Rules to follow the REAP lifecycle
|
|
197
|
+
- Genome staleness detection — checks if code-related commits (`src/`, `tests/`, `package.json`, `tsconfig.json`, `scripts/`) have occurred since the last Genome update (docs-only changes are excluded)
|
|
198
|
+
- Source-map drift detection — compares documented components in `source-map.md` against actual files in the project
|
|
195
199
|
|
|
196
200
|
This ensures the agent immediately understands the project context even in a brand-new session.
|
|
197
201
|
|
|
@@ -219,22 +223,28 @@ Strict mode is disabled by default (`strict: false`).
|
|
|
219
223
|
|
|
220
224
|
### REAP Hooks
|
|
221
225
|
|
|
222
|
-
|
|
226
|
+
Hooks are file-based and stored in `.reap/hooks/`. Each hook is a file named `{event}.{name}.{md|sh}`:
|
|
227
|
+
|
|
228
|
+
- `.md` files contain AI prompts (executed by the AI agent)
|
|
229
|
+
- `.sh` files contain shell scripts (executed directly)
|
|
223
230
|
|
|
224
|
-
```yaml
|
|
225
|
-
hooks:
|
|
226
|
-
onGenerationStart:
|
|
227
|
-
- command: "echo 'Generation started'"
|
|
228
|
-
onStageTransition:
|
|
229
|
-
- command: "echo 'Stage changed'"
|
|
230
|
-
onGenerationComplete:
|
|
231
|
-
- command: "reap update"
|
|
232
|
-
- prompt: "Update README if this generation changed any features."
|
|
233
|
-
onRegression:
|
|
234
|
-
- command: "echo 'Regressed'"
|
|
235
231
|
```
|
|
232
|
+
.reap/hooks/
|
|
233
|
+
├── onGenerationStart.context-load.md
|
|
234
|
+
├── onGenerationComplete.version-bump.md
|
|
235
|
+
├── onGenerationComplete.readme-update.md
|
|
236
|
+
├── onStageTransition.notify.sh
|
|
237
|
+
└── onRegression.alert.sh
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Each hook file supports frontmatter with the following fields:
|
|
236
241
|
|
|
237
|
-
|
|
242
|
+
```yaml
|
|
243
|
+
---
|
|
244
|
+
condition: has-code-changes # always | has-code-changes | version-bumped
|
|
245
|
+
order: 10 # execution order (lower runs first)
|
|
246
|
+
---
|
|
247
|
+
```
|
|
238
248
|
|
|
239
249
|
| Event | Trigger |
|
|
240
250
|
|-------|---------|
|
|
@@ -243,7 +253,7 @@ Each hook supports `command` (shell) or `prompt` (AI agent instruction).
|
|
|
243
253
|
| `onGenerationComplete` | After `/reap.next` archives a completed generation |
|
|
244
254
|
| `onRegression` | After `/reap.back` returns to a previous stage |
|
|
245
255
|
|
|
246
|
-
Hooks are executed by the AI agent in the project root directory.
|
|
256
|
+
Hooks are executed by the AI agent in the project root directory. The `onGenerationComplete` hooks include automatic version bump judgment — patch-level bumps are applied automatically, while minor/major bumps require user confirmation.
|
|
247
257
|
|
|
248
258
|
## Project Structure After `reap init`
|
|
249
259
|
|
|
@@ -256,7 +266,9 @@ my-project/
|
|
|
256
266
|
│ ├── principles.md
|
|
257
267
|
│ ├── domain/
|
|
258
268
|
│ ├── conventions.md
|
|
259
|
-
│
|
|
269
|
+
│ ├── constraints.md
|
|
270
|
+
│ └── source-map.md
|
|
271
|
+
├── hooks/ # Lifecycle hooks (.md/.sh)
|
|
260
272
|
├── environment/ # External context
|
|
261
273
|
├── life/ # Current generation
|
|
262
274
|
│ ├── current.yml
|
|
@@ -274,10 +286,10 @@ As generations accumulate, the lineage directory grows. REAP manages this with a
|
|
|
274
286
|
|
|
275
287
|
| Level | Input | Output | Max lines | Trigger |
|
|
276
288
|
|-------|-------|--------|-----------|---------|
|
|
277
|
-
| **Level 1** | Generation folder (5 artifacts) | `gen-XXX.md` | 40 lines | lineage >
|
|
289
|
+
| **Level 1** | Generation folder (5 artifacts) | `gen-XXX.md` | 40 lines | lineage > 5,000 lines + 5+ generations |
|
|
278
290
|
| **Level 2** | 5 Level 1 files | `epoch-XXX.md` | 60 lines | 5+ Level 1 files |
|
|
279
291
|
|
|
280
|
-
Compression runs automatically when a generation completes. Compressed files preserve objectives and completion results while retaining only notable findings from intermediate stages.
|
|
292
|
+
Compression runs automatically when a generation completes. The most recent 3 generations are always protected from compression. Compressed files preserve objectives and completion results while retaining only notable findings from intermediate stages.
|
|
281
293
|
|
|
282
294
|
## Evolution Flow
|
|
283
295
|
|
|
@@ -315,6 +327,10 @@ reap init my-project --preset bun-hono-react
|
|
|
315
327
|
| `migration` | Build anew while referencing an existing system |
|
|
316
328
|
| `adoption` | Apply REAP to an existing codebase |
|
|
317
329
|
|
|
330
|
+
## Author
|
|
331
|
+
|
|
332
|
+
**HyeonIL Choi** — [hichoi@c-d.cc](mailto:hichoi@c-d.cc) | [c-d.cc](https://c-d.cc) | [LinkedIn](https://www.linkedin.com/in/hichoi-dev) | [GitHub](https://github.com/casamia918)
|
|
333
|
+
|
|
318
334
|
## License
|
|
319
335
|
|
|
320
336
|
MIT
|
package/README.zh-CN.md
CHANGED
|
@@ -38,6 +38,7 @@ REAP通过**基于世代的进化模型**解决这些问题:
|
|
|
38
38
|
- AI代理在每次会话开始时自动获取当前上下文(SessionStart Hook)
|
|
39
39
|
- 实现过程中发现的设计问题记录在backlog中,在Completion时反映
|
|
40
40
|
- 回顾(Completion)中提取的教训积累在Genome中
|
|
41
|
+
- 跨世代自动检测重复的手动操作,经用户确认后生成Hook
|
|
41
42
|
|
|
42
43
|
## 安装
|
|
43
44
|
|
|
@@ -97,7 +98,7 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
97
98
|
| **Planning** | 任务分解、实施方案、依赖关系 | `02-planning.md` |
|
|
98
99
|
| **Implementation** | AI+人类协作编写代码 | `03-implementation.md` |
|
|
99
100
|
| **Validation** | 执行测试、检查完成条件 | `04-validation.md` |
|
|
100
|
-
| **Completion** | 回顾 + 应用Genome变更 + 归档 | `05-completion.md` |
|
|
101
|
+
| **Completion** | 回顾 + 应用Genome变更 + Hook建议 + 归档 | `05-completion.md` |
|
|
101
102
|
|
|
102
103
|
## 核心概念
|
|
103
104
|
|
|
@@ -110,7 +111,8 @@ Objective → Planning → Implementation ⟷ Validation → Completion
|
|
|
110
111
|
├── principles.md # 架构原则/决策
|
|
111
112
|
├── domain/ # 业务规则(按模块)
|
|
112
113
|
├── conventions.md # 开发规则/约定
|
|
113
|
-
|
|
114
|
+
├── constraints.md # 技术约束/选择
|
|
115
|
+
└── source-map.md # C4 Container/Component图(Mermaid)
|
|
114
116
|
```
|
|
115
117
|
|
|
116
118
|
**Genome不变原则**:当前世代不直接修改Genome。发现问题时记录在backlog中,仅在Completion阶段反映。
|
|
@@ -182,7 +184,7 @@ REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理
|
|
|
182
184
|
| `/reap.back` | 回到前一个阶段(micro loop) |
|
|
183
185
|
| `/reap.status` | 显示当前Generation状态和项目健康度 |
|
|
184
186
|
| `/reap.sync` | 基于源代码同步Genome |
|
|
185
|
-
| `/reap.help` |
|
|
187
|
+
| `/reap.help` | 24+主题的上下文AI帮助(workflow, genome, backlog, strict, agents, hooks, config, evolve, regression, author及所有命令名) |
|
|
186
188
|
| `/reap.update` | 检查REAP更新并升级到最新版本 |
|
|
187
189
|
| **`/reap.evolve`** | **从头到尾运行一个完整的Generation(推荐)** |
|
|
188
190
|
|
|
@@ -193,6 +195,8 @@ REAP通过斜杠命令和会话钩子与AI代理集成。当前支持的代理
|
|
|
193
195
|
- REAP工作流完整指南(Genome、生命周期、四轴结构等)
|
|
194
196
|
- 当前Generation状态(在哪个阶段、下一步做什么)
|
|
195
197
|
- 遵循REAP生命周期的规则
|
|
198
|
+
- Genome新鲜度检测 — 检查上次Genome更新后是否有代码相关提交(`src/`、`tests/`、`package.json`、`tsconfig.json`、`scripts/`),纯文档变更除外
|
|
199
|
+
- Source-map漂移检测 — 将`source-map.md`中记录的组件与项目中的实际文件进行比对
|
|
196
200
|
|
|
197
201
|
这确保即使打开新会话,代理也能立即理解项目上下文。
|
|
198
202
|
|
|
@@ -220,22 +224,28 @@ Strict模式默认禁用(`strict: false`)。
|
|
|
220
224
|
|
|
221
225
|
### REAP Hooks
|
|
222
226
|
|
|
223
|
-
|
|
227
|
+
Hook基于文件,存储在`.reap/hooks/`中。每个Hook是一个以`{event}.{name}.{md|sh}`命名的文件:
|
|
228
|
+
|
|
229
|
+
- `.md`文件包含AI提示词(由AI代理执行)
|
|
230
|
+
- `.sh`文件包含Shell脚本(直接执行)
|
|
224
231
|
|
|
225
|
-
```yaml
|
|
226
|
-
hooks:
|
|
227
|
-
onGenerationStart:
|
|
228
|
-
- command: "echo 'Generation started'"
|
|
229
|
-
onStageTransition:
|
|
230
|
-
- command: "echo 'Stage changed'"
|
|
231
|
-
onGenerationComplete:
|
|
232
|
-
- command: "reap update"
|
|
233
|
-
- prompt: "如果本Generation有功能变更,请更新README。"
|
|
234
|
-
onRegression:
|
|
235
|
-
- command: "echo 'Regressed'"
|
|
236
232
|
```
|
|
233
|
+
.reap/hooks/
|
|
234
|
+
├── onGenerationStart.context-load.md
|
|
235
|
+
├── onGenerationComplete.version-bump.md
|
|
236
|
+
├── onGenerationComplete.readme-update.md
|
|
237
|
+
├── onStageTransition.notify.sh
|
|
238
|
+
└── onRegression.alert.sh
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
每个Hook文件支持包含以下字段的frontmatter:
|
|
237
242
|
|
|
238
|
-
|
|
243
|
+
```yaml
|
|
244
|
+
---
|
|
245
|
+
condition: has-code-changes # always | has-code-changes | version-bumped
|
|
246
|
+
order: 10 # 执行顺序(数值越小越先执行)
|
|
247
|
+
---
|
|
248
|
+
```
|
|
239
249
|
|
|
240
250
|
| 事件 | 触发时机 |
|
|
241
251
|
|------|----------|
|
|
@@ -244,7 +254,7 @@ hooks:
|
|
|
244
254
|
| `onGenerationComplete` | `/reap.next`归档已完成的Generation后 |
|
|
245
255
|
| `onRegression` | `/reap.back`回到前一阶段后 |
|
|
246
256
|
|
|
247
|
-
Hook由AI
|
|
257
|
+
Hook由AI代理在项目根目录中执行。`onGenerationComplete` Hook包含自动版本号升级判断 — patch级别自动应用,minor/major级别需要用户确认。
|
|
248
258
|
|
|
249
259
|
## `reap init`后的项目结构
|
|
250
260
|
|
|
@@ -257,7 +267,9 @@ my-project/
|
|
|
257
267
|
│ ├── principles.md
|
|
258
268
|
│ ├── domain/
|
|
259
269
|
│ ├── conventions.md
|
|
260
|
-
│
|
|
270
|
+
│ ├── constraints.md
|
|
271
|
+
│ └── source-map.md
|
|
272
|
+
├── hooks/ # Lifecycle hooks (.md/.sh)
|
|
261
273
|
├── environment/ # 外部环境
|
|
262
274
|
├── life/ # 当前世代
|
|
263
275
|
│ ├── current.yml
|
|
@@ -275,10 +287,10 @@ my-project/
|
|
|
275
287
|
|
|
276
288
|
| 级别 | 输入 | 输出 | 最大行数 | 触发条件 |
|
|
277
289
|
|------|------|------|----------|----------|
|
|
278
|
-
| **Level 1** | 世代文件夹(5个产出物) | `gen-XXX.md` | 40行 | lineage >
|
|
290
|
+
| **Level 1** | 世代文件夹(5个产出物) | `gen-XXX.md` | 40行 | lineage > 5,000行 + 5个以上世代 |
|
|
279
291
|
| **Level 2** | 5个Level 1文件 | `epoch-XXX.md` | 60行 | Level 1达到5个以上 |
|
|
280
292
|
|
|
281
|
-
|
|
293
|
+
压缩在世代完成时自动执行。最近3个世代始终受到保护,不会被压缩。压缩后的文件以目标(Objective)和结果(Completion)为中心保存,中间过程仅保留特别事项。
|
|
282
294
|
|
|
283
295
|
## 进化流程(Evolution Flow)
|
|
284
296
|
|
|
@@ -316,6 +328,10 @@ reap init my-project --preset bun-hono-react
|
|
|
316
328
|
| `migration` | 参考现有系统进行新建 |
|
|
317
329
|
| `adoption` | 将REAP应用到现有代码库 |
|
|
318
330
|
|
|
331
|
+
## 作者
|
|
332
|
+
|
|
333
|
+
**HyeonIL Choi** — [hichoi@c-d.cc](mailto:hichoi@c-d.cc) | [c-d.cc](https://c-d.cc) | [LinkedIn](https://www.linkedin.com/in/hichoi-dev) | [GitHub](https://github.com/casamia918)
|
|
334
|
+
|
|
319
335
|
## 许可证
|
|
320
336
|
|
|
321
337
|
MIT
|