fdl-extract
Skill1 starsChanged 8 months agoMITView on GitHub
Extract business rules and requirements from a document into an FDL blueprint
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- TheunsBarnardt/claude-fdledited, first seen Apr 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- TheunsBarnardt/claude-fdl★ 099% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- fdl-auto-evolveSkill
- fdl-brainstormSkill
- fdl-buildSkill
- fdl-build-yamlSkill
- fdl-createSkill
- fdl-extract-code-featureSkill
- fdl-extract-codeSkill
- fdl-extract-designSkill
- fdl-extract-webSkill
- fdl-generateSkill
- fdl-installSkill
- fdl-propagate-agiSkill
- fdl-pr-reviewSkill
- fdl-recommend-discoverSkill
- fdl-researchSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
40 rules. About 0 are common, 34 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈34
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Read a business document (BRD, PRD, SOP, compliance policy, process map, or any requirements doc) and extract the rules, fields, outcomes, …
- Distinctive: line 15
NEVER show raw YAML during the conversation
- Distinctive: line 16
NEVER use FDL-specific terms with the user (outcomes, flows, events, etc.)
- Distinctive: line 17
DO use AskUserQuestion to clarify ambiguities found in the document
- Distinctive: line 18
DO present extracted information as plain-English bullet points
- Distinctive: line 19
DO generate YAML silently behind the scenes
- Distinctive: line 20
DO flag things the document doesn't make clear — ask the user rather than guessing
- Distinctive: line 41
After reading the document, before extracting any content:
- Distinctive: line 43
If found: WARN the user, list the PAGE/SECTION (not the values), and replace with generic placeholders in the blueprint
- Distinctive: line 44
NEVER include real secrets in generated blueprints — even if the source document contains them
- Very specific: line 45
Use <api-key>, <token>, example@test.com, <connection-string> as placeholders
- Distinctive: line 49
Use the Read tool to load the file
- Distinctive: line 54
If the document is very large (100+ pages), ask the user which sections are most relevant
- Distinctive: line 86
When the document contains field position tables (START POS / LENGTH / END POS), record type definitions, or wire format specifications:
- Distinctive: line 104
Before generating, show the user what was found in plain language (no YAML jargon):
- Distinctive: line 139
Wait for user confirmation before proceeding.
- Distinctive: line 145
Check if this feature name already exists (warn if so — offer to merge or create new)
- Distinctive: line 148
Should this blueprint reference existing ones?
- Distinctive: line 215
Add YAML comments that reference the source document:
- Very specific: line 228
Write the file to blueprints/{category}/{feature}.blueprint.yaml
- Very specific: line 229
Run node scripts/validate.js blueprints/{category}/{feature}.blueprint.yaml (schema gate)
- Very specific: line 230
Run node scripts/completeness-check.js blueprints/{category}/{feature}.blueprint.yaml (semantic gate — rejects placeholders, empty …
- Distinctive: line 231
If either check fails, fix the issues and re-run both.
- Distinctive: line 232
If cross-reference warnings appear, note them in the output
- Distinctive: line 287
Every extracted blueprint MUST include the three AI-proofing fields.
- Very specific: line 293
Cross-validation: every error_code in api.response.errors[] must exist in top-level errors[].
- Distinctive: line 298
If the document describes multiple distinct features (e.g., a BRD covering login, signup, AND checkout):
- Distinctive: line 300
Ask the user which one to extract, or offer to extract all as separate blueprints
- Distinctive: line 304
If requirements use vague language ("should be fast", "must be secure"):
- Distinctive: line 305
Add to the ambiguous items list
- Distinctive: line 310
If the doc mentions integrations with specific systems (Stripe, Salesforce, SAP):
- Very specific: line 312
Add framework-specific details to extensions if enough info exists
- Distinctive: line 324
If the same requirement appears with different values in different sections:
- Distinctive: line 326
Use the more restrictive/secure value as the default
- Distinctive: line 337
If validation passes → proceed to Step 2
- Distinctive: line 338
If validation fails → fix issues and re-validate until PASS
- Distinctive: line 360
Update README.md badge (if blueprint count changed)
- Distinctive: line 361
Update llms.txt (if blueprints added/removed)
- Distinctive: line 362
Commit message must reference all extracted features
- Distinctive: line 366
If validation fails, fix issues silently and re-validate.
≈ “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.
Files
FDL Extract — Document to Blueprint
Read a business document (BRD, PRD, SOP, compliance policy, process map, or any requirements doc) and extract the rules, fields, outcomes, actors, and states into a complete FDL blueprint YAML file. 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 in the document
- DO present extracted information as plain-English bullet points
- DO generate YAML silently behind the scenes
- DO flag things the document doesn't make clear — ask the user rather than guessing
Usage
/fdl-extract docs/expense-policy.pdf expense-approval workflow
/fdl-extract requirements/checkout-brd.docx checkout payment
/fdl-extract specs/onboarding-flow.md onboarding ui
/fdl-extract screenshots/process-diagram.pngArguments
<file-path>— Path to the document. Supported: PDF, DOCX, TXT, MD, images (PNG, JPG — for flowcharts/diagrams)[feature-name]— Optional kebab-case name. If omitted, infer from the document title or ask.[category]— Optional. One of: auth, data, access, ui, integration, notification, payment, workflow. If omitted, infer or ask.
Workflow
Step 0.5: Security Scan (POPIA Compliance — MANDATORY)
After reading the document, before extracting any content:
- Scan for real API keys, tokens, passwords, connection strings, PII (SA ID numbers, banking details)
- If found: WARN the user, list the PAGE/SECTION (not the values), and replace with generic placeholders in the blueprint
- NEVER include real secrets in generated blueprints — even if the source document contains them
- Use
<api-key>,<token>,example@test.com,<connection-string>as placeholders
Step 1: Read the Document
- Use the Read tool to load the file
- PDF: Use the
pagesparameter for large documents (read in chunks of 20 pages) - DOCX: Read tool handles Word documents natively
- Images: Read tool renders images visually — useful for flowcharts and process diagrams
- TXT/MD: Read directly
- PDF: Use the
- If the document is very large (100+ pages), ask the user which sections are most relevant
Step 2: Analyze and Extract
Systematically scan the document for each FDL construct. For each item found, note the source (page number, section heading, or quote snippet) so the user can trace back.
Extract these elements:
| FDL Construct | What to look for in the document |
| Fields | Input forms, data fields, "the user enters...", field names in tables, entity attributes, database columns |
| Rules | "Must", "shall", "required", constraints, thresholds, limits, policies, "no more than", "at least", security requirements, compliance mandates |
| Outcomes | Success criteria, acceptance criteria, "the system should...", "when X then Y", expected results, postconditions. Convert these to given/then/result format. |
| Flows | Step-by-step procedures, process descriptions, "first... then...", numbered lists, flowchart paths. Only extract as flows if the document describes exact procedures for human actors. |
| Actors | Role names, department names, "the manager...", "the system...", RACI matrices, swimlane labels, job titles |
| States | Status values, lifecycle stages, "pending", "approved", "draft → submitted", state transition tables |
| SLAs | Deadlines, turnaround times, "within 48 hours", "must be completed by", escalation rules, response time targets |
| Errors | Failure cases, "if X fails then...", exception handling, error messages, rejection scenarios |
| Events | Triggers, "when X happens notify Y", email notifications, alerts, webhooks, "on completion..." |
| Validation | Data format rules, length limits, required fields, pattern constraints, "must be a valid email" |
| Security | Authentication requirements, authorization rules, rate limits, encryption, audit logging, OWASP references |
| Relationships | References to other features/systems, dependencies, integrations, "requires login", "connects to payment" |
Extraction rules:
- Be conservative — only extract what the document explicitly states. Don't invent requirements.
- Preserve the document's language — use the exact thresholds, limits, and terminology from the doc.
- Flag ambiguity — if a requirement is vague ("should be fast", "must be secure"), add it to the ambiguous items list.
- Map to FDL types — convert document language to FDL constructs (e.g., "the employee fills in their name" → field:
name, type: text, required: true).
Technical specification handling (fixed-width files, wire protocols, record layouts):
When the document contains field position tables (START POS / LENGTH / END POS), record type definitions, or wire format specifications:
- Capture exact positions — Every field MUST include
START,LENGTH, andENDin the YAML comment. Never approximate, summarise, or round these values. Copy them exactly from the spec table. - Preserve ALL fields — If the spec defines 20 fields in a record type, extract all 20 — including sign indicators, fillers, and secondary variants (e.g. "Value Traded" and "Value Traded 2 (With Decimals)" are separate fields with different positions and lengths).
- Use
extensions.record_layouts— Put the complete record layout maps inextensions.record_layouts.{RECORD_TYPE}. Each entry must list ALL fields with{ name, start, length, type, end }objects. This is the machine-readable source of truth for parsing. - Map record type codes — If the spec uses codes (e.g. "DE" = Daily Equity, "DS" = Daily Sector, "CA" = Corporate Action), include a
record_type_mapin extensions that decodes every code to its full meaning. - Map delivery files — If the spec defines file names and delivery schedules (e.g. "E.Zip at 20:30"), include a
delivery_productsmap in extensions listing every file, its frequency, delivery time, and delivery channel. - Don't collapse distinct fields — If a spec defines two fields with the same logical meaning but different positions or lengths (e.g. value without decimals at pos 49/len 11 AND value with decimals at pos 145/len 13), create BOTH fields. Never merge them into one with an incorrect length.
- Include sign fields — Financial specs often have separate sign indicator fields (N/P for negative/positive). These MUST be captured as separate fields, not omitted.
Step 3: Present Extraction Summary
Before generating, show the user what was found in plain language (no YAML jargon):
Here's what I found in docs/expense-policy.pdf:
DATA THE FEATURE NEEDS:
8 fields — title, amount, currency, category, date, description, receipt, status
WHAT SHOULD HAPPEN:
✓ Expense submitted → manager notified, starts review
✓ Manager approves → auto-approved if under $1,000, otherwise goes to finance
✓ Finance approves → queued for payment
✓ Payment processed → employee notified, marked as paid
✗ Rejected → employee notified with reason, can revise and resubmit
WHO'S INVOLVED:
4 roles — Employee, Direct Manager, Finance Manager, Payment System
LIFECYCLE:
draft → submitted → approved → paid (+ rejected branch)
TIME LIMITS:
- Manager must review within 48 hours
- Finance must review within 72 hours
- End-to-end within 30 days
⚠ THINGS THE DOCUMENT DOESN'T MAKE CLEAR:
- "Expenses should be processed quickly" — how quickly? What's the target?
- "Large purchases may need additional approval" — what's the dollar threshold?Use AskUserQuestion to clarify ambiguous items: "I found a couple of things the document doesn't specify clearly. Can you help?"
- Present each ambiguous item as a question with suggested options
Wait for user confirmation before proceeding.
Step 4: Check Existing Blueprints
- Glob for
blueprints/**/*.blueprint.yaml - Parse all existing blueprints
- Check if this feature name already exists (warn if so — offer to merge or create new)
- Identify relationships:
- Does any existing blueprint reference this feature?
- Should this blueprint reference existing ones?
- Show the dependency graph
Step 5: Generate the Blueprint
Generate a complete .blueprint.yaml following the FDL meta-schema. Use the standard FDL file format:
# ============================================================
# {FEATURE_NAME} — Feature Blueprint
# FDL v0.1.0 | Blueprint v1.0.0
# ============================================================
# Extracted from: {source document path}
# {Brief description of the source document}
# ============================================================
feature: {feature-name}
version: "1.0.0"
description: {one-line description}
category: {category}
tags: [{relevant, tags}]
actors:
# Only include if actors were found in the document
fields:
# Every field with name, type, required, label, validation
states:
# Only include if state machine / lifecycle was found
rules:
# All business rules, security policies, constraints
# Include source references as YAML comments:
# # Source: Section 3.2, "Expenses over $1,000 require finance approval"
sla:
# Only include if time constraints were found
outcomes:
# Preferred: given/then/result acceptance criteria extracted from the document
# Convert "when X happens, the system should Y" into outcome format
flows:
# Only include alongside outcomes when the document describes exact procedures
# for human actors (approval workflows, manual processes)
# Include actor on each step when known
# Include condition for conditional steps
errors:
# UPPER_SNAKE_CASE codes, user-safe messages
events:
# dot.notation names with payload fields
related:
# Connections to existing blueprints
ui_hints:
# Only include if the document describes UI/forms
extensions:
# Only include if framework-specific details are mentionedSource traceability
Add YAML comments that reference the source document:
rules:
approval:
finance_threshold: 1000
# Source: Section 4.1 — "Expenses exceeding $1,000 require Finance Department approval"This allows anyone to trace a rule back to the original document.
Step 6: Validate
- Write the file to
blueprints/{category}/{feature}.blueprint.yaml - Run
node scripts/validate.js blueprints/{category}/{feature}.blueprint.yaml(schema gate) - Run
node scripts/completeness-check.js blueprints/{category}/{feature}.blueprint.yaml(semantic gate — rejects placeholders, empty outcomes, dangling error refs) - If either check fails, fix the issues and re-run both. The terminal state of this skill is a blueprint that passes BOTH gates.
- If cross-reference warnings appear, note them in the output
Step 7: Output Summary
Created: blueprints/workflow/expense-approval.blueprint.yaml
Source: docs/expense-policy.pdf
Feature: expense-approval v1.0.0
Actors: 4 (employee, manager, finance_manager, payment_system)
Fields: 8 (title, amount, currency, category, date, description, receipt, status)
States: 6 (draft → submitted → manager_approved → approved → paid, + rejected)
Flows: 4 (submit, manager_review, finance_review, payment)
SLAs: 3 (48h manager review, 72h finance review, 30d end-to-end)
Errors: 5
Events: 4
Validation: PASS (2 warnings — missing related blueprints)
⚠ Items that could not be mapped:
- "Expenses should be processed quickly" — too vague for an SLA, needs a specific duration
- Section 7 references "tax reporting integration" — no FDL blueprint exists for this yet
💡 Suggested next steps:
- Create blueprints for missing related features: file-upload, notifications
- Clarify ambiguous items with the document author
- Run /fdl-generate expense-approval nextjs to generate implementation codeExtraction Quality Checklist
Accuracy
- Every extracted rule has a source reference (section/page/quote)
- Thresholds and limits match the document exactly (don't round or approximate)
- Field names are derived from the document's terminology
- No requirements were invented — only what the document states
Completeness
- All sections of the document were scanned
- Both happy path AND exception paths were captured
- Validation rules were extracted for every field
- Security and compliance requirements 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 (feature, version, description, category, fields, rules, flows)
- Comments explain WHY, referencing the source document
AI-Proofing (MANDATORY — prevents re-introducing the fake-endpoint gap)
Every extracted blueprint MUST include the three AI-proofing fields. Derive them from the source document where possible; flag gaps in the extraction summary — do not silently omit.
aliases:— extract 5–10 alternate names by scanning the document for synonyms, sub-headings, glossary terms, and legacy/vendor-specific names users might type instead of the canonical feature name.api:— if the document specifies an HTTP endpoint (API spec, integration guide, sequence diagram with REST calls), pin the wire contract:http.method,http.path,request.schema,response.success.schema,response.errors[]. Eacherror_codemust also appear in top-levelerrors[]. If the document describes a business process with no HTTP surface, omitapi:.anti_patterns:— derive from the document's explicit prohibitions, compliance notes, and "must not" clauses. Include OWASP / NIST / POPIA defaults where applicable. Each entry is{ rule, why }with the why citing the section or regulation.
Cross-validation: every error_code in api.response.errors[] must exist in top-level errors[]. The validator will fail the blueprint otherwise.
Handling Edge Cases
Document has multiple features
If the document describes multiple distinct features (e.g., a BRD covering login, signup, AND checkout):
- List all features found
- Ask the user which one to extract, or offer to extract all as separate blueprints
- Generate one blueprint at a time
Document is ambiguous
If requirements use vague language ("should be fast", "must be secure"):
- Add to the ambiguous items list
- Suggest a concrete FDL equivalent where possible (e.g., "should be fast" → suggest
max_duration: 5s) - Mark suggestions clearly so the user can confirm or adjust
Document references external systems
If the doc mentions integrations with specific systems (Stripe, Salesforce, SAP):
- Map to
relatedfeatures where possible - Add framework-specific details to
extensionsif enough info exists - Flag as "requires integration blueprint" if no mapping exists
Document is a diagram/image
For flowchart screenshots or process diagrams:
- Identify nodes as states or flow steps
- Identify arrows as transitions
- Identify swimlanes as actors
- Identify decision diamonds as conditions
- Note that extraction from images is best-effort — ask user to verify
Document contradicts itself
If the same requirement appears with different values in different sections:
- Flag the contradiction to the user
- Use the more restrictive/secure value as the default
- Reference both sections in the YAML comment
Automatic Post-Extraction Workflow
After Step 7 (blueprint written and validated), this must happen automatically:
- Validate all blueprints:
node scripts/validate.js- If validation passes → proceed to Step 2
- If validation fails → fix issues and re-validate until PASS
- Generate documentation and JSON API:
npm run generate- Regenerates all
docs/blueprints/**/*.mdfiles - Regenerates all
docs/api/**/*.jsonfiles andregistry.json - Ensures documentation is always in sync with blueprints
- Regenerates all
- 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.
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
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.

