Agent skill

phoenix-waterfall-ledger-semantics

Waterfall ledger semantics and clawback behavior for the Phoenix VC fund model. Use when working on tier or ledger waterfall code, clawback behavior, or waterfall truth cases.

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/nikhillinit/Updog_restore/tree/main/.claude/skills/phoenix-waterfall-ledger-semantics

SKILL.md

Phoenix Waterfall Ledger Semantics

You own GP/LP waterfall semantics for both the tier-based and ledger-based engines, including shortfall-based partial clawback and cross-validation rules.

When to Use

Invoke this skill when:

  • Editing server/analytics/waterfall-tier.ts or server/analytics/waterfall-ledger.ts
  • Working on clawback behavior or validating scenario L08 and related cases
  • Expanding or debugging waterfall truth-case JSONs
  • Syncing waterfall docs/JSDoc with actual behavior

Files You Own

  • Implementation:
    • server/analytics/waterfall-tier.ts
    • server/analytics/waterfall-ledger.ts
  • Types / config:
    • shared/types/waterfall.ts (or equivalent config types)
  • Truth cases:
    • docs/waterfall-tier.truth-cases.json
    • docs/waterfall-ledger.truth-cases.json
  • Documentation:
    • Waterfall section in docs/calculations.md
    • Clawback JSDoc in the waterfall config types

Core Concepts

Tier vs. Ledger

  • Tier engine:

    • Simple tiers (return of capital, preferred, carry splits)
    • No ledger-level clawback
  • Ledger engine:

    • Full ledger of contributions and distributions
    • Applies shortfall-based partial clawback:
      • GP carry is limited by fund-level profit above the LP shortfall
      • If LPs haven't achieved capital + preferred return, GP carry is reduced proportionally
      • Not a binary all-or-nothing clawback
      • Not time-based; uses cumulative fund performance at liquidation

Only for simple, no-clawback, no-recycling cases may tier and ledger results be expected to match.

Clawback Semantics

Ensure implementation and docs agree:

  • Use a shortfall-based formula:
    • LP shortfall = (required capital + pref) – actual LP distributions
    • GP clawback = min(GP carry, LP shortfall)
  • JSDoc must clearly state:
    • "Shortfall-based partial clawback (NOT hard floor, NOT time-based)"
    • Include a concrete example referencing the relevant truth case (e.g., L08)

Truth-Case Workflow

  1. Identify failing scenario(s) in tier/ledger truth-cases JSON.

  2. Run targeted tests:

    bash
    npm test -- tests/truth-cases/runner.test.ts -t "<scenario-id>"
    
  3. Compare:

    • Expected vs actual totals (LP distributions, GP carry, clawback)
    • Row-level distributions for ledger scenarios (e.g., quarterly rows)
  4. Decide:

    • JSON wrong → fix truth case and re-run
    • Implementation wrong → adjust code, keep semantics aligned with docs and plan

Documentation Sync

Whenever you change behavior:

  • Update:
    • docs/calculations.md waterfall section
    • JSDoc for waterfall config and key functions
  • Include:
    • Plain-English description of clawback behavior
    • Example using a real truth-case ID

Invariants

  • Clawback must never cause LPs to receive less than capital + pref while GP receives carry.
  • Ledger engine must respect the LPA semantics described in the plan and JSDoc.
  • Tier engine is not used to validate clawback scenarios.

Expand your agent's capabilities with these related and highly-rated skills.

nikhillinit/Updog_restore

financial-calc-correctness

0 0
Explore
nikhillinit/Updog_restore

statistical-testing

0 0
Explore
nikhillinit/Updog_restore

ui-ux-pro-max

UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.

0 0
Explore
nikhillinit/Updog_restore

code-reviewer

Comprehensive multi-AI code review system for Python, JavaScript, and TypeScript. Use when reviewing code for quality, security, performance, or best practices. Includes automated analysis scripts, language-specific patterns, and AI collaboration workflows for complex decisions.

0 0
Explore
nikhillinit/Updog_restore

dependency-guardian

Automated dependency management with security scanning, update orchestration, and compatibility validation

0 0
Explore
nikhillinit/Updog_restore

documentation-sync

Detects code/documentation drift, validates examples, generates diagrams, auto-updates documentation

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results