Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate professional cost estimation reports from CWICR calculations. HTML, PDF, Excel outputs with charts and breakdowns.
.claude/skills/datadrivenconstruction-cwicr-report-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 59% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 192% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 136% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 131% | 0% |
Generate professional cost reports from CWICR calculations - executive summaries, detailed breakdowns, charts, and export to multiple formats.
pythonimport pandas as pd from typing import Dict, Any, List, Optional from dataclasses import dataclass, field from datetime import datetime from pathlib import Path import json @dataclass class ReportSection: """Report section content.""" title: str content: str chart_type: Optional[str] = None chart_data: Optional[Dict] = None @dataclass class CostReport: """Complete cost report.""" project_name: str generated_date: datetime total_cost: float currency: str sections: List[ReportSection] line_items: List[Dict] summary: Dict[str, Any] class CWICRReportGenerator: """Generate cost estimation reports.""" def __init__(self, project_name: str = "Project", currency: str = "USD"): self.project_name = project_name self.currency = currency self.sections: List[ReportSection] = [] self.line_items: List[Dict] = [] def add_summary(self, summary_data: Dict[str, float]): """Add executive summary section.""" content = f""" <div class="summary-box"> <h3>Cost Summary</h3> <table class="summary-table"> <tr><td>Labor</td><td class="amount">${summary_data.get('labor', 0):,.2f}</td></tr> <tr><td>Materials</td><td class="amount">${summary_data.get('material', 0):,.2f}</td></tr> <tr><td>Equipment</td><td class="amount">${summary_data.get('equipment', 0):,.2f}</td></tr> <tr><td>Overhead</td><td class="amount">${summary_data.get('overhead', 0):,.2f}</td></tr> <tr><td>Profit</td><td class="amount">${summary_data.get('profit', 0):,.2f}</td></tr> <tr class="total"><td>TOTAL</td><td class="amount">${summary_data.get('total', 0):,.2f}</td></tr> </table> </div> """ self.sections.append(ReportSection( title="Executive Summary", content=content, chart_type="pie", chart_data={ 'labels': ['Labor', 'Materials', 'Equipment', 'Overhead', 'Profit'], 'values': [ summary_data.get('labor', 0), summary_data.get('material', 0), summary_data.get('equipment', 0), summary_data.get('overhead', 0), summary_data.get('profit', 0) ] } )) def add_breakdown_by_category(self, breakdown: Dict[str, float]): """Add breakdown by category section.""" rows = "" for category, cost in sorted(breakdown.items(), key=lambda x: -x[1]): rows += f"<tr><td>{category}</td><td class='amount'>${cost:,.2f}</td></tr>" content = f""" <table class="detail-table"> <thead><tr><th>Category</th><th>Cost</th></tr></thead> <tbody>{rows}</tbody> </table> """ self.sections.append(ReportSection( title="Cost by Category", content=content, chart_type="bar", chart_data={ 'labels': list(breakdown.keys()), 'values': list(breakdown.values()) } )) def add_line_items(self, items: List[Dict]): """Add detailed line items.""" self.line_items = items rows = "" for item in items[:50]: # Limit for report rows += f""" <tr> <td>{item.get('code', '')}</td> <td>{item.get('description', '')[:50]}</td> <td>{item.get('quantity', 0):,.2f}</td> <td>{item.get('unit', '')}</td> <td class="amount">${item.get('unit_price', 0):,.2f}</td> <td class="amount">${item.get('total', 0):,.2f}</td> </tr> """ content = f""" <table class="line-items"> <thead> <tr> <th>Code</th> <th>Description</th> <th>Qty</th> <th>Unit</th> <th>Unit Price</th> <th>Total</th> </tr> </thead> <tbody>{rows}</tbody> </table> """ self.sections.append(ReportSection( title="Line Items", content=content )) def generate_html(self) -> str: """Generate HTML report.""" sections_html = "" for section in self.sections: sections_html += f""" <section class="report-section"> <h2>{section.title}</h2> {section.content} </section> """ html = f""" <!DOCTYPE html> <html> <head> <title>Cost Report - {self.project_name}</title> <style> body {{ font-family: 'Segoe UI', Arial, sans-serif; margin: 40px; background: #f5f5f5; }} .report-container {{ max-width: 1200px; margin: 0 auto; background: white; padding: 40px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }} h1 {{ color: #2c3e50; border-bottom: 3px solid #3498db; padding-bottom: 10px; }} h2 {{ color: #34495e; margin-top: 30px; }} .summary-box {{ background: #ecf0f1; padding: 20px; border-radius: 8px; }} table {{ width: 100%; border-collapse: collapse; margin: 20px 0; }} th, td {{ padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }} th {{ background: #3498db; color: white; }} .amount {{ text-align: right; font-family: monospace; }} .total {{ font-weight: bold; background: #f8f9fa; }} .line-items td {{ font-size: 0.9em; }} .meta {{ color: #7f8c8d; font-size: 0.9em; margin-bottom: 20px; }} </style> </head> <body> <div class="report-container"> <h1>Cost Estimation Report</h1> <div class="meta"> <p>Project: {self.project_name}</p> <p>Generated: {datetime.now().strftime('%Y-%m-%d %H:%M')}</p> <p>Currency: {self.currency}</p> </div> {sections_html} <footer style="margin-top: 40px; color: #95a5a6; text-align: center;"> Generated by DDC CWICR | DataDrivenConstruction.io </footer> </div> </body> </html> """ return html def save_html(self, output_path: str) -> str: """Save HTML report to file.""" html = self.generate_html() with open(output_path, 'w', encoding='utf-8') as f: f.write(html) return output_path def generate_excel(self, output_path: str) -> str: """Generate Excel report.""" with pd.ExcelWriter(output_path, engine='openpyxl') as writer: # Summary sheet if self.sections: summary_data = [] for section in self.sections: if section.chart_data: for i, label in enumerate(section.chart_data.get('labels', [])): summary_data.append({ 'Category': label, 'Amount': section.chart_data.get('values', [])[i] }) if summary_data: pd.DataFrame(summary_data).to_excel( writer, sheet_name='Summary', index=False) # Line items sheet if self.line_items: pd.DataFrame(self.line_items).to_excel( writer, sheet_name='Line Items', index=False) return output_path def generate_json(self) -> str: """Generate JSON report.""" report = { 'project_name': self.project_name, 'generated_date': datetime.now().isoformat(), 'currency': self.currency, 'sections': [ { 'title': s.title, 'chart_data': s.chart_data } for s in self.sections ], 'line_items': self.line_items } return json.dumps(report, indent=2) class QuickReport: """Quick report generation from cost data.""" @staticmethod def from_dataframe(df: pd.DataFrame, project_name: str = "Project") -> CWICRReportGenerator: """Generate report from cost DataFrame.""" gen = CWICRReportGenerator(project_name) # Calculate summary summary = { 'labor': df['labor_cost'].sum() if 'labor_cost' in df.columns else 0, 'material': df['material_cost'].sum() if 'material_cost' in df.columns else 0, 'equipment': df['equipment_cost'].sum() if 'equipment_cost' in df.columns else 0, 'overhead': df['overhead_cost'].sum() if 'overhead_cost' in df.columns else 0, 'profit': df['profit_cost'].sum() if 'profit_cost' in df.columns else 0, 'total': df['total_cost'].sum() if 'total_cost' in df.columns else 0 } gen.add_summary(summary) # Category breakdown if 'category' in df.columns and 'total_cost' in df.columns: breakdown = df.groupby('category')['total_cost'].sum().to_dict() gen.add_breakdown_by_category(breakdown) # Line items items = df.to_dict('records') gen.add_line_items(items) return gen
python# Create report generator gen = CWICRReportGenerator("Office Building", currency="EUR") # Add sections gen.add_summary({ 'labor': 125000, 'material': 350000, 'equipment': 75000, 'overhead': 82500, 'profit': 63250, 'total': 695750 }) # Save reports gen.save_html("cost_report.html") gen.generate_excel("cost_report.xlsx")
python# Quick report from cost DataFrame report = QuickReport.from_dataframe(cost_df, "My Project") report.save_html("quick_report.html")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 14,537 | 10,066 | -31% | 1 | 1 | 0% | 3,151 | 4,999 | +59% | 0 | 0 | — |
case-01 | fail→pass | 27,401 | 23,387 | -15% | 1 | 1 | 0% | 6,199 | 8,115 | +31% | 0 | 0 | — |
case-03 | fail→pass | 12,219 | 19,658 | +61% | 1 | 1 | 0% | 2,537 | 7,398 | +192% | 0 | 0 | — |
case-04 | pass→fail | 18,732 | 24,505 | +31% | 1 | 1 | 0% | 3,114 | 7,262 | +133% | 0 | 0 | — |
case-05 | pass→pass | 16,112 | 14,807 | -8% | 1 | 1 | 0% | 3,003 | 5,942 | +98% | 0 | 0 | — |
case-06 | pass→pass | 14,637 | 12,528 | -14% | 1 | 1 | 0% | 2,716 | 5,091 | +87% | 0 | 0 | — |
case-07 | fail→pass | 8,681 | 4,094 | -53% | 1 | 1 | 0% | 1,503 | 3,547 | +136% | 0 | 0 | — |
case-16 | fail→pass | 8,122 | 2,126 | -74% | 1 | 1 | 0% | 1,336 | 3,084 | +131% | 0 | 0 | — |
case-08 | fail→fail | 9,917 | 4,197 | -58% | 1 | 1 | 0% | 1,661 | 3,576 | +115% | 0 | 0 | — |
case-09 | fail→pass | 6,377 | 2,966 | -53% | 1 | 1 | 0% | 950 | 3,218 | +239% | 0 | 0 | — |
case-10 | fail→pass | 11,078 | 2,728 | -75% | 1 | 1 | 0% | 1,692 | 3,241 | +92% | 0 | 0 | — |
case-11 | fail→fail | 7,342 | 3,147 | -57% | 1 | 1 | 0% | 1,052 | 3,371 | +220% | 0 | 0 | — |
case-12 | fail→fail | 9,285 | 2,177 | -77% | 1 | 1 | 0% | 1,395 | 2,996 | +115% | 0 | 0 | — |
case-13 | fail→pass | 14,668 | 3,004 | -80% | 1 | 1 | 0% | 2,363 | 3,355 | +42% | 0 | 0 | — |
case-14 | fail→pass | 12,469 | 4,793 | -62% | 1 | 1 | 0% | 2,109 | 3,696 | +75% | 0 | 0 | — |
case-15 | pass→pass | 10,631 | 4,022 | -62% | 1 | 1 | 0% | 1,472 | 3,546 | +141% | 0 | 0 | — |
case-17 | fail→pass | 12,846 | 3,006 | -77% | 1 | 1 | 0% | 2,247 | 3,348 | +49% | 0 | 0 | — |
case-18 | fail→pass | 11,162 | 1,604 | -86% | 1 | 1 | 0% | 1,766 | 3,038 | +72% | 0 | 0 | — |
case-19 | fail→pass | 5,945 | 1,998 | -66% | 1 | 1 | 0% | 826 | 3,092 | +274% | 0 | 0 | — |
case-20 | fail→pass | 9,280 | 8,671 | -7% | 1 | 1 | 0% | 1,495 | 4,402 | +194% | 0 | 0 | — |
case-21 | fail→pass | 12,802 | 4,463 | -65% | 1 | 1 | 0% | 2,064 | 3,626 | +76% | 0 | 0 | — |
case-22 | fail→pass | 11,600 | 3,187 | -73% | 1 | 1 | 0% | 2,085 | 3,373 | +62% | 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 +64 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
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.