few-shot-examples
Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.
What this skill does
# Few-Shot Examples for Construction AI
## Overview
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.
## Few-Shot Framework
### Example Manager
```python
from 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)
```
## CSI Classification Examples
```python
CSI_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"
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.