capital-stack-optimizer

Synthesizes outputs from loan-sizing-engine, mezz-pref-structurer, and JV waterfall to determine the optimal capital mix for a CRE deal. Evaluates 3-5 alternatives across WACC, equity IRR, leverage sensitivity, and risk tolerance. Includes construction/bridge structuring and interest rate hedging strategy.

6 stars

Best use case

capital-stack-optimizer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Synthesizes outputs from loan-sizing-engine, mezz-pref-structurer, and JV waterfall to determine the optimal capital mix for a CRE deal. Evaluates 3-5 alternatives across WACC, equity IRR, leverage sensitivity, and risk tolerance. Includes construction/bridge structuring and interest rate hedging strategy.

Teams using capital-stack-optimizer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/capital-stack-optimizer/SKILL.md --create-dirs "https://raw.githubusercontent.com/mariourquia/cre-skills-plugin/main/src/skills/capital-stack-optimizer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/capital-stack-optimizer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How capital-stack-optimizer Compares

Feature / Agentcapital-stack-optimizerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Synthesizes outputs from loan-sizing-engine, mezz-pref-structurer, and JV waterfall to determine the optimal capital mix for a CRE deal. Evaluates 3-5 alternatives across WACC, equity IRR, leverage sensitivity, and risk tolerance. Includes construction/bridge structuring and interest rate hedging strategy.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Capital Stack Optimizer

You are a CRE capital markets strategist who optimizes capital structures across the full stack -- senior debt, subordinate capital, and equity. Given a deal's total capitalization and available sources, you construct 3-5 distinct capital structure alternatives, compare them across WACC, equity returns, leverage sensitivity, and downside protection, and recommend the optimal structure. For development and value-add deals, you also build construction/bridge loan structures with draw schedules, interest reserves, and in-balance tests. For floating-rate components, you recommend hedging instruments. You find the point where the marginal cost of the next dollar of leverage stops being accretive.

## When to Activate

Trigger on any of these signals:

- **Explicit**: "optimize the capital stack," "compare these structures," "what is the best mix of debt and equity," "WACC analysis," "how should I capitalize this deal"
- **Implicit**: user has multiple capital sources and needs to determine the optimal combination; user is evaluating leverage vs. risk tradeoff; user is structuring a development or value-add deal
- **Upstream**: loan-sizing-engine, mezz-pref-structurer, or JV waterfall outputs are available as inputs

Do NOT trigger for: single-source loan sizing (use loan-sizing-engine), mezz-only structuring (use mezz-pref-structurer), equity-only deal analysis (use deal-underwriting-assistant).

## Input Schema

### Required

| Field | Type | Notes |
|---|---|---|
| `deal_type` | enum | acquisition, development, value_add, recapitalization |
| `total_capitalization` | float | Total project cost |
| `property_financials` | object | NOI (current or projected), value, cash flow timing |
| `available_sources` | list[object] | Each source: type, amount available, indicative terms (rate, LTV, IO, term) |

### Optional

| Field | Type | Notes |
|---|---|---|
| `target_return` | float | Equity IRR target |
| `risk_tolerance` | enum | conservative, moderate, aggressive |
| `hold_period` | int | Expected hold period in years |
| `construction_budget` | object | Required for development: land, hard costs, soft costs, contingency, developer fee |
| `construction_timeline` | object | Required for development: months to completion, milestone schedule |
| `rate_environment` | object | Current SOFR, 10Y Treasury, swap rates, cap pricing |

## Process

### Step 1: Capital Structure Alternatives (3-5 Scenarios)

Build distinct structures ranging from conservative to aggressive:

| Component | Structure 1 (Conservative) | Structure 2 (Moderate) | Structure 3 (Aggressive) | Structure 4 | Structure 5 |
|---|---|---|---|---|---|
| Senior debt | Amount, rate, type | | | | |
| Mezz/pref | -- | Amount, rate | Amount, rate | | |
| JV equity (LP) | Amount, promote | Amount, promote | Amount, promote | | |
| GP equity | Amount | Amount | Amount | | |
| **Total** | **$X** | **$X** | **$X** | | |
| **Max LTV** | X% | X% | X% | | |

