Skip to content

prism openai implementation guide

mirror any website and rebuild it with codex

No fluff — just the commands that work on macOS to download a live site, prep Codex context, and run the rebuild locally so you can ship updates fast.

start here

one folder that captures the live site

Every step keeps your local rebuild simple: download the current experience, extract the words that convert, and hand Codex a clean brief so the regenerated build matches what's live today.

goal

ship a portable snapshot

  1. 1Create a folder that includes the full download of the current site.
  2. 2Extract all readable text and sitemap clues Codex needs for context.
  3. 3Run Codex locally so the rebuilt Next.js project is ready to preview on localhost.

step 1

create a project folder

Keep everything in one spot so assets, text files, and Codex context stay organized.

cd ~/Desktop
mkdir site-rebuild && cd site-rebuild

step 2

download the entire website snapshot

Use wget to grab every reachable page and its assets directly to disk.

Install wget (if needed):

brew install wget

Download the live site:

The command below updates automatically with the URL you enter.

wget -r -l inf -p -E -k -nc https://example.com

Flags in plain English:

  • -r→ recursive crawl so linked pages come with it.
  • -l inf→ crawl depth stays open until links run out.
  • -p→ pulls required assets like images, styles, and scripts.
  • -E→ adds .html extensions so files open cleanly.
  • -k→ rewrites links for offline use.
  • -nc→ skips files you already downloaded.

Expected structure:

site-rebuild/
 ├── example.com/
 │    ├── index.html
 │    ├── about/
 │    ├── images/
 │    └── ...

step 3

pull the actual copy into plain text

Optional, but it helps Codex keep every headline and paragraph accurate.

Install ripgrep:

brew install ripgrep

Extract headings and paragraphs:

rg -o '<p>.*?</p>|<h[1-6]>.*?</h[1-6]>' ./example.com > all_text_raw.html

Strip the HTML tags:

sed -E 's/<[^>]+>//g' all_text_raw.html > all_text_raw.txt

Result: a clean all_text_raw.txt file ready for Codex context.

step 4

grab the sitemap (if one exists)

A live sitemap.xml gives Codex a definitive page list.

curl -O https://example.com/sitemap.xml

step 5

prep the codex context folder

Codex reads context from the .codex directory — keep instructions and source text here.

mkdir .codex

Add project instructions:

echo "Website rebuild project for https://example.com
- Use Next.js + Tailwind
- Keep copy identical to original
- Modernize layout only" > .codex/instructions.md

Copy extracted text for Codex:

cp all_text_raw.txt .codex/current-site.md

step 6

run codex locally

With context in place, let Codex generate the rebuild in a fresh Next.js project.

Export your OpenAI key first:

export OPENAI_API_KEY="your_api_key_here"

Ask Codex for the rebuild:

codex ask "Rebuild this website locally with the same text and structure using Next.js and Tailwind." \
  --with .codex/instructions.md .codex/current-site.md

Codex writes directly into the current folder — expect directories like pages/, components/, and public/.

step 7

preview the rebuilt site on localhost

Run the usual Next.js dev workflow and confirm the copy, layout, and routes match the original.

pnpm install
pnpm dev

Visit the local build:

http://localhost:3000

reference

folder layout when you’re done

Keep this snapshot intact — it's the fastest way to iterate on the rebuild, hand assets to teammates, or version control the work.

site-rebuild/
 ├── example.com/          ← downloaded site
 ├── all_text_raw.txt      ← readable copy for Codex
 ├── sitemap.xml           ← structure map (optional)
 ├── .codex/
 │    ├── instructions.md
 │    └── current-site.md
 ├── package.json          ← generated by Codex
 ├── pages/
 ├── components/
 └── public/

wrap up

seven moves, live rebuild

You now have a local mirror of the live site, Codex-ready context, and a running Next.js build on localhost. From here, you can modernize the design, iterate on copy, or push the rebuild into your repo.

next experiment

watch gpt-5.1 codex build a dentist site

We ran the Model Test Key from this guide through GPT-5.1 Codex (High) and documented the full run: generation time, UI polish, responsive behavior, sitemap completeness, and the live video breakdown.

  • speed5 minutes 16 seconds from prompt to exported files, captured end-to-end.
  • qualityDeep dive on gradients, icon styling, blog completeness, and mobile breakpoints.
  • schemaFull structured data plus transcript so you can mirror the benchmark exactly.