agentleFS
Stax-appStax-app/stax-skill/.agents/skills/stax/SKILL.md

stax

Skill1 starsChanged 6 months agoMITView on GitHub

Stax Labs — build, backtest, deploy, and manage investment strategies. Two modes: CLI (short commands) or API (curl/JSON). Use CLI when installed, fall back to API otherwise. Use when the user asks to "build a strategy", "backtest", "screen stocks", "test a value strategy", or anything related to quantitative investing.

  • Reads credentials
  • Sends data out

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. agentik-os/claude-code-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All use the same auth and the same backend at https://api.staxlabs.org/api/v1

    line 58
  2. Very specific:

    Use curl when CLI is not installed:

    line 98
  3. Distinctive:

    Every backtest requires a strategy object.

    line 154
  4. Distinctive:

    Start simple (2-3 filters), run backtest

    line 519
  5. Distinctive:

    Check Sharpe and max drawdown first

    line 520
  6. Distinctive:

    Always modify one variable at a time and re-run

    line 525
  7. Distinctive:

    No ML in API (use Stax Labs UI for ML)

    line 704

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stax Labs

Build, backtest, deploy, and manage investment strategies — via CLI or API.

Install

git clone https://github.com/Stax-app/stax-skill.git ~/.claude/skills/stax
cd ~/.claude/skills/stax/cli && ./setup.sh
stax login

One clone, one setup, one login. Key saves to ~/.stax/config.json — never paste it again.

Auth

stax login              # guided: open browser or paste key (saves permanently)
stax login --key sk_... # one-liner for agents/CI (no prompts)
stax whoami             # check auth status
stax logout             # remove saved key

Key resolution order:

  1. STAX_API_KEY env var (agents/CI override)
  2. ~/.stax/config.json (from stax login)
  3. Auto-prompts login if neither exists

Usage

stax              # interactive mode — guided menus, build strategies step by step
stax backtest     # direct commands — fast for agents and scripts
stax --help       # see all commands

Which mode to use

  • Interactive (stax with no args) — guided menus, for humans building strategies
  • CLI (stax backtest, stax screen, etc.) — direct commands, for agents/scripts
  • API (curl) — raw JSON, when CLI isn't installed
  • All use the same auth and the same backend at https://api.staxlabs.org/api/v1

CLI Quick Reference

# Screen the universe
stax screen --roe ">15" --pe "<20" --mcap ">10000000000" --date 2024-12-31

# Backtest a strategy
stax backtest strategy.json --start 2022-01-01 --end 2024-12-31 --capital 100000

# Manage strategies
stax strategies list [--search "value"]
stax strategies get <id>
stax strategies delete <id>

# Deploy (paper trading)
stax deploy strategy.json --name "My Deploy" --capital 50000
stax deployments list
stax deployments stop <id>

# Account & keys
stax account
stax keys list
stax keys create --name "New Key"

# Community
stax community --sort sharpe --limit 10

Screen shortcuts: --roe, --pe, --pb, --ps, --de, --mcap, --margin, --roic, --fcf, --div, --cr

Operators in values: ">15", ">=15", "<20", "<=20", "=10", "5..25" (between)


API Reference

Use curl when CLI is not installed:

curl -s -X POST https://api.staxlabs.org/api/v1/backtest \
  -H "Authorization: Bearer $STAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...strategy JSON...}' | jq .

Endpoints

Core

MethodPathDescription
POST/api/v1/backtestRun a full backtest
POST/api/v1/screenScreen universe against filters
GET/api/v1/healthHealth check (no auth)

Strategies

MethodPathDescription
GET/api/v1/strategiesList your saved strategies
POST/api/v1/strategiesSave a new strategy
GET/api/v1/strategies/:idGet a strategy by ID
PUT/api/v1/strategies/:idUpdate a strategy
DELETE/api/v1/strategies/:idDelete a strategy

Account

MethodPathDescription
GET/api/v1/accountYour tier, rate limits, usage
GET/api/v1/account/keysList your API keys
POST/api/v1/account/keysCreate a new API key
DELETE/api/v1/account/keys/:idRevoke an API key

Deployments

MethodPathDescription
POST/api/v1/deployDeploy for paper trading
GET/api/v1/deploymentsList your deployments
GET/api/v1/deployments/:idGet deployment + positions + trades
POST/api/v1/deployments/:id/stopStop a deployment
POST/api/v1/deployments/:id/pausePause a deployment
POST/api/v1/deployments/:id/resumeResume a paused deployment

