The following prompt was used to develop the custom instructions that Claude Artifacts used to develop an interactive learning experience to simulate creating and managing a stock market portfolio.
Prompt #1 (STEP ONE):
Help me develop an AI Prompt for Claude Artifacts that will build a simple stock market game. The game must simulate 30 days of investing within a 30-minute class period.
Present students with a list of 10 globally known companies they can invest in. They have a $25,000 cash balance. They must be able to buy shares and sell shares in these companies to build a portfolio. The entire time, prices must change, and their portfolio balance must update in real-time. Track both unrealized and realized gains(losses). Simulate earnings and news events sporadically throughout the 30-minute session.
No back end, and nothing will persist. This must work in the Claude Artifacts environment.
Before answering, if needed, ask me as many clarifying questions as necessary to ensure your response adds value.
Clarifying Questions #1 (STEP TWO):
Thoughtfully answer any clarifying questions you are asked.
Prompt #2 (STEP Three This prompt was developed by an AI. I will give this prompt to Claude. You will use the prompt answers generated. ):
Create an interactive stock market simulation game as a React artifact with the following specifications:
Core Requirements
Build a 30-minute stock market game that simulates 30 trading days. Students start with $25,000 cash and can trade stocks from 10 globally recognized companies.
Companies to Include
Use these 10 well-known companies with realistic starting prices:
- Apple (AAPL) - ~$175
- Microsoft (MSFT) - ~$380
- Amazon (AMZN) - ~$145
- Google/Alphabet (GOOGL) - ~$140
- Tesla (TSLA) - ~$245
- Coca-Cola (KO) - ~$62
- McDonald's (MCD) - ~$295
- Nike (NKE) - ~$75
- Disney (DIS) - ~$95
- Walmart (WMT) - ~$165
Game Mechanics
Time System:
- 30 simulated days compressed into 30 minutes (90 seconds per trading day)
- Display current day number and time remaining prominently
- Auto-advance days with a visible countdown timer
Price Movement:
- Prices fluctuate realistically every day (±0.5% to ±4% typical movement)
- Occasional larger swings (±5% to ±12%) for volatility
- Prices should never go below $5 to keep the game realistic
Trading System:
- Buy stocks: Enter number of shares, show total cost, confirm transaction
- Sell stocks: Only allow selling shares they own, show proceeds
- Validate sufficient cash before purchases
- Update portfolio immediately after each trade
- Show transaction history/log
Portfolio Tracking:
- Display current cash balance
- Show all owned stocks with: company name, ticker, shares owned, purchase price average, current price, current value
- Calculate and display unrealized gains/losses (current holdings)
- Calculate and display realized gains/losses (from completed sell transactions)
- Show total portfolio value (cash + stock holdings value)
- Display overall gain/loss percentage from starting $25,000
Random Events
Trigger 8-12 news events randomly throughout the 30 minutes:
Positive Events (stock price jumps 8-15%):
- "Earnings beat expectations"
- "Major product launch success"
- "Strategic partnership announced"
- "Expansion into new markets"
Negative Events (stock price drops 8-15%):
- "Earnings miss expectations"
- "Product recall announced"
- "Regulatory investigation"
- "Supply chain disruptions"
Display events prominently: Show a notification banner with company name, event description, and price impact that auto-dismisses after a few seconds but also logs to an event history panel.
UI/UX Requirements
- Clean, professional dashboard layout resembling a trading platform
- Color coding: Green for gains, red for losses
- Responsive design that works on laptop screens
- Real-time updates - all numbers update smoothly as prices change
- Clear visual hierarchy: Most important info (portfolio value, cash) at the top
- Stock list: Sortable table with current prices and +/- change indicators
- End game screen: Show final results, best/worst performers, and trading statistics
Technical Constraints
- Use only React with Hooks (useState, useEffect, useRef)
- Use Tailwind CSS for styling
- No external APIs or backend
- No localStorage - everything in memory only
- All state managed in React component
- Smooth animations for price changes and transitions
Additional Features
- Pause/Resume button for the simulation
- Visual price charts (simple line graphs) for each stock showing the 30-day trend
- Leaderboard-ready: Display final portfolio value as a clear "score"
- Confetti or celebration effect if student doubles their money
Build this as a single, fully-functional React component that works immediately in Claude Artifacts.