A weekly Shopify conversion rate optimisation agent powered by Claude. Runs automatically every Monday via GitHub Actions. Pulls live store data, analyses your theme code, scores findings by ICE, synthesises a report, and sends a Slack/email digest.
First time here? Follow SETUP.md — a step-by-step walkthrough designed for an AI agent (or you) to work through from zero to first report. Once running, see VERSIONING.md for how to pin to a release tag and pull upstream improvements safely.
This project is an agentic AI tool — it makes real API calls, reads live store data, writes files, and can instruct a dev agent to open pull requests against your codebase.
By using this software you accept that:
- All AI-generated analysis, recommendations, and code is provided for informational purposes only. You are responsible for reviewing all outputs before acting on them.
- The authors accept no liability for decisions made based on agent output, including but not limited to: changes to your Shopify store, revenue impact, data exposure, or any other consequence of using this software.
- This software accesses your Shopify store data via API credentials you provide. You are responsible for securing those credentials and understanding what scopes you grant.
- No code generated by the dev agent should be merged or deployed without human review.
- This software is provided "as is" under the MIT License. See LICENSE.
This is experimental software. Use it with the same caution you would apply to any automated system that touches a production environment.
The agents in this system are read-only by design. See GUARDRAILS.md for the full breakdown. Short version:
- The CRO agent reads your store data and writes report files. It cannot push code or modify your theme.
- The dev agent writes Liquid files but has no git access. Branch creation, commits, and PRs are explicit workflow steps — not agent actions.
- PRs require human review before merge. Merging does not deploy to your live store.
- Enabling an experiment requires a second manual step: toggling a setting in the Shopify theme editor.
- GitHub Actions triggers every Monday at 8 AM AEST
- Agent reads
knowledge/— your hypotheses, playbook, and history of past findings - Pulls live Liquid theme files from Shopify via CLI (
shopify theme pull) - Fetches orders, abandoned checkouts, and product data from Shopify Admin API
- Fetches sessions and conversion rate from Shopify GraphQL Analytics API
- Scores all findings using ICE framework
- Calls Claude API to synthesise a structured report
- Commits the report to
reports/DD-MM-YYYY.mdand updatesknowledge/history.md - Sends Slack message and/or email digest
git clone https://github.com/YOUR_USERNAME/shopify-cro-agent.git
cd shopify-cro-agentInstall uv if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | shThen install dependencies:
uv synccp .env.example .envOpen .env and fill in:
| Key | Where to find it |
|---|---|
SHOPIFY_SHOP_URL |
Your .myshopify.com domain |
SHOPIFY_ACCESS_TOKEN |
Shopify Admin → Apps → Develop apps → Create app → Admin API |
THEME_DIR |
Local path to your downloaded theme (via shopify theme pull) |
ANTHROPIC_API_KEY |
console.anthropic.com |
SLACK_WEBHOOK_URL |
Slack → Apps → Incoming Webhooks |
| SMTP keys | Your email provider's SMTP settings |
Shopify API scopes required (set when creating your custom app):
| Scope | Why the agent needs it |
|---|---|
read_orders |
AOV, revenue, refund rate, repeat customer rate, discount usage |
read_checkouts |
Abandoned checkout count for cart abandonment rate |
read_products |
Flag thin descriptions, few images, out-of-stock variants |
read_customers |
Identify repeat customers for retention metrics |
read_analytics |
Sessions + CVR via GraphQL — powers the core conversion metrics |
read_themes |
Only needed for GitHub Actions to auto-pull theme files via Shopify CLI |
Only grant READ scopes. The agent is strictly read-only. Do not enable any
write_*scope — it creates unnecessary risk for zero benefit. See.env.examplefor the full setup walkthrough.
Finding your theme ID: Shopify Admin → Online Store → Themes → ⋯ (Actions) → Edit code. The number in the URL is your theme ID.
Dry run (no API calls, no notifications):
uv run python scripts/run_agent.py --weekly --dry-runFull local run:
uv run python scripts/run_agent.py --weeklyGo to your repo → Settings → Secrets and variables → Actions → New repository secret
Add one secret for each key in .env.example:
SHOPIFY_SHOP_URLSHOPIFY_ACCESS_TOKENSHOPIFY_API_VERSIONSHOPIFY_THEME_IDSHOPIFY_THEME_REPO— e.g.your-org/shopify-themeTHEME_REPO_PAT— GitHub PAT withreposcope on your theme repo (for dev agent PRs)ANTHROPIC_API_KEYSLACK_WEBHOOK_URLSMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS,NOTIFY_EMAIL
Note:
THEME_REPO_PATis only needed if you use the dev agent (implement-experiment workflow). The weekly CRO scan does not require it.
Go to Settings → Actions → General → Workflow permissions Select Read and write permissions so the agent can commit reports back to the repo.
Go to Actions → Weekly CRO Scan → Run workflow to test before the first Monday.
Open this repo in Claude Code for ad-hoc analysis:
cd shopify-cro-agent
claudeClaude Code will automatically read CLAUDE.md. Then prompt naturally:
Focus on cart drop-off. Read the knowledge base and dig into the API data
and theme files for anything relevant to checkout friction.
I've added three new hypotheses to hypotheses.md. Re-run analysis focused
on those areas. Update playbook.md if you find signals worth tracking permanently.
Read history.md. Which findings have appeared more than twice and are still
marked Ongoing? What's getting stuck?
| File | Who updates it | When |
|---|---|---|
knowledge/hypotheses.md |
You | Whenever you have a new hunch |
knowledge/playbook.md |
You or the agent | When new signals worth tracking are discovered |
knowledge/history.md |
Agent (auto) | After every run — you add "Actioned" notes manually |
reports/ |
Agent (auto) | Each Monday |
The agent tracks win rates by experiment type and surfaces strategic observations in every report. After a few experiments complete, you'll see output like:
Strategy pulse:
social_proofexperiments have a 3/3 win rate (100%) but only 2 are currently active out of 11 suggested. This is your highest-ROI underutilised strategy. Meanwhilevisualhas 6 experiments suggested and 1/3 winners (33%) — consider pausing the backlog and runningsocial_proofexperiments first.
The agent is deliberately opinionated here. The data is in knowledge/insights.md.
Every experiment suggestion includes a zone (which part of the page it affects) and a test mode (solo / concurrent / sequential).
- Solo: run this alone — it shares a zone with another active test
- Concurrent: safe to run alongside other active experiments in different zones
- Sequential: run only after a specific preceding experiment concludes
The agent also checks your current session volume and flags if a proposed multivariate
test is underpowered. Full methodology is in knowledge/playbook.md.
Once the CRO agent identifies an experiment worth implementing, you can spawn a dev agent to write the Liquid code and open a PR — without writing a line of code yourself.
This project is an agentic AI tool — it makes real API calls, reads live store data, writes files, and can instruct a dev agent to open pull requests against your codebase.
By using this software you accept that:
- All AI-generated analysis, recommendations, and code is provided for informational purposes only. You are responsible for reviewing all outputs before acting on them.
- The authors accept no liability for decisions made based on agent output, including but not limited to: changes to your Shopify store, revenue impact, data exposure, or any other consequence of using this software.
- This software accesses your Shopify store data via API credentials you provide. You are responsible for securing those credentials and understanding what scopes you grant.
- No code generated by the dev agent should be merged or deployed without human review.
- This software is provided "as is" under the MIT License. See LICENSE.
This is experimental software. Use it with the same caution you would apply to any automated system that touches a production environment.
The agents in this system are read-only by design. See GUARDRAILS.md for the full breakdown. Short version:
- The CRO agent reads your store data and writes report files. It cannot push code or modify your theme.
- The dev agent writes Liquid files but has no git access. Branch creation, commits, and PRs are explicit workflow steps — not agent actions.
- PRs require human review before merge. Merging does not deploy to your live store.
- Enabling an experiment requires a second manual step: toggling a setting in the Shopify theme editor.
- CRO agent (or you) writes a handoff spec to
dev-agent/handoffs/DD-MM-YYYY-[id].mdusing the template indev-agent/handoff-template.md - Go to Actions → Implement Experiment (Dev Agent) → Run workflow
- Enter the handoff filename
- The dev agent pulls the live theme, reads the spec, writes the code change (gated behind a theme schema toggle), and opens a PR
- You review the PR — nothing is deployed until you merge
The human gate is the PR. The dev agent cannot merge, cannot deploy, cannot change live theme settings. It can only write code and open a pull request.
# Write your handoff spec first
cp dev-agent/handoff-template.md dev-agent/handoffs/16-04-2026-pdp-17.md
# Edit it with the experiment details
# Then run Claude Code scoped to the dev agent
cd shopify-cro-agent
claude --dangerously-skip-permissions \
-p "Read dev-agent/CLAUDE.md for your instructions. Then read dev-agent/handoffs/16-04-2026-pdp-17.md and implement it."shopify-cro-agent/
├── CLAUDE.md # Agent identity — read automatically by Claude Code
├── pyproject.toml # Dependencies (uv)
├── .env.example # Environment variable template
├── .gitignore
├── knowledge/
│ ├── hypotheses.md # Your CRO theories
│ ├── playbook.md # Methodology and benchmarks
│ ├── history.md # Auto-updated findings log
│ └── insights.md # Strategy pattern analysis and win rates
├── reports/
│ └── DD-MM-YYYY.md # Weekly reports (committed by agent)
├── scripts/
│ ├── run_agent.py # Master orchestrator
│ ├── fetch_shopify.py # Shopify Admin API fetcher
│ ├── analyse_theme.py # Liquid theme CRO checker
│ ├── score.py # ICE scoring
│ └── notify.py # Slack + email notifications
├── dev-agent/
│ ├── CLAUDE.md # Dev agent identity — read by Claude Code
│ ├── handoff-template.md # Template for CRO→dev handoff specs
│ └── handoffs/ # Specs written by CRO agent, read by dev agent
└── .github/
└── workflows/
├── weekly-scan.yml # GitHub Actions — weekly CRO scan
└── implement-experiment.yml # GitHub Actions — dev agent PR workflow