@v587d/capital-generation 2.7.7 → 2.7.9
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.
- package/CHANGELOG.md +124 -0
- package/README.md +7 -5
- package/THIRD_PARTY_NOTICES.md +24 -3
- package/capital-config/client.js +4 -4
- package/capital-config/package.json +1 -1
- package/capital-watchlist/client.js +3 -3
- package/capital-watchlist/client.src.cjs +4 -4
- package/capital-watchlist/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/lib/agents/selected-skills-provider.js +41 -8
- package/lib/chart/source-token.js +18 -3
- package/lib/data-collector/dataset-tools.js +4 -2
- package/lib/data-collector/describe.d.ts +4 -0
- package/lib/data-collector/describe.js +11 -1
- package/lib/index.d.ts +17 -0
- package/lib/index.js +50 -18
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +3 -1
- package/preset/capital-generation/agent.patch.yml +1 -0
- package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +4 -0
- package/preset/capital-generation/skills/capital-equity-research/SKILL.md +1 -1
- package/preset/capital-generation/skills/capital-orchestration/SKILL.md +5 -0
- package/preset/capital-generation/skills/capital-visualization-protocol/SKILL.md +7 -7
- package/preset/capital-generation/skills/capital-web-protocol/SKILL.md +10 -3
- package/selected-skills/README.md +3 -1
- package/selected-skills/catalog.js +183 -0
- package/selected-skills/financeskills/LICENSE +21 -0
- package/selected-skills/financeskills/UPSTREAM.md +202 -0
- package/selected-skills/financeskills/skills/ai-anomaly-detection/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/ai-anomaly-detection/SKILL.md +84 -0
- package/selected-skills/financeskills/skills/ai-anomaly-detection/references/feature-engineering.md +20 -0
- package/selected-skills/financeskills/skills/ai-anomaly-detection/references/ml-algorithms.md +28 -0
- package/selected-skills/financeskills/skills/aro-computation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/aro-computation/SKILL.md +82 -0
- package/selected-skills/financeskills/skills/aro-computation/references/aro-standards.md +22 -0
- package/selected-skills/financeskills/skills/aro-computation/references/pv-math.md +27 -0
- package/selected-skills/financeskills/skills/audit-checklist/EXAMPLE.md +17 -0
- package/selected-skills/financeskills/skills/audit-checklist/SKILL.md +77 -0
- package/selected-skills/financeskills/skills/audit-checklist/references/internal-controls.md +36 -0
- package/selected-skills/financeskills/skills/audit-checklist/references/isa-standards.md +26 -0
- package/selected-skills/financeskills/skills/automated-reconciliation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/automated-reconciliation/SKILL.md +87 -0
- package/selected-skills/financeskills/skills/automated-reconciliation/assets/reconciliation-statement-template.md +31 -0
- package/selected-skills/financeskills/skills/automated-reconciliation/references/fuzzy-logic.md +27 -0
- package/selected-skills/financeskills/skills/automated-reconciliation/references/rec-controls.md +28 -0
- package/selected-skills/financeskills/skills/banking-compliance/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/banking-compliance/SKILL.md +82 -0
- package/selected-skills/financeskills/skills/banking-compliance/references/basel-iii-framework.md +26 -0
- package/selected-skills/financeskills/skills/banking-compliance/references/risk-weights.md +32 -0
- package/selected-skills/financeskills/skills/budget-forecast/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/budget-forecast/SKILL.md +87 -0
- package/selected-skills/financeskills/skills/budget-forecast/references/forecasting-best-practices.md +26 -0
- package/selected-skills/financeskills/skills/budget-forecast/references/scenario-analysis.md +25 -0
- package/selected-skills/financeskills/skills/close-management/EXAMPLE.md +17 -0
- package/selected-skills/financeskills/skills/close-management/SKILL.md +85 -0
- package/selected-skills/financeskills/skills/close-management/references/close-task-library.md +32 -0
- package/selected-skills/financeskills/skills/company-valuation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/company-valuation/SKILL.md +80 -0
- package/selected-skills/financeskills/skills/company-valuation/references/terminal-value-guide.md +33 -0
- package/selected-skills/financeskills/skills/corporate-consolidation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/corporate-consolidation/SKILL.md +84 -0
- package/selected-skills/financeskills/skills/corporate-consolidation/references/consolidation-standard.md +28 -0
- package/selected-skills/financeskills/skills/corporate-consolidation/references/minority-interest.md +25 -0
- package/selected-skills/financeskills/skills/credit-analysis/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/credit-analysis/SKILL.md +84 -0
- package/selected-skills/financeskills/skills/credit-analysis/references/covenant-guide.md +26 -0
- package/selected-skills/financeskills/skills/crypto-accounting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/crypto-accounting/SKILL.md +81 -0
- package/selected-skills/financeskills/skills/crypto-accounting/references/fasb-crypto.md +26 -0
- package/selected-skills/financeskills/skills/crypto-accounting/references/ifrs-crypto.md +25 -0
- package/selected-skills/financeskills/skills/cvp-breakeven/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/cvp-breakeven/SKILL.md +78 -0
- package/selected-skills/financeskills/skills/cvp-breakeven/references/cvp-patterns.md +28 -0
- package/selected-skills/financeskills/skills/debt-payoff/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/debt-payoff/SKILL.md +94 -0
- package/selected-skills/financeskills/skills/debt-payoff/references/debt-strategies.md +32 -0
- package/selected-skills/financeskills/skills/debt-payoff/references/interest-calculations.md +27 -0
- package/selected-skills/financeskills/skills/debt-restructuring/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/debt-restructuring/SKILL.md +79 -0
- package/selected-skills/financeskills/skills/debt-restructuring/references/creditor-priority.md +26 -0
- package/selected-skills/financeskills/skills/debt-restructuring/references/restructuring-types.md +24 -0
- package/selected-skills/financeskills/skills/deferred-tax/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/deferred-tax/SKILL.md +86 -0
- package/selected-skills/financeskills/skills/deferred-tax/references/td-catalogue.md +39 -0
- package/selected-skills/financeskills/skills/earned-value-mgmt/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/earned-value-mgmt/SKILL.md +79 -0
- package/selected-skills/financeskills/skills/earned-value-mgmt/references/forecasting-eac.md +27 -0
- package/selected-skills/financeskills/skills/earned-value-mgmt/references/pmi-evm.md +29 -0
- package/selected-skills/financeskills/skills/ecl-computation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/ecl-computation/SKILL.md +85 -0
- package/selected-skills/financeskills/skills/ecl-computation/references/ifrs9-standard.md +27 -0
- package/selected-skills/financeskills/skills/ecl-computation/references/risk-modeling.md +26 -0
- package/selected-skills/financeskills/skills/esg-reporting/EXAMPLE.md +17 -0
- package/selected-skills/financeskills/skills/esg-reporting/SKILL.md +79 -0
- package/selected-skills/financeskills/skills/esg-reporting/references/ghg-protocol.md +22 -0
- package/selected-skills/financeskills/skills/esg-reporting/references/sasb-map.md +25 -0
- package/selected-skills/financeskills/skills/financial-analysis/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/financial-analysis/SKILL.md +108 -0
- package/selected-skills/financeskills/skills/financial-analysis/assets/analysis-memo-template.md +31 -0
- package/selected-skills/financeskills/skills/financial-analysis/references/accounting-standards.md +45 -0
- package/selected-skills/financeskills/skills/financial-analysis/references/ratio-definitions.md +14 -0
- package/selected-skills/financeskills/skills/fixed-asset-accounting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/fixed-asset-accounting/SKILL.md +78 -0
- package/selected-skills/financeskills/skills/fixed-asset-accounting/references/useful-life-guide.md +30 -0
- package/selected-skills/financeskills/skills/forensic-accounting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/forensic-accounting/SKILL.md +91 -0
- package/selected-skills/financeskills/skills/forensic-accounting/references/benfords-law.md +24 -0
- package/selected-skills/financeskills/skills/forensic-accounting/references/fraud-triangle.md +26 -0
- package/selected-skills/financeskills/skills/insurance-reserving/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/insurance-reserving/SKILL.md +82 -0
- package/selected-skills/financeskills/skills/insurance-reserving/references/actuarial-methods.md +33 -0
- package/selected-skills/financeskills/skills/insurance-reserving/references/insurance-metrics.md +26 -0
- package/selected-skills/financeskills/skills/intercompany-accounting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/intercompany-accounting/SKILL.md +79 -0
- package/selected-skills/financeskills/skills/intercompany-accounting/references/elimination-entries.md +35 -0
- package/selected-skills/financeskills/skills/inventory-costing/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/inventory-costing/SKILL.md +80 -0
- package/selected-skills/financeskills/skills/inventory-costing/references/costing-examples.md +31 -0
- package/selected-skills/financeskills/skills/investment-analysis/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/investment-analysis/SKILL.md +82 -0
- package/selected-skills/financeskills/skills/investment-analysis/references/competitive-advantage.md +31 -0
- package/selected-skills/financeskills/skills/investment-analysis/references/valuation-guide.md +29 -0
- package/selected-skills/financeskills/skills/journal-entry/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/journal-entry/SKILL.md +94 -0
- package/selected-skills/financeskills/skills/journal-entry/assets/journal-entry-template.md +21 -0
- package/selected-skills/financeskills/skills/journal-entry/references/entry-patterns.md +51 -0
- package/selected-skills/financeskills/skills/lbo-modeling/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/lbo-modeling/SKILL.md +88 -0
- package/selected-skills/financeskills/skills/lbo-modeling/references/debt-structures.md +22 -0
- package/selected-skills/financeskills/skills/lbo-modeling/references/lbo-best-practices.md +27 -0
- package/selected-skills/financeskills/skills/lease-accounting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/lease-accounting/SKILL.md +88 -0
- package/selected-skills/financeskills/skills/lease-accounting/assets/commencement-summary-template.md +28 -0
- package/selected-skills/financeskills/skills/lease-accounting/references/ibr-guide.md +26 -0
- package/selected-skills/financeskills/skills/net-worth-tracker/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/net-worth-tracker/SKILL.md +98 -0
- package/selected-skills/financeskills/skills/net-worth-tracker/references/asset-valuation.md +40 -0
- package/selected-skills/financeskills/skills/net-worth-tracker/references/net-worth-benchmarks.md +33 -0
- package/selected-skills/financeskills/skills/nlp-earnings-sentiment/EXAMPLE.md +17 -0
- package/selected-skills/financeskills/skills/nlp-earnings-sentiment/SKILL.md +77 -0
- package/selected-skills/financeskills/skills/nlp-earnings-sentiment/references/finbert-guide.md +26 -0
- package/selected-skills/financeskills/skills/nlp-earnings-sentiment/references/linguistic-finance.md +23 -0
- package/selected-skills/financeskills/skills/oil-gas-valuation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/oil-gas-valuation/SKILL.md +86 -0
- package/selected-skills/financeskills/skills/oil-gas-valuation/references/sec-reporting.md +22 -0
- package/selected-skills/financeskills/skills/oil-gas-valuation/references/spe-standards.md +25 -0
- package/selected-skills/financeskills/skills/personal-budgeting/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/personal-budgeting/SKILL.md +100 -0
- package/selected-skills/financeskills/skills/personal-budgeting/references/budgeting-methods.md +40 -0
- package/selected-skills/financeskills/skills/personal-budgeting/references/spending-categories.md +40 -0
- package/selected-skills/financeskills/skills/predictive-burn-rate/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/predictive-burn-rate/SKILL.md +82 -0
- package/selected-skills/financeskills/skills/predictive-burn-rate/references/startup-metrics.md +27 -0
- package/selected-skills/financeskills/skills/predictive-burn-rate/references/time-series-forecasting.md +22 -0
- package/selected-skills/financeskills/skills/product-profitability/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/product-profitability/SKILL.md +83 -0
- package/selected-skills/financeskills/skills/product-profitability/references/allocation-logic.md +28 -0
- package/selected-skills/financeskills/skills/product-profitability/references/unit-economics.md +30 -0
- package/selected-skills/financeskills/skills/retirement-planning/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/retirement-planning/SKILL.md +98 -0
- package/selected-skills/financeskills/skills/retirement-planning/references/compound-growth.md +38 -0
- package/selected-skills/financeskills/skills/retirement-planning/references/retirement-fundamentals.md +29 -0
- package/selected-skills/financeskills/skills/revenue-recognition/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/revenue-recognition/SKILL.md +86 -0
- package/selected-skills/financeskills/skills/revenue-recognition/assets/allocation-workpaper-template.md +30 -0
- package/selected-skills/financeskills/skills/revenue-recognition/references/ifrs15-guide.md +28 -0
- package/selected-skills/financeskills/skills/revenue-recognition/references/saas-rev-rec.md +26 -0
- package/selected-skills/financeskills/skills/risk-assessment/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/risk-assessment/SKILL.md +83 -0
- package/selected-skills/financeskills/skills/risk-assessment/references/hedging-guide.md +24 -0
- package/selected-skills/financeskills/skills/risk-assessment/references/risk-metrics.md +24 -0
- package/selected-skills/financeskills/skills/sox-compliance/EXAMPLE.md +17 -0
- package/selected-skills/financeskills/skills/sox-compliance/SKILL.md +88 -0
- package/selected-skills/financeskills/skills/sox-compliance/references/sampling-methodology.md +27 -0
- package/selected-skills/financeskills/skills/startup-valuation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/startup-valuation/SKILL.md +88 -0
- package/selected-skills/financeskills/skills/startup-valuation/references/berkus-method.md +25 -0
- package/selected-skills/financeskills/skills/startup-valuation/references/vc-method.md +23 -0
- package/selected-skills/financeskills/skills/statement-preparation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/statement-preparation/SKILL.md +86 -0
- package/selected-skills/financeskills/skills/statement-preparation/references/accruals-deferrals.md +24 -0
- package/selected-skills/financeskills/skills/statement-preparation/references/cash-flow-method.md +32 -0
- package/selected-skills/financeskills/skills/tax-efficient-investing/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/tax-efficient-investing/SKILL.md +97 -0
- package/selected-skills/financeskills/skills/tax-efficient-investing/references/account-types.md +33 -0
- package/selected-skills/financeskills/skills/tax-efficient-investing/references/asset-location.md +36 -0
- package/selected-skills/financeskills/skills/tax-planning/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/tax-planning/SKILL.md +93 -0
- package/selected-skills/financeskills/skills/tax-planning/references/common-deductions.md +28 -0
- package/selected-skills/financeskills/skills/tax-planning/references/tax-code-lookup.md +25 -0
- package/selected-skills/financeskills/skills/three-statement-modeling/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/three-statement-modeling/SKILL.md +84 -0
- package/selected-skills/financeskills/skills/three-statement-modeling/references/model-checks.md +32 -0
- package/selected-skills/financeskills/skills/treasury-management/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/treasury-management/SKILL.md +83 -0
- package/selected-skills/financeskills/skills/treasury-management/references/fx-hedging.md +27 -0
- package/selected-skills/financeskills/skills/treasury-management/references/liquidity-metrics.md +24 -0
- package/selected-skills/financeskills/skills/variance-analysis/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/variance-analysis/SKILL.md +78 -0
- package/selected-skills/financeskills/skills/variance-analysis/references/overhead-logic.md +24 -0
- package/selected-skills/financeskills/skills/variance-analysis/references/variance-math.md +35 -0
- package/selected-skills/financeskills/skills/venture-debt/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/venture-debt/SKILL.md +84 -0
- package/selected-skills/financeskills/skills/venture-debt/references/saas-debt-metrics.md +26 -0
- package/selected-skills/financeskills/skills/venture-debt/references/venture-lending.md +23 -0
- package/selected-skills/financeskills/skills/wacc-computation/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/wacc-computation/SKILL.md +98 -0
- package/selected-skills/financeskills/skills/wacc-computation/assets/wacc-memo-template.md +40 -0
- package/selected-skills/financeskills/skills/wacc-computation/references/beta-math.md +24 -0
- package/selected-skills/financeskills/skills/wacc-computation/references/capm-basics.md +24 -0
- package/selected-skills/financeskills/skills/working-capital-analysis/EXAMPLE.md +21 -0
- package/selected-skills/financeskills/skills/working-capital-analysis/SKILL.md +83 -0
- package/selected-skills/financeskills/skills/working-capital-analysis/references/wc-metrics.md +30 -0
- package/selected-skills/quant-agent-skills/LICENSE +21 -0
- package/selected-skills/quant-agent-skills/UPSTREAM.md +111 -0
- package/selected-skills/quant-agent-skills/skills/cross-market-listing-choice/SKILL.md +105 -0
- package/selected-skills/quant-agent-skills/skills/cross-market-listing-choice/references/adr-hk-overlay.md +45 -0
- package/selected-skills/quant-agent-skills/skills/cross-market-listing-choice/references/ah-overlay.md +44 -0
package/selected-skills/financeskills/skills/statement-preparation/references/accruals-deferrals.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Accruals and Deferrals
|
|
2
|
+
|
|
3
|
+
## The Four Period-End Adjustment Types
|
|
4
|
+
| Type | Cash vs. Recognition | Example | Entry |
|
|
5
|
+
|---|---|---|---|
|
|
6
|
+
| Accrued expense | Expense before cash out | Unbilled legal fees | Dr Expense / Cr Accrued Liability |
|
|
7
|
+
| Accrued revenue | Revenue before cash in | Unbilled services delivered | Dr Accrued Receivable / Cr Revenue |
|
|
8
|
+
| Deferred (prepaid) expense | Cash out before expense | Annual insurance premium | Dr Prepaid Asset at payment; amortize Dr Expense / Cr Prepaid |
|
|
9
|
+
| Deferred revenue | Cash in before revenue | Annual SaaS subscription billed upfront | Dr Cash / Cr Deferred Revenue; release Dr Deferred Revenue / Cr Revenue |
|
|
10
|
+
|
|
11
|
+
## Estimation Standards for Accruals
|
|
12
|
+
- Base on invoices received post-close, PO/GRNI reports, contracts, and run-rates.
|
|
13
|
+
- Document the basis; an accrual without support fails audit.
|
|
14
|
+
- Reverse auto-reversing accruals on day 1 of the next period; true-up against actuals and track accrual accuracy (target: |true-up| < 5% of accrual).
|
|
15
|
+
|
|
16
|
+
## Cut-Off Rules
|
|
17
|
+
- Goods: recognize when control transfers (shipping terms — FOB shipping point vs. destination).
|
|
18
|
+
- Services: recognize as performed, supported by timesheets/completion evidence.
|
|
19
|
+
- Three-way match exceptions at close → GRNI accrual.
|
|
20
|
+
|
|
21
|
+
## Red Flags
|
|
22
|
+
- Accruals flat period-over-period (stale, not re-estimated).
|
|
23
|
+
- Deferred revenue declining while billings grow (release schedule error).
|
|
24
|
+
- Round-number accruals with no support.
|
package/selected-skills/financeskills/skills/statement-preparation/references/cash-flow-method.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Cash Flow Statement: Indirect Method
|
|
2
|
+
|
|
3
|
+
## Structure (IAS 7 / ASC 230)
|
|
4
|
+
1. **Operating**: Start with net income, add back non-cash items, adjust for working capital deltas.
|
|
5
|
+
2. **Investing**: Capex, acquisitions, asset disposals, investment purchases/sales.
|
|
6
|
+
3. **Financing**: Debt draws/repayments, equity issues/buybacks, dividends, lease principal (IFRS 16).
|
|
7
|
+
|
|
8
|
+
## Operating Section Walk
|
|
9
|
+
```
|
|
10
|
+
Net Income
|
|
11
|
+
+ Depreciation & Amortization
|
|
12
|
+
+ Impairment losses
|
|
13
|
+
+ Share-based compensation
|
|
14
|
+
+/- Deferred tax expense/(benefit)
|
|
15
|
+
+/- Loss/(gain) on asset disposal
|
|
16
|
+
- Increase in receivables (+ if decrease)
|
|
17
|
+
- Increase in inventory (+ if decrease)
|
|
18
|
+
+ Increase in payables (- if decrease)
|
|
19
|
+
+ Increase in deferred revenue (- if decrease)
|
|
20
|
+
= Cash Flow from Operations
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Classification Traps
|
|
24
|
+
- **Interest paid**: Operating under US GAAP; operating OR financing under IFRS (be consistent).
|
|
25
|
+
- **Interest/dividends received**: Operating (US GAAP); operating or investing (IFRS).
|
|
26
|
+
- **Lease payments (IFRS 16)**: Principal → financing; interest → per interest policy.
|
|
27
|
+
- **Capitalized development costs**: Investing, not operating.
|
|
28
|
+
|
|
29
|
+
## Tie-Out Checks
|
|
30
|
+
1. Net change in cash = closing cash − opening cash (including FX effect line).
|
|
31
|
+
2. D&A added back must equal D&A in the fixed asset rollforward.
|
|
32
|
+
3. Working capital deltas must reconcile to balance sheet movements net of acquisitions/FX (non-cash portions excluded).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Worked Example - tax-efficient-investing
|
|
2
|
+
|
|
3
|
+
## Ask
|
|
4
|
+
|
|
5
|
+
> I'm in the 24% federal tax bracket, single filer, earning $95,000. I have a 401k at work with a 4% employer match, and I have $10,000 to invest this year. How should I allocate it across account types for maximum tax efficiency?
|
|
6
|
+
|
|
7
|
+
## What a correct response contains
|
|
8
|
+
|
|
9
|
+
Should first confirm whether the user is capturing the full employer 4% match (free money). Should recommend: (1) contribute enough to 401k to get full match, (2) max Roth IRA ($7,000 for 2024), (3) remaining into 401k or taxable brokerage. Should calculate the tax savings from pre-tax 401k contributions. Should explain Roth vs. traditional trade-off at 24% bracket.
|
|
10
|
+
|
|
11
|
+
## File-driven variant
|
|
12
|
+
|
|
13
|
+
With fixture `evals/files/tax_inputs.csv`:
|
|
14
|
+
|
|
15
|
+
> From the attached tax inputs (evals/files/tax_inputs.csv), calculate the after-tax future value of $10,000 invested in a taxable account vs. a Roth IRA over 25 years at 7% gross return. Quantify the tax drag in dollar terms.
|
|
16
|
+
|
|
17
|
+
Expected: Roth IRA FV $54,274 (no tax drag); Taxable FV $42,415 (15% tax on gains applied annually); tax drag cost $11,859 over 25 years; Roth advantage: 21.8% more wealth.
|
|
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,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tax-efficient-investing
|
|
3
|
+
description: When the user wants to invest in a tax-efficient way, maximise contributions to tax-advantaged accounts, understand the tax drag on investment returns, compare traditional vs. Roth accounts, or determine the optimal account to hold specific asset classes. Also use when the user mentions "401k vs Roth," "ISA allowance," "tax on investments," "asset location," "tax-loss harvesting," or "after-tax returns."
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Tax-Efficient Investing
|
|
9
|
+
|
|
10
|
+
You are a Tax-Aware Investment Advisor. Your goal is to help the user legally minimise their tax burden on investments so more of their wealth compounds over time.
|
|
11
|
+
|
|
12
|
+
## Initial Assessment
|
|
13
|
+
|
|
14
|
+
1. **Tax Situation**
|
|
15
|
+
- Current marginal income tax rate and capital gains tax rate.
|
|
16
|
+
- Country/jurisdiction (US 401k/IRA/Roth, UK ISA/SIPP, other).
|
|
17
|
+
- Filing status (single, married filing jointly, etc.).
|
|
18
|
+
|
|
19
|
+
2. **Account Inventory**
|
|
20
|
+
- Existing tax-advantaged accounts and current balances.
|
|
21
|
+
- Annual contribution room remaining.
|
|
22
|
+
- Taxable brokerage accounts and unrealised gains/losses.
|
|
23
|
+
|
|
24
|
+
3. **Investment Goals**
|
|
25
|
+
- Time horizon and target asset allocation.
|
|
26
|
+
- Expected investment return and income needs.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Tax-Efficiency Framework
|
|
31
|
+
|
|
32
|
+
### Priority Order (US context — adapt for other jurisdictions)
|
|
33
|
+
1. **Employer match** — contribute enough to the 401(k) to capture the full match (100% instant return).
|
|
34
|
+
2. **HSA** (if eligible) — triple tax advantage: deductible contributions, tax-free growth, tax-free withdrawals for medical.
|
|
35
|
+
3. **Max Roth IRA** — tax-free growth and withdrawals; best for those expecting higher future tax rates.
|
|
36
|
+
4. **Max 401(k)** — pre-tax contributions reduce current taxable income.
|
|
37
|
+
5. **Taxable brokerage** — use remaining savings here with tax-efficient funds (index funds, ETFs, municipal bonds).
|
|
38
|
+
|
|
39
|
+
### Asset Location Strategy
|
|
40
|
+
Place the least tax-efficient assets in tax-advantaged accounts:
|
|
41
|
+
- **In tax-advantaged**: REITs, bonds, high-dividend stocks, actively managed funds.
|
|
42
|
+
- **In taxable**: broad index funds, ETFs, municipal bonds, long-term buy-and-hold equities.
|
|
43
|
+
|
|
44
|
+
### Tax-Loss Harvesting
|
|
45
|
+
Realise capital losses to offset capital gains, reducing current-year tax liability. Replace with a similar (not substantially identical) fund to maintain exposure.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Technical Concepts
|
|
50
|
+
|
|
51
|
+
### Tax Drag
|
|
52
|
+
The reduction in annual return caused by taxes on dividends, interest, and realised capital gains.
|
|
53
|
+
`After-Tax Return = Gross Return × (1 − Tax Rate on Gains)`
|
|
54
|
+
|
|
55
|
+
### Tax-Equivalent Yield
|
|
56
|
+
Converts a tax-free yield into its taxable equivalent for comparison:
|
|
57
|
+
`Tax-Equivalent Yield = Tax-Free Yield / (1 − Marginal Tax Rate)`
|
|
58
|
+
|
|
59
|
+
### Roth vs. Traditional Break-Even
|
|
60
|
+
Roth is better if future marginal tax rate > current marginal tax rate.
|
|
61
|
+
Traditional is better if future marginal tax rate < current marginal tax rate.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Output Format
|
|
66
|
+
|
|
67
|
+
**Account Priority Plan**
|
|
68
|
+
- Ranked contribution order with dollar amounts for the current tax year.
|
|
69
|
+
- Remaining contribution room per account.
|
|
70
|
+
|
|
71
|
+
**Asset Location Map**
|
|
72
|
+
- Which holdings belong in which account type and why.
|
|
73
|
+
|
|
74
|
+
**Tax Drag Analysis**
|
|
75
|
+
- Estimated annual after-tax return vs. gross return under current structure.
|
|
76
|
+
- Projected 10/20/30-year wealth difference between tax-efficient and tax-inefficient approach.
|
|
77
|
+
|
|
78
|
+
**Action Items**
|
|
79
|
+
- Specific rebalancing or contribution changes to implement.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Scripts
|
|
84
|
+
- [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.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## References
|
|
89
|
+
- [Account Types Guide](./references/account-types.md): Overview of US and international tax-advantaged account types, limits, and rules.
|
|
90
|
+
- [Asset Location Research](./references/asset-location.md): Evidence on the value of asset location and tax-loss harvesting strategies.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Related Skills
|
|
95
|
+
- **retirement-planning**: Retirement accounts are the primary tax-efficient vehicle — coordinate contribution strategy.
|
|
96
|
+
- **tax-planning**: Coordinate investment tax strategy with broader income tax planning.
|
|
97
|
+
- **investment-analysis**: Evaluate the after-tax return of specific investment options.
|
package/selected-skills/financeskills/skills/tax-efficient-investing/references/account-types.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Account Types Guide
|
|
2
|
+
|
|
3
|
+
## United States
|
|
4
|
+
|
|
5
|
+
### Tax-Deferred Accounts (Pay tax on withdrawal)
|
|
6
|
+
| Account | Who | 2024 Limit | Key Rule |
|
|
7
|
+
|---|---|---|---|
|
|
8
|
+
| Traditional 401(k) | Employees | $23,000 (+$7,500 catch-up) | RMDs at age 73 |
|
|
9
|
+
| Traditional IRA | Anyone with earned income | $7,000 (+$1,000 catch-up) | Deductibility phases out with 401k |
|
|
10
|
+
| SEP-IRA | Self-employed | 25% of comp, max $69,000 | No catch-up |
|
|
11
|
+
| SIMPLE IRA | Small business | $16,000 (+$3,500 catch-up) | 2-year vesting rule |
|
|
12
|
+
|
|
13
|
+
### Tax-Free Accounts (Pay tax now, withdraw tax-free)
|
|
14
|
+
| Account | Who | 2024 Limit | Key Rule |
|
|
15
|
+
|---|---|---|---|
|
|
16
|
+
| Roth 401(k) | Employees | Same as 401(k) | No RMDs |
|
|
17
|
+
| Roth IRA | Income limit applies | $7,000 (+$1,000 catch-up) | Phases out at $146k–$161k (single) |
|
|
18
|
+
| HSA | HDHP enrollees | $4,150 individual / $8,300 family | Triple tax advantage |
|
|
19
|
+
|
|
20
|
+
### Taxable Brokerage
|
|
21
|
+
No contribution limits. Gains taxed at capital gains rates (0%, 15%, or 20% federal depending on income). Qualified dividends also receive preferential rates.
|
|
22
|
+
|
|
23
|
+
## United Kingdom
|
|
24
|
+
| Account | Annual Allowance | Tax Treatment |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| ISA | £20,000 | Tax-free growth and withdrawals |
|
|
27
|
+
| SIPP | £60,000 (annual allowance) | Tax-relieved contributions, taxed on withdrawal |
|
|
28
|
+
| Lifetime ISA | £4,000 (25% bonus) | First home or retirement only |
|
|
29
|
+
|
|
30
|
+
## General Principles (All Jurisdictions)
|
|
31
|
+
1. Maximise employer-matched accounts first (free money).
|
|
32
|
+
2. Prefer tax-free over tax-deferred if future tax rate expected to rise.
|
|
33
|
+
3. Use taxable accounts last, with the most tax-efficient instruments (index ETFs, munis).
|
package/selected-skills/financeskills/skills/tax-efficient-investing/references/asset-location.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Asset Location Research
|
|
2
|
+
|
|
3
|
+
Asset location is the strategy of placing investments in the account type that minimises their tax cost.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
Different assets generate different types of taxable events:
|
|
7
|
+
- **Interest income** (bonds, CDs): taxed as ordinary income — highest rate.
|
|
8
|
+
- **Dividends**: qualified dividends taxed at capital gains rates; non-qualified at ordinary rates.
|
|
9
|
+
- **Capital gains**: long-term gains taxed at preferential rates (0/15/20%); short-term at ordinary rates.
|
|
10
|
+
- **REIT distributions**: mostly ordinary income — high tax cost.
|
|
11
|
+
|
|
12
|
+
## Optimal Asset Location
|
|
13
|
+
|
|
14
|
+
| Asset Class | Best Account | Reason |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| Bonds / Fixed income | Tax-advantaged (traditional) | Interest taxed as ordinary income |
|
|
17
|
+
| REITs | Tax-advantaged | High ordinary income distributions |
|
|
18
|
+
| High-dividend stocks | Tax-advantaged | Avoids annual dividend tax |
|
|
19
|
+
| Actively managed funds | Tax-advantaged | High turnover generates short-term gains |
|
|
20
|
+
| Broad index funds / ETFs | Taxable | Low turnover, qualified dividends, tax-loss harvesting |
|
|
21
|
+
| Municipal bonds | Taxable | Already tax-exempt; wasted in tax-advantaged |
|
|
22
|
+
| International stocks | Taxable | Foreign tax credit only available in taxable accounts |
|
|
23
|
+
|
|
24
|
+
## Tax-Loss Harvesting
|
|
25
|
+
Selling a position at a loss to realise the loss for tax purposes, then immediately buying a similar (but not "substantially identical") fund to maintain market exposure.
|
|
26
|
+
|
|
27
|
+
**Annual value**: Studies estimate 0.5–1.5% of portfolio value per year in tax alpha for taxable accounts with sufficient volatility and size (Vanguard, 2015).
|
|
28
|
+
|
|
29
|
+
**Wash-sale rule (US)**: Cannot repurchase the same or substantially identical security within 30 days before or after the sale.
|
|
30
|
+
|
|
31
|
+
## Quantified Value of Asset Location
|
|
32
|
+
Vanguard research (Jaconetti et al., 2018) estimates optimal asset location adds 0–0.75% per year in after-tax returns, depending on tax bracket and asset mix. The benefit is greatest for investors in high tax brackets with significant bond allocations.
|
|
33
|
+
|
|
34
|
+
## Sources
|
|
35
|
+
- Jaconetti, C., Kinniry, F., & Schlanger, T. (2018). *Vanguard's Principles for Investing Success*.
|
|
36
|
+
- Kitces, M. (2015). *The Asset Location Decision for Optimal After-Tax Returns*. Kitces.com.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Worked Example - tax-planning
|
|
2
|
+
|
|
3
|
+
## Ask
|
|
4
|
+
|
|
5
|
+
> I'm a freelancer making $150k/year. I'm currently a sole proprietor. Am I paying too much in tax?
|
|
6
|
+
|
|
7
|
+
## What a correct response contains
|
|
8
|
+
|
|
9
|
+
Should identify the potential benefit of an S-Corp election (to save on self-employment tax). Should discuss common deductions for freelancers. Should emphasize that AI cannot file taxes and a CPA review is required. Should provide a Tax Strategy Report structure with an action plan.
|
|
10
|
+
|
|
11
|
+
## File-driven variant
|
|
12
|
+
|
|
13
|
+
With fixture(s) `evals/files/income_and_brackets.csv`:
|
|
14
|
+
|
|
15
|
+
> Using the attached bracket schedule and income (evals/files/income_and_brackets.csv): compute total tax, effective rate, and marginal rate. Then quantify the PV benefit of deferring $100,000 of that tax by 3 years at a 10% discount rate.
|
|
16
|
+
|
|
17
|
+
Expected: Tax $308,000; effective 15.4%; marginal 21%; deferral PV benefit $24,869.
|
|
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,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tax-planning
|
|
3
|
+
description: When the user wants to optimize tax liability or ensure tax compliance. Also use when the user mentions "tax strategy," "lowering taxes," "tax credits," "deductions," "filing prep," "corporate tax," "VAT audit," or "capital gains planning." Use this for both individual and corporate tax.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Tax Planning
|
|
9
|
+
|
|
10
|
+
You are a Tax Strategist. Your goal is to maximize after-tax wealth by leveraging legal tax credits, deductions, and structural optimizations while ensuring full compliance.
|
|
11
|
+
|
|
12
|
+
## Initial Assessment
|
|
13
|
+
|
|
14
|
+
1. **Tax Jurisdiction**
|
|
15
|
+
- Which country and local region?
|
|
16
|
+
- Is there a tax treaty involved (for international entities)?
|
|
17
|
+
|
|
18
|
+
2. **Entity Type**
|
|
19
|
+
- Individual, Sole Proprietorship, LLC, S-Corp, or C-Corp?
|
|
20
|
+
- What is the estimated annual income?
|
|
21
|
+
|
|
22
|
+
3. **Existing Documentation**
|
|
23
|
+
- Previous year's tax returns.
|
|
24
|
+
- Current year's income/expense logs.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Tax Optimization Framework
|
|
29
|
+
|
|
30
|
+
### Compliance Limitation
|
|
31
|
+
|
|
32
|
+
**AI cannot file tax returns.**
|
|
33
|
+
This skill is for strategy and automation of calculations. All final tax filings must be prepared or reviewed by a qualified CPA or tax attorney.
|
|
34
|
+
|
|
35
|
+
### Priority Order
|
|
36
|
+
1. **Compliance Verification** (Ensuring all basic filings are up to date).
|
|
37
|
+
2. **Deduction Identification** (Expensing all eligible business costs).
|
|
38
|
+
3. **Credit Analysis** (Finding dollar-for-dollar tax reductions like R&D credits).
|
|
39
|
+
4. **Structural Optimization** (Is the entity type the most tax-efficient?).
|
|
40
|
+
5. **Deferral Strategies** (Timing income and expenses to lower current liability).
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Technical Tax Steps
|
|
45
|
+
|
|
46
|
+
### 1. Categorization Audit
|
|
47
|
+
- Review expense logs to ensure all deductible items are captured (Travel, Meals, Equipment).
|
|
48
|
+
- Identify Section 179 depreciation opportunities for capital assets.
|
|
49
|
+
|
|
50
|
+
### 2. Credit Screening
|
|
51
|
+
- Screen for industry-specific credits (Energy, R&D, Opportunity Zones).
|
|
52
|
+
|
|
53
|
+
### 3. Deferral Modeling
|
|
54
|
+
- Compare the impact of contributing to deferred tax accounts (401k, SEP IRA) vs. taxable accounts.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Output Format
|
|
59
|
+
|
|
60
|
+
### Tax Strategy Report Structure
|
|
61
|
+
|
|
62
|
+
**Executive Summary**
|
|
63
|
+
- Estimated Baseline Liability.
|
|
64
|
+
- Potential Optimized Liability.
|
|
65
|
+
- Total Estimated Savings.
|
|
66
|
+
|
|
67
|
+
**Strategy Details**
|
|
68
|
+
- **Deductions**: List of additional eligible expenses found.
|
|
69
|
+
- **Credits**: Specific tax credits for which the entity qualifies.
|
|
70
|
+
- **Structural**: Recommendations for entity type or income timing changes.
|
|
71
|
+
|
|
72
|
+
**Action Plan**
|
|
73
|
+
1. Immediate record-keeping improvements.
|
|
74
|
+
2. Timing-specific actions (e.g., "Purchase equipment before Dec 31").
|
|
75
|
+
3. Items for CPA review.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Scripts
|
|
80
|
+
- [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.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## References
|
|
85
|
+
- [IRS / Local Tax Codes](./references/tax-code-lookup.md): Direct links to source regulations.
|
|
86
|
+
- [Deduction Cheat Sheet](./references/common-deductions.md): List of standard eligible expenses.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Related Skills
|
|
91
|
+
- **financial-analysis**: To audit the income data used for tax planning.
|
|
92
|
+
- **budget-forecast**: To project future tax liabilities.
|
|
93
|
+
- **audit-checklist**: To ensure tax-related internal controls are sound.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Common Deductions: Business Expense Guide
|
|
2
|
+
|
|
3
|
+
A checklist of standard eligible expenses that can lower a business's taxable income.
|
|
4
|
+
|
|
5
|
+
## 🏛️ Standard Categories
|
|
6
|
+
|
|
7
|
+
### 1. Operations
|
|
8
|
+
- **Rent/Lease**: Office space or equipment rentals.
|
|
9
|
+
- **Utilities**: Electricity, water, internet, and phone.
|
|
10
|
+
- **Supplies**: Office consumables, software subscriptions (SaaS).
|
|
11
|
+
|
|
12
|
+
### 2. Marketing & Travel
|
|
13
|
+
- **Advertising**: Online ads, agency fees, print materials.
|
|
14
|
+
- **Travel**: 100% of transport; percentage of meals (varies by year/jurisdiction).
|
|
15
|
+
|
|
16
|
+
### 3. Personnel
|
|
17
|
+
- **Salaries**: W-2 wages and employer-side payroll taxes.
|
|
18
|
+
- **Benefits**: Health insurance premiums, retirement contributions.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 🔍 Special Deductions
|
|
23
|
+
- **Section 179 (US)**: Immediate expensing of the full purchase price of qualifying equipment.
|
|
24
|
+
- **R&D Credits**: Dollar-for-dollar tax reductions for innovative activities.
|
|
25
|
+
|
|
26
|
+
## 🔗 Sources
|
|
27
|
+
- [IRS: Deducting Business Expenses](https://www.irs.gov/businesses/small-businesses-self-employed/deducting-business-expenses)
|
|
28
|
+
- [HMRC: Expenses if you're self-employed](https://www.gov.uk/expenses-if-youre-self-employed)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tax Code Lookup: Global Sources
|
|
2
|
+
|
|
3
|
+
Directories and portals for accessing the most up-to-date tax laws and regulations.
|
|
4
|
+
|
|
5
|
+
## 🏛️ Major Portals
|
|
6
|
+
|
|
7
|
+
### United States
|
|
8
|
+
- **IRS (Internal Revenue Service)**: [Official Website](https://www.irs.gov/). Use the "Search" function for specific Publication numbers (e.g., Pub 535 for Business Expenses).
|
|
9
|
+
|
|
10
|
+
### South Africa
|
|
11
|
+
- **SARS (South African Revenue Service)**: [Official Website](https://www.sars.gov.za/). Key link: [Legal Counsel / Primary Legislation](https://www.sars.gov.za/legal-counsel/primary-legislation/).
|
|
12
|
+
|
|
13
|
+
### United Kingdom
|
|
14
|
+
- **HMRC (HM Revenue & Customs)**: [Official Manuals](https://www.gov.uk/government/organisations/hm-revenue-customs/about/publications).
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 🔍 Best Practices for Searching
|
|
19
|
+
1. **Check the Year**: Tax laws change annually. Ensure you are looking at the code for the correct filing year.
|
|
20
|
+
2. **Verify Status**: Ensure a regulation is "In Effect" and hasn't been repealed or superseded.
|
|
21
|
+
3. **Jurisdiction Check**: Confirm if state/provincial laws override or supplement federal laws.
|
|
22
|
+
|
|
23
|
+
## 🔗 Sources
|
|
24
|
+
- [OECD: Tax Database](https://www.oecd.org/tax/tax-policy/tax-database/)
|
|
25
|
+
- [IBFD: International Bureau of Fiscal Documentation](https://www.ibfd.org/)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Worked Example - three-statement-modeling
|
|
2
|
+
|
|
3
|
+
## Ask
|
|
4
|
+
|
|
5
|
+
> Build a simple 3-year integrated model: revenue 1,000 growing 10%, EBITDA margin 25%, D&A 50/yr (capex 60/yr), tax 30%, DSO 45, DPO 30, DIO 0, opening cash 100, no debt, no dividends. Show the three statements and prove the balance sheet balances.
|
|
6
|
+
|
|
7
|
+
## What a correct response contains
|
|
8
|
+
|
|
9
|
+
A coded model producing IS (NI year 1 = (250-50)x0.7 = 140), WC schedule from days, CFS deriving cash, BS with explicit balance check = 0 all years.
|
|
10
|
+
|
|
11
|
+
## File-driven variant
|
|
12
|
+
|
|
13
|
+
With fixture(s) `evals/files/model_inputs.xlsx`:
|
|
14
|
+
|
|
15
|
+
> Project one year of the linked three-statement model from the attached workbook (evals/files/model_inputs.xlsx): income statement down to net income, cash rollforward, PP&E rollforward, and PROVE the balance sheet balances (assets = liabilities + equity).
|
|
16
|
+
|
|
17
|
+
Expected: Revenue 110.0; net income 13.16; closing cash 26.80; PP&E 81.10; equity 67.90; balance check passes.
|
|
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,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: three-statement-modeling
|
|
3
|
+
description: When the user wants to build an integrated financial model linking income statement, balance sheet, and cash flow. Also use when the user mentions "3-statement model," "integrated model," "balance sheet doesn't balance," "circular reference," "revolver plug," "model drivers," or "financial projections."
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Three-Statement Modeling
|
|
9
|
+
|
|
10
|
+
You are a Financial Modeler. Your goal is to build (or debug) an integrated model where the three statements link correctly, the balance sheet balances by construction, and every output traces to a labeled driver.
|
|
11
|
+
|
|
12
|
+
## Initial Assessment
|
|
13
|
+
|
|
14
|
+
1. **Purpose & Horizon**
|
|
15
|
+
- Budgeting, valuation feed (company-valuation), debt capacity (credit-analysis), or scenario planning — purpose sets granularity.
|
|
16
|
+
- Monthly (operational, ≤ 24 months) vs. annual (strategic, 5+ years).
|
|
17
|
+
|
|
18
|
+
2. **Starting Point**
|
|
19
|
+
- Historical statements (≥ 3 years) for ratio calibration; opening balance sheet that actually balances.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Modeling Framework
|
|
24
|
+
|
|
25
|
+
### Build Order (always)
|
|
26
|
+
1. **Drivers & assumptions sheet** — every assumption in ONE place, labeled, with historical context alongside.
|
|
27
|
+
2. **Income statement**: revenue build (price × volume / cohort / segment — never "grow 10%" without basis) → costs (variable as % of revenue, fixed as schedules, stepped where real) → EBITDA → D&A from the asset schedule → interest from the debt schedule → tax → NI.
|
|
28
|
+
3. **Supporting schedules**: PP&E rollforward (capex, depreciation), working capital (DSO/DIO/DPO days driving AR/inventory/AP), debt schedule (draws, amortization, interest), equity rollforward (NI, dividends, issues).
|
|
29
|
+
4. **Balance sheet**: every line driven by a schedule — nothing hardcoded.
|
|
30
|
+
5. **Cash flow statement**: indirect method derived ENTIRELY from IS + BS deltas. Cash from the CFS feeds the BS cash line.
|
|
31
|
+
|
|
32
|
+
### The Linkages That Make It "Integrated"
|
|
33
|
+
- NI → retained earnings AND CFS top line.
|
|
34
|
+
- D&A: IS expense ↔ PP&E schedule ↔ CFS addback.
|
|
35
|
+
- ΔWC: BS deltas → CFS operating section.
|
|
36
|
+
- Capex: CFS investing ↔ PP&E schedule.
|
|
37
|
+
- Debt draws/repayments: CFS financing ↔ debt schedule ↔ interest on IS.
|
|
38
|
+
- Dividends: equity schedule ↔ CFS financing.
|
|
39
|
+
|
|
40
|
+
### The Revolver Plug (cash sweep logic)
|
|
41
|
+
`If cash before revolver < minimum cash → draw the shortfall; if excess cash and revolver balance > 0 → repay.` This makes the BS balance by construction and creates the interest↔cash circularity: resolve with opening-balance interest convention (preferred — stable, auditable) or iterative calculation (document it).
|
|
42
|
+
|
|
43
|
+
### Balance Check Discipline
|
|
44
|
+
`Assets − Liabilities − Equity = 0` displayed on every period, every sheet, conditionally flagged. A model without a visible balance check is untrustworthy by default.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Technical Analysis Steps
|
|
49
|
+
|
|
50
|
+
1. **Build in the fixed order** (one driver block, then statements, then checks): drivers → statements → checks, with the balance check shown for every period. Nothing here assumes a shell or a spreadsheet engine — write the linkage out, and hand a model long enough to need real compute to the delegated `data_junior`.
|
|
51
|
+
2. **Calibrate**: projected ratios (margins, days, capex/revenue) vs. 3-year history — every divergence from history needs a stated reason.
|
|
52
|
+
3. **Stress the plumbing**: zero out revenue growth, spike capex — does the revolver respond, does the BS still balance, does interest update?
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Output Format
|
|
57
|
+
|
|
58
|
+
### Model Package
|
|
59
|
+
|
|
60
|
+
**Assumptions Summary**: driver table with historical vs. projected.
|
|
61
|
+
|
|
62
|
+
**Statements**: IS, BS, CFS with balance check row.
|
|
63
|
+
|
|
64
|
+
**Schedules**: PP&E, WC, debt, equity rollforwards.
|
|
65
|
+
|
|
66
|
+
**Diagnostics**: balance check status, revolver utilization, key ratio trajectory, circularity convention stated.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Scripts
|
|
71
|
+
- [calculate.py](./scripts/calculate.py): Deterministic functions for this skill's core computations, kept as reviewable material. This plugin's research role has no shell and the scripts are not part of the installed package, so nothing here runs them: build the linkage line by line from the checks in [Model Integrity Checklist](./references/model-checks.md), show the arithmetic in the answer, and hand anything that needs real compute to the delegated `data_junior`.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## References
|
|
76
|
+
- [Model Integrity Checklist](./references/model-checks.md): The full debugging sequence for a model that doesn't balance.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Related Skills
|
|
81
|
+
- **company-valuation**: The DCF consumes this model's FCF.
|
|
82
|
+
- **budget-forecast**: Driver logic for the projections.
|
|
83
|
+
- **credit-analysis**: Covenant and DSCR outputs from the debt schedule.
|
|
84
|
+
- **working-capital-analysis**: The days assumptions driving the WC schedule.
|
package/selected-skills/financeskills/skills/three-statement-modeling/references/model-checks.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Model Integrity Checklist
|
|
2
|
+
|
|
3
|
+
## When the Balance Sheet Doesn't Balance — Debug Sequence
|
|
4
|
+
Work in this order; stop when the imbalance first appears.
|
|
5
|
+
1. **Find the first broken period.** The error is THERE, not where it's biggest (imbalances compound).
|
|
6
|
+
2. **Opening balance sheet**: does period 0 balance? If not, nothing downstream can.
|
|
7
|
+
3. **Retained earnings**: RE_close = RE_open + NI − dividends. The #1 culprit — check NI links to the right period and dividends aren't double-counted.
|
|
8
|
+
4. **Cash**: BS cash must equal CFS ending cash. If CFS is "correct" but BS differs, a BS line moved without a CFS counterpart.
|
|
9
|
+
5. **Delta audit**: for every BS line, ΔBS must appear somewhere in the CFS (or be a documented non-cash move). Build a delta-vs-CFS mapping table — this finds the missing item mechanically.
|
|
10
|
+
6. **Non-cash traps**: PIK interest (IS expense, no cash, adds to debt), unrealized FX on monetary items, asset writeoffs/impairments, capitalized interest, leases commencing (ROU + liability appear with no cash), revaluations (OCI, not CFS).
|
|
11
|
+
7. **Sign conventions**: the eternal ΔWC sign error — AR increase CONSUMES cash (negative in CFS).
|
|
12
|
+
|
|
13
|
+
## Circularity Management
|
|
14
|
+
Interest → cash → revolver → interest. Options:
|
|
15
|
+
- **Opening balance convention**: interest on opening debt/cash balances. Slight inaccuracy, total stability. Recommended default.
|
|
16
|
+
- **Average balance + iteration**: more precise; in Excel requires iterative calc (risk: silent convergence failures); in Python, loop until |Δinterest| < tolerance.
|
|
17
|
+
- Never mix conventions across tranches.
|
|
18
|
+
|
|
19
|
+
## Hardcode Hygiene
|
|
20
|
+
- Inputs only on the assumptions sheet.
|
|
21
|
+
- No constants inside formulas.
|
|
22
|
+
- Color convention if spreadsheet-based.
|
|
23
|
+
- One driver block: every statement derives from it, nothing re-typed per schedule.
|
|
24
|
+
|
|
25
|
+
## Pre-Delivery Test Battery
|
|
26
|
+
1. Balance check = 0 every period.
|
|
27
|
+
2. CFS ending cash = BS cash every period.
|
|
28
|
+
3. Zero-growth test: flat revenue → margins should stay flat; if they drift, a cost is mislinked.
|
|
29
|
+
4. Revolver test: force a cash shortfall → revolver draws; force surplus → repays to zero before cash builds.
|
|
30
|
+
5. Depreciation exhaustion: assets never depreciate below zero/residual.
|
|
31
|
+
6. Ratio reasonableness vs. history: margins, days, capex/revenue, leverage.
|
|
32
|
+
7. Stress symmetry: +10% and −10% revenue should produce roughly mirrored (not wildly asymmetric) outcomes unless steps/breakpoints explain it.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Worked Example - treasury-management
|
|
2
|
+
|
|
3
|
+
## Ask
|
|
4
|
+
|
|
5
|
+
> We have $5M in cash but $2M is in Euros and the Euro is dropping. We also have a $1M payroll next week. What should we do?
|
|
6
|
+
|
|
7
|
+
## What a correct response contains
|
|
8
|
+
|
|
9
|
+
Should identify the immediate liquidity need (payroll) and the FX risk (Euro dropping). Should suggest a cash positioning review and potential FX hedging or conversion. Should provide a structured Treasury Report with a cash flow forecast and risk management recommendations.
|
|
10
|
+
|
|
11
|
+
## File-driven variant
|
|
12
|
+
|
|
13
|
+
With fixture(s) `evals/files/treasury_position.csv`:
|
|
14
|
+
|
|
15
|
+
> From the attached treasury position (evals/files/treasury_position.csv): compute liquidity runway in days, the 6-month NGN/USD forward rate under covered interest parity, and the NGN cost of hedging the $1,000,000 payable forward versus at spot.
|
|
16
|
+
|
|
17
|
+
Expected: Runway 80 days; 6m forward 1,624.39 NGN/USD; hedged cost NGN 1,624,390,244 vs spot 1,500,000,000 - forward premium 8.3%.
|
|
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.
|