DEV Community

Quinn
Quinn

Posted on

I Built an AI Crochet Pattern Engine Using Browser Agents (Debugg.ai + Claude Code + OpenAI) for my Sister

Most people think browser agents are for QA, scraping, or growth automation.

I wanted to test something weirder:

Can you fully automate a creative, messy, human workflow like crocheting?

Turns out β€” yes. And it’s a perfect stress test for agent reliability.


🧠 The Idea

Crochet patterns are essentially programs written for humans:

  • Step-by-step instructions
  • Stateful execution (you can’t skip rows)
  • Error-prone (one missed stitch breaks everything)
  • Inconsistent formatting across the internet

This makes them ideal for testing agentic workflows over real UIs.

To ground this, I used real-world pattern flows from sites like the one I built for my sister:
πŸ‘‰ Crochets.site Crocheting Page

There are many types of general resources sites that provide structured + semi-structured patterns, materials, and UI interactions β€” perfect for agent testing.


πŸ—οΈ System Architecture

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Surfs.dev Agents   β”‚
                β”‚ (browser execution)  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                 β”‚                 β”‚
        β–Ό                 β–Ό                 β–Ό
 Pattern Sites     Pattern Editor UI   Test Runner (Debugg.ai)
 (scraping)         (Next.js app)        (validation layer)

        β”‚
        β–Ό
   OpenAI / Claude
 (parsing + generation)

        β”‚
        β–Ό
 Structured Pattern JSON
Enter fullscreen mode Exit fullscreen mode

πŸ” Step 1: Scraping Real Patterns

Using Surfs.dev agents (real browser sessions), I:

  • Navigate crochet sites
  • Extract rows, stitch counts, materials
  • Handle messy UI (expandable notes, dynamic sections)

Why not traditional scraping?

Because most pattern sites:

  • Aren’t clean HTML
  • Require interaction
  • Break easily

Browser agents solve this.


🧩 Step 2: Structuring with LLMs

Raw pattern example:

Row 3: Ch 1, *sc in next st, inc; rep from * around. (18 sts)
Enter fullscreen mode Exit fullscreen mode

Converted into structured JSON:

{
  "row": 3,
  "stitches": 18,
  "instructions": [
    { "type": "sc", "count": 1 },
    { "type": "inc", "repeat": true }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Model Roles

  • OpenAI β†’ deterministic parsing + schema output
  • Claude Code β†’ reasoning, cleanup, transformations

πŸͺ„ Step 3: Generating Variations

Once structured, patterns become programmable.

Examples:

  • β€œMake it longer” β†’ extend BODY rows
  • β€œAdd ribbing” β†’ inject BLO stitches
  • β€œConvert to child size” β†’ adjust stitch counts

Crochet becomes:

A DSL for physical objects


πŸ§ͺ Step 4: Testing with Debugg.ai

This is the key unlock.

We treat patterns like end-to-end tests.

What gets validated:

  • Stitch counts per row
  • Logical progression
  • UI rendering
  • Instruction clarity

Because:

One bad row = broken output


πŸ€– Step 5: Execution via Browser Agents

Agents:

  • Load pattern UI
  • Click through steps
  • Expand notes
  • Simulate a human following instructions

This creates:

  • Replayable sessions
  • Failure logs
  • Deterministic debugging

⚠️ Challenges

1. Data is messy

Different sites = different formats
β†’ solved with LLM normalization

2. Fully stateful system

Each row depends on the last
β†’ solved with full agent simulation

3. Tiny errors compound

β†’ solved with Debugg.ai validation loops


πŸš€ Why This Matters

Crochet is just a proxy.

The real insight:

Most real workflows are not APIs β€” they’re UI-driven systems.

Examples:

  • SaaS dashboards
  • Internal tools
  • Marketplaces
  • Creative workflows

If agents can handle crochet patterns reliably:
they can handle almost anything.


🧠 Key Takeaway

Crochet patterns are:

Programs for humans

And with Debugg.ai + Surfs.dev:

They become programs that can be tested, executed, and improved by agents.


If you’re building agent workflows (growth, ops, QA, etc.), I’d love to see what you’re working on.

Top comments (0)