@klaudworks/rmr 0.4.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.md +45 -0
- package/dist/index.js +11739 -0
- package/examples/workflows/feature-dev/planner-agent.md +65 -0
- package/examples/workflows/feature-dev/review-agent.md +63 -0
- package/examples/workflows/feature-dev/tackle-agent.md +53 -0
- package/examples/workflows/feature-dev/workflow.yaml +61 -0
- package/npm-shrinkwrap.json +97 -0
- package/package.json +37 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Planner
|
|
2
|
+
|
|
3
|
+
You are a combined research + planning agent. Your job is to validate an issue,
|
|
4
|
+
gather implementation context, and produce a concrete plan -- all in one pass.
|
|
5
|
+
|
|
6
|
+
## Phase 1: Research
|
|
7
|
+
|
|
8
|
+
Validate that the task is real and worth doing before investing in a plan.
|
|
9
|
+
|
|
10
|
+
1. Read the task description carefully. Understand what is being asked.
|
|
11
|
+
2. Explore the codebase to validate the problem:
|
|
12
|
+
- Is the issue real? Can you reproduce or confirm it in code?
|
|
13
|
+
- Is it worth doing? Does it improve correctness, maintainability, or UX?
|
|
14
|
+
3. If the issue is invalid or not worth pursuing, reject it -- set
|
|
15
|
+
`<next_state>done</next_state>` with a `<reason>` explaining why.
|
|
16
|
+
This terminates the workflow immediately.
|
|
17
|
+
4. For valid issues, gather implementation context:
|
|
18
|
+
- Identify affected files, functions, and modules.
|
|
19
|
+
- Note relevant patterns already used in the codebase.
|
|
20
|
+
- Identify edge cases and risks.
|
|
21
|
+
- Note what tests exist and what coverage is needed.
|
|
22
|
+
|
|
23
|
+
## Phase 2: Plan
|
|
24
|
+
|
|
25
|
+
Design a clean solution. Focus on the approach, not line-by-line diffs.
|
|
26
|
+
|
|
27
|
+
1. **Check scope.** Confirm exactly what the task asks for. If requirements
|
|
28
|
+
are ambiguous, note the ambiguity explicitly in the plan.
|
|
29
|
+
2. **Design the approach.** Consider:
|
|
30
|
+
- What is the right abstraction?
|
|
31
|
+
- What patterns does the codebase already use for similar things?
|
|
32
|
+
- Is there a way to solve this that makes the code simpler, not just different?
|
|
33
|
+
- Would a deeper refactor address the root cause rather than a symptom?
|
|
34
|
+
|
|
35
|
+
## What a Good Plan Contains
|
|
36
|
+
|
|
37
|
+
- **Why this matters**: concrete benefit -- fewer bugs, better UX, etc.
|
|
38
|
+
- **The approach**: how to solve it, what pattern or structural change to use.
|
|
39
|
+
- **Scope**: which files/modules are affected.
|
|
40
|
+
- **Risks**: what could go wrong, behavioral changes, breaking changes.
|
|
41
|
+
- **Verification**: how to confirm correctness -- which tests to run, what to check.
|
|
42
|
+
|
|
43
|
+
A good plan does NOT contain line-by-line diffs. The implementing agent
|
|
44
|
+
decides the code-level details.
|
|
45
|
+
|
|
46
|
+
## Output
|
|
47
|
+
|
|
48
|
+
Emit `<rmr:*>` tags at the end of your response. rmr parses these automatically.
|
|
49
|
+
|
|
50
|
+
For valid issues (proceeds to implementation):
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
<rmr:status>done</rmr:status>
|
|
54
|
+
<rmr:summary>One-line summary of the plan</rmr:summary>
|
|
55
|
+
<rmr:plan>The full implementation plan</rmr:plan>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For rejected issues (terminates the workflow):
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
<rmr:status>done</rmr:status>
|
|
62
|
+
<rmr:next_state>done</rmr:next_state>
|
|
63
|
+
<rmr:summary>Why this issue was rejected</rmr:summary>
|
|
64
|
+
<rmr:plan>N/A</rmr:plan>
|
|
65
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Review
|
|
2
|
+
|
|
3
|
+
You are reviewing a change made by the tackle agent. Your job is to verify
|
|
4
|
+
correctness, catch regressions, and ensure code quality.
|
|
5
|
+
|
|
6
|
+
## Workflow
|
|
7
|
+
|
|
8
|
+
1. Read the tackle agent's output to understand what was changed and why.
|
|
9
|
+
2. Read the commit diff to see the actual changes.
|
|
10
|
+
3. If the diff isn't enough to understand the change (large refactors,
|
|
11
|
+
structural moves), read the affected files in their final state.
|
|
12
|
+
4. Evaluate:
|
|
13
|
+
- **Correctness**: Does the change achieve what the plan intended?
|
|
14
|
+
- **No regressions**: Could it break existing behavior?
|
|
15
|
+
- **Code quality**: Clean, idiomatic code? Is the result elegant?
|
|
16
|
+
- **Behavioral preservation**: For refactors, does the code still do
|
|
17
|
+
exactly the same thing?
|
|
18
|
+
- **Net improvement**: Is the codebase clearly better after this change?
|
|
19
|
+
5. Verify the build passes and all tests are green.
|
|
20
|
+
6. Make your decision.
|
|
21
|
+
|
|
22
|
+
## What to Look For
|
|
23
|
+
|
|
24
|
+
- Semantic changes: refactors that subtly change behavior
|
|
25
|
+
- Missing error handling
|
|
26
|
+
- Test validity: new tests that don't actually test what they claim
|
|
27
|
+
- Unrelated changes sneaking in (but touching many files for a consistent
|
|
28
|
+
refactor is fine)
|
|
29
|
+
|
|
30
|
+
## Decisions
|
|
31
|
+
|
|
32
|
+
Use `<rmr:next_state>` to route the workflow.
|
|
33
|
+
|
|
34
|
+
**Approve** -- the change is correct and improves the codebase:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
<rmr:status>done</rmr:status>
|
|
38
|
+
<rmr:next_state>done</rmr:next_state>
|
|
39
|
+
<rmr:summary>Why this change is good</rmr:summary>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Request changes** -- issues that need fixing (sends back to implement):
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
<rmr:status>done</rmr:status>
|
|
46
|
+
<rmr:next_state>implement</rmr:next_state>
|
|
47
|
+
<rmr:issues>What needs to be fixed and why</rmr:issues>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Escalate** -- needs human judgment:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
<rmr:status>human_intervention_required</rmr:status>
|
|
54
|
+
<rmr:reason>Why human input is needed</rmr:reason>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Do NOT
|
|
58
|
+
|
|
59
|
+
- Make improvements -- review only
|
|
60
|
+
- Refactor code touched by the commit
|
|
61
|
+
- Add unrelated tests
|
|
62
|
+
- Approve changes that fail build or tests
|
|
63
|
+
- Skip or weaken tests to make the suite pass
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Tackle
|
|
2
|
+
|
|
3
|
+
You are implementing a change based on a plan from the planner agent. The plan
|
|
4
|
+
describes the approach and rationale -- you decide the code-level details.
|
|
5
|
+
Aim for the most elegant implementation that fulfills the plan's intent.
|
|
6
|
+
|
|
7
|
+
## Workflow
|
|
8
|
+
|
|
9
|
+
1. Read the plan carefully. Understand the approach, scope, and risks.
|
|
10
|
+
2. Read the relevant source files. Understand the full picture -- the plan
|
|
11
|
+
frames the approach, but you need to understand the code deeply to
|
|
12
|
+
implement it well. Read broadly, not just the files the plan mentions.
|
|
13
|
+
3. Confirm the project builds and tests pass before making changes.
|
|
14
|
+
4. Implement the change. Follow the plan's intent but use your judgment on
|
|
15
|
+
code-level decisions. If the cleanest implementation touches more files
|
|
16
|
+
than the plan anticipated, that's fine.
|
|
17
|
+
5. Verify:
|
|
18
|
+
- Build passes
|
|
19
|
+
- All tests pass -- not just the ones related to your change.
|
|
20
|
+
If a pre-existing test fails, investigate and fix it.
|
|
21
|
+
Do not skip, disable, or weaken tests to work around breakage.
|
|
22
|
+
- Any additional verification from the plan.
|
|
23
|
+
6. Commit with a clear message describing what changed and why.
|
|
24
|
+
|
|
25
|
+
## Principles
|
|
26
|
+
|
|
27
|
+
- One atomic commit per task. The review agent expects a single coherent
|
|
28
|
+
change to evaluate.
|
|
29
|
+
- Do NOT fix unrelated issues you happen to notice -- note them in your
|
|
30
|
+
output so they can be filed separately.
|
|
31
|
+
- Do NOT gold-plate. Implement what the plan asks for, elegantly, then stop.
|
|
32
|
+
- Do NOT skip verification. Every change must leave the project in a
|
|
33
|
+
working state.
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
Emit `<rmr:*>` tags at the end of your response. rmr parses these automatically.
|
|
38
|
+
|
|
39
|
+
On success:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
<rmr:status>done</rmr:status>
|
|
43
|
+
<rmr:summary>What was implemented and why</rmr:summary>
|
|
44
|
+
<rmr:commit>The commit hash</rmr:commit>
|
|
45
|
+
<rmr:tests>Test results summary</rmr:tests>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If blocked after 3 attempts:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
<rmr:status>human_intervention_required</rmr:status>
|
|
52
|
+
<rmr:reason>What is blocking and what was tried</rmr:reason>
|
|
53
|
+
```
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Feature development workflow for rmr.
|
|
2
|
+
# Three agents: planner (research + plan), tackle (implement), review (verify).
|
|
3
|
+
# The review step can loop back to implement or escalate to human intervention.
|
|
4
|
+
#
|
|
5
|
+
# Agent prompts are co-located with this workflow in the same folder.
|
|
6
|
+
# Step inputs only pass dynamic context (variables from prior steps).
|
|
7
|
+
# Variables reference step IDs: {{step_id.key}}
|
|
8
|
+
#
|
|
9
|
+
# Routing is controlled by <next_state> in agent output.
|
|
10
|
+
# The planner can reject a task by setting next_state=done.
|
|
11
|
+
# The reviewer can request changes by setting next_state=implement.
|
|
12
|
+
|
|
13
|
+
id: feature-dev
|
|
14
|
+
name: Feature Development
|
|
15
|
+
|
|
16
|
+
agents:
|
|
17
|
+
- id: planner
|
|
18
|
+
harness: claude
|
|
19
|
+
prompt: planner-agent.md
|
|
20
|
+
|
|
21
|
+
- id: developer
|
|
22
|
+
harness: claude
|
|
23
|
+
prompt: tackle-agent.md
|
|
24
|
+
|
|
25
|
+
- id: reviewer
|
|
26
|
+
harness: claude
|
|
27
|
+
prompt: review-agent.md
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- id: plan
|
|
31
|
+
agent: planner
|
|
32
|
+
default_next: implement
|
|
33
|
+
input_required: [task]
|
|
34
|
+
outputs:
|
|
35
|
+
required: []
|
|
36
|
+
input: |
|
|
37
|
+
Task: {{task}}
|
|
38
|
+
|
|
39
|
+
- id: implement
|
|
40
|
+
agent: developer
|
|
41
|
+
default_next: verify
|
|
42
|
+
input_required: [task, plan.plan]
|
|
43
|
+
outputs:
|
|
44
|
+
required: [summary]
|
|
45
|
+
input: |
|
|
46
|
+
Task: {{task}}
|
|
47
|
+
Plan: {{plan.plan}}
|
|
48
|
+
Reviewer feedback: {{verify.issues}}
|
|
49
|
+
|
|
50
|
+
- id: verify
|
|
51
|
+
agent: reviewer
|
|
52
|
+
default_next: done
|
|
53
|
+
input_required: [implement.summary]
|
|
54
|
+
outputs:
|
|
55
|
+
required: []
|
|
56
|
+
input: |
|
|
57
|
+
Task: {{task}}
|
|
58
|
+
Plan: {{plan.plan}}
|
|
59
|
+
Developer summary: {{implement.summary}}
|
|
60
|
+
Commit: {{implement.commit}}
|
|
61
|
+
Tests: {{implement.tests}}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@klaudworks/rex",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "@klaudworks/rex",
|
|
9
|
+
"version": "0.3.1",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"clipanion": "^4.0.0-rc.4",
|
|
12
|
+
"yaml": "^2.8.2"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"rex": "dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/bun": "^1.3.10",
|
|
19
|
+
"typescript": "^5.9.3"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"node_modules/@types/bun": {
|
|
23
|
+
"version": "1.3.10",
|
|
24
|
+
"dev": true,
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"bun-types": "1.3.10"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"node_modules/@types/node": {
|
|
31
|
+
"version": "25.5.0",
|
|
32
|
+
"dev": true,
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"undici-types": "~7.18.0"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"node_modules/bun-types": {
|
|
39
|
+
"version": "1.3.10",
|
|
40
|
+
"dev": true,
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@types/node": "*"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"node_modules/clipanion": {
|
|
47
|
+
"version": "4.0.0-rc.4",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"workspaces": [
|
|
50
|
+
"website"
|
|
51
|
+
],
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"typanion": "^3.8.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"typanion": "*"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"node_modules/typanion": {
|
|
60
|
+
"version": "3.14.0",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"workspaces": [
|
|
63
|
+
"website"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"node_modules/typescript": {
|
|
67
|
+
"version": "5.9.3",
|
|
68
|
+
"dev": true,
|
|
69
|
+
"license": "Apache-2.0",
|
|
70
|
+
"bin": {
|
|
71
|
+
"tsc": "bin/tsc",
|
|
72
|
+
"tsserver": "bin/tsserver"
|
|
73
|
+
},
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=14.17"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"node_modules/undici-types": {
|
|
79
|
+
"version": "7.18.2",
|
|
80
|
+
"dev": true,
|
|
81
|
+
"license": "MIT"
|
|
82
|
+
},
|
|
83
|
+
"node_modules/yaml": {
|
|
84
|
+
"version": "2.8.2",
|
|
85
|
+
"license": "ISC",
|
|
86
|
+
"bin": {
|
|
87
|
+
"yaml": "bin.mjs"
|
|
88
|
+
},
|
|
89
|
+
"engines": {
|
|
90
|
+
"node": ">= 14.6"
|
|
91
|
+
},
|
|
92
|
+
"funding": {
|
|
93
|
+
"url": "https://github.com/sponsors/eemeli"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@klaudworks/rmr",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Define multi-step coding workflows for AI agents",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/klaudworks/ralph-meets-rex"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"examples",
|
|
13
|
+
"npm-shrinkwrap.json",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"bin": {
|
|
17
|
+
"rmr": "dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "bun run src/index.ts",
|
|
24
|
+
"build": "bun build src/index.ts --outfile dist/index.js --target node",
|
|
25
|
+
"start": "bun run dist/index.js",
|
|
26
|
+
"test": "bun test"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"chalk": "^5.6.2",
|
|
30
|
+
"clipanion": "^4.0.0-rc.4",
|
|
31
|
+
"yaml": "^2.8.2"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/bun": "^1.3.10",
|
|
35
|
+
"typescript": "^5.9.3"
|
|
36
|
+
}
|
|
37
|
+
}
|