Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.
.claude/skills/datadrivenconstruction-few-shot-examples/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 204% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 219% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 331% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 313% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 738% | 0% |
Curated few-shot examples for construction industry AI tasks. These examples improve LLM performance by providing domain-specific context for classification, extraction, and analysis tasks.
pythonfrom dataclasses import dataclass, field from typing import List, Dict, Any, Optional import json import random @dataclass class FewShotExample: input: str output: str explanation: Optional[str] = None tags: List[str] = field(default_factory=list) difficulty: str = "medium" # easy, medium, hard source: str = "" @dataclass class ExampleSet: name: str description: str task_type: str examples: List[FewShotExample] version: str = "1.0" def get_examples(self, n: int = 3, difficulty: str = None) -> List[FewShotExample]: """Get n examples, optionally filtered by difficulty.""" filtered = self.examples if difficulty: filtered = [e for e in self.examples if e.difficulty == difficulty] return filtered[:n] def get_random_examples(self, n: int = 3) -> List[FewShotExample]: """Get n random examples for variety.""" return random.sample(self.examples, min(n, len(self.examples))) def format_for_prompt(self, n: int = 3) -> str: """Format examples for inclusion in prompt.""" examples = self.get_examples(n) formatted = [] for i, ex in enumerate(examples, 1): formatted.append(f"Example {i}:") formatted.append(f"Input: {ex.input}") formatted.append(f"Output: {ex.output}") if ex.explanation: formatted.append(f"Explanation: {ex.explanation}") formatted.append("") return "\n".join(formatted) class ConstructionExampleLibrary: """Library of construction-specific few-shot examples.""" def __init__(self): self.example_sets: Dict[str, ExampleSet] = {} self._register_defaults() def register(self, example_set: ExampleSet): self.example_sets[example_set.name] = example_set def get(self, name: str) -> Optional[ExampleSet]: return self.example_sets.get(name) def _register_defaults(self): for example_set in DEFAULT_EXAMPLE_SETS: self.register(example_set)
pythonCSI_CLASSIFICATION_EXAMPLES = ExampleSet( name="csi_classification", description="Examples for classifying line items to CSI MasterFormat", task_type="classification", examples=[ FewShotExample( input="4000 PSI structural concrete for foundations", output=json.dumps({ "csi_division": "03", "csi_section": "03 30 00", "csi_title": "Cast-in-Place Concrete", "confidence": "high" }), explanation="Structural concrete is Division 03, Cast-in-Place section", tags=["concrete", "structural"], difficulty="easy" ), FewShotExample( input="Grade 60 #5 reinforcing steel", output=json.dumps({ "csi_division": "03", "csi_section": "03 20 00", "csi_title": "Concrete Reinforcing", "confidence": "high" }), explanation="Rebar is in Division 03 under reinforcing, not Division 05 Metals", tags=["rebar", "concrete"], difficulty="medium" ), FewShotExample( input="8\" CMU block wall with vertical rebar", output=json.dumps({ "csi_division": "04", "csi_section": "04 22 00", "csi_title": "Concrete Unit Masonry", "confidence": "high" }), explanation="CMU is concrete masonry, Division 04", tags=["masonry", "cmu"], difficulty="easy" ), FewShotExample( input="W12x26 structural steel beams", output=json.dumps({ "csi_division": "05", "csi_section": "05 12 00", "csi_title": "Structural Steel Framing", "confidence": "high" }), explanation="Wide flange beams are structural steel, Division 05", tags=["steel", "structural"], difficulty="easy" ), FewShotExample( input="6\" spray foam insulation R-38", output=json.dumps({ "csi_division": "07", "csi_section": "07 21 00", "csi_title": "Thermal Insulation", "confidence": "high" }), explanation="All insulation types are in Division 07", tags=["insulation", "thermal"], difficulty="easy" ), FewShotExample( input="Hollow metal door frame 3'x7'", output=json.dumps({ "csi_division": "08", "csi_section": "08 11 00", "csi_title": "Metal Doors and Frames", "confidence": "high" }), explanation="Metal doors and frames are in Division 08 Openings", tags=["doors", "openings"], difficulty="easy" ), FewShotExample( input="5/8\" Type X gypsum board on metal studs", output=json.dumps({ "csi_division": "09", "csi_section": "09 29 00", "csi_title": "Gypsum Board", "confidence": "high" }), explanation="Gypsum board (drywall) is in Division 09 Finishes", tags=["drywall", "finishes"], difficulty="easy" ), FewShotExample( input="VCT flooring in corridors", output=json.dumps({ "csi_division": "09", "csi_section": "09 65 00", "csi_title": "Resilient Flooring", "confidence": "high" }), explanation="VCT (vinyl composition tile) is resilient flooring in Division 09", tags=["flooring", "finishes"], difficulty="medium" ), FewShotExample( input="Fire sprinkler system - ordinary hazard", output=json.dumps({ "csi_division": "21", "csi_section": "21 13 00", "csi_title": "Fire-Suppression Sprinkler Systems", "confidence": "high" }), explanation="Fire sprinklers are Division 21 Fire Suppression", tags=["fire protection", "mep"], difficulty="medium" ), FewShotExample( input="Domestic water piping - copper type L", output=json.dumps({ "csi_division": "22", "csi_section": "22 11 00", "csi_title": "Facility Water Distribution", "confidence": "high" }), explanation="Domestic water piping is Division 22 Plumbing", tags=["plumbing", "mep"], difficulty="medium" ), FewShotExample( input="VAV boxes with hot water reheat", output=json.dumps({ "csi_division": "23", "csi_section": "23 36 00", "csi_title": "Air Terminal Units", "confidence": "high" }), explanation="VAV boxes are air terminal units in Division 23 HVAC", tags=["hvac", "mep"], difficulty="medium" ), FewShotExample( input="277/480V 3-phase electrical distribution panel", output=json.dumps({ "csi_division": "26", "csi_section": "26 24 00", "csi_title": "Switchboards and Panelboards", "confidence": "high" }), explanation="Electrical panels are in Division 26", tags=["electrical", "mep"], difficulty="medium" ), FewShotExample( input="Site excavation and grading - 5000 CY", output=json.dumps({ "csi_division": "31", "csi_section": "31 20 00", "csi_title": "Earth Moving", "confidence": "high" }), explanation="Excavation and grading is Division 31 Earthwork", tags=["sitework", "earthwork"], difficulty="easy" ), FewShotExample( input="Asphalt paving for parking lot - 3\" thick", output=json.dumps({ "csi_division": "32", "csi_section": "32 12 00", "csi_title": "Flexible Paving", "confidence": "high" }), explanation="Asphalt paving is in Division 32 Exterior Improvements", tags=["paving", "sitework"], difficulty="easy" ), FewShotExample( input="8\" DIP water main with fittings", output=json.dumps({ "csi_division": "33", "csi_section": "33 11 00", "csi_title": "Water Utility Distribution Piping", "confidence": "high" }), explanation="Site utilities are in Division 33", tags=["utilities", "sitework"], difficulty="medium" ) ] )
pythonRFI_CLASSIFICATION_EXAMPLES = ExampleSet( name="rfi_classification", description="Examples for classifying RFI types and urgency", task_type="classification", examples=[ FewShotExample( input="Drawing A-301 shows a door at grid line 5, but the structural drawing S-102 shows a column at the same location. Please clarify.", output=json.dumps({ "rfi_type": "conflict_clarification", "disciplines": ["architectural", "structural"], "urgency": "high", "impact_areas": ["design", "schedule"], "suggested_routing": "architect" }), explanation="Drawing conflict between disciplines requires urgent resolution", tags=["conflict", "multi-discipline"], difficulty="medium" ), FewShotExample( input="Specification section 09 91 00 calls for Benjamin Moore paint, but we would like to submit Sherwin-Williams as an equal. Is this acceptable?", output=json.dumps({ "rfi_type": "substitution_request", "disciplines": ["architectural"], "urgency": "low", "impact_areas": ["cost"], "suggested_routing": "architect" }), explanation="Substitution request is low urgency, cost-driven", tags=["substitution", "finishes"], difficulty="easy" ), FewShotExample( input="We encountered rock during excavation at elevation 95.5'. Drawings show bottom of footing at elevation 94.0'. How should we proceed?", output=json.dumps({ "rfi_type": "field_condition", "disciplines": ["structural", "geotechnical"], "urgency": "critical", "impact_areas": ["design", "cost", "schedule"], "suggested_routing": "structural_engineer" }), explanation="Unforeseen site condition affecting structural design is critical", tags=["field condition", "foundation"], difficulty="hard" ), FewShotExample( input="What is the required fire rating for the corridor walls on Level 2? The drawing notes are unclear.", output=json.dumps({ "rfi_type": "clarification", "disciplines": ["architectural"], "urgency": "medium", "impact_areas": ["design"], "suggested_routing": "architect" }), explanation="Missing information request, medium urgency", tags=["fire rating", "clarification"], difficulty="easy" ), FewShotExample( input="The mechanical contractor has proposed routing ductwork through the structural transfer beam. Please confirm this is acceptable.", output=json.dumps({ "rfi_type": "coordination", "disciplines": ["mechanical", "structural"], "urgency": "high", "impact_areas": ["design", "schedule"], "suggested_routing": "structural_engineer" }), explanation="MEP penetration through structural element requires SE approval", tags=["coordination", "mep", "structural"], difficulty="medium" ) ] )
pythonCOST_ANALYSIS_EXAMPLES = ExampleSet( name="cost_analysis", description="Examples for cost analysis and validation", task_type="analysis", examples=[ FewShotExample( input=json.dumps({ "item": "Cast-in-place concrete", "unit_cost": 850, "unit": "CY", "location": "New York City", "year": 2026 }), output=json.dumps({ "assessment": "high", "typical_range": {"low": 400, "high": 700}, "variance_percent": 21.4, "likely_causes": ["high local labor rates", "difficult access", "small quantity"], "recommendation": "Review labor productivity assumptions and access conditions" }), explanation="NYC concrete costs are high, but $850/CY exceeds typical range", tags=["concrete", "unit cost", "validation"], difficulty="medium" ), FewShotExample( input=json.dumps({ "item": "Structural steel erection", "unit_cost": 1200, "unit": "TON", "location": "Houston, TX", "year": 2026 }), output=json.dumps({ "assessment": "reasonable", "typical_range": {"low": 1000, "high": 1500}, "variance_percent": 0, "likely_causes": [], "recommendation": "No action needed - within expected range" }), explanation="Steel erection cost is within normal Houston range", tags=["steel", "unit cost", "validation"], difficulty="easy" ), FewShotExample( input=json.dumps({ "item": "Gypsum board partition", "unit_cost": 3.50, "unit": "SF", "location": "Phoenix, AZ", "year": 2026 }), output=json.dumps({ "assessment": "low", "typical_range": {"low": 6, "high": 12}, "variance_percent": -41.7, "likely_causes": ["missing framing", "missing tape/finish", "labor underestimated"], "recommendation": "Verify scope includes metal studs, insulation, and Level 4 finish" }), explanation="Very low drywall cost likely missing scope items", tags=["drywall", "unit cost", "validation"], difficulty="medium" ) ] )
pythonSCHEDULE_ANALYSIS_EXAMPLES = ExampleSet( name="schedule_analysis", description="Examples for schedule analysis and review", task_type="analysis", examples=[ FewShotExample( input=json.dumps({ "activity": "Foundation concrete pour", "duration": 45, "duration_unit": "days", "quantity": 2500, "quantity_unit": "CY" }), output=json.dumps({ "assessment": "duration_appears_long", "typical_production": "100-150 CY/day", "expected_duration_range": {"low": 17, "high": 25}, "possible_reasons": ["phased pours", "complex formwork", "cure time included"], "recommendation": "Review activity scope - may include formwork and curing" }), explanation="45 days for 2500 CY seems long unless multiple activities combined", tags=["concrete", "duration", "validation"], difficulty="medium" ), FewShotExample( input=json.dumps({ "activity": "Steel erection", "duration": 60, "duration_unit": "days", "quantity": 500, "quantity_unit": "tons", "resources": ["1 erection crew"] }), output=json.dumps({ "assessment": "reasonable", "typical_production": "8-12 tons/day/crew", "expected_duration_range": {"low": 42, "high": 63}, "possible_reasons": [], "recommendation": "Duration is within expected range for single crew" }), explanation="500 tons with 1 crew at 8-10 tons/day = 50-63 days", tags=["steel", "duration", "validation"], difficulty="medium" ), FewShotExample( input=json.dumps({ "predecessor": "Foundation complete", "successor": "Steel erection", "lag": -5, "lag_unit": "days" }), output=json.dumps({ "assessment": "aggressive", "concern": "Steel erection starting 5 days before foundation complete", "typical_practice": "FS+0 to FS+5 lag for concrete cure", "risk_level": "high", "recommendation": "Verify foundation is cured sufficiently before steel loads applied" }), explanation="Negative lag on foundation to steel is risky", tags=["logic", "dependency", "validation"], difficulty="hard" ) ] )
pythonBIM_EXTRACTION_EXAMPLES = ExampleSet( name="bim_extraction", description="Examples for BIM data extraction and interpretation", task_type="extraction", examples=[ FewShotExample( input=json.dumps({ "element_type": "IfcWall", "properties": { "Name": "Interior Partition", "IsExternal": False, "FireRating": "1 Hour", "Pset_WallCommon.Width": 0.165, "BaseQuantities.GrossArea": 45.5, "BaseQuantities.NetArea": 42.3 } }), output=json.dumps({ "classification": "Interior wall", "fire_rated": True, "fire_rating": "1 Hour", "thickness_mm": 165, "thickness_in": 6.5, "gross_area_m2": 45.5, "gross_area_sf": 490, "net_area_sf": 455, "opening_deduction_pct": 7.0 }), explanation="Extract and convert BIM properties to construction quantities", tags=["wall", "quantities", "ifc"], difficulty="medium" ), FewShotExample( input=json.dumps({ "element_type": "IfcDoor", "properties": { "Name": "D-01", "OverallWidth": 0.914, "OverallHeight": 2.134, "FireRating": None, "Pset_DoorCommon.IsExternal": False, "Pset_DoorCommon.HandicapAccessible": True } }), output=json.dumps({ "door_type": "D-01", "size": "3'-0\" x 7'-0\"", "size_standard": "36x84", "fire_rated": False, "ada_compliant": True, "classification": "Interior door, ADA" }), explanation="Interpret door properties for specification compliance", tags=["door", "ada", "ifc"], difficulty="easy" ), FewShotExample( input=json.dumps({ "element_type": "IfcSpace", "properties": { "Name": "Conference Room 101", "LongName": "Large Conference Room", "Pset_SpaceCommon.NetFloorArea": 55.7, "Pset_SpaceOccupancyRequirements.OccupancyNumber": 20, "Pset_SpaceFireSafetyRequirements.FireRiskFactor": "Low" } }), output=json.dumps({ "space_name": "Conference Room 101", "net_area_sf": 600, "occupancy": 20, "area_per_person_sf": 30, "occupancy_assessment": "typical for conference", "code_check": "IBC allows 15 SF/person for assembly, 600 SF / 15 = 40 max" }), explanation="Validate space programming against code requirements", tags=["space", "occupancy", "code"], difficulty="hard" ) ] )
python# Initialize library library = ConstructionExampleLibrary() # Get example set csi_examples = library.get("csi_classification") # Format for prompt examples_text = csi_examples.format_for_prompt(n=3) # Build complete prompt prompt = f"""Classify the following line items to CSI MasterFormat. {examples_text} Now classify these items: 1. Aluminum storefront framing 2. Acoustic ceiling tiles 3. Elevator cab finishes """ # Or get specific examples easy_examples = csi_examples.get_examples(n=2, difficulty="easy") random_examples = csi_examples.get_random_examples(n=3)
python# Create custom example set for your project my_examples = ExampleSet( name="my_project_classification", description="Project-specific classification examples", task_type="classification", examples=[ FewShotExample( input="Your specific input", output="Expected output", explanation="Why this classification", tags=["custom"], difficulty="medium" ) ] ) # Register to library library.register(my_examples)
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 14,967 | 35,601 | +138% | 1 | 1 | 0% | 2,839 | 8,618 | +204% | 0 | 0 | — |
case-02 | fail→fail | 11,968 | 17,863 | +49% | 1 | 1 | 0% | 2,225 | 8,882 | +299% | 0 | 0 | — |
case-03 | fail→fail | 13,526 | 20,326 | +50% | 1 | 1 | 0% | 2,606 | 9,648 | +270% | 0 | 0 | — |
case-04 | fail→fail | 14,649 | 16,018 | +9% | 1 | 1 | 0% | 3,120 | 9,081 | +191% | 0 | 0 | — |
case-05 | fail→fail | 17,230 | 12,373 | -28% | 1 | 1 | 0% | 2,954 | 8,084 | +174% | 0 | 0 | — |
case-06 | fail→pass | 14,101 | 12,984 | -8% | 1 | 1 | 0% | 2,633 | 8,404 | +219% | 0 | 0 | — |
case-07 | fail→fail | 11,046 | 11,745 | +6% | 1 | 1 | 0% | 2,233 | 7,907 | +254% | 0 | 0 | — |
case-08 | fail→fail | 13,947 | 10,273 | -26% | 1 | 1 | 0% | 2,702 | 7,910 | +193% | 0 | 0 | — |
case-09 | fail→fail | 8,450 | 11,682 | +38% | 1 | 1 | 0% | 1,611 | 8,101 | +403% | 0 | 0 | — |
case-10 | fail→fail | 10,607 | 11,537 | +9% | 1 | 1 | 0% | 2,244 | 8,329 | +271% | 0 | 0 | — |
case-11 | fail→pass | 9,857 | 12,516 | +27% | 1 | 1 | 0% | 1,939 | 8,358 | +331% | 0 | 0 | — |
case-12 | fail→fail | 18,312 | 17,880 | -2% | 1 | 1 | 0% | 3,688 | 9,484 | +157% | 0 | 0 | — |
case-13 | fail→pass | 10,088 | 5,006 | -50% | 1 | 1 | 0% | 1,599 | 6,611 | +313% | 0 | 0 | — |
case-14 | pass→pass | 7,628 | 5,295 | -31% | 1 | 1 | 0% | 1,365 | 6,772 | +396% | 0 | 0 | — |
case-15 | fail→pass | 3,943 | 2,344 | -41% | 1 | 1 | 0% | 738 | 6,184 | +738% | 0 | 0 | — |
case-16 | fail→pass | 9,603 | 7,918 | -18% | 1 | 1 | 0% | 1,756 | 7,161 | +308% | 0 | 0 | — |
case-17 | pass→pass | 8,567 | 2,683 | -69% | 1 | 1 | 0% | 1,654 | 6,227 | +276% | 0 | 0 | — |
case-18 | fail→pass | 6,750 | 2,750 | -59% | 1 | 1 | 0% | 1,137 | 6,248 | +450% | 0 | 0 | — |
case-19 | fail→pass | 9,092 | 3,106 | -66% | 1 | 1 | 0% | 1,444 | 6,305 | +337% | 0 | 0 | — |
case-20 | pass→pass | 17,737 | 22,421 | +26% | 1 | 1 | 0% | 3,755 | 10,532 | +180% | 0 | 0 | — |
case-21 | pass→pass | 12,243 | 11,162 | -9% | 1 | 1 | 0% | 2,750 | 8,413 | +206% | 0 | 0 | — |
case-22 | pass→pass | 10,806 | 10,709 | -1% | 1 | 1 | 0% | 2,228 | 7,917 | +255% | 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 +36 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.