Agent skill
alphaear-stock
Search A-Share stock tickers and retrieve stock price history. Use when user asks about stock codes, recent price changes, or specific company stock info.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/alphaear-stock
SKILL.md
AlphaEar Stock Skill
Overview
This skill provides access to A-Share market data, including fuzzy search for stock tickers and retrieval of historical price data (OHLCV).
Capabilities
1. Stock Search & Data Retrieval
Use scripts/stock_tools.py to interact with the stock database (and network fallback).
Key Methods:
search_ticker(query): Fuzzy search for stock code or name.- Returns: List of
{'code': '...', 'name': '...'}.
- Returns: List of
get_stock_price(ticker, start_date, end_date): Get daily OHLCV dataframe.- Arguments:
ticker(e.g. "600519"), dates in "YYYY-MM-DD".
- Arguments:
Example Usage (Python):
from scripts.database_manager import DatabaseManager
from scripts.stock_tools import StockTools
import pandas as pd
from datetime import datetime, timedelta
db = DatabaseManager()
stock_tools = StockTools(db)
# 1. Search Ticker
results = stock_tools.search_ticker("茅台")
print(results)
# Output: [{'code': '600519', 'name': '贵州茅台'}]
# 2. Get Price
end = datetime.now()
start = end - timedelta(days=30)
df = stock_tools.get_stock_price(
"600519",
start_date=start.strftime('%Y-%m-%d'),
end_date=end.strftime('%Y-%m-%d')
)
print(df.tail())
Dependencies
pandasrequestssqlite3(built-in)
Ensure DatabaseManager is initialized correctly to access the shared SQLite database.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?