cashflow-forecaster

cashflow-forecaster is a skill for Claude Code, Codex from datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction. It costs 30 tokens per session (3,576 once invoked), scanned A, original, MIT.

A tool for forecasting the movement of money through a construction project. It compares expected payments with project expenses over time and accounts for billing cycles and payment terms.

In plain words
What is it for?
Use it to project income and costs, identify possible cash shortfalls, support financing decisions, and plan when payments should be made or received.
Why use it?
It helps reveal periods when expenses may arrive before customer payments. Teams can use that view to spot funding gaps and plan payment timing.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to project income and costs, identify possible cash shortfalls, support financing decisions, and plan when payments should be made or received.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill cashflow-forecaster
Clone the repo
git clone --depth 1 https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cashflow-forecaster

README.md
[![agentmods](https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster/github.svg)](https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster)
Your own site
<a href="https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster"><img src="https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cashflow-forecaster

Your own site · 80×15
<a href="https://agentmods.dev/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster"><img src="https://agentmods.dev/badge/skills/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction/cashflow-forecaster.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,576 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.03576
Opus 5 $0.00015 $0.01788
Sonnet 5 $0.00006 $0.00715
Haiku 4.5 $0.00003 $0.00358

Measured 8d ago against content hash d878cf9b6a1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

cashflow-forecaster scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

4_DDC_Curated/Financial-Management/cashflow-forecaster/SKILL.md · 460 lines

How it starts

The opening of the file, as written. The whole thing — 460 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cashflow Forecaster

Overview

Forecast construction project cash flow based on schedule, billing cycles, and payment terms. Identify potential cash shortfalls, optimize payment timing, and support project financing decisions.

Cash Flow Curve

┌─────────────────────────────────────────────────────────────────┐
│                    CONSTRUCTION CASH FLOW                        │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  $   Income (payments received)                                 │
│  │         ╱──────────╲                                         │
│  │       ╱              ╲    Positive cash                      │
│  │     ╱                  ╲  position                           │
│  │   ╱                      ╲                                   │
│  │ ╱     Cash Gap             ╲                                 │
│  ├─────────────────────────────────────────────────────         │
│  │╲                                                             │
│  │  ╲    Expenses (costs incurred)                              │
│  │    ╲──────────╱                                              │
│  │                                                              │
│  └──────────────────────────────────────────────────────────    │
│        Time →                                                    │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Technical Implementation

from dataclasses import dataclass, field
from typing import List, Dict, Optional, Tuple
from datetime import datetime, timedelta
from enum import Enum
import math

class CostCategory(Enum):
    LABOR = "labor"
    MATERIALS = "materials"
    EQUIPMENT = "equipment"
    SUBCONTRACTOR = "subcontractor"
    GENERAL_CONDITIONS = "general_conditions"
    OVERHEAD = "overhead"
    OTHER = "other"

class PaymentTerms(Enum):
    NET_30 = 30
    NET_45 = 45
    NET_60 = 60
    NET_90 = 90

@dataclass
class CostItem:
    id: str
    description: str
    category: CostCategory
    amount: float
    scheduled_date: datetime
    payment_terms_days: int = 30
    paid: bool = False
    paid_date: Optional[datetime] = None

@dataclass
class IncomeItem:
    id: str
    description: str
    amount: float
    billing_date: datetime
    expected_payment_date: datetime
    received: bool = False
    received_date: Optional[datetime] = None
    received_amount: float = 0.0

@dataclass
class CashFlowPeriod:
    period_start: datetime
    period_end: datetime
    opening_balance: float
    income: float
    expenses: float
    net_cashflow: float
    closing_balance: float
    cumulative_income: float
    cumulative_expenses: float

@dataclass
class CashFlowForecast:
    project_name: str
    forecast_date: datetime
    total_contract: float
    total_costs: float
    periods: List[CashFlowPeriod]
    peak_deficit: float
    peak_deficit_date: datetime
    breakeven_date: Optional[datetime]
    financing_required: float

class CashFlowForecaster:
    """Forecast construction project cash flow."""

    # Typical cost distribution curve (S-curve)
    S_CURVE = [0.05, 0.10, 0.15, 0.20, 0.20, 0.15, 0.10, 0.05]

    def __init__(self, project_name: str, contract_value: float,
                 estimated_cost: float, start_date: datetime,
                 duration_months: int):
        self.project_name = project_name
        self.contract_value = contract_value
        self.estimated_cost = estimated_cost
        self.start_date = start_date
        self.duration_months = duration_months
        self.end_date = start_date + timedelta(days=duration_months * 30)

        self.cost_items: List[CostItem] = []
        self.income_items: List[IncomeItem] = []

        self.retainage_rate = 0.10  # 10%
        self.payment_terms_income = PaymentTerms.NET_30
        self.billing_frequency = 30  # Monthly

    def set_payment_terms(self, income_terms: PaymentTerms,
                         retainage_rate: float = 0.10):
        """Set payment terms for income."""
        self.payment_terms_income = income_terms
        self.retainage_rate = retainage_rate

    def add_cost_item(self, description: str, category: CostCategory,
                     amount: float, scheduled_date: datetime,
                     payment_terms_days: int = 30) -> CostItem:
        """Add cost item to forecast."""
        item = CostItem(
            id=f"COST-{len(self.cost_items)+1:04d}",
            description=description,
            category=category,
            amount=amount,
            scheduled_date=scheduled_date,
            payment_terms_days=payment_terms_days
        )
        self.cost_items.append(item)
        return item

    def generate_cost_distribution(self, cost_breakdown: Dict[CostCategory, float] = None):
        """Generate cost items based on S-curve distribution."""
        if cost_breakdown is None:
            # Default breakdown
            cost_breakdown = {
                CostCategory.LABOR: self.estimated_cost * 0.35,
                CostCategory.MATERIALS: self.estimated_cost * 0.30,
                CostCategory.SUBCONTRACTOR: self.estimated_cost * 0.20,
                CostCategory.EQUIPMENT: self.estimated_cost * 0.05,
                CostCategory.GENERAL_CONDITIONS: self.estimated_cost * 0.07,
                CostCategory.OVERHEAD: self.estimated_cost * 0.03,
            }

        # Distribute costs over project duration using S-curve
        months = self.duration_months
        curve_months = len(self.S_CURVE)

        for category, total in cost_breakdown.items():
            for month in range(months):
                # Map to S-curve
                curve_idx = int(month / months * curve_months)
                curve_idx = min(curve_idx, curve_months - 1)
                monthly_pct = self.S_CURVE[curve_idx]

                # Adjust for number of months
                adjustment = months / curve_months
                amount = total * monthly_pct / adjustment

                cost_date = self.start_date + timedelta(days=month * 30)

                # Payment terms vary by category
                payment_days = 30
                if category == CostCategory.SUBCONTRACTOR:
                    payment_days = 45
                elif category == CostCategory.MATERIALS:
                    payment_days = 30

                self.add_cost_item(
                    f"{category.value} - Month {month+1}",
                    category,
                    amount,
                    cost_date,
                    payment_days
                )

    def generate_billing_schedule(self):
        """Generate income items based on billing schedule."""
        # Monthly billing based on progress
        months = self.duration_months

        for month in range(months):
            # Map to S-curve for progress
            curve_months = len(self.S_CURVE)
            curve_idx = int(month / months * curve_months)
            curve_idx = min(curve_idx, curve_months - 1)
            monthly_pct = self.S_CURVE[curve_idx]

            # Adjust for number of months
            adjustment = months / curve_months
            billing_amount = self.contract_value * monthly_pct / adjustment

            # Apply retainage
            retainage = billing_amount * self.retainage_rate
            net_billing = billing_amount - retainage

            billing_date = self.start_date + timedelta(days=(month + 1) * 30)
            payment_date = billing_date + timedelta(days=self.payment_terms_income.value)

            self.income_items.append(IncomeItem(
                id=f"INC-{month+1:04d}",
                description=f"Progress Billing #{month+1}",
                amount=net_billing,
                billing_date=billing_date,
                expected_payment_date=payment_date
            ))

        # Retainage release at end
        total_retainage = self.contract_value * self.retainage_rate
        final_date = self.end_date + timedelta(days=30)
        self.income_items.append(IncomeItem(
            id="INC-RET",
            description="Retainage Release",
            amount=total_retainage,
            billing_date=final_date,
            expected_payment_date=final_date + timedelta(days=self.payment_terms_income.value)
        ))

    def generate_forecast(self, period_days: int = 30,
                         opening_balance: float = 0) -> CashFlowForecast:
        """Generate cash flow forecast."""
        if not self.cost_items:
            self.generate_cost_distribution()
        if not self.income_items:
            self.generate_billing_schedule()

        periods = []
        current_date = self.start_date
        balance = opening_balance
        cumulative_income = 0
        cumulative_expenses = 0

        peak_deficit = 0
        peak_deficit_date = current_date
        breakeven_date = None

        # Extend forecast beyond project end
        forecast_end = self.end_date + timedelta(days=90)

        while current_date < forecast_end:
            period_end = current_date + timedelta(days=period_days)

            # Calculate expenses for period (when paid, not when incurred)
            period_expenses = sum(
                c.amount for c in self.cost_items
                if current_date <= c.scheduled_date + timedelta(days=c.payment_terms_days) < period_end
            )

            # Calculate income for period (when received)
            period_income = sum(
                i.amount for i in self.income_items
                if current_date <= i.expected_payment_date < period_end
            )

            net_cashflow = period_income - period_expenses
            closing_balance = balance + net_cashflow
            cumulative_income += period_income
            cumulative_expenses += period_expenses

            period = CashFlowPeriod(
                period_start=current_date,
                period_end=period_end,
                opening_balance=balance,
                income=period_income,
                expenses=period_expenses,
                net_cashflow=net_cashflow,
                closing_balance=closing_balance,
                cumulative_income=cumulative_income,
                cumulative_expenses=cumulative_expenses
            )
            periods.append(period)

            # Track peak deficit
            if closing_balance < peak_deficit:
                peak_deficit = closing_balance
                peak_deficit_date = current_date

            # Track breakeven
            if breakeven_date is None and closing_balance > 0 and balance <= 0:
                breakeven_date = current_date

            balance = closing_balance
            current_date = period_end

        financing_required = abs(peak_deficit) if peak_deficit < 0 else 0

        return CashFlowForecast(
            project_name=self.project_name,
            forecast_date=datetime.now(),
            total_contract=self.contract_value,
            total_costs=self.estimated_cost,
            periods=periods,
            peak_deficit=peak_deficit,
            peak_deficit_date=peak_deficit_date,
            breakeven_date=breakeven_date,
            financing_required=financing_required
        )

    def analyze_scenarios(self) -> Dict[str, CashFlowForecast]:
        """Analyze different payment scenarios."""
        scenarios = {}

        # Base case
        scenarios["base"] = self.generate_forecast()

        # Optimistic - faster payments
        original_terms = self.payment_terms_income
        self.payment_terms_income = PaymentTerms.NET_30
        scenarios["optimistic"] = self.generate_forecast()

        # Pessimistic - slower payments
        self.payment_terms_income = PaymentTerms.NET_60
        scenarios["pessimistic"] = self.generate_forecast()

        self.payment_terms_income = original_terms

        return scenarios

    def calculate_financing_cost(self, forecast: CashFlowForecast,
                                annual_rate: float = 0.08) -> Dict:
        """Calculate cost of financing the cash deficit."""
        if forecast.financing_required == 0:
            return {"financing_needed": False, "cost": 0}

        # Calculate weighted average deficit duration
        total_deficit_days = 0
        weighted_deficit = 0

        for period in forecast.periods:
            if period.closing_balance < 0:
                deficit = abs(period.closing_balance)
                days = (period.period_end - period.period_start).days
                total_deficit_days += days
                weighted_deficit += deficit * days

        avg_deficit = weighted_deficit / total_deficit_days if total_deficit_days else 0

        # Calculate interest cost
        daily_rate = annual_rate / 365
        interest_cost = weighted_deficit * daily_rate

        return {
            "financing_needed": True,
            "peak_deficit": forecast.peak_deficit,
            "deficit_days": total_deficit_days,
            "average_deficit": avg_deficit,
            "annual_rate": annual_rate,
            "estimated_interest": interest_cost,
            "recommendation": f"Line of credit needed: ${forecast.financing_required:,.0f}"
        }

    def generate_report(self, forecast: CashFlowForecast) -> str:
        """Generate cash flow forecast report."""
        lines = [
            "# Cash Flow Forecast Report",
            "",
            f"**Project:** {forecast.project_name}",
            f"**Forecast Date:** {forecast.forecast_date.strftime('%Y-%m-%d')}",
            "",
            "## Summary",
            "",
            f"| Metric | Value |",
            f"|--------|-------|",
            f"| Contract Value | ${forecast.total_contract:,.0f} |",
            f"| Estimated Cost | ${forecast.total_costs:,.0f} |",
            f"| Gross Margin | ${forecast.total_contract - forecast.total_costs:,.0f} ({(forecast.total_contract - forecast.total_costs)/forecast.total_contract*100:.1f}%) |",
            f"| Peak Cash Deficit | ${forecast.peak_deficit:,.0f} |",
            f"| Peak Deficit Date | {forecast.peak_deficit_date.strftime('%Y-%m-%d')} |",
            f"| Financing Required | ${forecast.financing_required:,.0f} |",
            "",
            "## Monthly Cash Flow",
            "",
            "| Period | Income | Expenses | Net | Balance |",
            "|--------|--------|----------|-----|---------|"
        ]

        for period in forecast.periods:
            if period.income > 0 or period.expenses > 0:
                lines.append(
                    f"| {period.period_start.strftime('%Y-%m')} | "
                    f"${period.income:,.0f} | ${period.expenses:,.0f} | "
                    f"${period.net_cashflow:,.0f} | ${period.closing_balance:,.0f} |"
                )

        # Financing analysis
        financing = self.calculate_financing_cost(forecast)
        if financing["financing_needed"]:
            lines.extend([
                "",
                "## Financing Analysis",
                "",
                f"- Peak Deficit: ${financing['peak_deficit']:,.0f}",
                f"- Days in Deficit: {financing['deficit_days']}",
                f"- Estimated Interest Cost: ${financing['estimated_interest']:,.0f}",
                f"- **{financing['recommendation']}**"
            ])

        return "\n".join(lines)

