skills/website/phases/01-extract.md

2.6 KiB

Phase 1 — Business Intelligence Extraction

Extract structured brand data from any business website using Firecrawl.

Step-by-Step Protocol

1. Check Firecrawl status

firecrawl --status

If not authenticated, instruct user to set FIRECRAWL_API_KEY in their environment.

2. Scrape homepage

firecrawl scrape "<url>" -o .firecrawl/homepage.md

3. Map site structure

firecrawl map "<url>" --search "about services team contact" -o .firecrawl/sitemap.json

4. Crawl key pages (parallel)

firecrawl scrape "<url>/about" -o .firecrawl/about.md &
firecrawl scrape "<url>/services" -o .firecrawl/services.md &
wait

5. AI agent extraction

Run the agent to extract structured brand data:

firecrawl agent "<url>" \
  "Analyze this business website thoroughly. Extract and return JSON with these exact fields:
   - name: business name
   - tagline: main tagline or value proposition (1 sentence)
   - services: array of service names (max 8)
   - colors: { primary: hex, secondary: hex, accent: hex, bg: hex } — infer from screenshots/CSS if mentioned
   - tone: one of formal | casual | bold | playful — based on copy style
   - heroHeadline: the most compelling headline for their hero section
   - ctaText: primary call-to-action button text
   - audience: target customer description (1 sentence)
   - industry: e.g. healthcare, tech, legal, hospitality
   Return only valid JSON, no markdown wrapping." \
  -o .firecrawl/brand.json

6. Validate extraction

Read .firecrawl/brand.json and verify all fields are populated. If any are missing:

  • colors: default to a neutral palette based on industry field
    • tech: { primary: "#3B82F6", secondary: "#1E293B", accent: "#10B981", bg: "#F9FAFB" }
    • healthcare: { primary: "#0EA5E9", secondary: "#164E63", accent: "#22D3EE", bg: "#F0F9FF" }
    • legal: { primary: "#1C1917", secondary: "#57534E", accent: "#D97706", bg: "#FAFAF9" }
    • hospitality: { primary: "#B45309", secondary: "#292524", accent: "#F59E0B", bg: "#FFFBEB" }
    • default: { primary: "#18181B", secondary: "#3F3F46", accent: "#6366F1", bg: "#FAFAFA" }
  • heroHeadline: use the business name + tagline combined
  • ctaText: default to "Get Started"

7. Generate brand.ts tokens file

Write brand.ts using ../templates/brand.ts as the base, injecting the extracted values.

Output Checklist

  • .firecrawl/homepage.md exists and has content
  • .firecrawl/brand.json has all required fields
  • No empty string values remain
  • Colors are valid hex codes (6 digits with #)