agentleFS
MattSezginMattSezgin/unofficial-smartlead-cli/.claude/skills/clone-campaign/SKILL.md

clone-campaign

Skill8 starsChanged 6 months agoMITView on GitHub

Clone a Smartlead campaign by running the 6-step API recipe (Smartlead has no native clone endpoint). Creates a new campaign and copies schedule, settings, sequences, sender mailboxes, and optionally leads from the source. Use when the user wants to duplicate a campaign, run a V2/V3 of a winning campaign, or copy a campaign template to a new audience.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only if user asked for --with-leads.

    line 78
  2. Very specific:

    The clone is NOT atomic: If step 4 fails you have an orphan campaign with schedule+settings but no sequences.

    line 89
  3. Very specific:

    Lead records are shared across campaigns by email: If you copy leads, custom_fields from the source propagate to the new campaign too — see …

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/clone-campaign

Before running: verify exact flag names with smartlead campaigns <subcommand> --help. Flag shapes shown below are illustrative — confirm against the actual CLI.

You're cloning an existing campaign. Smartlead has no clone endpoint. Cloning is a 6-step sequence of real API calls. The CLI exposes each step as its own subcommand — chain them.

What you need from the user

  • Source campaign ID to copy from
  • New campaign name
  • Whether to also copy leads (default: NO — V2 usually wants a fresh audience)

The 6 steps

Step 1 — Create the new campaign shell

smartlead campaigns create --name "<new name>"

Capture the returned id as $NEW_ID. Subsequent steps need it.

Step 2 — Copy the schedule

Pull source:

smartlead campaigns get $SRC_ID --output json | jq '.scheduler'

Apply to new:

smartlead campaigns schedule $NEW_ID \
  --timezone "..." --days "..." \
  --start-hour "..." --end-hour "..." \
  --min-time-between-emails N --max-new-leads-per-day N

Step 3 — Copy the settings

Pull source settings, then POST to the new campaign:

smartlead campaigns settings $NEW_ID [flags from source]

⚠️ Translate field names before posting — see docs/learnings/settings-api-quirks.md:

  • DONT_EMAIL_OPEN → DONT_TRACK_EMAIL_OPEN
  • ai_categorisation_options labels → numeric IDs (1-7)
  • seq_delay_details.delayInDays → delay_in_days

Step 4 — Copy the sequences

Pull source sequences:

smartlead campaigns sequences $SRC_ID --output json

For each step, POST to the new campaign. The delayInDays → delay_in_days translation applies here too.

Step 5 — Assign sender mailboxes

Pull source assignments:

smartlead campaigns email-accounts $SRC_ID --output json

Then re-assign to new:

smartlead campaigns email-accounts $NEW_ID --add [ids from source]

Step 6 — Upload leads (optional)

Only if user asked for --with-leads. Usually skip — V2 wants a fresh audience.

If yes:

smartlead leads list $SRC_ID --output json > leads.json
# Convert to upload format, then:
smartlead leads add $NEW_ID --csv leads.csv

Important caveats

  • The clone is NOT atomic. If step 4 fails you have an orphan campaign with schedule+settings but no sequences. Decide whether to delete (smartlead campaigns delete $NEW_ID) or fix-forward.
  • Webhook configurations don't clone. Reattach manually with smartlead webhooks ... if the source has webhooks.
  • Lead records are shared across campaigns by email. If you copy leads, custom_fields from the source propagate to the new campaign too — see docs/learnings/campaign-cloning-runbook.md.
  • Always run smartlead campaigns get $NEW_ID after each step to verify state before moving on.

Reference

Full recipe with field translation details: docs/learnings/campaign-cloning-runbook.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.