@c-d-cc/reap 0.1.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.
Files changed (32) hide show
  1. package/README.ko.md +309 -0
  2. package/README.md +308 -0
  3. package/dist/cli.js +9982 -0
  4. package/dist/templates/artifacts/01-objective.md +29 -0
  5. package/dist/templates/artifacts/02-planning.md +14 -0
  6. package/dist/templates/artifacts/03-implementation.md +19 -0
  7. package/dist/templates/artifacts/04-validation.md +20 -0
  8. package/dist/templates/artifacts/05-completion.md +47 -0
  9. package/dist/templates/commands/reap.back.md +54 -0
  10. package/dist/templates/commands/reap.completion.md +96 -0
  11. package/dist/templates/commands/reap.evolve.md +48 -0
  12. package/dist/templates/commands/reap.help.md +61 -0
  13. package/dist/templates/commands/reap.implementation.md +102 -0
  14. package/dist/templates/commands/reap.next.md +53 -0
  15. package/dist/templates/commands/reap.objective.md +171 -0
  16. package/dist/templates/commands/reap.planning.md +88 -0
  17. package/dist/templates/commands/reap.start.md +44 -0
  18. package/dist/templates/commands/reap.status.md +70 -0
  19. package/dist/templates/commands/reap.sync.md +95 -0
  20. package/dist/templates/commands/reap.validation.md +85 -0
  21. package/dist/templates/genome/constraints.md +38 -0
  22. package/dist/templates/genome/conventions.md +35 -0
  23. package/dist/templates/genome/domain/README.md +96 -0
  24. package/dist/templates/genome/principles.md +31 -0
  25. package/dist/templates/help/en.txt +32 -0
  26. package/dist/templates/help/ko.txt +32 -0
  27. package/dist/templates/hooks/reap-guide.md +188 -0
  28. package/dist/templates/hooks/session-start.sh +163 -0
  29. package/dist/templates/presets/bun-hono-react/constraints.md +28 -0
  30. package/dist/templates/presets/bun-hono-react/conventions.md +28 -0
  31. package/dist/templates/presets/bun-hono-react/principles.md +28 -0
  32. package/package.json +45 -0
@@ -0,0 +1,171 @@
1
+ ---
2
+ description: "REAP Objective — Define the goal and specification for this Generation"
3
+ ---
4
+
5
+ # Objective (Goal Definition)
6
+
7
+ <HARD-GATE>
8
+ Do NOT write any code until the artifact (01-objective.md) has been confirmed by the human.
9
+ If the goal is ambiguous, do NOT guess — STOP and ask the human. This is non-negotiable.
10
+ </HARD-GATE>
11
+
12
+ ## Gate (Preconditions)
13
+ - Read `.reap/life/current.yml` and verify that stage is `objective`
14
+ - If not met: ERROR — "Current stage is not objective. Start a new Generation with `/reap.start` or check the current state with `reap status`." then **STOP**
15
+
16
+ ## Context (Generation Info)
17
+ - Read `.reap/life/current.yml` for the current generation info (id, goal, genomeVersion)
18
+ - Reference this info in all subsequent artifacts and conversations
19
+
20
+ ## Re-entry Check
21
+ - If `.reap/life/01-objective.md` already exists, this is a **re-entry due to regression**
22
+ - Read the existing artifact; if a `## Regression` section exists, understand the regression reason
23
+ - Use the existing content as reference, but overwrite it with modifications that address the regression reason
24
+
25
+ ## Steps
26
+
27
+ ### 1. Environment Scan
28
+ - Read all files in `.reap/environment/`
29
+ - This directory stores external context: external API docs, product requirements, team decision logs, reference materials, etc.
30
+ - **If empty (first time setup)**, conduct an interactive Environment setup:
31
+ 1. **Brief the human on what Environment means**:
32
+ > "Environment is where we record information **external to this project** — things that affect development but are outside the project's direct control.
33
+ > Unlike the Genome (design and knowledge the team decides), Environment captures the **constraints and context from the outside world**:
34
+ > connected systems, infrastructure, organizational rules, external API specs, etc."
35
+ 2. **Ask questions interactively** (one at a time, skip if not applicable):
36
+ - "Are there any **connected systems**? (other services, external APIs, legacy systems, etc.)"
37
+ - "What is the **infrastructure/deployment environment**? (cloud, on-premise, containers, etc.)"
38
+ - "Are there **organizational rules or guidelines** to follow? (company standards, coding policies, security policies, regulatory compliance, etc.)"
39
+ - "Are there **external reference documents** to incorporate? (API specs, system architecture diagrams, integration guides, etc.)"
40
+ 3. **Save collected information** to `.reap/environment/` as structured markdown files (e.g., `integrations.md`, `infrastructure.md`, `org-guidelines.md`)
41
+ 4. If the human has nothing to add, that's fine — Environment is optional
42
+ - If files already exist, review them and ask if any updates are needed
43
+
44
+ ### 2. Previous Generation Reference
45
+ - If a `05-completion.md` exists for the most recent generation in `.reap/lineage/`, read it
46
+ - Reference lessons learned and next-generation suggestions from the previous generation
47
+
48
+ ### 3. Backlog Review
49
+ - Read all files in `.reap/life/backlog/`
50
+ - Review deferred tasks and planned goals
51
+
52
+ ### 4. Genome Health Check
53
+ - Read all files in `.reap/genome/` (principles.md, conventions.md, constraints.md, domain/)
54
+ - Read `.reap/config.yml` to determine the `entryMode` (greenfield, migration, adoption)
55
+
56
+ - **If this is the first generation** (`.reap/lineage/` is empty):
57
+ - This is the sole exception to the Genome immutability principle: **direct genome authoring is permitted only during the first generation's Objective**
58
+ - **Brief the human on what Genome means**:
59
+ > "Genome is where we record this project's **design and knowledge** — things the team decides and controls internally.
60
+ > Architecture principles, business rules, development conventions, and technical constraints.
61
+ > It's the project's DNA that evolves across generations."
62
+
63
+ - **If entryMode is `greenfield`** (new project):
64
+ 1. Ask about the application first:
65
+ - "What application do you want to build? Give me a brief introduction."
66
+ - "Who are the primary users? What problem does it solve?"
67
+ 2. Based on the app description, **recommend a tech stack**:
68
+ - Propose 2-3 options with pros/cons based on the app type (web, API, CLI, mobile, etc.)
69
+ - If the human already has a preferred stack, respect that
70
+ 3. After stack is decided, ask additional questions:
71
+ - "Any architecture principles or design decisions already in mind?"
72
+ - "Any development conventions? (coding style, branch strategy, test policy, etc.)"
73
+ - "Any technical constraints? (performance requirements, compatibility, dependency restrictions, etc.)"
74
+ 4. Populate `principles.md`, `conventions.md`, `constraints.md` with collected information
75
+
76
+ - **If entryMode is `adoption`** (existing codebase):
77
+ 1. **Validate REAP root**:
78
+ - Check for project root signals (package.json, go.mod, .git, etc.)
79
+ - If parent directory has root signals, warn: "This may be a subdirectory. Is [parent] the actual project root?"
80
+ - If workspace config exists in parent (pnpm-workspace.yaml, lerna.json, etc.), ask: "Monorepo detected. Init for the whole repo or just this package?"
81
+ - If sibling directories contain other sub-projects, suggest: "Other sub-projects found at the same level. Consider init from the parent directory."
82
+ - Proceed after human confirmation (intentional subdirectory init is allowed)
83
+ 2. **Scan for existing documentation**:
84
+ - Search for README.md, CONTRIBUTING.md, ARCHITECTURE.md, docs/, CLAUDE.md, AGENTS.md, ADR directories
85
+ - Show discovered documents to the human and ask for each: "Is this still current?"
86
+ - Current → use as genome source
87
+ - Partially outdated → use as reference, prioritize code analysis
88
+ - No longer valid → skip
89
+ 3. **Analyze existing source code**:
90
+ - Infer tech stack from config files (package.json, tsconfig, Dockerfile, etc.)
91
+ - Infer architecture patterns from directory structure
92
+ - Extract conventions from linter/formatter configs
93
+ - Identify test strategy from test configs
94
+ 4. **Present combined analysis** (verified docs + code analysis) as genome draft:
95
+ - "Based on existing documents and source analysis, here's the proposed Genome. Please review."
96
+ - Human confirms/modifies each section
97
+ 5. Ask about anything not derivable from code or docs (business context, team decisions, etc.)
98
+ 6. Populate genome files with confirmed information
99
+
100
+ - **If entryMode is `migration`**: Follow the `adoption` flow for analysis of the existing system, but note that the new project may diverge in architecture
101
+
102
+ - **For subsequent generations**:
103
+ - Evaluate the health of each file:
104
+ - **Files with only placeholders** → flag as "genome needs enhancement"
105
+ - **Files exceeding 100 lines** → flag as "needs extraction to domain/"
106
+ - **domain/ has only README.md and no rule files** → flag as "domain rules undefined"
107
+ - **constraints.md has empty Validation Commands** → flag as "test commands undefined"
108
+ - Report the genome health status to the human
109
+
110
+ ### 5. Goal + Spec Definition
111
+ - Based on the above information, converse with the human to refine this generation's goal
112
+ - If genome enhancement is needed, discuss whether to include it in this generation's goal
113
+ - Criteria for a good goal:
114
+ - Achievable within a single Generation
115
+ - Verifiable completion criteria (no vague wording)
116
+ - Relevant genome areas are clearly identified
117
+
118
+ ### 6. Genome Gap Analysis
119
+ - Identify information required to achieve the goal that is missing from the genome
120
+ - For each missing item, record it in `.reap/life/backlog/`:
121
+ ```markdown
122
+ ---
123
+ type: genome-change
124
+ status: pending
125
+ target: genome/domain/{topic}.md
126
+ ---
127
+ # [Title]
128
+ [Specifically what is lacking and how it should be changed]
129
+ ```
130
+
131
+ ### 7. Requirements Finalization
132
+ - Organize functional requirements (FR) and non-functional requirements
133
+ - Define acceptance criteria
134
+ - **Limit**: Maximum 10 functional requirements. If exceeding 10, split into separate generations.
135
+ - **Limit**: Maximum 7 completion criteria. Each must be verifiable.
136
+ - Finalize with the human
137
+
138
+ ## Escalation
139
+ In the following situations, do NOT guess — **STOP and ask the human**:
140
+ - When the scope of the goal is unclear
141
+ - When two or more reasonable interpretations are possible
142
+ - When contradictory information exists in the genome
143
+
144
+ ## Self-Verification
145
+ Before saving the artifact, verify:
146
+ - [ ] Is the goal clearly stated in a single sentence?
147
+ - [ ] Are all completion criteria verifiable? (No vague wording like "improve" or "make better"?)
148
+ - [ ] Are exclusions explicitly stated in the scope?
149
+ - [ ] Do functional requirements have FR-XXX numbering?
150
+
151
+ ❌ Bad completion criterion: "Stabilize the service"
152
+ ✅ Good completion criterion: "`npm run lint` reports 0 errors, `npm run build` succeeds"
153
+
154
+ ## Artifact Generation (Progressive Recording)
155
+ - **Language**: Write all artifact content in the user's configured language (see REAP Guide § Language).
156
+ - **Immediately upon entering this stage**: Read `~/.reap/templates/01-objective.md` and create `.reap/life/01-objective.md` with the Goal section filled in (from `current.yml` goal)
157
+ - **Update incrementally**: As each step progresses, update the artifact in place:
158
+ - After Environment Scan → update Background section
159
+ - After Previous Generation Reference → update Background section
160
+ - After Backlog Review → update Background section
161
+ - After Genome Health Check → update Genome Reference section
162
+ - After Goal + Spec Definition → update Goal, Scope sections
163
+ - After Genome Gap Analysis → update Backlog section
164
+ - After Requirements Finalization → update Requirements, Completion Criteria sections
165
+ - The artifact should reflect the **current state of work at all times**
166
+ - Do NOT wait until the end to write the artifact
167
+
168
+ ## Completion
169
+ - **If called from `/reap.evolve`** (Autonomous Override active): Save the artifact and proceed automatically. Do NOT pause for human confirmation.
170
+ - **If called standalone**: Show the artifact to the human and get confirmation.
171
+ - After confirmation or auto-proceed: "Proceed to the Planning stage with `/reap.next`."
@@ -0,0 +1,88 @@
1
+ ---
2
+ description: "REAP Planning — Develop the implementation plan and decompose tasks"
3
+ ---
4
+
5
+ # Planning (Plan Development)
6
+
7
+ <HARD-GATE>
8
+ Do NOT create a plan without reading 01-objective.md.
9
+ Do NOT make technical decisions without reading the Genome (conventions.md, constraints.md).
10
+ </HARD-GATE>
11
+
12
+ ## Gate (Preconditions)
13
+ - Read `.reap/life/current.yml` and verify that stage is `planning`
14
+ - Verify that `.reap/life/01-objective.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
+ ## Re-entry Check
21
+ - If `.reap/life/02-planning.md` already exists, this is a **re-entry due to regression**
22
+ - Read the existing artifact; if a `## Regression` section exists, understand the regression reason
23
+ - Use the existing content as reference, but overwrite it with modifications that address the regression reason
24
+ - If `03-implementation.md` already exists, also reference implementation progress (decide whether to keep completed tasks)
25
+
26
+ ## Steps
27
+
28
+ ### 1. Read Objective
29
+ - Read requirements and acceptance criteria from `.reap/life/01-objective.md`
30
+ - Determine how to implement each FR
31
+
32
+ ### 2. Genome Reference
33
+ - Check technical constraints and Validation Commands in `.reap/genome/constraints.md`
34
+ - Check development rules and Enforced Rules in `.reap/genome/conventions.md`
35
+ - Check Core Beliefs and Architecture Decisions in `.reap/genome/principles.md`
36
+
37
+ ### 3. Develop Implementation Plan
38
+ - Decide on the architectural approach and technology choices
39
+ - Respect the Tech Stack in constraints.md
40
+ - **If there is an uncertain technical decision, STOP and ask the human**
41
+
42
+ ### 4. Task Decomposition
43
+ - Write tasks as a checklist in the format `- [ ] T001 description`
44
+ - **Limit**: Maximum 20 tasks. If exceeding 20, split into Phases.
45
+ - Each task must be **one logical unit of change**
46
+ - Specify dependencies and parallelization potential between tasks
47
+
48
+ ### 5. Human Confirmation
49
+ - Finalize the plan with the human
50
+
51
+ ## Task Format
52
+
53
+ ```
54
+ ### Phase 1: [Phase Name]
55
+ - [ ] T001 [Specific action] — [target file/module]
56
+ - [ ] T002 [P] [Specific action] — [target file/module]
57
+
58
+ ### Phase 2: [Phase Name]
59
+ - [ ] T003 [Specific action] — [target file/module]
60
+ ```
61
+
62
+ - `[P]`: Indicates parallelizable execution
63
+ - Specify the target file/module for each task
64
+
65
+ ❌ Bad task: "- [ ] T001 Implement authentication"
66
+ ✅ Good task: "- [ ] T001 `src/lib/auth.ts` — Configure NextAuth Google OAuth + define authOptions"
67
+
68
+ ## Self-Verification
69
+ Before saving the artifact, verify:
70
+ - [ ] Does every FR have a corresponding task?
71
+ - [ ] Are dependencies between tasks specified?
72
+ - [ ] Is the target file/module specified for each task?
73
+ - [ ] Is the Phase classification logical?
74
+
75
+ ## Artifact Generation (Progressive Recording)
76
+ - **Language**: Write all artifact content in the user's configured language (see REAP Guide § Language).
77
+ - **Immediately upon entering this stage**: Read `~/.reap/templates/02-planning.md` and create `.reap/life/02-planning.md` with the Summary section filled in
78
+ - **Update incrementally**: As each step progresses, update the artifact in place:
79
+ - After Genome Reference → update Technical Context section
80
+ - After Develop Implementation Plan → update Summary with architecture decisions
81
+ - After Task Decomposition → add tasks to the Tasks section as they are decomposed
82
+ - The artifact is a **living document** during the stage — it should reflect the current state of work at all times
83
+ - Do NOT wait until the end to write the artifact
84
+
85
+ ## Completion
86
+ - **If called from `/reap.evolve`** (Autonomous Override active): Save the artifact and proceed automatically. Do NOT pause for human confirmation.
87
+ - **If called standalone**: Show the artifact to the human and get confirmation.
88
+ - After confirmation or auto-proceed: "Proceed to the Implementation stage with `/reap.next`."
@@ -0,0 +1,44 @@
1
+ ---
2
+ description: "REAP Start — Start a new Generation"
3
+ ---
4
+
5
+ # Start a New Generation
6
+
7
+ ## Gate (Preconditions)
8
+ - Read `.reap/life/current.yml`
9
+ - If an active Generation exists: ERROR — "Generation [id] is in progress (stage: [stage]). Complete it before starting a new generation." **STOP**
10
+
11
+ ## Steps
12
+
13
+ ### 0. Backlog Scan
14
+ - Read all files in `.reap/life/backlog/`
15
+ - If backlog items exist:
16
+ - Present the list with title and priority for each item
17
+ - Ask: "Would you like to select one of these, or enter a new goal?"
18
+ - If the human selects a backlog item: use its title/content as the goal, then update the selected item's frontmatter to `status: consumed` and add `consumedBy: gen-XXX`
19
+ - If the human wants a new goal: proceed to Step 1
20
+ - If no backlog items exist: proceed to Step 1
21
+
22
+ 1. Ask the human for the goal of this generation
23
+ 2. Count existing generations in `.reap/lineage/` to determine the genomeVersion
24
+ 3. Generate the next generation ID (existing count + 1, in `gen-XXX` format)
25
+ 4. Write the following to `current.yml`:
26
+ ```yaml
27
+ id: gen-XXX
28
+ goal: [goal provided by the human]
29
+ stage: objective
30
+ genomeVersion: [generation count + 1]
31
+ startedAt: [current ISO 8601 timestamp]
32
+ timeline:
33
+ - stage: objective
34
+ at: [current ISO 8601 timestamp]
35
+ ```
36
+ 5. Immediately create `.reap/life/01-objective.md` from the artifact template with the Goal section filled in
37
+
38
+ ### Hook Execution
39
+ 6. Read `.reap/config.yml` — if `hooks.onGenerationStart` is defined, execute each hook in order:
40
+ - If hook has `command`: run the shell command
41
+ - If hook has `prompt`: follow the prompt instructions (AI agent executes the described task)
42
+
43
+ ## Completion
44
+ - "Generation gen-XXX started. Proceed with `/reap.objective` to define the goal, or `/reap.evolve` to run the full lifecycle."
@@ -0,0 +1,70 @@
1
+ ---
2
+ description: "REAP Status — Show current generation state and project health"
3
+ ---
4
+
5
+ # Status
6
+
7
+ Display a comprehensive overview of the current REAP project state.
8
+
9
+ ## Steps
10
+
11
+ ### 1. Project Info
12
+ - Read `.reap/config.yml` for project name, entryMode, preset, hooks
13
+ - Count completed generations in `.reap/lineage/`
14
+
15
+ ### 2. Current Generation
16
+ - Read `.reap/life/current.yml`
17
+ - If no active generation: report "No active Generation" and skip to Step 5
18
+ - Display: Generation ID, goal, current stage, genomeVersion, startedAt
19
+
20
+ ### 3. Stage Progress
21
+ - Read the current stage's artifact file (`.reap/life/0X-*.md`)
22
+ - Summarize what has been done so far in this stage (completed tasks, decisions made, etc.)
23
+ - If the artifact doesn't exist yet, report "Stage not started"
24
+
25
+ ### 4. Timeline & Notable Events
26
+ - Display the full timeline from `current.yml`:
27
+ - Stage transitions with timestamps
28
+ - Regressions (from, reason, refs)
29
+ - Flag notable events:
30
+ - Any regressions in this generation
31
+ - Deferred tasks (from `03-implementation.md` if exists)
32
+ - Genome-change backlog items pending
33
+
34
+ ### 5. Backlog Summary
35
+ - Read all files in `.reap/life/backlog/`
36
+ - Count by type: `genome-change`, `environment-change`, `task`
37
+ - List titles briefly
38
+
39
+ ### 6. Genome Health
40
+ - Quick check of `.reap/genome/` files:
41
+ - Any files that are still placeholder-only?
42
+ - Any files exceeding 100 lines?
43
+ - Is `domain/` empty (no rule files)?
44
+
45
+ ## Output Format
46
+ Present as a structured summary the human can quickly scan:
47
+
48
+ ```
49
+ 📊 REAP Status
50
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
+ Project: [name] ([entryMode])
52
+ Genome Version: v[N]
53
+ Completed Generations: [count]
54
+
55
+ 🔄 Active Generation: [id]
56
+ Goal: [goal]
57
+ Stage: [stage]
58
+ Started: [date]
59
+
60
+ 📋 Stage Progress:
61
+ [summary of current artifact]
62
+
63
+ 📅 Timeline:
64
+ [stage transitions]
65
+
66
+ 📦 Backlog: [N] items
67
+ genome-change: [n] environment-change: [n] task: [n]
68
+
69
+ 🧬 Genome Health: [status]
70
+ ```
@@ -0,0 +1,95 @@
1
+ ---
2
+ description: "REAP Sync — Synchronize Genome with current source code"
3
+ ---
4
+
5
+ # Sync (Genome Synchronization)
6
+
7
+ Analyze the current source code and update the Genome to reflect reality.
8
+
9
+ <HARD-GATE>
10
+ If an active Generation exists (`.reap/life/current.yml` has content), do NOT modify Genome directly.
11
+ Instead, record discovered differences as `type: genome-change` items in `.reap/life/backlog/` and inform the human.
12
+ Only proceed with direct Genome modification when NO active Generation exists.
13
+ </HARD-GATE>
14
+
15
+ ## Gate (Preconditions)
16
+ - Read `.reap/life/current.yml`
17
+ - If active Generation exists: switch to **Backlog Mode** (record differences, do not modify Genome)
18
+ - If no active Generation: proceed with **Sync Mode** (modify Genome directly after human confirmation)
19
+
20
+ ## Steps
21
+
22
+ ### 1. Read Current Genome
23
+ - Read all files in `.reap/genome/` (principles.md, conventions.md, constraints.md, domain/)
24
+ - Note current genomeVersion from the most recent generation in `.reap/lineage/`
25
+
26
+ ### 2. Analyze Source Code
27
+ Scan the project to understand its current state:
28
+
29
+ **Tech Stack & Dependencies**:
30
+ - package.json, tsconfig.json, Dockerfile, docker-compose.yml, etc.
31
+ - New dependencies added, removed, or version-changed since Genome was last updated
32
+
33
+ **Architecture & Structure**:
34
+ - Directory structure and patterns (layers, modules, services)
35
+ - Entry points, routing, API structure
36
+ - Database, ORM, migration setup
37
+
38
+ **Conventions**:
39
+ - Linter/formatter configs (.eslintrc, .prettierrc, biome.json, etc.)
40
+ - Test setup and patterns (test framework, file naming, coverage config)
41
+ - Git hooks, CI/CD config
42
+ - Code patterns observed in the source (naming, error handling, etc.)
43
+
44
+ **Constraints**:
45
+ - Build commands, test commands, validation commands
46
+ - Environment requirements, runtime constraints
47
+ - External service dependencies
48
+
49
+ ### 3. Diff Analysis
50
+ Compare source analysis with current Genome and identify:
51
+ - **Additions**: Things in code but not in Genome
52
+ - **Changes**: Things in Genome that no longer match code
53
+ - **Removals**: Things in Genome that no longer exist in code
54
+ - **Gaps**: Areas where Genome has placeholders but code has established patterns
55
+
56
+ ### 4. Report to Human
57
+ Present a structured diff report:
58
+
59
+ ```
60
+ 🔄 Genome Sync Report
61
+ ━━━━━━━━━━━━━━━━━━━━━
62
+
63
+ 📝 principles.md
64
+ + [New] API-first design pattern observed
65
+ ~ [Changed] Layer structure: added shared/ directory
66
+
67
+ 📝 conventions.md
68
+ + [New] Biome used for linting (replacing ESLint)
69
+ ~ [Changed] Test pattern: using vitest instead of jest
70
+
71
+ 📝 constraints.md
72
+ + [New] Validation command: bun test
73
+ ~ [Changed] Runtime: Node.js compatible (was Bun-only)
74
+
75
+ 📁 domain/
76
+ + [Suggest] Create lifecycle-rules.md for REAP lifecycle logic
77
+ ```
78
+
79
+ ### 5. Apply Changes
80
+
81
+ **Sync Mode** (no active Generation):
82
+ - For each difference, ask the human: "Apply this change? (yes/no/modify)"
83
+ - Apply confirmed changes to the corresponding Genome files
84
+ - Follow Genome writing principles:
85
+ - Each file ≤ 100 lines
86
+ - If exceeding, extract to `domain/`
87
+ - Follow `~/.reap/templates/domain-guide.md` for domain files
88
+
89
+ **Backlog Mode** (active Generation):
90
+ - Record each difference as a `type: genome-change` backlog item in `.reap/life/backlog/`
91
+ - Inform: "Genome changes recorded in backlog. They will be applied at the Completion stage."
92
+
93
+ ## Completion
94
+ - **Sync Mode**: "Genome synchronized. [N] changes applied."
95
+ - **Backlog Mode**: "Genome differences recorded as [N] backlog items. Apply during Completion."
@@ -0,0 +1,85 @@
1
+ ---
2
+ description: "REAP Validation — Verify goal achievement through testing and validation"
3
+ ---
4
+
5
+ # Validation
6
+
7
+ <HARD-GATE>
8
+ Do NOT declare "pass" without running the validation commands.
9
+ Do NOT reuse results from a previous run — you MUST execute them fresh in this session.
10
+ "It will probably pass" or "It looks fine" is NOT validation.
11
+ Do NOT make claims without evidence. This is non-negotiable.
12
+ </HARD-GATE>
13
+
14
+ ## Gate (Preconditions)
15
+ - Read `.reap/life/current.yml` and verify that stage is `validation`
16
+ - Verify that `.reap/life/03-implementation.md` exists
17
+ - If not met: ERROR — state the reason and **STOP**
18
+
19
+ ## Context (Generation Info)
20
+ - Read `.reap/life/current.yml` for the current generation info (id, goal, genomeVersion)
21
+
22
+ ## Re-entry Check
23
+ - If `.reap/life/04-validation.md` already exists, this is a **re-entry due to regression**
24
+ - Reference the previous validation report, but overwrite it with a fresh one
25
+
26
+ ## Steps
27
+
28
+ ### 1. Run Automated Validation
29
+ - Read the **Validation Commands** table from `.reap/genome/constraints.md`
30
+ - Execute **all** defined commands **in order**:
31
+ - Test → Lint → Build → Type check
32
+ - Record the **actual output and exit code** of each command
33
+ - Skip items with no defined command, but record them as "undefined"
34
+
35
+ | Claim | Required Evidence | Insufficient Evidence |
36
+ |-------|------------------|-----------------------|
37
+ | "Tests pass" | Test command output: 0 failures | Previous run, "it should pass" |
38
+ | "Lint clean" | Lint output: 0 errors | Partial check, assumption |
39
+ | "Build succeeds" | Build command: exit 0 | "Lint passed so build should too" |
40
+
41
+ ### 2. Convention Compliance Check
42
+ - Read the **Enforced Rules** table from `.reap/genome/conventions.md`
43
+ - Execute the verification command for each defined rule
44
+ - Record any violations
45
+
46
+ ### 3. Completion Criteria Review
47
+ - Read the completion criteria from `.reap/life/01-objective.md`
48
+ - Check the deferred task list in `.reap/life/03-implementation.md`
49
+ - Review each completion criterion **one by one**, excluding deferred tasks from scope
50
+ - Determine pass/fail/deferred for each criterion
51
+
52
+ ### 4. Minor Fix (Fix Trivial Issues Directly)
53
+ - Fix typos, lint errors, minor bugs, and other **issues that can be resolved without a stage transition** directly
54
+ - Record all fixes in the "Minor Fixes" section of the artifact
55
+ - Minor fix criteria: **issues resolvable within 5 minutes without design changes**
56
+ - After minor fixes, **re-run** the relevant validation commands
57
+
58
+ ### 5. Verdict
59
+ - All automated validations pass + completion criteria met → **pass**
60
+ - Automated validations pass + some completion criteria deferred → **partial**
61
+ - Automated validation failure or completion criteria not met → **fail**
62
+ - If **fail**, provide regression guidance:
63
+ - Code issue → `/reap.back` (implementation)
64
+ - Plan issue → `/reap.back planning`
65
+ - Goal issue → `/reap.back objective`
66
+
67
+ ## Red Flags — STOP if you catch yourself thinking:
68
+ - "It will probably pass" → Run it.
69
+ - "It passed before" → Run it again.
70
+ - "It's trivial, it'll be fine" → Fix it as a minor fix and re-validate.
71
+ - "I haven't tried the build but lint passed" → Run the build too.
72
+
73
+ ## Artifact Generation (Progressive Recording)
74
+ - **Language**: Write all artifact content in the user's configured language (see REAP Guide § Language).
75
+ - **Immediately upon entering this stage**: Read `~/.reap/templates/04-validation.md` and create `.reap/life/04-validation.md` with `result: pending`
76
+ - **Update incrementally during validation**:
77
+ - After EACH validation command execution → immediately record the result in Test Results
78
+ - After EACH completion criterion check → immediately record pass/fail/deferred in the Completion Criteria Check table
79
+ - After EACH minor fix → immediately record it in the Minor Fixes table, then re-run and record
80
+ - After Step 5 (Verdict) → update the Result field to pass / partial / fail
81
+ - The artifact should reflect the current validation progress at all times
82
+
83
+ ## Completion
84
+ - pass/partial: "Proceed to the Completion stage with `/reap.next`."
85
+ - fail: Provide regression guidance
@@ -0,0 +1,38 @@
1
+ # Technical Constraints
2
+
3
+ > **Writing principle**: This file should be a **map** of ~100 lines or fewer.
4
+ > Record not only the "what" but also the "why" of each technical choice.
5
+ > Agents refer to this file when making technical decisions.
6
+ > Modified only during the Birth phase.
7
+
8
+ ## Tech Stack
9
+
10
+ Briefly record the rationale for each technology choice.
11
+
12
+ - **Language**: (language and version) — Rationale:
13
+ - **Framework**: (framework) — Rationale:
14
+ - **Database**: (database) — Rationale:
15
+ - **Runtime**: (runtime environment) — Rationale:
16
+
17
+ ## Constraints
18
+
19
+ Technical constraints that agents must follow during implementation.
20
+
21
+ - (Add technical constraints here)
22
+
23
+ ## Validation Commands
24
+
25
+ Project test/lint/build commands. Automatically executed during the Validation phase.
26
+
27
+ | Purpose | Command | Description |
28
+ |---------|---------|-------------|
29
+ | Test | | e.g., `npm test`, `bun test` |
30
+ | Lint | | e.g., `npm run lint` |
31
+ | Build | | e.g., `npm run build` |
32
+ | Type check | | e.g., `tsc --noEmit` |
33
+
34
+ ## External Dependencies
35
+
36
+ External services, APIs, etc. Specify external dependencies that agents cannot access.
37
+
38
+ - (External services, APIs, etc.)
@@ -0,0 +1,35 @@
1
+ # Development Conventions
2
+
3
+ > **Writing principle**: This file should be a **map** of ~100 lines or fewer.
4
+ > Write rules to be mechanically verifiable whenever possible.
5
+ > Instead of "write good code", describe it as "functions must not exceed 50 lines".
6
+ > Prioritize rules that can be enforced via linters/tests over documentation-only rules.
7
+ > Modified only during the Birth phase.
8
+
9
+ ## Code Style
10
+
11
+ Code style rules. Delegate to linter configuration for anything the linter can enforce;
12
+ record only rules that linters cannot catch here.
13
+
14
+ - (Add code style rules here)
15
+
16
+ ## Naming Conventions
17
+
18
+ Naming rules for filenames, variables, functions, classes, etc.
19
+
20
+ - (Add naming rules here)
21
+
22
+ ## Git Conventions
23
+
24
+ Commit messages, branching strategy, PR rules.
25
+
26
+ - (Add commit/branching rules here)
27
+
28
+ ## Enforced Rules
29
+
30
+ List of mechanically enforced rules. Specify which tool verifies each rule.
31
+ Automatically executed during the Validation phase.
32
+
33
+ | Rule | Verification Tool | Command |
34
+ |------|-------------------|---------|
35
+ | | | |