@c-d-cc/reap 0.10.2 → 0.11.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 +30 -8
- package/README.ko.md +30 -8
- package/README.md +22 -6
- package/README.zh-CN.md +30 -8
- package/dist/cli.js +4644 -1307
- package/dist/templates/artifacts/01-objective.md +1 -0
- package/dist/templates/artifacts/02-planning.md +1 -0
- package/dist/templates/artifacts/03-implementation.md +1 -0
- package/dist/templates/artifacts/04-validation.md +1 -0
- package/dist/templates/artifacts/05-completion.md +1 -0
- package/dist/templates/artifacts/merge/01-detect.md +1 -0
- package/dist/templates/artifacts/merge/02-mate.md +1 -0
- package/dist/templates/artifacts/merge/03-merge.md +1 -0
- package/dist/templates/artifacts/merge/04-sync.md +1 -0
- package/dist/templates/artifacts/merge/05-validation.md +1 -0
- package/dist/templates/artifacts/merge/06-completion.md +1 -0
- package/dist/templates/commands/reap.abort.md +1 -69
- package/dist/templates/commands/reap.back.md +1 -58
- package/dist/templates/commands/reap.completion.md +2 -145
- package/dist/templates/commands/reap.evolve.md +1 -51
- package/dist/templates/commands/reap.help.md +1 -90
- package/dist/templates/commands/reap.implementation.md +1 -98
- package/dist/templates/commands/reap.merge.completion.md +2 -17
- package/dist/templates/commands/reap.merge.detect.md +1 -16
- package/dist/templates/commands/reap.merge.evolve.md +1 -24
- package/dist/templates/commands/reap.merge.mate.md +1 -23
- package/dist/templates/commands/reap.merge.md +1 -43
- package/dist/templates/commands/reap.merge.merge.md +1 -18
- package/dist/templates/commands/reap.merge.start.md +1 -18
- package/dist/templates/commands/reap.merge.sync.md +1 -28
- package/dist/templates/commands/reap.merge.validation.md +1 -21
- package/dist/templates/commands/reap.next.md +1 -87
- package/dist/templates/commands/reap.objective.md +1 -252
- package/dist/templates/commands/reap.planning.md +1 -97
- package/dist/templates/commands/reap.pull.md +1 -49
- package/dist/templates/commands/reap.push.md +1 -14
- package/dist/templates/commands/reap.report.md +1 -123
- package/dist/templates/commands/reap.start.md +1 -53
- package/dist/templates/commands/reap.status.md +1 -76
- package/dist/templates/commands/reap.sync.environment.md +1 -80
- package/dist/templates/commands/reap.sync.genome.md +1 -105
- package/dist/templates/commands/reap.sync.md +1 -13
- package/dist/templates/commands/reap.update.md +1 -40
- package/dist/templates/commands/reap.validation.md +1 -81
- package/dist/templates/hooks/reap-guide.md +1 -0
- package/package.json +1 -1
|
@@ -2,72 +2,4 @@
|
|
|
2
2
|
description: "REAP Abort — Abort the current generation and return to initial state"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Abort the current generation and return to initial state.
|
|
8
|
-
|
|
9
|
-
## Gate (Preconditions)
|
|
10
|
-
- Read `.reap/life/current.yml`
|
|
11
|
-
- If no active Generation: ERROR — "No active Generation to abort." **STOP**
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
### 1. Show Current State
|
|
16
|
-
- Display: generation id, goal, current stage
|
|
17
|
-
- Ask: "이 generation을 abort 하시겠습니까?"
|
|
18
|
-
- If no: **STOP**
|
|
19
|
-
|
|
20
|
-
### 2. Abort Reason
|
|
21
|
-
- Ask: "abort 사유를 입력해주세요"
|
|
22
|
-
|
|
23
|
-
### 3. Source Code Handling
|
|
24
|
-
- Check `git diff --name-only` for uncommitted changes
|
|
25
|
-
- If no changes: skip to Step 4
|
|
26
|
-
- If changes exist, present the changed files and ask:
|
|
27
|
-
- **rollback**: `git checkout .` — 모든 변경 revert
|
|
28
|
-
- **stash**: `git stash push -m "reap-abort: {gen-id}"` — stash에 저장
|
|
29
|
-
- **hold**: 변경 유지 (working tree에 그대로)
|
|
30
|
-
|
|
31
|
-
### 4. Backlog Save
|
|
32
|
-
- Ask: "Goal과 진행 상황을 backlog에 저장할까요? (yes/no)"
|
|
33
|
-
- If yes:
|
|
34
|
-
- Read `01-objective.md` for goal/spec content
|
|
35
|
-
- Read `03-implementation.md` if exists for progress
|
|
36
|
-
- Create `.reap/life/backlog/aborted-{gen-id}.md`:
|
|
37
|
-
```markdown
|
|
38
|
-
---
|
|
39
|
-
type: task
|
|
40
|
-
status: pending
|
|
41
|
-
aborted: true
|
|
42
|
-
abortedFrom: {gen-id}
|
|
43
|
-
abortReason: "{reason}"
|
|
44
|
-
stage: {current stage}
|
|
45
|
-
sourceAction: rollback|stash|hold
|
|
46
|
-
stashRef: "reap-abort: {gen-id}" # only if stash
|
|
47
|
-
changedFiles:
|
|
48
|
-
- {file1}
|
|
49
|
-
- {file2}
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
# [Aborted] {goal}
|
|
53
|
-
|
|
54
|
-
## Original Goal
|
|
55
|
-
{goal from objective}
|
|
56
|
-
|
|
57
|
-
## Progress
|
|
58
|
-
{stage} 단계에서 중단.
|
|
59
|
-
{implementation summary if available}
|
|
60
|
-
|
|
61
|
-
## Resume Guide
|
|
62
|
-
{if stash: "git stash pop으로 코드 복구"}
|
|
63
|
-
{if hold: "코드 변경이 working tree에 유지됨"}
|
|
64
|
-
{if rollback: "코드 변경이 revert됨. objective부터 재시작 필요"}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### 5. Cleanup
|
|
68
|
-
- Delete all artifact files from `.reap/life/` (`01-*.md` through `05-*.md`)
|
|
69
|
-
- Clear `current.yml` (write empty content)
|
|
70
|
-
- Do NOT record in lineage (incomplete generation)
|
|
71
|
-
|
|
72
|
-
## Completion
|
|
73
|
-
- "Generation {gen-id} aborted. {backlog saved / not saved}."
|
|
5
|
+
Run `reap run abort` and follow the stdout instructions exactly.
|
|
@@ -2,61 +2,4 @@
|
|
|
2
2
|
description: "REAP Back — Return to a previous lifecycle stage"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Gate (Preconditions)
|
|
8
|
-
- Read `.reap/life/current.yml`
|
|
9
|
-
- If no active Generation: ERROR — "No active Generation." **STOP**
|
|
10
|
-
- If current stage is `objective` (first stage): ERROR — "Already at the first stage. Cannot go back." **STOP**
|
|
11
|
-
|
|
12
|
-
## Steps
|
|
13
|
-
|
|
14
|
-
1. Determine target stage:
|
|
15
|
-
- `/reap.back` alone: go to the immediately previous stage
|
|
16
|
-
- `/reap.back [stage]`: go directly to the specified stage
|
|
17
|
-
- Stage order: objective → planning → implementation → validation → completion
|
|
18
|
-
- Only backward transitions are allowed
|
|
19
|
-
2. Ask the human for the reason for regression
|
|
20
|
-
3. Collect regression reason and reference info:
|
|
21
|
-
- **reason**: why we are going back
|
|
22
|
-
- **refs**: related files/locations (artifact sections, source code locations)
|
|
23
|
-
4. Modify `current.yml`:
|
|
24
|
-
- Change `stage` to the target stage
|
|
25
|
-
- Add a regression entry to `timeline`:
|
|
26
|
-
```yaml
|
|
27
|
-
- stage: [target stage]
|
|
28
|
-
at: [current ISO 8601]
|
|
29
|
-
from: [original stage]
|
|
30
|
-
reason: [regression reason]
|
|
31
|
-
refs:
|
|
32
|
-
- [ref 1]
|
|
33
|
-
- [ref 2]
|
|
34
|
-
```
|
|
35
|
-
5. Artifact handling:
|
|
36
|
-
- **Before the target stage**: preserve
|
|
37
|
-
- **Target stage**: overwrite on re-entry (implementation only: append)
|
|
38
|
-
- **After the target stage**: preserve, overwrite on re-entry
|
|
39
|
-
6. Record the regression reason at the top of the target stage artifact as a `## Regression` section:
|
|
40
|
-
```markdown
|
|
41
|
-
## Regression
|
|
42
|
-
- **From**: [original stage]
|
|
43
|
-
- **Reason**: [regression reason]
|
|
44
|
-
- **Refs**: [reference list]
|
|
45
|
-
- **Affected**: [affected subsequent artifacts]
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Hook Execution (Regression)
|
|
49
|
-
7. Scan `.reap/hooks/` for files matching `onLifeRegretted.*`
|
|
50
|
-
- For each matched file (sorted by `order` from frontmatter, then alphabetically):
|
|
51
|
-
1. Read the frontmatter (`condition`, `order`)
|
|
52
|
-
2. Evaluate `condition` by running `.reap/hooks/conditions/{condition}.sh` (exit 0 = met, non-zero = skip):
|
|
53
|
-
- If `condition` is absent: treat as `always`
|
|
54
|
-
- If the condition script doesn't exist: warn and skip the hook
|
|
55
|
-
- Default conditions: `always`, `has-code-changes`, `version-bumped`
|
|
56
|
-
- Users can add custom conditions by placing scripts in `.reap/hooks/conditions/`
|
|
57
|
-
3. Execute based on file extension:
|
|
58
|
-
- `.md`: read the file content (after frontmatter) as AI prompt and follow the instructions
|
|
59
|
-
- `.sh`: run as shell script in the project root directory
|
|
60
|
-
|
|
61
|
-
## Completion
|
|
62
|
-
- "Returned to [stage] stage. Proceed with `/reap.[stage]`."
|
|
5
|
+
Run `reap run back` and follow the stdout instructions exactly.
|
|
@@ -1,148 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "REAP Completion — Retrospect, evolve the Genome, and finalize the Generation"
|
|
2
|
+
description: "REAP Completion — Retrospect, evolve the Genome, archive, and finalize the Generation"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<HARD-GATE>
|
|
8
|
-
Do NOT apply Genome changes without human confirmation — UNLESS called from `/reap.evolve` (Autonomous Override active).
|
|
9
|
-
Do NOT finalize Genome changes without running Validation Commands.
|
|
10
|
-
</HARD-GATE>
|
|
11
|
-
|
|
12
|
-
## Gate (Preconditions)
|
|
13
|
-
- Read `.reap/life/current.yml` and verify that stage is `completion`
|
|
14
|
-
- Verify that `.reap/life/04-validation.md` exists
|
|
15
|
-
- If not met: ERROR — state the reason and **STOP**
|
|
16
|
-
|
|
17
|
-
## Context (Generation Info)
|
|
18
|
-
- Read `.reap/life/current.yml` for the current generation info (id, goal, genomeVersion)
|
|
19
|
-
|
|
20
|
-
## Steps
|
|
21
|
-
|
|
22
|
-
### Phase 0: Summary
|
|
23
|
-
|
|
24
|
-
1. Fill the `## Summary` section of `05-completion.md` using data from `current.yml` and `04-validation.md`:
|
|
25
|
-
- **Goal**: from `current.yml` goal
|
|
26
|
-
- **Period**: from `current.yml` startedAt ~ completedAt
|
|
27
|
-
- **Genome Version**: from `current.yml` genomeVersion (v[N] → v[N+1])
|
|
28
|
-
- **Result**: from `04-validation.md` result (pass/partial/fail)
|
|
29
|
-
- **Key Changes**: brief one-line summary of what was delivered
|
|
30
|
-
|
|
31
|
-
### Phase 1: Retrospective
|
|
32
|
-
|
|
33
|
-
2. Read all `type: genome-change` and `type: environment-change` items from `.reap/life/backlog/`
|
|
34
|
-
3. Read the deferred task list from `.reap/life/03-implementation.md`
|
|
35
|
-
4. Compile lessons learned from this generation
|
|
36
|
-
- **Limit**: Maximum 5 lessons. Keep only the most impactful ones.
|
|
37
|
-
5. Compile genome changes to apply (which genome file to modify and how)
|
|
38
|
-
|
|
39
|
-
### Phase 2: Garbage Collection (Codebase Health)
|
|
40
|
-
|
|
41
|
-
6. Referencing the Enforced Rules in `.reap/genome/conventions.md`, check codebase consistency:
|
|
42
|
-
- Check whether new convention violations have been introduced
|
|
43
|
-
- Identify technical debt incurred during implementation
|
|
44
|
-
7. For each piece of technical debt found, add it to `.reap/life/backlog/`:
|
|
45
|
-
```markdown
|
|
46
|
-
---
|
|
47
|
-
type: task
|
|
48
|
-
status: pending
|
|
49
|
-
---
|
|
50
|
-
# [Title]
|
|
51
|
-
[Description]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Phase 3: Backlog Cleanup
|
|
55
|
-
|
|
56
|
-
8. Add deferred tasks to `.reap/life/backlog/` as `type: task`
|
|
57
|
-
9. Also add other next-generation goal candidates to the backlog
|
|
58
|
-
10. Finalize the retrospective with the human
|
|
59
|
-
|
|
60
|
-
### Phase 4: Genome Application
|
|
61
|
-
|
|
62
|
-
11. Read `type: genome-change` and `type: environment-change` items from `.reap/life/backlog/`
|
|
63
|
-
12. Apply genome-change items to the corresponding files in `.reap/genome/`:
|
|
64
|
-
- **Map principle**: Each genome file should be **~100 lines or less**
|
|
65
|
-
- If exceeding 100 lines, extract into files under `domain/`
|
|
66
|
-
- **When writing domain/ files, follow the guide in `~/.reap/templates/domain-guide.md`**
|
|
67
|
-
13. Apply environment-change items to the corresponding files in `.reap/environment/`
|
|
68
|
-
14. **Verify**: Run the Validation Commands from constraints.md to confirm genome changes do not conflict with existing code
|
|
69
|
-
15. **Human confirmation**:
|
|
70
|
-
- **If called from `/reap.evolve`** (Autonomous Override active): Apply genome changes automatically after Validation Commands pass. Do NOT pause for human confirmation.
|
|
71
|
-
- **If called standalone**: Show the modified genome/environment content to the human and get approval. Do NOT finalize changes until the human approves.
|
|
72
|
-
16. For each applied `type: genome-change` and `type: environment-change` backlog item, update its frontmatter to `status: consumed` and add `consumedBy: gen-XXX-{hash}`
|
|
73
|
-
|
|
74
|
-
### Phase 5: Hook Suggestion
|
|
75
|
-
|
|
76
|
-
17. Read the last 3 completed generations from `.reap/lineage/` (sorted by gen number, most recent first)
|
|
77
|
-
- For each: read `03-implementation.md` (Implementation Notes) and `05-completion.md` (Retrospective)
|
|
78
|
-
- Identify **manual tasks that were repeated across 2+ generations**
|
|
79
|
-
- Examples: docs update, lint fix, dependency sync, test data setup, specific file regeneration
|
|
80
|
-
18. If a repeated pattern is found, engage the human with a step-by-step confirmation:
|
|
81
|
-
a. **Describe the pattern**: "최근 N개 generation에서 '[작업 설명]'이 반복적으로 수행되었습니다."
|
|
82
|
-
b. **Ask if it should be a hook**: "이 작업을 hook으로 자동화할까요? (yes/no)"
|
|
83
|
-
c. If yes, ask **event**: "어떤 이벤트에서 실행할까요?"
|
|
84
|
-
- `onLifeCompleted` — generation 완료 후
|
|
85
|
-
- `onLifeTransited` — stage 전환 시
|
|
86
|
-
- `onLifeStarted` — generation 시작 시
|
|
87
|
-
- `onLifeRegretted` — stage 회귀 시
|
|
88
|
-
d. Ask **condition**: "실행 조건은 무엇인가요?"
|
|
89
|
-
- `always` — 항상
|
|
90
|
-
- `has-code-changes` — src/ 변경이 있을 때
|
|
91
|
-
- `version-bumped` — version bump가 있을 때
|
|
92
|
-
- Custom — 유저가 직접 기술
|
|
93
|
-
e. Ask **hook name**: "hook 이름을 지어주세요 (예: lint-fix, docs-sync)"
|
|
94
|
-
f. **Preview**: 생성될 hook 파일 내용을 보여주고 확인:
|
|
95
|
-
```
|
|
96
|
-
파일: .reap/hooks/{event}.{name}.md
|
|
97
|
-
---
|
|
98
|
-
condition: {condition}
|
|
99
|
-
order: 50
|
|
100
|
-
---
|
|
101
|
-
{작업 내용}
|
|
102
|
-
```
|
|
103
|
-
g. 유저 확인 후 `.reap/hooks/{event}.{name}.md` 생성
|
|
104
|
-
19. 반복 패턴이 없으면 skip — "반복 패턴이 감지되지 않았습니다."
|
|
105
|
-
20. **Limit**: 한 번에 최대 2개까지만 제안 (과부하 방지)
|
|
106
|
-
|
|
107
|
-
### Phase 6: Lineage Compression
|
|
108
|
-
|
|
109
|
-
21. Check if lineage compression is needed:
|
|
110
|
-
- Count total lines in `.reap/lineage/` and number of generations
|
|
111
|
-
- **Level 1 trigger**: total lines > 5,000 AND generations >= 5
|
|
112
|
-
- **Level 2 trigger**: Level 1 compressed `.md` files > 100
|
|
113
|
-
22. If Level 1 triggered:
|
|
114
|
-
- Compress oldest uncompressed generation directories into single `.md` files
|
|
115
|
-
- Protect: recent 3 generations + DAG leaf nodes
|
|
116
|
-
- Preserve DAG metadata in frontmatter (id, parents, genomeHash)
|
|
117
|
-
23. If Level 2 triggered:
|
|
118
|
-
- Run `git fetch --all` to update remote refs
|
|
119
|
-
- Scan all branches (local + remote) for fork points
|
|
120
|
-
- Compress eligible Level 1 files into single `epoch.md` (append if exists)
|
|
121
|
-
- Protect: recent 9 Level 1 files + all generations at/after fork points
|
|
122
|
-
- epoch.md frontmatter contains `generations` array with hash chain (id, parents, genomeHash)
|
|
123
|
-
24. Report compression results: "Compressed N generations (Level 1: X, Level 2: Y)"
|
|
124
|
-
- If no compression needed: skip silently
|
|
125
|
-
|
|
126
|
-
## Self-Verification
|
|
127
|
-
Before saving the artifact, verify:
|
|
128
|
-
- [ ] Are lessons concrete and applicable to the next generation? (No vague "do better next time")
|
|
129
|
-
- [ ] Have genome changes been confirmed by the human?
|
|
130
|
-
- [ ] Do Validation Commands still pass after the changes?
|
|
131
|
-
- [ ] Have deferred tasks been added to the backlog?
|
|
132
|
-
|
|
133
|
-
❌ Bad lesson: "We should write more tests"
|
|
134
|
-
✅ Good lesson: "SSE streaming responses are difficult to unit test, so prioritize integration tests"
|
|
135
|
-
|
|
136
|
-
## Artifact Generation (Progressive Recording)
|
|
137
|
-
- **Language**: Write all artifact content in the user's configured language (see REAP Guide § Language).
|
|
138
|
-
- **Immediately upon entering this stage**: Read `~/.reap/templates/05-completion.md` and create `.reap/life/05-completion.md` with empty sections ready to fill
|
|
139
|
-
- **Update incrementally as each phase completes**:
|
|
140
|
-
- After Phase 1 (Retrospective) → fill in Lessons Learned, Genome Change Proposals
|
|
141
|
-
- After Phase 2 (Garbage Collection) → update with any tech debt findings
|
|
142
|
-
- After Phase 3 (Backlog Cleanup) → fill in Deferred Task Handoff, Next Generation Backlog
|
|
143
|
-
- After Phase 4 (Genome Application) → fill in Genome Changelog sections
|
|
144
|
-
- The artifact should reflect the current state of completion work at all times
|
|
145
|
-
|
|
146
|
-
## Completion
|
|
147
|
-
- **If called from `/reap.evolve`** (Autonomous Override active): Proceed automatically to `/reap.next`.
|
|
148
|
-
- **If called standalone**: "Finalize the generation with `/reap.next`. Lineage archiving will be performed automatically."
|
|
5
|
+
Run `reap run completion` and follow the stdout instructions exactly.
|
|
@@ -2,54 +2,4 @@
|
|
|
2
2
|
description: "REAP Evolve — Run the full lifecycle for a Generation"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Run the entire Generation lifecycle from start to finish, interactively with the human.
|
|
8
|
-
|
|
9
|
-
<HARD-GATE>
|
|
10
|
-
NEVER modify `current.yml` directly to change the stage. ALWAYS use `/reap.next` to advance and `/reap.back` to regress.
|
|
11
|
-
Direct modification skips artifact creation and breaks the lifecycle. This is non-negotiable.
|
|
12
|
-
|
|
13
|
-
Specifically PROHIBITED:
|
|
14
|
-
- Running `node -e` or any script that writes to `current.yml`
|
|
15
|
-
- Using YAML.stringify() to update the stage field
|
|
16
|
-
- Any method other than invoking `/reap.next` or `/reap.back` slash commands
|
|
17
|
-
|
|
18
|
-
The ONLY legitimate way to change the stage is through `/reap.next` (forward) or `/reap.back` (regression).
|
|
19
|
-
</HARD-GATE>
|
|
20
|
-
|
|
21
|
-
## Gate (Preconditions)
|
|
22
|
-
- Read `.reap/life/current.yml`
|
|
23
|
-
- If no active Generation exists: run `/reap.start` first to create one
|
|
24
|
-
- If an active Generation exists: resume from the current stage
|
|
25
|
-
|
|
26
|
-
## Autonomous Override
|
|
27
|
-
When `/reap.evolve` calls each stage command, the following overrides apply:
|
|
28
|
-
- **Skip routine human confirmations**: Do NOT pause to show artifacts and ask for approval at the end of each stage. Proceed autonomously.
|
|
29
|
-
- **Skip environment/genome interactive setup questions**: Use existing data, fill in what you can, skip what's empty.
|
|
30
|
-
- **STOP only when genuinely blocked**: ambiguous goal with multiple valid interpretations, uncertain technical decision with significant trade-offs, conflicts in the genome, or unexpected errors.
|
|
31
|
-
- **Escalation sections still apply**: If a stage's Escalation rules trigger, STOP and ask.
|
|
32
|
-
- This override does NOT apply when stages are invoked standalone (e.g., user runs `/reap.objective` directly).
|
|
33
|
-
|
|
34
|
-
## Lifecycle Loop
|
|
35
|
-
|
|
36
|
-
Execute the following loop until the generation is complete:
|
|
37
|
-
|
|
38
|
-
1. Read `current.yml` to determine the current stage
|
|
39
|
-
2. Execute the corresponding stage command:
|
|
40
|
-
- `objective` → `/reap.objective`
|
|
41
|
-
- `planning` → `/reap.planning`
|
|
42
|
-
- `implementation` → `/reap.implementation`
|
|
43
|
-
- `validation` → `/reap.validation`
|
|
44
|
-
- `completion` → `/reap.completion`
|
|
45
|
-
3. When the stage command completes, run `/reap.next` to advance
|
|
46
|
-
4. If `/reap.next` archives the generation (from completion), the loop ends
|
|
47
|
-
5. Otherwise, return to step 1
|
|
48
|
-
|
|
49
|
-
## Handling Issues
|
|
50
|
-
- If validation fails: `/reap.back` to return to implementation (or earlier), then resume the loop
|
|
51
|
-
- If the human wants to pause: stop the loop, the generation state is preserved in `current.yml`
|
|
52
|
-
- If the human wants to skip a stage: advance with `/reap.next` without running the stage command
|
|
53
|
-
|
|
54
|
-
## Completion
|
|
55
|
-
- "Generation [id] completed. All artifacts archived to lineage."
|
|
5
|
+
Run `reap run evolve` and follow the stdout instructions exactly.
|
|
@@ -2,93 +2,4 @@
|
|
|
2
2
|
description: "REAP Help — Contextual help based on current state"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**ARGUMENTS**: $ARGUMENTS
|
|
8
|
-
|
|
9
|
-
## File Access Rules
|
|
10
|
-
- ONLY read `.reap/life/current.yml` and `.reap/config.yml`. No other files for basic help.
|
|
11
|
-
- For topic help: also read `reap.{name}.md` from the same directory as this file.
|
|
12
|
-
- Do NOT access global node_modules. Do NOT guess file paths.
|
|
13
|
-
|
|
14
|
-
## If ARGUMENTS is provided → skip to "Topic Help" section below.
|
|
15
|
-
|
|
16
|
-
## Basic Help (no arguments)
|
|
17
|
-
|
|
18
|
-
Read `.reap/life/current.yml` and `.reap/config.yml`, then output EXACTLY this format with values filled in. Use markdown formatting. Do NOT add extra explanation.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
**REAP** — Recursive Evolutionary Autonomous Pipeline
|
|
23
|
-
|
|
24
|
-
AI와 사람이 협업하여 소프트웨어를 세대(Generation) 단위로 진화시키는 개발 파이프라인입니다.
|
|
25
|
-
각 세대는 5단계 lifecycle을 거칩니다:
|
|
26
|
-
|
|
27
|
-
`Objective` → `Planning` → `Implementation` → `Validation` → `Completion`
|
|
28
|
-
|
|
29
|
-
Genome(`.reap/genome/`)에 프로젝트의 설계 원칙과 규칙을 기록하고, 세대를 거듭하며 점진적으로 진화합니다.
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
[If active generation exists, show:]
|
|
34
|
-
> 🔄 **{id}** — {goal}
|
|
35
|
-
> Stage: `{stage}` → 다음: `/reap.{stage}` 또는 `/reap.next`
|
|
36
|
-
|
|
37
|
-
[If no active generation, show:]
|
|
38
|
-
> No active Generation → `/reap.start` 또는 `/reap.evolve`
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
### 커맨드
|
|
43
|
-
|
|
44
|
-
| Command | Description |
|
|
45
|
-
|---------|-------------|
|
|
46
|
-
| `/reap.start` | 새 Generation을 시작하고 goal을 설정 |
|
|
47
|
-
| `/reap.evolve` | ⚡ 전체 lifecycle을 자율적으로 실행 (사람 개입 최소화) |
|
|
48
|
-
| `/reap.objective` | 이번 Generation의 목표, 요구사항, 완료 기준을 정의 |
|
|
49
|
-
| `/reap.planning` | 태스크를 분해하고 구현 계획을 수립 |
|
|
50
|
-
| `/reap.implementation` | 계획에 따라 코드를 구현하고 진행 상황을 기록 |
|
|
51
|
-
| `/reap.validation` | 테스트 실행, 완료 기준 충족 여부를 검증 |
|
|
52
|
-
| `/reap.completion` | 회고, Genome 변경 반영, Generation 마무리 |
|
|
53
|
-
| `/reap.next` | 다음 stage로 전진 (completion → archiving + commit) |
|
|
54
|
-
| `/reap.back` | 이전 stage로 회귀 (regression 사유 기록) |
|
|
55
|
-
| `/reap.status` | 프로젝트 상태, Generation 진행도, backlog, Genome 건강도 표시 |
|
|
56
|
-
| `/reap.sync` | 현재 소스코드와 Genome 간 차이를 분석하고 동기화 |
|
|
57
|
-
| `/reap.update` | REAP 최신 버전 확인 및 업그레이드 |
|
|
58
|
-
| `/reap.help` | 도움말. `/reap.help {topic}`으로 주제별 상세 설명 |
|
|
59
|
-
| | **Collaboration** |
|
|
60
|
-
| `/reap.pull {branch}` | fetch + divergence 감지 + merge generation 자동 실행 |
|
|
61
|
-
| `/reap.push` | REAP 상태 검증 + git push |
|
|
62
|
-
| `/reap.merge {branch}` | merge generation 전체 lifecycle 실행 |
|
|
63
|
-
| `/reap.merge.start` | merge generation 생성 + detect |
|
|
64
|
-
| `/reap.merge.evolve` | merge 6단계 자율 실행 |
|
|
65
|
-
|
|
66
|
-
💡 `/reap.help {topic}` — workflow, genome, backlog, strict, agents, hooks, config, evolve, regression, merge, pull, push, author ...
|
|
67
|
-
|
|
68
|
-
**Config**: Strict: {on/off} · Auto-Update: {on/off} · Language: {value}
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Topic Help
|
|
73
|
-
|
|
74
|
-
If ARGUMENTS contains a topic, look up from the list below. **If NOT in the list, respond: "Unknown topic: '{topic}'. `/reap.help`로 available topics를 확인하세요."**
|
|
75
|
-
|
|
76
|
-
For command-name topics: read `reap.{name}.md` from the same directory as this file, then explain.
|
|
77
|
-
|
|
78
|
-
#### Topics
|
|
79
|
-
|
|
80
|
-
- **workflow** / **lifecycle** — 5-stage lifecycle: objective → planning → implementation → validation → completion. Gate → Steps → Artifact. `/reap.next`로 전진, `/reap.back`으로 회귀.
|
|
81
|
-
- **genome** — `.reap/genome/`: principles.md, conventions.md, constraints.md, domain/*.md. 불변 원칙: 현재 세대에서 직접 수정 금지 → backlog → completion에서 반영.
|
|
82
|
-
- **backlog** — `.reap/life/backlog/`. genome-change, environment-change, task. status: pending/consumed. consumed → lineage, pending → 이월.
|
|
83
|
-
- **strict** — `strict: true`: no generation = 코드 수정 차단, non-implementation = 차단, implementation = plan scope만. Escape: "override"/"bypass strict".
|
|
84
|
-
- **agents** — AgentAdapter 추상화. auto-detect (Claude Code, OpenCode). config.yml `agents` 오버라이드.
|
|
85
|
-
- **hooks** — config.yml: onLifeStarted, onLifeTransited, onLifeCompleted, onLifeRegretted. command/prompt 타입.
|
|
86
|
-
- **config** — `.reap/config.yml`: version, project, entryMode, strict, language, agents, autoUpdate, hooks.
|
|
87
|
-
- **evolve** — `/reap.evolve`: 전체 lifecycle 자율 실행. 사람 확인 없이 objective~completion 순차 진행.
|
|
88
|
-
- **regression** — `/reap.back`: 이전 stage 회귀. timeline + artifact에 Regression 섹션 기록.
|
|
89
|
-
- **minor-fix** — 5분 이내, 설계 변경 없는 수정. stage 전환 없이 현재 artifact에 기록.
|
|
90
|
-
- **compression** — 10,000줄 + 5세대 이상 시 lineage 자동 압축. L1(40줄), L2(60줄).
|
|
91
|
-
- **merge** / **collaboration** — 분산 협업: genome-first merge 6단계 (detect→mate→merge→sync→validation→completion). `/reap.pull`로 fetch+merge, `/reap.push`로 검증+push. 상세: `domain/collaboration.md`, `domain/merge-lifecycle.md`.
|
|
92
|
-
- **author** — HyeonIL Choi. Email: hichoi@c-d.cc / Homepage: https://c-d.cc / LinkedIn: https://www.linkedin.com/in/hichoi-dev / GitHub: https://github.com/casamia918
|
|
93
|
-
- **start** / **objective** / **planning** / **implementation** / **validation** / **completion** / **next** / **back** / **sync** / **status** / **update** / **help** — Read `reap.{name}.md` from same directory, explain.
|
|
94
|
-
- **pull** / **push** / **merge.start** / **merge.detect** / **merge.mate** / **merge.merge** / **merge.sync** / **merge.validation** / **merge.completion** / **merge.evolve** — Read `reap.{name}.md` from same directory, explain.
|
|
5
|
+
Run `reap run help` and follow the stdout instructions exactly.
|
|
@@ -2,101 +2,4 @@
|
|
|
2
2
|
description: "REAP Implementation — Implement code through AI+Human collaboration"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<HARD-GATE>
|
|
8
|
-
Do NOT write code without the task list from 02-planning.md.
|
|
9
|
-
Do NOT write code that violates the Genome (conventions.md, constraints.md).
|
|
10
|
-
Do NOT modify the Genome directly — if you discover an issue, record it in the backlog.
|
|
11
|
-
Do NOT modify the Environment directly — if you discover a change, record it in the backlog.
|
|
12
|
-
</HARD-GATE>
|
|
13
|
-
|
|
14
|
-
## Gate (Preconditions)
|
|
15
|
-
- Read `.reap/life/current.yml` and verify that stage is `implementation`
|
|
16
|
-
- Verify that `.reap/life/02-planning.md` exists
|
|
17
|
-
- Check git working tree status (`git status`)
|
|
18
|
-
- If there are uncommitted changes that overlap with files this generation will modify:
|
|
19
|
-
- Ask the user: "There are uncommitted changes. Would you like to commit them before proceeding? (yes/no/show diff)"
|
|
20
|
-
- If yes: help the user commit the changes, then proceed
|
|
21
|
-
- If no: proceed with caution, noting the existing changes
|
|
22
|
-
- If show diff: show the diff, then ask again
|
|
23
|
-
- If there are uncommitted changes in unrelated files: proceed normally
|
|
24
|
-
- If the working tree is clean: proceed normally
|
|
25
|
-
- If not met: ERROR — state the reason and **STOP**
|
|
26
|
-
|
|
27
|
-
## Context (Generation Info)
|
|
28
|
-
- Read `.reap/life/current.yml` for the current generation info (id, goal, genomeVersion)
|
|
29
|
-
- Read `.reap/genome/conventions.md` — rules to reference continuously during implementation
|
|
30
|
-
- Read `.reap/genome/constraints.md` — technical constraints
|
|
31
|
-
|
|
32
|
-
## Re-entry Check
|
|
33
|
-
- If `.reap/life/03-implementation.md` already exists, this is a **re-entry due to regression**
|
|
34
|
-
- Read the existing log; if a `## Regression` section exists, understand the regression reason
|
|
35
|
-
- On regression re-entry, **append** to the existing log (preserve existing completion records)
|
|
36
|
-
|
|
37
|
-
## Steps
|
|
38
|
-
|
|
39
|
-
### 1. Load Task List
|
|
40
|
-
- Read the task list from `.reap/life/02-planning.md`
|
|
41
|
-
- If `03-implementation.md` already exists, read it (preserve existing records)
|
|
42
|
-
- Identify incomplete (`[ ]`) tasks
|
|
43
|
-
|
|
44
|
-
### 2. Sequential Implementation
|
|
45
|
-
- Implement starting from the first incomplete task, in order
|
|
46
|
-
- **After EACH task completion**, immediately add it to the Completed Tasks table in `03-implementation.md`
|
|
47
|
-
- **After EACH deferred task decision**, immediately add it to the Deferred Tasks table
|
|
48
|
-
- **After EACH genome issue discovery**, immediately add it to the Genome-Change Backlog Items table
|
|
49
|
-
- Do NOT batch-write the log at the end. Update it as you go.
|
|
50
|
-
- **Strictly** follow the rules in conventions.md
|
|
51
|
-
- **Strictly** follow the technical constraints in constraints.md
|
|
52
|
-
|
|
53
|
-
### 3. When Genome/Environment Changes Are Discovered
|
|
54
|
-
- If you discover something that must be implemented differently from the spec:
|
|
55
|
-
a. Record it in `.reap/life/backlog/`:
|
|
56
|
-
```markdown
|
|
57
|
-
---
|
|
58
|
-
type: genome-change
|
|
59
|
-
status: pending
|
|
60
|
-
target: genome/[relevant file]
|
|
61
|
-
---
|
|
62
|
-
# [Title]
|
|
63
|
-
[What is different and how it should be changed]
|
|
64
|
-
```
|
|
65
|
-
b. Mark tasks that depend on this change as `[deferred]` in `02-planning.md`
|
|
66
|
-
c. Record the reason for deferral
|
|
67
|
-
- **Do NOT modify Genome or Environment files directly. This is non-negotiable.**
|
|
68
|
-
|
|
69
|
-
### 3b. When Out-of-Scope Issues Are Discovered
|
|
70
|
-
- If you discover issues outside the current generation's scope (outdated tests, tech debt, broken code unrelated to current tasks, etc.):
|
|
71
|
-
a. Record it in `.reap/life/backlog/`:
|
|
72
|
-
```markdown
|
|
73
|
-
---
|
|
74
|
-
type: task
|
|
75
|
-
status: pending
|
|
76
|
-
---
|
|
77
|
-
# [Title]
|
|
78
|
-
[Description of the issue and what needs to be done]
|
|
79
|
-
```
|
|
80
|
-
b. Do NOT fix it in the current generation unless the human explicitly approves
|
|
81
|
-
c. Record it in `03-implementation.md` under "Genome-Change Backlog Items" or "Implementation Notes"
|
|
82
|
-
|
|
83
|
-
### 4. Completion Marking
|
|
84
|
-
- Mark completed tasks as `[x]` in `02-planning.md`
|
|
85
|
-
|
|
86
|
-
## Escalation
|
|
87
|
-
In the following situations, **STOP and ask the human**:
|
|
88
|
-
- When task requirements are unclear
|
|
89
|
-
- When an architectural decision is needed but not covered in the plan
|
|
90
|
-
- When a conflict arises with existing code
|
|
91
|
-
- When the scope turns out to be significantly larger than expected
|
|
92
|
-
|
|
93
|
-
## Artifact Generation (Progressive Recording)
|
|
94
|
-
- **Language**: Write all artifact content in the user's configured language (see REAP Guide § Language).
|
|
95
|
-
- **Immediately upon entering this stage**: Read `~/.reap/templates/03-implementation.md` and create `.reap/life/03-implementation.md` with empty tables ready to fill (or preserve existing content on re-entry)
|
|
96
|
-
- **Update continuously during Step 2**: After each task, deferral, or discovery, update the artifact immediately
|
|
97
|
-
- By the time all tasks are done, the artifact should already be complete — no separate "generation" step is needed
|
|
98
|
-
- Add Implementation Notes at the end summarizing notable decisions
|
|
99
|
-
|
|
100
|
-
## Completion
|
|
101
|
-
- "Proceed to the Validation stage with `/reap.next`."
|
|
102
|
-
- "If issues are found during Validation, you can return with `/reap.back`."
|
|
5
|
+
Run `reap run implementation` and follow the stdout instructions exactly.
|
|
@@ -1,20 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "REAP Merge Completion — Finalize the merge generation"
|
|
2
|
+
description: "REAP Merge Completion — Finalize the merge generation with archiving"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Finalize the merge generation after validation passes.
|
|
8
|
-
|
|
9
|
-
## Gate
|
|
10
|
-
- Verify current generation is type: merge and stage: completion
|
|
11
|
-
- Verify `05-validation.md` exists
|
|
12
|
-
|
|
13
|
-
## Steps
|
|
14
|
-
|
|
15
|
-
1. Commit the merged source + genome changes
|
|
16
|
-
2. Write `06-completion.md` with:
|
|
17
|
-
- Summary of what was merged
|
|
18
|
-
- Genome changes applied
|
|
19
|
-
- Lessons learned
|
|
20
|
-
3. Proceed with `/reap.next` to archive
|
|
5
|
+
Run `reap run merge-completion` and follow the stdout instructions exactly.
|
|
@@ -2,19 +2,4 @@
|
|
|
2
2
|
description: "REAP Merge Detect — Analyze divergence between branches"
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Analyze the divergence between the current branch and the target branch.
|
|
8
|
-
|
|
9
|
-
## Gate
|
|
10
|
-
- Verify current generation is type: merge and stage: detect
|
|
11
|
-
|
|
12
|
-
## Steps
|
|
13
|
-
|
|
14
|
-
1. Read `01-detect.md` (created by `reap merge` CLI)
|
|
15
|
-
2. Review the divergence report with the human:
|
|
16
|
-
- Common ancestor
|
|
17
|
-
- Genome changes on each side
|
|
18
|
-
- Conflicts (WRITE-WRITE, CROSS-FILE)
|
|
19
|
-
3. If the detect needs to be re-run, use `reap merge {branch}` again
|
|
20
|
-
4. When satisfied, proceed with `/reap.next`
|
|
5
|
+
Run `reap run merge-detect` and follow the stdout instructions exactly.
|