PTENES
MODULE 4.2

🔥 Local Leads Abundance System

The case study of a multi-agent pipeline: several small skills chained together that find local businesses in directories, enrich contacts in cascades, build a personalized gift website, and start the conversation through the business’s own form — all automated, end to end.

6
Topics
55
Minutes
Inter.
Level
System
Type
1

🗺️ The System in Four Steps

The big lesson from this module isn’t “how to get leads.” It’s how to compose multiple skills into a system. Instead of one giant skill that does everything (and breaks all at once), the system is a pipeline: each stage is a standalone skill, one stage’s output becomes the next stage’s input, and each piece can be tested and fixed on its own.

1 · Scraping directories → spreadsheet 2 · Enrich site + LinkedIn 3 · Gift website lead magnet 4 · Contact via a form

🎯 The premise

You’re an AI agency looking for clients. The answer: local businesses with money. The system finds them for you—starting with sources where businesses have already prequalified themselves as established and having a budget.

Pipeline, not monolith

One skill per stage.

Contract between stages

One’s output = the next one’s input.

Testable in parts

Fixes one stage without changing the rest.

End-to-end value

From directory to submitted form.

2

🕸️ Scraping Directories with Playwright

The first stage determines the quality of everything that follows. The strategic choice here is the source: directories of trade associations and networking groups list businesses that have already prequalified themselves — established for years, with a budget, and often with dated websites (exactly the pain the agency solves).

📚 Three sources of prequalified leads

  • • Chamber of commerce directories: member businesses, usually long-standing and established in the area.
  • • Networking group directories (BNI-style): business owners active in referral groups.
  • • Local lifestyle magazines: each advertiser pays a lot for the space — a strong budget signal.

How scraping works

The skill uses browser automation (Playwright) to go through the directory: it opens each member card, reads the profile information, and organizes everything into a spreadsheet. This is the "real-browser scraping" pattern from Track 3 applied to a business goal.

for each card in the directory:
    open the card / "learn more"
    read the name, business, phone number, address
    add a row to the leads spreadsheet

💡 Tip: pre-qualification comes from the source

You don’t “pre-qualify” leads afterward—you choose a source where they already arrive pre-qualified. A business that has paid annual dues to a chamber of commerce for years has already demonstrated longevity and ability to pay. The quality of the list comes from choosing the directory.

Browser automation

Opens each card like a human.

Prequalified source

The directory already filters for stability.

Structured data

Profile becomes a spreadsheet row.

Outdated website = pain point

The right target has the right problem.

3

💧 Cascading enrichment

A name and a business aren’t enough. The enrichment stage discovers the site and LinkedIn profile for each contact. The technique is a cascade (waterfall): try one provider; if it doesn't find anything, move on to the next, ordered from cheapest/fastest to most expensive/complete.

Provider A · $ Provider B · $$ Provider C · $$$ Email API · $$$$ Found it! site + LinkedIn cheap first → moves to the next if it doesn’t find anything

The cascade logic

resultado = vazio
para provedor em [barato, médio, caro]:
    resultado = provedor.buscar(nome, negócio)
    se resultado tem site E linkedin:
        parar  # achou, não gasta com os próximos
se resultado vazio E quer e-mail:
    usar API de e-mail dedicada (a mais cara)

By chaining search providers, the system finds the website and LinkedIn profile associated with a name with high accuracy—without making the expensive call for every lead.

✓ Well-designed cascade

  • ✓Sorts from least expensive to most expensive.
  • ✓Stops as soon as it has enough data.
  • ✓Reserve the expensive API only for those who need the email.
  • ✓Records which provider it found (audit).

✗ Poorly designed cascade

  • ✗Calls every provider for every lead — costs skyrocket.
  • ✗Starts with the most expensive provider “because it’s better.”
  • ✗Don’t stop once you’ve found it — pure waste.
  • ✗Can’t say where each piece of data came from.
Waterfall

Providers in a specified order.

Fallback

Failed? Try the next one.

Rising cost

Cheap → expensive, stop when it works.

High precision

Website + LinkedIn by name.

4

🎁 The site as a lead magnet

Here’s the system’s masterstroke. Instead of sending a message asking for attention, the pipeline delivers value before asking for anything: for each lead, creates an improved version of their website — a clone with an updated header, a modern-style redesign, or an added chat widget — and sends it as a gift to start the conversation.

🎯 Why this changes the game

"Look, I found your website and made a better version" is a completely different approach from "hi, can I help you?". You've already demonstrated your skills, shown the result, and tailored it to that specific business. The gift is the hook.

Variations of the present (illustrative recreation)

faithful clone
just the rebuilt header; "this is your site, modernized"
redesign
modern layout with good design practices
+ chat widget
"see what it would look like with a chat on your current website"

Illustrative mockups of the concept of present variation — not real screens.

💡 Tip: storytelling in the funnel

The gift doesn’t end there. It leads into a short story: “this is your website → see what it could be → let’s talk.” The gift website is the top of the funnel; the goal is to bring people to a meeting, not close the deal in the first message.

Lead magnet

A gift that opens doors.

Upfront value

Deliver before asking.

Personalization

Tailored to each business.

Scale

Automatic generation per lead.

5

✉️ Contact via form

The final step closes the loop: browser automation fills out and submits the contact form from the business's own website (or directory), with the message and link to the gift website. Leaving the saturated cold email channel is a strategic decision—and a screenshot of the successful send becomes proof of delivery.

1

Locate the form

The skill finds the contact form (usually in the page footer) on the lead’s website.

2

Fill in with the message

Automatically inserts the personalized message and gift-site link in the right fields.

3

Send and capture proof

Submit the form and take a screenshot of the confirmation — proof that the message went through.

📊 Why a form instead of cold email

  • • Less saturated channel: the inbox is full; the contact form goes straight to the owner.
  • • The right context: a person reads a message about the site itself, coming from the site itself.
  • • Delivery proof: the screenshot of the successful send confirms that the message was received.

⚠️ Attention: responsible automation

Sending automated messages through forms requires respecting volume, relevance, and each site's rules. The system's strength is personalization and the value it delivers—not spam. Generic bulk messages damage your reputation and violate terms of use. Keep your outreach specific and welcome.

Alternative channel

Form > crowded box.

Submission proof

Screenshot of the confirmation.

Ethical automation

Personalized, not spam.

Closed loop

From lead to conversation started.

6

🔗 Orchestrating the Pipeline Skills

Four chained skills only form a system if there’s a orchestration that connect them and a checkpoint that protects progress. Without it, an error in step 4 forces you to repeat steps 1 to 3—and in long pipelines, that costs hours and API money.

Copyable prompt — orchestrator SKILL.md

---
name: local-leads-pipeline
description: Orchestrates a local-lead pipeline end to end. Use when the
  user wants to find local businesses from directories, enrich the
  contacts, build a gift website per lead, and reach out via their
  contact form. Triggers include "find local leads", "run the lead
  pipeline", "enrich and reach these businesses".
---

# Local Leads Pipeline (orchestrator)

Run four stages in order. Each stage is its own skill. Pass the CSV
forward. Save a checkpoint after each lead so the run can resume.

1. scrape-directory  → leads.csv   (name, business, phone, address)
2. enrich-contacts   → +website, +linkedin   (waterfall, cheap → costly)
3. build-gift-site   → +gift_url   (clone / redesign / chat widget)
4. submit-form       → +sent_proof (screenshot of the confirmation)

## Rules
- A stage only consumes rows where its input columns are filled and its
  output columns are empty (idempotent — safe to re-run).
- Write a checkpoint file after each lead. On restart, skip leads already
  marked done.
- If a stage fails on a lead, log it and continue — do NOT stop the batch.
- Keep outreach personalised and respectful of each site's rules.

✓ Robust orchestration

  • ✓Clear column contract between stages.
  • ✓Checkpoint after each lead — resumes where it left off.
  • ✓Idempotent: rerunning doesn’t duplicate work.
  • ✓One lead’s failure doesn’t bring down the entire batch.

✗ Fragile pipeline

  • ✗One giant skill that handles all four steps together.
  • ✗No checkpoint — an error at the end means starting over.
  • ✗Rerunning reprocesses leads that are already ready (costs 2x).
  • ✗One bad lead stops the batch of 600.

💡 Tip: the CSV is the contract

The spreadsheet that runs through the pipeline is the contract between the skills. Each stage knows which columns to read and which to write. This pattern—"a skill only touches rows where its input is ready and its output is still empty"—is what makes the system idempotent and safe to resume.

✍️ Hands-on exercises

1

Design the contract. For each of the four stages, list the columns it reads and those that writes in the CSV. Where two stages touch, does the contract hold up?

2

Create a runnable SKILL.md. Save the orchestrator above in ~/.claude/skills/local-leads-pipeline/SKILL.md and implement only stage 1 (scrape) in any public directory, saving a CSV. Test the skill trigger.

3

Design the cascade. Choose 3 enrichment sources (free or paid), rank them by cost, and write the rule for "stop when you find a website + LinkedIn profile".

4

Test resuming. Run stage 1 on 10 leads, interrupt halfway through, and run it again. Does it skip the ones already processed or reprocess everything? Fix it to be idempotent.

📌 Module Summary

✓
Pipeline > monolith — four chained skills, each testable and fixable on its own.
✓
The source pre-qualifies — directories list established businesses with budgets and dated websites.
✓
Cascade enrichment — cheap → expensive, stopping when it gets a hit, saving the expensive API for those who need it.
✓
Website present = lead magnet — delivers tailored value before asking for anything.
✓
Orchestrate with a checkpoint — the CSV is the contract; idempotency and resumability protect the pipeline.

Next Module:

4.3 — 📊 Lead Scoring with Apify: score each lead across three dimensions to know who to contact first.