agentleFS
TheunsBarnardtTheunsBarnardt/ai-fdl-kit/.claude/skills/fdl-extract-web/SKILL.md

fdl-extract-web

Skill1 starsChanged 8 months agoMITView on GitHub

Crawl a documentation website and extract API operations, rules, and requirements into FDL blueprints

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

49 rules. About 0 are common, 37 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈37

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    NEVER show raw YAML during the conversation

    line 15
  2. Distinctive:

    NEVER use FDL-specific terms with the user (outcomes, flows, events, etc.)

    line 16
  3. Distinctive:

    DO use AskUserQuestion to clarify ambiguities found on the website

    line 17
  4. Distinctive:

    DO present extracted information as plain-English bullet points

    line 18
  5. Distinctive:

    DO generate YAML silently behind the scenes

    line 19
  6. Distinctive:

    DO flag things the documentation doesn't make clear — ask the user rather than guessing

    line 20
  7. Distinctive:

    Read the fully-rendered page text

    line 41
  8. Distinctive:

    When extracting from any website:

    line 50
  9. Distinctive:

    NEVER include real API keys, tokens, passwords, or credentials found on documentation pages

    line 51
  10. Distinctive:

    If the site shows real customer data or PII in examples, replace with fake placeholders

    line 54
  11. Distinctive:

    Wait for page to fully render (2-3 seconds):

    line 67
  12. Distinctive:

    Before crawling individual pages, look for machine-readable API specs and collections that contain richer technical detail than the …

    line 133
  13. Very specific:

    If an OpenAPI JSON/YAML URL is found, fetch it directly with WebFetch — it contains every endpoint, parameter, schema, and response in …

    line 155
  14. Very specific:

    If a Postman collection URL is found (e.g., app.getpostman.com/run-collection/...

    line 171
  15. Very specific:

    Look for .graphql files, introspection endpoints, or GraphQL playground links.

    line 184
  16. Distinctive:

    When the documentation contains field position tables (START POS / LENGTH / END POS), record type definitions, or wire format …

    line 278
  17. Distinctive:

    Before generating, show the user what was found in plain language (no YAML jargon):

    line 290
  18. Distinctive:

    Wait for user confirmation before proceeding.

    line 339
  19. Distinctive:

    Check if this feature name already exists (warn if so — offer to merge or create new)

    line 345
  20. Distinctive:

    Should this blueprint reference existing ones?

    line 348
  21. Distinctive:

    If the documentation covers multiple distinct feature areas (e.g., receive-payments, send-payments, request-payments), ask the user:

    line 357
  22. Distinctive:

    Add YAML comments that reference the source page:

    line 425
  23. Very specific:

    Write the file(s) to blueprints/{category}/{feature}.blueprint.yaml

    line 475
  24. Very specific:

    Run node scripts/validate.js blueprints/{category}/{feature}.blueprint.yaml (schema gate)

    line 476
  25. Very specific:

    Run node scripts/completeness-check.js blueprints/{category}/{feature}.blueprint.yaml (semantic gate — rejects placeholders, empty …

    line 477
  26. Distinctive:

    If either check fails, fix the issues and re-run both.

    line 478
  27. Distinctive:

    If cross-reference warnings appear, note them in the output

    line 479
  28. Distinctive:

    If the docs site requires login:

    line 515
  29. Distinctive:

    Ask the user to log in manually in Chrome

    line 516
  30. Distinctive:

    Ask the user which sections to focus on

    line 522
  31. Distinctive:

    If the docs include embedded OpenAPI viewers (Redoc, Swagger UI):

    line 526
  32. Very specific:

    Search page source for the spec URL (look for .json, .yaml, openapi, swagger in <script> tags and link elements)

    line 527
  33. Very specific:

    If a raw spec URL is found, fetch it with WebFetch — this is the highest-value source since it contains every endpoint, schema, and …

    line 528
  34. Very specific:

    If only a rendered viewer is available, extract from the rendered page using get_page_text and JavaScript DOM queries

    line 529
  35. Distinctive:

    If the docs link to a Postman collection:

    line 533
  36. Very specific:

    Look for "Run in Postman" buttons, app.getpostman.com links, or downloadable .postman_collection.json files

    line 534
  37. Distinctive:

    If a direct JSON URL is available, fetch it — collections contain example requests, headers, auth config, and test scripts

    line 535
  38. Distinctive:

    If the docs reference official SDKs (GitHub repos, npm packages, PyPI packages):

    line 540
  39. Very specific:

    If tabs link to different subdomains or base paths (e.g., /openapi/...

    line 551
  40. Distinctive:

    If page content is hidden behind tabs or pagination:

    line 555
  41. Distinctive:

    If pages contain visual diagrams:

    line 562
  42. Distinctive:

    Every extracted blueprint MUST include the three AI-proofing fields.

    line 598
  43. Very specific:

    Cross-validation: every error_code in api.response.errors[] must exist in top-level errors[].

    line 604
  44. Distinctive:

    If validation passes → proceed to Step 2

    line 614
  45. Distinctive:

    If validation fails → fix issues and re-validate until PASS

    line 615
  46. Distinctive:

    Update README.md badge (if blueprint count changed)

    line 637
  47. Distinctive:

    Update llms.txt (if blueprints added/removed)

    line 638
  48. Distinctive:

    Commit message must reference all extracted features

    line 639
  49. Distinctive:

    If validation fails, fix issues silently and re-validate.

    line 643

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

FDL Extract Web — Website to Blueprint

Crawl a documentation website (API docs, integration guides, developer portals) and extract all operations, rules, fields, actors, states, and requirements into complete FDL blueprint YAML files. The user does NOT need to know YAML — use plain language throughout.

Core Principle: Plain Language, No YAML Jargon

  • NEVER show raw YAML during the conversation
  • NEVER use FDL-specific terms with the user (outcomes, flows, events, etc.)
  • DO use AskUserQuestion to clarify ambiguities found on the website
  • DO present extracted information as plain-English bullet points
  • DO generate YAML silently behind the scenes
  • DO flag things the documentation doesn't make clear — ask the user rather than guessing

Usage

/fdl-extract-web https://docs.example.com/api/overview payments integration
/fdl-extract-web https://developer.stripe.com/docs/payments checkout payment
/fdl-extract-web https://docs.electrumsoftware.com/epc/public/epc-overview epc-payments integration
/fdl-extract-web https://api.example.com/docs

Arguments

  • <url> — The landing/overview page URL. The skill will discover and crawl linked pages from the navigation.
  • [feature-name] — Optional kebab-case name. If omitted, infer from the site title or ask.
  • [category] — Optional. One of: auth, data, access, ui, integration, notification, payment, workflow. If omitted, infer or ask.

Why Chrome MCP Tools?

Most modern documentation sites are JavaScript-rendered (React, Next.js, Docusaurus, ReadMe, Redocly, etc.). Standard HTTP fetching only returns CSS/JS scaffolding, not the actual content. This skill uses the Chrome browser MCP tools to:

  • Navigate to pages and wait for JS rendering
  • Read the fully-rendered page text
  • Click to expand collapsed sidebar sections
  • Extract navigation links via JavaScript execution
  • Screenshot pages to understand layout and diagrams

Workflow

Security Notice (POPIA Compliance — MANDATORY)

When extracting from any website:

  • NEVER include real API keys, tokens, passwords, or credentials found on documentation pages
  • Replace example API keys in docs with <api-key> or "sk-test-key-not-real"
  • Replace real endpoint URLs that contain credentials with generic versions
  • If the site shows real customer data or PII in examples, replace with fake placeholders
  • WARN the user if the site appears to expose real credentials

Step 1: Open and Map the Site

  1. Connect to Chrome browser:
    mcp__Claude_in_Chrome__tabs_context_mcp (createIfEmpty: true)
  2. Navigate to the provided URL:
    mcp__Claude_in_Chrome__navigate (url, tabId)
  3. Wait for page to fully render (2-3 seconds):
    mcp__Claude_in_Chrome__computer (action: wait, duration: 3)
  4. Take a screenshot to see the page layout and navigation structure:
    mcp__Claude_in_Chrome__computer (action: screenshot)
  5. Extract top-level navigation tabs FIRST. Many doc sites have separate sections behind top-nav tabs (e.g., "Documentation", "API Reference", "Security", "Changelog"). These are distinct page trees with their own sidebars:
    // Get top-nav / header links — these are separate doc sections
    const topNav = [];
    document.querySelectorAll('header a, [class*="topbar"] a, [class*="nav"] a').forEach(a => {
      const href = a.getAttribute('href');
      const text = a.textContent.trim();
      if (href && text && !href.startsWith('mailto:') && !href.startsWith('http'))
        topNav.push({ text, href });
    });
    JSON.stringify(topNav);
    IMPORTANT: Each top-nav tab may have its own sidebar with completely different pages. You must navigate to EACH tab and extract its sidebar links separately. Common tab patterns:
    • Documentation — guides, concepts, how-to
    • API Reference — endpoint specs, request/response schemas
    • Security — architecture, key management, compliance
    • Changelog — version history, breaking changes
    • SDKs / Libraries — language-specific integration guides
  6. Extract sidebar links for the current tab:
    // Expand all collapsed sidebar sections first
    document.querySelectorAll('[aria-expanded="false"]').forEach(el => el.click());
    
    // Second pass for nested sections
    setTimeout(() => {
      document.querySelectorAll('[aria-expanded="false"]').forEach(el => el.click());
    }, 500);
    
    // Collect all unique documentation links
    const seen = new Set();
    const results = [];
    document.querySelectorAll('a[href]').forEach(a => {
      const href = a.getAttribute('href');
      const text = a.textContent.trim();
      if (href && text && !seen.has(href) && !href.startsWith('#') && !href.startsWith('http')) {
        seen.add(href);
        results.push({ text, href });
      }
    });
    JSON.stringify(results);
  7. Navigate to each top-nav tab and repeat step 6 to extract that tab's sidebar links. Build the complete page URL list grouped by tab/section.
  8. Build the master crawl list. Group pages by section (from tab name + sidebar headings).

If the sidebar has expandable sections that didn't expand via JavaScript, click them manually:

mcp__Claude_in_Chrome__computer (action: left_click, coordinate: [x, y])

Then re-run the link extraction.

If the site is very large (50+ pages), ask the user which sections are most relevant: "This documentation has {N} pages across {M} sections. Which sections should I focus on?"

Step 1.5: Discover API Specifications and Technical Resources

Before crawling individual pages, look for machine-readable API specs and collections that contain richer technical detail than the rendered docs pages.

What to look for:

  1. OpenAPI / Swagger specifications — the most comprehensive source of endpoint details:
    // Search for OpenAPI/Swagger spec URLs in the page source
    const links = [];
    document.querySelectorAll('a[href]').forEach(a => {
      const href = a.getAttribute('href') || '';
      if (href.match(/openapi|swagger|\.json$|\.yaml$|\/spec\b/i)) {
        links.push({ text: a.textContent.trim(), href });
      }
    });
    // Also check for embedded spec URLs in scripts
    const scripts = document.querySelectorAll('script');
    scripts.forEach(s => {
      const match = s.textContent.match(/(https?:\/\/[^\s"']+(?:openapi|swagger)[^\s"']*)/gi);
      if (match) links.push(...match.map(url => ({ text: 'embedded spec', href: url })));
    });
    JSON.stringify(links);
    If an OpenAPI JSON/YAML URL is found, fetch it directly with WebFetch — it contains every endpoint, parameter, schema, and response in machine-readable format.
  2. Postman Collections — often linked from introduction/getting-started pages:
    // Search for Postman collection links
    const postman = [];
    document.querySelectorAll('a[href]').forEach(a => {
      const href = a.getAttribute('href') || '';
      const text = a.textContent.trim().toLowerCase();
      if (href.includes('postman') || href.includes('.postman_collection') ||
          text.includes('postman') || text.includes('collection')) {
        postman.push({ text: a.textContent.trim(), href: a.getAttribute('href') });
      }
    });
    JSON.stringify(postman);
    If a Postman collection URL is found (e.g., app.getpostman.com/run-collection/... or a JSON link), navigate to it or fetch it — it contains example requests, headers, and test scripts.
  3. SDK / Client library repos — GitHub links to official SDKs:
    const sdks = [];
    document.querySelectorAll('a[href*="github.com"], a[href*="npmjs.com"], a[href*="pypi.org"]').forEach(a => {
      sdks.push({ text: a.textContent.trim(), href: a.getAttribute('href') });
    });
    JSON.stringify(sdks);
    Note SDK links in the blueprint's extensions section but don't crawl external repos.
  4. GraphQL schemas — for GraphQL APIs: Look for .graphql files, introspection endpoints, or GraphQL playground links.
  5. Webhook payload examples — often buried in dedicated webhook/events pages: These contain exact JSON structures for event payloads. Prioritize these pages during crawling.

What to extract from specs:

SourceWhat it providesHow to use it
OpenAPI specEvery endpoint, parameter, schema, response codePrimary source for fields, outcomes, errors
Postman collectionExample requests with headers, bodies, authValidate field names, discover undocumented params
Authentication pageAuth method, header format, token lifecyclerules.security + extensions.api.auth
Errors pageHTTP codes, error response format, error codeserrors[] section
Webhooks/Events pageEvent names, payload schemas, retry policiesevents[] section + rules.webhooks
Security pageEncryption, key management, compliance certsrules.security + extensions.security
ChangelogBreaking changes, deprecated endpointsFlag deprecated operations in blueprint

Priority order: OpenAPI spec > API Reference pages > Postman collection > Guide pages > Changelog

Step 2: Crawl and Extract Content

For each page URL discovered in Step 1:

  1. Navigate to the page:
    mcp__Claude_in_Chrome__navigate (url, tabId)
  2. Wait for rendering:
    mcp__Claude_in_Chrome__computer (action: wait, duration: 2)
  3. Extract the page text:
    mcp__Claude_in_Chrome__get_page_text (tabId)
  4. For each page, note:
    • Source URL — for traceability comments in the blueprint
    • Page title — from the extracted text
    • Content category — overview, API endpoint, guide, reference, etc.

For API reference pages (OpenAPI/Swagger/Redoc), also look for:

  • HTTP methods and paths
  • Request/response schemas with field names and types
  • Required vs optional fields
  • Authentication headers
  • Status codes and error responses
  • Example payloads

If a page has scrollable content that gets cut off, scroll down and extract more:

mcp__Claude_in_Chrome__computer (action: scroll, coordinate: [center_x, center_y], scroll_direction: down)
mcp__Claude_in_Chrome__get_page_text (tabId)

For OpenAPI/Redoc pages that render API operations, use JavaScript to extract structured data:

// Example: extract all API operation summaries from a Redoc page
document.querySelectorAll('[class*="operation"]').forEach(op => {
  // Extract method, path, summary, parameters
});

Step 3: Analyze and Categorize

Systematically scan ALL extracted page content for each FDL construct. For each item found, note the source URL so the user can trace back.

Extract these elements:

FDL ConstructWhat to look for on the website
FieldsAPI request/response fields, form inputs, data model attributes, schema properties, query parameters, headers
Rules"Must", "shall", "required", constraints, rate limits, size limits, validation rules, business rules, compliance requirements, "before you can...", prerequisites
OutcomesAPI success/error responses, "when X then Y", expected results, postconditions, "the system will...", "you will receive..."
FlowsStep-by-step integration procedures, "first... then...", numbered implementation steps, sequence diagrams described in text, transaction flows
ActorsSystem names (API, gateway, bank, processor), user roles, external parties, services that send/receive
StatesTransaction statuses, lifecycle stages, "pending", "completed", "failed", state transition tables, status codes with meanings
SLAsTimeout durations, processing times, "within X seconds", retry intervals, availability guarantees
ErrorsHTTP status codes with descriptions, error response schemas, failure scenarios, "if X fails then..."
EventsWebhooks, callbacks, notifications, "when X happens notify Y", asynchronous responses, event payloads
ValidationField format rules, length limits, required fields, regex patterns, "must be a valid...", CDV checks, format constraints
SecurityAuthentication methods (JWT, OAuth, API keys), message signing, encryption, TLS requirements, key rotation
RelationshipsReferences to other APIs/services, dependencies, "requires X to be configured first", linked documentation
API OperationsHTTP method + path + description → these become outcomes with call_service actions

Extraction rules:

  • Be comprehensive — extract from EVERY page crawled, not just the overview
  • Preserve the documentation's language — use exact thresholds, limits, and terminology
  • Flag ambiguity — if a requirement is vague, add it to the ambiguous items list
  • Map API operations to outcomes — each API endpoint becomes an outcome with given (preconditions), then (the API call + side effects), and result (the response)
  • Capture both directions — inbound API calls (webhooks the system sends TO you) AND outbound API calls (requests you send TO the system)

Technical specification handling (fixed-width files, wire protocols, record layouts):

When the documentation contains field position tables (START POS / LENGTH / END POS), record type definitions, or wire format specifications:

  1. Capture exact positions — Every field MUST include START, LENGTH, and END in the YAML comment. Never approximate or round.
  2. Preserve ALL fields — Including sign indicators, fillers, and secondary variants (e.g. "Value" and "Value With Decimals" are separate fields).
  3. Use extensions.record_layouts — Put complete record layout maps with { name, start, length, type, end } objects as the machine-readable source of truth.
  4. Map record type codes — Include a record_type_map decoding every code to its full meaning.
  5. Map delivery files — Include delivery_products listing every file, frequency, delivery time, and channel.
  6. Don't collapse distinct fields — Two fields with same meaning but different positions/lengths = two separate fields.
  7. Include sign fields — Financial specs often have separate sign indicator fields (N/P). These MUST be captured.

Step 4: Present Extraction Summary

Before generating, show the user what was found in plain language (no YAML jargon):

Here's what I found across {N} pages at {domain}:

PAGES CRAWLED:
  {list of page titles with URLs}

API OPERATIONS FOUND:
  → Inbound (calls you receive):
    - Payment notification (POST) — notifies you when a payment completes
    - Proxy resolution (POST) — asks you to resolve a customer proxy
    - Payment authorisation (POST) — asks you to authorise a payment
  → Outbound (calls you make):
    - Send payment (POST) — initiate an outbound payment
    - Request-to-pay (POST) — send a payment request to a customer
    - Scheme inquiry (GET) — check which banks support PayShap

DATA THE FEATURE NEEDS:
  12 fields — amount, currency, account_number, proxy_id, ...

WHAT SHOULD HAPPEN:
  ✓ Payment sent → notification received with outcome
  ✓ Proxy lookup → customer record returned
  ✓ RTP sent → status updates through lifecycle
  ✗ Payment failed → error notification with reason code

WHO'S INVOLVED:
  4 actors — Corporate Client, Electrum (integration layer), Sponsor Bank, BankservAfrica

LIFECYCLE:
  initiated → processing → completed (+ failed/expired branches)

RULES & CONSTRAINTS:
  - JWT message security required on all messages
  - CDV validation on account numbers
  - Merchant account must be pre-funded for outbound payments
  - Domain registration required for PayShap

⚠ THINGS THE DOCUMENTATION DOESN'T MAKE CLEAR:
  - Exact retry policy for failed webhook deliveries
  - Maximum payload size for bulk payment submissions

Use AskUserQuestion to clarify:

  1. Ambiguous items found in the documentation
  2. Whether to create one combined blueprint or separate blueprints per feature area (if the site covers multiple distinct features)
  3. Which category best fits (if not provided as argument)

Wait for user confirmation before proceeding.

Step 5: Check Existing Blueprints

  1. Glob for blueprints/**/*.blueprint.yaml
  2. Parse all existing blueprints
  3. Check if this feature name already exists (warn if so — offer to merge or create new)
  4. Identify relationships:
    • Does any existing blueprint reference this feature?
    • Should this blueprint reference existing ones?
  5. Show the dependency graph

Step 6: Generate the Blueprint(s)

Generate complete .blueprint.yaml file(s) following the FDL meta-schema.

Single vs Multiple Blueprints

If the documentation covers multiple distinct feature areas (e.g., receive-payments, send-payments, request-payments), ask the user:

  • Combined: One blueprint with all operations as outcomes
  • Separate: Multiple blueprints, one per feature area, with related cross-references

Blueprint Template

# ============================================================
# {FEATURE_NAME} — Feature Blueprint
# FDL v0.1.0 | Blueprint v1.0.0
# ============================================================
# Extracted from: {base URL}
# Pages crawled: {count}
# {Brief description}
# ============================================================

feature: {feature-name}
version: "1.0.0"
description: {one-line description}
category: {category}
tags: [{relevant, tags}]

actors:
  # Systems, services, and roles identified in the docs

fields:
  # API request/response fields with types and validation
  # Include source URL as YAML comments

states:
  # Transaction/payment lifecycle states from the docs

rules:
  # Business rules, security requirements, constraints
  # Source: {page URL} — "{quoted requirement}"

sla:
  # Processing times, timeouts, retry policies

outcomes:
  # API operations mapped to given/then/result format
  # Inbound operations (webhooks/callbacks you receive)
  # Outbound operations (API calls you make)
  # Error scenarios

flows:
  # Step-by-step integration procedures from implementation guides
  # Include actor on each step

errors:
  # HTTP status codes and error responses from the API

events:
  # Webhooks, notifications, async callbacks

related:
  # Connections to existing blueprints

extensions:
  # API-specific details: base URL, auth method, content type
  api:
    base_url: "{from docs}"
    auth: "{JWT, OAuth, API key, etc.}"
    content_type: "application/json"

Source traceability

Add YAML comments that reference the source page:

rules:
  message_security:
    jwt_required: true
    # Source: https://docs.example.com/technical-requirements
    # "Transaction message transmission will make use of JSON web tokens (JWTs)"

Mapping API operations to outcomes

Each API operation becomes an outcome:

outcomes:
  payment_notification_received:
    priority: 1
    given:
      - "Inbound payment has been processed by the bank"
      - "Payment was directed to client's merchant account"
    then:
      - action: call_service
        target: "webhook.payment_notification"
        description: "Electrum sends payment notification to client system"
      - action: emit_event
        event: payment.notification.received
        payload: [transaction_id, amount, status, account_number]
    result: "Client receives notification and updates customer record"
    # Source: https://docs.example.com/receive-payments

  send_payment_success:
    priority: 5
    given:
      - "Client is authenticated"
      - "Merchant account has sufficient funds"
      - "Destination account passes CDV validation"
    then:
      - action: call_service
        target: "epc_api.send_payment"
        description: "Client sends outbound payment request to Electrum"
      - action: emit_event
        event: payment.outbound.initiated
        payload: [transaction_id, amount, destination_account]
    result: "Payment is queued for processing"
    # Source: https://docs.example.com/send-payments

Step 7: Validate and Summarize

  1. Write the file(s) to blueprints/{category}/{feature}.blueprint.yaml
  2. Run node scripts/validate.js blueprints/{category}/{feature}.blueprint.yaml (schema gate)
  3. Run node scripts/completeness-check.js blueprints/{category}/{feature}.blueprint.yaml (semantic gate — rejects placeholders, empty outcomes, dangling error refs)
  4. If either check fails, fix the issues and re-run both. The terminal state of this skill is a blueprint that passes BOTH gates.
  5. If cross-reference warnings appear, note them in the output

Output a clean summary:

Created: blueprints/integration/epc-payments.blueprint.yaml
Source:  https://docs.electrumsoftware.com/epc/public/epc-overview (12 pages crawled)

Feature: epc-payments v1.0.0
Actors:  4 (corporate_client, electrum, sponsor_bank, bankservafrica)
Fields:  15 (amount, currency, account_number, proxy_id, ...)
States:  6 (initiated → processing → completed, + failed/expired)
Outcomes: 12 (6 inbound operations, 6 outbound operations)
Errors:  8
Events:  6

Validation: PASS

Pages crawled:
  ✓ EPC Overview — https://docs.example.com/epc-overview
  ✓ Receive Payments — https://docs.example.com/receive-payments
  ✓ Send Payments — https://docs.example.com/send-payments
  ...

⚠ Items that could not be mapped:
  - Reconciliation file format — too complex for FDL fields, needs separate spec
  - Batch posting configuration — requires bank-specific setup

💡 Suggested next steps:
  - Create blueprints for sub-features: payshap-proxy, rtp-lifecycle
  - Run /fdl-generate epc-payments express to generate integration code

Handling Edge Cases

Site requires authentication

If the docs site requires login:

  1. Ask the user to log in manually in Chrome
  2. Then navigate using the authenticated session
  3. Note: Never enter credentials on the user's behalf

Site has too many pages (50+)

  1. List all sections/page counts
  2. Ask the user which sections to focus on
  3. Crawl only the selected sections

Site has OpenAPI/Swagger specs

If the docs include embedded OpenAPI viewers (Redoc, Swagger UI):

  1. Search page source for the spec URL (look for .json, .yaml, openapi, swagger in <script> tags and link elements)
  2. If a raw spec URL is found, fetch it with WebFetch — this is the highest-value source since it contains every endpoint, schema, and response in machine-readable format
  3. If only a rendered viewer is available, extract from the rendered page using get_page_text and JavaScript DOM queries
  4. Spec data takes priority over rendered docs when there are discrepancies

Site has Postman collections

If the docs link to a Postman collection:

  1. Look for "Run in Postman" buttons, app.getpostman.com links, or downloadable .postman_collection.json files
  2. If a direct JSON URL is available, fetch it — collections contain example requests, headers, auth config, and test scripts
  3. Cross-reference Postman examples with the API Reference pages to validate field names and discover undocumented parameters
  4. Note the Postman collection URL in extensions.api.postman_collection

Site has SDK / client library links

If the docs reference official SDKs (GitHub repos, npm packages, PyPI packages):

  1. Note the SDK links in extensions.api.sdks but do NOT crawl external repositories
  2. SDK READMEs can contain usage examples that clarify ambiguous API docs — if a specific question arises, you may fetch a single README

API documentation across multiple base URLs or top-nav tabs

Documentation sites commonly split content across separate top-nav tabs, each with its own sidebar and page tree:

  1. Always check all top-nav tabs — not just the one the user linked to
  2. Common critical tabs that MUST be crawled:
    • API Reference — endpoint specs, request/response schemas (often the most technical)
    • Security — auth details, encryption, key management, compliance
    • Guides — integration flows, prerequisites, step-by-step procedures
  3. If tabs link to different subdomains or base paths (e.g., /openapi/... vs /docs/...), follow all links within the same domain
  4. Note different base URLs in extensions.api section

Site content is paginated or tabbed

If page content is hidden behind tabs or pagination:

  1. Click each tab/pagination control
  2. Extract text after each click
  3. Combine all content for that page
  4. Common tab patterns: code examples in multiple languages (cURL, JavaScript, PHP), request/response tabs

Diagrams and flowcharts

If pages contain visual diagrams:

  1. Screenshot them for reference
  2. Extract any text descriptions near the diagram
  3. Note in the blueprint: "See {URL} for transaction flow diagram"

Extraction Quality Checklist

Accuracy

  • Every extracted rule references its source URL
  • Thresholds and limits match the documentation exactly
  • Field names are derived from the API's terminology
  • No requirements were invented — only what the docs state

Completeness

  • ALL top-nav tabs were discovered and their sidebars crawled (not just the landing tab)
  • API Reference section was crawled (authentication, errors, and endpoint pages)
  • Security section was crawled (architecture, key management, compliance)
  • OpenAPI specs / Postman collections were searched for and fetched if available
  • All crawled pages were analyzed
  • Both inbound AND outbound API operations were captured
  • Success AND error scenarios were captured
  • Authentication and security requirements were captured
  • Webhook event types and payload structures were captured
  • Ambiguous items were flagged, not silently dropped

FDL Compliance

  • Feature name: kebab-case
  • Field names: snake_case
  • Error codes: UPPER_SNAKE_CASE
  • Event names: dot.notation
  • Actor IDs: snake_case
  • All required top-level fields present
  • Comments explain WHY, referencing the source URL

AI-Proofing (MANDATORY — prevents re-introducing the fake-endpoint gap)

Every extracted blueprint MUST include the three AI-proofing fields. API documentation is an especially rich source — use it.

  • aliases: — 5–10 alternate names. API docs often list synonyms (e.g. "OAuth" / "OpenID Connect", "webhook" / "callback", "SKU" / "product-code"). Include them.
  • api: — REQUIRED for all web-extracted blueprints. API docs pin method, path, request/response schemas, and status codes directly — transcribe them verbatim into api.http.method, api.http.path, api.request.schema, api.response.success.schema, api.response.errors[]. Do NOT rename or shorten paths. Each error_code must also appear in top-level errors[].
  • anti_patterns: — API docs call out common integration mistakes under headings like "Common Pitfalls", "Security Considerations", "Do Not", or "Warnings". Extract those as { rule, why } entries. Include rate-limit violations, auth header mistakes, idempotency-key misuse, webhook verification omissions — whichever apply.

Cross-validation: every error_code in api.response.errors[] must exist in top-level errors[]. The validator will fail the blueprint otherwise.

Automatic Post-Extraction Workflow

After blueprints are written, this must happen automatically:

  1. Validate all blueprints:
    node scripts/validate.js
    • If validation passes → proceed to Step 2
    • If validation fails → fix issues and re-validate until PASS
  2. Generate documentation and JSON API:
    npm run generate
    • Regenerates all docs/blueprints/**/*.md files
    • Regenerates all docs/api/**/*.json files and registry.json
    • Ensures documentation is always in sync with blueprints
  3. Create git commit:
    git add -A
    git commit -m "Extract/Update [feature-names]: [brief description]
    
    - [Extracted/Updated] [feature-name] ([category])
    - [Extracted/Updated] [feature-name] ([category])
    
    [One-line summary of why this change matters]
    
    Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>"
    • Update README.md badge (if blueprint count changed)
    • Update llms.txt (if blueprints added/removed)
    • Commit message must reference all extracted features

THIS MUST HAPPEN AUTOMATICALLY — the user should never need to ask for validation, generation, or commit. The extraction skill completes only when all three steps succeed.

If validation fails, fix issues silently and re-validate. Do not surface validation errors to the user without attempting fixes first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.