pi-extensions 0.1.9

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 (135) hide show
  1. package/.ralph/import-cc-codex.md +31 -0
  2. package/.ralph/import-cc-codex.state.json +14 -0
  3. package/.ralph/mario-not-impl.md +69 -0
  4. package/.ralph/mario-not-impl.state.json +14 -0
  5. package/.ralph/mario-not-spec.md +163 -0
  6. package/.ralph/mario-not-spec.state.json +14 -0
  7. package/LICENSE +21 -0
  8. package/README.md +65 -0
  9. package/RELEASING.md +34 -0
  10. package/agent-guidance/CHANGELOG.md +4 -0
  11. package/agent-guidance/README.md +102 -0
  12. package/agent-guidance/agent-guidance.ts +147 -0
  13. package/agent-guidance/package.json +22 -0
  14. package/agent-guidance/setup.sh +75 -0
  15. package/agent-guidance/templates/CLAUDE.md +5 -0
  16. package/agent-guidance/templates/CODEX.md +92 -0
  17. package/agent-guidance/templates/GEMINI.md +5 -0
  18. package/arcade/CHANGELOG.md +4 -0
  19. package/arcade/README.md +85 -0
  20. package/arcade/assets/picman.png +0 -0
  21. package/arcade/assets/ping.png +0 -0
  22. package/arcade/assets/spice-invaders.png +0 -0
  23. package/arcade/assets/tetris.png +0 -0
  24. package/arcade/mario-not/README.md +30 -0
  25. package/arcade/mario-not/boss.js +103 -0
  26. package/arcade/mario-not/camera.js +59 -0
  27. package/arcade/mario-not/collision.js +91 -0
  28. package/arcade/mario-not/colors.js +36 -0
  29. package/arcade/mario-not/constants.js +97 -0
  30. package/arcade/mario-not/core.js +39 -0
  31. package/arcade/mario-not/death.js +77 -0
  32. package/arcade/mario-not/effects.js +84 -0
  33. package/arcade/mario-not/enemies.js +31 -0
  34. package/arcade/mario-not/engine.js +171 -0
  35. package/arcade/mario-not/fireballs.js +98 -0
  36. package/arcade/mario-not/items.js +24 -0
  37. package/arcade/mario-not/levels.js +403 -0
  38. package/arcade/mario-not/logic.js +104 -0
  39. package/arcade/mario-not/mario-not.ts +297 -0
  40. package/arcade/mario-not/player.js +244 -0
  41. package/arcade/mario-not/render.js +257 -0
  42. package/arcade/mario-not/spec.md +548 -0
  43. package/arcade/mario-not/state.js +246 -0
  44. package/arcade/mario-not/tests/e2e.test.js +855 -0
  45. package/arcade/mario-not/tests/engine.test.js +888 -0
  46. package/arcade/mario-not/tests/fixtures/story0-frame.txt +4 -0
  47. package/arcade/mario-not/tests/fixtures/story1-camera.txt +4 -0
  48. package/arcade/mario-not/tests/fixtures/story1-glyphs.txt +4 -0
  49. package/arcade/mario-not/tests/fixtures/story10-item.txt +4 -0
  50. package/arcade/mario-not/tests/fixtures/story11-hazards.txt +4 -0
  51. package/arcade/mario-not/tests/fixtures/story12-used-block.txt +4 -0
  52. package/arcade/mario-not/tests/fixtures/story13-pipes.txt +4 -0
  53. package/arcade/mario-not/tests/fixtures/story14-goal.txt +4 -0
  54. package/arcade/mario-not/tests/fixtures/story15-hud-narrow.txt +2 -0
  55. package/arcade/mario-not/tests/fixtures/story16-unknown-tile.txt +4 -0
  56. package/arcade/mario-not/tests/fixtures/story17-mix.txt +4 -0
  57. package/arcade/mario-not/tests/fixtures/story18-hud-score.txt +2 -0
  58. package/arcade/mario-not/tests/fixtures/story19-cue.txt +4 -0
  59. package/arcade/mario-not/tests/fixtures/story2-enemy.txt +4 -0
  60. package/arcade/mario-not/tests/fixtures/story20-camera-offset.txt +4 -0
  61. package/arcade/mario-not/tests/fixtures/story21-hud-zero.txt +2 -0
  62. package/arcade/mario-not/tests/fixtures/story22-big-viewport.txt +4 -0
  63. package/arcade/mario-not/tests/fixtures/story23-camera-negative.txt +4 -0
  64. package/arcade/mario-not/tests/fixtures/story24-camera-width.txt +4 -0
  65. package/arcade/mario-not/tests/fixtures/story25-camera-positive.txt +4 -0
  66. package/arcade/mario-not/tests/fixtures/story26-hud-lives.txt +2 -0
  67. package/arcade/mario-not/tests/fixtures/story27-hud-coins.txt +2 -0
  68. package/arcade/mario-not/tests/fixtures/story28-item-viewport.txt +4 -0
  69. package/arcade/mario-not/tests/fixtures/story29-enemy-viewport.txt +4 -0
  70. package/arcade/mario-not/tests/fixtures/story3-hud.txt +2 -0
  71. package/arcade/mario-not/tests/fixtures/story30-hud-score.txt +2 -0
  72. package/arcade/mario-not/tests/fixtures/story31-particles-viewport.txt +4 -0
  73. package/arcade/mario-not/tests/fixtures/story32-paused-frame.txt +4 -0
  74. package/arcade/mario-not/tests/fixtures/story4-big.txt +4 -0
  75. package/arcade/mario-not/tests/fixtures/story5-resume-hud.txt +2 -0
  76. package/arcade/mario-not/tests/fixtures/story6-particles.txt +4 -0
  77. package/arcade/mario-not/tests/fixtures/story6-paused.txt +4 -0
  78. package/arcade/mario-not/tests/fixtures/story7-powerup.txt +4 -0
  79. package/arcade/mario-not/tests/fixtures/story8-hud-time.txt +2 -0
  80. package/arcade/mario-not/tests/fixtures/story9-hud-level.txt +2 -0
  81. package/arcade/mario-not/tiles.js +79 -0
  82. package/arcade/mario-not/tsconfig.json +14 -0
  83. package/arcade/mario-not/types.js +225 -0
  84. package/arcade/package.json +26 -0
  85. package/arcade/picman.ts +328 -0
  86. package/arcade/ping.ts +594 -0
  87. package/arcade/spice-invaders.ts +1104 -0
  88. package/arcade/tetris.ts +662 -0
  89. package/code-actions/CHANGELOG.md +4 -0
  90. package/code-actions/README.md +65 -0
  91. package/code-actions/actions.ts +107 -0
  92. package/code-actions/index.ts +148 -0
  93. package/code-actions/package.json +22 -0
  94. package/code-actions/search.ts +79 -0
  95. package/code-actions/snippets.ts +179 -0
  96. package/code-actions/ui.ts +120 -0
  97. package/files-widget/CHANGELOG.md +90 -0
  98. package/files-widget/DESIGN.md +452 -0
  99. package/files-widget/README.md +122 -0
  100. package/files-widget/TODO.md +141 -0
  101. package/files-widget/browser.ts +922 -0
  102. package/files-widget/comment.ts +5 -0
  103. package/files-widget/constants.ts +18 -0
  104. package/files-widget/demo.svg +1 -0
  105. package/files-widget/file-tree.ts +224 -0
  106. package/files-widget/file-viewer.ts +93 -0
  107. package/files-widget/git.ts +107 -0
  108. package/files-widget/index.ts +140 -0
  109. package/files-widget/input-utils.ts +3 -0
  110. package/files-widget/package.json +22 -0
  111. package/files-widget/types.ts +28 -0
  112. package/files-widget/utils.ts +26 -0
  113. package/files-widget/viewer.ts +424 -0
  114. package/import-cc-codex/research/import-chats-from-other-agents.md +135 -0
  115. package/import-cc-codex/spec.md +79 -0
  116. package/package.json +29 -0
  117. package/ralph-wiggum/CHANGELOG.md +7 -0
  118. package/ralph-wiggum/README.md +96 -0
  119. package/ralph-wiggum/SKILL.md +73 -0
  120. package/ralph-wiggum/index.ts +792 -0
  121. package/ralph-wiggum/package.json +25 -0
  122. package/raw-paste/CHANGELOG.md +7 -0
  123. package/raw-paste/README.md +52 -0
  124. package/raw-paste/index.ts +112 -0
  125. package/raw-paste/package.json +22 -0
  126. package/tab-status/CHANGELOG.md +4 -0
  127. package/tab-status/README.md +61 -0
  128. package/tab-status/assets/tab-status.png +0 -0
  129. package/tab-status/package.json +22 -0
  130. package/tab-status/tab-status.ts +179 -0
  131. package/usage-extension/CHANGELOG.md +17 -0
  132. package/usage-extension/README.md +120 -0
  133. package/usage-extension/index.ts +628 -0
  134. package/usage-extension/package.json +22 -0
  135. package/usage-extension/screenshot.png +0 -0
