historical-data-manager
Extract, clean, and organize legacy construction data from archives. Migrate historical project data, cost records, and schedules into modern formats.
What this skill does
# Historical Data Manager for Construction
## Overview
Manage legacy construction data from archives, old systems, and historical records. Extract, clean, normalize, and migrate data into modern formats for analysis and benchmarking.
## Business Case
Construction companies accumulate decades of project data in various formats:
- Paper records scanned to PDF
- Legacy database exports (Access, dBase, FoxPro)
- Old spreadsheet formats (Lotus 1-2-3, early Excel)
- Proprietary software exports
- Project closeout documentation
This skill helps extract value from historical data for:
- Cost benchmarking and trending
- Productivity analysis over time
- Risk pattern identification
- Estimating improvement
## Technical Implementation
### Historical Data Extractor
```python
from dataclasses import dataclass, field
from typing import List, Dict, Any, Optional
from datetime import datetime
from pathlib import Path
import pandas as pd
import re
import json
@dataclass
class HistoricalRecord:
project_id: str
project_name: str
year: int
data_type: str # cost, schedule, labor, material
original_format: str
extracted_data: Dict[str, Any]
quality_score: float
notes: List[str] = field(default_factory=list)
class HistoricalDataManager:
"""Manage extraction and normalization of historical construction data."""
def __init__(self, archive_path: str):
self.archive_path = Path(archive_path)
self.records: List[HistoricalRecord] = []
self.normalization_rules = self._load_normalization_rules()
def scan_archive(self) -> Dict[str, int]:
"""Scan archive and categorize files by type."""
file_types = {}
for file_path in self.archive_path.rglob('*'):
if file_path.is_file():
ext = file_path.suffix.lower()
file_types[ext] = file_types.get(ext, 0) + 1
return file_types
def extract_from_legacy_excel(self, file_path: str, year: int) -> List[HistoricalRecord]:
"""Extract data from legacy Excel files."""
records = []
try:
# Try different engines for old formats
try:
df = pd.read_excel(file_path, engine='openpyxl')
except:
df = pd.read_excel(file_path, engine='xlrd')
# Detect data type from content
data_type = self._detect_data_type(df)
# Normalize column names
df = self._normalize_columns(df)
# Extract project info
project_info = self._extract_project_info(df, file_path)
record = HistoricalRecord(
project_id=project_info.get('id', f'LEGACY-{year}-{hash(file_path) % 10000}'),
project_name=project_info.get('name', Path(file_path).stem),
year=year,
data_type=data_type,
original_format='excel',
extracted_data=df.to_dict('records'),
quality_score=self._assess_quality(df)
)
records.append(record)
except Exception as e:
print(f"Error extracting {file_path}: {e}")
return records
def extract_from_csv(self, file_path: str, year: int) -> HistoricalRecord:
"""Extract data from CSV files with encoding detection."""
# Try different encodings
encodings = ['utf-8', 'latin-1', 'cp1252', 'iso-8859-1']
for encoding in encodings:
try:
df = pd.read_csv(file_path, encoding=encoding)
break
except:
continue
df = self._normalize_columns(df)
data_type = self._detect_data_type(df)
return HistoricalRecord(
project_id=f'CSV-{year}-{hash(file_path) % 10000}',
project_name=Path(file_path).stem,
year=year,
data_type=data_type,
original_format='csv',
extracted_data=df.to_dict('records'),
quality_score=self._assess_quality(df)
)
def extract_from_database_export(self, file_path: str, db_type: str) -> List[HistoricalRecord]:
"""Extract data from legacy database exports."""
records = []
if db_type == 'access':
# Read Access MDB/ACCDB files
import pyodbc
conn_str = f'DRIVER={{Microsoft Access Driver (*.mdb, *.accdb)}};DBQ={file_path}'
conn = pyodbc.connect(conn_str)
# Get all tables
cursor = conn.cursor()
tables = [row.table_name for row in cursor.tables(tableType='TABLE')]
for table in tables:
df = pd.read_sql(f'SELECT * FROM [{table}]', conn)
# Process each table...
conn.close()
return records
def normalize_cost_data(self, records: List[HistoricalRecord], base_year: int = 2026) -> pd.DataFrame:
"""Normalize historical cost data to current dollars."""
# RSMeans historical cost indices (example values)
cost_indices = {
2015: 0.82, 2016: 0.84, 2017: 0.87, 2018: 0.90,
2019: 0.93, 2020: 0.95, 2021: 0.98, 2022: 1.02,
2023: 1.06, 2024: 1.10, 2025: 1.14, 2026: 1.18
}
normalized_data = []
for record in records:
if record.data_type == 'cost':
year_index = cost_indices.get(record.year, 1.0)
base_index = cost_indices.get(base_year, 1.18)
escalation_factor = base_index / year_index
for item in record.extracted_data:
if 'amount' in item or 'cost' in item:
original_cost = item.get('amount') or item.get('cost', 0)
normalized_item = item.copy()
normalized_item['original_cost'] = original_cost
normalized_item['normalized_cost'] = original_cost * escalation_factor
normalized_item['escalation_factor'] = escalation_factor
normalized_item['original_year'] = record.year
normalized_item['project_id'] = record.project_id
normalized_data.append(normalized_item)
return pd.DataFrame(normalized_data)
def _detect_data_type(self, df: pd.DataFrame) -> str:
"""Detect type of data from column names and content."""
columns_lower = [c.lower() for c in df.columns]
if any(c in columns_lower for c in ['cost', 'amount', 'price', 'total', 'budget']):
return 'cost'
elif any(c in columns_lower for c in ['start', 'finish', 'duration', 'task', 'activity']):
return 'schedule'
elif any(c in columns_lower for c in ['hours', 'labor', 'worker', 'crew']):
return 'labor'
elif any(c in columns_lower for c in ['material', 'quantity', 'unit', 'supplier']):
return 'material'
else:
return 'unknown'
def _normalize_columns(self, df: pd.DataFrame) -> pd.DataFrame:
"""Normalize column names to standard format."""
column_mapping = {
r'proj.*id': 'project_id',
r'proj.*name': 'project_name',
r'desc.*': 'description',
r'qty|quantity': 'quantity',
r'unit.*cost|unit.*price': 'unit_cost',
r'total|amount': 'amount',
r'start.*date': 'start_date',
r'end.*date|finish.*date': 'end_date',
r'dur.*': 'duration',
}
new_columns = {}
for col in df.columns:
col_lower = col.lower().strip()
for pattern, new_name in column_mapping.items():
if re.match(pattern, col_lower):
new_columns[col] = new_name
break
return df.rename(columns=new_columns)
def _assess_quality(self, df: pd.DataFrame) -> float:
"""Assess data quality score (0-1)."""
if df.emptRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.