@nestpilot/mcp-app 1.0.0

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 (149) hide show
  1. package/README.md +350 -0
  2. package/dist/cli/doctor.d.ts +1 -0
  3. package/dist/cli/doctor.js +214 -0
  4. package/dist/cli/export-import.d.ts +6 -0
  5. package/dist/cli/export-import.js +132 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.js +168 -0
  8. package/dist/cli/init.d.ts +1 -0
  9. package/dist/cli/init.js +171 -0
  10. package/dist/host-configs/cowork.json +11 -0
  11. package/dist/host-configs/goose.yaml +22 -0
  12. package/dist/host-configs/openclaw-manifest.json +16 -0
  13. package/dist/main.d.ts +2 -0
  14. package/dist/main.js +128 -0
  15. package/dist/mcp-app.html +155 -0
  16. package/dist/nestpilot-client.d.ts +44 -0
  17. package/dist/nestpilot-client.js +160 -0
  18. package/dist/planner.html +222 -0
  19. package/dist/server.d.ts +19 -0
  20. package/dist/server.js +245 -0
  21. package/dist/skills/SKILL.md +162 -0
  22. package/dist/skills/manifest.json +51 -0
  23. package/dist/skills/tools/activate_plan.md +36 -0
  24. package/dist/skills/tools/coach.md +59 -0
  25. package/dist/skills/tools/comprehensive_plan.md +65 -0
  26. package/dist/skills/tools/create_plan.md +59 -0
  27. package/dist/skills/tools/create_saved_plan.md +49 -0
  28. package/dist/skills/tools/delete_plan.md +42 -0
  29. package/dist/skills/tools/delete_scenario.md +38 -0
  30. package/dist/skills/tools/generate_proposal.md +63 -0
  31. package/dist/skills/tools/generate_retirement_report.md +50 -0
  32. package/dist/skills/tools/get_active_plan.md +44 -0
  33. package/dist/skills/tools/get_baseline_forecast.md +47 -0
  34. package/dist/skills/tools/get_plan.md +44 -0
  35. package/dist/skills/tools/get_plan_components.md +50 -0
  36. package/dist/skills/tools/get_scenario.md +46 -0
  37. package/dist/skills/tools/list_plans.md +44 -0
  38. package/dist/skills/tools/list_scenarios.md +42 -0
  39. package/dist/skills/tools/medicare-guardian.md +59 -0
  40. package/dist/skills/tools/nestpilot_run_plan.md +61 -0
  41. package/dist/skills/tools/optimize_roth_conversion.md +107 -0
  42. package/dist/skills/tools/optimize_ss_claiming.md +30 -0
  43. package/dist/skills/tools/rename_plan.md +34 -0
  44. package/dist/skills/tools/retirement-planner.md +55 -0
  45. package/dist/skills/tools/run_forecast.md +65 -0
  46. package/dist/skills/tools/run_saved_forecast.md +52 -0
  47. package/dist/skills/tools/run_scenario.md +66 -0
  48. package/dist/skills/tools/save_plan.md +48 -0
  49. package/dist/skills/tools/save_scenario.md +50 -0
  50. package/dist/skills/tools/verify_forecast.md +43 -0
  51. package/dist/src/config.d.ts +20 -0
  52. package/dist/src/config.js +44 -0
  53. package/dist/src/contracts/provenance.d.ts +37 -0
  54. package/dist/src/contracts/provenance.js +71 -0
  55. package/dist/src/contracts/tool-contract-registry.d.ts +43 -0
  56. package/dist/src/contracts/tool-contract-registry.js +282 -0
  57. package/dist/src/local/cloud-compute-client.d.ts +55 -0
  58. package/dist/src/local/cloud-compute-client.js +135 -0
  59. package/dist/src/local/encryption.d.ts +24 -0
  60. package/dist/src/local/encryption.js +105 -0
  61. package/dist/src/local/keychain.d.ts +41 -0
  62. package/dist/src/local/keychain.js +236 -0
  63. package/dist/src/local/local-config.d.ts +34 -0
  64. package/dist/src/local/local-config.js +61 -0
  65. package/dist/src/local/local-data-layer.d.ts +20 -0
  66. package/dist/src/local/local-data-layer.js +15 -0
  67. package/dist/src/local/local-plan-store.d.ts +66 -0
  68. package/dist/src/local/local-plan-store.js +195 -0
  69. package/dist/src/local/pii-scrubber.d.ts +26 -0
  70. package/dist/src/local/pii-scrubber.js +219 -0
  71. package/dist/src/policy/policy-engine.d.ts +44 -0
  72. package/dist/src/policy/policy-engine.js +119 -0
  73. package/dist/src/rate-limit.d.ts +17 -0
  74. package/dist/src/rate-limit.js +41 -0
  75. package/dist/src/security.d.ts +19 -0
  76. package/dist/src/security.js +118 -0
  77. package/dist/src/skills/index.d.ts +12 -0
  78. package/dist/src/skills/index.js +16 -0
  79. package/dist/src/skills/retirement-pack-v1.d.ts +28 -0
  80. package/dist/src/skills/retirement-pack-v1.js +295 -0
  81. package/dist/src/skills/skill-executor.d.ts +65 -0
  82. package/dist/src/skills/skill-executor.js +174 -0
  83. package/dist/src/skills/skill-manifest-schema.d.ts +337 -0
  84. package/dist/src/skills/skill-manifest-schema.js +94 -0
  85. package/dist/src/skills/skill-registry.d.ts +71 -0
  86. package/dist/src/skills/skill-registry.js +116 -0
  87. package/dist/src/telemetry.d.ts +12 -0
  88. package/dist/src/telemetry.js +59 -0
  89. package/dist/src/types.d.ts +46 -0
  90. package/dist/src/types.js +4 -0
  91. package/dist/tools/agent-tools.d.ts +12 -0
  92. package/dist/tools/agent-tools.js +141 -0
  93. package/dist/tools/forecast-management-tools.d.ts +9 -0
  94. package/dist/tools/forecast-management-tools.js +133 -0
  95. package/dist/tools/local-plan-tools.d.ts +8 -0
  96. package/dist/tools/local-plan-tools.js +357 -0
  97. package/dist/tools/mcp-helpers.d.ts +52 -0
  98. package/dist/tools/mcp-helpers.js +177 -0
  99. package/dist/tools/medicare-tools.d.ts +3 -0
  100. package/dist/tools/medicare-tools.js +162 -0
  101. package/dist/tools/optimize-roth-tools-test.d.ts +2 -0
  102. package/dist/tools/optimize-roth-tools-test.js +36 -0
  103. package/dist/tools/optimize-roth-tools.d.ts +3 -0
  104. package/dist/tools/optimize-roth-tools.js +818 -0
  105. package/dist/tools/plan-management-tools.d.ts +3 -0
  106. package/dist/tools/plan-management-tools.js +196 -0
  107. package/dist/tools/planning-tools.d.ts +3 -0
  108. package/dist/tools/planning-tools.js +290 -0
  109. package/dist/tools/proposal-tools.d.ts +3 -0
  110. package/dist/tools/proposal-tools.js +428 -0
  111. package/dist/tools/report-tools.d.ts +3 -0
  112. package/dist/tools/report-tools.js +245 -0
  113. package/dist/tools/scenario-management-tools.d.ts +3 -0
  114. package/dist/tools/scenario-management-tools.js +136 -0
  115. package/dist/views/verification-packet.html +211 -0
  116. package/host-configs/cowork.json +11 -0
  117. package/host-configs/goose.yaml +22 -0
  118. package/host-configs/openclaw-manifest.json +16 -0
  119. package/package.json +66 -0
  120. package/skills/SKILL.md +162 -0
  121. package/skills/manifest.json +51 -0
  122. package/skills/tools/activate_plan.md +36 -0
  123. package/skills/tools/coach.md +59 -0
  124. package/skills/tools/comprehensive_plan.md +65 -0
  125. package/skills/tools/create_plan.md +59 -0
  126. package/skills/tools/create_saved_plan.md +49 -0
  127. package/skills/tools/delete_plan.md +42 -0
  128. package/skills/tools/delete_scenario.md +38 -0
  129. package/skills/tools/generate_proposal.md +63 -0
  130. package/skills/tools/generate_retirement_report.md +50 -0
  131. package/skills/tools/get_active_plan.md +44 -0
  132. package/skills/tools/get_baseline_forecast.md +47 -0
  133. package/skills/tools/get_plan.md +44 -0
  134. package/skills/tools/get_plan_components.md +50 -0
  135. package/skills/tools/get_scenario.md +46 -0
  136. package/skills/tools/list_plans.md +44 -0
  137. package/skills/tools/list_scenarios.md +42 -0
  138. package/skills/tools/medicare-guardian.md +59 -0
  139. package/skills/tools/nestpilot_run_plan.md +61 -0
  140. package/skills/tools/optimize_roth_conversion.md +107 -0
  141. package/skills/tools/optimize_ss_claiming.md +30 -0
  142. package/skills/tools/rename_plan.md +34 -0
  143. package/skills/tools/retirement-planner.md +55 -0
  144. package/skills/tools/run_forecast.md +65 -0
  145. package/skills/tools/run_saved_forecast.md +52 -0
  146. package/skills/tools/run_scenario.md +66 -0
  147. package/skills/tools/save_plan.md +48 -0
  148. package/skills/tools/save_scenario.md +50 -0
  149. package/skills/tools/verify_forecast.md +43 -0
