# The Viral Remake Machine: full setup guide

This is the system from the reel. It's how I pick every reel I film. Once a week it pulls the top posts in my niche, ranks them by **comments**, and breaks every one into **the hook, the beats and the CTA**. Then it writes my version. So I'm not guessing what works, I'm reading it.

> **Want this running for you instead?** My team builds done-for-you AI second brains: research loops like this one, your notes, your tools, all wired together. **[Book a call with my team](https://qwavelabs.io/book)**

It isn't a chatbot you ask for content ideas. It's **four pieces** that hand off to each other:

```
[1 PULL: Instagram's official API] → [2 TRANSCRIBE: on your laptop] → [3 BREAK DOWN: your AI, shot by shot] → [4 WRITE: your version]
```

You're getting the whole thing:

| File | What it is |
|---|---|
| `00-README.md` | This guide. Start here. |
| `fetch.py` | **The fetch script.** Pulls your creators' recent public posts through Instagram's official Graph API. No scraping, no logins. |
| `rank.py` | Ranks every post by comments (not likes) and spots the "comment KEYWORD" CTA |
| `breakdown.py` | **The breakdown script.** Downloads one post, transcribes it word for word on your computer, and pulls keyframes + scene cuts so your AI can see every shot |
| `ANALYZE.md` | **The playbook your AI follows** to score each post and break it down beat by beat |
| `REMAKE-SPEC.md` | **The remake spec.** What every one of your versions must contain |
| `creators.md` | **Your creator list.** A template to fill in |

**You don't need to code any of this.** You hand the folder to your AI, tell it your niche, and it sets the whole thing up around your creators, not mine.

---

## The 5-minute version (recommended)

1. Install **Claude Code** (or Codex, or any AI agent that can run code on your computer).
2. Download `remake-machine.zip` from /tools/remake and unzip it. You get a `remake-machine/` folder with all seven files.
3. Open your agent in that folder and paste this. Fill in the brackets:

```
You're my content research agent. Read 00-README.md and set this whole system up for me.

MY NICHE: I make content about [topic] for [who it's for].
MY CREATORS: [5-15 Instagram handles: a few my size, a few big ones in my niche,
1-2 outside my niche whose format I like].
WHAT I GIVE AWAY: [the guide / template / setup I DM when people comment].

Do this as a checklist, end to end:

1. SETUP: fill in creators.md and the niche line at the top of ANALYZE.md.
   Then walk me through getting my IG_USER_ID and IG_ACCESS_TOKEN one click at a time.
   I'll set them in my terminal myself. Never ask me to paste the token into chat.

2. PULL: run fetch.py, then rank.py --top 40. Show me the top 10 by comments,
   and flag which ones use a "comment KEYWORD" CTA.

3. TRANSCRIBE: for the top 10, run breakdown.py on each one.

4. BREAK DOWN: follow ANALYZE.md. Score each post 1-10 for MY niche. For every 7+,
   look at the frames (don't guess from the caption) and give me the verbatim hook,
   the hook style, every beat with timestamps and what's on screen, and the CTA mechanic
   (comment WORD → DM what). One line on why it worked.

5. WRITE: pick the best 5 and write my version of each following REMAKE-SPEC.md:
   shot list, teleprompter script, caption, and a draft of the thing I'd DM.

GUARDRAILS: Read-only on Instagram. Never like, comment, follow, DM or post anything.
Remake the structure, never the words. Never invent a number, a result or a tool I
don't use. Mark anything you can't verify as [CONFIRM]. I approve everything before I film.
```

It'll take it from there, including editing the niche line in `ANALYZE.md` and filling `creators.md` for you.

---

## What it looks like filled in (a real run)

Niche: *AI systems for running your life and business.* One run, and it:

- **Pulled + ranked:** the posts in my creator list with the most comments. Most of the top ones were "comment KEYWORD" reels. That's the signal: thousands of comments on a keyword is a proven offer, not just a pretty video.
- **Broke one down:** a ~30-second talking-head reel. Hook: *"You can now get [thing] for completely free."* Then three short beats (what it is → how it works → the one detail people screenshot), then *"comment WORD"* → DM a link plus a soft pitch.
- **Wrote my version:** same hook pattern, same beat count, same CTA mechanic, my own stack. That became my **COACH** reel: a free AI accountability coach, three notes, one prompt, two check-ins a day.

Pull → transcribe → break down → write. One run a week, and I know exactly what to film before I hit record.

---

## What it costs to run

- **Instagram Graph API:** free. It's Meta's own official API.
- **Transcription + keyframes:** free. Runs on your laptop (faster-whisper + ffmpeg).
- **The breakdown + scripts:** done inside the AI subscription you already pay for. No extra API key.

Realistic total: **nothing extra** if you already pay for an AI subscription.

## What you need installed

| Thing | Why | How |
|---|---|---|
| **Python 3.10+** | runs the three scripts | python.org, or `brew install python` |
| **ffmpeg** | pulls keyframes + audio | `brew install ffmpeg` · `sudo apt install ffmpeg` · `winget install Gyan.FFmpeg` |
| **faster-whisper** | the transcriber (runs locally; the first run downloads a ~500 MB model once) | `pip install faster-whisper` |
| **yt-dlp** | downloads the reel when the API doesn't hand over the video file (common for other people's reels) | `pip install yt-dlp` |
| **Claude Code or Codex** | does the breakdown + writing | claude.com/claude-code · or Codex |