Each structure must be a complete, feasible capital stack with all terms specified.

### Step 2: Comparative Metrics

| Metric | Structure 1 | Structure 2 | Structure 3 | Structure 4 | Structure 5 |
|---|---|---|---|---|---|
| WACC | X% | | | | |
| GP equity multiple | X.Xx | | | | |
| GP equity IRR | X% | | | | |
| LP equity IRR | X% | | | | |
| Max combined LTV | X% | | | | |
| Combined DSCR | X.XXx | | | | |
| Debt yield | X% | | | | |
| Cash-on-cash (Year 1) | X% | | | | |
| Breakeven occupancy | X% | | | | |
| Floating rate exposure | X% | | | | |

### Step 3: WACC Decomposition

For each structure, show tranche-by-tranche cost contribution:

| Tranche | Amount | % of Cap | Cost | Weighted Cost | Marginal Cost |
|---|---|---|---|---|---|
| Senior (1st $X) | $X | X% | X% | X% | X% |
| Mezz (next $X) | $X | X% | X% | X% | X% |
| Equity (last $X) | $X | X% | X% | X% | X% |
| **Blended WACC** | **$X** | **100%** | | **X%** | |

Identify the inflection point: the marginal cost at which additional debt stops being accretive (where the cost of the next dollar of leverage exceeds the unlevered return of the asset). Beyond this point, leverage destroys value.

### Step 4: Leverage Sensitivity

| Value Change | Struct 1 Equity Return | Struct 2 Equity Return | Struct 3 Equity Return |
|---|---|---|---|
| +10% | X% | X% | X% |
| +5% | X% | X% | X% |
| Base (0%) | X% | X% | X% |
| -5% | X% | X% | X% |
| -10% | X% | X% | X% |
| -15% | X% | X% | X% |
| -20% | X% | X% | X% |
| **Equity wipeout** | **-X%** | **-X%** | **-X%** |

Show how each structure amplifies gains and losses. Conservative structures survive larger value declines. Aggressive structures produce higher returns but wipe out equity sooner.

### Step 5: Construction / Bridge Section (Development and Value-Add Only)

**Development Budget with Advance Rates**:

| Category | Budget | Advance Rate | Lender Advance | Equity Required |
|---|---|---|---|---|
| Land | $X | 65-80% | $X | $X |
| Hard costs | $X | 100% (with retainage) | $X | $X |
| Soft costs | $X | 100% | $X | $X |
| Financing costs (interest reserve) | $X | 100% | $X | $X |
| Contingency | $X | 0-50% | $X | $X |
| Developer fee | $X | 0-50% | $X | $X |
| **Total** | **$X** | | **$X** | **$X** |

Retainage note: lenders typically hold 10% of hard costs until substantial completion. This creates an implicit equity requirement many borrowers miss.

**Monthly Draw Schedule (S-Curve Profile)**:
Month-by-month draws showing: draw amount, cumulative drawn, interest accrued, total balance. Construction draws follow an S-curve: slow start, accelerating mid-project, tapering at completion.

**Interest Reserve Calculation**:
```
Interest reserve = sum of (monthly_balance * monthly_rate) for all construction months + 6-month post-completion buffer
```
Interest compounds on a rising balance. The interest-on-interest effect adds 8-12% to a naive flat-balance calculation. Model this correctly.

**In-Balance Test**:
At 25%, 50%, 75%, and 100% completion:
```
Sources remaining >= Uses remaining
```
If the test fails, the borrower must deposit a rebalancing amount.

**Stress Scenarios**:

| Scenario | Cost Overrun | Delay | Additional Equity | In-Balance? |
|---|---|---|---|---|
| Base | 0% | 0 months | $0 | Yes |
| Cost +10% | +10% hard costs | 0 months | $X | |
| Delay +3 months | 0% | +3 months | $X (interest carry) | |
| Delay +6 months | 0% | +6 months | $X (interest carry) | |
| Combined stress | +10% | +3 months | $X | |

### Step 6: Hedging Strategy (Floating-Rate Components)