@@ -0,0 +1,59 @@
1
+ # Tool Skill: medicare-guardian
2
+
3
+ Opens the interactive Medicare Guardian view — an enrollment readiness tool that helps users
4
+ understand their Medicare enrollment deadlines, penalty risks, and IRMAA surcharges.
5
+
6
+ ## When to Use
7
+
8
+ Use `medicare-guardian` when the user:
9
+ - Is approaching age 65 and asking about Medicare enrollment
10
+ - Wants to know their enrollment window (IEP, SEP, or GEP)
11
+ - Is asking about Medicare penalties or late enrollment consequences
12
+ - Wants to understand IRMAA surcharges based on their income
13
+ - Is still working and asking whether they can delay enrollment
14
+ - Mentions retiring and needs to switch from employer coverage to Medicare
15
+ - Asks about COBRA and Medicare coordination or timing
16
+ - Wants deadline reminders for Medicare enrollment
17
+ - Needs to understand creditable vs. non-creditable drug coverage
18
+
19
+ ## CRITICAL Boundaries
20
+
21
+ **DO NOT recommend specific Medicare plans** (Part C/Advantage plans, Part D drug plans).
22
+ The Medicare Guardian is an enrollment timing and penalty avoidance tool — NOT a plan comparison
23
+ tool. Recommending specific plans creates regulatory exposure.
24
+
25
+ What you CAN do:
26
+ - Explain enrollment windows (IEP: 7-month window centered on the month you turn 65)
27
+ - Explain penalty rules (Part B: 10% per year delayed beyond IEP; Part D: 1%/month)
28
+ - Explain IRMAA income thresholds and how to appeal them
29
+ - Explain when employer coverage allows delayed enrollment (employer size 100+ = SEP eligible)
30
+ - Explain HSA rules (must stop contributions 6 months before Medicare Part A starts)
31
+
32
+ ## View Modes
33
+
34
+ The guardian opens in one of three modes:
35
+ - `timeline` (default) — shows enrollment windows and key dates based on date of birth
36
+ - `sep_check` — evaluates Special Enrollment Period eligibility (for those still working)
37
+ - `penalty_estimate` — calculates potential penalty exposure
38
+
39
+ Select the mode based on the user's primary concern:
40
+ - "When do I need to sign up?" → `timeline`
41
+ - "Can I delay? I'm still working" → `sep_check`
42
+ - "I missed my window, what are my penalties?" → `penalty_estimate`
43
+
44
+ ## Presenting the Results
45
+
46
+ The view handles its own analysis display. After opening the guardian, if the user wants
47
+ to discuss the results, guide them through:
48
+
49
+ 1. **Enrollment Status**: Whether they are in, approaching, or past their IEP
50
+ 2. **Coverage Assessment**: Whether current coverage allows delayed enrollment
51
+ 3. **Penalty Risk**: Quantify the permanent surcharge risk if applicable
52
+ 4. **IRMAA Warning**: If income exceeds ~$103,000 (single) / ~$206,000 (joint) for 2024
53
+ 5. **Action Items**: Clear next steps with dates
54
+
55
+ ## Error Handling
56
+
57
+ If the view fails to load, ask the user for their date of birth and employment status, then
58
+ explain enrollment timing conceptually from general knowledge. Recommend they visit
59
+ Medicare.gov for authoritative deadline confirmation.
@@ -0,0 +1,61 @@
1
+ # Tool Skill: nestpilot_run_plan
2
+
3
+ Runs a full retirement readiness assessment through the NestPilot Agent Runtime using the
4
+ `retirement-readiness` skill. Accepts natural language input and returns a structured
5
+ assessment with session continuity support.
6
+
7
+ ## When to Use
8
+
9
+ Use `nestpilot_run_plan` when the user:
10
+ - Provides retirement situation in natural language: "I'm 42, have $300k saved, contribute
11
+ $1,500/month, plan to retire at 65. Am I on track?"
12
+ - Wants a complete retirement readiness assessment without manually entering structured inputs
13
+ - Says "check my retirement plan" or "am I on track?"
14
+ - Wants the agent to gather and analyze their situation conversationally
15
+ - Has a complex situation that benefits from the agent's contextual reasoning
16
+
17
+ Use `create_plan` instead when the user has already provided structured inputs (age, balance,
18
+ contribution amounts, rates) and you can pass them directly.
19
+
20
+ ## How It Works
21
+
22
+ `nestpilot_run_plan` communicates with the NestPilot Agent Runtime service:
23
+ 1. Creates a new session (or continues an existing one via `sessionId`)
24
+ 2. Sends the user's message prefixed with `[skill:retirement-readiness]`
25
+ 3. The agent runtime processes the skill workflow and returns analysis results
26
+
27
+ ## Input
28
+
29
+ - `message` — The user's retirement planning question or data in natural language.
30
+ Include as much context as available: age, current savings, monthly contributions,
31
+ retirement target age, expected expenses.
32
+
33
+ Example: "I'm 45, have $400k in my 401k, contribute $2k/month, and want to retire
34
+ at 67 with $6k/month income. How do I look?"
35
+
36
+ - `sessionId` — (optional) Existing session ID to continue a conversation thread.
37
+ Omit to start a fresh session. The tool returns the `sessionId` for follow-up calls.
38
+
39
+ ## Presenting the Results
40
+
41
+ The result includes:
42
+ - `sessionId` — preserve this for follow-up questions in the same conversation
43
+ - Agent analysis: readiness assessment, key findings, recommendations
44
+
45
+ Follow up the result with:
46
+ - A summary of the agent's assessment in plain language
47
+ - Key numbers if provided (readiness score, projected balance, sustainability)
48
+ - Offer to run a specific scenario: "Want me to run a scenario showing what happens
49
+ if you increase contributions by $500/month?"
50
+
51
+ ## Session Continuity
52
+
53
+ For multi-turn retirement conversations, pass the `sessionId` from the first call to
54
+ subsequent calls. This allows the agent to maintain context across the conversation.
55
+
56
+ ## Error Handling
57
+
58
+ If the Agent Runtime service is unavailable (connection refused), fall back to `create_plan`
59
+ with structured inputs extracted from the user's message:
60
+ "The agent service is temporarily unavailable. Let me calculate your retirement projection
61
+ directly — [gather required inputs and call create_plan]."
@@ -0,0 +1,107 @@
1
+ # Tool Skill: optimize_roth_conversion
2
+
3
+ Optimizes Roth conversion strategies for retirement accounts. Analyzes tax brackets, required
4
+ minimum distributions (RMDs), and projected income to recommend a multi-year Roth conversion
5
+ ladder that minimizes lifetime tax burden.
6
+
7
+ ## When to Suggest Roth Conversions
8
+
9
+ Use `optimize_roth_conversion` when the user:
10
+ - Is in a low-income year (between jobs, early retirement, before Social Security starts)
11
+ - Has a pre-RMD window (ages 60-72) where conversions can reduce future forced distributions
12
+ - Has a bracket gap: current income is below their expected retirement tax bracket
13
+ - Asks "How much should I convert to Roth each year?"
14
+ - Wants to minimize lifetime taxes through strategic conversions
15
+ - Asks about filling tax brackets or building a Roth conversion ladder
16
+
17
+ Do NOT use for general tax questions — use `coach` instead.
18
+ Do NOT use for basic forecasting — use `run_forecast` instead.
19
+
20
+ ## Questions to Ask the User
21
+
22
+ Before calling the tool, gather these inputs:
23
+
24
+ ### Required
25
+ - **Filing status**: SINGLE, MFJ (Married Filing Jointly), MFS (Married Filing Separately), HOH (Head of Household)
26
+ - **Current age** and **target retirement age**
27
+ - **Traditional IRA / 401k balance** (total pre-tax retirement account balance)
28
+ - **Annual income** (current gross income from employment)
29
+
30
+ ### Optional but Valuable
31
+ - **Other income sources** (pensions, rental income, part-time work)
32
+ - **Expected Social Security benefit** (annual amount)
33
+ - **Roth IRA balance** (existing Roth assets)
34
+ - **Conversion policy preference**: conservative (fill 12% bracket), moderate (fill 22%), aggressive (fill 24%)
35
+
36
+ If the user doesn't specify a conversion policy, default to "moderate" (fill up to the 22% bracket).
37
+
38
+ ## Presenting Results
39
+
40
+ Structure the response in four parts:
41
+
42
+ ### 1. Lead with Savings
43
+ "Based on your tax situation, converting $X over Y years could save approximately $Z in
44
+ lifetime taxes compared to doing nothing."
45
+
46
+ ### 2. Conversion Schedule
47
+ Present the year-by-year schedule as a table or summary:
48
+ - Year, age, conversion amount, tax cost, bracket filled
49
+ - Highlight the best conversion years (lowest income, most headroom)
50
+
51
+ ### 3. Trade-offs
52
+ - **Upfront tax cost**: Total taxes paid on conversions
53
+ - **Break-even age**: When the tax-free Roth growth exceeds the upfront cost
54
+ - **RMD reduction**: How much lower Required Minimum Distributions will be at age 73+
55
+
56
+ ### 4. Key Considerations
57
+ - IRMAA warnings (if any conversions push income near Medicare surcharge thresholds)
58
+ - State tax implications note
59
+ - Any caveats about the specific situation
60
+
61
+ ## Safety Gates
62
+
63
+ ### IRMAA Cliff Warning
64
+ When income with conversion approaches $103,000 (single) or $206,000 (MFJ), warn:
65
+ "Converting this amount may trigger Medicare IRMAA surcharges that add $X/month to your
66
+ Part B and Part D premiums. Consider converting less to stay below the threshold."
67
+
68
+ ### ACA Subsidy Impact
69
+ If the user is pre-65 and on ACA marketplace insurance, note that conversions increase MAGI
70
+ and may reduce premium subsidies. Suggest coordinating with their insurance situation.
71
+
72
+ ### State Tax Considerations
73
+ Always note: "This analysis uses federal tax brackets only. Your state may tax Roth conversions
74
+ differently. Some states (like Pennsylvania) do not tax Roth conversions."
75
+
76
+ ## Required Disclaimers
77
+
78
+ ALWAYS include in every response:
79
+ - "This analysis is for educational purposes only and does not constitute tax advice."
80
+ - "Consult a qualified tax professional before making Roth conversion decisions."
81
+ - "Tax brackets and IRMAA thresholds are based on 2025 values and may change."
82
+
83
+ ## Evidence Packet
84
+
85
+ The tool returns a full evidence packet containing:
86
+ - All input assumptions used in the calculation
87
+ - Step-by-step calculation methodology
88
+ - Tax bracket headroom analysis
89
+ - IRMAA threshold proximity for each conversion year
90
+ - Disclaimers and caveats
91
+
92
+ Present the evidence packet transparently when the user asks "show me the math" or
93
+ "what assumptions did you use?"
94
+
95
+ ## Common Follow-Up Patterns
96
+
97
+ After presenting Roth conversion results, offer:
98
+ - "Want to see how this conversion strategy affects your overall retirement forecast?" → `run_forecast`
99
+ - "Want to compare this with a different conversion policy (conservative vs. aggressive)?" → re-run with different `conversionPolicy`
100
+ - "Want to coordinate this with your Social Security claiming strategy?" → `optimize_ss_claiming`
101
+ - "Want to explore a what-if scenario with these conversions?" → `run_scenario`
102
+
103
+ ## Error Handling
104
+
105
+ Same as `run_forecast`. Validation errors should prompt clarification of the specific field.
106
+ If the backend tax API returns an error, explain what went wrong and ask the user to verify
107
+ their inputs (especially filing status and income figures).
@@ -0,0 +1,30 @@
1
+ # Tool Skill: optimize_ss_claiming
2
+
3
+ Optimizes Social Security claiming strategy. Analyzes benefit amounts across different claiming
4
+ ages (62–70) factoring in longevity estimates, spousal benefits, survivor benefits, and the
5
+ interaction with other retirement income sources.
6
+
7
+ ## When to Use
8
+
9
+ Use `optimize_ss_claiming` when the user wants to:
10
+ - Determine the optimal age to start claiming Social Security
11
+ - Compare the cumulative benefit of early vs delayed claiming
12
+ - Factor in spousal or survivor benefit strategies
13
+ - Understand the breakeven age for delayed claiming
14
+
15
+ ## Core Purpose: Maximizing Lifetime Social Security Benefits
16
+
17
+ This tool runs a breakeven analysis comparing claiming at different ages, adjusting for the
18
+ user's health, life expectancy, other income sources, and tax situation. It considers the 8%
19
+ per year delayed retirement credits and any applicable spousal benefit strategies.
20
+
21
+ ## Presenting Results
22
+
23
+ Structure the response in three parts:
24
+ 1. **Recommended claiming age**: The optimal age based on the user's specific situation.
25
+ 2. **Comparison table**: Monthly and cumulative benefits at ages 62, 67, and 70.
26
+ 3. **Key factors**: Breakeven age, spousal considerations, and tax implications.
27
+
28
+ ## Error Handling
29
+
30
+ Same as `run_forecast`. Validation errors should prompt clarification of the specific field.
@@ -0,0 +1,34 @@
1
+ # Tool Skill: rename_plan
2
+
3
+ Renames an existing saved plan. Updates the display name without changing any plan data,
4
+ components, or associated forecasts.
5
+
6
+ ## When to Use
7
+
8
+ Use `rename_plan` when the user:
9
+ - Says "Rename my plan to [new name]" or "Call this plan [new name]"
10
+ - Wants to organize plans with more descriptive labels
11
+ - Has a generic name like "Untitled Plan" they want to improve
12
+
13
+ Use `save_plan` instead if the user wants to change plan data, not just the name.
14
+
15
+ ## Required Inputs to Gather
16
+
17
+ - `planId` (string, required) — UUID of the plan to rename
18
+ - `name` (string, required) — the new name for the plan
19
+
20
+ If the user refers to the plan by its current name, resolve the ID via `list_plans`.
21
+
22
+ ## Presenting the Results
23
+
24
+ Structure the response:
25
+
26
+ 1. **Confirmation**: "Done — your plan has been renamed from '[old name]' to '[new name]'."
27
+
28
+ 2. **No Other Changes**: "All plan data, forecasts, and scenarios are unchanged."
29
+
30
+ ## Common Follow-Up Patterns
31
+
32
+ - User wants to review the plan → `get_plan`
33
+ - User wants to rename another plan → `list_plans` then `rename_plan`
34
+ - User wants to make other changes → `save_plan`
@@ -0,0 +1,55 @@
1
+ # Tool Skill: retirement-planner
2
+
3
+ Opens the interactive Retirement Planner — a full visual planning application with plan
4
+ creation form, forecast charts, and scenario comparison view.
5
+
6
+ ## When to Use
7
+
8
+ Use `retirement-planner` when the user:
9
+ - Wants a visual, interactive retirement planning experience
10
+ - Says "show me my retirement plan", "open the planner", or "I want to see charts"
11
+ - Wants to create or edit a retirement plan through a form UI
12
+ - Wants to see their forecast visualized as charts
13
+ - Wants to compare scenarios side-by-side visually
14
+ - Has just run `create_plan` or `run_forecast` and wants to explore further
15
+
16
+ ## View Modes
17
+
18
+ Select the mode based on the user's intent:
19
+
20
+ - `editor` (default) — Input form for quick plan creation. Use when the user wants to
21
+ enter or modify their retirement inputs interactively.
22
+
23
+ - `forecast` — Displays forecast charts for an existing plan. Use after `run_forecast`
24
+ has been called, especially when the user wants to see year-by-year projections visually.
25
+
26
+ - `scenario` — Shows baseline vs. candidate scenario comparison. Use after `run_scenario`
27
+ when the user wants a visual side-by-side comparison.
28
+
29
+ ## Sequence Patterns
30
+
31
+ **Starting fresh**: Open in `editor` mode. The user fills out inputs, then the planner
32
+ runs its own forecast internally.
33
+
34
+ **After create_plan**: Open in `editor` mode if the user wants to refine inputs, or in
35
+ `forecast` mode to see a richer visual of what `create_plan` returned.
36
+
37
+ **After run_forecast**: Open in `forecast` mode to show the year-by-year chart of the
38
+ detailed forecast results.
39
+
40
+ **After run_scenario**: Open in `scenario` mode to show the baseline vs. candidate
41
+ comparison visually.
42
+
43
+ ## Integration with Tool Results
44
+
45
+ The planner view is standalone — it does not automatically receive results from prior
46
+ `create_plan` or `run_forecast` calls. If a `planId` was returned by a prior tool call,
47
+ mention it to the user so they can load it inside the planner.
48
+
49
+ ## Presenting the Tool Result
50
+
51
+ The tool returns a confirmation message; the actual UI renders in the host application.
52
+ Follow the launch with:
53
+ - "The retirement planner is now open. You can [describe the current mode action]."
54
+ - If in `forecast` mode: "The chart shows your projected portfolio balance year by year."
55
+ - If in `scenario` mode: "You can compare your baseline plan against the scenario on the left."
@@ -0,0 +1,65 @@
1
+ # Tool Skill: run_forecast
2
+
3
+ Runs a comprehensive deterministic retirement forecast with multi-account, multi-income-stream
4
+ support. Returns readiness score, yearly projections, portfolio runway, legacy value, and
5
+ success probability.
6
+
7
+ ## When to Use
8
+
9
+ Use `run_forecast` when the user:
10
+ - Has detailed financial data: multiple accounts (401k, IRA, Roth, taxable), income streams
11
+ - Wants year-by-year projections through retirement
12
+ - Asks about portfolio runway or "When will I run out of money?"
13
+ - Wants to consider tax optimization, withdrawal ordering, or Roth conversions
14
+ - Has a spouse and needs household-level analysis
15
+ - Wants to understand legacy value (assets remaining at life expectancy)
16
+
17
+ Use `create_plan` instead for quick projections when detailed account data is not available.
18
+
19
+ ## Gathering Inputs
20
+
21
+ The `run_forecast` tool takes a full `PlanInputExtended` payload. Gather minimum required fields:
22
+
23
+ **Required:**
24
+ - `currentAge` — integer >= 18
25
+ - `retirementAge` — integer >= 50
26
+ - `targetMonthlySpending` — desired monthly spending in retirement
27
+ - `accounts` — at least one account: `{type, balance, annualContribution?, realReturn?}`
28
+ - Types: `TRADITIONAL`, `ROTH`, `TAXABLE`, `CASH`
29
+ - `incomeStreams` — at least one stream: `{type, amountMonthly, startAge?, endAge?}`
30
+ - Types: `SALARY`, `SOCIAL_SECURITY`, `PENSION`, `ANNUITY`, `RENTAL`, `OTHER`
31
+
32
+ **Optional but valuable:**
33
+ - `socialSecurityClaimAge` — claiming age affects monthly benefit amount
34
+ - `safeWithdrawalRate` — default 0.04 (4% rule)
35
+ - `effectiveTaxRate` — default 0.15; use marginal for accuracy
36
+ - `withdrawalStrategy` — `"taxable_first"` or `"traditional_first"`
37
+ - `horizonAge` — planning horizon (default 95)
38
+ - `spouse` — partner data for household analysis
39
+
40
+ ## Presenting the Results
41
+
42
+ Structure the response:
43
+
44
+ 1. **Headline**: "Your retirement forecast shows a [readiness score]/100 readiness score,
45
+ with your portfolio covering [yearsCovered] years."
46
+
47
+ 2. **Key Metrics**:
48
+ - Readiness score: X/100
49
+ - Portfolio runway: X years
50
+ - Legacy value at [horizonAge]: $X
51
+ - Success probability: X%
52
+
53
+ 3. **Year-by-Year Narrative**: "Your portfolio peaks at retirement in [year] at $X. Starting
54
+ from age [retirementAge], withdrawals of $X/month cover your target spending through [age]."
55
+
56
+ 4. **Key Assumptions**: Withdrawal rate, tax rate, return assumptions, Social Security claim age.
57
+
58
+ 5. **Next Step**: Offer a scenario or planner view:
59
+ "Want to see how delaying Social Security to 70 changes these numbers?"
60
+
61
+ ## Common Follow-Up Patterns
62
+
63
+ - User wants to explore changes → `run_scenario`
64
+ - User wants visual charts → `retirement-planner` in `forecast` mode with `planId` if saved
65
+ - User wants to stress-test against a market crash → `run_scenario` with `stressTest`
@@ -0,0 +1,52 @@
1
+ # Tool Skill: run_saved_forecast
2
+
3
+ Triggers a retirement forecast on a saved plan. Unlike `run_forecast` (which takes an inline
4
+ PlanContract), this tool references a persisted plan by ID and stores the forecast results
5
+ server-side for later retrieval.
6
+
7
+ ## When to Use
8
+
9
+ Use `run_saved_forecast` when the user:
10
+ - Has a saved plan and says "Run a forecast" or "How does my plan look?"
11
+ - Wants to update projections after making changes to a saved plan
12
+ - Needs baseline results to compare against a scenario
13
+ - Asks for year-by-year projections on their active or named plan
14
+
15
+ Use `run_forecast` instead for ad-hoc projections with inline plan data that isn't saved.
16
+ Use `run_scenario` when the user wants to compare baseline vs. modified assumptions.
17
+
18
+ ## Required Inputs to Gather
19
+
20
+ - `planId` (string, required) — UUID of the saved plan
21
+ - `runType` (string, required) — one of:
22
+ - `"baseline"` — standard projection with current plan assumptions
23
+ - `"scenario"` — projection using a saved scenario's overrides
24
+ - `scenarioId` (string, optional) — required when `runType` is `"scenario"`;
25
+ the UUID of the saved scenario to apply
26
+
27
+ If the user doesn't specify a plan, resolve via `get_active_plan`.
28
+
29
+ ## Presenting the Results
30
+
31
+ Structure the response:
32
+
33
+ 1. **Headline**: "Forecast complete for '[plan name]' ([runType] run)."
34
+
35
+ 2. **Key Metrics**:
36
+ - Readiness score: X/100
37
+ - Portfolio runway: X years (covers spending through age X)
38
+ - Legacy value at [horizon age]: $X
39
+ - Success probability: X%
40
+
41
+ 3. **Year-by-Year Narrative**: Summarize the trajectory — peak balance, drawdown start,
42
+ and critical inflection points.
43
+
44
+ 4. **Next Step**: "Want to explore a what-if scenario, or see how a different claiming
45
+ age affects these numbers?"
46
+
47
+ ## Common Follow-Up Patterns
48
+
49
+ - User wants to explore changes → `save_scenario` then `run_saved_forecast` with `runType: "scenario"`
50
+ - User wants the baseline data later → `get_baseline_forecast`
51
+ - User wants visual charts → `retirement-planner` with the `planId`
52
+ - User wants a stress test → `run_scenario` with `stressTest`
@@ -0,0 +1,66 @@
1
+ # Tool Skill: run_scenario
2
+
3
+ Runs a what-if scenario analysis comparing a baseline retirement plan against modified
4
+ assumptions. Returns baseline vs. candidate comparison with delta metrics.
5
+
6
+ ## When to Use
7
+
8
+ Use `run_scenario` when the user:
9
+ - Asks "What if I retire at 62 instead of 65?"
10
+ - Wants to compare two versions of their plan
11
+ - Asks about enabling/disabling income streams (annuity, rental income)
12
+ - Wants to stress-test against historical market crashes (2008, dot-com, 1929)
13
+ - Says "How would my plan hold up in a recession?"
14
+ - Wants to see the impact of delaying Social Security
15
+ - Wants to understand the trade-off between saving more vs. retiring earlier
16
+
17
+ ## Framing Scenarios
18
+
19
+ Always present scenarios as exploration, not recommendation:
20
+ - "If X, then Y" — not "you should do X"
21
+ - Lead with the delta: "Retiring at 62 reduces your readiness score by 8 points and
22
+ cuts legacy value by $180,000."
23
+ - Explain the driver: "The 3 extra withdrawal years are the primary factor."
24
+
25
+ ## Input Structure
26
+
27
+ `run_scenario` requires:
28
+ - `plan` — baseline PlanContract object (the current plan)
29
+ - `overrides` (optional) — bundle of changes:
30
+ - `planDeltas` — field-level changes: `[{path: "household.primary.retireAge", to: 62}]`
31
+ - `componentOverrides` — enable/disable plan components by UUID
32
+ - `stressTest` — historical market scenario: `{scenarioId: "2008_CRISIS", applyTo: "EQUITY"}`
33
+
34
+ Common `planDeltas` examples:
35
+ - Retire 3 years earlier: `{path: "household.primary.retireAge", to: retireAge - 3}`
36
+ - Increase target spending: `{path: "goals.retirement.targetSpending.amountMonthly", to: newAmount}`
37
+ - Delay Social Security: `{path: "household.primary.socialSecurity.claimAge", to: 70}`
38
+
39
+ Common `stressTest.scenarioId` values:
40
+ - `"2008_CRISIS"` — 2008 financial crisis
41
+ - `"DOT_COM_BUST"` — 2000-2002 dot-com crash
42
+ - `"1929_CRASH"` — Great Depression
43
+
44
+ ## Presenting the Results
45
+
46
+ Structure the comparison:
47
+
48
+ 1. **Scenario Label**: "Scenario: [label, e.g., 'Retire at 62']"
49
+
50
+ 2. **Delta Summary**:
51
+ - Readiness score: [baseline] → [candidate] (Δ [+/-X])
52
+ - Legacy value: $[baseline] → $[candidate] (Δ [+/-$X])
53
+ - Portfolio runway: [baseline] years → [candidate] years
54
+
55
+ 3. **Key Driver**: Explain the 1-2 factors that most changed the outcome.
56
+
57
+ 4. **Trade-Off Frame**: "The trade-off is [X years of retirement] vs. [Y reduction in
58
+ portfolio longevity]. At your spending target of $Z/month, that math looks like..."
59
+
60
+ 5. **Next Step**: Offer to run another scenario or open the planner comparison view.
61
+
62
+ ## Error Handling
63
+
64
+ If the plan object is incomplete, ask for the missing required fields before calling.
65
+ A minimal plan requires household ages, at least one account, at least one income stream,
66
+ and a target monthly spending goal.
@@ -0,0 +1,48 @@
1
+ # Tool Skill: save_plan
2
+
3
+ Updates an existing saved plan with new or modified data. Performs a partial or full update
4
+ of the PlanContract and persists the changes.
5
+
6
+ ## When to Use
7
+
8
+ Use `save_plan` when the user:
9
+ - Wants to update their retirement age, spending target, or other assumptions
10
+ - Adds or removes accounts or income streams from an existing plan
11
+ - Says "Change my retirement age to 62" or "Add a Roth IRA with $50k"
12
+ - Corrects a mistake in their plan data
13
+ - Wants to save changes after discussing adjustments
14
+
15
+ Do NOT use this to create a brand-new plan — use `create_saved_plan` for that.
16
+
17
+ ## Required Inputs to Gather
18
+
19
+ - `planId` (string, required) — UUID of the plan to update
20
+
21
+ Plus any fields to update within the PlanContract:
22
+ - `household` — age, retirement age, life expectancy, spouse changes
23
+ - `accounts` — add, update, or remove accounts
24
+ - `incomeStreams` — add, update, or remove income streams
25
+ - `goals` — target spending, withdrawal strategy, safe withdrawal rate
26
+ - `name` — to rename (though `rename_plan` is the dedicated tool for that)
27
+
28
+ Fetch the current plan with `get_plan` first if you need to merge changes.
29
+
30
+ ## Presenting the Results
31
+
32
+ Structure the response:
33
+
34
+ 1. **Confirmation**: "I've updated your '[name]' plan."
35
+
36
+ 2. **Changes Applied**: Bullet list of what changed:
37
+ - "Retirement age: 65 -> 62"
38
+ - "Added Roth IRA account ($50,000)"
39
+
40
+ 3. **Impact Hint**: "These changes may affect your forecast. Want me to run a fresh
41
+ projection to see how this looks?"
42
+
43
+ ## Common Follow-Up Patterns
44
+
45
+ - User wants to see the impact → `run_saved_forecast`
46
+ - User wants to compare before/after → `run_scenario` with deltas
47
+ - User wants to undo → `save_plan` reverting to previous values (fetch via `get_plan`)
48
+ - User wants to rename → `rename_plan`
@@ -0,0 +1,50 @@
1
+ # Tool Skill: save_scenario
2
+
3
+ Persists a what-if scenario so it can be re-run, compared, or shared. A scenario captures
4
+ a set of modifications (deltas, overrides, stress tests) that can be applied against a
5
+ baseline plan to produce an alternative forecast.
6
+
7
+ ## When to Use
8
+
9
+ Use `save_scenario` when the user:
10
+ - Wants to save a what-if for later: "Save this as my early-retirement scenario"
11
+ - Has explored a scenario via `run_scenario` and wants to keep it
12
+ - Wants to build a library of scenarios to compare (e.g., "conservative" vs. "aggressive")
13
+ - Says "Remember these changes" or "I want to come back to this"
14
+
15
+ Use `run_scenario` for one-off exploration that doesn't need to persist.
16
+
17
+ ## Required Inputs to Gather
18
+
19
+ - `label` (string, required) — descriptive name (e.g., "Retire at 60", "No Pension")
20
+
21
+ **Optional inputs (at least one recommended):**
22
+ - `deltas` — array of field-level changes:
23
+ `[{path: "household.primary.retireAge", to: 60}]`
24
+ - `overrides` — component-level toggles:
25
+ `{componentId: "uuid", enabled: false}` to disable an income stream
26
+ - `bundle` — a named preset group of changes (e.g., `"aggressive_growth"`)
27
+ - `planId` — UUID of the plan this scenario is associated with; if omitted, the scenario
28
+ is standalone and can be applied to any plan
29
+
30
+ ## Presenting the Results
31
+
32
+ Structure the response:
33
+
34
+ 1. **Confirmation**: "Saved scenario '[label]' (ID: [scenarioId])."
35
+
36
+ 2. **What It Contains**:
37
+ - Deltas: list each change in human-readable form
38
+ - Overrides: list toggled components
39
+ - Stress test: name of historical scenario if included
40
+
41
+ 3. **Association**: "This scenario is [linked to plan '[name]' / standalone]."
42
+
43
+ 4. **Next Step**: "Want me to run a forecast using this scenario, or create another one?"
44
+
45
+ ## Common Follow-Up Patterns
46
+
47
+ - User wants to see the impact → `run_saved_forecast` with `runType: "scenario"` and `scenarioId`
48
+ - User wants to list all scenarios → `list_scenarios`
49
+ - User wants to modify the scenario → `save_scenario` with updated fields (or delete and recreate)
50
+ - User wants to compare multiple scenarios → run forecasts for each and compare