cwicr-report-generator
БесплатноБез исполняемых скриптовНе проверенGenerate professional cost estimation reports from CWICR calculations. HTML, PDF, Excel outputs with charts and breakdowns.
от datadrivenconstruction★ 461 звезда на GitHubОб этом скилле
CWICR Report Generator
Overview
Generate professional cost reports from CWICR calculations - executive summaries, detailed breakdowns, charts, and export to multiple formats.
Python Implementation
import 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
Установить cwicr-report-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cwicr-report-generator?
Generate professional cost estimation reports from CWICR calculations. HTML, PDF, Excel outputs with charts and breakdowns.
Как установить скилл cwicr-report-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cwicr-report-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic