Engineering

Write a one-off script to fix bad data

Ask Merlin in Slack for a script to fix bad data. It dry-runs it read-only, reports the rows it would change and opens a pull request for a person to run.

@Merlin from now on, when someone in #eng asks for a script to fix bad data, write it in acme/web and dry-run it against Supabase with read-only queries. Reply in the thread with how many rows it would change and a few examples, and open a pull request with the script. Never write to the database: a person reviews the pull request and runs the script.

#eng
Get started for free
  1. Starts whenAn engineer asks @Merlin in #eng for a script to fix rows a bug left wrong
  2. Merlin worksClaude Code or Codex writes the script, then dry-runs it with read-only queries in Supabase to find the rows it would change
  3. You getThe row count and a few examples in the thread, plus a pull request with the script. A person runs it

Tools

  • Slack
  • Supabase
  • GitHub

Capabilities

  • Integrations
  • Your agent's MCP

How it works

From rows a bug left wrong to a reviewed fix script and its dry run.

Mention @Merlin in #eng with what the bug got wrong and what the rows should say. Teammates can add rules in the thread.

Acme

Channels

general

eng

product

support-eng

data

finance

it-help

legal

Direct messages

Merlin

Hana

Tom

eng

24

MessagesAdd canvasFiles

Today

Hana11:20

@Merlin the invite bug fixed in acme/web#612 gave invited members the owner role between Oct 20 and 22. Can you write a script that sets them back to the role on their invite?

Message #eng

Before and after

A data fix is written, dry-run and reviewed before anyone touches production.

Without Merlin

An engineer writes the fix by hand, checks it against production carefully and pastes counts into Slack.

  1. 01Read the bug report
  2. 02Read the bug's fix
  3. 03Find the affected rows
  4. 04Exclude manual role changes
  5. 05Check a few rows by hand
  6. 06Write the fix script
  7. 07Add a dry-run mode
  8. 08Post the row count
  9. 09Open a pull request
  10. 10Ask someone to review it

With Merlin

One mention gets the script and its dry run, and a person still decides when it runs.

  1. @Merlin in #engAsked by the engineer in Slack
  2. Writes the script and dry-runs it on Hana's MacBookCodex with read-only Supabase
  3. Script pull request and the row countA person reviews and runs it

Setup

Add Merlin to #eng, then give the agent read-only Supabase.

Set these up once and anyone in the channel can ask for a data fix script. Merlin never writes to the database.

  1. 01Connect a machineRuntimeInstall the Merlin desktop app or CLI on a computer running Claude Code or Codex. You can also use a machine a teammate shares with your workspace.
  2. 02Add Merlin to SlackIntegrationsInstall the Slack app and add Merlin to the channel you work in. A private channel needs /invite @Merlin.
  3. 03Add Supabase to your agentYour agent's MCPConnect the Supabase MCP server to Claude Code or Codex on the machine that runs this. Its credentials stay on that machine.
  4. 04Install the GitHub appIntegrationsPick the repositories Merlin can access, so it can read and link the pull requests there. Pushes use the machine owner's own Git access.
  5. 05Keep your code on the machineRuntimeMerlin reads the code in a local project on the runtime, so keep the repository checked out there.
  6. 06Keep Supabase read-onlyYour agent's MCP

    Connect the Supabase MCP server in read-only mode and scope it to one project, so the dry run can query rows but never write them.

  7. 07Paste the setup promptGuidanceAn owner or admin sends the prompt below to @Merlin once, and it becomes workspace guidance for every future run.

Prompt

Tell Merlin how to handle data fix requests.

@Merlin from now on, when someone in #eng asks for a script to fix bad data, write it in acme/web and dry-run it against Supabase with read-only queries. Reply in the thread with how many rows it would change and a few examples, and open a pull request with the script. Never write to the database: a person reviews the pull request and runs the script.

#eng

Once, when you paste it

  1. PromptYou paste the prompt to @Merlin
  2. GuidanceMerlin saves your rules as workspace guidance

Every time someone mentions Merlin in Slack

  1. IntegrationThe Slack app spots the mention
  2. RuntimeMerlin picks an available machine
  3. ContextThe run gathers context
  4. WorkClaude Code or Codex writes the script and dry-runs it
  5. SteeringYour team steers the work in the thread
  6. ResultMerlin opens the pull request and reports the rows

Bring your coding agents into the tools your team already uses.

Let your whole team hand work to Claude Code and Codex today. Connect one machine and add Merlin to Slack, Linear or GitHub. 14-day free trial, no API keys, no card.