Skip to content

LirKonu/clay-campaign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

/clay-campaign

a claude code skill that builds clay workbooks for you from a prompt.

i used to click through clay for 20+ minutes to set up a workbook. now i do it in 90 seconds.


how it works

claude code = anthropic's cli. skills are workflows you trigger with a slash command (/clay-campaign).

this skill wraps an unofficial python sdk for clay's internal api (rex sdk). so no more ui clicks — a script builds the workbook for you and verifies everything is wired correctly.

what a run looks like

  1. you type /clay-campaign with a short description of what you want
  2. claude asks 8 questions — the same ones you'd run through in the ui anyway:
    • where does the data come from? (manual, webhook, csv import, lookup)
    • which columns/types in the input?
    • which enrichments and in what order?
    • logic (formulas, conditional gates, dedup)?
    • ai columns? (purpose, model, prompt sketch, which fields to inject)
    • where does the enriched data go? (sequencer, notion, sheets, nothing)
    • auto-run on or off? (default off — otherwise you burn credits during build)
    • sample rows to test?
  3. claude composes a python script with primitives: text_col, formula_col, webhook_source, ai, email_waterfall_clay, action, etc
  4. runs the script → workbook exists in clay
  5. verifies: every action has its required inputs, every ai prompt is non-empty (known silent escaping bug)
  6. gives you the clay url

if verify fails → the table still exists so you can inspect it in the ui, but the 'done' signal doesn't fire. fix the script, b.destroy(), re-run.


setup

  1. claude code installed (claude.ai/code)
  2. clone rex into ~/Documents/rex/, install its venv:
    cd ~/Documents
    git clone https://github.com/leszek-backpack/rex
    cd rex && python -m venv .venv && .venv/bin/pip install -r requirements.txt
  3. clay session cookie from devtools → drop into ~/Documents/rex/clay-session.json — rex repo has a COOKIE_SETUP.md walkthrough
  4. drop SKILL.md into .claude/skills/clay-campaign/ in whichever repo you use claude code from
  5. drop clay_builder.py into tools/clay/clay_builder.py (same repo) — this is the wrapper that calls rex
  6. update auth account ids in clay_builder.pyAUTH dict at the top is set to aa_REPLACE_ME placeholders. get yours via:
    from clay_client import ClayClient
    print(ClayClient().list_auth_accounts())
  7. run /clay-campaign

what to know

  • cookie expires every ~3 weeks — if calls 401, pull it from devtools again
  • rex is unofficial → gold for spinning up workbooks for yourself quickly. not for building a production-grade system. for prod-critical paths: n8n + clay's official export integrations
  • auth account ids in clay_builder.AUTH are workspace-specific. you need to fill in yours (see step 6 above)
  • prebuilt waterfalls: only work email is wired. for mobile phone / techstack / etc you have to capture the api call with rex's clay_browser.py and add it

files

  • SKILL.md — the skill definition. drop into .claude/skills/clay-campaign/
  • clay_builder.py — the python wrapper around rex sdk. drop into tools/clay/
  • README.md — this file

both SKILL.md and clay_builder.py are needed. the skill references the builder.


license

MIT. do whatever, no warranty. if you build something cool with it, let me know.

About

Claude Code skill that builds Clay workbooks from a prompt. Wraps the Rex SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages