FrancyJGLisboa/agent-skills-platform / references/examples/stock-analyzer
stock-analyzer
UnverifiedProvides comprehensive technical analysis for stocks and ETFs using RSI, MACD, Bollinger Bands, and other indicators. Activates when user requests stock analysis, technical indicators, trading signals, or market data for specific ticker symbols.
README.md
View on GitHub# Stock Analyzer Skill
**Version:** 1.0.0
**Type:** Simple Skill
**Created by:** Agent-Skill-Creator v3.0.0
---
## Overview
A comprehensive technical analysis skill for stocks and ETFs. Analyzes price movements, volume patterns, and momentum using proven technical indicators including RSI, MACD, Bollinger Bands, and moving averages. Generates actionable buy/sell signals and enables comparative analysis across multiple securities.
### Key Features
- Technical indicator calculation (RSI, MACD, Bollinger Bands, Moving Averages)
- Buy/sell signal generation with reasoning
- Multi-stock comparison and ranking
- Chart pattern recognition
- Price monitoring and alerts
---
## Installation
```bash
# Clone or copy the skill to your Claude Code skills directory
cp -r stock-analyzer ~/.claude/skills/
# Install Python dependencies
cd ~/.claude/skills/stock-analyzer
pip install -r requirements.txt
```
---
## π― Skill Activation
This skill uses a **3-Layer Activation System** for reliable detection.
### β
Phrases That Activate This Skill
The skill will automatically activate when you use phrases like:
#### Primary Activation Phrases
1. **"analyze stock"**
- Example: "Analyze AAPL stock performance"
2. **"technical analysis for"**
- Example: "Show me technical analysis for MSFT"
3. **"RSI indicator"**
- Example: "What's the RSI indicator for TSLA?"
#### Workflow-Based Activation
4. **"buy signal for"**
- Example: "Is there a buy signal for NVDA?"
5. **"compare stocks using"**
- Example: "Compare AAPL vs GOOGL using RSI"
#### Domain-Specific Activation
6. **"MACD indicator"**
- Example: "Show MACD indicator for AMD"
7. **"Bollinger Bands"**
- Example: "Calculate Bollinger Bands for SPY"
#### Natural Language Variations
8. **"What's the technical setup for [TICKER]"**
- Example: "What's the technical setup for QQQ?"
9. **"Monitor stock price"**
- Example: "Monitor AMZN stock price and alert on RSI oversold"
10. **"Chart pattern analysis"**
- Example: "Analyze chart patterns for NFLX"
### β Phrases That Do NOT Activate
To prevent false positives, this skill will **NOT** activate for:
1. **Fundamental Analysis Requests**
- Example: "What's the P/E ratio of AAPL?"
- Reason: This skill focuses on technical analysis, not fundamentals
2. **News or Sentiment Analysis**
- Example: "What's the latest news about TSLA?"
- Reason: This skill analyzes price/volume data, not news sentiment
3. **General Market Education**
- Example: "How do stocks work?"
- Reason: This is educational content, not technical analysis
### π‘ Activation Tips
To ensure reliable activation:
**DO:**
- β
Use action verbs: analyze, compare, monitor, track, show
- β
Be specific about: stock ticker symbols (AAPL, MSFT, etc.)
- β
Mention: technical indicators (RSI, MACD, Bollinger Bands)
- β
Include context: "for trading", "technical analysis", "buy signals"
**DON'T:**
- β Use vague phrases like "tell me about stocks"
- β Omit key entities like ticker symbols or indicator names
- β Be too generic: "analyze the market"
### π― Example Activation Patterns
**Pattern 1:** Technical Indicator Analysis
```
User: "Show me RSI and MACD for AAPL"
Result: β
Skill activates via Keyword Layer (RSI indicator, MACD indicator)
```
**Pattern 2:** Signal Generation
```
User: "Is there a buy signal for NVDA based on technical indicators?"
Result: β
Skill activates via Pattern Layer (buy signal + technical)
```
**Pattern 3:** Stock Comparison
```
User: "Compare these tech stocks using momentum indicators"
Result: β
Skill activates via Pattern Layer (compare.*stocks)
```
---
## Usage
### Basic Usage
```python
# Analyze a single stock
from stock_analyzer import StockAnalyzer
analyzer = StockAnalyzer()
result = analyzer.analyze("AAPL", indicators=["RSI", "MACD"])
print(result)
```
### Advanced Usage
```python
# Compare multiple stocks with custom parameters
analyzer = StockAnalyzer()
comparison = analyzer.compare(
tickers=["AAPL", "MSFT", "GOOGL"],
indicators=["RSI", "MACD", "Bollinger"],
period="1y"
)
print(comparison.ranked_by_momentum())
```
### Real-World Examples
#### Example 1: Single Stock Technical Analysis
**User Query:**
```
"Analyze AAPL stock using RSI and MACD indicators"
```
**Skill Actions:**
1. Fetches recent price data for AAPL
2. Calculates RSI (14-period default)
3. Calculates MACD (12, 26, 9 parameters)
4. Interprets signals and generates recommendation
**Output:**
```json
{
"ticker": "AAPL",
"timestamp": "2025-10-23T10:30:00Z",
"price": 178.45,
"indicators": {
"RSI": {
"value": 62.3,
"signal": "neutral",
"interpretation": "RSI above 50 indicates bullish momentum, but not overbought"
},
"MACD": {
"macd_line": 2.15,
"signal_line": 1.89,
"histogram": 0.26,
"signal": "buy",
"interpretation": "MACD line crossed above signal line - bullish crossover"
}
},
"recommendation": "BUY",
"confidence": "moderate",
"reasoning": "MACD bullish crossover with healthy RSI supports buying opportunity"
}
```
#### Example 2: Multi-Stock Comparison
**User Query:**
```
"Compare AAPL, MSFT, and GOOGL using RSI and rank by momentum"
```
**Skill Actions:**
1. Fetches data for all three tickers
2. Calculates RSI for each
3. Calculates momentum metrics
4. Ranks stocks by technical strength
**Output:**
```json
{
"comparison": [
{
"rank": 1,
"ticker": "MSFT",
"RSI": 68.5,
"momentum_score": 8.2,
"signal": "strong_buy"
},
{
"rank": 2,
"ticker": "AAPL",
"RSI": 62.3,
"momentum_score": 6.8,
"signal": "buy"
},
{
"rank": 3,
"ticker": "GOOGL",
"RSI": 45.7,
"momentum_score": 4.1,
"signal": "neutral"
}
],
"recommendation": "MSFT shows strongest technical setup"
}
```
---
## Features
### Feature 1: Technical Indicator Calculation
Calculates industry-standard technical indicators with customizable parameters.
**Activation:**
- "Calculate RSI for AAPL"
- "Show Bollinger Bands for MSFT"
**Example:**
```python
indicators = analyzer.calculate_indicators("AAPL", ["RSI", "MACD", "Bollinger"])
```
### Feature 2: Buy/Sell Signal Generation
Generates actionable trading signals based on technical indicator combinations.
**Activation:**
- "Is there a buy signal for NVDA?"
- "Show me sell signals for tech stocks"
**Example:**
```python
signal = analyzer.generate_signal("NVDA", strategy="RSI_MACD")
print(f"Signal: {signal.action} - Confidence: {signal.confidence}")
```
### Feature 3: Stock Comparison & Ranking
Compare multiple stocks using technical metrics and rank by strength.
**Activation:**
- "Compare AAPL vs MSFT using technical indicators"
- "Rank these stocks by momentum"
**Example:**
```python
comparison = analyzer.compare(["AAPL", "MSFT", "GOOGL"], rank_by="momentum")
```
### Feature 4: Price Monitoring & Alerts
Monitor stock prices and receive alerts based on technical conditions.
**Activation:**
- "Monitor AMZN and alert when RSI is oversold"
- "Track TSLA price for MACD crossover"
**Example:**
```python
analyzer.set_alert("AMZN", condition="RSI < 30", action="notify")
```
---
## Configuration
### Optional Configuration
You can customize indicator parameters in `config.json`:
```json
{
"indicators": {
"RSI": {
"period": 14,
"overbought": 70,
"oversold": 30
},
"MACD": {
"fast_period": 12,
"slow_period": 26,
"signal_period": 9
},
"Bollinger": {
"period": 20,
"std_dev": 2
}
},
"data_source": "yahoo_finance",
"default_period": "1y"
}
```
---
## Troubleshooting
### Issue: Skill Not Activating
**Symptoms:** Your query doesn't activate the skill
**Solutions:**
1. β
Use one of the activation phrases listed above
2. β
Include action verbs: analyze, compare, monitor, track
3. β
Mention specific entities: ticker symbols, indicator names
4. β
Provide context: "technical analysis", "using RSI"
**Example Fix:**
```
β "What about AAPL?"
β
"Analyze AAPL stock using technical indicators"
```
### Issue: Wrong Skill Activates
**Symptoms:** A different skill activates instead
**Solutions:**
1. Be more specific about technical analysis
2. Use technical indicator keywords: RSI, MACD, Bollinger Bands
3. Add context that distinguishes from fundamental analysis
**Example Fix:**
```
β "Analyze AAPL" (too generic, might trigger fundamental analysis)
β
"Technical analysis of AAPL using RSI and MACD" (specific to this skill)
```
---
## Testing
### Activation Test Suite
You can verify activation with these test queries:
```markdown
1. "Analyze AAPL stock using RSI indicator" β Should activate β
2. "What's the technical analysis for MSFT?" β Should activate β
3. "Show me MACD and Bollinger Bands for TSLA" β Should activate β
4. "Is there a buy signal for NVDA?" β Should activate β
5. "Compare AAPL vs MSFT using RSI" β Should activate β
6. "What's the P/E ratio of AAPL?" β Should NOT activate β
7. "Latest news about TSLA" β Should NOT activate β
```
---
## FAQ
### Q: Why isn't the skill activating for my query?
**A:** Make sure your query includes:
- Action verb (analyze, compare, monitor, track)
- Entity/object (stock ticker like AAPL, or indicator name like RSI)
- Specific context (technical analysis, indicators, signals)
See the "Activation Tips" section above.
### Q: How do I know which phrases will activate the skill?
**A:** Check the "Phrases That Activate This Skill" section above for 10+ tested examples.
### Q: Can I use variations of the activation phrases?
**A:** Yes! The skill uses regex patterns and Claude's NLU, so natural variations will work. For example:
- "Show technical analysis for AAPL" β
- "I need RSI indicator on MSFT" β
- "Compare stocks using momentum" β
---
## Technical Details
### Architecture
Simple Skill architecture with modular indicator calculators, signal generators, and data fetchers.
### Components
- **IndicatorCalculator**: Computes RSI, MACD, Bollinger Bands, Moving Averages
- **SignalGenerator**: Interprets indicators and generates buy/sell signals
- **StockComparator**: Ranks multiple stocks by technical strength
- **DataFetcher**: Retrieves historical price/volume data
### Dependencies
```txt
yfinance>=0.2.0
pandas>=2.0.0
numpy>=1.24.0
ta-lib>=0.4.0
```
---
## Contributing
Contributions welcome! Please submit PRs with:
- New technical indicators
- Improved signal generation algorithms
- Additional chart pattern recognition
- Test coverage improvements
---
## License
MIT License - See LICENSE file for details
---
## Changelog
### v1.0.0 (2025-10-23)
- Initial release with 3-Layer Activation System
- Technical indicators: RSI, MACD, Bollinger Bands, Moving Averages
- Buy/sell signal generation
- Multi-stock comparison
- 95%+ activation reliability
---
## Support
For issues or questions:
- Open an issue in the repository
- Check activation troubleshooting section above
---
**Generated by:** Agent-Skill-Creator v3.0.0
**Last Updated:** 2025-10-23
**Activation System:** 3-Layer (Keywords + Patterns + Description)
## Verification
[VERIFICATION.md](VERIFICATION.md) records the latest generation-time gate and eval evidence.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |