Skip to content

514-labs/agent-skills

Repository files navigation

Agent Skills — MooseStack + ClickHouse

A collection of skills that extend AI coding agents with domain-specific expertise for building data applications with MooseStack and ClickHouse.

Install

npx skills add 514-labs/agent-skills

Works with Claude Code, Cursor, Copilot, Windsurf, Gemini CLI, Codex, and 20+ other agents.

Skills

Skill Type Description
clickhouse-best-practices Reference (28 rules) Schema design, query optimization, and data ingestion best practices — ClickHouse SQL + MooseStack TypeScript & Python
514-cli Workflow 514 CLI basics — logging in, linking a project, checking deployments, browsing docs
514-debug Workflow Deployment debugging — status checks, log tailing, slow query discovery, resource inspection, diagnostic SQL
perf-optimize Workflow (7 stages) End-to-end optimization and benchmarking: profile production, propose candidates, benchmark a frozen baseline vs experiment branches, compare results, and ship the winning PR
production-rollout-plan Workflow (5 stages) Production rollout planning: classify a chosen change, define rollout/validation/rollback steps, and review a safe path to production

Workflow Map

  • perf-optimize -> production-rollout-plan
  • production-rollout-plan can also be used directly once a specific change has been chosen

clickhouse-best-practices

Forked from ClickHouse/agent-skills, which provides 28 battle-tested rules for schema design, query optimization, and data ingestion — all in ClickHouse SQL. We extended every rule with MooseStack TypeScript and Python examples so your agents apply the same discipline when writing application code, not just raw DDL.

What you're building

Teams use MooseStack + ClickHouse to ship analytics features inside their applications — the kind of features where performance, schema design, and data modeling directly impact the end user. This skill makes sure your agents get those decisions right from the start.

Fast, customer-facing dashboards. Your users expect interactive charts and filters that respond in milliseconds, not seconds. When analytical queries outgrow your transactional database, moving them to ClickHouse yields 10–100x faster dashboards — but only if the schema is designed for your actual access patterns. This skill teaches agents to choose the right orderByFields, partitioning, and types so the data model performs well from day one.

Data-connected chat in your app. LLMs can now query your database through MCP, turning natural language into live analytics. The quality of those answers depends on how your data is modeled: clean schemas, well-chosen types, and materialized views that pre-aggregate the right dimensions. This skill ensures agents build chat-ready data models that return fast, accurate results.

What's inside

28 rules, each with ClickHouse SQL + MooseStack TypeScript + MooseStack Python examples:

Category Rules Impact e.g.
Key ordering / orderByFields 4 CRITICAL order columns low-to-high cardinality, prioritize filter columns
Type selection 5 CRITICAL prefer native types, minimize bit-width, avoid Nullable
JOIN optimization 5 CRITICAL filter before joining, ANY for single matches
Insert batching 1 CRITICAL 10K-100K rows per batch
Mutation avoidance 2 CRITICAL no ALTER TABLE UPDATE/DELETE
Partitioning 4 HIGH lifecycle management, keep cardinality under 1,000
Skipping indices 1 HIGH bloom filters for non-ORDER BY filters
Materialized views 2 HIGH incremental for real-time, refreshable for batch
Async inserts 2 HIGH high-frequency small batches
OPTIMIZE avoidance 1 HIGH let merges happen naturally
JSON usage 1 MEDIUM use JSON type for dynamic schemas

Browse the rules: skills/clickhouse/best-practices/ | Human-friendly overview: SKILL.md

Example prompts

Here's a sample of our source data [paste schema or CSV header]. Our queries filter heavily by region and time range. Using the clickhouse-best-practices-ts-py skill, create an optimized TypeScript data model with the right orderByFields, partitioning, and type annotations. Use moose query to validate the table performs well for those access patterns.

Using the clickhouse-best-practices-ts-py skill, review this OlapTable definition against the queries in our Next.js frontend at app/dashboard/. Are the orderByFields in the right order given actual filter and GROUP BY patterns? Should any string columns be LowCardinality? Is Nullable justified on these fields?

I need to track order line items with frequent updates to fulfillment status. Using the clickhouse-best-practices-ts-py skill, what table engine and data model should I use to avoid mutations? Show me the TypeScript and Python versions.

