What problem does it solve?
Creating custom risk, exit, hold, or weight override rules for the open-xquant quantitative research kernel requires manual boilerplate code, strict adherence to the framework's Rule protocol, test setup, and registry wiring, which is error-prone and time-consuming for researchers and AI agents building custom trading logic.
Core Features & Use Cases
- End-to-End Rule Creation Workflow: Guides users through 5 structured phases: reading existing rule patterns, defining rule behavior, writing test-first implementations, coding the rule, and registering it in the framework's built-in registry.
- Built-in Guardrails: Enforces critical best practices including portfolio non-mutation, proper RuleResult formatting, test coverage for trigger and no-trigger scenarios, and pre-registration validation to avoid broken framework integrations.
- Use Case: If you need a custom trailing stop-loss rule that exits positions when a stock's price drops 8% from its recent peak, this skill walks you through building, testing, and registering the rule so it works seamlessly with the open-xquant engine's pre-trade and post-trade lifecycle.
Quick Start
Use the create-rule skill to build a new custom exit rule that triggers when a stock's price falls 12% below its 30-day moving average, with full test coverage and automatic framework registration.