Prism is a Chrome extension plus local AI style engine for changing live webpages with AI-assisted DOM patches. The project is not production-ready yet, but this version is a much better foundation than the original prototype: the main flow now works end to end, the UI is cleaner, style templates provide visual design presets, and users can point the AI at exact page elements by clicking them.
We successfully completed the current rebuild steps:
- Style templates are available through
/api/v1/modesas visual design presets. - The popup can fetch and apply visual style templates such as Modern, Futuristic, Cartoon, and Solarpunk.
- Users can click page elements, reference them in the prompt, and ask the AI to modify those exact elements.
- Element selection now supports deselection and does not duplicate the same element.
- Saves/history are available in the popup, with restore and delete actions.
- The popup UI was improved with a slide-out detail pane for saves and style templates.
- Page outputs are cached locally so the extension can re-apply saved changes.
This is still an active development build. It is not ready for production distribution, but it is now a better and more practical version of the product direction.
Prism lets a user open the extension on a webpage, write a prompt, optionally choose a style template, and generate changes for the current page.
The important workflow is:
- Open a normal webpage.
- Open the Prism extension.
- Optionally click
Pickand select elements on the page. - Write a prompt that references selected elements, for example:
make 'element1' look like a floating glass card. - Choose a style template if useful.
- Generate the change.
- Restore or delete saved versions from the popup.
This example selects the GitHub profile avatar as 'element1' and asks Prism:
please remove 'element1'?
| Before | After |
|---|---|
![]() |
![]() |
Style templates are visual design presets. The extension fetches the available style templates from:
GET /api/v1/modes
Style-template prompt files are stored here:
backend/app/prompts/modes/
Current examples include:
modern.mdfuturistic.mdcartoon.mdsolarpunk.md
This makes visual presets easy to change without rebuilding the extension. The popup only sends the selected style-template key; the processing layer resolves the actual instruction.
Prism can reference exact page elements. When the user clicks Pick, the content script overlays the page and records rich metadata for selected elements:
- stable selector candidates
- DOM path
- visible text
- tag name, id, classes, data attributes, and useful attributes
- bounding box and visual position
- selected computed styles
- nearby DOM context
- a fingerprint used for matching and deselection
The selected element becomes a prompt token such as:
'element1'
That token is stored with the element metadata and sent to the backend. This lets the model understand that the user is talking about a specific live element, not a vague region of the page.
The expensive naive approach is to send a model the raw HTML of a page and ask it to return a modified full document. In quick tests, that can cost roughly $0.30 to $1.00 per generation with a small model, depending on page size and output length.
Prism uses a cheaper patch-oriented flow:
- The extension captures the live post-JavaScript DOM from the current page.
- The backend builds an anchored DOM representation instead of sending raw HTML directly.
- The backend assigns stable internal anchors and selector candidates to elements.
- The skeletonizer keeps meaningful structure, text, attributes, nearby context, and layout hints while collapsing repetitive sibling runs and pruning deep subtrees.
- Selected element metadata is sent alongside the compact skeleton, so exact user targets stay visible to the model.
- The model is asked to emit small patch operations, CSS variable changes, and CSS rules instead of a full HTML rewrite.
- The extension applies those patches to the live DOM and caches the result.
In other words, the LLM does not need to read every raw byte and then rewrite the entire page. It sees a compact, anchored, purpose-built view of the DOM and returns intent-level edits. That is the main reason the system can get good results with much less input and output.
In first-look testing, this brought many page generations below $0.01 while using a model like gpt-5.4-nano. The exact benchmark is not point-accurate yet; it was a quick initial measurement. A real benchmark with logged usage, output quality, and apples-to-apples model comparisons still needs to be built.
The bigger result is not only cost. The exciting part is that the compact representation lets a very small model do useful webpage edits. Everyone can switch the backend model through environment configuration, but for many current cases nano-level models are already doing the job.
There are still many changes that can improve both quality and cost. This area is actively being worked on.
Right now Prism modifies one page at a time. That is useful for testing and for focused edits, but it is not enough for every real website workflow.
The next major product problem is full website coverage:
- editing consistent styles across multiple pages
- understanding shared layouts and components
- applying changes site-wide instead of only page-by-page
- keeping cost low while doing that
The next direction is to design a cheap method for whole-website modification without blindly sending every page's full HTML to the model.
git clone https://github.com/5en5e1/prism.git
cd prismcd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envEdit backend/.env and set:
OPENAI_API_KEY=your_api_key_here
OPENAI_DEFAULT_MODEL=gpt-5.4-nano
You can use another model if you want. The backend owns the model choice.
From the backend directory:
python -m uvicorn app.main:app --reload --host 127.0.0.1 --port 8000The extension expects the backend at:
http://127.0.0.1:8000
- Open Chrome.
- Go to
chrome://extensions. - Enable Developer Mode.
- Click
Load unpacked. - Select the
prism-extensionfolder.
- Open a normal
httporhttpswebpage. - Click the Prism extension icon.
- Write a prompt.
- Optionally choose a style template.
- Optionally use
Pickto select exact page elements. - Click
Generate.
Generated saves appear in the popup. Cached webpages can be reviewed and cleared from the options page.
Backend routes used by the extension:
/api/v1/health/api/v1/modes/api/v1/process
Important extension files:
prism-extension/popup/popup.htmlprism-extension/popup/popup.cssprism-extension/popup/popup.jsprism-extension/src/content.jsprism-extension/src/background.jsprism-extension/options/options.html
Important backend files:
backend/app/api/v1/routes.pybackend/app/handlers/dom_manipulation.pybackend/app/preprocessing/anchor_skeleton.pybackend/app/preprocessing/id_anchoring.pybackend/app/preprocessing/patch_applier.pybackend/app/prompts/modes/
- Add usage metrics.
- Estimate cost per generation in the UI or logs.
- Log every generation result.
- Store model, token, prompt, patch, and quality metadata for each run.
- Create a real cost comparison benchmark.
- Compare raw-HTML prompting against Prism's anchored skeleton and patch flow.
- Benchmark multiple models, including nano-level models and larger models.
- Improve output quality while keeping generation cost low.
- Design full website coverage so Prism can modify a whole site, not only one page at a time.
Prism is licensed under the MIT License. See LICENSE.

