$npx -y skills add mphinance/alpha-skills --skill earnings-calendarThis skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. Use this when the user requests earnings calendar data, wants to know which companies are reporting earnings in the upcoming week, or needs a weekly earnings review. Th
| 1 | # Earnings Calendar |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This skill retrieves upcoming earnings announcements for US stocks using the Financial Modeling Prep (FMP) API. It focuses on companies with significant market capitalization (mid-cap and above, over $2B) that are likely to impact market movements. The skill generates organized markdown reports showing which companies are reporting earnings over the next week, grouped by date and timing (before market open, after market close, or time not announced). |
| 6 | |
| 7 | **Key Features**: |
| 8 | - Uses FMP API for reliable, structured earnings data |
| 9 | - Filters by market cap (>$2B) to focus on market-moving companies |
| 10 | - Includes EPS and revenue estimates |
| 11 | - Multi-environment support (CLI, Desktop, Web) |
| 12 | - Flexible API key management |
| 13 | - Organized by date, timing, and market cap |
| 14 | |
| 15 | ## Prerequisites |
| 16 | |
| 17 | ### FMP API Key |
| 18 | |
| 19 | This skill requires a Financial Modeling Prep API key. |
| 20 | |
| 21 | **Get Free API Key**: |
| 22 | 1. Visit: https://site.financialmodelingprep.com/developer/docs |
| 23 | 2. Sign up for free account |
| 24 | 3. Receive API key immediately |
| 25 | 4. Free tier: 250 API calls/day (sufficient for weekly earnings calendar) |
| 26 | |
| 27 | **API Key Setup by Environment**: |
| 28 | |
| 29 | **Claude Code (CLI)**: |
| 30 | ```bash |
| 31 | export FMP_API_KEY="your-api-key-here" |
| 32 | ``` |
| 33 | |
| 34 | **Claude Desktop**: |
| 35 | Set environment variable in system or configure MCP server. |
| 36 | |
| 37 | **Claude Web**: |
| 38 | API key will be requested during skill execution (stored only for current session). |
| 39 | |
| 40 | ## Core Workflow |
| 41 | |
| 42 | ### Step 1: Get Current Date and Calculate Target Week |
| 43 | |
| 44 | **CRITICAL**: Always start by obtaining the accurate current date. |
| 45 | |
| 46 | Retrieve the current date and time: |
| 47 | - Use system date/time to get today's date |
| 48 | - Note: "Today's date" is provided in the environment (<env> tag) |
| 49 | - Calculate the target week: Next 7 days from current date |
| 50 | |
| 51 | **Date Range Calculation**: |
| 52 | ``` |
| 53 | Current Date: [e.g., November 2, 2025] |
| 54 | Target Week Start: [Current Date + 1 day, e.g., November 3, 2025] |
| 55 | Target Week End: [Current Date + 7 days, e.g., November 9, 2025] |
| 56 | ``` |
| 57 | |
| 58 | **Why This Matters**: |
| 59 | - Earnings calendars are time-sensitive |
| 60 | - "Next week" must be calculated from the actual current date |
| 61 | - Provides accurate date range for API request |
| 62 | |
| 63 | **Format dates in YYYY-MM-DD** for API compatibility. |
| 64 | |
| 65 | ### Step 2: Load FMP API Guide |
| 66 | |
| 67 | Before retrieving data, load the comprehensive FMP API guide: |
| 68 | |
| 69 | ``` |
| 70 | Read: references/fmp_api_guide.md |
| 71 | ``` |
| 72 | |
| 73 | This guide contains: |
| 74 | - FMP API endpoint structure and parameters |
| 75 | - Authentication requirements |
| 76 | - Market cap filtering strategy (via Company Profile API) |
| 77 | - Earnings timing conventions (BMO, AMC, TAS) |
| 78 | - Response format and field descriptions |
| 79 | - Error handling strategies |
| 80 | - Best practices and optimization tips |
| 81 | |
| 82 | ### Step 3: API Key Detection and Configuration |
| 83 | |
| 84 | Detect API key availability based on environment. |
| 85 | |
| 86 | **Multi-Environment API Key Detection**: |
| 87 | |
| 88 | #### 3.1 Check Environment Variable (CLI/Desktop) |
| 89 | |
| 90 | ```bash |
| 91 | if [ ! -z "$FMP_API_KEY" ]; then |
| 92 | echo "✓ API key found in environment" |
| 93 | API_KEY=$FMP_API_KEY |
| 94 | fi |
| 95 | ``` |
| 96 | |
| 97 | If environment variable is set, proceed to Step 4. |
| 98 | |
| 99 | #### 3.2 Prompt User for API Key (Desktop/Web) |
| 100 | |
| 101 | If environment variable not found, use AskUserQuestion tool: |
| 102 | |
| 103 | **Question Configuration**: |
| 104 | ``` |
| 105 | Question: "This skill requires an FMP API key to retrieve earnings data. Do you have an FMP API key?" |
| 106 | Header: "API Key" |
| 107 | Options: |
| 108 | 1. "Yes, I'll provide it now" → Proceed to 3.3 |
| 109 | 2. "No, get free key" → Show instructions (3.2.1) |
| 110 | 3. "Skip API, use manual entry" → Jump to Step 8 (fallback mode) |
| 111 | ``` |
| 112 | |
| 113 | **3.2.1 If user chooses "No, get free key"**: |
| 114 | |
| 115 | Provide instructions: |
| 116 | ``` |
| 117 | To get a free FMP API key: |
| 118 | |
| 119 | 1. Visit: https://site.financialmodelingprep.com/developer/docs |
| 120 | 2. Click "Get Free API Key" or "Sign Up" |
| 121 | 3. Create account (email + password) |
| 122 | 4. Receive API key immediately |
| 123 | 5. Free tier includes 250 API calls/day (sufficient for daily use) |
| 124 | |
| 125 | Once you have your API key, please select "Yes, I'll provide it now" to continue. |
| 126 | ``` |
| 127 | |
| 128 | #### 3.3 Request API Key Input |
| 129 | |
| 130 | If user has API key, request input: |
| 131 | |
| 132 | **Prompt**: |
| 133 | ``` |
| 134 | Please paste your FMP API key below: |
| 135 | |
| 136 | (Your API key will only be stored for this conversation session and will be forgotten when the session ends. For regular use, consider setting the FMP_API_KEY environment variable.) |
| 137 | ``` |
| 138 | |
| 139 | **Store API key in session variable**: |
| 140 | ``` |
| 141 | API_KEY = [user_input] |
| 142 | ``` |
| 143 | |
| 144 | **Confirm with user**: |
| 145 | ``` |
| 146 | ✓ API key received and stored for this session. |
| 147 | |
| 148 | Security Note: |
| 149 | - API key is stored only in current conversation context |
| 150 | - Not saved to disk or persisten |