You don't strictly need to name the skill — most agents will activate it automatically when they see ClickHouse or MooseStack context. We like to call it explicitly when we want a formal review against the full ruleset.

For best results, have moose dev running and connect the MooseStack MCP server to your agent. This lets the agent query your local ClickHouse, inspect infrastructure, and validate its recommendations against real data.


514-cli

The foundational workflow skill for the 514 platform. Teaches agents how to authenticate, discover projects, inspect deployed schemas, and run metrics queries — the building blocks that other 514 workflow skills (like perf-optimize and production-rollout-plan) rely on.

Sections

Section What it covers
Authentication Login, whoami, org switching
Projects List, link, setup
Deployments List and filter deployments
Docs Search and browse 514 docs from the terminal

Prerequisites

  • 514 CLI — installed and on your PATH

514-debug

A workflow skill for diagnosing deployment issues. When something is broken or behaving unexpectedly, this skill walks agents through the 514 CLI's observability commands to figure out what's going on.

Sections

Section What it covers
Deployment status Health checks, status filters, branch targeting
Logs Error filtering, full-text search, time ranges, live tailing
Query metrics Slow queries, memory-heavy queries, duration/rows filters
Resource inspection Tables, views, streams, functions, endpoints, syncs
Diagnostic queries Ad-hoc ClickHouse SQL — table sizes, running queries, recent errors

Prerequisites

  • 514 CLI — installed and on your PATH

perf-optimize

A workflow skill that guides an agent through profiling, benchmarking, and selecting ClickHouse optimizations in a 514/Moose deployment. It owns production discovery, candidate generation, frozen baseline setup, experiment branch benchmarking, comparison, and PR creation. Production rollout planning remains separate.

Stages

Stage Goal
SETUP Authenticate with 514 CLI, identify the target project and active deployment, and capture baseline DDL
PROFILE Fetch production schema and query data, analyze it, and map hot query patterns back to code
PROPOSE Present candidate optimizations and get approval on which experiments to run
BASELINE Scaffold the benchmark harness, create the frozen control branch, and benchmark the baseline deployment
EXPERIMENT Run approved optimizations on experiment branches and benchmark each candidate
COMPARE Rank baseline vs candidate results and pick a winner
SHIP Open the winning PR with benchmark evidence and hand off to production-rollout-plan for production rollout planning

Usage

/perf-optimize [project-slug]

If a project slug is provided, the agent skips the project selection prompt. Otherwise it lists available projects and asks the user to choose.

Prerequisites

  • 514 CLI — authenticated (514 auth login)
  • git — available locally for baseline/candidate branch creation
  • gh CLI — available locally for creating the winning pull request
  • moose — available locally, including moose add benchmark and moose dev
  • pnpm — available for the benchmark suite
  • A 514/Moose project with at least one active deployment

Docs: MooseStack | ClickHouse


production-rollout-plan

A workflow skill for planning safe production rollouts of chosen changes in a 514/Moose deployment. It is intentionally not benchmark-specific and can be used from any implementation workflow once a change has been selected.

Stages

Stage Goal
SETUP Identify the project, branch, chosen change, and affected production resources
CLASSIFY Determine rollout type and operational risk
PLAN Define rollout, validation, rollback, backfill, and cutover steps
REVIEW Present the plan for approval and revision
HANDOFF Emit the reviewed rollout plan

Usage

/production-rollout-plan [project-slug]

Prerequisites

  • 514 CLI — authenticated (514 auth login)
  • moose — available locally when local resource inspection is needed
  • A 514/Moose project with at least one active production deployment

Docs: MooseStack | ClickHouse


Supported Agents

The installer auto-detects which agents you have. Skills are agent-agnostic — same skill, every assistant:

Agent Config Directory
Claude Code .claude/skills/
Cursor .cursor/skills/
Windsurf .windsurf/skills/
GitHub Copilot .github/skills/
Gemini CLI .gemini/skills/
Cline .cline/skills/
Codex .codex/skills/
Goose .goose/skills/
Roo Code .roo/skills/
OpenHands .openhands/skills/

And 13 more.

Acknowledgments

The ClickHouse team's agent-skills repo did the hard work of codifying ClickHouse best practices into agent-consumable rules. This project wouldn't exist without it.

License

Apache 2.0 — see LICENSE.

About

Agent skills for MooseStack

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors