Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

few-shot-examples

БесплатноБез исполняемых скриптовНе проверен

Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.

datadrivenconstructionот datadrivenconstruction★ 461 звезда на GitHub

Об этом скилле

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

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

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'",
Полный SKILL.md на GitHub

Установить few-shot-examples в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

claw.jsoninstructions.md

FAQ

Что делает скилл few-shot-examples?

Curated few-shot examples for construction AI tasks: classification, extraction, analysis. Domain-specific examples for improved LLM performance.

Как установить скилл few-shot-examples?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл few-shot-examples запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить few-shot-examples с