Community

MethodPathDescription
GET/api/v1/community/strategiesBrowse public strategies
GET/api/v1/community/strategies/:idGet a public strategy
POST/api/v1/community/strategies/:id/forkFork to your account

Strategy JSON Schema

Every backtest requires a strategy object. Here's the full schema:

{
  "strategy": {
    "name": "My Strategy",
    "schemaVersion": 4,

    "fundamentalFilters": [
      { "metric": "return_on_equity", "operator": "gte", "value": 15 },
      { "metric": "debt_to_equity_ratio", "operator": "lte", "value": 1.0 },
      { "metric": "market_cap", "operator": "gte", "value": 1000000000 }
    ],

    "ranking": {
      "momentumWeight": 50,
      "fundamentalWeight": 50,
      "momentumLookback": 6,
      "topN": 20
    },

    "positionSizing": {
      "maxPositionSize": 0.10,
      "minPositionSize": 0.01
    },

    "riskManagement": {
      "hardStopLoss": 0.20,
      "trailingStopLoss": 0.15,
      "takeProfit": 0.50,
      "maxDrawdown": 0.30,
      "exitFailedImmediately": true
    },

    "rebalancing": {
      "frequency": "monthly",
      "weightingMethod": "equal",
      "reconstitutionFrequency": "quarterly"
    },

    "tradingCosts": {
      "commission": { "type": "per_share", "value": 0.005 },
      "slippage": { "type": "percentage", "value": 0.001 }
    }
  },
  "startDate": "2022-01-01",
  "endDate": "2024-12-31",
  "initialCapital": 100000
}

Available Metrics (68 Total)

VALUATION (15 metrics)

MetricDescriptionDirection
price_to_earnings_ratioP/E — price per $1 of profitLower is better
price_to_book_ratioP/B — price vs book valueLower is better
price_to_sales_ratioP/S — price vs revenueLower is better
price_to_free_cash_flow_ratioP/FCF — price vs free cashLower is better
price_to_operating_cash_flow_ratioP/OCF — price vs operating cashLower is better
price_to_earnings_growth_ratioPEG — P/E adjusted for growthLower is better
enterprise_value_multipleEV/EBITDA multipleLower is better
price_to_fair_valuePrice vs estimated fair valueLower is better
ev_to_salesEnterprise value / revenueLower is better
ev_to_ebitdaEnterprise value / EBITDALower is better
ev_to_free_cash_flowEnterprise value / FCFLower is better
ev_to_operating_cash_flowEnterprise value / OCFLower is better
earnings_yieldEarnings / price (%)Higher is better
free_cash_flow_yieldFCF / price (%)Higher is better
graham_numberBen Graham's fair price formulaHigher is better

PROFITABILITY (11 metrics)

MetricDescriptionDirection
gross_profit_marginRevenue kept after COGS (%)Higher is better
operating_profit_marginOperating profit / revenue (%)Higher is better
net_profit_marginNet income / revenue (%)Higher is better
ebit_marginEBIT / revenue (%)Higher is better
ebitda_marginEBITDA / revenue (%)Higher is better
return_on_equityROE — profit / shareholder equity (%)Higher is better
return_on_assetsROA — profit / total assets (%)Higher is better
return_on_invested_capitalROIC — return on all capital (%)Higher is better
return_on_capital_employedROCE — return on employed capital (%)Higher is better
return_on_tangible_assetsROTA — return on tangible assets (%)Higher is better
operating_return_on_assetsOperating income / assets (%)Higher is better

QUALITY (5 metrics — 2 blocked in backtests)

MetricDescriptionDirection
income_qualityCash flow / reported earningsHigher is better
intangibles_to_total_assetsIntangible assets %Lower is better
capex_to_revenueCapital spending / revenueLower is better
research_development_to_revenueR&D spending / revenueHigher is better
stock_based_compensation_to_revenueSBC / revenueLower is better

piotroski_score and altman_z_score are blocked in backtests (lookahead bias).

GROWTH (5 metrics)

MetricDescriptionDirection
revenue_per_shareRevenue / sharesHigher is better
net_income_per_shareEPSHigher is better
book_value_per_shareBook value / sharesHigher is better
free_cash_flow_per_shareFCF / sharesHigher is better
operating_cash_flow_per_shareOCF / sharesHigher is better

