alpacalyzer-algo-trader: Skill for Claude Code

.agents/skills/pydantic-model/SKILL.md

pydantic-model is a skill for Claude Code, Codex from kimrejstrom/alpacalyzer-algo-trader. It costs 33 tokens per session (805 once invoked), scanned A, original, MIT.

A set of project-specific instructions for creating Pydantic data models, configuration objects, and event types. Pydantic is a Python library that checks and converts structured data.

In plain words
What is it for?
Use it when adding trading data models, strategy configuration, event types, execution state, or agent response models in the specified project.
Why use it?
It keeps new models consistent with the project’s existing patterns and adds checks for unreliable input, including responses from language models.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is kimrejstrom/alpacalyzer-algo-trader's own configuration. It tells Claude Code and Codex how to work on alpacalyzer-algo-trader itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything alpacalyzer-algo-trader configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kimrejstrom/alpacalyzer-algo-trader. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kimrejstrom/alpacalyzer-algo-trader/main/.agents/skills/pydantic-model/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/kimrejstrom/alpacalyzer-algo-trader

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pydantic-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model/github.svg)](https://agentmods.dev/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model)
Your own site
<a href="https://agentmods.dev/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model"><img src="https://agentmods.dev/badge/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pydantic-model

Your own site · 80×15
<a href="https://agentmods.dev/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model"><img src="https://agentmods.dev/badge/skills/kimrejstrom/alpacalyzer-algo-trader/pydantic-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 805 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00805
Opus 5.5 $0.00013 $0.00322
Sonnet 5.5 $0.00007 $0.00161
Haiku 4.5 $0.00003 $0.00081

Measured 2mo ago against content hash 7847d6bd6d53, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pydantic-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/pydantic-model/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scope Constraint

Model Purpose Location
Trading data (signals, positions) src/alpacalyzer/data/models.py
Strategy configuration src/alpacalyzer/strategies/config.py
Event types (logging) src/alpacalyzer/events/models.py
Execution state src/alpacalyzer/execution/state.py
Agent responses src/alpacalyzer/data/models.py

Steps

1. Study existing models

Read src/alpacalyzer/data/models.py for the established patterns. Also check src/alpacalyzer/strategies/config.py and src/alpacalyzer/events/models.py.

Key patterns: Pydantic v2 syntax (model_dump(), ConfigDict, field_validator with @classmethod), Field() with descriptions for GPT guidance, validators for business logic.

LLM output resilience

Models that receive LLM output need extra hardening because LLMs frequently return wrong types, missing fields, or invented enum values. Patterns used in TradingStrategy:

  • Defaults for commonly-omitted fields: quantity: int = 0, entry_point: float = 0.0, strategy_notes: str = ""
  • Type coercion validators: field_validator("risk_reward_ratio", mode="before") parses "1:1.47" → 1.47
  • Flexible input types: entry_criteria: list[EntryCriteria | str] accepts both structured dicts and plain strings
  • Enum normalization: EntryCriteria.entry_type validator maps near-miss values like "price_above_ma50" → "above_ma50"
  • Default collections: entry_criteria: list[...] = Field(default_factory=list) instead of required list

2. Create model

Follow these conventions:

  • Inherit from pydantic.BaseModel
  • Use Field(description=...) for all fields (helps GPT structured output)
  • Add @field_validator for business constraints (e.g., stop_loss_pct < target_pct)
  • Add @model_validator(mode='after') for cross-field validation
  • Use Literal for constrained string choices

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 84 lines · 33 tokens per session scan A 7847d6bd6d53

Subscribe to this mod's changes

pydantic-model is a skill published in the GitHub repository kimrejstrom/alpacalyzer-algo-trader (2 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 805 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

pydantic-model compared with skills from other repositories

pydantic-model next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pydantic-modelkimrejstrom/alpacalyzer-algo-traderSkill25mo agoMITA33Claude Code, Codex
matlabK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA44Claude Code
pennylaneK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA74Claude Code
holoscan-install-wheelNVIDIA/skillsSkill3.9kyesterdayApache-2.0A34Claude Code, Codex
future-self-liteTHU-MAIC/OpenMAICSkill43kyesterdayMITA20Claude Code, Codex
rocm-kernelshuggingface/kernelsSkill783yesterdayApache-2.0A93Claude Code
typing-exclusion-workergetsentry/skillsSkill1.1kyesterdayApache-2.0A57Claude Code