Case study 01 · AI systems · Apr to Jul 2026

A pipeline that runs itself, and stops itself.

Problem

Unattended agents with API keys can publish junk or leak secrets.

Role

Sole builder: design, direction, review and operation.

Tools

CrewAI, Claude, Canva MCP, Shopify Admin API, SQLite.

Result

Seven of seven phases tested. Live publishing next.

The 30-second version

What I built, at a glance.

Business problem

A small online catalog needs research, design, and listing work every week. Done by hand, it does not scale. Handed to unattended AI agents with API keys, it risks junk listings, leaked credentials, and runaway API use.

Technical architecture

A scheduled loop on a VPS runs a six-agent CrewAI team on Claude for research and copy, Claude with Canva’s MCP server for design, and the Shopify Admin API for publishing. Two gates sit in the path: a credential check before any work and a validator before anything goes live.

Business value

The weekly catalog work runs without me, inside limits I set: a publishing cap, a cooldown, retry limits, and a daily report. Every step is logged, so a failure is diagnosable instead of silent. Live sales results come after the first month of publishing.

7/7pipeline phases built and tested
10/10automated tests passing
0secrets in the repository
5validation checks before a listing can publish

The problem

Running a small print-on-demand catalog means research, copywriting, design and listing work every week. Agents can do most of it, but an unattended agent with API keys can also publish junk, leak credentials or burn through rate limits overnight.

The goal was a pipeline that could run without me, and could be trusted to stop itself.

My role

I wrote the requirements, chose the stack and set every guardrail. Claude drafted the code against those requirements; I reviewed each change, ran the tests and decided what merged. I also operate it: the VPS, the credentials and the daily health report.

How it runs

It runs unattended on a VPS under systemd, cycling through build, design and maintain modes depending on publish limits and configured cooldowns.

  1. 1Brand strategybrand_guide.md
  2. 2Listing planmaster.txt
  3. 3Canva mockupsMockups/
  4. 3BCanva templatesmeta.json
  5. 4Build and validateReadyToUpload/
  6. 5PublishShopify Admin API
  7. 6SEO refreshtags + metafields
  8. 7Health reportdaily summary
$ pytest -v
collected 10 items
test_common.py::test_extract_checklist_parses_all_weeks PASSED
test_common.py::test_extract_checklist_raises_when_missing_weeks PASSED
test_db.py::test_init_db_creates_seo_review_audit_columns PASSED
test_db.py::test_insert_listing_migrates_legacy_table_and_stores_shopify_product_id PASSED
test_db.py::test_insert_seo_review_migrates_legacy_table_and_stores_audit_data PASSED
test_db.py::test_insert_seo_review_uses_empty_added_tags_for_gap_count PASSED
test_seo_analyzer.py::test_normalise_tags_strips_lowercases_dedupes_and_enforces_limits PASSED
test_seo_analyzer.py::test_build_optimised_tags_returns_clean_limited_tag_set PASSED
test_seo_analyzer.py::test_competitor_keywords_extracts_google_shopping_terms PASSED
test_seo_analyzer.py::test_analyze_applies_cleanup_only_tag_changes PASSED
10 passed in 0.13s
The test suite, run against the public repository in October 2026.

The guardrails

  • CredentialsAPI keys and OAuth tokens stay in .env; .env.example documents the variables without values.
  • Scanninggitleaks runs pre-commit and again in GitHub Actions on every pull request, with a pip-audit dependency check.
  • OAuthCanva tokens come from an OAuth PKCE setup script, Shopify credentials from a verified setup script; both checked at preflight.
  • ValidationTitle length, tag count, price range and asset readiness checked before any live publish.
  • ResilienceExponential backoff on rate limits and server errors; publish limits and cooldowns prevent burst automation.
  • OperationsSQLite tracks queue state, listings, run logs, SEO reviews and sales, so failures are diagnosable.

When it fails

Every failure has a defined outcome. The pipeline stops, waits or reports; it never guesses.

  • Bad credentialsPreflight checks Shopify, Canva and Anthropic before any work starts. If one fails, the loop exits and nothing runs.
  • Invalid listingThe validator writes the error to the run log and halts that product. Nothing reaches Shopify.
  • API errorsRate limits and server errors retry at 2, 4 and 8 seconds, honoring Retry-After. Five failures in a row open a circuit breaker for five minutes.
  • Runaway publishingA weekly cap and a 24-hour cooldown limit how much can go live. At the cap, the loop switches to SEO maintenance only.
  • Silent failuresErrors go to a separate log, and the daily health report flags any product stuck for more than 48 hours. I read that report and the daily email digest.

The tools

  • Python 3.12
  • CrewAI
  • Anthropic API
  • Canva remote MCP
  • Canva Connect API
  • Shopify Admin API
  • OAuth PKCE
  • Serper API
  • SQLite
  • gitleaks
  • pip-audit
  • GitHub Actions
  • Ubuntu VPS · systemd
  • Gmail SMTP digest

The results

Seven-phase pipeline
Built and tested
Automated tests
10 of 10 passing
Credential safeguards
In place
Preflight gate and publish limits
In place
Live publishing
Pending
Sales and SEO measurement
After the first month live

“The interesting engineering is not the AI. It is everything around it that makes the AI worth trusting.”

Next case studySOC brute-force detection lab →