SAFETY (10 metrics)

MetricDescriptionDirection
current_ratioCurrent assets / current liabilitiesHigher is better
quick_ratioLiquid assets / current liabilitiesHigher is better
cash_ratioCash / current liabilitiesHigher is better
debt_to_equity_ratioTotal debt / equityLower is better
debt_to_assets_ratioDebt / total assets (%)Lower is better
debt_to_capital_ratioDebt / total capital (%)Lower is better
interest_coverage_ratioEBIT / interest expenseHigher is better
debt_service_coverage_ratioIncome / debt paymentsHigher is better
solvency_ratioLong-term financial healthHigher is better
net_debt_to_ebitdaYears of earnings to pay debtLower is better

EFFICIENCY (11 metrics)

MetricDescriptionDirection
asset_turnoverRevenue / total assetsHigher is better
inventory_turnoverCOGS / inventoryHigher is better
receivables_turnoverRevenue / receivablesHigher is better
payables_turnoverCOGS / payablesHigher is better
fixed_asset_turnoverRevenue / fixed assetsHigher is better
working_capital_turnover_ratioRevenue / working capitalHigher is better
days_sales_outstandingDays to collect paymentLower is better
days_payables_outstandingDays to pay suppliersHigher is better
days_inventory_outstandingDays inventory sitsLower is better
cash_conversion_cycleFull cash cycle (days)Lower is better
operating_cycleInventory + collection (days)Lower is better

SIZE (1 metric)

MetricDescriptionDirection
market_capTotal market capitalization ($)Context-dependent

CASH FLOW (10 metrics)

MetricDescriptionDirection
operating_cash_flow_ratioOCF / current liabilitiesHigher is better
operating_cash_flow_sales_ratioOCF / revenueHigher is better
free_cash_flow_operating_cash_flow_ratioFCF / OCFHigher is better
capital_expenditure_coverage_ratioOCF / capexHigher is better
dividend_payout_ratioDividends / earnings (%)Context-dependent
dividend_yieldAnnual dividend / price (%)Higher is better
free_cash_flow_to_equityCash to shareholders ($)Higher is better
free_cash_flow_to_firmCash to all investors ($)Higher is better
capex_to_operating_cash_flowCapex / OCFLower is better
capex_to_depreciationCapex / depreciationContext-dependent

Filter Operators

OperatorMeaningExample
gtGreater than{ "metric": "return_on_equity", "operator": "gt", "value": 10 }
gteGreater than or equalP/E >= 5
ltLess thanD/E < 1.0
lteLess than or equalP/E <= 20
eqEquals (±0.001)Current ratio = 2.0
betweenInclusive range{ "operator": "between", "value": 10, "value2": 25 }

Value rules:

  • Percentage metrics (margins, ROE, yields): Enter whole numbers. 15 = 15%.
  • Dollar metrics (market_cap, FCFE, FCFF): Enter raw amount. 1000000000 = $1B.
  • Ratio metrics (P/E, D/E, current ratio): Enter the ratio. 20 = 20x.

Configuration Reference

Ranking

"ranking": {
  "momentumWeight": 50,        // 0-100, must sum to 100 with fundamentalWeight
  "fundamentalWeight": 50,     // 0-100
  "momentumLookback": 6,       // Months (1-24)
  "topN": 20                   // Stocks to hold (1+)
}

Position Sizing

"positionSizing": {
  "maxPositionSize": 0.10,     // Max 10% per position (0.01-1.0)
  "minPositionSize": 0.01      // Close below 1% (0.001-1.0)
}

Risk Management

"riskManagement": {
  "hardStopLoss": 0.20,        // Exit at 20% loss (0.01-0.50), null to disable
  "trailingStopLoss": 0.15,    // Trail 15% below high (0.01-0.50), null to disable
  "takeProfit": 0.50,          // Take profit at 50% gain (0.01-4.0), null to disable
  "maxDrawdown": 0.30,         // Portfolio circuit breaker (0.05-0.50)
  "exitFailedImmediately": true // Exit stocks failing screen immediately
}

Rebalancing

"rebalancing": {
  "frequency": "monthly",                    // daily | weekly | monthly
  "weightingMethod": "equal",                // equal | market-cap
  "reconstitutionFrequency": "quarterly"     // monthly | quarterly | semi-annual | annual
}