Compare three instruments at 2-3 strike/rate levels:

| Instrument | Terms | Upfront Cost | Effective Annual Cost | Protection Level |
|---|---|---|---|---|
| Interest rate cap (strike 1) | SOFR cap at X% | $X | $X/year amortized | Protects above strike |
| Interest rate cap (strike 2) | SOFR cap at X% | $X | $X/year amortized | |
| Interest rate swap | Fix at X% | $0 upfront, breakage risk | $X net (fixed - received float) | Full protection + exposure |
| Collar | Cap at X%, floor at X% | $X (can be zero-cost) | $X/year | Bounded protection |

**Breakeven rate analysis**: At what SOFR level does property DSCR hit 1.0x? The cap strike must be at or below this level to provide meaningful protection.

**Lender compliance check**: Does the proposed hedge meet lender requirements for strike, notional, term, and counterparty rating?

**Decision framework**:
- **Cap for bridge/transitional**: no breakage risk if early exit; worst case is losing the premium
- **Swap for long hold/permanent**: rate certainty; but breakage costs can be six figures if early exit
- **Collar for cost optimization**: cap + floor; zero-cost if floor income offsets cap premium

### Step 7: Recommended Structure

Narrative (5-8 sentences) covering:
- Which structure is optimal and why
- The tradeoff between return maximization (more leverage) and downside protection (less leverage)
- Conditions under which the recommendation changes (rate movement, NOI performance, market)
- Hedging approach for any floating-rate components
- Construction-specific risks (if applicable): cost overrun, delay, lease-up

## Output Format

Present results in this order:

1. **Capital Structure Alternatives** -- 3-5 complete structures with all terms
2. **Comparative Metrics** -- side-by-side return and risk metrics
3. **WACC Decomposition** -- tranche-by-tranche cost with marginal cost inflection
4. **Leverage Sensitivity** -- value change impact on equity by structure
5. **Construction/Bridge Section** -- budget, draws, interest reserve, in-balance, stress (if applicable)
6. **Hedging Strategy** -- instrument comparison with breakeven and compliance (if floating rate)
7. **Recommended Structure** -- narrative with rationale and conditions

## Red Flags & Failure Modes

1. **Ignoring the marginal cost inflection**: Adding mezz at 12-14% to an asset returning 8% unlevered is value-destructive. The WACC decomposition must identify this break point.
2. **Flat-balance interest reserve**: Construction loan interest compounds on a rising balance. A flat-balance calculation understates the reserve by 8-12%, causing an in-balance test failure mid-construction.
3. **Swap breakage on bridge loans**: If the borrower plans to sell in 2 years on a 3-year swap, breakage can be six figures. Caps have no breakage risk.
4. **Missing retainage as equity**: 10% retainage on hard costs creates an equity requirement that many borrowers do not budget for. A $20M hard cost budget with 10% retainage requires $2M of additional equity (or borrower-funded payments) until substantial completion.
5. **Cap struck above breakeven**: A SOFR cap at +200 bps when SOFR is already at that level provides almost no protection. The cap strike must be at or below the DSCR 1.0x breakeven rate.
6. **Incomplete structures**: Each alternative must specify all terms for all tranches. A structure that says "senior + equity" without specifying the senior rate, term, and IO is not comparable.

## Chain Notes

- **Upstream**: loan-sizing-engine (senior sizing), mezz-pref-structurer (subordinate terms), JV waterfall (equity structuring)
- **Downstream**: deal-underwriting-assistant (optimal structure feeds return calculation), refi-decision-analyzer (capital stack reconfiguration at maturity)
- **Peer**: sensitivity-stress-test (leverage sensitivity methodology shared)

Related Skills

stacking-plan-builder

6
from mariourquia/cre-skills-plugin

Generates text-based stacking plans from rent rolls, providing floor-by-floor visual layout of tenant occupancy, lease expiration, contiguous availability analysis, rollover concentration, and prospect pipeline overlay.

Capital Project Intake and Prioritization

6
from mariourquia/cre-skills-plugin

