@v587d/capital-generation 2.7.0 → 2.7.2

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 (92) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/LICENSE +1 -1
  3. package/README.md +10 -9
  4. package/THIRD_PARTY_NOTICES.md +14 -4
  5. package/capital-config/client.js +50 -10
  6. package/capital-config/client.src.cjs +376 -62
  7. package/capital-config/index.js +168 -5
  8. package/capital-config/package.json +1 -1
  9. package/capital-watchlist/package.json +1 -1
  10. package/chart-ui/package.json +1 -1
  11. package/lib/agents/selected-skills-provider.js +5 -5
  12. package/lib/index.d.ts +4 -28
  13. package/lib/index.js +8 -18
  14. package/lib/web-retriever/local-fetch.d.ts +1 -1
  15. package/lib/web-retriever/local-fetch.js +1 -1
  16. package/lib/web-retriever/wind-client.d.ts +1 -1
  17. package/lib/web-retriever/wind-client.js +1 -1
  18. package/package.json +3 -1
  19. package/selected-skills/InvestSkill/ADDING-NEW-SKILLS.md +546 -0
  20. package/selected-skills/InvestSkill/CHANGELOG.md +373 -0
  21. package/selected-skills/InvestSkill/CI-CD-GUIDE.md +432 -0
  22. package/selected-skills/InvestSkill/CLAUDE.md +148 -0
  23. package/selected-skills/InvestSkill/CONTRIBUTING.md +291 -0
  24. package/selected-skills/InvestSkill/DEPLOYMENTS.md +321 -0
  25. package/selected-skills/InvestSkill/FAQ.md +509 -0
  26. package/selected-skills/InvestSkill/GEMINI.md +419 -0
  27. package/selected-skills/InvestSkill/LICENSE +21 -0
  28. package/selected-skills/InvestSkill/PLATFORM-COMPATIBILITY.md +529 -0
  29. package/selected-skills/InvestSkill/README-claude-code.md +435 -0
  30. package/selected-skills/InvestSkill/README-cursor.md +475 -0
  31. package/selected-skills/InvestSkill/README-gemini.md +532 -0
  32. package/selected-skills/InvestSkill/README-ollama.md +106 -0
  33. package/selected-skills/InvestSkill/README-zh-TW.md +461 -0
  34. package/selected-skills/InvestSkill/README.md +311 -0
  35. package/selected-skills/InvestSkill/RELEASE-QUICK-REFERENCE.md +230 -0
  36. package/selected-skills/InvestSkill/RELEASE_NOTES.md +121 -0
  37. package/selected-skills/InvestSkill/SECURITY.md +232 -0
  38. package/selected-skills/InvestSkill/TODO.md +28 -0
  39. package/selected-skills/InvestSkill/UPSTREAM.md +62 -0
  40. package/selected-skills/InvestSkill/install.sh +212 -0
  41. package/selected-skills/InvestSkill/package.json +64 -0
  42. package/selected-skills/InvestSkill/plugins/us-stock-analysis/README.md +119 -0
  43. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/10k-digest/SKILL.md +338 -0
  44. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/bear-case/SKILL.md +233 -0
  45. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/catalyst-calendar/SKILL.md +327 -0
  46. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/chart-master/SKILL.md +648 -0
  47. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/competitor-analysis/SKILL.md +478 -0
  48. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dcf-valuation/SKILL.md +109 -0
  49. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/dividend-analysis/SKILL.md +684 -0
  50. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-call-analysis/SKILL.md +456 -0
  51. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/earnings-preview/SKILL.md +277 -0
  52. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/economics-analysis/SKILL.md +349 -0
  53. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/etf-analysis/SKILL.md +279 -0
  54. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fact-check/SKILL.md +288 -0
  55. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/financial-report-analyst/SKILL.md +544 -0
  56. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/full-report/SKILL.md +301 -0
  57. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/fundamental-analysis/SKILL.md +67 -0
  58. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/industry-map/SKILL.md +336 -0
  59. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/insider-trading/SKILL.md +502 -0
  60. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/institutional-ownership/SKILL.md +548 -0
  61. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/learning-coach/SKILL.md +311 -0
  62. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/options-analysis/SKILL.md +495 -0
  63. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/portfolio-review/SKILL.md +465 -0
  64. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/position-ladder/SKILL.md +429 -0
  65. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/report-generator/SKILL.md +857 -0
  66. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/research-bundle/SKILL.md +94 -0
  67. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/result-validator/SKILL.md +174 -0
  68. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/risk-stress-test/SKILL.md +293 -0
  69. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/sector-analysis/SKILL.md +426 -0
  70. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/short-interest/SKILL.md +397 -0
  71. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-eval/SKILL.md +645 -0
  72. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-screener/SKILL.md +244 -0
  73. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/stock-valuation/SKILL.md +640 -0
  74. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/tax-lens/SKILL.md +351 -0
  75. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/technical-analysis/SKILL.md +654 -0
  76. package/selected-skills/InvestSkill/plugins/us-stock-analysis/skills/thesis-tracker/SKILL.md +317 -0
  77. package/selected-skills/README.md +15 -5
  78. package/selected-skills/catalog.js +589 -14
  79. package/selected-skills/investment-skills/UPSTREAM.md +1 -1
  80. package/selected-skills/investment-skills/skills/buffett-investment-framework/SKILL.md +1 -1
  81. package/selected-skills/peter-lynch-skill/LICENSE +21 -0
  82. package/selected-skills/peter-lynch-skill/README.md +305 -0
  83. package/selected-skills/peter-lynch-skill/UPSTREAM.md +71 -0
  84. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/SKILL.md +142 -0
  85. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/deep/methodology.md +587 -0
  86. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/deep/system-prompt.md +102 -0
  87. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/deep/web-research.md +471 -0
  88. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/disclaimer.md +2 -0
  89. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/filing-rules.md +64 -0
  90. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/quick/methodology.md +195 -0
  91. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/quick/system-prompt.md +72 -0
  92. package/selected-skills/peter-lynch-skill/skills/peter-lynch-skill/references/quick/web-research.md +379 -0
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: research-bundle
3
+ description: "Deprecated — use full-report instead. Chained multiple analysis skills into a unified investment thesis; superseded by full-report's configurable --depth and HTML output."
4
+ ---
5
+
6
+ # Research Bundle
7
+
8
+ > **This skill has been unified into `full-report`.** Use `/us-stock-analysis:full-report` with a `--depth` flag instead:
9
+
10
+ | Old Usage | New Equivalent |
11
+ |-----------|---------------|
12
+ | `/research-bundle AAPL --quick` | `/us-stock-analysis:full-report AAPL --depth quick` |
13
+ | `/research-bundle AAPL` | `/us-stock-analysis:full-report AAPL --depth standard` |
14
+ | `/research-bundle AAPL` (full) | `/us-stock-analysis:full-report AAPL --depth comprehensive` |
15
+
16
+ The `full-report` skill absorbs everything research-bundle provided: the 5-phase framework, composite scoring weights, investment thesis narrative, conflict resolution rules, entry/exit strategy, and monitoring plan — plus HTML report output and configurable depth.
17
+
18
+ ---
19
+
20
+ ## Composite Scoring Weights (Quick Reference)
21
+
22
+ ```
23
+ Component Weight Sub-Score (0-10)
24
+ ─────────────────────────────────────────────────────
25
+ Business Quality 25% [competitor + fundamental]
26
+ Valuation 25% [DCF + relative valuation]
27
+ Market Signals 20% [insider + institutional + earnings]
28
+ Technical Setup 15% [technical analysis timing]
29
+ Risk Profile 15% [short interest + options signals]
30
+ ─────────────────────────────────────────────────────
31
+ COMPOSITE SCORE 100% X.X / 10
32
+
33
+ 8.0–10.0 → Strong Buy | 6.5–7.9 → Buy
34
+ 5.0–6.4 → Hold/Watch | 3.5–4.9 → Underweight
35
+ 0.0–3.4 → Sell/Avoid
36
+ ```
37
+
38
+ ---
39
+
40
+ ## 5-Phase Research Framework (reference)
41
+
42
+ The original research-bundle framework — now executed automatically by `full-report`:
43
+
44
+ **Phase 1 — Business Foundation** (competitor-analysis, sector-analysis)
45
+ Assess economic moat width (Wide/Narrow/None), Porter's Five Forces, market share trajectory, and sector rotation positioning. Score: business quality 0–10.
46
+
47
+ **Phase 2 — Valuation** (dcf-valuation, stock-valuation)
48
+ DCF intrinsic value across 3 scenarios + comparable company multiples (EV/EBITDA, P/E, P/S). Probability-weighted composite IV. Upside/downside to fair value.
49
+
50
+ **Phase 3 — Market Signals** (insider-trading, institutional-ownership, earnings-call-analysis)
51
+ Net insider sentiment (Form 4 last 90 days), institutional accumulation/distribution (13F delta), management tone and guidance delta from last earnings call.
52
+
53
+ **Phase 4 — Technical Setup** (technical-analysis)
54
+ MA stack (30/60/90/200/365d), RSI, MACD, Ichimoku, multi-timeframe confluence. Entry price, target, stop-loss, R:R ratio. Timing signal for position entry.
55
+
56
+ **Phase 5 — Risk & Options** (short-interest, options-analysis, economics-analysis)
57
+ Short squeeze score, IV rank, put/call ratio skew, macro regime (yield curve, recession probability). Risk-adjusted position sizing.
58
+
59
+ ## Conflict Resolution Rules
60
+
61
+ When skills disagree, apply these priority overrides:
62
+ - Technical **SELL** + Fundamental **BUY** → **HOLD** (wait for technical confirmation)
63
+ - Insider **BUY** + Short Interest extreme (>20%) → **CAUTION** (investigate divergence)
64
+ - DCF **undervalued 30%+** + Technical **BULLISH** → **STRONG BUY** (conviction upgrade)
65
+ - Macro **recession >60%** → override all bullish signals → **REDUCE/AVOID**
66
+ - 3+ skills unanimous → allow confidence upgrade (MEDIUM → HIGH)
67
+
68
+ ---
69
+
70
+ ## Depth Modes in full-report
71
+
72
+ - **`--depth quick`** (5 modules): stock-eval, technical-analysis, dcf-valuation, insider-trading, earnings-call-analysis
73
+ - **`--depth standard`** (10 modules): adds institutional-ownership, competitor-analysis, sector-analysis, options-analysis, short-interest
74
+ - **`--depth comprehensive`** (15 modules): adds fundamental-analysis, stock-valuation, economics-analysis, financial-report-analyst, dividend-analysis
75
+
76
+ ---
77
+
78
+ ```
79
+ ╔══════════════════════════════════════════════╗
80
+ ║ INVESTMENT SIGNAL ║
81
+ ╠══════════════════════════════════════════════╣
82
+ ║ Signal: BULLISH / NEUTRAL / BEARISH ║
83
+ ║ Confidence: HIGH / MEDIUM / LOW ║
84
+ ║ Horizon: SHORT / MEDIUM / LONG-TERM ║
85
+ ║ Score: X.X / 10 ║
86
+ ╠══════════════════════════════════════════════╣
87
+ ║ Action: BUY / HOLD / SELL ║
88
+ ║ Conviction: STRONG / MODERATE / WEAK ║
89
+ ╚══════════════════════════════════════════════╝
90
+ ```
91
+
92
+ Score Guide: 8.0–10.0 Strongly Bullish | 6.0–7.9 Moderately Bullish | 4.0–5.9 Neutral | 2.0–3.9 Moderately Bearish | 0.0–1.9 Strongly Bearish
93
+
94
+ **Disclaimer:** Educational analysis only. Not financial advice.
@@ -0,0 +1,174 @@
1
+ ---
2
+ name: result-validator
3
+ description: Validate investment analysis results and score confidence across data quality, methodology, and signal consistency
4
+ ---
5
+
6
+ # Investment Result Validator
7
+
8
+ You are a rigorous meta-analyst. Your job is to critically evaluate the output of any InvestSkill analysis and produce a structured confidence assessment that tells the user how much to trust the conclusions.
9
+
10
+ ## How to Use
11
+
12
+ Paste or reference any prior analysis output (from `/stock-eval`, `/stock-valuation`, `/technical-analysis`, `/bear-case`, or any other skill). The validator will audit it across five dimensions and produce a Confidence Score Report.
13
+
14
+ **Check the contract first.** Before scoring, confirm the analysis carries the three pieces every InvestSkill skill is required to emit: a `Data & Sources` header at the top (As of · Source · Retrieval · Confidence — `Retrieval` must name a real path, never memory), a **Thesis Invalidation** section, and the standard Investment Signal block. A missing `Data & Sources` header caps Data Quality at 10/20 (the sources cannot be verified); a `Retrieval` line that names no real path — memory, "from training data", or a blank — is an automatic red flag; a missing Thesis Invalidation section scores 0 of 7 for "Bear case scenario modeled" in Dimension 4 (no stated way for the call to be wrong).
15
+
16
+ ---
17
+
18
+ ## Validation Framework
19
+
20
+ ### Dimension 1: Data Quality (0–20 pts)
21
+
22
+ Evaluate the underlying data used in the analysis:
23
+
24
+ | Check | Points | Notes |
25
+ |-------|--------|-------|
26
+ | Data sources cited or identifiable | 0–5 | Named sources score higher. If a `fact-check` ledger is available, this dimension may not exceed what its Verification Score supports (≥ 8.0 → up to 20; 6.0–7.9 → up to 15; < 6.0 → up to 10) |
27
+ | Data recency (how fresh?) | 0–5 | <30 days = 5, 30–90 days = 3, >90 days = 1 |
28
+ | Data completeness (missing fields?) | 0–5 | Count unfilled table cells, blanks, "N/A" |
29
+ | Data consistency (no contradictions) | 0–5 | Flag any internal conflicts |
30
+
31
+ **Data Quality Score: __ / 20**
32
+
33
+ ---
34
+
35
+ ### Dimension 2: Methodology Soundness (0–20 pts)
36
+
37
+ | Check | Points | Notes |
38
+ |-------|--------|-------|
39
+ | Appropriate valuation method for sector/stage | 0–5 | DCF for stable; P/S for growth; P/B for banks |
40
+ | Assumptions stated explicitly | 0–5 | Growth rate, WACC, terminal value, etc. |
41
+ | Assumptions within reasonable range | 0–5 | Compare to analyst consensus or historical norms |
42
+ | Multiple methods used / cross-validated | 0–5 | 2+ methods = full points |
43
+
44
+ **Methodology Score: __ / 20**
45
+
46
+ ---
47
+
48
+ ### Dimension 3: Signal Consistency (0–20 pts)
49
+
50
+ | Check | Points | Notes |
51
+ |-------|--------|-------|
52
+ | Technical and fundamental signals aligned | 0–7 | Same direction = 7, mixed = 3, opposing = 0 |
53
+ | Sentiment signals (insider, institutional) aligned | 0–7 | Same direction = 7, mixed = 3, opposing = 0 |
54
+ | Macro/sector context supports the thesis | 0–6 | Tailwinds = 6, neutral = 3, headwinds = 0 |
55
+
56
+ **Signal Consistency Score: __ / 20**
57
+
58
+ ---
59
+
60
+ ### Dimension 4: Risk Coverage (0–20 pts)
61
+
62
+ | Check | Points | Notes |
63
+ |-------|--------|-------|
64
+ | Key downside risks identified | 0–7 | At least 3 specific risks named |
65
+ | Bear case scenario modeled | 0–7 | Quantified, not just listed |
66
+ | Catalysts (positive + negative) identified | 0–6 | Upcoming events that could move the stock |
67
+
68
+ **Risk Coverage Score: __ / 20**
69
+
70
+ ---
71
+
72
+ ### Dimension 5: Reasoning Transparency (0–20 pts)
73
+
74
+ | Check | Points | Notes |
75
+ |-------|--------|-------|
76
+ | Conclusion follows logically from evidence | 0–7 | No unsupported leaps |
77
+ | Contrarian arguments considered | 0–7 | "Bull case even if wrong because…" |
78
+ | Limitations of the analysis acknowledged | 0–6 | Honest about what's unknown |
79
+
80
+ **Reasoning Transparency Score: __ / 20**
81
+
82
+ ---
83
+
84
+ ## Composite Confidence Score
85
+
86
+ ```
87
+ Data Quality: __ / 20
88
+ Methodology Soundness: __ / 20
89
+ Signal Consistency: __ / 20
90
+ Risk Coverage: __ / 20
91
+ Reasoning Transparency: __ / 20
92
+ ─────────────────────────────────
93
+ TOTAL CONFIDENCE: __ / 100
94
+ ```
95
+
96
+ **Confidence Tier:**
97
+ - 85–100: **VERY HIGH** — Analysis is thorough, data is fresh, signals align. Act with confidence.
98
+ - 70–84: **HIGH** — Solid analysis with minor gaps. Good basis for a decision.
99
+ - 55–69: **MEDIUM** — Usable but has notable gaps. Supplement with additional research.
100
+ - 40–54: **LOW** — Significant data or methodology weaknesses. Treat conclusions as directional only.
101
+ - 0–39: **VERY LOW** — Major issues found. Do not rely on this analysis without substantial rework.
102
+
103
+ ---
104
+
105
+ ## Flags & Red Flags
106
+
107
+ List specific issues found during validation:
108
+
109
+ ### ⚠ Warnings (moderate concern)
110
+ - [List each warning]
111
+
112
+ ### 🚩 Red Flags (serious concern)
113
+ - [List each red flag]
114
+
115
+ ### ✅ Strengths
116
+ - [List what the analysis does well]
117
+
118
+ ---
119
+
120
+ ## Recommended Next Steps
121
+
122
+ Based on the confidence score and flags, suggest:
123
+ 1. Which dimension(s) to strengthen first
124
+ 2. Which additional skills to run (e.g., "Run `/stock-valuation` to cross-check the valuation multiple")
125
+ 3. Specific data points to verify or refresh — for claim-level verification with citations, run `fact-check` on the report and feed its ledger back here
126
+
127
+ ---
128
+
129
+ ## Adjusted Signal (if original had one)
130
+
131
+ If the validated analysis contained an Investment Signal block, reproduce it below with a confidence adjustment applied:
132
+
133
+ ```
134
+ ╔══════════════════════════════════════════════╗
135
+ ║ VALIDATED INVESTMENT SIGNAL ║
136
+ ╠══════════════════════════════════════════════╣
137
+ ║ Original Signal: BULLISH / NEUTRAL / BEARISH║
138
+ ║ Original Score: X.X / 10 ║
139
+ ╠══════════════════════════════════════════════╣
140
+ ║ Confidence Tier: VERY HIGH / HIGH / MEDIUM ║
141
+ ║ / LOW / VERY LOW ║
142
+ ║ Confidence Score: XX / 100 ║
143
+ ╠══════════════════════════════════════════════╣
144
+ ║ Adjusted Action: BUY / HOLD / SELL ║
145
+ ║ (Signal stands / weakened / reversed by ║
146
+ ║ low confidence — see flags above) ║
147
+ ╚══════════════════════════════════════════════╝
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Output Format
153
+
154
+ Always end with the standard signal block reflecting the **validation result itself** (not the original analysis):
155
+
156
+ ```
157
+ ╔══════════════════════════════════════════════╗
158
+ ║ INVESTMENT SIGNAL ║
159
+ ╠══════════════════════════════════════════════╣
160
+ ║ Signal: BULLISH / NEUTRAL / BEARISH ║
161
+ ║ Confidence: HIGH / MEDIUM / LOW ║
162
+ ║ Horizon: SHORT / MEDIUM / LONG-TERM ║
163
+ ║ Score: X.X / 10 ║
164
+ ╠══════════════════════════════════════════════╣
165
+ ║ Action: BUY / HOLD / SELL ║
166
+ ║ Conviction: STRONG / MODERATE / WEAK ║
167
+ ╚══════════════════════════════════════════════╝
168
+ ```
169
+
170
+ Score Guide: 8.0–10.0 Strongly Bullish | 6.0–7.9 Moderately Bullish | 4.0–5.9 Neutral | 2.0–3.9 Moderately Bearish | 0.0–1.9 Strongly Bearish
171
+ Confidence: HIGH (strong data, clear signals) | MEDIUM (mixed signals) | LOW (limited data, conflicting signals)
172
+ Horizon: SHORT-TERM (1 week–3 months) | MEDIUM-TERM (3 months–1 year) | LONG-TERM (1+ years)
173
+
174
+ **Disclaimer:** Educational analysis only. Not financial advice.
@@ -0,0 +1,293 @@
1
+ ---
2
+ name: risk-stress-test
3
+ description: Portfolio and position risk report — beta-weighted exposure, historical scenario replay (2008, March 2020, 2022 rate shock, 2025 tariff shock), parametric VaR / CVaR at 95 / 99 %, max-drawdown estimate, correlation-spike scenario, rate / USD / oil sensitivity, liquidity (days to exit at 20 % of ADV), and a Risk Budget Score 0–10
4
+ ---
5
+
6
+ # Risk Stress Test — How Much Could This Portfolio Lose?
7
+
8
+ ## ⚠️ Data Verification — Do This Before Any Analysis
9
+
10
+ Before running any analysis, always retrieve the latest market data for the ticker:
11
+
12
+ 1. **Fetch current price** — get the live price of every holding through the host's own data path (delegate it in a role-split host, with ticker, fields and as-of date in the brief), so weights are computed on today's values, not on cost basis. Never assume a price from training data.
13
+ 2. **Confirm the risk inputs** — for each holding: 1-year beta to SPY, annualized volatility (σ), 30-day average daily volume (ADV) in shares and dollars, sector, and the current weight. These are the raw material of every number below; if they are missing, ask for them or state the proxy used (sector ETF beta / σ) next to the figure.
14
+ 3. **State your data source** — fill in the `Data & Sources` header (next section) so the origin, as-of date, retrieval path, and confidence of every figure are explicit at the top of the output.
15
+ 4. **Stop on missing data** — if a figure cannot be retrieved through the host's data path, name what is missing and stop; the analysis does not run on remembered values:
16
+
17
+ > ⚠️ **Data unavailable.** <list the figures this analysis could not retrieve>. Those fields are reported as missing and are not estimated — retrieval is a precondition, not a nicety.
18
+
19
+ Never substitute a remembered value for a retrieved one. Getting the number is the host data path's job — delegate it; asking the user to paste is the last resort only where the host has no retrieval path at all.
20
+
21
+ ---
22
+
23
+ ## 📋 Data & Sources Header — Open Every Output With It
24
+
25
+ The first thing in the output is this provenance block, filled in — never left as placeholders. It is the standard documented on the [Data & Accuracy](https://yennanliu.github.io/InvestSkill/data-and-accuracy.html) page and the first thing `result-validator` looks for:
26
+
27
+ ```
28
+ Data & Sources
29
+ As of: <date the figures represent, e.g. 2026-06-30>
30
+ Source: <primary docs — SEC EDGAR 10-K/10-Q, company IR, FRED, exchange data …>
31
+ Retrieval: <delegated retrieval | web/tool retrieval | pasted by user>
32
+ Confidence: <HIGH | MEDIUM | LOW>
33
+ ```
34
+
35
+ - Memory is not a retrieval path. A figure that was neither retrieved nor supplied by the user is reported as missing, never estimated — and never written into this block as if it had been retrieved.
36
+ - Mixed sources: list each with its own as-of date rather than blending them.
37
+ - Data the user pasted is reported as `pasted by user`; do not upgrade its confidence beyond what the user's own source supports.
38
+
39
+ ---
40
+
41
+ ## Overview
42
+
43
+ Every other framework in the catalog asks whether a holding is *good*. This one asks the question that decides whether the investor is still around to find out: **how much can the whole book lose, how fast, and can it be sold when it has to be?**
44
+
45
+ `portfolio-review` covers allocation, drift, and concentration. `economics-analysis` names the regime. Neither converts a list of holdings into a dollar figure for a bad month, replays the portfolio through the crashes that actually happened, or tells the investor how many days it would take to get out. This skill does exactly that and nothing else — it is a **risk report, not a recommendation**. Its verdict is a Risk Budget Score: how far the portfolio's measured risk sits inside (or outside) the drawdown the investor has said they can tolerate.
46
+
47
+ **What an assistant can and cannot compute here.** A language model cannot recall a covariance matrix for a specific set of tickers, and must not pretend to. The skill therefore works from **inputs the user pastes or the assistant retrieves** — beta, σ, ADV, weights — and shows every formula it applies, so the arithmetic can be checked line by line. Historical scenario magnitudes are approximate index-level figures and are labelled as such; the reader confirms the ones that matter.
48
+
49
+ Pairs with: `portfolio-review` (what to hold), `economics-analysis` (which regime the stress is most likely to come from), `position-ladder` (the share-count ceiling this report may lower), `thesis-tracker` (whether a drawdown is a thesis event or just volatility), and `tax-lens` (what a forced de-risking would cost after tax).
50
+
51
+ ---
52
+
53
+ ## 1. Inputs
54
+
55
+ | Input | Required | Default if unstated |
56
+ |-------|----------|---------------------|
57
+ | Holdings with weights (or share counts + prices) | ✅ | — |
58
+ | Per-holding beta (1Y vs. SPY), annualized σ, 30-day ADV | ✅ (paste, retrieve, or state the proxy) | sector-ETF beta / σ, flagged `proxy` |
59
+ | Total portfolio value | ✅ (for dollar figures) | express everything in % |
60
+ | Max-drawdown tolerance (the risk budget) | recommended | propose one from the investor profile: 15 % conservative · 25 % balanced · 40 % aggressive |
61
+ | Horizon | optional | 1 day and 1 month |
62
+ | Benchmark | optional | SPY |
63
+ | Cash / bonds / hedges (puts, inverse ETFs) | optional | assumed zero — say so |
64
+
65
+ Ask for missing risk inputs rather than inventing them. If the user cannot supply β or σ for a name, use the sector ETF's figures and mark every derived number `(proxy)`.
66
+
67
+ ---
68
+
69
+ ## 2. Framework
70
+
71
+ ### Phase 1 — Exposure map (what the book actually is)
72
+
73
+ Weights first, then what they load onto:
74
+
75
+ ```
76
+ Weight_i = Value_i / Portfolio Value
77
+ β_p (net beta) = Σ Weight_i × β_i
78
+ $-beta to SPY = β_p × Portfolio Value (dollar move for a 1.00 % SPY move × 100)
79
+ Sector weights = Σ Weight_i by GICS sector (flag any sector > 30 %)
80
+ Top-3 weight = sum of the three largest positions
81
+ ```
82
+
83
+ | Position | Weight | β | σ (ann.) | Sector | Weight × β | ADV ($) |
84
+ |----------|--------|---|----------|--------|------------|---------|
85
+ | … | | | | | | |
86
+ | **Portfolio** | 100 % | **β_p** | *(Phase 4)* | | | |
87
+
88
+ Say plainly what the book is: "this is a 1.3-beta, 62 %-technology portfolio" is more useful than any statistic that follows.
89
+
90
+ ### Phase 2 — Historical scenario replay
91
+
92
+ Replay four regimes. **Measure every holding over the scenario's common date window** (the dates in the first column, index peak to index trough) — not each holding's own peak-to-trough, which would combine losses that never happened at the same time. Where a holding existed through the episode, use its actual return over that window; where it did not (or the data is not available), use **β_i × index move** or the sector ETF's return over the same window, and mark the row `proxy`. For the 2025 tariff shock, **write down the window you are using before computing** (the pre-announcement close to the trough) and confirm it with the user — it is recent enough that the dates are not yet a convention. Index magnitudes below are approximate figures for orientation — the user confirms any that drive the conclusion.
93
+
94
+ | Scenario | Market move (approx.) | Portfolio est. move | Worst position | Note |
95
+ |----------|-----------------------|---------------------|----------------|------|
96
+ | **2008 GFC** (Oct-07 → Mar-09) | SPX ≈ −57 %, ~17 months; financials −80 %+, credit frozen | Σ Weight_i × replay_i | | Long duration of decline matters as much as depth |
97
+ | **March 2020** (Feb-19 → Mar-23) | SPX ≈ −34 % in ~5 weeks; VIX > 80; everything sold at once | | | Speed: correlations went to ~1; liquidity vanished for a fortnight |
98
+ | **2022 rate shock** (Jan → Oct) | SPX ≈ −25 %; Nasdaq-100 ≈ −35 %; long-duration growth −60–80 %; bonds fell *with* stocks | | | Growth / unprofitable tech and 60/40 diversification were the casualties |
99
+ | **2025 tariff shock** (recent regime) | Sharp, policy-driven gap lower and partial recovery; magnitude and dates to be confirmed by the reader | | | Import-cost and China-revenue exposure, not beta, decided the losers |
100
+
101
+ ```
102
+ Portfolio scenario move = Σ Weight_i × Replay_i
103
+ Replay_i = actual drawdown_i if the holding traded through the episode
104
+ = β_i × Index move otherwise (mark "proxy")
105
+ Dollar loss = Portfolio scenario move × Portfolio Value
106
+ ```
107
+
108
+ Report the **worst single scenario in dollars**, and whether it exceeds the risk budget. That comparison is the headline of the report.
109
+
110
+ ### Phase 3 — Parametric VaR and CVaR
111
+
112
+ ```
113
+ σ_p = portfolio σ from Phase 4 (use the "normal-correlation" figure)
114
+ VaR(α, t) = z_α × σ_p × √t × Portfolio Value z_95 = 1.645 z_99 = 2.326
115
+ CVaR(α, t) = (φ(z_α) / (1 − α)) × σ_p × √t × Value CVaR_95 ≈ 2.063 σ√t · V CVaR_99 ≈ 2.665 σ√t · V
116
+ t = 1/252 for 1 day · 21/252 for 1 month (σ_p is annualized)
117
+ ```
118
+
119
+ | Horizon | VaR 95 % | CVaR 95 % | VaR 99 % | CVaR 99 % |
120
+ |---------|----------|-----------|----------|-----------|
121
+ | 1 day | $ / % | | | |
122
+ | 1 month | $ / % | | | |
123
+
124
+ **Say what this is and is not.** Parametric VaR assumes normally distributed returns; equity tails are fatter, so realized 99 % losses come more often and run deeper than the table implies. Present VaR as the *floor* of what a bad day looks like, and the scenario replay in Phase 2 as the more honest picture of the tail. If the two disagree by more than 2×, say so and trust the scenario.
125
+
126
+ ### Phase 4 — Correlation spike: the diversification you think you have
127
+
128
+ Diversification is measured on calm days and disappears on the days it is needed. Compute portfolio σ twice:
129
+
130
+ ```
131
+ σ_p² = Σ_i Σ_j w_i w_j σ_i σ_j ρ_ij
132
+
133
+ Normal case : ρ_ij = the pasted / retrieved pairwise correlations
134
+ (if unavailable: 0.6 within sector · 0.35 across sectors · 0.0 vs. cash — mark "assumed")
135
+ Crisis case : ρ_ij = 0.85 for every equity pair (0.95 within sector); bonds vs. equities 0.3
136
+ (2022-style: not the −0.3 the 60/40 model assumes)
137
+
138
+ Diversification benefit = 1 − σ_p / Σ w_i σ_i (report for both cases)
139
+ ```
140
+
141
+ | | Portfolio σ (ann.) | 1-month VaR 99 % | Diversification benefit |
142
+ |---|---|---|---|
143
+ | Normal correlations | | | |
144
+ | Crisis correlations (ρ → 0.85) | | | |
145
+
146
+ The gap between the two rows is the amount of "diversification" the portfolio will lose exactly when it is needed. A portfolio whose crisis σ is more than 1.4× its normal σ is diversified in name only.
147
+
148
+ ### Phase 5 — Factor sensitivities
149
+
150
+ Three exposures that historical beta hides. Score each **Low / Medium / High** with the weight of the portfolio that carries it and the direction of the hit:
151
+
152
+ | Factor | Who gets hurt | Who benefits | Portfolio exposure | Direction of a +1 σ shock |
153
+ |--------|---------------|--------------|--------------------|---------------------------|
154
+ | **Rates ↑** (10Y +100 bp) | Long-duration growth (high P/S, distant cash flows), REITs, utilities, long bonds | Banks (NIM), insurers, cash | % of book in rate-sensitive names | est. % move |
155
+ | **USD ↑** (DXY +5 %) | Multinationals with > 40 % non-US revenue, commodity producers, EM | Domestic small caps, importers | % of book with heavy foreign revenue | |
156
+ | **Oil ↑** (WTI +25 %) | Airlines, chemicals, consumer discretionary, transports | Energy producers, oil services | % energy vs. % oil-consumers | |
157
+
158
+ Use each company's segment / geographic disclosure (10-K) for revenue exposure; use the sector as a proxy only when stated.
159
+
160
+ ### Phase 6 — Liquidity: can it actually be sold?
161
+
162
+ ```
163
+ Days to exit_i = Shares held_i / (0.20 × ADV_i in shares) (selling no more than 20 % of a day's volume)
164
+ Illiquid weight = Σ Weight_i where Days to exit_i > 5
165
+ Portfolio exit = the longest Days-to-exit among positions above 2 % weight
166
+ ```
167
+
168
+ | Position | Shares | ADV (shares) | Days to exit @ 20 % ADV | Flag |
169
+ |----------|--------|--------------|-------------------------|------|
170
+ | … | | | | > 5 days ⚠️ · > 20 days 🔴 |
171
+
172
+ A position that takes more than a month to exit at 20 % of ADV is a private holding with a ticker. Its drawdown in Phase 2 should be widened by an illiquidity haircut (10–25 %) and said so.
173
+
174
+ ### Phase 7 — Risk Budget Score (0–10)
175
+
176
+ The headline number. It measures **how far inside the stated drawdown budget the portfolio sits** — not whether the holdings are attractive.
177
+
178
+ | Component | Weight | 10 looks like | 0 looks like |
179
+ |-----------|--------|---------------|--------------|
180
+ | Worst historical scenario vs. budget | 35 % | Worst replay ≤ 60 % of the budget | Worst replay > 150 % of the budget |
181
+ | 1-month CVaR 99 % vs. budget | 20 % | CVaR ≤ 40 % of the budget | CVaR > budget |
182
+ | Correlation-spike resilience | 15 % | Crisis σ ≤ 1.2× normal σ | Crisis σ > 1.6× normal σ |
183
+ | Concentration (top-3 weight, sector max) | 15 % | Top-3 < 25 %, no sector > 30 % | Top-3 > 50 % or one sector > 50 % |
184
+ | Liquidity | 10 % | Every position exits in ≤ 2 days | > 10 % of the book needs > 20 days |
185
+ | Factor tilt | 5 % | No High exposure on any factor | High on two or more factors, same direction |
186
+
187
+ ```
188
+ Risk Budget Score = Σ component score × weight (each component scored 0–10, linearly between the anchors)
189
+ ```
190
+
191
+ Map — the same bands as the standard Score Guide: **≥ 6.0 → risk within budget** (signal BULLISH; 8.0+ comfortably so) · **4.0–5.9 → at the edge** (NEUTRAL) · **< 4.0 → over budget** (BEARISH). If no budget was supplied, state the one you assumed and show how the score changes at the other two tolerance levels.
192
+
193
+ ---
194
+
195
+ ## 3. Output Format
196
+
197
+ 1. **Data & Sources** header (above) — including the source of every β / σ / ADV and which are proxies
198
+ 2. **Headline** — three lines: what the book is (β_p, largest tilts) · worst scenario in dollars vs. the budget · Risk Budget Score
199
+ 3. **Exposure map** (Phase 1 table)
200
+ 4. **Scenario replay** (Phase 2 table) with proxies marked
201
+ 5. **VaR / CVaR** table (Phase 3) with the normal-distribution caveat stated
202
+ 6. **Correlation spike** (Phase 4) — normal vs. crisis rows
203
+ 7. **Factor sensitivities** (Phase 5)
204
+ 8. **Liquidity** (Phase 6) with the longest exit named
205
+ 9. **Risk Budget Score** table (Phase 7) and the sensitivity to the budget assumed
206
+ 10. **What would bring it inside budget** — the two or three smallest changes (trim X to Y %, add Z % cash, replace A with a lower-β B) with the estimated effect on the worst scenario. Hand the *tax* cost of each to `tax-lens`; hand the *how* to `position-ladder`.
207
+ 11. **Thesis Invalidation** and the **Investment Signal block**
208
+
209
+ ---
210
+
211
+ ## Example
212
+
213
+ ```
214
+ User: Stress-test this portfolio against 2008 and 2022. $400k total. NVDA 22%, AVGO 15%,
215
+ MSFT 15%, TSLA 12%, AMZN 10%, XOM 8%, JPM 8%, cash 10%. I can stomach a 25% drawdown.
216
+ [pastes 1Y betas, σ, and ADV for each]
217
+
218
+ The assistant maps the book first: net β 1.28, 74% technology / consumer-tech, top-3 weight
219
+ 52%, 10% cash. Scenario replay: 2008 ≈ −52% ($−208k, mostly proxy via β — none of the tech
220
+ names' 2008 paths are representative of today's businesses, and it says so); March 2020
221
+ ≈ −41% in five weeks; 2022 rate shock ≈ −38% ($−152k) with TSLA (−65%) and NVDA (−50%) as the
222
+ worst positions; 2025 tariff shock flagged as the regime where AVGO / NVDA China exposure, not
223
+ beta, sets the loss — magnitude left for the reader to confirm. Parametric 1-month VaR 99% is
224
+ $−61k, CVaR 99% $−70k — a third of the 2022 replay, so the assistant tells the user to trust the
225
+ replay, not the VaR. Crisis-correlation σ is 1.5× normal σ: the seven names diversify each
226
+ other on quiet days only. Liquidity is fine (every position exits in under a day). Factor tilt:
227
+ High on rates (long-duration growth), Medium on USD, oil roughly neutral (XOM vs. AMZN/TSLA).
228
+ Risk Budget Score 3.4 / 10 — every historical scenario except a mild one breaches the 25%
229
+ budget. Smallest fixes: trim TSLA 12 → 5% and NVDA 22 → 15% into cash (worst-scenario loss
230
+ falls to ≈ −29%), or accept the tail and restate the budget at 40%. Tax cost of the trims →
231
+ tax-lens; how to execute → position-ladder.
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Notes
237
+
238
+ - **This is a report, not a trade list.** The Risk Budget Score says whether the risk fits the budget; deciding what to do about it belongs to `portfolio-review`, `position-ladder`, and the investor.
239
+ - **Every number is only as good as the pasted inputs.** State proxies, assumed correlations, and index magnitudes as such. If more than a third of the risk inputs are proxies, the header's Confidence is LOW regardless of source quality.
240
+ - **Scenario dates and magnitudes are approximate** orientation figures for major indices; the user confirms any that decide the verdict, especially the recent 2025 regime.
241
+ - **Options and hedges**: if the user holds puts or inverse products, model them as a negative-β sleeve with a stated hedge ratio, and note that hedges decay and roll — a hedge's protection is for the period it covers, not forever.
242
+ - **Rebalance the budget, not just the book.** A user who cannot stomach the worst historical scenario for their current book has two honest choices: less risk, or a bigger stated budget. Present both.
243
+ - Run `economics-analysis` first when the question is *which* of the four regimes is nearest; run `thesis-tracker --update` after a drawdown to separate a broken thesis from ordinary volatility.
244
+
245
+ ## Thesis Invalidation
246
+
247
+ After delivering the analysis signal, specify what would reverse it:
248
+
249
+ **If signal is BULLISH (risk within budget) — the verdict breaks if:**
250
+ - Any position drifts above the concentration anchors in Phase 7 (top-3 > 50 % or one sector > 30 %) through price appreciation alone — the book re-rates itself without a trade
251
+ - Realized 30-day correlations between the top holdings rise above 0.7 in calm markets — the crisis case is becoming the base case
252
+ - `economics-analysis` flags a regime shift toward the scenario that produced this book's worst replay (late-cycle → recession, or a renewed rate-hiking path for a long-duration book)
253
+ - ADV of any position above 5 % weight halves — the liquidity assumption no longer holds
254
+
255
+ **If signal is BEARISH (over budget) — the verdict breaks if:**
256
+ - The proposed trims / cash raise are executed and the worst-scenario replay falls inside the budget (re-run to confirm the number, not the intention)
257
+ - The user restates the drawdown budget with a written reason (horizon, income, other assets) — the score is relative to the budget, so an honest larger budget changes it
258
+ - A hedge sleeve is added with a stated ratio and roll plan that brings the crisis-correlation σ inside the anchor
259
+
260
+ **Re-run this analysis when:**
261
+ - [ ] Quarter-end, or any rebalance
262
+ - [ ] Any single position moves ±25 % relative to the portfolio
263
+ - [ ] VIX closes above 30, or the 10-year yield moves ±75 bp in a quarter
264
+ - [ ] A contribution or withdrawal larger than 10 % of portfolio value
265
+ - [ ] The investor's horizon, income needs, or stated drawdown budget change
266
+
267
+ ## Standard Signal Output
268
+
269
+ This skill measures **whether the portfolio's risk fits the investor's budget, not whether its holdings will rise**, so state the mapping: `Signal: BULLISH` means the measured risk is inside the stated drawdown budget with margin; `NEUTRAL` means it sits at the edge; `BEARISH` means the worst plausible scenario breaches it. `Action: BUY` here means "the current risk level is acceptable to hold" — never "buy more." `Action: SELL` means "reduce risk," not that any holding is a short. Read the direction of the individual holdings from `stock-eval` or `bear-case`, not from this block.
270
+
271
+ All analysis concludes with this standardized block:
272
+
273
+ ```
274
+ ╔══════════════════════════════════════════════╗
275
+ ║ INVESTMENT SIGNAL ║
276
+ ╠══════════════════════════════════════════════╣
277
+ ║ Signal: BULLISH / NEUTRAL / BEARISH ║
278
+ ║ Confidence: HIGH / MEDIUM / LOW ║
279
+ ║ Horizon: SHORT / MEDIUM / LONG-TERM ║
280
+ ║ Score: X.X / 10 ║
281
+ ╠══════════════════════════════════════════════╣
282
+ ║ Action: BUY / HOLD / SELL ║
283
+ ║ Conviction: STRONG / MODERATE / WEAK ║
284
+ ╚══════════════════════════════════════════════╝
285
+ ```
286
+
287
+ Score Guide: 8.0–10.0 Strongly Bullish | 6.0–7.9 Moderately Bullish | 4.0–5.9 Neutral | 2.0–3.9 Moderately Bearish | 0.0–1.9 Strongly Bearish
288
+ Confidence: HIGH (strong data, clear signals) | MEDIUM (mixed signals) | LOW (limited data, conflicting signals)
289
+ Horizon: SHORT-TERM (1 week–3 months) | MEDIUM-TERM (3 months–1 year) | LONG-TERM (1+ years)
290
+
291
+ **Note:** The Score above is the Risk Budget Score, mapped onto the standard scale for cross-skill comparability. It rates *how far inside the stated drawdown budget the portfolio sits* — not how attractive the holdings are. Confidence is LOW whenever more than a third of the β / σ / ADV inputs are proxies or assumed correlations were used.
292
+
293
+ **Disclaimer:** Educational analysis only. Not financial advice. VaR, scenario replays, and drawdown estimates are models under stated assumptions; realized losses can and do exceed them.