diff --git a/AGENTS.md b/AGENTS.md index a2d3fb645..1bcf3a380 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Overview -Ralph is an autonomous AI agent loop that runs Amp repeatedly until all PRD items are complete. Each iteration is a fresh Amp instance with clean context. +Ralph-tabnine is an autonomous AI agent loop that runs Tabnine CLI repeatedly until all PRD items are complete. Each iteration is a fresh Tabnine CLI instance with clean context. ## Commands @@ -19,8 +19,8 @@ cd flowchart && npm run build ## Key Files -- `ralph.sh` - The bash loop that spawns fresh Amp instances -- `prompt.md` - Instructions given to each Amp instance +- `ralph.sh` - The bash loop that spawns fresh Tabnine CLI instances +- `prompt.md` - Instructions given to each Tabnine CLI instance - `prd.json.example` - Example PRD format - `flowchart/` - Interactive React Flow diagram explaining how Ralph works @@ -37,7 +37,7 @@ npm run dev ## Patterns -- Each iteration spawns a fresh Amp instance with clean context +- Each iteration spawns a fresh Tabnine CLI instance with clean context - Memory persists via git history, `progress.txt`, and `prd.json` - Stories should be small enough to complete in one context window - Always update AGENTS.md with discovered patterns for future iterations diff --git a/README.md b/README.md index 67d98d16a..9fe30c8a2 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,21 @@ ![Ralph](ralph.webp) -Ralph is an autonomous AI agent loop that runs [Amp](https://ampcode.com) repeatedly until all PRD items are complete. Each iteration is a fresh Amp instance with clean context. Memory persists via git history, `progress.txt`, and `prd.json`. +Ralph is an autonomous AI agent loop that runs [Tabnine CLI](https://github.com/codota/tabnine-cli/) repeatedly until all PRD items are complete. Each iteration is a fresh Tabnine CLI instance with clean context. Memory persists via git history, `progress.txt`, and `prd.json`. -Based on [Geoffrey Huntley's Ralph pattern](https://ghuntley.com/ralph/). +Tabnine CLI is a Gemini-based AI coding assistant that provides similar capabilities to Anthropic's Claude. -[Read my in-depth article on how I use Ralph](https://x.com/ryancarson/status/2008548371712135632) +Based on [Geoffrey Huntley's Ralph pattern](https://ghuntley.com/ralph/). ## Prerequisites -- [Amp CLI](https://ampcode.com) installed and authenticated +- [Tabnine CLI](https://github.com/codota/tabnine-cli/) installed and authenticated - `jq` installed (`brew install jq` on macOS) - A git repository for your project ## Setup -### Option 1: Copy to your project +### Copy to your project Copy the ralph files into your project: @@ -28,46 +28,17 @@ cp /path/to/ralph/prompt.md scripts/ralph/ chmod +x scripts/ralph/ralph.sh ``` -### Option 2: Install skills globally - -Copy the skills to your Amp config for use across all projects: - -```bash -cp -r skills/prd ~/.config/amp/skills/ -cp -r skills/ralph ~/.config/amp/skills/ -``` - -### Configure Amp auto-handoff (recommended) - -Add to `~/.config/amp/settings.json`: - -```json -{ - "amp.experimental.autoHandoff": { "context": 90 } -} -``` - -This enables automatic handoff when context fills up, allowing Ralph to handle large stories that exceed a single context window. - ## Workflow ### 1. Create a PRD -Use the PRD skill to generate a detailed requirements document: +Create a detailed requirements document manually or with assistance from Tabnine CLI. See `skills/prd/SKILL.md` for guidelines on creating effective PRDs. -``` -Load the prd skill and create a PRD for [your feature description] -``` - -Answer the clarifying questions. The skill saves output to `tasks/prd-[feature-name].md`. +Save the PRD as `tasks/prd-[feature-name].md`. ### 2. Convert PRD to Ralph format -Use the Ralph skill to convert the markdown PRD to JSON: - -``` -Load the ralph skill and convert tasks/prd-[feature-name].md to prd.json -``` +Convert the markdown PRD to JSON format using the guidelines in `skills/ralph/SKILL.md`. You can ask Tabnine CLI to help with this conversion. This creates `prd.json` with user stories structured for autonomous execution. @@ -93,13 +64,13 @@ Ralph will: | File | Purpose | |------|---------| -| `ralph.sh` | The bash loop that spawns fresh Amp instances | -| `prompt.md` | Instructions given to each Amp instance | +| `ralph.sh` | The bash loop that spawns fresh Tabnine CLI instances | +| `prompt.md` | Instructions given to each Tabnine CLI instance | | `prd.json` | User stories with `passes` status (the task list) | | `prd.json.example` | Example PRD format for reference | | `progress.txt` | Append-only learnings for future iterations | -| `skills/prd/` | Skill for generating PRDs | -| `skills/ralph/` | Skill for converting PRDs to JSON | +| `skills/prd/` | Guidelines for creating PRDs | +| `skills/ralph/` | Guidelines for converting PRDs to JSON | | `flowchart/` | Interactive visualization of how Ralph works | ## Flowchart @@ -120,7 +91,7 @@ npm run dev ### Each Iteration = Fresh Context -Each iteration spawns a **new Amp instance** with clean context. The only memory between iterations is: +Each iteration spawns a **new Tabnine CLI instance** with clean context. The only memory between iterations is: - Git history (commits from previous iterations) - `progress.txt` (learnings and context) - `prd.json` (which stories are done) @@ -142,7 +113,7 @@ Too big (split these): ### AGENTS.md Updates Are Critical -After each iteration, Ralph updates the relevant `AGENTS.md` files with learnings. This is key because Amp automatically reads these files, so future iterations (and future human developers) benefit from discovered patterns, gotchas, and conventions. +After each iteration, Ralph updates the relevant `AGENTS.md` files with learnings. These files provide context for future iterations and human developers about discovered patterns, gotchas, and conventions. Examples of what to add to AGENTS.md: - Patterns discovered ("this codebase uses X for Y") @@ -158,7 +129,7 @@ Ralph only works if there are feedback loops: ### Browser Verification for UI Stories -Frontend stories must include "Verify in browser using dev-browser skill" in acceptance criteria. Ralph will use the dev-browser skill to navigate to the page, interact with the UI, and confirm changes work. +Frontend stories should include manual browser verification in acceptance criteria. After Ralph implements UI changes, verify the changes work as expected in the browser. ### Stop Condition @@ -193,4 +164,4 @@ Ralph automatically archives previous runs when you start a new feature (differe ## References - [Geoffrey Huntley's Ralph article](https://ghuntley.com/ralph/) -- [Amp documentation](https://ampcode.com/manual) +- [Tabnine CLI](https://github.com/codota/tabnine-cli/) diff --git a/flowchart/README.md b/flowchart/README.md index d2e77611f..272fb8dd2 100644 --- a/flowchart/README.md +++ b/flowchart/README.md @@ -1,73 +1,20 @@ -# React + TypeScript + Vite +# Ralph Flowchart -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +Interactive visualization showing how Ralph works with Tabnine CLI. -Currently, two official plugins are available: +Built with React Flow for presentations - click through to reveal each step with animations. -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +## Development -## React Compiler - -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). - -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked, - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +```bash +npm install +npm run dev ``` -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: +## Build -```js -// eslint.config.js -import reactX from 'eslint-plugin-react-x' -import reactDom from 'eslint-plugin-react-dom' - -export default defineConfig([ - globalIgnores(['dist']), - { - files: ['**/*.{ts,tsx}'], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs['recommended-typescript'], - // Enable lint rules for React DOM - reactDom.configs.recommended, - ], - languageOptions: { - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, - }, - // other options... - }, - }, -]) +```bash +npm run build ``` + +The build output goes to `dist/` and is deployed to GitHub Pages. \ No newline at end of file diff --git a/flowchart/index.html b/flowchart/index.html index 32eada16e..351cd02a2 100644 --- a/flowchart/index.html +++ b/flowchart/index.html @@ -4,7 +4,7 @@ - How Ralph Works with Amp + How Ralph Works with Tabnine CLI
diff --git a/flowchart/src/App.tsx b/flowchart/src/App.tsx index 422b5ba2c..ad46381ca 100644 --- a/flowchart/src/App.tsx +++ b/flowchart/src/App.tsx @@ -40,7 +40,7 @@ const allSteps: { id: string; label: string; description: string; phase: Phase } { id: '2', label: 'Convert to prd.json', description: 'Break into small user stories', phase: 'setup' }, { id: '3', label: 'Run ralph.sh', description: 'Starts the autonomous loop', phase: 'setup' }, // Loop phase - { id: '4', label: 'Amp picks a story', description: 'Finds next passes: false', phase: 'loop' }, + { id: '4', label: 'Tabnine CLI picks a story', description: 'Finds next passes: false', phase: 'loop' }, { id: '5', label: 'Implements it', description: 'Writes code, runs tests', phase: 'loop' }, { id: '6', label: 'Commits changes', description: 'If tests pass', phase: 'loop' }, { id: '7', label: 'Updates prd.json', description: 'Sets passes: true', phase: 'loop' }, @@ -325,7 +325,7 @@ function App() { return (
-

How Ralph Works with Amp

+

How Ralph Works with Tabnine CLI

Autonomous AI agent loop for completing PRDs

diff --git a/prd.json.example b/prd.json.example index fbc406681..7b04719f9 100644 --- a/prd.json.example +++ b/prd.json.example @@ -24,7 +24,7 @@ "Each task card shows colored priority badge (red=high, yellow=medium, gray=low)", "Priority visible without hovering or clicking", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 2, "passes": false, @@ -39,7 +39,7 @@ "Shows current priority as selected", "Saves immediately on selection change", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 3, "passes": false, @@ -54,7 +54,7 @@ "Filter persists in URL params", "Empty state message when no tasks match filter", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 4, "passes": false, diff --git a/prompt.md b/prompt.md index cdebe901d..b327f5705 100644 --- a/prompt.md +++ b/prompt.md @@ -20,7 +20,6 @@ You are an autonomous coding agent working on a software project. APPEND to progress.txt (never replace, always append): ``` ## [Date/Time] - [Story ID] -Thread: https://ampcode.com/threads/$AMP_CURRENT_THREAD_ID - What was implemented - Files changed - **Learnings for future iterations:** @@ -30,8 +29,6 @@ Thread: https://ampcode.com/threads/$AMP_CURRENT_THREAD_ID --- ``` -Include the thread URL so future iterations can use the `read_thread` tool to reference previous work if needed. - The learnings section is critical - it helps future iterations avoid repeating mistakes and understand the codebase better. ## Consolidate Patterns @@ -82,14 +79,9 @@ Only update AGENTS.md if you have **genuinely reusable knowledge** that would he ## Browser Testing (Required for Frontend Stories) -For any story that changes UI, you MUST verify it works in the browser: - -1. Load the `dev-browser` skill -2. Navigate to the relevant page -3. Verify the UI changes work as expected -4. Take a screenshot if helpful for the progress log +For any story that changes UI, you should manually verify it works in the browser after implementation. Document verification results in the progress log. -A frontend story is NOT complete until browser verification passes. +A frontend story is NOT complete until verification passes. ## Stop Condition diff --git a/ralph.sh b/ralph.sh index 677b120cb..eec761a80 100755 --- a/ralph.sh +++ b/ralph.sh @@ -59,8 +59,8 @@ for i in $(seq 1 $MAX_ITERATIONS); do echo " Ralph Iteration $i of $MAX_ITERATIONS" echo "═══════════════════════════════════════════════════════" - # Run amp with the ralph prompt - OUTPUT=$(cat "$SCRIPT_DIR/prompt.md" | amp --dangerously-allow-all 2>&1 | tee /dev/stderr) || true + # Run tabnine with the ralph prompt + OUTPUT=$(cat "$SCRIPT_DIR/prompt.md" | tabnine --yolo 2>&1 | tee /dev/stderr) || true # Check for completion signal if echo "$OUTPUT" | grep -q "COMPLETE"; then diff --git a/skills/prd/SKILL.md b/skills/prd/SKILL.md index 0e55eb1a6..66e3607e2 100644 --- a/skills/prd/SKILL.md +++ b/skills/prd/SKILL.md @@ -87,7 +87,7 @@ Each story should be small enough to implement in one focused session. **Important:** - Acceptance criteria must be verifiable, not vague. "Works correctly" is bad. "Button shows confirmation dialog before deleting" is good. -- **For any story with UI changes:** Always include "Verify in browser using dev-browser skill" as acceptance criteria. This ensures visual verification of frontend work. +- **For any story with UI changes:** Always include "Verify in browser" as acceptance criteria. This ensures visual verification of frontend work. ### 4. Functional Requirements Numbered list of specific functionalities: @@ -172,7 +172,7 @@ Add priority levels to tasks so users can focus on what matters most. Tasks can - [ ] Each task card shows colored priority badge (red=high, yellow=medium, gray=low) - [ ] Priority visible without hovering or clicking - [ ] Typecheck passes -- [ ] Verify in browser using dev-browser skill +- [ ] Verify in browser ### US-003: Add priority selector to task edit **Description:** As a user, I want to change a task's priority when editing it. @@ -182,7 +182,7 @@ Add priority levels to tasks so users can focus on what matters most. Tasks can - [ ] Shows current priority as selected - [ ] Saves immediately on selection change - [ ] Typecheck passes -- [ ] Verify in browser using dev-browser skill +- [ ] Verify in browser ### US-004: Filter tasks by priority **Description:** As a user, I want to filter the task list to see only high-priority items when I'm focused. @@ -192,7 +192,7 @@ Add priority levels to tasks so users can focus on what matters most. Tasks can - [ ] Filter persists in URL params - [ ] Empty state message when no tasks match filter - [ ] Typecheck passes -- [ ] Verify in browser using dev-browser skill +- [ ] Verify in browser ## Functional Requirements diff --git a/skills/ralph/SKILL.md b/skills/ralph/SKILL.md index c17043c68..abc06b077 100644 --- a/skills/ralph/SKILL.md +++ b/skills/ralph/SKILL.md @@ -108,10 +108,10 @@ For stories with testable logic, also include: ### For stories that change UI, also include: ``` -"Verify in browser using dev-browser skill" +"Verify in browser" ``` -Frontend stories are NOT complete until visually verified. Ralph will use the dev-browser skill to navigate to the page, interact with the UI, and confirm changes work. +Frontend stories are NOT complete until visually verified. After implementation, manually verify the changes work as expected in the browser. --- @@ -188,7 +188,7 @@ Add ability to mark tasks with different statuses. "Each task card shows colored status badge", "Badge colors: gray=pending, blue=in_progress, green=done", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 2, "passes": false, @@ -203,7 +203,7 @@ Add ability to mark tasks with different statuses. "Changing status saves immediately", "UI updates without page refresh", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 3, "passes": false, @@ -217,7 +217,7 @@ Add ability to mark tasks with different statuses. "Filter dropdown: All | Pending | In Progress | Done", "Filter persists in URL params", "Typecheck passes", - "Verify in browser using dev-browser skill" + "Verify in browser" ], "priority": 4, "passes": false,