`fetch.py` and `rank.py` only use Python's standard library. Nothing to install for those.

**Environment variables** (only `fetch.py` needs them; `breakdown.py` uses them if they're set):

| Variable | What it is |
|---|---|
| `IG_USER_ID` | your Instagram professional account's ID (the 1784… number) |
| `IG_ACCESS_TOKEN` | a Meta access token with `instagram_basic` + `pages_show_list` (+ `business_management` if your Page sits in a Business Manager) |

Every script has `--help`. Check your setup any time with `python3 fetch.py --check`.

## The two things you need (one time, about 20-30 min)

1. **An Instagram professional account** (Creator or Business, free to switch in the app) **connected to a Facebook Page.**
2. **A Meta app + access token:** at developers.facebook.com create an app → add the Instagram Graph API → generate a token with `instagram_basic` and `pages_show_list` → find your IG user ID (`GET /me/accounts?fields=instagram_business_account`).

Then set them in your terminal (your agent can add them to your shell profile so they stick):

```bash
export IG_USER_ID="1784xxxxxxxxxxxx"
export IG_ACCESS_TOKEN="your-token"
```

**Never paste the token into a chat, a shared file or a screenshot.** The scripts never print it.

**Limits:** the API only reads **professional** accounts (most creators are), and it's rate-limited, so 10-20 creators per run is the sweet spot.

## Manual setup (if you'd rather drive)

1. Fill in `creators.md`: one row per creator, `Active = yes` for the ones to track.
2. Replace the niche line at the top of `ANALYZE.md` with what you actually make content about.
3. Install the tools and run the scripts:

```bash
pip install faster-whisper yt-dlp   # + ffmpeg (see the table above)
python3 fetch.py --check            # confirms your token + ID work
python3 fetch.py                    # every Active creator → raw/
python3 rank.py --top 40            # → ranked.md (sorted by comments)
python3 breakdown.py https://www.instagram.com/reel/XXXX/   # per post → posts/<handle>-<id>/
```

`breakdown.py` options: `--file video.mp4` uses a reel you already saved (handy if a download fails), `--model base.en` is faster on older laptops, and `--no-transcribe` does frames only.

4. Tell your AI: **"Follow ANALYZE.md for the top 10 in ranked.md."**
5. Then: **"Write remakes for the best 5 following REMAKE-SPEC.md."** Each one lands in `remakes/` with a shot list, `teleprompter.txt`, a caption and the DM deliverable drafted.

## The weekly rhythm

Once a week: fetch → rank, skim `ranked.md` (5 minutes). Pick 3-6 you can film in one sitting. Batch film from the teleprompter files. That's the point: **you stop scrolling reels and start reading patterns.**

**This is where the DIY gets heavy:** tokens that expire, scheduling, wiring the output into your notes and your content calendar. If you'd rather have it built and running, my team does that. **[Book a call with my team](https://qwavelabs.io/book)**

Want it hands-off? Ask your agent to schedule `fetch.py` + `rank.py` weekly (launchd or cron on Mac, Task Scheduler on Windows). Mine runs on an always-on Mac, so the ranked list is waiting for me when I sit down to plan.

## Fair-use notes (read this once)

- This is **research**, not a repost kit. You're studying hooks, structures and CTA mechanics, not republishing anyone's videos or transcripts.
- **Remake the structure, not the words.** Same hook pattern, same beats, your story, your tools, your numbers.
- **Read-only.** Nothing here likes, comments, follows or DMs. Never automate that.
- The downloaded videos in `posts/` are working files. Delete them once a post is broken down; keep the notes.

## Troubleshooting

- **"Missing IG_ACCESS_TOKEN"**: the export lines aren't in your current terminal. Re-run them, or have your agent add them to your shell profile.
- **A creator errors out**: it's a personal account (the API can't read those) or the handle is wrong. Flip it to `no` in `creators.md`.
- **Token stopped working**: short-lived tokens expire in about an hour. Ask your agent to walk you through making a long-lived one.
- **"yt-dlp not found" or the download fails**: `pip install yt-dlp`. If it still fails, save the reel yourself and run `python3 breakdown.py URL --file the-reel.mp4`.
- **Transcript looks garbled**: music under the voice. Rerun with `--model medium.en` (slower, more accurate).
- **Empty transcript**: some reels are music only. Your AI can still break them down from the frames and the caption.
- Anything else: paste the error into your AI. It has every file, so it can fix its own plumbing.

---

- Bonus: want your AI to **edit** the reel too (best take per line, cut dead air, captions)? Download that skill too: /tools/remake/reel-edit-skill.zip

## Want us to build it for you?

This kit is one loop from the AI second brain I run my business on.

**Who it's for:** founders, creators and small teams who want AI systems that actually run (research, content, notes, follow-ups) without spending weekends wiring them up.

**What you get:** my team builds your AI second brain with you:
- one organized home for your notes, calls, people and projects, so your AI knows your business
- your AI connected to the tools you already use, with approval rules so nothing posts or sends without your OK
- loops like this one, set up around your niche and running on a schedule
- a walkthrough so you know exactly how to run it

**What happens on the call:** we look at how you work today, where things live and what eats your week, and I tell you what I'd build first. If it's a fit, we map out the build. If it's not, you still leave with the plan.

**→ [Book a call with my team](https://qwavelabs.io/book)**
