# ktx-ai-data-agents-context-layer

The ktx-ai-data-agents-context-layer skill guides setup of ktx as a context layer for warehouse queries. It connects approved metrics, data structure, and business knowledge for AI agents.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 157 installs · ★ 9 repo stars
- Author: reason-machines
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/ktx-ai-data-agents-context-layer/SKILL.md
- Updated: 2026-10-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/ktx-ai-data-agents-context-layer

## What it does

The skill walks through configuring ktx for analytics agents: connecting a warehouse, collecting metadata and business context, building a semantic layer, and starting an MCP server. Supported databases include PostgreSQL, Snowflake, BigQuery, ClickHouse, MySQL, SQL Server, and SQLite. Listed integrations include dbt, Looker, Metabase, and Notion.

Install ktx globally or in a project with `npm`, then run `ktx setup`. The interactive setup configures LLM and embedding providers, database connections, and context sources. You’ll need API keys for the providers you choose and database connection credentials; without valid credentials, ktx cannot connect to the warehouse.

Use `ktx ingest` to refresh context, `ktx validate` to check configuration, and the search commands to find metrics or wiki content. The `.ktx/` directory holds secrets and local state, so keep it out of Git. The project configuration, semantic layer, and wiki can be committed.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/ktx-ai-data-agents-context-layer/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/ktx-ai-data-agents-context-layer/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/ktx-ai-data-agents-context-layer/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/ktx-ai-data-agents-context-layer/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install reason-machines/mcp-skills skills/ktx-ai-data-agents-context-layer
```

2. **Manually: put the files in place**
- File: `.github/skills/ktx-ai-data-agents-context-layer/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/reason-machines/mcp-skills --path skills/ktx-ai-data-agents-context-layer
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/ktx-ai-data-agents-context-layer/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add reason-machines/mcp-skills --skill ktx-ai-data-agents-context-layer -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/reason-machines/mcp-skills/tree/HEAD/skills/ktx-ai-data-agents-context-layer/SKILL.md

## When to use it
- connect an agent to warehouse metrics
- build a semantic layer from tables and measures
- load wiki and dbt knowledge into agent context
- validate ktx configuration and refresh data context

## Example prompts
- Set up ktx so the agent can query our warehouse, then connect its MCP server.
- Build a semantic layer from the database metadata and configured dbt source.
- Validate the ktx setup and refresh its context with `ktx ingest`.

## Similar
- [data-context-extractor](https://affpapa.org/en/nevibecode/skills/data-context-extractor.md) — skill · 3300 installs
- [create-data-context](https://affpapa.org/en/nevibecode/skills/create-data-context.md) — skill · 1 install
- [semlayer](https://affpapa.org/en/nevibecode/mcp/semlayer.md) — MCP server · ★ 5 repo stars
- [building-dbt-semantic-layer](https://affpapa.org/en/nevibecode/skills/building-dbt-semantic-layer.md) — skill · 1100 installs
- [setting-up-data-catalog](https://affpapa.org/en/nevibecode/skills/setting-up-data-catalog.md) — skill · 182 installs
- [analyzing-data](https://affpapa.org/en/nevibecode/skills/analyzing-data.md) — skill · 1500 installs

From the same set: [reason-machines/mcp-skills](https://affpapa.org/en/nevibecode/by/reason-machines/mcp-skills.md) — 98 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