Read the full file on GitHub · 460 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 460 lines · 30 tokens per session scan A d878cf9b6a1d

Subscribe to this mod's changes

cashflow-forecaster is a skill published in the GitHub repository datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction (308 stars, last pushed 20d ago), licensed MIT. It adds 30 tokens to every session and 3,576 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

close-management

Manage the month-end close process with task sequencing, dependencies, and status tracking. Use when planning the close calendar, tracking close progress, identifying blockers, or sequencing close activities by day.

charlieviettq/awesome-agent-skill · 40 tokens

catchup

Summarize and review what changed while you were away. Use after a weekend, vacation, or flight to check missed PRs, git commits, Linear tickets, and meetings — one prioritized brief, not a firehose.

oliver-kriska/claude-elixir-phoenix · 48 tokens

phx-deps-update

Bump outdated Hex deps — inventory, snapshot changelogs, update, fix breaks, split reviewable PRs (patches bundled, majors solo). Use to upgrade/bump Elixir dependencies or when versions fall behind. NOT for deps.get failures (phx-investigate).

oliver-kriska/claude-elixir-phoenix · 62 tokens

stripe-payments

Add Stripe payments to a web app — Checkout Sessions, Payment Intents, subscriptions, webhooks, customer portal, and pricing pages. Covers the decision of which Stripe API to use, produces working integration code, and handles webhook verification. No MCP server needed — uses Stripe npm package directly. Triggers…

jezweb/claude-skills · 101 tokens

proposal-writer

Write a client proposal, quote, scope of work, or engagement letter for a service business. Covers project understanding, scope, timeline, pricing presentation, and terms. Use whenever the user asks for a proposal, quote, project proposal, client proposal, SOW, statement of work, engagement letter, or B2B service…

jezweb/claude-skills · 85 tokens

whats-next

Suggests the 3 most impactful next actions based on full developer context — git, Linear, PRs, and current conversation. Prioritizes blockers, unblocked items, and momentum. Use when deciding what to work on next or after finishing a task.

mostafa-drz/claude-skills · 56 tokens