@neriros/ralphy 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.
- package/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/checklists/deploy.md +5 -0
- package/dist/checklists/static.md +6 -0
- package/dist/checklists/tests.md +5 -0
- package/dist/cli/index.js +53882 -0
- package/dist/mcp/index.js +24013 -0
- package/dist/phases/done.md +10 -0
- package/dist/phases/exec.md +140 -0
- package/dist/phases/plan.md +119 -0
- package/dist/phases/research.md +99 -0
- package/dist/phases/review.md +115 -0
- package/dist/scaffolds/MANUAL_TESTING.md +9 -0
- package/dist/scaffolds/PLAN.md +20 -0
- package/dist/scaffolds/PROGRESS.md +13 -0
- package/dist/scaffolds/STEERING.md +9 -0
- package/package.json +88 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: exec
|
|
3
|
+
order: 3
|
|
4
|
+
requires: [PLAN.md, PROGRESS.md]
|
|
5
|
+
next: review
|
|
6
|
+
autoAdvance: allChecked
|
|
7
|
+
loopBack: null
|
|
8
|
+
terminal: false
|
|
9
|
+
context:
|
|
10
|
+
- type: currentSection
|
|
11
|
+
label: "Current Section"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Task — Execution Phase
|
|
15
|
+
|
|
16
|
+
You implement one section of a task plan. The current section and verification checklists are injected at the bottom of this prompt.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Orient
|
|
21
|
+
|
|
22
|
+
0a. Study `CLAUDE.md` for build commands, conventions, patterns, and gotchas. This is the operational source of truth.
|
|
23
|
+
0b. Read `TASK_DIR/state.json` for task context: current phase, iteration count, history of previous runs, and any metadata.
|
|
24
|
+
0c. Study existing source code using parallel subagents. **Read at least 2 existing files in the same area** you will be working in to understand the exact patterns before writing new code.
|
|
25
|
+
0d. Never assume something is missing without searching first — use grep/glob to confirm before listing gaps.
|
|
26
|
+
|
|
27
|
+
{{MCP_TOOLS}}
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Steps
|
|
32
|
+
|
|
33
|
+
### 1. Implement
|
|
34
|
+
|
|
35
|
+
Work through the items in the Current Section in order.
|
|
36
|
+
|
|
37
|
+
- **Read before writing** — study at least 2 existing files in the same area before modifying code
|
|
38
|
+
- **Check for existing code first** — before creating anything new, search the codebase for similar implementations, utilities, or patterns. Reuse and extend existing code rather than duplicating. If a helper, type, or component already exists that does 80% of what you need, build on it.
|
|
39
|
+
- **Follow existing patterns** — match the style, naming, and structure of surrounding code
|
|
40
|
+
- **Keep it minimal** — implement exactly what the item specifies, no more
|
|
41
|
+
- **Type safety first** — follow the project's TypeScript strictness conventions. Favor Zod schemas for runtime validation at system boundaries (API inputs, external data, config). Define the Zod schema first, then derive the TypeScript type from it with `z.infer<>` rather than maintaining both separately.
|
|
42
|
+
- **Size limits** — respect file and function size limits from `CLAUDE.md`
|
|
43
|
+
|
|
44
|
+
### 2. Verify
|
|
45
|
+
|
|
46
|
+
Follow every injected checklist below in order. Fix all issues before proceeding.
|
|
47
|
+
|
|
48
|
+
**CRITICAL: ALWAYS use Nx affected, NEVER run-many**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# CORRECT - Run all relevant tasks together with affected
|
|
52
|
+
nx affected -t test,lint,typecheck
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**NEVER DO THIS:**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# WRONG - Runs ALL tests (100x slower, crushes CPU)
|
|
59
|
+
nx run-many -t test
|
|
60
|
+
|
|
61
|
+
# WRONG - Multiple independent commands (spawns uncontrolled processes)
|
|
62
|
+
nx run lib1:test & nx run lib2:test
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Rules:**
|
|
66
|
+
|
|
67
|
+
- **ALWAYS** use `affected` - it only validates your uncommitted changes
|
|
68
|
+
- **NEVER** use `run-many` - it runs on the entire monorepo
|
|
69
|
+
- **NEVER** run multiple independent Nx commands in parallel
|
|
70
|
+
- Keep Nx daemon running (never use `NX_DAEMON=false`)
|
|
71
|
+
- If tests fail, fix them and re-run `nx affected` (still fast)
|
|
72
|
+
|
|
73
|
+
### 3. Update PROGRESS.md
|
|
74
|
+
|
|
75
|
+
- Check off (`[x]`) every completed item in the section
|
|
76
|
+
- If you discovered new issues or subtasks, add them as `- [ ]` entries in the appropriate section (or create a new section)
|
|
77
|
+
|
|
78
|
+
### 4. Review
|
|
79
|
+
|
|
80
|
+
Before committing, review all changes made in this section:
|
|
81
|
+
|
|
82
|
+
- **Code review**: Check for typos, logic errors, missing edge cases, and adherence to patterns
|
|
83
|
+
- **Test coverage**: Verify all new code paths are covered by tests
|
|
84
|
+
- **Type safety**: Run typecheck to catch any type errors
|
|
85
|
+
- **Lint & format**: Ensure all files pass linting
|
|
86
|
+
- **Integration**: Check that changes work correctly with existing code
|
|
87
|
+
|
|
88
|
+
**If issues are found:**
|
|
89
|
+
|
|
90
|
+
- Document them in PROGRESS.md with a note (e.g., `- [x] Item name — Issue: [description]`)
|
|
91
|
+
- Fix each issue directly in the code
|
|
92
|
+
- Re-run verification commands (`nx affected -t test,lint,typecheck`)
|
|
93
|
+
- Loop back to step 2 (Verify) until all issues are resolved
|
|
94
|
+
|
|
95
|
+
**If no issues are found:**
|
|
96
|
+
|
|
97
|
+
- Proceed to step 5 (Commit & push)
|
|
98
|
+
|
|
99
|
+
### 5. Commit, push, and advance if done
|
|
100
|
+
|
|
101
|
+
- `git add` the specific files you changed (not `git add -A`)
|
|
102
|
+
- `git commit` with a descriptive message summarizing the section's work
|
|
103
|
+
- `git push`
|
|
104
|
+
- Check PROGRESS.md for remaining unchecked items. If **all items across all sections** are now checked, advance to done. Use `ralph_advance_phase` MCP tool if available, otherwise fall back to:
|
|
105
|
+
```
|
|
106
|
+
./loop.sh advance --name "{{TASK_NAME}}"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Remediation
|
|
112
|
+
|
|
113
|
+
When items are bugs or fixes discovered during review/testing:
|
|
114
|
+
|
|
115
|
+
- Group related failures by root cause
|
|
116
|
+
- Fix the underlying issue, not just the symptom
|
|
117
|
+
- Add regression tests for each fix
|
|
118
|
+
- Verify the fix doesn't introduce new issues
|
|
119
|
+
- If a fix reveals additional problems, add them to PROGRESS.md
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Termination Signal
|
|
124
|
+
|
|
125
|
+
If you hit an unresolvable blocker (e.g., missing credentials, broken dependency, architectural question that needs human input), write a file `TASK_DIR/STOP` containing a one-line reason. The loop will halt after this iteration.
|
|
126
|
+
|
|
127
|
+
Example: `echo "Blocked: need API key for X service" > TASK_DIR/STOP`
|
|
128
|
+
|
|
129
|
+
Only use this for genuine blockers. For item-level blocks, add a note in PROGRESS.md and continue with remaining items.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Rules
|
|
134
|
+
|
|
135
|
+
- **One section per iteration.** Complete all items in the section, then commit and push.
|
|
136
|
+
- **Never skip tests.** Tests are your backpressure mechanism.
|
|
137
|
+
- **Follow `CLAUDE.md` conventions exactly** — lint/typecheck must pass on the first try.
|
|
138
|
+
- If blocked on a specific item, add a note under it in PROGRESS.md and continue with remaining items.
|
|
139
|
+
- Ultrathink when making architectural decisions.
|
|
140
|
+
- Keep `CLAUDE.md` current with learnings.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
order: 2
|
|
4
|
+
requires: [RESEARCH.md]
|
|
5
|
+
next: exec
|
|
6
|
+
autoAdvance: null
|
|
7
|
+
loopBack: null
|
|
8
|
+
terminal: false
|
|
9
|
+
context:
|
|
10
|
+
- type: file
|
|
11
|
+
file: RESEARCH.md
|
|
12
|
+
label: "Research Findings"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Task — Planning Phase
|
|
16
|
+
|
|
17
|
+
You have a RESEARCH.md with detailed codebase findings. Your job is to create an implementation plan and execution checklist.
|
|
18
|
+
|
|
19
|
+
**Input: `TASK_DIR/RESEARCH.md` (already exists)**
|
|
20
|
+
**Output: `TASK_DIR/PLAN.md` and `TASK_DIR/PROGRESS.md` (you create both)**
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Orient
|
|
25
|
+
|
|
26
|
+
0a. Study `CLAUDE.md` for build commands, conventions, patterns, and gotchas. This is the operational source of truth.
|
|
27
|
+
0b. Read `TASK_DIR/state.json` for task context: current phase, iteration count, history of previous runs, and any metadata.
|
|
28
|
+
0c. Read `TASK_DIR/RESEARCH.md` thoroughly — it contains the codebase analysis, file details, callsites, and dependency graph.
|
|
29
|
+
0d. You may do additional targeted searches if the research missed something, but most exploration should already be done.
|
|
30
|
+
0e. If PLAN.md and PROGRESS.md already exist, you are refining them — review, identify issues, improve.
|
|
31
|
+
0f. Phase iteration: {{PHASE_ITERATION}}. After committing, advance to execution (use `ralph_advance_phase` MCP tool if available, otherwise `./loop.sh advance`).
|
|
32
|
+
|
|
33
|
+
{{MCP_TOOLS}}
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Steps
|
|
38
|
+
|
|
39
|
+
### 1. Read the research
|
|
40
|
+
|
|
41
|
+
Read `TASK_DIR/RESEARCH.md` end to end. Absorb:
|
|
42
|
+
|
|
43
|
+
- Current state of every file that will be modified
|
|
44
|
+
- All callsites and consumers that need updating
|
|
45
|
+
- Existing code to reuse
|
|
46
|
+
- Discovered issues and edge cases
|
|
47
|
+
- Dependency graph and ordering constraints
|
|
48
|
+
|
|
49
|
+
### 2. Gap analysis
|
|
50
|
+
|
|
51
|
+
Compare the research findings against what the task requires. For each gap, note:
|
|
52
|
+
|
|
53
|
+
- What exists (if partial)
|
|
54
|
+
- What's missing
|
|
55
|
+
- Dependencies on other items
|
|
56
|
+
- Priority (critical path items first)
|
|
57
|
+
|
|
58
|
+
### 3. Create PLAN.md
|
|
59
|
+
|
|
60
|
+
Write `TASK_DIR/PLAN.md` with:
|
|
61
|
+
|
|
62
|
+
- A brief summary of the task and approach
|
|
63
|
+
- Key architectural decisions and trade-offs
|
|
64
|
+
- Files that will be created or modified
|
|
65
|
+
- Risks or open questions
|
|
66
|
+
|
|
67
|
+
### 4. Create PROGRESS.md
|
|
68
|
+
|
|
69
|
+
Write `TASK_DIR/PROGRESS.md` as a detailed execution checklist. Structure:
|
|
70
|
+
|
|
71
|
+
- Each `## Section N — Title` = one iteration (one agent invocation)
|
|
72
|
+
- Items within a section should be completable together in one iteration
|
|
73
|
+
- Later sections can depend on earlier sections
|
|
74
|
+
- Items within a section should be as independent as possible
|
|
75
|
+
|
|
76
|
+
Rules:
|
|
77
|
+
|
|
78
|
+
- **Each item must be specific and implementable** — include file paths, function names, what changes
|
|
79
|
+
- **No vague items** like "improve performance" or "clean up code"
|
|
80
|
+
- **Include test items** alongside implementation items (not in a separate section)
|
|
81
|
+
- **Include a final section** for integration testing, verification, and cleanup
|
|
82
|
+
- **Order by dependency** — critical-path items first within each section
|
|
83
|
+
- **Keep sections reasonably sized** — 3-8 items per section is ideal
|
|
84
|
+
|
|
85
|
+
### 5. Append verification checklists
|
|
86
|
+
|
|
87
|
+
Use `ralph_list_checklists` to see available verification checklists, then `ralph_apply_checklist` to append the relevant ones as final sections of PROGRESS.md before advancing to exec. Checklists are auto-appended during phase transition as a fallback, but explicitly choosing which ones to include is preferred.
|
|
88
|
+
|
|
89
|
+
### 6. Commit and advance
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
git add TASK_DIR/PLAN.md TASK_DIR/PROGRESS.md
|
|
93
|
+
git commit -m "plan: <task-name>"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then advance to the execution phase so the next iteration starts correctly. Use `ralph_advance_phase` MCP tool if available, otherwise fall back to:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
./loop.sh advance --name "{{TASK_NAME}}"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Stop after advancing. Do not implement anything.**
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Termination Signal
|
|
107
|
+
|
|
108
|
+
If you cannot proceed (e.g., research is insufficient, critical information is missing, or a dependency is unresolvable), write a file `TASK_DIR/STOP` containing a one-line reason. The loop will halt after this iteration.
|
|
109
|
+
|
|
110
|
+
Only use this for genuine blockers — not for normal completion (the loop handles that automatically).
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Rules
|
|
115
|
+
|
|
116
|
+
- **PLAN ONLY. Do NOT implement anything. Do NOT write application code.**
|
|
117
|
+
- Base your plan on the research findings — don't re-explore what's already documented.
|
|
118
|
+
- Ultrathink when analyzing architecture and priorities.
|
|
119
|
+
- Keep each checklist item a single implementable unit of work.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research
|
|
3
|
+
order: 1
|
|
4
|
+
requires: []
|
|
5
|
+
next: plan
|
|
6
|
+
autoAdvance: null
|
|
7
|
+
loopBack: null
|
|
8
|
+
terminal: false
|
|
9
|
+
context: []
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Task — Research Phase
|
|
13
|
+
|
|
14
|
+
You are starting a new task. Your job is to deeply research the codebase to understand the current state, then produce a RESEARCH.md documenting your findings.
|
|
15
|
+
|
|
16
|
+
**Input: Task description (injected below)**
|
|
17
|
+
**Output: `TASK_DIR/RESEARCH.md` (you create this)**
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Orient
|
|
22
|
+
|
|
23
|
+
0a. Study `CLAUDE.md` for build commands, conventions, patterns, and gotchas. This is the operational source of truth.
|
|
24
|
+
0b. Read `TASK_DIR/state.json` for task context: current phase, iteration count, history of previous runs, and any metadata.
|
|
25
|
+
0c. Never assume something is missing without searching first — use grep/glob to confirm.
|
|
26
|
+
|
|
27
|
+
{{MCP_TOOLS}}
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Steps
|
|
32
|
+
|
|
33
|
+
### 1. Understand the task
|
|
34
|
+
|
|
35
|
+
Read the task description below. Identify:
|
|
36
|
+
|
|
37
|
+
- What needs to change or be created
|
|
38
|
+
- What existing code is likely affected
|
|
39
|
+
- What areas of the codebase to investigate
|
|
40
|
+
|
|
41
|
+
### 2. Deep research
|
|
42
|
+
|
|
43
|
+
**Write RESEARCH.md incrementally as you go.** Do not wait until the end — create the file early and append findings after each area of investigation. This ensures nothing is lost if the session is interrupted.
|
|
44
|
+
|
|
45
|
+
Use parallel subagents to investigate the codebase. For each area the task touches:
|
|
46
|
+
|
|
47
|
+
- **Read the actual files** that will be modified — understand their current structure, imports, exports, and patterns
|
|
48
|
+
- **Search for all callsites** of code that will change — find every consumer that needs updating
|
|
49
|
+
- **Check for edge cases** — related tests, config files, CI/CD, build scripts
|
|
50
|
+
- **Find existing implementations** — code that already does something similar that can be reused or extended
|
|
51
|
+
- **Find existing types, Zod schemas, and utilities** that overlap with the task requirements
|
|
52
|
+
- **Identify ordering constraints** — what must happen before what? What can be parallelized?
|
|
53
|
+
|
|
54
|
+
After each batch of investigation, immediately write or append your findings to `TASK_DIR/RESEARCH.md`.
|
|
55
|
+
|
|
56
|
+
### 3. Finalize RESEARCH.md
|
|
57
|
+
|
|
58
|
+
Review `TASK_DIR/RESEARCH.md` for completeness. Ensure it covers:
|
|
59
|
+
|
|
60
|
+
- **For each file to be modified**: current state, relevant imports/exports, callsites, what needs to change
|
|
61
|
+
- **For each new file**: patterns to follow (based on similar existing files), dependencies it needs
|
|
62
|
+
- **Existing code to reuse**: types, utilities, patterns that already exist and should be leveraged
|
|
63
|
+
- **Discovered issues**: extra files, hidden callsites, ordering constraints, edge cases
|
|
64
|
+
- **Dependency graph**: what must happen before what, what can be parallelized
|
|
65
|
+
|
|
66
|
+
Keep it factual and reference-heavy — file paths, line numbers, function names. This document is the foundation for the plan and execution checklist.
|
|
67
|
+
|
|
68
|
+
### 4. Commit and advance
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
git add TASK_DIR/RESEARCH.md
|
|
72
|
+
git commit -m "research: <task-name>"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then advance to the planning phase so the next iteration starts correctly. Use `ralph_advance_phase` MCP tool if available, otherwise fall back to:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
./loop.sh advance --name "{{TASK_NAME}}"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Stop after advancing. Do not create PLAN.md or PROGRESS.md — that happens in the next phase. Do not implement anything.**
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Termination Signal
|
|
86
|
+
|
|
87
|
+
If you hit a blocker (task description is ambiguous, critical information is missing), write `TASK_DIR/STOP` with a one-line reason.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Rules
|
|
92
|
+
|
|
93
|
+
- **RESEARCH ONLY. Do NOT implement anything. Do NOT write application code. Do NOT create PLAN.md or PROGRESS.md.**
|
|
94
|
+
- If RESEARCH.md already exists, you are refining it — read it first, identify gaps, then enhance.
|
|
95
|
+
- Phase iteration: {{PHASE_ITERATION}}. After committing, advance to planning (use `ralph_advance_phase` MCP tool if available, otherwise `./loop.sh advance`).
|
|
96
|
+
- Read actual files — don't guess at what's in them.
|
|
97
|
+
- Use parallel subagents aggressively to explore the codebase.
|
|
98
|
+
- The quality of the plan depends entirely on the quality of this research. Be thorough.
|
|
99
|
+
- Ultrathink when analyzing the codebase.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
order: 4
|
|
4
|
+
requires: []
|
|
5
|
+
next: exec
|
|
6
|
+
autoAdvance: allChecked
|
|
7
|
+
loopBack: exec
|
|
8
|
+
terminal: false
|
|
9
|
+
context:
|
|
10
|
+
- type: currentSection
|
|
11
|
+
label: "Current Section (to review)"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Task — Review Phase
|
|
15
|
+
|
|
16
|
+
You review the work completed in the current execution section and identify any issues that need to be fixed.
|
|
17
|
+
|
|
18
|
+
**Input: `TASK_DIR/PROGRESS.md` (current section with completed items)**
|
|
19
|
+
**Output: Issues documented in PROGRESS.md or approval to advance**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Orient
|
|
24
|
+
|
|
25
|
+
0a. Study `CLAUDE.md` for build commands, conventions, patterns, and gotchas.
|
|
26
|
+
0b. Read `TASK_DIR/state.json` for task context and previous execution results.
|
|
27
|
+
0c. Read the current section from `TASK_DIR/PROGRESS.md` — these are the items just implemented.
|
|
28
|
+
0d. Review the git diff/recent commits to see exactly what was changed.
|
|
29
|
+
|
|
30
|
+
{{MCP_TOOLS}}
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Steps
|
|
35
|
+
|
|
36
|
+
### 1. Code Review
|
|
37
|
+
|
|
38
|
+
For each implemented item in the current section:
|
|
39
|
+
|
|
40
|
+
- **Correctness** — Does the implementation match the item requirements exactly?
|
|
41
|
+
- **Patterns** — Does it follow existing code patterns and conventions?
|
|
42
|
+
- **Edge cases** — Are there missing edge cases or error scenarios?
|
|
43
|
+
- **Type safety** — No type errors or unsafe casts?
|
|
44
|
+
- **Dependencies** — Are all imports and dependencies correct?
|
|
45
|
+
- **Naming** — Are variable/function names clear and consistent?
|
|
46
|
+
|
|
47
|
+
### 2. Test Coverage Review
|
|
48
|
+
|
|
49
|
+
- **Test files created** — Are there tests for the new code?
|
|
50
|
+
- **Coverage** — Do tests cover normal paths and edge cases?
|
|
51
|
+
- **Integration** — Do tests verify the code works with existing code?
|
|
52
|
+
- **No regressions** — Did existing tests pass? (`nx affected -t test`)
|
|
53
|
+
|
|
54
|
+
### 3. Lint & Type Safety
|
|
55
|
+
|
|
56
|
+
Run checks:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
nx affected -t lint,typecheck
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If there are errors:
|
|
63
|
+
|
|
64
|
+
- Document them as issues in PROGRESS.md (step 4)
|
|
65
|
+
- Do NOT fix them here — the execution phase will fix them
|
|
66
|
+
|
|
67
|
+
### 4. Document Issues
|
|
68
|
+
|
|
69
|
+
If you found **any problems**, add them to `PROGRESS.md` under the current section:
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
- [x] Item name — Issue: [clear description of what's wrong]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Example:
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
- [x] Add login button — Issue: Button missing error handling for failed login attempts
|
|
79
|
+
- [x] Create auth service — Issue: Type error on line 42: cannot assign string to AuthToken
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Include enough detail that an implementation agent can fix the issue directly without re-reading the code.
|
|
83
|
+
|
|
84
|
+
### 5. Decision
|
|
85
|
+
|
|
86
|
+
**If issues found:**
|
|
87
|
+
|
|
88
|
+
- Do NOT advance
|
|
89
|
+
- Return to console with issues documented
|
|
90
|
+
- The loop will loop back to exec to fix them
|
|
91
|
+
|
|
92
|
+
**If NO issues found:**
|
|
93
|
+
|
|
94
|
+
- All items in section are correct
|
|
95
|
+
- Ready to advance to next section
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Rules
|
|
100
|
+
|
|
101
|
+
- **REVIEW ONLY. Do not implement or fix anything.**
|
|
102
|
+
- Be thorough — catching issues now prevents rework later
|
|
103
|
+
- If uncertain about an issue, document it anyway (better safe)
|
|
104
|
+
- Focus on correctness, not "nice to have" improvements
|
|
105
|
+
- Only block if the code doesn't work or is incorrect
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Termination Signal
|
|
110
|
+
|
|
111
|
+
If you discover a fundamental architectural issue that requires revisiting the plan, write `TASK_DIR/STOP` with a one-line reason.
|
|
112
|
+
|
|
113
|
+
Example: `echo "Discovered issue: Auth token storage conflicts with existing pattern" > TASK_DIR/STOP`
|
|
114
|
+
|
|
115
|
+
Only use this for genuine blockers, not normal issues that can be fixed in the next execution pass.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Manual Testing — User Instructions
|
|
2
|
+
|
|
3
|
+
This file is for providing manual testing steps that the agent should follow during execution and review phases.
|
|
4
|
+
|
|
5
|
+
**USER: Edit this file anytime** to define manual testing procedures. Changes take effect on the next iteration.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Leave this file empty if no manual testing is needed.**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Plan — {{TASK_NAME}}
|
|
2
|
+
|
|
3
|
+
> Task: {{TASK_PROMPT}}
|
|
4
|
+
> Created: {{DATE}}
|
|
5
|
+
|
|
6
|
+
## Summary
|
|
7
|
+
|
|
8
|
+
<!-- Brief summary of the task and approach -->
|
|
9
|
+
|
|
10
|
+
## Approach
|
|
11
|
+
|
|
12
|
+
<!-- Key architectural decisions and trade-offs -->
|
|
13
|
+
|
|
14
|
+
## Files
|
|
15
|
+
|
|
16
|
+
<!-- Files that will be created or modified -->
|
|
17
|
+
|
|
18
|
+
## Risks & Open Questions
|
|
19
|
+
|
|
20
|
+
<!-- Anything uncertain or risky -->
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Progress — {{TASK_NAME}}
|
|
2
|
+
|
|
3
|
+
> Task: {{TASK_PROMPT}}
|
|
4
|
+
> Created: {{DATE}}
|
|
5
|
+
|
|
6
|
+
## Section 1 — TODO
|
|
7
|
+
|
|
8
|
+
- [ ] Item description (specific, implementable)
|
|
9
|
+
|
|
10
|
+
## Section N — Verification & Cleanup
|
|
11
|
+
|
|
12
|
+
- [ ] Final integration testing
|
|
13
|
+
- [ ] Update documentation if needed
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Steering — User Guidance
|
|
2
|
+
|
|
3
|
+
This file is for providing real-time guidance and constraints to the agent as iterations progress.
|
|
4
|
+
|
|
5
|
+
**USER: Edit this file anytime** to steer the task. Changes take effect on the next iteration.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Leave this file empty if no special guidance is needed.**
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neriros/ralphy",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "An iterative AI task execution framework. Orchestrates multi-phase autonomous work using Claude or Codex engines.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/neriros/ralphy.git"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"ai",
|
|
12
|
+
"cli",
|
|
13
|
+
"claude",
|
|
14
|
+
"task-runner",
|
|
15
|
+
"mcp",
|
|
16
|
+
"agent",
|
|
17
|
+
"ralph",
|
|
18
|
+
"loop"
|
|
19
|
+
],
|
|
20
|
+
"workspaces": [
|
|
21
|
+
"packages/*",
|
|
22
|
+
"apps/*",
|
|
23
|
+
"tools/generators/*"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"bin": {
|
|
27
|
+
"ralphy": "./dist/cli/index.js",
|
|
28
|
+
"ralphy-mcp": "./dist/mcp/index.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/cli/index.js",
|
|
32
|
+
"dist/mcp/index.js",
|
|
33
|
+
"dist/phases/",
|
|
34
|
+
"dist/checklists/",
|
|
35
|
+
"dist/scaffolds/",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"bun": ">=1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"ralph": "bun .ralph/bin/cli.js",
|
|
43
|
+
"lint": "oxlint --config .oxlintrc.json .",
|
|
44
|
+
"lint:fix": "oxlint --config .oxlintrc.json --fix .",
|
|
45
|
+
"fmt": "oxfmt --write .",
|
|
46
|
+
"fmt:check": "oxfmt --check .",
|
|
47
|
+
"typecheck": "nx affected -t typecheck",
|
|
48
|
+
"check:circular": "madge --circular --extensions ts packages/*/src apps/*/src",
|
|
49
|
+
"check:deps": "depcruise packages/*/src apps/*/src --config .dependency-cruiser.cjs",
|
|
50
|
+
"check:unused": "knip",
|
|
51
|
+
"lint:ci": "nx affected -t lint",
|
|
52
|
+
"fmt:ci": "nx affected -t fmt:check",
|
|
53
|
+
"typecheck:ci": "nx affected -t typecheck --parallel=1",
|
|
54
|
+
"test:ci": "nx affected -t test",
|
|
55
|
+
"test:coverage:ci": "nx affected -t test:coverage",
|
|
56
|
+
"check:circular:ci": "nx affected -t check:circular",
|
|
57
|
+
"prepare": "bunx husky",
|
|
58
|
+
"build:publish": "bunx nx run-many --target=build --projects=cli,mcp && bun run copy-assets",
|
|
59
|
+
"copy-assets": "bun scripts/copy-assets.ts",
|
|
60
|
+
"prepublishOnly": "bun run build:publish"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@commitlint/cli": "^20.4.3",
|
|
64
|
+
"@commitlint/config-conventional": "^20.4.3",
|
|
65
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
66
|
+
"@nx/devkit": "^22.5.3",
|
|
67
|
+
"@nx/js": "^22.5.3",
|
|
68
|
+
"@secretlint/secretlint-rule-preset-recommend": "^11.3.1",
|
|
69
|
+
"@swc-node/register": "^1.11.1",
|
|
70
|
+
"@swc/core": "^1.15.18",
|
|
71
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
72
|
+
"@types/node": "^22.0.0",
|
|
73
|
+
"bun-types": "^1.3.0",
|
|
74
|
+
"chalk": "^5.4.0",
|
|
75
|
+
"dependency-cruiser": "^17.3.8",
|
|
76
|
+
"front-matter": "^4.0.2",
|
|
77
|
+
"husky": "^9.1.7",
|
|
78
|
+
"knip": "^5.85.0",
|
|
79
|
+
"lint-staged": "^16.3.2",
|
|
80
|
+
"madge": "^8.0.0",
|
|
81
|
+
"nx": "22.5.3",
|
|
82
|
+
"oxfmt": "^0.36.0",
|
|
83
|
+
"oxlint": "^1.51.0",
|
|
84
|
+
"secretlint": "^11.3.1",
|
|
85
|
+
"typescript": "^5.8.0",
|
|
86
|
+
"zod": "^3.24.0"
|
|
87
|
+
}
|
|
88
|
+
}
|