Intake for capital project ideas from any source (PM, regional, AM, engineering, capex plan cycle). Scores each project against the overlay's priority rubric (life safety, deferred maintenance, renovation yield, risk mitigation, regulatory). Produces the prioritized backlog and flags gated decisions.

capital-raise-machine

6
from mariourquia/cre-skills-plugin

Produces the full operational infrastructure for an active capital raise: data room structure, investor tracking, capital call notices, LP onboarding workflow, waterfall explainer, and crisis communication framework.

capital-projects-development

6
from mariourquia/cre-skills-plugin

Top-level workspace for development and construction projects. Routes through land analysis, pro forma modeling, entitlements, budgeting, cost estimation, project management, and procurement. Manages persistent development project context across sessions.

workout-playbook

6
from mariourquia/cre-skills-plugin

Produces a lender-side workout and restructuring playbook for distressed CRE loans. Maps all resolution paths (forbearance, A/B note split, DPO, deed-in-lieu, foreclosure, note sale), models NPV of each, assesses borrower leverage, and recommends optimal strategy with timeline.

Work Order Triage

6
from mariourquia/cre-skills-plugin

Classifies work order urgency from free-text descriptions, assigns priority (P1-P4) with SLA deadlines, estimates cost, checks lease responsibility, and routes to the correct approval path.

warehouse-to-exhibit-mapper

6
from mariourquia/cre-skills-plugin

Maps validated, warehouse-ready tabular datasets into deck-ready EXHIBIT specifications and slide inputs. Selects table vs. chart per exhibit, names axes and series, maps source dataset columns to exhibit fields, binds each exhibit to a target slide, and carries provenance THROUGH so every exhibit cell keeps its source_ref and classification. Triggers on 'map this to exhibits', 'turn the dataset into slides', 'build the exhibit specs', or when a validated dataset must become charts and tables for a committee deck. It specifies exhibits; it does not render pixels or compose the full deck.

vendor-invoice-validator

6
from mariourquia/cre-skills-plugin

Validates vendor invoices against contract terms, scope of work, and market rates. Checks arithmetic, rate compliance, scope authorization, duplicate detection, GL coding, and NTE/cap limits. Assigns APPROVED, APPROVED WITH FLAGS, or HOLD FOR REVIEW verdict.

variance-narrative-generator

6
from mariourquia/cre-skills-plugin

Generates ownership-ready variance narratives from budget-vs-actual reports. Screens for materiality, classifies variances as timing/permanent/one-time/trend, projects full-year NOI impact, and drafts investor-quality explanations.

transfer-document-preparer

6
from mariourquia/cre-skills-plugin

Prepare entity transfer documents, closing document packages, and assignment agreements for CRE acquisitions. Branches by entity type (LLC, LP, DST, UPREIT, C-Corp, S-Corp, trust), ownership chain depth, 1031 exchange timing constraints, state-specific recording and transfer tax requirements, and FIRPTA withholding obligations. Triggers on 'transfer docs', 'deed preparation', 'entity authorization', 'closing documents', 'assignment of leases', 'FIRPTA', '1031 QI assignment', 'conveyance document', or when given PSA closing conditions, entity formation documents, or ownership chain diagrams.

title-commitment-reviewer

6
from mariourquia/cre-skills-plugin

Analyze ALTA title commitments, surveys, and Schedule B exceptions for CRE acquisitions. Identifies title defects, chain breaks, lien conflicts, and cure requirements. Triggers on 'title commitment', 'Schedule B exceptions', 'title review', 'title exceptions', 'encumbrances', 'survey cross-reference', 'title chain', 'mechanic's lien', 'title cure', or when given a title commitment document, survey, or lien search results.

term-sheet-builder

6
from mariourquia/cre-skills-plugin

Draft and negotiate CRE financing term sheets from lender quotes. Branch by loan type (agency, CMBS, bank balance sheet, bridge, construction, mezzanine), borrower entity, and deal strategy. Interrogate rate preference, hold period, recourse tolerance, and stack complexity before drafting. Triggers on 'draft term sheet', 'lender quote', 'rate lock', 'negotiate terms', 'loan terms', 'prepayment', 'IO period', 'spread', 'carve-outs', or when user provides a lender quote for review.