Trading Costs

"tradingCosts": {
  "commission": { "type": "per_share", "value": 0.005 },  // $0.005/share
  "slippage": { "type": "percentage", "value": 0.001 }    // 0.1%
}

Example Strategies

1. Classic Value (Buffett-style)

{
  "strategy": {
    "name": "Classic Value",
    "schemaVersion": 4,
    "fundamentalFilters": [
      { "metric": "price_to_earnings_ratio", "operator": "between", "value": 5, "value2": 15 },
      { "metric": "return_on_equity", "operator": "gte", "value": 15 },
      { "metric": "debt_to_equity_ratio", "operator": "lte", "value": 0.5 },
      { "metric": "current_ratio", "operator": "gte", "value": 1.5 }
    ],
    "ranking": { "momentumWeight": 30, "fundamentalWeight": 70, "momentumLookback": 6, "topN": 15 },
    "positionSizing": { "maxPositionSize": 0.10, "minPositionSize": 0.01 },
    "riskManagement": { "hardStopLoss": 0.25, "maxDrawdown": 0.35, "exitFailedImmediately": true },
    "rebalancing": { "frequency": "monthly", "weightingMethod": "equal", "reconstitutionFrequency": "quarterly" },
    "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.001 } }
  },
  "startDate": "2020-01-01", "endDate": "2024-12-31", "initialCapital": 100000
}

2. Growth Momentum

{
  "strategy": {
    "name": "Growth Momentum",
    "schemaVersion": 4,
    "fundamentalFilters": [
      { "metric": "revenue_per_share", "operator": "gte", "value": 5 },
      { "metric": "net_income_per_share", "operator": "gte", "value": 1 },
      { "metric": "gross_profit_margin", "operator": "gte", "value": 30 },
      { "metric": "return_on_invested_capital", "operator": "gte", "value": 12 }
    ],
    "ranking": { "momentumWeight": 70, "fundamentalWeight": 30, "momentumLookback": 12, "topN": 10 },
    "positionSizing": { "maxPositionSize": 0.15, "minPositionSize": 0.02 },
    "riskManagement": { "hardStopLoss": 0.20, "trailingStopLoss": 0.12, "takeProfit": 0.60, "maxDrawdown": 0.25, "exitFailedImmediately": true },
    "rebalancing": { "frequency": "weekly", "weightingMethod": "equal", "reconstitutionFrequency": "monthly" },
    "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.001 } }
  },
  "startDate": "2021-01-01", "endDate": "2024-12-31", "initialCapital": 100000
}

3. Quality Dividend

{
  "strategy": {
    "name": "Quality Dividend",
    "schemaVersion": 4,
    "fundamentalFilters": [
      { "metric": "dividend_yield", "operator": "gte", "value": 2 },
      { "metric": "dividend_payout_ratio", "operator": "between", "value": 20, "value2": 70 },
      { "metric": "income_quality", "operator": "gte", "value": 1.0 },
      { "metric": "debt_to_equity_ratio", "operator": "lte", "value": 1.0 },
      { "metric": "market_cap", "operator": "gte", "value": 5000000000 }
    ],
    "ranking": { "momentumWeight": 40, "fundamentalWeight": 60, "momentumLookback": 6, "topN": 25 },
    "positionSizing": { "maxPositionSize": 0.08, "minPositionSize": 0.01 },
    "riskManagement": { "hardStopLoss": 0.30, "maxDrawdown": 0.40, "exitFailedImmediately": true },
    "rebalancing": { "frequency": "monthly", "weightingMethod": "equal", "reconstitutionFrequency": "quarterly" },
    "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.001 } }
  },
  "startDate": "2019-01-01", "endDate": "2024-12-31", "initialCapital": 100000
}

4. Small-Cap Deep Value

{
  "strategy": {
    "name": "Small-Cap Deep Value",
    "schemaVersion": 4,
    "fundamentalFilters": [
      { "metric": "market_cap", "operator": "between", "value": 300000000, "value2": 2000000000 },
      { "metric": "price_to_book_ratio", "operator": "lte", "value": 1.5 },
      { "metric": "price_to_earnings_ratio", "operator": "lte", "value": 12 },
      { "metric": "current_ratio", "operator": "gte", "value": 2.0 },
      { "metric": "return_on_equity", "operator": "gte", "value": 10 }
    ],
    "ranking": { "momentumWeight": 40, "fundamentalWeight": 60, "momentumLookback": 3, "topN": 20 },
    "positionSizing": { "maxPositionSize": 0.08, "minPositionSize": 0.01 },
    "riskManagement": { "hardStopLoss": 0.25, "trailingStopLoss": 0.15, "maxDrawdown": 0.35, "exitFailedImmediately": true },
    "rebalancing": { "frequency": "monthly", "weightingMethod": "equal", "reconstitutionFrequency": "monthly" },
    "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.002 } }
  },
  "startDate": "2020-01-01", "endDate": "2024-12-31", "initialCapital": 100000
}

5. Defensive Quality (Low Drawdown)

{
  "strategy": {
    "name": "Defensive Quality",
    "schemaVersion": 4,
    "fundamentalFilters": [
      { "metric": "market_cap", "operator": "gte", "value": 10000000000 },
      { "metric": "gross_profit_margin", "operator": "gte", "value": 40 },
      { "metric": "net_profit_margin", "operator": "gte", "value": 10 },
      { "metric": "debt_to_equity_ratio", "operator": "lte", "value": 0.5 },
      { "metric": "income_quality", "operator": "gte", "value": 1.0 },
      { "metric": "interest_coverage_ratio", "operator": "gte", "value": 5 }
    ],
    "ranking": { "momentumWeight": 30, "fundamentalWeight": 70, "momentumLookback": 6, "topN": 30 },
    "positionSizing": { "maxPositionSize": 0.06, "minPositionSize": 0.01 },
    "riskManagement": { "hardStopLoss": 0.15, "trailingStopLoss": 0.10, "takeProfit": 0.30, "maxDrawdown": 0.20, "exitFailedImmediately": true },
    "rebalancing": { "frequency": "monthly", "weightingMethod": "equal", "reconstitutionFrequency": "quarterly" },
    "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.001 } }
  },
  "startDate": "2019-01-01", "endDate": "2024-12-31", "initialCapital": 100000
}

Interpreting Results

Key Metrics Benchmarks

MetricPoorAverageGoodExcellent
Sharpe Ratio< 0.50.5-1.01.0-2.0> 2.0
Total Return (annual)< 5%5-12%12-25%> 25%
Max Drawdown> 40%25-40%15-25%< 15%
Win Rate< 40%40-50%50-60%> 60%
Profit Factor< 1.01.0-1.51.5-2.5> 2.5
Sortino Ratio< 0.50.5-1.01.0-2.5> 2.5

Context

  • S&P 500 baseline: ~10% annual return, Sharpe ~0.5, max DD ~34% (COVID)
  • Sharpe > 1.0 consistently = genuinely good strategy
  • Max drawdown matters more than return — surviving drawdowns determines livability
  • Win rate alone is misleading — 30% win rate with 5:1 payoff ratio is excellent

Iteration Workflow

  1. Start simple (2-3 filters), run backtest
  2. Check Sharpe and max drawdown first
  3. Sharpe < 0.5? Filters too loose — tighten or change
  4. Max DD > 30%? Add stops or reduce position size
  5. Too few trades? Loosen filters or increase topN
  6. Too many trades? Tighten reconstitution to quarterly
  7. Always modify one variable at a time and re-run

Screen Endpoint

Screen the universe without a full backtest:

curl -s -X POST https://api.staxlabs.org/api/v1/screen \
  -H "Authorization: Bearer $STAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filters": [
      { "metric": "return_on_equity", "operator": "gte", "value": 20 },
      { "metric": "price_to_earnings_ratio", "operator": "lte", "value": 15 }
    ],
    "asOfDate": "2024-12-31"
  }' | jq .

Strategies

Save a strategy

