Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Extract structured data from construction documents using LLMs. Process RFIs, submittals, contracts, specifications. Convert unstructured PDFs to structured JSON/Excel.
.claude/skills/datadrivenconstruction-llm-document-extraction/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 118% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -25% | 0% |
Construction documents (RFIs, submittals, specs, contracts) contain critical data trapped in unstructured formats. This skill uses LLMs to extract structured data automatically.
> "The construction industry is drowning in a flood of new data: the volume of information has grown from 15 zettabytes in 2015 to 181 zettabytes in 2025, and 90% of all existing data has been created in just the last few years." — Artem Boiko
| Document Type | Extract | |---------------|---------| | RFI | Question, response, dates, parties | | Submittal | Product specs, approval status, materials | | Contract | Parties, amounts, dates, scope, clauses | | Specification | Materials, standards, requirements | | Daily Report | Weather, labor, equipment, progress |
pythonfrom openai import OpenAI import pdfplumber import json client = OpenAI() def extract_from_pdf(pdf_path: str, extraction_schema: dict) -> dict: """Extract structured data from PDF using LLM""" # Extract text from PDF with pdfplumber.open(pdf_path) as pdf: text = "\n".join(page.extract_text() for page in pdf.pages) # Build extraction prompt prompt = f""" Extract the following information from this construction document. Return ONLY valid JSON matching the schema. Schema: {json.dumps(extraction_schema, indent=2)} Document: {text[:8000]} # Truncate for context limits JSON Output: """ response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a construction document analyst. Extract data accurately."}, {"role": "user", "content": prompt} ], response_format={"type": "json_object"} ) return json.loads(response.choices[0].message.content)
pythonrfi_schema = { "rfi_number": "string", "date_submitted": "YYYY-MM-DD", "date_required": "YYYY-MM-DD", "from_company": "string", "to_company": "string", "subject": "string", "question": "string", "response": "string or null", "status": "open|closed|pending", "cost_impact": "boolean", "schedule_impact": "boolean", "attachments": ["list of attachment names"] } # Extract rfi_data = extract_from_pdf("RFI-0042.pdf", rfi_schema)
pythonsubmittal_schema = { "submittal_number": "string", "spec_section": "string", "description": "string", "manufacturer": "string", "product_name": "string", "model_number": "string", "submitted_by": "string", "date_submitted": "YYYY-MM-DD", "status": "approved|approved_as_noted|revise_resubmit|rejected", "reviewer_comments": "string or null", "materials": [ { "name": "string", "specification": "string", "quantity": "string" } ] }
pythoncontract_schema = { "contract_number": "string", "project_name": "string", "owner": { "name": "string", "address": "string" }, "contractor": { "name": "string", "address": "string" }, "contract_amount": "number", "start_date": "YYYY-MM-DD", "completion_date": "YYYY-MM-DD", "liquidated_damages": "number per day", "retention_percentage": "number", "key_clauses": [ { "clause_number": "string", "title": "string", "summary": "string" } ] }
json{ "workflow": "Document Extraction Pipeline", "trigger": "Watch folder for new PDFs", "nodes": [ { "name": "Read PDF", "type": "Read Binary Files" }, { "name": "Classify Document", "type": "AI Agent", "prompt": "Classify this document: RFI, Submittal, Contract, Spec, or Other" }, { "name": "Route by Type", "type": "Switch", "rules": ["RFI", "Submittal", "Contract", "Spec"] }, { "name": "Extract RFI", "type": "OpenAI", "schema": "rfi_schema" }, { "name": "Extract Submittal", "type": "OpenAI", "schema": "submittal_schema" }, { "name": "Save to Database", "type": "PostgreSQL", "operation": "insert" }, { "name": "Update Dashboard", "type": "HTTP Request", "method": "POST" } ] }
pythonimport base64 def extract_from_drawing(image_path: str, query: str) -> str: """Extract information from drawings using vision model""" with open(image_path, "rb") as f: image_data = base64.standard_b64encode(f.read()).decode() response = client.chat.completions.create( model="gpt-4o", messages=[ { "role": "user", "content": [ {"type": "text", "text": query}, { "type": "image_url", "image_url": { "url": f"data:image/png;base64,{image_data}" } } ] } ] ) return response.choices[0].message.content # Example: Extract room areas from floor plan areas = extract_from_drawing( "floor_plan.png", "List all rooms with their areas in square meters. Return as JSON." )
pythonfrom langchain_community.document_loaders import PyPDFLoader from langchain_text_splitters import RecursiveCharacterTextSplitter from langchain_openai import OpenAIEmbeddings from langchain_community.vectorstores import Qdrant def create_document_index(pdf_path: str): """Create searchable index for large documents""" # Load and split loader = PyPDFLoader(pdf_path) docs = loader.load() splitter = RecursiveCharacterTextSplitter( chunk_size=1000, chunk_overlap=200 ) chunks = splitter.split_documents(docs) # Create vector store embeddings = OpenAIEmbeddings() vectorstore = Qdrant.from_documents( chunks, embeddings, collection_name="contract_docs" ) return vectorstore def query_document(vectorstore, question: str) -> str: """Query document with RAG""" retriever = vectorstore.as_retriever(search_kwargs={"k": 5}) docs = retriever.invoke(question) context = "\n".join(doc.page_content for doc in docs) response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "Answer based on the contract excerpts provided."}, {"role": "user", "content": f"Context:\n{context}\n\nQuestion: {question}"} ] ) return response.choices[0].message.content # Usage index = create_document_index("contract_100pages.pdf") answer = query_document(index, "What are the liquidated damages terms?")
bashpip install openai pdfplumber langchain langchain-openai qdrant-client
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 17,821 | 12,068 | -32% | 1 | 1 | 0% | 3,705 | 4,649 | +25% | 0 | 0 | — |
case-02 | fail→pass | 20,834 | 21,806 | +5% | 1 | 1 | 0% | 4,157 | 6,621 | +59% | 0 | 0 | — |
case-03 | fail→fail | 16,463 | 14,417 | -12% | 1 | 1 | 0% | 3,172 | 4,947 | +56% | 0 | 0 | — |
case-04 | fail→fail | 12,181 | 10,771 | -12% | 1 | 1 | 0% | 2,186 | 4,042 | +85% | 0 | 0 | — |
case-05 | fail→pass | 11,937 | 5,728 | -52% | 1 | 1 | 0% | 2,061 | 3,075 | +49% | 0 | 0 | — |
case-06 | pass→pass | 12,889 | 10,043 | -22% | 1 | 1 | 0% | 2,204 | 3,783 | +72% | 0 | 0 | — |
case-07 | fail→fail | 16,009 | 13,560 | -15% | 1 | 1 | 0% | 2,967 | 4,666 | +57% | 0 | 0 | — |
case-08 | pass→pass | 7,976 | 2,889 | -64% | 1 | 1 | 0% | 1,266 | 2,602 | +106% | 0 | 0 | — |
case-09 | pass→pass | 2,830 | 3,153 | +11% | 1 | 1 | 0% | 513 | 2,668 | +420% | 0 | 0 | — |
case-10 | fail→pass | 6,186 | 1,869 | -70% | 1 | 1 | 0% | 1,094 | 2,380 | +118% | 0 | 0 | — |
case-11 | pass→pass | 10,091 | 2,972 | -71% | 1 | 1 | 0% | 1,737 | 2,566 | +48% | 0 | 0 | — |
case-12 | fail→pass | 9,210 | 2,116 | -77% | 1 | 1 | 0% | 1,513 | 2,394 | +58% | 0 | 0 | — |
case-13 | pass→pass | 13,464 | 6,718 | -50% | 1 | 1 | 0% | 2,401 | 3,298 | +37% | 0 | 0 | — |
case-14 | pass→pass | 13,946 | 14,422 | +3% | 1 | 1 | 0% | 2,531 | 4,606 | +82% | 0 | 0 | — |
case-15 | fail→pass | 16,938 | 2,078 | -88% | 1 | 1 | 0% | 3,250 | 2,425 | -25% | 0 | 0 | — |
case-16 | fail→pass | 10,563 | 7,798 | -26% | 1 | 1 | 0% | 1,724 | 3,275 | +90% | 0 | 0 | — |
case-17 | pass→pass | 8,439 | 2,897 | -66% | 1 | 1 | 0% | 1,318 | 2,578 | +96% | 0 | 0 | — |
case-18 | fail→fail | 11,695 | 10,043 | -14% | 1 | 1 | 0% | 1,885 | 3,742 | +99% | 0 | 0 | — |
case-19 | fail→pass | 8,975 | 3,042 | -66% | 1 | 1 | 0% | 1,472 | 2,620 | +78% | 0 | 0 | — |
case-20 | pass→pass | 7,650 | 8,242 | +8% | 1 | 1 | 0% | 1,248 | 3,444 | +176% | 0 | 0 | — |
case-21 | pass→pass | 5,157 | 4,171 | -19% | 1 | 1 | 0% | 971 | 2,921 | +201% | 0 | 0 | — |
case-22 | pass→pass | 14,892 | 18,150 | +22% | 1 | 1 | 0% | 3,221 | 5,925 | +84% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.