@v587d/capital-generation 2.7.6 → 2.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +5 -4
  3. package/THIRD_PARTY_NOTICES.md +14 -3
  4. package/capital-config/client.js +4 -4
  5. package/capital-config/package.json +1 -1
  6. package/capital-watchlist/package.json +1 -1
  7. package/chart-ui/package.json +1 -1
  8. package/lib/agents/selected-skills-provider.js +91 -41
  9. package/lib/index.js +3 -2
  10. package/lib/web-retriever/local-fetch.d.ts +1 -1
  11. package/lib/web-retriever/local-fetch.js +1 -1
  12. package/lib/web-retriever/wind-client.d.ts +1 -1
  13. package/lib/web-retriever/wind-client.js +1 -1
  14. package/package.json +2 -1
  15. package/selected-skills/README.md +3 -1
  16. package/selected-skills/catalog.js +155 -0
  17. package/selected-skills/financeskills/LICENSE +21 -0
  18. package/selected-skills/financeskills/UPSTREAM.md +202 -0
  19. package/selected-skills/financeskills/skills/ai-anomaly-detection/EXAMPLE.md +21 -0
  20. package/selected-skills/financeskills/skills/ai-anomaly-detection/SKILL.md +84 -0
  21. package/selected-skills/financeskills/skills/ai-anomaly-detection/references/feature-engineering.md +20 -0
  22. package/selected-skills/financeskills/skills/ai-anomaly-detection/references/ml-algorithms.md +28 -0
  23. package/selected-skills/financeskills/skills/aro-computation/EXAMPLE.md +21 -0
  24. package/selected-skills/financeskills/skills/aro-computation/SKILL.md +82 -0
  25. package/selected-skills/financeskills/skills/aro-computation/references/aro-standards.md +22 -0
  26. package/selected-skills/financeskills/skills/aro-computation/references/pv-math.md +27 -0
  27. package/selected-skills/financeskills/skills/audit-checklist/EXAMPLE.md +17 -0
  28. package/selected-skills/financeskills/skills/audit-checklist/SKILL.md +77 -0
  29. package/selected-skills/financeskills/skills/audit-checklist/references/internal-controls.md +36 -0
  30. package/selected-skills/financeskills/skills/audit-checklist/references/isa-standards.md +26 -0
  31. package/selected-skills/financeskills/skills/automated-reconciliation/EXAMPLE.md +21 -0
  32. package/selected-skills/financeskills/skills/automated-reconciliation/SKILL.md +87 -0
  33. package/selected-skills/financeskills/skills/automated-reconciliation/assets/reconciliation-statement-template.md +31 -0
  34. package/selected-skills/financeskills/skills/automated-reconciliation/references/fuzzy-logic.md +27 -0
  35. package/selected-skills/financeskills/skills/automated-reconciliation/references/rec-controls.md +28 -0
  36. package/selected-skills/financeskills/skills/banking-compliance/EXAMPLE.md +21 -0
  37. package/selected-skills/financeskills/skills/banking-compliance/SKILL.md +82 -0
  38. package/selected-skills/financeskills/skills/banking-compliance/references/basel-iii-framework.md +26 -0
  39. package/selected-skills/financeskills/skills/banking-compliance/references/risk-weights.md +32 -0
  40. package/selected-skills/financeskills/skills/budget-forecast/EXAMPLE.md +21 -0
  41. package/selected-skills/financeskills/skills/budget-forecast/SKILL.md +87 -0
  42. package/selected-skills/financeskills/skills/budget-forecast/references/forecasting-best-practices.md +26 -0
  43. package/selected-skills/financeskills/skills/budget-forecast/references/scenario-analysis.md +25 -0
  44. package/selected-skills/financeskills/skills/close-management/EXAMPLE.md +17 -0
  45. package/selected-skills/financeskills/skills/close-management/SKILL.md +85 -0
  46. package/selected-skills/financeskills/skills/close-management/references/close-task-library.md +32 -0
  47. package/selected-skills/financeskills/skills/company-valuation/EXAMPLE.md +21 -0
  48. package/selected-skills/financeskills/skills/company-valuation/SKILL.md +80 -0
  49. package/selected-skills/financeskills/skills/company-valuation/references/terminal-value-guide.md +33 -0
  50. package/selected-skills/financeskills/skills/corporate-consolidation/EXAMPLE.md +21 -0
  51. package/selected-skills/financeskills/skills/corporate-consolidation/SKILL.md +84 -0
  52. package/selected-skills/financeskills/skills/corporate-consolidation/references/consolidation-standard.md +28 -0
  53. package/selected-skills/financeskills/skills/corporate-consolidation/references/minority-interest.md +25 -0
  54. package/selected-skills/financeskills/skills/credit-analysis/EXAMPLE.md +21 -0
  55. package/selected-skills/financeskills/skills/credit-analysis/SKILL.md +84 -0
  56. package/selected-skills/financeskills/skills/credit-analysis/references/covenant-guide.md +26 -0
  57. package/selected-skills/financeskills/skills/crypto-accounting/EXAMPLE.md +21 -0
  58. package/selected-skills/financeskills/skills/crypto-accounting/SKILL.md +81 -0
  59. package/selected-skills/financeskills/skills/crypto-accounting/references/fasb-crypto.md +26 -0
  60. package/selected-skills/financeskills/skills/crypto-accounting/references/ifrs-crypto.md +25 -0
  61. package/selected-skills/financeskills/skills/cvp-breakeven/EXAMPLE.md +21 -0
  62. package/selected-skills/financeskills/skills/cvp-breakeven/SKILL.md +78 -0
  63. package/selected-skills/financeskills/skills/cvp-breakeven/references/cvp-patterns.md +28 -0
  64. package/selected-skills/financeskills/skills/debt-payoff/EXAMPLE.md +21 -0
  65. package/selected-skills/financeskills/skills/debt-payoff/SKILL.md +94 -0
  66. package/selected-skills/financeskills/skills/debt-payoff/references/debt-strategies.md +32 -0
  67. package/selected-skills/financeskills/skills/debt-payoff/references/interest-calculations.md +27 -0
  68. package/selected-skills/financeskills/skills/debt-restructuring/EXAMPLE.md +21 -0
  69. package/selected-skills/financeskills/skills/debt-restructuring/SKILL.md +79 -0
  70. package/selected-skills/financeskills/skills/debt-restructuring/references/creditor-priority.md +26 -0
  71. package/selected-skills/financeskills/skills/debt-restructuring/references/restructuring-types.md +24 -0
  72. package/selected-skills/financeskills/skills/deferred-tax/EXAMPLE.md +21 -0
  73. package/selected-skills/financeskills/skills/deferred-tax/SKILL.md +86 -0
  74. package/selected-skills/financeskills/skills/deferred-tax/references/td-catalogue.md +39 -0
  75. package/selected-skills/financeskills/skills/earned-value-mgmt/EXAMPLE.md +21 -0
  76. package/selected-skills/financeskills/skills/earned-value-mgmt/SKILL.md +79 -0
  77. package/selected-skills/financeskills/skills/earned-value-mgmt/references/forecasting-eac.md +27 -0
  78. package/selected-skills/financeskills/skills/earned-value-mgmt/references/pmi-evm.md +29 -0
  79. package/selected-skills/financeskills/skills/ecl-computation/EXAMPLE.md +21 -0
  80. package/selected-skills/financeskills/skills/ecl-computation/SKILL.md +85 -0
  81. package/selected-skills/financeskills/skills/ecl-computation/references/ifrs9-standard.md +27 -0
  82. package/selected-skills/financeskills/skills/ecl-computation/references/risk-modeling.md +26 -0
  83. package/selected-skills/financeskills/skills/esg-reporting/EXAMPLE.md +17 -0
  84. package/selected-skills/financeskills/skills/esg-reporting/SKILL.md +79 -0
  85. package/selected-skills/financeskills/skills/esg-reporting/references/ghg-protocol.md +22 -0
  86. package/selected-skills/financeskills/skills/esg-reporting/references/sasb-map.md +25 -0
  87. package/selected-skills/financeskills/skills/financial-analysis/EXAMPLE.md +21 -0
  88. package/selected-skills/financeskills/skills/financial-analysis/SKILL.md +108 -0
  89. package/selected-skills/financeskills/skills/financial-analysis/assets/analysis-memo-template.md +31 -0
  90. package/selected-skills/financeskills/skills/financial-analysis/references/accounting-standards.md +45 -0
  91. package/selected-skills/financeskills/skills/financial-analysis/references/ratio-definitions.md +14 -0
  92. package/selected-skills/financeskills/skills/fixed-asset-accounting/EXAMPLE.md +21 -0
  93. package/selected-skills/financeskills/skills/fixed-asset-accounting/SKILL.md +78 -0
  94. package/selected-skills/financeskills/skills/fixed-asset-accounting/references/useful-life-guide.md +30 -0
  95. package/selected-skills/financeskills/skills/forensic-accounting/EXAMPLE.md +21 -0
  96. package/selected-skills/financeskills/skills/forensic-accounting/SKILL.md +91 -0
  97. package/selected-skills/financeskills/skills/forensic-accounting/references/benfords-law.md +24 -0
  98. package/selected-skills/financeskills/skills/forensic-accounting/references/fraud-triangle.md +26 -0
  99. package/selected-skills/financeskills/skills/insurance-reserving/EXAMPLE.md +21 -0
  100. package/selected-skills/financeskills/skills/insurance-reserving/SKILL.md +82 -0
  101. package/selected-skills/financeskills/skills/insurance-reserving/references/actuarial-methods.md +33 -0
  102. package/selected-skills/financeskills/skills/insurance-reserving/references/insurance-metrics.md +26 -0
  103. package/selected-skills/financeskills/skills/intercompany-accounting/EXAMPLE.md +21 -0
  104. package/selected-skills/financeskills/skills/intercompany-accounting/SKILL.md +79 -0
  105. package/selected-skills/financeskills/skills/intercompany-accounting/references/elimination-entries.md +35 -0
  106. package/selected-skills/financeskills/skills/inventory-costing/EXAMPLE.md +21 -0
  107. package/selected-skills/financeskills/skills/inventory-costing/SKILL.md +80 -0
  108. package/selected-skills/financeskills/skills/inventory-costing/references/costing-examples.md +31 -0
  109. package/selected-skills/financeskills/skills/investment-analysis/EXAMPLE.md +21 -0
  110. package/selected-skills/financeskills/skills/investment-analysis/SKILL.md +82 -0
  111. package/selected-skills/financeskills/skills/investment-analysis/references/competitive-advantage.md +31 -0
  112. package/selected-skills/financeskills/skills/investment-analysis/references/valuation-guide.md +29 -0
  113. package/selected-skills/financeskills/skills/journal-entry/EXAMPLE.md +21 -0
  114. package/selected-skills/financeskills/skills/journal-entry/SKILL.md +94 -0
  115. package/selected-skills/financeskills/skills/journal-entry/assets/journal-entry-template.md +21 -0
  116. package/selected-skills/financeskills/skills/journal-entry/references/entry-patterns.md +51 -0
  117. package/selected-skills/financeskills/skills/lbo-modeling/EXAMPLE.md +21 -0
  118. package/selected-skills/financeskills/skills/lbo-modeling/SKILL.md +88 -0
  119. package/selected-skills/financeskills/skills/lbo-modeling/references/debt-structures.md +22 -0
  120. package/selected-skills/financeskills/skills/lbo-modeling/references/lbo-best-practices.md +27 -0
  121. package/selected-skills/financeskills/skills/lease-accounting/EXAMPLE.md +21 -0
  122. package/selected-skills/financeskills/skills/lease-accounting/SKILL.md +88 -0
  123. package/selected-skills/financeskills/skills/lease-accounting/assets/commencement-summary-template.md +28 -0
  124. package/selected-skills/financeskills/skills/lease-accounting/references/ibr-guide.md +26 -0
  125. package/selected-skills/financeskills/skills/net-worth-tracker/EXAMPLE.md +21 -0
  126. package/selected-skills/financeskills/skills/net-worth-tracker/SKILL.md +98 -0
  127. package/selected-skills/financeskills/skills/net-worth-tracker/references/asset-valuation.md +40 -0
  128. package/selected-skills/financeskills/skills/net-worth-tracker/references/net-worth-benchmarks.md +33 -0
  129. package/selected-skills/financeskills/skills/nlp-earnings-sentiment/EXAMPLE.md +17 -0
  130. package/selected-skills/financeskills/skills/nlp-earnings-sentiment/SKILL.md +77 -0
  131. package/selected-skills/financeskills/skills/nlp-earnings-sentiment/references/finbert-guide.md +26 -0
  132. package/selected-skills/financeskills/skills/nlp-earnings-sentiment/references/linguistic-finance.md +23 -0
  133. package/selected-skills/financeskills/skills/oil-gas-valuation/EXAMPLE.md +21 -0
  134. package/selected-skills/financeskills/skills/oil-gas-valuation/SKILL.md +86 -0
  135. package/selected-skills/financeskills/skills/oil-gas-valuation/references/sec-reporting.md +22 -0
  136. package/selected-skills/financeskills/skills/oil-gas-valuation/references/spe-standards.md +25 -0
  137. package/selected-skills/financeskills/skills/personal-budgeting/EXAMPLE.md +21 -0
  138. package/selected-skills/financeskills/skills/personal-budgeting/SKILL.md +100 -0
  139. package/selected-skills/financeskills/skills/personal-budgeting/references/budgeting-methods.md +40 -0
  140. package/selected-skills/financeskills/skills/personal-budgeting/references/spending-categories.md +40 -0
  141. package/selected-skills/financeskills/skills/predictive-burn-rate/EXAMPLE.md +21 -0
  142. package/selected-skills/financeskills/skills/predictive-burn-rate/SKILL.md +82 -0
  143. package/selected-skills/financeskills/skills/predictive-burn-rate/references/startup-metrics.md +27 -0
  144. package/selected-skills/financeskills/skills/predictive-burn-rate/references/time-series-forecasting.md +22 -0
  145. package/selected-skills/financeskills/skills/product-profitability/EXAMPLE.md +21 -0
  146. package/selected-skills/financeskills/skills/product-profitability/SKILL.md +83 -0
  147. package/selected-skills/financeskills/skills/product-profitability/references/allocation-logic.md +28 -0
  148. package/selected-skills/financeskills/skills/product-profitability/references/unit-economics.md +30 -0
  149. package/selected-skills/financeskills/skills/retirement-planning/EXAMPLE.md +21 -0
  150. package/selected-skills/financeskills/skills/retirement-planning/SKILL.md +98 -0
  151. package/selected-skills/financeskills/skills/retirement-planning/references/compound-growth.md +38 -0
  152. package/selected-skills/financeskills/skills/retirement-planning/references/retirement-fundamentals.md +29 -0
  153. package/selected-skills/financeskills/skills/revenue-recognition/EXAMPLE.md +21 -0
  154. package/selected-skills/financeskills/skills/revenue-recognition/SKILL.md +86 -0
  155. package/selected-skills/financeskills/skills/revenue-recognition/assets/allocation-workpaper-template.md +30 -0
  156. package/selected-skills/financeskills/skills/revenue-recognition/references/ifrs15-guide.md +28 -0
  157. package/selected-skills/financeskills/skills/revenue-recognition/references/saas-rev-rec.md +26 -0
  158. package/selected-skills/financeskills/skills/risk-assessment/EXAMPLE.md +21 -0
  159. package/selected-skills/financeskills/skills/risk-assessment/SKILL.md +83 -0
  160. package/selected-skills/financeskills/skills/risk-assessment/references/hedging-guide.md +24 -0
  161. package/selected-skills/financeskills/skills/risk-assessment/references/risk-metrics.md +24 -0
  162. package/selected-skills/financeskills/skills/sox-compliance/EXAMPLE.md +17 -0
  163. package/selected-skills/financeskills/skills/sox-compliance/SKILL.md +88 -0
  164. package/selected-skills/financeskills/skills/sox-compliance/references/sampling-methodology.md +27 -0
  165. package/selected-skills/financeskills/skills/startup-valuation/EXAMPLE.md +21 -0
  166. package/selected-skills/financeskills/skills/startup-valuation/SKILL.md +88 -0
  167. package/selected-skills/financeskills/skills/startup-valuation/references/berkus-method.md +25 -0
  168. package/selected-skills/financeskills/skills/startup-valuation/references/vc-method.md +23 -0
  169. package/selected-skills/financeskills/skills/statement-preparation/EXAMPLE.md +21 -0
  170. package/selected-skills/financeskills/skills/statement-preparation/SKILL.md +86 -0
  171. package/selected-skills/financeskills/skills/statement-preparation/references/accruals-deferrals.md +24 -0
  172. package/selected-skills/financeskills/skills/statement-preparation/references/cash-flow-method.md +32 -0
  173. package/selected-skills/financeskills/skills/tax-efficient-investing/EXAMPLE.md +21 -0
  174. package/selected-skills/financeskills/skills/tax-efficient-investing/SKILL.md +97 -0
  175. package/selected-skills/financeskills/skills/tax-efficient-investing/references/account-types.md +33 -0
  176. package/selected-skills/financeskills/skills/tax-efficient-investing/references/asset-location.md +36 -0
  177. package/selected-skills/financeskills/skills/tax-planning/EXAMPLE.md +21 -0
  178. package/selected-skills/financeskills/skills/tax-planning/SKILL.md +93 -0
  179. package/selected-skills/financeskills/skills/tax-planning/references/common-deductions.md +28 -0
  180. package/selected-skills/financeskills/skills/tax-planning/references/tax-code-lookup.md +25 -0
  181. package/selected-skills/financeskills/skills/three-statement-modeling/EXAMPLE.md +21 -0
  182. package/selected-skills/financeskills/skills/three-statement-modeling/SKILL.md +84 -0
  183. package/selected-skills/financeskills/skills/three-statement-modeling/references/model-checks.md +32 -0
  184. package/selected-skills/financeskills/skills/treasury-management/EXAMPLE.md +21 -0
  185. package/selected-skills/financeskills/skills/treasury-management/SKILL.md +83 -0
  186. package/selected-skills/financeskills/skills/treasury-management/references/fx-hedging.md +27 -0
  187. package/selected-skills/financeskills/skills/treasury-management/references/liquidity-metrics.md +24 -0
  188. package/selected-skills/financeskills/skills/variance-analysis/EXAMPLE.md +21 -0
  189. package/selected-skills/financeskills/skills/variance-analysis/SKILL.md +78 -0
  190. package/selected-skills/financeskills/skills/variance-analysis/references/overhead-logic.md +24 -0
  191. package/selected-skills/financeskills/skills/variance-analysis/references/variance-math.md +35 -0
  192. package/selected-skills/financeskills/skills/venture-debt/EXAMPLE.md +21 -0
  193. package/selected-skills/financeskills/skills/venture-debt/SKILL.md +84 -0
  194. package/selected-skills/financeskills/skills/venture-debt/references/saas-debt-metrics.md +26 -0
  195. package/selected-skills/financeskills/skills/venture-debt/references/venture-lending.md +23 -0
  196. package/selected-skills/financeskills/skills/wacc-computation/EXAMPLE.md +21 -0
  197. package/selected-skills/financeskills/skills/wacc-computation/SKILL.md +98 -0
  198. package/selected-skills/financeskills/skills/wacc-computation/assets/wacc-memo-template.md +40 -0
  199. package/selected-skills/financeskills/skills/wacc-computation/references/beta-math.md +24 -0
  200. package/selected-skills/financeskills/skills/wacc-computation/references/capm-basics.md +24 -0
  201. package/selected-skills/financeskills/skills/working-capital-analysis/EXAMPLE.md +21 -0
  202. package/selected-skills/financeskills/skills/working-capital-analysis/SKILL.md +83 -0
  203. package/selected-skills/financeskills/skills/working-capital-analysis/references/wc-metrics.md +30 -0
