Built in 5 hours and selected as a finalist at Cursor’s DC Hackathon. View the Devpost here.
Prism is a GitHub App that automatically spins up live preview environments for pull requests using Daytona sandboxes.
When a PR is opened:
- A sandbox is created with the PR branch.
- A preview URL is posted as a PR comment.
- Reviewers get a live app with React-Grab enabled.
- They click any element, describe a change (e.g., "make this button blue"), and hit Apply.
- OpenCode edits the source, commits to the PR branch, and pushes.
- The preview updates instantly via HMR.
- The new commit appears on the PR, all without leaving the browser.
- Listens for:
pull_request.openedpull_request.synchronize
- Calls the Daytona API to create a workspace
- Posts the preview URL as a PR comment
- Stores workspace ID per PR for cleanup on close/merge
Workspace configuration:
- Clones the PR branch
- Runs
npm install - Starts the dev server
- Exposes:
- Port 3000 → App preview
- Port 4000 → API bridge
- Runs OpenCode inside the sandbox
Integrated into the Next.js app in development mode:
- Floating panel UI
- Displays:
- Selected element
- Source file + line number
- Change input field
- Apply sends the edit request to the OpenCode bridge
Next.js API route that:
-
Receives:
{ "file": "...", "line": 42, "change": "..." } -
Calls the OpenCode TypeScript SDK to edit the file
-
Stages and commits with:
[PR Preview] {description} -
Pushes to the PR branch
-
Returns success + commit SHA to the UI
- Live preview environments per PR
- In-browser UI-driven code edits
- Automatic commits to the PR branch
- Real-time feedback via HMR