# TD Skills for Claude Code

[TD Skills](https://github.com/treasure-data/td-skills) are pre-built Claude Code plugins that enhance AI assistance for Treasure Data workflows.

Getting Started
Launch Claude Code with [`tdx claude`](/treasure-code/commands/claude) to get all TD Skills pre-installed and ready to use.

## Available Skills

### SQL Skills (`sql-skills`)

Query writing, optimization, and engine-specific assistance. [View on GitHub](https://github.com/treasure-data/td-skills/tree/main/sql-skills)

| Skill | Description |
|  --- | --- |
| `trino` | TD Trino SQL with TD-specific functions (`td_interval`, `td_time_range`, `td_time_string`) |
| `hive` | TD Hive SQL with Hive-only features (`lateral view`, `explode`, `MAPJOIN`) |
| `trino-optimizer` | Performance optimization: CTAS, UDP bucketing, magic comments, approx functions |
| `trino-to-hive-migration` | Convert Trino queries to Hive when memory errors occur |
| `trino-cli` | Trino CLI for interactive queries, batch mode, output formats |
| `td-mcp` | TD MCP server setup for Claude Code integration |
| `time-filtering` | Advanced `td_interval` patterns and partition pruning |


### Workflow Skills (`workflow-skills`)

Workflow orchestration and automation. [View on GitHub](https://github.com/treasure-data/td-skills/tree/main/workflow-skills)

| Skill | Description |
|  --- | --- |
| `digdag` | Treasure Workflow (digdag) syntax, `td>` operator, scheduling |
| `workflow-management` | Debugging, monitoring, retry/backfill patterns, alerting |
| `dbt` | dbt with TD Trino: profiles.yml setup, override macros, TD_INTERVAL |


### tdx Skills (`tdx-skills`)

CDP and tdx CLI operations. [View on GitHub](https://github.com/treasure-data/td-skills/tree/main/tdx-skills)

| Skill | Description |
|  --- | --- |
| `tdx-basic` | Core tdx CLI operations, authentication, context management |
| `parent-segment` | Manage CDP parent segments with YAML configs |
| `segment` | Manage CDP child segments with rules and activations |
| `validate-segment` | Validate segment YAML syntax before pushing |
| `journey` | Create CDP journey definitions with stages and steps |
| `validate-journey` | Validate journey YAML configurations |
| `connector-config` | Configure `connector_config` for segment/journey activations |
| `agent` | Build LLM agents using `tdx agent` with YAML/Markdown config |
| `agent-prompt` | Write effective system prompts for TD AI agents |


## Installation

Pre-installed with tdx claude
All TD Skills are automatically pre-installed when you launch Claude Code with `tdx claude`. No manual installation required.

To manually install plugins using Claude Code's `/plugin install` command:


```bash
# Install all skills from a plugin
/plugin install sql-skills@td-skills
/plugin install workflow-skills@td-skills
/plugin install tdx-skills@td-skills

# Or install individual skills
/plugin install sql-skills/trino@td-skills
/plugin install workflow-skills/digdag@td-skills
/plugin install tdx-skills/segment@td-skills
```

## Usage Examples

### SQL Skills


```
> "Help me optimize this Trino query"
> "Convert this SQL to Hive"
> "How do I filter by the last 7 days using td_interval?"
```

### Workflow Skills


```
> "Create a Digdag workflow that runs daily at 6am"
> "Debug this workflow failure"
> "Set up dbt with Treasure Data"
```

### tdx Skills


```
> "Create a segment for high-value customers"
> "Set up an activation to Salesforce"
> "Build a welcome journey with email and wait steps"
> "Validate my segment YAML"
```

## More Information

See the [td-skills repository](https://github.com/treasure-data/td-skills) for detailed documentation and skill-specific guides.