@@ -0,0 +1,30 @@
1
+ # Unit Economics
2
+
3
+ ## Define the Unit First
4
+ Per product sold, per order, per customer, per active user, per ride/delivery, per bbl, per policy. Mixed units = meaningless math. State the unit on every analysis.
5
+
6
+ ## The Core Ledger (per unit)
7
+ ```
8
+ Average revenue per unit
9
+ − Variable COGS (materials, hosting, payment fees 1.5–3%, packaging)
10
+ − Variable fulfillment (shipping, delivery, support cost per order)
11
+ = Contribution margin 1 (CM1)
12
+ − Direct marketing cost per acquired unit (CAC where unit = customer)
13
+ = CM2 / fully variable profit
14
+ ```
15
+ CM1 must be positive at maturity or growth multiplies losses. CM2 payback determines cash needs.
16
+
17
+ ## Customer-Level Economics
18
+ - `LTV = CM1 per period × expected periods` (or `CM1 × 1/churn` for constant churn; discount if horizon > 2 yrs).
19
+ - LTV:CAC ≥ 3 healthy; CAC payback < 12–18 months B2B, < 6–12 B2C.
20
+ - Cohort discipline: compute by acquisition cohort and channel — blended numbers hide dying channels.
21
+
22
+ ## Margin Bridge Habit
23
+ When unit margin moves, decompose: price effect + mix effect + input cost effect + efficiency effect. (Pairs with variance-analysis skill.)
24
+
25
+ ## Traps
26
+ 1. Counting gross revenue when you're an agent (take-rate businesses: use net revenue).
27
+ 2. Excluding payment fees, refunds, fraud, and free-tier costs from "variable".
28
+ 3. LTV on projected retention with < 12 months of data.
29
+ 4. Improving averages that mask a barbell (great cohort + terrible cohort): always plot distributions.
30
+ 5. Fixed-cost amortization smuggled into unit costs to make a price look justified.
@@ -0,0 +1,21 @@
1
+ # Worked Example - retirement-planning
2
+
3
+ ## Ask
4
+
5
+ > I'm 35 years old, have $45,000 saved for retirement, and contribute $500/month. I want to retire at 65 with $1.5M. My expected return is 7% per year. Am I on track? If not, how much more do I need to contribute?
6
+
7
+ ## What a correct response contains
8
+
9
+ Should project the future value of $45,000 + $500/month at 7% over 30 years. Should compare the projection to the $1.5M target. Should calculate the additional monthly contribution required to reach $1.5M. Should mention the 4% rule and the annual withdrawal $1.5M would support.
10
+
11
+ ## File-driven variant
12
+
13
+ With fixture `evals/files/retirement_inputs.csv`:
14
+
15
+ > From the attached inputs (evals/files/retirement_inputs.csv), project the retirement nest egg, determine whether the target is met, and calculate the required monthly contribution to close any gap.
16
+
17
+ Expected: Projected nest egg $975,228; gap $524,772; need to contribute approximately $930/month to hit $1.5M target; 4% withdrawal from $1.5M supports $60,000/year.
18
+
19
+ ## Compute, don't estimate
20
+
21
+ All figures above come from [`scripts/calculate.py`](./scripts/calculate.py) — import its functions rather than doing arithmetic in prose.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: retirement-planning
3
+ description: When the user wants to plan for retirement, calculate how much to save, project a retirement nest egg, determine a safe withdrawal amount, or figure out whether they are on track. Also use when the user mentions "401k," "pension," "retirement age," "how much do I need to retire," "compound interest," "FIRE," or "retire early."
4
+ metadata:
5
+ version: 1.0.0
6
+ ---
7
+
8
+ # Retirement Planning
9
+
10
+ You are a Retirement Planning Specialist. Your goal is to help the user understand exactly where they stand, how much they need, and what specific actions will close any gap.
11
+
12
+ ## Initial Assessment
13
+
14
+ 1. **Current Position**
15
+ - Current retirement savings balance.
16
+ - Monthly contribution amount and any employer match.
17
+ - Current age and target retirement age.
18
+
19
+ 2. **Target**
20
+ - Desired annual retirement income (in today's dollars).
21
+ - Expected Social Security / state pension / annuity income.
22
+ - Expected retirement duration (target age to life expectancy).
23
+
24
+ 3. **Assumptions**
25
+ - Expected annual investment return (pre-retirement).
26
+ - Expected annual return in retirement (typically more conservative).
27
+ - Inflation rate assumption (default 2.5%).
28
+
29
+ ---
30
+
31
+ ## Planning Framework
32
+
33
+ ### Priority Order
34
+ 1. **Nest Egg Target** — calculate the lump sum needed at retirement.
35
+ 2. **Current Trajectory** — project current savings + contributions forward.
36
+ 3. **Gap Analysis** — identify the funding shortfall.
37
+ 4. **Contribution Strategy** — determine the monthly contribution to close the gap.
38
+ 5. **Withdrawal Planning** — model sustainable withdrawals in retirement.
39
+
40
+ ### The 4% Rule (Safe Withdrawal Rate)
41
+ A portfolio should sustain 30 years of withdrawals if the initial withdrawal rate is 4% or less.
42
+ `Nest Egg Target = Annual Retirement Spending / 0.04`
43
+
44
+ Example: $60,000/year needed → nest egg of $1,500,000.
45
+
46
+ ---
47
+
48
+ ## Technical Steps
49
+
50
+ ### 1. Future Value of Current Savings
51
+ `FV = P × (1 + r/12)^(n×12) + PMT × [((1 + r/12)^(n×12) − 1) / (r/12)]`
52
+ where P = current balance, PMT = monthly contribution, r = annual return, n = years to retirement.
53
+
54
+ ### 2. Months to Reach Target
55
+ Iterate monthly until accumulated balance ≥ nest egg target.
56
+
57
+ ### 3. Required Monthly Contribution
58
+ Solve for PMT given a known FV target, P, r, and n.
59
+
60
+ ### 4. Inflation Adjustment
61
+ Express all targets in real (inflation-adjusted) terms or gross up the nominal target.
62
+
63
+ ---
64
+
65
+ ## Output Format
66
+
67
+ **Retirement Snapshot**
68
+ - Target nest egg, projected nest egg, gap.
69
+ - Years remaining, required monthly contribution to close gap.
70
+
71
+ **Projection Chart Data**
72
+ - Year-by-year balance from today to retirement.
73
+
74
+ **Withdrawal Plan**
75
+ - Annual and monthly safe withdrawal amount.
76
+ - Portfolio depletion year under different return scenarios.
77
+
78
+ **Sensitivity Table**
79
+ - Impact of retiring 2 years later / earlier.
80
+ - Impact of +1% higher or lower return assumption.
81
+
82
+ ---
83
+
84
+ ## Scripts
85
+ - [calculate.py](./scripts/calculate.py): Deterministic functions for this skill's core computations. Run `python3 scripts/calculate.py` to self-test; import the functions instead of doing mental math.
86
+
87
+ ---
88
+
89
+ ## References
90
+ - [Retirement Planning Fundamentals](./references/retirement-fundamentals.md): Nest egg targets, safe withdrawal rate research, and contribution limits.
91
+ - [Compound Growth Guide](./references/compound-growth.md): Time-value-of-money concepts and the power of early contributions.
92
+
93
+ ---
94
+
95
+ ## Related Skills
96
+ - **personal-budgeting**: Identify how much of the monthly budget can be allocated to retirement contributions.
97
+ - **tax-efficient-investing**: Maximise after-tax growth by choosing the right account type (traditional vs. Roth vs. taxable).
98
+ - **investment-analysis**: Evaluate the asset allocation strategy inside the retirement portfolio.
@@ -0,0 +1,38 @@
1
+ # Compound Growth Guide
2
+
3
+ ## The Time Value of Money
4
+
5
+ A dollar today is worth more than a dollar in the future because it can be invested and earn a return.
6
+
7
+ **Future Value formula (lump sum):**
8
+ `FV = PV × (1 + r)^n`
9
+
10
+ **Future Value with regular contributions (monthly):**
11
+ `FV = PV × (1 + r/12)^(12n) + PMT × [((1 + r/12)^(12n) − 1) / (r/12)]`
12
+
13
+ where `r` = annual rate, `n` = years, `PMT` = monthly contribution.
14
+
15
+ ## Why Starting Early Matters
16
+
17
+ | Start Age | Monthly Contribution | Balance at 65 (7%) |
18
+ |---|---|---|
19
+ | 25 | $300 | $906,000 |
20
+ | 35 | $300 | $436,000 |
21
+ | 45 | $300 | $189,000 |
22
+
23
+ Starting at 25 vs. 35 yields more than double the outcome with the same contribution.
24
+
25
+ ## The Cost of Stopping Contributions
26
+
27
+ Stopping contributions for just 5 years in your 30s costs more in lost growth than the contributions themselves, because early dollars have the longest compounding runway.
28
+
29
+ ## Inflation Adjustment
30
+
31
+ To express a future sum in today's purchasing power:
32
+ `Real FV = Nominal FV / (1 + inflation_rate)^n`
33
+
34
+ At 2.5% inflation, $1M in 30 years has the purchasing power of ~$477,000 today.
35
+
36
+ ## Sources
37
+ - Bogle, J. C. (2017). *The Little Book of Common Sense Investing*. Wiley.
38
+ - Bernstein, W. (2010). *The Investor's Manifesto*. Wiley.
@@ -0,0 +1,29 @@
1
+ # Retirement Planning Fundamentals
2
+
3
+ ## How Much Do You Need? — The Nest Egg Target
4
+
5
+ The most widely cited rule is the **4% Safe Withdrawal Rate** (Bengen, 1994):
6
+ `Nest Egg = Desired Annual Income / 0.04`
7
+
8
+ A $1.5M portfolio supports $60,000/year for at least 30 years with high historical probability (>95% success across US market history).
9
+
10
+ **Conservative alternative**: Use 3.5% for a 40+ year horizon (FIRE movement standard).
11
+
12
+ ## Contribution Limits (US, 2024)
13
+ | Account | Limit | Catch-Up (50+) |
14
+ |---|---|---|
15
+ | 401(k) / 403(b) | $23,000 | +$7,500 |
16
+ | IRA (Traditional or Roth) | $7,000 | +$1,000 |
17
+ | HSA (individual) | $4,150 | +$1,000 |
18
+ | HSA (family) | $8,300 | +$1,000 |
19
+
20
+ ## Employer Match — Never Leave It on the Table
21
+ An employer 4% match on a $80,000 salary = $3,200 free per year. This is a 100% instant return; always contribute at least enough to capture the full match.
22
+
23
+ ## Rule of 72
24
+ A quick mental check: `Years to Double = 72 / Annual Return %`
25
+ At 7% return, money doubles every ~10.3 years.
26
+
27
+ ## Sources
28
+ - Bengen, W. P. (1994). Determining withdrawal rates using historical data. *Journal of Financial Planning*.
29
+ - Pfau, W. (2018). *How Much Can I Spend in Retirement?* Retirement Researcher Media.
@@ -0,0 +1,21 @@
1
+ # Worked Example - revenue-recognition
2
+
3
+ ## Ask
4
+
5
+ > We sold a $12k annual subscription today. The customer paid upfront. How much revenue do we recognize this month?
6
+
7
+ ## What a correct response contains
8
+
9
+ Should identify this as a multi-period performance obligation. Should calculate the monthly revenue ($1k). Should explain the deferral of the remaining $11k as Unearned Revenue. Should provide a Revenue Recognition Memo structure.
10
+
11
+ ## File-driven variant
12
+
13
+ With fixture(s) `evals/files/contracts.csv`:
14
+
15
+ > Contract C-101 in the attached file (evals/files/contracts.csv) was signed on 1 January for a fixed price of $100,000. Support and implementation are both delivered evenly over 12 months. Allocate the transaction price to each performance obligation using relative SSP per IFRS 15 / ASC 606, then compute revenue recognised by 31 March (3 months in). Show the allocation table and journal-ready amounts.
16
+
17
+ Expected: Relative-SSP allocation: licence $60,000, support $24,000, implementation $16,000 (sums to $100,000). By 31 March: licence in full plus 3/12 of support and implementation = $70,000 recognised; $30,000 remains as contract liability.
18
+
19
+ ## Compute, don't estimate
20
+
21
+ All figures above come from [`scripts/calculate.py`](./scripts/calculate.py) - import its functions rather than doing arithmetic in prose.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: revenue-recognition
3
+ description: When the user wants to apply complex revenue recognition rules (IFRS 15 / ASC 606). Also use when the user mentions "deferred revenue," "performance obligations," "contract assets," "multi-element arrangements," "SaaS revenue rules," or "unearned revenue."
4
+ metadata:
5
+ version: 1.0.0
6
+ ---
7
+
8
+ # Revenue Recognition (IFRS 15 / ASC 606)
9
+
10
+ You are a Technical Accounting Manager. Your goal is to ensure that revenue is recognized in a way that depicts the transfer of promised goods or services to customers.
11
+
12
+ ## Initial Assessment
13
+
14
+ 1. **Contract Analysis**
15
+ - Is there a formal contract?
16
+ - What are the distinct performance obligations? (e.g., Software license vs. Implementation vs. Support).
17
+
18
+ 2. **Transaction Price**
19
+ - Is there variable consideration (discounts, rebates, bonuses)?
20
+ - Is there a significant financing component?
21
+
22
+ 3. **Transfer of Control**
23
+ - Is revenue recognized "Point in Time" or "Over Time"?
24
+
25
+ ---
26
+
27
+ ## Revenue Framework (The 5-Step Model)
28
+
29
+ ### Priority Order
30
+ 1. **Identify the Contract** (Existence and enforceability).
31
+ 2. **Identify Performance Obligations** (Are they distinct?).
32
+ 3. **Determine Transaction Price** (Expected value or most likely amount).
33
+ 4. **Allocate Transaction Price** (Based on Standalone Selling Price - SSP).
34
+ 5. **Recognize Revenue** (As control transfers).
35
+
36
+ ---
37
+
38
+ ## Technical Accounting Steps
39
+
40
+ ### 1. Standalone Selling Price (SSP) Allocation
41
+ - If a bundle is sold for $1,000, but the individual components (License + Support) are worth $800 and $400, allocate the $1,000 proportionally.
42
+
43
+ ### 2. Contract Assets vs. Receivables
44
+ - Recognize a contract asset when the right to payment is conditional on something other than the passage of time.
45
+
46
+ ### 3. Deferred Revenue (Unearned)
47
+ - Map the schedule for recognizing revenue over the life of a subscription or service period.
48
+
49
+ ---
50
+
51
+ ## Output Format
52
+
53
+ ### Revenue Recognition Memo
54
+
55
+ **The Contract**
56
+ - Summary of performance obligations identified.
57
+ - Transaction price determination.
58
+
59
+ **Allocation Table**
60
+ - Breakdown of how the price is spread across obligations.
61
+
62
+ **Journal Entries**
63
+ - Specific entries for Initial Recognition, Deferral, and monthly Amortization.
64
+
65
+ ---
66
+
67
+ ## Scripts
68
+ - [calculate.py](./scripts/calculate.py): Deterministic functions for this skill's core computations. Run `python3 scripts/calculate.py` to self-test; import the functions instead of doing mental math.
69
+
70
+ ---
71
+
72
+ ## References
73
+ - [IFRS 15 Summary](./references/ifrs15-guide.md): The official 5-step model details.
74
+ - [SaaS Revenue Standards](./references/saas-rev-rec.md): Specifics for subscription businesses.
75
+
76
+ ---
77
+
78
+ ## Assets
79
+ - [allocation-workpaper-template.md](./assets/allocation-workpaper-template.md): 5-step IFRS 15 / ASC 606 workpaper.
80
+
81
+ ---
82
+
83
+ ## Related Skills
84
+ - **statement-preparation**: For accurately reporting revenue and deferred revenue.
85
+ - **audit-checklist**: For auditing the revenue cycle.
86
+ - **financial-analysis**: For analyzing the quality of earnings.
@@ -0,0 +1,30 @@
1
+ # Revenue Recognition Workpaper (IFRS 15 / ASC 606)
2
+
3
+ **Contract:** {id} | **Customer:** {name} | **Signed:** {date} | **Transaction price:** {amount}
4
+
5
+ ## Step 1-2: Contract & Performance Obligations
6
+ | # | Performance obligation | Distinct? | Timing (PIT / over time) | Measure of progress |
7
+ |---|---|---|---|---|
8
+
9
+ ## Step 3: Transaction Price
10
+ Fixed: {x} | Variable (constrained): {x} | Financing component: {y/n} | Non-cash: {x}
11
+
12
+ ## Step 4: Allocation (relative SSP)
13
+ | PO | SSP | SSP % | Allocated price |
14
+ |---|---|---|---|
15
+ | | | | |
16
+ | **Total** | {ssp_total} | 100% | **{price - must tie}** |
17
+
18
+ ## Step 5: Recognition Schedule
19
+ | PO | {p1} | {p2} | {p3} | {p4} | Total |
20
+ |---|---|---|---|---|---|
21
+
22
+ ## Period-End Position
23
+ Revenue recognised to date: {x} | Billed: {x} | Contract asset / (liability): {x}
24
+
25
+ ## Journal Entries
26
+ | Date | Account | Dr | Cr |
27
+ |---|---|---|---|
28
+
29
+ ---
30
+ *Allocation computed with scripts/calculate.py (allocate_transaction_price). AI-prepared - review required.*
@@ -0,0 +1,28 @@
1
+ # IFRS 15 / ASC 606: The Five-Step Model
2
+
3
+ ## Step 1 — Identify the Contract
4
+ Criteria: approved, rights identifiable, payment terms identifiable, commercial substance, collection probable. Combine contracts entered near the same time with the same customer if negotiated as a package.
5
+
6
+ ## Step 2 — Identify Performance Obligations (POs)
7
+ A promised good/service is distinct if: (a) customer can benefit from it alone or with readily available resources, AND (b) it is separately identifiable in the contract (not highly integrated, not significantly modifying another good/service).
8
+ - Software + critical customization = often ONE PO.
9
+ - Software + standalone support = TWO POs.
10
+
11
+ ## Step 3 — Determine Transaction Price
12
+ - Variable consideration (rebates, penalties, usage tiers): estimate via expected value or most-likely amount, constrained so reversal is highly improbable.
13
+ - Significant financing component if timing gap > 12 months.
14
+ - Non-cash consideration at fair value.
15
+
16
+ ## Step 4 — Allocate to POs
17
+ Pro-rata on standalone selling prices (SSP). SSP hierarchy: observable price → adjusted market assessment → expected cost plus margin → residual (restricted).
18
+
19
+ ## Step 5 — Recognize Revenue
20
+ Over time if ANY: (a) customer simultaneously receives/consumes, (b) asset created/enhanced is customer-controlled, (c) no alternative use + enforceable right to payment for performance to date. Otherwise point in time (control transfer indicators: title, possession, risks/rewards, acceptance).
21
+
22
+ ## Contract Modifications
23
+ - Adds distinct goods at SSP → separate contract.
24
+ - Adds distinct goods NOT at SSP → prospective (terminate & replace).
25
+ - Remaining goods not distinct → cumulative catch-up.
26
+
27
+ ## Disclosures
28
+ Disaggregated revenue, contract balances (contract assets/liabilities), remaining performance obligations (backlog), significant judgments.
@@ -0,0 +1,26 @@
1
+ # SaaS Revenue Recognition Patterns
2
+
3
+ ## Typical POs in a SaaS Contract
4
+ | Element | Distinct? | Pattern |
5
+ |---|---|---|
6
+ | Subscription/hosting | Yes (the core PO) | Ratable over term |
7
+ | Implementation/setup | Usually NOT distinct if no standalone value | Roll into subscription, recognize over term (or over expected customer life if material) |
8
+ | Premium support | Yes if sold separately | Ratable |
9
+ | Usage/overage fees | Variable consideration | Recognize as usage occurs (royalty-style exception often applies) |
10
+ | Professional services (config, training) | Often distinct | As delivered |
11
+
12
+ ## Key Judgments
13
+ - **Setup fees**: Non-refundable upfront fees rarely transfer a distinct service → defer and amortize. Material renewal option advantage → amortize over expected life, not initial term.
14
+ - **Term licenses + cloud**: On-prem license is point-in-time; SaaS is over-time. Hybrid deals need SSP allocation.
15
+ - **Free trials/discounted first year**: Total contract price spread over total committed term.
16
+
17
+ ## Metrics Bridge (for finance reviews)
18
+ - Billings = Revenue + ΔDeferred Revenue.
19
+ - ARR ≠ revenue: ARR is contracted run-rate; revenue is recognized.
20
+ - A growing gap between billings and revenue signals lengthening prepay terms, not necessarily growth.
21
+
22
+ ## Common Errors
23
+ 1. Recognizing setup fees on go-live (should be deferred).
24
+ 2. Straight-lining usage revenue (should follow actual usage).
25
+ 3. Ignoring material rights from renewal discounts.
26
+ 4. Commission costs (ASC 340-40 / IFRS 15 contract costs): capitalize and amortize over benefit period, including renewals if commissions on renewal aren't commensurate.
@@ -0,0 +1,21 @@
1
+ # Worked Example - risk-assessment
2
+
3
+ ## Ask
4
+
5
+ > Our portfolio is 40% tech stocks and 60% crypto. What's the risk if the Fed raises interest rates?
6
+
7
+ ## What a correct response contains
8
+
9
+ Should identify high interest rate sensitivity in tech and crypto. Should discuss the impact on the discount rate (valuing tech) and liquidity (crypto). Should suggest a VaR calculation or stress test. Should recommend diversification or hedging strategies.
10
+
11
+ ## File-driven variant
12
+
13
+ With fixture(s) `evals/files/daily_returns.csv`:
14
+
15
+ > Portfolio value $10,000,000. From the attached daily return history (evals/files/daily_returns.csv), compute 95% one-day historical VaR (in % and $), 95% parametric VaR assuming sigma=1.2% and zero mean, and annualized volatility. Compare the two VaR estimates.
16
+
17
+ Expected: Historical VaR 1.94% ($194,370); parametric VaR $197,388; annualized vol 19.4%.
18
+
19
+ ## Compute, don't estimate
20
+
21
+ All figures above come from [`scripts/calculate.py`](./scripts/calculate.py) - import its functions rather than doing arithmetic in prose.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: risk-assessment
3
+ description: When the user wants to identify, quantify, and mitigate financial risks. Also use when the user mentions "market volatility," "credit risk," "liquidity gap," "stress testing," "Value at Risk," "VaR," "black swan events," or "what if the market crashes." Use this for portfolio management and enterprise risk.
4
+ metadata:
5
+ version: 1.1.0
6
+ ---
7
+
8
+ # Risk Assessment
9
+
10
+ You are a Risk Manager. Your goal is to identify potential threats to financial stability and recommend mitigation strategies to protect capital.
11
+
12
+ ## Initial Assessment
13
+
14
+ 1. **Risk Scope**
15
+ - Portfolio risk, Credit risk, or Operational risk?
16
+ - What is the time horizon (e.g., 1-day VaR, 1-year default risk)?
17
+
18
+ 2. **Data Requirements**
19
+ - Historical price volatility.
20
+ - Counterparty credit ratings.
21
+ - Current liquidity ratios.
22
+
23
+ ---
24
+
25
+ ## Risk Framework
26
+
27
+ ### Priority Order
28
+ 1. **Identification** (What could go wrong?).
29
+ 2. **Quantification** (How likely is it and how much will it cost?).
30
+ 3. **Mitigation** (How can we lower the impact?).
31
+ 4. **Monitoring** (How do we track the risk over time?).
32
+
33
+ ---
34
+
35
+ ## Technical Risk Steps
36
+
37
+ ### 1. Value at Risk (VaR)
38
+ - Calculate VaR at 95% and 99% confidence levels using historical or parametric methods.
39
+ - Explain the result: "There is a 5% chance the portfolio will lose more than $X in a single day."
40
+
41
+ ### 2. Stress Testing
42
+ - Simulate "Black Swan" scenarios (e.g., interest rate spike, currency devaluation, sector-specific crash).
43
+
44
+ ### 3. Credit Risk Review
45
+ - Evaluate the probability of default for key counterparties using Altman Z-Score or similar models.
46
+
47
+ ---
48
+
49
+ ## Output Format
50
+
51
+ ### Risk Dashboard Structure
52
+
53
+ **Executive Summary**
54
+ - Top 3 Risk Exposures.
55
+ - Risk Appetite Alignment (Within/Exceeding limits).
56
+
57
+ **Quantitative Assessment**
58
+ - VaR Analysis Table.
59
+ - Stress Test Results (Scenario vs. Estimated Loss).
60
+ - Concentration report (Are we too heavily invested in one area?).
61
+
62
+ **Mitigation Plan**
63
+ 1. Hedging recommendations (Options, Swaps).
64
+ 2. Diversification steps.
65
+ 3. Liquidity reserve requirements.
66
+
67
+ ---
68
+
69
+ ## Scripts
70
+ - [calculate.py](./scripts/calculate.py): Deterministic functions for this skill's core computations. Run `python3 scripts/calculate.py` to self-test; import the functions instead of doing mental math.
71
+
72
+ ---
73
+
74
+ ## References
75
+ - [Risk Metrics Guide](./references/risk-metrics.md): Explaining VaR and Z-Score.
76
+ - [Mitigation Strategies](./references/hedging-guide.md): Derivatives and diversification basics.
77
+
78
+ ---
79
+
80
+ ## Related Skills
81
+ - **investment-analysis**: To factor risk into the valuation.
82
+ - **financial-analysis**: For detecting deteriorating liquidity signals.
83
+ - **budget-forecast**: For building risk-adjusted financial plans.
@@ -0,0 +1,24 @@
1
+ # Hedging Guide: Managing Financial Exposure
2
+
3
+ Strategies for protecting an entity from adverse price movements in markets.
4
+
5
+ ## 🏛️ Common Hedging Instruments
6
+
7
+ ### 1. Options
8
+ - **Put Options**: Protect against falling prices (downside protection).
9
+ - **Call Options**: Protect against rising prices (for buyers of commodities).
10
+
11
+ ### 2. Futures & Forwards
12
+ Contractual obligations to buy or sell an asset at a predetermined price on a future date. Used to lock in prices today.
13
+
14
+ ### 3. Swaps (Interest Rate Swaps)
15
+ Exchanging floating-rate interest payments for fixed-rate payments to protect against rising interest rates.
16
+
17
+ ---
18
+
19
+ ## 🔍 The Goal of Hedging
20
+ The goal of hedging is **NOT** to make a profit. It is to **REDUCE UNCERTAINTY** and protect the core operations of the business from market volatility.
21
+
22
+ ## 🔗 Sources
23
+ - [Investopedia: Hedging Definition](https://www.investopedia.com/terms/h/hedging.asp)
24
+ - [CFI: Hedging Strategy](https://corporatefinanceinstitute.com/resources/knowledge/trading-investing/hedging-strategy/)
@@ -0,0 +1,24 @@
1
+ # Risk Metrics: VaR & Z-Score
2
+
3
+ Quantitative tools for measuring the probability and impact of financial failure.
4
+
5
+ ## 🏛️ Value at Risk (VaR)
6
+ VaR measures the potential loss in value of a risky asset or portfolio over a defined period for a given confidence interval.
7
+
8
+ ### Interpretation
9
+ "Our 1-day 95% VaR is $1M."
10
+ This means there is a **5% probability** that the portfolio will lose **more than $1M** in a single day.
11
+
12
+ ---
13
+
14
+ ## 🔍 Altman Z-Score
15
+ A formula used to predict the probability that a firm will go into bankruptcy within two years.
16
+
17
+ ### The Zones
18
+ - **Z > 2.99**: "Safe" Zone.
19
+ - **1.81 < Z < 2.99**: "Grey" Zone (Caution required).
20
+ - **Z < 1.81**: "Distress" Zone (High probability of bankruptcy).
21
+
22
+ ## 🔗 Sources
23
+ - [Investopedia: Value at Risk](https://www.investopedia.com/terms/v/var.asp)
24
+ - [CFI: Altman's Z-Score Model](https://corporatefinanceinstitute.com/resources/knowledge/finance/altmans-z-score-model/)
@@ -0,0 +1,17 @@
1
+ # Worked Example - sox-compliance
2
+
3
+ ## Ask
4
+
5
+ > I need to test a daily three-way-match control in P2P for the full year. Population is about 18,000 matched invoices. How many samples, how do I pick them, and what do I document?
6
+
7
+ ## What a correct response contains
8
+
9
+ Sample of 25-40 (daily/per-transaction frequency), random selection across the full period including period-end, population completeness validation against the GL/system, and item-level attribute documentation.
10
+
11
+ ## File-driven variant
12
+
13
+ With fixture(s) `evals/files/revenue_population.csv`:
14
+
15
+ > This is the Jan-May population for the revenue approval control (evals/files/revenue_population.csv), which operates per-transaction (daily frequency). Determine the sample size per standard SOX guidance for a daily control, select the sample reproducibly (state your method/seed), test approval status across the FULL population programmatically, and classify any exceptions.
16
+
17
+ Expected: Daily/multiple-times-daily control -> 25 selections (or 40 per some methodologies - state the table used). Programmatic scan of all 120 items finds 25 missing approvals -> exceptions to evaluate as deficiency; given the rate, classify at least significant-deficiency pending compensating controls and quantitative materiality.