curl -s -X POST https://api.staxlabs.org/api/v1/strategies \
  -H "Authorization: Bearer $STAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Value Strategy",
    "description": "Low P/E, high ROE mega caps",
    "tags": ["value", "large-cap"],
    "parameters": {
      "schemaVersion": 4,
      "fundamentalFilters": [
        { "metric": "return_on_equity", "operator": "gte", "value": 15 },
        { "metric": "price_to_earnings_ratio", "operator": "lte", "value": 20 }
      ],
      "ranking": { "momentumWeight": 50, "fundamentalWeight": 50, "momentumLookback": 6, "topN": 10 },
      "positionSizing": { "maxPositionSize": 0.15, "minPositionSize": 0.02 },
      "riskManagement": { "hardStopLoss": 0.20, "maxDrawdown": 0.35, "exitFailedImmediately": true },
      "rebalancing": { "frequency": "monthly", "weightingMethod": "equal", "reconstitutionFrequency": "quarterly" },
      "tradingCosts": { "commission": { "type": "per_share", "value": 0.005 }, "slippage": { "type": "percentage", "value": 0.001 } }
    }
  }' | jq .

Response: { "success": true, "strategy": { "id": "uuid", "name": "...", "created_at": "..." } }

List your strategies

curl -s "https://api.staxlabs.org/api/v1/strategies?limit=10&search=value" \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Query params: limit (max 100), offset, search (name filter)

Get a strategy by ID

curl -s https://api.staxlabs.org/api/v1/strategies/STRATEGY_ID \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Returns the full strategy including parameters (the strategy JSON you can pass to /backtest).

Update a strategy

curl -s -X PUT https://api.staxlabs.org/api/v1/strategies/STRATEGY_ID \
  -H "Authorization: Bearer $STAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Updated Name", "is_public": true }' | jq .

Updatable fields: name, description, parameters, tags, is_public

Delete a strategy

curl -s -X DELETE https://api.staxlabs.org/api/v1/strategies/STRATEGY_ID \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Account

Get account info

curl -s https://api.staxlabs.org/api/v1/account \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Returns: tier, rate limits, requests remaining, active key count, subscription info.

List API keys

curl -s https://api.staxlabs.org/api/v1/account/keys \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Create a new API key

curl -s -X POST https://api.staxlabs.org/api/v1/account/keys \
  -H "Authorization: Bearer $STAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My Script" }' | jq .

The full key is returned once — store it immediately.

Revoke an API key

curl -s -X DELETE https://api.staxlabs.org/api/v1/account/keys/KEY_ID \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Community

Browse public strategies

curl -s "https://api.staxlabs.org/api/v1/community/strategies?sort=sharpe&limit=10" \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Sort options: popularity (default), newest, sharpe, returns, backtests

Fork a public strategy

curl -s -X POST https://api.staxlabs.org/api/v1/community/strategies/STRATEGY_ID/fork \
  -H "Authorization: Bearer $STAX_API_KEY" | jq .

Creates a copy in your account that you can modify and backtest.


Workflow: Build → Save → Iterate

The typical API workflow:

  1. Screen — Find which metrics produce interesting universes
  2. Backtest — Test a strategy configuration
  3. Save — Store the strategy if results are promising
  4. Iterate — Load, modify parameters, re-backtest
  5. Share — Set is_public: true for the community
# 1. Screen for high-ROE stocks
curl -s -X POST $API/screen -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"filters": [{"metric": "return_on_equity", "operator": "gte", "value": 20}]}' | jq '.result.passedSymbols | length'

# 2. Backtest a strategy
RESULT=$(curl -s -X POST $API/backtest -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"strategy": {...}, "startDate": "2022-01-01", "endDate": "2024-12-31", "initialCapital": 100000}')

# 3. Save if Sharpe > 1.0
echo $RESULT | jq '.result.metrics.sharpeRatio'
curl -s -X POST $API/strategies -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"name": "High ROE v1", "parameters": {...}}'

# 4. Load, tweak, re-backtest
STRATEGY=$(curl -s $API/strategies/ID -H "$AUTH" | jq '.strategy.parameters')
# Modify filters, re-run backtest...

# 5. Share with community
curl -s -X PUT $API/strategies/ID -H "$AUTH" -H "Content-Type: application/json" \
  -d '{"is_public": true}'

Guardrails

  • Max 1000 symbols per backtest
  • Max 5 years date range
  • Max $100M initial capital
  • No ML in API (use Stax Labs UI for ML)
  • Equity curve capped at 500 points
  • Trades capped at 10,000 in response
  • Rate limits: Pro=10/day, Elite=50/day, Unlimited=500/day

Installation

To install this skill in Claude Code:

git clone https://github.com/Stax-app/stax-skill.git ~/.claude/skills/stax

Then use /stax in any Claude Code session.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.