oxy-workflow-builder

A builder for Oxy SQL queries, workflows, and AI-agent files. A workflow is a sequence of data-processing steps, while an agent uses AI to reason about a question.

In plain words
What is it for?
Use it to create or edit SQL queries, multi-step workflows, and agents, then run them with variables, dry runs, or natural-language questions.
Why use it?
It helps choose the simplest suitable Oxy approach, reuse existing semantic-layer definitions, and validate or run the resulting files.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/oxy-hq/skills/oxy-workflow-builder
Clone the repo
git clone --depth 1 https://github.com/oxy-hq/skills
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.02660
Opus 5 $0.00000 $0.01330
Sonnet 5 $0.00000 $0.00532
Haiku 4.5 $0.00000 $0.00266

Measured 2d ago against content hash de71661af206, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

oxy-workflow-builder 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 2d 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.

cursor/rules/oxy-workflow-builder.mdc · 407 lines

How it starts

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

Oxy Workflow Builder

Build Oxy data workflows, SQL queries, and AI agents following best practices. Always follow the Oxy Hierarchy: semantic queries first, then SQL/workflows, then agents (see oxy-core rule for the full decision tree).

Before writing SQL or agents, check if semantic layer views exist that can answer the question:

find semantics/views -name "*.view.yml" 2>/dev/null
find semantics/topics -name "*.topic.yml" 2>/dev/null

Essential Commands

# Validation (ALWAYS run after creating/editing YAML)
oxy validate
oxy validate --file=<path>

# SQL execution
oxy run query.sql
oxy run query.sql --dry-run
oxy run query.sql -v key=value

# Workflows
oxy run pipeline.workflow.yml

# Agents
oxy run agent.agent.yml "question"

# Semantic queries (preferred when views exist)
oxy semantic-engine --dev-mode

SQL File Structure

SQL files support Jinja2 templating for dynamic queries:

-- query.sql
-- Description: Brief description of what this query does
-- Variables:
--   - start_date: Start date for the date range
--   - end_date: End date for the date range

SELECT
    date,
    customer_id,
    SUM(amount) as total_amount
FROM {{ databases.clickhouse.schema }}.orders
WHERE date BETWEEN '{{ start_date }}' AND '{{ end_date }}'
GROUP BY date, customer_id
ORDER BY total_amount DESC;

SQL Best Practices

  1. Add header comments with description and required variables
  2. Use Jinja2 variables for parameterization: {{ variable_name }}
  3. Reference databases via context: {{ databases.db_name.schema }}.table
  4. Test with dry-run before executing: oxy run query.sql --dry-run
  5. Keep queries focused - one clear purpose per file
  6. Name descriptively - monthly_revenue_by_restaurant.sql not query1.sql

Common SQL Patterns

Date filtering with variables:

WHERE created_at >= '{{ start_date }}'
  AND created_at < '{{ end_date }}'

Dynamic schema references:

FROM {{ databases.clickhouse.restaurant_analytics }}.orders

Read the full file on GitHub · 407 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. 2d ago First seen · 407 lines · 0 tokens per session scan A de71661af206

Subscribe to this mod's changes

oxy-workflow-builder is a cursor rule published in the GitHub repository oxy-hq/skills (2 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,660 tokens. 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.