> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kazzle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Skills

> Teach the AI about your app and give it tools to call.

# Skills

A skill is a **folder** that tells the AI what it knows and can do with your app. It has:

* `SKILL.md` — instructions the AI reads (required).
* `tools.ts` — a list of tools the AI can call (optional).

`SKILL.md` describes the app and its tools; `tools.ts` declares the tools; each tool is implemented by an HTTP route in one of your app's components.

## Defining skills

Point `kazzle.config.ts` at each skill's `SKILL.md`. Kazzle uses its folder, so `tools.ts` beside it is picked up automatically.

```typescript theme={"theme":"material-theme-darker"}
import { defineConfig } from '@kazzle/app';

export default defineConfig({
  components: [{ name: 'api', type: 'process', path: './components/api/index.ts' }],
  skills: [
    { name: 'API guide', path: './skills/api/SKILL.md' },
  ],
});
```

## SKILL.md

Markdown with frontmatter, then instructions the AI should follow.

```markdown theme={"theme":"material-theme-darker"}
---
name: API guide
description: How to use this app's tools.
alwaysActive: true
---

Use `save_bookmark` to store a link. It returns a confirmation.
```

## tools.ts

`tools.ts` beside a `SKILL.md` declares the tools that skill can call. The full tool contract — declaration types, the handler request/response shape, and the `content` vs `markdown` result channels — lives in [Tools](/apps/tools).

```ts theme={"theme":"material-theme-darker"}
import { z } from 'zod';
import type { KazzleTool } from '@kazzle/app/tools';

export const tools = [
  {
    name: 'save_bookmark',
    displayName: 'Save bookmark',
    description: 'Save a bookmark URL and return a confirmation.',
    input: z.object({ url: z.string().url(), title: z.string().optional() }).strict(),
    target: {
      type: 'app',
      component: 'api',
      path: '/tools/save-bookmark',
      method: 'POST',
      body: '${input}',
    },
  },
] as const satisfies readonly KazzleTool[];
```

## How the AI uses skills

The AI reads `SKILL.md` on demand (not all skills upfront) to ground its answers, and can call the tools declared in `tools.ts`. A tool with no matching route does nothing; add both together. `tools.json` is not supported.
