prompt-templates
Reusable prompt templates for construction AI tasks: cost estimation, schedule analysis, document processing, BIM queries. Structured prompts for consistent results.
What this skill does
# Prompt Templates for Construction AI
## Overview
Structured, reusable prompt templates optimized for construction industry AI tasks. These templates ensure consistent, high-quality outputs for cost estimation, schedule analysis, document processing, and BIM data queries.
## Template Framework
### Base Template Structure
```python
from dataclasses import dataclass, field
from typing import Dict, Any, List, Optional
from string import Template
import json
@dataclass
class PromptTemplate:
name: str
description: str
template: str
input_variables: List[str]
output_format: Optional[str] = None
examples: List[Dict[str, Any]] = field(default_factory=list)
category: str = "general"
version: str = "1.0"
def format(self, **kwargs) -> str:
"""Format template with provided variables."""
# Validate all required variables are provided
missing = [v for v in self.input_variables if v not in kwargs]
if missing:
raise ValueError(f"Missing required variables: {missing}")
# Format template
prompt = Template(self.template).safe_substitute(**kwargs)
# Add output format if specified
if self.output_format:
prompt += f"\n\nOutput Format:\n{self.output_format}"
return prompt
def with_examples(self, n: int = 2) -> str:
"""Return template with few-shot examples."""
examples_text = ""
for i, ex in enumerate(self.examples[:n], 1):
examples_text += f"\nExample {i}:\n"
examples_text += f"Input: {ex.get('input', '')}\n"
examples_text += f"Output: {ex.get('output', '')}\n"
return f"{examples_text}\n{self.template}"
class ConstructionPromptLibrary:
"""Library of construction-specific prompt templates."""
def __init__(self):
self.templates: Dict[str, PromptTemplate] = {}
self._register_defaults()
def register(self, template: PromptTemplate):
self.templates[template.name] = template
def get(self, name: str) -> Optional[PromptTemplate]:
return self.templates.get(name)
def list_by_category(self, category: str) -> List[PromptTemplate]:
return [t for t in self.templates.values() if t.category == category]
def _register_defaults(self):
# Register all default templates
for template in DEFAULT_TEMPLATES:
self.register(template)
```
## Cost Estimation Templates
### Line Item Classification
```python
COST_LINE_ITEM_CLASSIFICATION = PromptTemplate(
name="cost_line_item_classification",
description="Classify cost estimate line items to CSI MasterFormat divisions",
category="cost_estimation",
input_variables=["line_items"],
template="""You are a construction cost estimator. Classify each line item to its appropriate CSI MasterFormat division.
Line Items to Classify:
$line_items
For each line item, provide:
1. CSI Division (2-digit)
2. CSI Section (6-digit code)
3. Confidence level (high/medium/low)
Use standard CSI MasterFormat 2020 divisions:
- 03: Concrete
- 04: Masonry
- 05: Metals
- 06: Wood, Plastics, Composites
- 07: Thermal and Moisture Protection
- 08: Openings
- 09: Finishes
- 22: Plumbing
- 23: HVAC
- 26: Electrical
- 31: Earthwork
- 32: Exterior Improvements
- 33: Utilities
""",
output_format="""JSON array with format:
[
{
"line_item": "original description",
"csi_division": "XX",
"csi_section": "XX XX XX",
"csi_title": "Section Title",
"confidence": "high|medium|low"
}
]""",
examples=[
{
"input": "4000 PSI concrete for foundations",
"output": '{"csi_division": "03", "csi_section": "03 30 00", "csi_title": "Cast-in-Place Concrete", "confidence": "high"}'
}
]
)
```
### Unit Cost Validation
```python
COST_UNIT_PRICE_VALIDATION = PromptTemplate(
name="cost_unit_price_validation",
description="Validate unit prices against industry standards",
category="cost_estimation",
input_variables=["line_items", "location", "year"],
template="""You are a construction cost analyst. Review these unit prices for reasonableness.
Project Location: $location
Cost Year: $year
Line Items to Review:
$line_items
For each line item:
1. Assess if the unit price is reasonable for the location and year
2. Flag any outliers (too high or too low)
3. Suggest corrections if needed
Consider regional cost factors, labor rates, and material costs for $location.
""",
output_format="""JSON array:
[
{
"line_item": "description",
"current_unit_cost": 0.00,
"assessment": "reasonable|high|low",
"typical_range": {"low": 0.00, "high": 0.00},
"suggested_unit_cost": 0.00,
"notes": "explanation"
}
]"""
)
```
### Estimate Summary Generation
```python
COST_ESTIMATE_SUMMARY = PromptTemplate(
name="cost_estimate_summary",
description="Generate executive summary from detailed estimate",
category="cost_estimation",
input_variables=["project_name", "estimate_data", "gross_area"],
template="""Generate an executive summary for this construction cost estimate.
Project: $project_name
Gross Area: $gross_area SF
Estimate Data:
$estimate_data
Create a professional summary including:
1. Total project cost and cost per SF
2. Major cost drivers (top 5 divisions)
3. Key assumptions and exclusions
4. Risk factors affecting the estimate
5. Recommendations for cost optimization
Write in a professional tone suitable for owner/stakeholder presentation.
""",
output_format="""Markdown format with sections:
## Executive Summary
## Cost Breakdown
## Key Assumptions
## Risk Factors
## Recommendations"""
)
```
## Schedule Analysis Templates
### Critical Path Analysis
```python
SCHEDULE_CRITICAL_PATH = PromptTemplate(
name="schedule_critical_path_analysis",
description="Analyze schedule critical path and float",
category="scheduling",
input_variables=["schedule_data", "data_date"],
template="""Analyze the critical path for this construction schedule.
Data Date: $data_date
Schedule Data:
$schedule_data
Provide analysis of:
1. Current critical path activities
2. Near-critical activities (total float < 10 days)
3. Float consumption trends
4. Schedule risk areas
5. Recommendations for protecting the critical path
Focus on activities that could impact the project completion date.
""",
output_format="""JSON:
{
"critical_path": [
{"activity_id": "", "name": "", "duration": 0, "total_float": 0}
],
"near_critical": [...],
"risk_areas": ["description"],
"recommendations": ["action item"]
}"""
)
```
### Delay Analysis
```python
SCHEDULE_DELAY_ANALYSIS = PromptTemplate(
name="schedule_delay_analysis",
description="Analyze schedule delays and impacts",
category="scheduling",
input_variables=["baseline_schedule", "current_schedule", "delay_events"],
template="""Perform a delay analysis comparing baseline to current schedule.
Baseline Schedule:
$baseline_schedule
Current Schedule:
$current_schedule
Known Delay Events:
$delay_events
Analyze:
1. Total project delay in calendar days
2. Critical path delays vs non-critical delays
3. Concurrent delays
4. Pacing delays
5. Attribution of delays (owner, contractor, third-party, weather)
Use the Time Impact Analysis (TIA) methodology.
""",
output_format="""JSON:
{
"total_delay_days": 0,
"delay_breakdown": {
"owner_caused": 0,
"contractor_caused": 0,
"concurrent": 0,
"excusable": 0
},
"impacted_milestones": [...],
"recommendations": [...]
}"""
)
```
### Resource Leveling
```python
SCHEDULE_RESOURCE_LEVELING = PromptTemplate(
name="schedule_resource_leveling",
description="Suggest resource leveling for over-allocated resources",
category="scheduling",
input_variables=["schedule_data", "resource_limits"],
template="""Analyze resource allocation and suggest leveling strategies.
Schedule Data:
$schedule_data
Resource LimRelated 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.