cwicr-schedule-integrator
Integrate CWICR cost data with project schedules. Link work items to schedule activities, generate cost-loaded schedules, and cash flow projections.
What this skill does
# CWICR Schedule Integrator
## Business Case
### Problem Statement
Project planning requires:
- Linking costs to schedule activities
- Generating cost-loaded schedules
- Projecting cash flow requirements
- Tracking earned value
### Solution
Integrate CWICR cost data with project schedules to create cost-loaded Gantt charts, cash flow curves, and earned value tracking.
### Business Value
- **Cost visibility** - See when costs occur
- **Cash flow** - Project funding requirements
- **Earned value** - Track cost/schedule performance
- **Integration** - Connect cost and schedule data
## Technical Implementation
```python
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from datetime import datetime, timedelta, date
from enum import Enum
from collections import defaultdict
class CostDistribution(Enum):
"""Methods for distributing costs over time."""
UNIFORM = "uniform" # Even distribution
FRONT_LOADED = "front_loaded" # More at start
BACK_LOADED = "back_loaded" # More at end
S_CURVE = "s_curve" # S-curve distribution
@dataclass
class ScheduleActivity:
"""Project schedule activity."""
activity_id: str
description: str
start_date: date
end_date: date
duration_days: int
work_items: List[str]
budgeted_cost: float
predecessors: List[str] = field(default_factory=list)
@dataclass
class CostLoadedActivity:
"""Activity with daily cost distribution."""
activity: ScheduleActivity
daily_costs: Dict[date, float]
cumulative_costs: Dict[date, float]
@dataclass
class CashFlowProjection:
"""Cash flow projection."""
project_name: str
start_date: date
end_date: date
total_cost: float
daily_costs: Dict[date, float]
weekly_costs: Dict[str, float]
monthly_costs: Dict[str, float]
cumulative: Dict[date, float]
@dataclass
class EarnedValueMetrics:
"""Earned value metrics at point in time."""
data_date: date
planned_value: float # PV / BCWS
earned_value: float # EV / BCWP
actual_cost: float # AC / ACWP
schedule_variance: float # SV = EV - PV
cost_variance: float # CV = EV - AC
spi: float # Schedule Performance Index
cpi: float # Cost Performance Index
eac: float # Estimate at Completion
etc: float # Estimate to Complete
class CWICRScheduleIntegrator:
"""Integrate CWICR costs with project schedules."""
def __init__(self, cwicr_data: pd.DataFrame):
self.cost_data = cwicr_data
self._index_data()
def _index_data(self):
"""Index cost data."""
if 'work_item_code' in self.cost_data.columns:
self._code_index = self.cost_data.set_index('work_item_code')
else:
self._code_index = None
def get_work_item_cost(self, code: str, quantity: float) -> float:
"""Get total cost for work item."""
if self._code_index is None or code not in self._code_index.index:
return 0
item = self._code_index.loc[code]
labor = float(item.get('labor_cost', 0) or 0)
material = float(item.get('material_cost', 0) or 0)
equipment = float(item.get('equipment_cost', 0) or 0)
return (labor + material + equipment) * quantity
def create_schedule_activity(self,
activity_id: str,
description: str,
start_date: date,
duration_days: int,
work_items: List[Dict[str, Any]],
predecessors: List[str] = None) -> ScheduleActivity:
"""Create schedule activity with linked work items."""
# Calculate budgeted cost
total_cost = 0
codes = []
for item in work_items:
code = item.get('work_item_code', item.get('code'))
qty = item.get('quantity', 0)
total_cost += self.get_work_item_cost(code, qty)
codes.append(code)
end_date = start_date + timedelta(days=duration_days)
return ScheduleActivity(
activity_id=activity_id,
description=description,
start_date=start_date,
end_date=end_date,
duration_days=duration_days,
work_items=codes,
budgeted_cost=round(total_cost, 2),
predecessors=predecessors or []
)
def distribute_cost(self,
activity: ScheduleActivity,
method: CostDistribution = CostDistribution.UNIFORM) -> CostLoadedActivity:
"""Distribute activity cost over duration."""
daily_costs = {}
days = activity.duration_days
if days == 0:
daily_costs[activity.start_date] = activity.budgeted_cost
else:
if method == CostDistribution.UNIFORM:
daily_amount = activity.budgeted_cost / days
for i in range(days):
day = activity.start_date + timedelta(days=i)
daily_costs[day] = daily_amount
elif method == CostDistribution.FRONT_LOADED:
# Higher at start, decreasing
total_weight = sum(range(days, 0, -1))
for i in range(days):
day = activity.start_date + timedelta(days=i)
weight = (days - i) / total_weight
daily_costs[day] = activity.budgeted_cost * weight
elif method == CostDistribution.BACK_LOADED:
# Lower at start, increasing
total_weight = sum(range(1, days + 1))
for i in range(days):
day = activity.start_date + timedelta(days=i)
weight = (i + 1) / total_weight
daily_costs[day] = activity.budgeted_cost * weight
elif method == CostDistribution.S_CURVE:
# S-curve distribution (sigmoid)
for i in range(days):
day = activity.start_date + timedelta(days=i)
# Sigmoid function normalized
x = (i / days - 0.5) * 10
sigmoid = 1 / (1 + np.exp(-x))
daily_costs[day] = activity.budgeted_cost * sigmoid / days * 2
# Calculate cumulative
cumulative = {}
running_total = 0
for day in sorted(daily_costs.keys()):
running_total += daily_costs[day]
cumulative[day] = running_total
return CostLoadedActivity(
activity=activity,
daily_costs=daily_costs,
cumulative_costs=cumulative
)
def generate_cash_flow(self,
activities: List[ScheduleActivity],
project_name: str = "Project",
distribution: CostDistribution = CostDistribution.S_CURVE) -> CashFlowProjection:
"""Generate project cash flow projection."""
# Distribute costs for all activities
loaded_activities = [
self.distribute_cost(a, distribution)
for a in activities
]
# Aggregate daily costs
daily_costs = defaultdict(float)
for loaded in loaded_activities:
for day, cost in loaded.daily_costs.items():
daily_costs[day] += cost
# Sort and calculate cumulative
sorted_days = sorted(daily_costs.keys())
cumulative = {}
running_total = 0
for day in sorted_days:
running_total += daily_costs[day]
cumulative[day] = running_total
# Aggregate to weekly
weekly_costs = defaultdict(float)
for day, cost in daily_costs.items():
week_key = day.strftime('%Y-W%W')
weekly_costs[week_kRelated 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.