@@ -0,0 +1,96 @@
1
+ # Ralph Wiggum Extension
2
+
3
+ Long-running agent loops for iterative development. Best for long-running-tasks that are verifiable. Builds on Geoffrey Huntley's ralph-loop for Claude Code and adapts it for Pi.
4
+ This one is cool because:
5
+ - You can ask Pi and it will set up and run the loop all by itself in-session. If you prefer, it can also invoke another Pi via tmux
6
+ - You can have multiple parallel loops at once in the same repo (unlike OG ralph-wiggum)
7
+ - You can ask Pi to self-reflect at regular intervals so it doesn't mindlessly grind through wrong instructions (optional)
8
+
9
+ <img width="432" height="357" alt="Screenshot 2026-01-07 at 17 16 24" src="https://github.com/user-attachments/assets/68cdab11-76c6-4aed-9ea1-558cbb267ea6" />
10
+
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pi install npm:@tmustier/pi-ralph-wiggum
16
+ ```
17
+
18
+ ```bash
19
+ pi install git:github.com/tmustier/pi-extensions
20
+ ```
21
+
22
+ Then filter to just this extension in `~/.pi/agent/settings.json`:
23
+
24
+ ```json
25
+ {
26
+ "packages": [
27
+ {
28
+ "source": "git:github.com/tmustier/pi-extensions",
29
+ "extensions": ["ralph-wiggum/index.ts"],
30
+ "skills": ["ralph-wiggum/SKILL.md"]
31
+ }
32
+ ]
33
+ }
34
+ ```
35
+
36
+ ## Recommended usage: just ask Pi
37
+ You ask Pi to set up a ralph-wiggum loop.
38
+ - Pi sets up `.ralph/<name>.md` with goals and a checklist (like a list of features to build, errors to check, or files to refactor)
39
+ - You let Pi know:
40
+ 1. What the task is and completion / tests to run
41
+ 2. How many items to process per iteration
42
+ 3. How often to commit
43
+ 4. (optionally) After how many items it should take a step back and self-reflect
44
+ - Pi runs `ralph_start`, beginning iteration 1.
45
+ - It gets a prompt telling it to work on the task, update the task file, and call ralph_done when it finishes that iteration
46
+ - When the iteration is done, it calls `ralph_done`, resending the same prompt*
47
+ - Pi runs until either:
48
+ - All tasks are done (Pi sends `<promise>COMPLETE</promise>`)
49
+ - Max iterations (default 50)
50
+ - You hit `esc` (pausing the loop)
51
+ If you hit `esc`, you can run `/ralph-stop` to clear the loop. Alternatively, just tell Pi to continue to keep going.
52
+
53
+ ## Commands
54
+
55
+ | Command | Description |
56
+ |---------|-------------|
57
+ | `/ralph start <name\|path>` | Start a new loop |
58
+ | `/ralph resume <name>` | Resume a paused loop |
59
+ | `/ralph stop` | Pause current loop |
60
+ | `/ralph-stop` | Stop active loop (idle only) |
61
+ | `/ralph status` | Show all loops |
62
+ | `/ralph list --archived` | Show archived loops |
63
+ | `/ralph archive <name>` | Move loop to archive |
64
+ | `/ralph clean [--all]` | Clean completed loops |
65
+ | `/ralph cancel <name>` | Delete a loop |
66
+ | `/ralph nuke [--yes]` | Delete all .ralph data |
67
+
68
+ ### Options for start
69
+
70
+ | Option | Description |
71
+ |--------|-------------|
72
+ | `--max-iterations N` | Stop after N iterations (default 50) |
73
+ | `--items-per-iteration N` | Suggest N items per turn (prompt hint) |
74
+ | `--reflect-every N` | Reflect every N iterations |
75
+
76
+ ## Agent Tool
77
+
78
+ The agent can self-start loops using `ralph_start`:
79
+
80
+ ```
81
+ ralph_start({
82
+ name: "refactor-auth",
83
+ taskContent: "# Task\n\n## Checklist\n- [ ] Item 1",
84
+ maxIterations: 50,
85
+ itemsPerIteration: 3,
86
+ reflectEvery: 10
87
+ })
88
+ ```
89
+
90
+ ## Credits
91
+
92
+ Based on Geoffrey Huntley's Ralph Wiggum approach for long-running agent tasks.
93
+
94
+ ## Changelog
95
+
96
+ See `CHANGELOG.md`.
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: ralph-wiggum
3
+ description: Long-running iterative development loops with pacing control and verifiable progress. Use when tasks require multiple iterations, many discrete steps, or periodic reflection with clear checkpoints; avoid for simple one-shot tasks or quick fixes.
4
+ ---
5
+
6
+ # Ralph Wiggum - Long-Running Development Loops
7
+
8
+ Use the `ralph_start` tool to begin a loop:
9
+
10
+ ```
11
+ ralph_start({
12
+ name: "loop-name",
13
+ taskContent: "# Task\n\n## Goals\n- Goal 1\n\n## Checklist\n- [ ] Item 1\n- [ ] Item 2",
14
+ maxIterations: 50, // Default: 50
15
+ itemsPerIteration: 3, // Optional: suggest N items per turn
16
+ reflectEvery: 10 // Optional: reflect every N iterations
17
+ })
18
+ ```
19
+
20
+ ## Loop Behavior
21
+
22
+ 1. **Write the task file**: Create `.ralph/<name>.md` with the task content. The tool does NOT create this file—you must write it yourself using the Write tool.
23
+ 2. Work on the task and update the file each iteration.
24
+ 3. Record verification evidence (commands run, file paths, outputs) in the task file.
25
+ 4. Call `ralph_done` to proceed to the next iteration.
26
+ 5. Output `<promise>COMPLETE</promise>` when finished.
27
+ 6. Stop when complete or when max iterations is reached (default 50).
28
+
29
+ ## User Commands
30
+
31
+ - `/ralph start <name|path>` - Start a new loop.
32
+ - `/ralph resume <name>` - Resume loop.
33
+ - `/ralph stop` - Pause loop (when agent idle).
34
+ - `/ralph-stop` - Stop active loop (idle only).
35
+ - `/ralph status` - Show loops.
36
+ - `/ralph list --archived` - Show archived loops.
37
+ - `/ralph archive <name>` - Move loop to archive.
38
+ - `/ralph clean [--all]` - Clean completed loops.
39
+ - `/ralph cancel <name>` - Delete loop.
40
+ - `/ralph nuke [--yes]` - Delete all .ralph data.
41
+
42
+ Press ESC to interrupt streaming, send a normal message to resume, and run `/ralph-stop` when idle to end the loop.
43
+
44
+ ## Task File Format
45
+
46
+ ```markdown
47
+ # Task Title
48
+
49
+ Brief description.
50
+
51
+ ## Goals
52
+ - Goal 1
53
+ - Goal 2
54
+
55
+ ## Checklist
56
+ - [ ] Item 1
57
+ - [ ] Item 2
58
+ - [x] Completed item
59
+
60
+ ## Verification
61
+ - Evidence, commands run, or file paths
62
+
63
+ ## Notes
64
+ (Update with progress, decisions, blockers)
65
+ ```
66
+
67
+ ## Best Practices
68
+
69
+ 1. Write a clear checklist with discrete items.
70
+ 2. Update checklist and notes as you go.
71
+ 3. Capture verification evidence for completed items.
72
+ 4. Reflect when stuck to reassess approach.
73
+ 5. Output the completion marker only when truly done.