arXiv:2611.09528cs.AINov 2026

Manuscript Offprint

arXiv:2611.09528

StockASkill: A Local-First AgentSkill for Intelligent Stock Selection

Xiangjing An, Zhibin Jiao, Aiting Chen

Abstract

Quantitative equity selection and portfolio construction in emerging and cross-border financial markets frequently encounter significant architectural friction: computational bottlenecks from row-oriented iterative scans, remote API rate exhaustion, lookahead and survivorship biases, and rigid real-world execution constraints (e.g., discrete board lots and investor-mandated drawdown limits). In this paper, we present StockASkill, a local-first, full-data-driven AgentSkill engineered as a specialized Quant Co-Processor for autonomous AI agents and quantitative researchers to perform intelligent stock selection and goal-constrained portfolio optimization. Tailored specifically for agile quantitative accounts, family offices, and autonomous AI trading agents with capital scale in the range 105∼10710^5 \sim 10^7 RMB where discrete board lot rounding and cash buffer protection are mandatory real-world requirements, StockASkill establishes an embedded columnar Online Analytical Processing (OLAP) foundation atop DuckDB over 42.44 million historical price records and 186,432 quarterly accounting disclosures spanning 26 years across China A-shares, Hong Kong, US equities, and ETFs. By eliminating ad-hoc remote network dependencies during analysis, StockASkill reduces full-market multi-factor cross-sectional screening latency across 5,400+ equities from over 25 seconds to sub-0.5 seconds (a 95%+ performance gain). We formalize an end-to-end mathematical pipeline integrating a 7+1 factor alpha baseline model, a Sequential Least Squares Programming (SLSQP) convex optimizer operating under smooth surrogate drawdown bounds with exact path validation, dynamic 100-share board lot integer quantization, and an autonomous thesis lifecycle finite-state machine. Furthermore, we provide a zero-disk, strongly-typed JSON streaming interface designed specifically for high-throughput LLM agent tool-calling. The complete source code, documentation, and reproducible pipelines are open-sourced at https://github.com/axjing/stockaskill. Comprehensive empirical benchmarks validate the computational scalability, out-of-sample risk-adjusted return characteristics, and operational resilience of the proposed AgentSkill architecture.

Keywords: AgentSkills, AI Agents, Local-First Architecture, Intelligent Stock Selection, Factor Investing, DuckDB OLAP, Convex Optimization, SLSQP, Board Lot Discretization.

1 Introduction

The democratization of quantitative finance and algorithmic portfolio management has expanded rapidly over the past decade. Individual quants, family offices, and autonomous AI agents now require institutional-grade decision engines capable of evaluating massive cross-sections of financial instruments across multiple asset classes and historical market regimes [1,2]. Despite this progress, contemporary open-source quantitative tooling suffers from several severe structural limitations:

*Corresponding author: axjing.ai@gmail.com Affiliation: Independent Researcher Team. Date: November 2026.

  1. Remote Query Fragility and Rate-Limit Exhaustion: Most quantitative toolkits rely on remote public REST/RPC APIs (e.g., EastMoney, Sina, Yahoo Finance) as their primary query layer. Repeatedly fetching long-term historical bars for cross-sectional screening inevitably triggers rate limits, socket disconnects (RemoteDisconnected), or IP throttling.

  2. Row-Oriented and Iterative Compute Inefficiencies: Evaluating multi-factor models across 5,000+ stocks typically involves iterative Python loops or row-oriented SQLite transactions, incurring severe interpretive overhead and latency exceeding 30 seconds per scan.

  3. The Disconnect Between Theoretical Alpha and Discrete Execution: Traditional Mean-Variance Optimizers (MVO) [3] output continuous theoretical weights (e.g., 3.471%) while ignoring rigid real-world execution constraints. In markets such as the Shanghai and Shenzhen Stock Exchanges, equities must be traded strictly in 100-share integer board lots (shou), and investor mandates demand strict bounds on Target CAGR and Maximum Drawdown.

  4. Friction in AI Agent Integration: Contemporary large language model (LLM) agent harnesses lack zero-disk, strongly typed tool-calling protocols. Agents often spend significant token budgets parsing unstructured terminal ASCII tables or waiting on intermediate disk I/O.

To systematically resolve these challenges, we introduce StockASkill, a high-performance, local-first AgentSkill engineered for intelligent stock selection and goal-constrained portfolio optimization. Conforming to the open AgentSkills specification, StockASkill transforms raw financial market data into actionable mathematical alpha through a strictly local-first paradigm: a unified, 42.44-million-row DuckDB columnar analytical database serves as the single active source of truth. Remote APIs function purely as dynamic, watermark-driven incremental ingestion pipes rather than ad-hoc query layers.