/tradecraft:synthetic-pair-constructorfrom tradecraft
Builds synthetic instruments from weighted pair combinations, including DXY replicas, risk-on/off baskets, and optimal weight estimation via regression.
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.
import pandas as pd
import numpy as np
class SyntheticPairBuilder:
@staticmethod
def build_basket(prices: pd.DataFrame, weights: dict, name: str = "BASKET") -> pd.Series:
"""Construct a synthetic instrument from weighted price series."""
normalized = prices / prices.iloc[0] # Normalize to 1.0
basket = sum(normalized[sym] * w for sym, w in weights.items() if sym in normalized.columns)
basket.name = name
return basket
@staticmethod
def dxy_replica(prices: pd.DataFrame) -> pd.Series:
"""Replicate the US Dollar Index from FX pairs."""
weights = {"EURUSD": -0.576, "USDJPY": 0.136, "GBPUSD": -0.119,
"USDCAD": 0.091, "USDSEK": 0.042, "USDCHF": 0.036}
# Invert pairs where USD is quote currency
adjusted = prices.copy()
for pair in ["EURUSD", "GBPUSD"]:
if pair in adjusted.columns:
adjusted[pair] = 1 / adjusted[pair]
return SyntheticPairBuilder.build_basket(adjusted, {k: abs(v) for k, v in weights.items()}, "DXY_SYNTHETIC")
@staticmethod
def risk_on_off_basket(prices: pd.DataFrame) -> dict:
"""Build risk-on and risk-off baskets for sentiment measurement."""
risk_on = {"AUDUSD": 0.33, "NZDUSD": 0.33, "USDCAD": -0.34} # long AUD/NZD, short USD/CAD
risk_off = {"USDJPY": -0.5, "USDCHF": -0.5} # long JPY, CHF
return {
"risk_on_basket": SyntheticPairBuilder.build_basket(prices, risk_on, "RISK_ON"),
"risk_off_basket": SyntheticPairBuilder.build_basket(prices, risk_off, "RISK_OFF"),
}
@staticmethod
def optimal_basket_weights(prices: pd.DataFrame, target: pd.Series,
method: str = "ols") -> dict:
"""Find optimal weights to replicate a target series."""
from sklearn.linear_model import LinearRegression
normalized_prices = prices / prices.iloc[0]
normalized_target = target / target.iloc[0]
aligned = pd.concat([normalized_prices, normalized_target.rename("target")], axis=1).dropna()
X = aligned.drop("target", axis=1)
y = aligned["target"]
model = LinearRegression(fit_intercept=False).fit(X, y)
weights = dict(zip(X.columns, np.round(model.coef_, 4)))
r_squared = round(model.score(X, y), 4)
return {"weights": weights, "r_squared": r_squared,
"tracking_error": round((y - model.predict(X)).std(), 6)}
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