/tradecraft:stocksight-sentimentfrom tradecraft
Correlates Twitter and news headline sentiment with stock price movements using NLTK/TextBlob/VADER NLP, stored in Elasticsearch with Kibana dashboards. Asset-agnostic.
Ships in tradecraft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
USE FOR:
Open-source sentiment analysis platform correlating Twitter + news sentiment with stock price.
Twitter API → tweepy collector ─┐
Financial News → newspaper3k/BS4 ──┤→ Sentiment Scoring → Elasticsearch → Kibana
Web pages (links) → optional deep ─┘ (NLTK/TextBlob/VADER) Dashboards
↕
stockprice.py
(price correlation)
git clone https://github.com/shirosaidev/stocksight
cd stocksight
docker-compose up -d # Spins up ES + Kibana + stocksight
pip install tweepy beautifulsoup4 newspaper3k nltk textblob elasticsearch
# Also requires: Elasticsearch 5.x + Kibana 5.x running locally
# config/stocksight.cfg
[twitter]
keywords = TSLA, Tesla, Elon Musk
whitelist = buy, bullish, moon, long
blacklist = spam, follow, RT
[stocks]
symbol = TSLA
# Collect Twitter sentiment for TSLA
python stocksight.py -s TSLA -t "Tesla, TSLA" -l
# Track a specific Twitter user's feed
python stocksight.py -s TSLA -u elonmusk
# Collect with deep web page analysis
python stocksight.py -s TSLA -t "Tesla" --web
# Add price data
python stockprice.py -s TSLA
from textblob import TextBlob
from nltk.sentiment.vader import SentimentIntensityAnalyzer
# TextBlob polarity
blob = TextBlob(tweet_text)
polarity = blob.sentiment.polarity # -1.0 to +1.0
# VADER compound score (better for social media)
vader = SentimentIntensityAnalyzer()
scores = vader.polarity_scores(tweet_text)
compound = scores["compound"] # -1.0 to +1.0
# Classification
if compound >= 0.05:
sentiment = "POSITIVE"
elif compound <= -0.05:
sentiment = "NEGATIVE"
else:
sentiment = "NEUTRAL"
After data collection, Kibana (localhost:5601) shows:
# Works for any keyword-based asset
python stocksight.py -s BTC -t "Bitcoin, BTC, crypto" -l
python stocksight.py -s ETH -t "Ethereum, ETH, DeFi" -l
Compound Score │ Signal
────────────────┼──────────────
> +0.3 │ Strong BUY signal
+0.05 to +0.3 │ Weak BUY
-0.05 to +0.05 │ NEUTRAL / hold
-0.05 to -0.3 │ Weak SELL
< -0.3 │ Strong SELL signal
Volume spike + strong sentiment → high-conviction signal
Research project on FTSE 100 top-6 stocks combining:
| Model | Use Case | Notes |
|---|---|---|
| ARIMA | Short-horizon price forecast | Needs stationarity (differencing) |
| SARIMA | ARIMA + seasonal component | Good for weekly/monthly patterns |
| Facebook Prophet | Trend + seasonality decomposition | Handles holidays, robust to missing data |
| Moving Averages | Baseline trend | SMA, EMA — simple but interpretable |
| Model | Use Case | Notes |
|---|---|---|
| LSTM | Long-term temporal dependencies | Standard for price sequences |
| GRU | LSTM-lite, faster training | Similar performance, fewer params |
| Simple RNN | Baseline seq model | Vanishing gradient limits depth |
| Model | Use Case | Notes |
|---|---|---|
| Gradient Boosting | Direction prediction | XGBoost/LightGBM variants preferred |
| Gaussian Naive Bayes | Fast baseline classifier | Good with sentiment features |
| Tool | Approach | Best For |
|---|---|---|
| VADER | Rule-based lexicon | Social media, short texts |
| TextBlob | Pattern-based | Quick polarity scoring |
| BERT | Contextual embeddings | Financial news (FinBERT variant) |
| SpaCy | NER + entity linking | Extract company/ticker mentions |
| Gensim | Topic modeling (LDA) | News theme extraction |
import pandas as pd
import talib # or pandas-ta
# Core price features
df["returns"] = df["Adj Close"].pct_change()
df["log_returns"] = np.log(df["Adj Close"] / df["Adj Close"].shift(1))
# Technical indicators
df["MACD"], df["MACD_signal"], _ = talib.MACD(df["Adj Close"])
df["RSI"] = talib.RSI(df["Adj Close"], timeperiod=14)
df["BB_upper"], df["BB_mid"], df["BB_lower"] = talib.BBANDS(df["Adj Close"])
df["STOCH_k"], df["STOCH_d"] = talib.STOCH(df["High"], df["Low"], df["Close"])
df["MFI"] = talib.MFI(df["High"], df["Low"], df["Close"], df["Volume"])
df["ROC"] = talib.ROC(df["Adj Close"], timeperiod=10)
df["OBV"] = talib.OBV(df["Close"], df["Volume"])
# WRONG — random split causes look-ahead bias
from sklearn.model_selection import train_test_split
X_train, X_test = train_test_split(X, test_size=0.2, random_state=42) # ❌
# CORRECT — time-based split
from sklearn.model_selection import TimeSeriesSplit
tscv = TimeSeriesSplit(n_splits=5)
for train_idx, test_idx in tscv.split(X):
X_train, X_test = X[train_idx], X[test_idx] # ✓
# BEST — walk-forward validation
# Each fold: train on past, predict next N days, advance window
# Regression: predict price or return magnitude
y = df["Adj Close"].shift(-1) # Next day price
y = df["returns"].shift(-1) # Next day return
# Classification: predict direction
y = (df["returns"].shift(-1) > 0).astype(int) # 1=up, 0=down
# or 3-class: 1=up, 0=flat, -1=down
y = np.where(df["returns"].shift(-1) > threshold, 1,
np.where(df["returns"].shift(-1) < -threshold, -1, 0))
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mahmoud20138/tradecraft --plugin tradecraft169 skills in this plugin
/agent-developmentThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins./agentic-storageAgentic storage architecture — persistent memory for AI agents using MCP, immutable versioning, sandboxing, and intent validation. Covers the stateless problem in LLM agents, RAG limitations (read-only), MCP protocol (JSON-RPC, resources, tools), storage safety layers, and agent file system design. Source: IBM Technology (Martin Keen), March 2026. Use this skill for "agentic storage", "agent memory", "persistent agent state", "MCP storage", "agent file system", "agent hard drive", "stateless agent problem", "agent work product", "immutable versioning", "agent sandboxing", "intent validation", "agent safety layers", "agent context window limits", "storage for AI agents", "agent persistence", "autonomous agent storage", "agent audit trail". Works with mcp-integration, trading-brain, agents, trade-psychology-coach.
Other plugins' skills for the same job