@open-tomato/rafa 0.7.1

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.
@@ -0,0 +1,47 @@
1
+ // @bun
2
+ import {
3
+ FINDING_KINDS,
4
+ FINDING_SIGNALS,
5
+ PLAN_BLOCK_KINDS,
6
+ PLAN_HEADER_FIELDS,
7
+ PROBE_TIMEOUT_MS,
8
+ REPORT_STATUSES,
9
+ loadPlanPrerequisites,
10
+ mergePlanPrerequisites,
11
+ parsePlan,
12
+ parsePrerequisites,
13
+ parseReport,
14
+ planPrerequisites,
15
+ prerequisitesPathForPlan,
16
+ renderInjection,
17
+ runPreflight,
18
+ runShellProbe
19
+ } from "../index-adgde7x3.js";
20
+ import {
21
+ INJECT_MODES,
22
+ RAFA_BLOCK_KINDS,
23
+ isRafaBlockKind,
24
+ readRafaBlocks
25
+ } from "../index-akz06erg.js";
26
+ export {
27
+ runShellProbe,
28
+ runPreflight,
29
+ renderInjection,
30
+ readRafaBlocks,
31
+ prerequisitesPathForPlan,
32
+ planPrerequisites,
33
+ parseReport,
34
+ parsePrerequisites,
35
+ parsePlan,
36
+ mergePlanPrerequisites,
37
+ loadPlanPrerequisites,
38
+ isRafaBlockKind,
39
+ REPORT_STATUSES,
40
+ RAFA_BLOCK_KINDS,
41
+ PROBE_TIMEOUT_MS,
42
+ PLAN_HEADER_FIELDS,
43
+ PLAN_BLOCK_KINDS,
44
+ INJECT_MODES,
45
+ FINDING_SIGNALS,
46
+ FINDING_KINDS
47
+ };
@@ -0,0 +1,65 @@
1
+ # Plan-generation instructions
2
+
3
+ ## Naming conventions
4
+
5
+ All rafa work follows a consistent naming scheme across specifications,
6
+ plans, branches, and pull requests. The board is GitHub Issues on
7
+ `open-tomato/rafa`; every spec has one issue labelled `type:spec`, whose
8
+ ID appears as `rafa-<n>`.
9
+
10
+ | Artifact | Pattern | Example |
11
+ | --- | --- | --- |
12
+ | Specification file | `.rafa/specs/rafa-<n>-<slug>.md` | `.rafa/specs/rafa-20-pr-commands.md` |
13
+ | Plan stub and directory | `rafa-<n>-<slug>` | `rafa-20-pr-commands` |
14
+ | `issue:` field in `rafa:plan` | `<n>` (number only) | `issue: 20` |
15
+ | Git branch | `feat/rafa-<n>-<slug>` | `feat/rafa-20-pr-commands` |
16
+ | Pull request title | `rafa-<n>: <title>` | `rafa-20: Add pull-request commands` |
17
+ | Pull request body | `Closes #<n>` | `Closes #20` |
18
+
19
+ The slug summarizes what the user gets, using two to four words joined by
20
+ hyphens. The order of work lives in ONE place: the pinned "Roadmap" issue
21
+ on the `open-tomato/rafa` board.
22
+
23
+ * Before planning, review the spec as written, and report that review at the
24
+ END of your final message as a `rafa:spec-review` block carrying
25
+ `verdict: ready` or `verdict: not-ready`, with empty `gaps:` for ready, or a
26
+ list of `{heading, what}` gaps for not-ready — only continue planning after
27
+ you have judged the spec ready. The block is the LAST thing you write: end
28
+ the final message with it, after the summary, and write nothing after it.
29
+ * Inspect each definition-of-done item: can it be shown by running a command
30
+ or demonstrating a UI interaction, or is it worded too broadly for a reader
31
+ to measure?
32
+ * Inspect each task name and the sentence that follows it: does it name what
33
+ the task changes, and is that claim defensible from the text, or must the
34
+ plan guess?
35
+ * Inspect the headers the spec names: are they the ones the dev-planner
36
+ format requires, and does each hold actual content or only placeholders?
37
+ * If any inspection finds a gap, write its heading as it appears in the spec,
38
+ the `what` explaining the gap clearly, and list them all under `gaps:` in
39
+ that closing block.
40
+
41
+ Create a plan based on the spec at the end of this prompt, following the
42
+ dev-planner format specification that precedes it. Produce the required
43
+ checklists, technical assessments, feature requirements and acceptance
44
+ criteria — **do not execute the plan**.
45
+
46
+ {PROGRESS_SECTION}
47
+
48
+ ## Files to produce
49
+
50
+ * Store the plan in `{PLAN_FILE}` (the plans directory is untracked unless
51
+ the project opts into tracking it — plans may describe unpatched issues;
52
+ never move them into a tracked path).
53
+ * If the plan assumes any prerequisite — a service running, a credential in an
54
+ env var, an installed tool — create `{PREREQUISITES_FILE}` with those steps
55
+ as a checklist in the PREREQUISITES.md format of the dev-planner
56
+ specification below. Only genuinely non-automatable steps; do not duplicate
57
+ what `README.md`/`AGENTS.md` already require of every contributor. Link to
58
+ it from the plan.
59
+ * Do not create or touch any tracker file — the loop derives it from the plan.
60
+
61
+ {PLAN_FORMAT}
62
+
63
+ ## Spec
64
+
65
+ {SPEC_CONTENT}
@@ -0,0 +1,24 @@
1
+ <!-- eslint-disable markdown/no-multiple-h1 -->
2
+ # Plan: Resolve CI install failure
3
+
4
+ ```rafa:plan
5
+ stub: resolve-ci-install
6
+ issue: "20"
7
+ spec: .rafa/specs/rafa-20-pr-commands.md
8
+ ```
9
+
10
+ ```rafa:context
11
+ The `bun install` step in CI failed. This plan routes the repair task to the build-error-resolver agent with the CI log excerpt, allowing it to diagnose and fix dependency-related issues.
12
+
13
+ This triage already read the failing job's log, and the excerpt below is what it read; do not fetch it again.
14
+
15
+ {FAILING_LOG}
16
+ ```
17
+
18
+ ## Description
19
+
20
+ This plan resolves a pull request with a failed `bun install` step in CI by delegating diagnosis and repair to the build-error-resolver agent, which will analyze the log excerpt and implement the necessary fix.
21
+
22
+ # Stage: Resolve
23
+
24
+ - [ ] Analyze the CI install failure log excerpt and repair the dependency or manifest issues that caused the install to fail {agent=build-error-resolver}
@@ -0,0 +1,24 @@
1
+ <!-- eslint-disable markdown/no-multiple-h1 -->
2
+ # Plan: Resolve CI lint failure
3
+
4
+ ```rafa:plan
5
+ stub: resolve-ci-lint
6
+ issue: "20"
7
+ spec: .rafa/specs/rafa-20-pr-commands.md
8
+ ```
9
+
10
+ ```rafa:context
11
+ The `bunx eslint .` step in CI failed. This plan routes the repair task to the build-error-resolver agent with the CI log excerpt, allowing it to diagnose and fix lint violations.
12
+
13
+ This triage already read the failing job's log, and the excerpt below is what it read; do not fetch it again.
14
+
15
+ {FAILING_LOG}
16
+ ```
17
+
18
+ ## Description
19
+
20
+ This plan resolves a pull request with a failed `bunx eslint .` step in CI by delegating diagnosis and repair to the build-error-resolver agent, which will analyze the log excerpt and implement the necessary lint fixes.
21
+
22
+ # Stage: Resolve
23
+
24
+ - [ ] Analyze the CI lint failure log excerpt and repair the lint violations that caused the check to fail {agent=build-error-resolver}
@@ -0,0 +1,28 @@
1
+ <!-- eslint-disable markdown/no-multiple-h1 -->
2
+ # Plan: Resolve lockfile conflict
3
+
4
+ ```rafa:plan
5
+ stub: resolve-conflict-lockfile
6
+ issue: "20"
7
+ spec: .rafa/specs/rafa-20-pr-commands.md
8
+ ```
9
+
10
+ ```rafa:context
11
+ {CONFLICT_SENTENCE}
12
+
13
+ For lockfile conflicts specifically: merge the base, take the base's lockfile, then reinstall to re-anchor the branch's dependencies to the base's versions. This triage read the conflict from {CONFLICT_FILES}.
14
+ ```
15
+
16
+ ## Description
17
+
18
+ This plan resolves a pull request with a `bun.lock` conflict by taking the base's lockfile version, reinstalling to verify the merged manifests are consistent, and confirming all gates pass before pushing.
19
+
20
+ # Stage: Resolve
21
+
22
+ - [ ] Merge the base branch into the current branch using `git merge origin/main` {agent=loop-implementer}
23
+ - [ ] Take the base's `bun.lock` with `git checkout origin/main -- bun.lock` {agent=loop-implementer}
24
+ - [ ] Run `bun install` (plain, not `--frozen-lockfile`) to re-anchor dependencies to the merged state {agent=loop-implementer}
25
+ - [ ] Run `bun install --frozen-lockfile` to verify the lockfile is now consistent with the merged manifests {agent=loop-implementer}
26
+ - [ ] Run the gates (`env -u CLAUDECODE bun test`, `bunx tsc --noEmit`, `bunx eslint .`) to verify no other conflicts arose {agent=loop-implementer}
27
+ - [ ] Commit the merge and lockfile changes to the branch {agent=loop-implementer}
28
+ - [ ] Push the resolved branch to the current branch on GitHub {agent=loop-implementer}
@@ -0,0 +1,28 @@
1
+ <!-- eslint-disable markdown/no-multiple-h1 -->
2
+ # Plan: Resolve manifest conflict
3
+
4
+ ```rafa:plan
5
+ stub: resolve-conflict-manifest
6
+ issue: "20"
7
+ spec: .rafa/specs/rafa-20-pr-commands.md
8
+ ```
9
+
10
+ ```rafa:context
11
+ {CONFLICT_SENTENCE}
12
+
13
+ For manifest conflicts specifically: merge the base, keep both sides' entries and take the higher version where both bumped one, then reinstall to verify consistency and confirm all gates pass before pushing. This triage read the conflict from {CONFLICT_FILES}.
14
+ ```
15
+
16
+ ## Description
17
+
18
+ This plan resolves a pull request with a `package.json` conflict by merging the base branch, keeping both sides' entries and taking the higher version where both dependencies were bumped, reinstalling to verify consistency, and confirming all gates pass before pushing.
19
+
20
+ # Stage: Resolve
21
+
22
+ - [ ] Merge the base branch into the current branch using `git merge origin/main` {agent=loop-implementer}
23
+ - [ ] Resolve the `package.json` conflict by keeping both sides' entries and taking the higher version where both sides bumped a dependency {agent=loop-implementer}
24
+ - [ ] Run `bun install` (plain, not `--frozen-lockfile`) to ensure both sides' dependencies are installed and the lockfile is updated {agent=loop-implementer}
25
+ - [ ] Run `bun install --frozen-lockfile` to verify the lockfile is now consistent with the merged manifests {agent=loop-implementer}
26
+ - [ ] Run the gates (`env -u CLAUDECODE bun test`, `bunx tsc --noEmit`, `bunx eslint .`) to verify no other conflicts arose {agent=loop-implementer}
27
+ - [ ] Commit the merge and manifest changes to the branch {agent=loop-implementer}
28
+ - [ ] Push the resolved branch to the current branch on GitHub {agent=loop-implementer}
@@ -0,0 +1 @@
1
+ // @bun
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Spec
3
+ about: A change described well enough that rafa can plan from it
4
+ title: 'Spec: '
5
+ labels: 'type:spec'
6
+ assignees: ''
7
+ ---
8
+
9
+ <!-- This issue is public. No local paths, no internal hostnames, no credentials: machine-specific notes belong in the local notes file beside the spec, never in this body. Delete every comment in this template as you fill it in. -->
10
+
11
+ ## What you get
12
+
13
+ <!-- The change from the outside: what somebody can do after it that they cannot do now. One paragraph. -->
14
+
15
+ ## Starting position
16
+
17
+ <!-- What exists today that this builds on: the modules, the commands and the readings that are already true. Name them. -->
18
+
19
+ ## Design
20
+
21
+ <!-- How it works: the pieces, where each one lives, and which decision each of them owns. Name the alternative you rejected and why. -->
22
+
23
+ ## What can go wrong
24
+
25
+ <!-- The failure modes, and what each one costs. A reading that could be a false negative belongs here with the control that would catch it. -->
26
+
27
+ ## Tasks the plan must carry
28
+
29
+ <!-- One list item per piece of work, each naming what it changes. The plan is written from these items, so a paragraph here plans nothing. -->
30
+
31
+ -
32
+
33
+ ## Definition of done
34
+
35
+ <!-- One list item per thing that can be shown by a command. "Works well" is not an item; "bun test is green with the new cases" is. -->
36
+
37
+ -
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@open-tomato/rafa",
3
+ "version": "0.7.1",
4
+ "description": "Alpha. Runs a plan through the ralph loop: one Claude Code session per task, one commit per task, then a pull request and a CI wait.",
5
+ "private": false,
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "registry": "https://registry.npmjs.org/",
9
+ "@open-tomato:registry": "https://registry.npmjs.org/"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/open-tomato/rafa.git"
14
+ },
15
+ "homepage": "https://github.com/open-tomato/rafa#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/open-tomato/rafa/issues"
18
+ },
19
+ "keywords": [
20
+ "claude-code",
21
+ "agent",
22
+ "loop",
23
+ "ralph",
24
+ "cli",
25
+ "bun"
26
+ ],
27
+ "license": "Apache-2.0",
28
+ "author": "Marcos Tomatti <marcos@opentomato.io>",
29
+ "packageManager": "bun@1.3.14",
30
+ "type": "module",
31
+ "module": "./dist/index.js",
32
+ "bin": {
33
+ "rafa": "./dist/cli.js"
34
+ },
35
+ "exports": {
36
+ ".": "./dist/index.js",
37
+ "./cli": "./dist/cli.js",
38
+ "./plan": "./dist/plan/index.js",
39
+ "./store": "./dist/effort/store/index.js",
40
+ "./ports": "./dist/ports/index.js"
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "NOTICE"
45
+ ],
46
+ "engines": {
47
+ "bun": ">=1.3.14"
48
+ },
49
+ "scripts": {
50
+ "build": "rm -rf dist && bun build src/rafa.ts --target=bun --outfile=dist/cli.js && bun build src/index.ts src/plan/index.ts src/effort/store/index.ts src/ports/index.ts --target=bun --splitting --root=src --outdir=dist && cp src/PROMPT.md src/plan-prompt.md .claude/skills/dev-planner/SKILL.md dist/ && for tree in pr/plans:plans board/templates:templates; do src=src/${tree%:*}; out=dist/${tree#*:}; [ -d \"$src\" ] || continue; mkdir -p \"$out\" && cp \"$src\"/*.md \"$out\"/ || exit 1; done",
51
+ "prepack": "bun run build",
52
+ "test": "bun test",
53
+ "lint": "eslint .",
54
+ "check-types": "tsc --noEmit",
55
+ "gate:control-bytes": "bun scripts/control-byte-gate/control-byte-gate.ts",
56
+ "snapshot": "bun scripts/snapshot-runtime.ts"
57
+ },
58
+ "devDependencies": {
59
+ "@eslint/js": "^10.0.1",
60
+ "@eslint/markdown": "^8.0.3",
61
+ "@stylistic/eslint-plugin": "^5.10.0",
62
+ "@types/bun": "^1.4.0",
63
+ "@types/node": "^26.4.1",
64
+ "@typescript-eslint/parser": "^8.69.0",
65
+ "eslint": "^9.39.4",
66
+ "eslint-import-resolver-typescript": "^4.4.4",
67
+ "eslint-plugin-import": "^2.32.0",
68
+ "eslint-plugin-jsonc": "^3.4.2",
69
+ "globals": "^17.12.0",
70
+ "jsonc-eslint-parser": "^3.1.0",
71
+ "typescript": "^5.9.3",
72
+ "typescript-eslint": "^8.69.0"
73
+ }
74
+ }