@kata-sh/cli 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +142 -6
  2. package/dist/cli.js +20 -0
  3. package/dist/loader.js +10 -0
  4. package/dist/resource-loader.js +19 -0
  5. package/package.json +1 -1
  6. package/src/resources/AGENTS.md +154 -2
  7. package/src/resources/extensions/kata/docs/preferences-reference.md +1 -1
  8. package/src/resources/extensions/kata/gitignore.ts +1 -1
  9. package/src/resources/extensions/kata/preferences.ts +19 -7
  10. package/src/resources/extensions/kata/prompts/complete-milestone.md +1 -1
  11. package/src/resources/extensions/kata/prompts/complete-slice.md +2 -2
  12. package/src/resources/extensions/kata/prompts/discuss.md +7 -7
  13. package/src/resources/extensions/kata/prompts/execute-task.md +2 -2
  14. package/src/resources/extensions/kata/prompts/guided-complete-slice.md +1 -1
  15. package/src/resources/extensions/kata/prompts/guided-discuss-milestone.md +1 -1
  16. package/src/resources/extensions/kata/prompts/guided-discuss-slice.md +1 -1
  17. package/src/resources/extensions/kata/prompts/guided-execute-task.md +1 -1
  18. package/src/resources/extensions/kata/prompts/guided-plan-milestone.md +1 -1
  19. package/src/resources/extensions/kata/prompts/guided-plan-slice.md +1 -1
  20. package/src/resources/extensions/kata/prompts/guided-research-slice.md +1 -1
  21. package/src/resources/extensions/kata/prompts/plan-milestone.md +2 -2
  22. package/src/resources/extensions/kata/prompts/plan-slice.md +2 -2
  23. package/src/resources/extensions/kata/prompts/queue.md +1 -1
  24. package/src/resources/extensions/kata/prompts/research-milestone.md +1 -1
  25. package/src/resources/extensions/kata/prompts/research-slice.md +1 -1
  26. package/src/resources/extensions/kata/prompts/system.md +4 -4
  27. package/src/resources/extensions/kata/templates/preferences.md +1 -1
  28. package/src/resources/extensions/kata/tests/complete-milestone.test.ts +1 -1
  29. package/src/resources/extensions/kata/tests/preferences-frontmatter.test.mjs +53 -0
  30. package/src/resources/extensions/kata/tests/reassess-prompt.test.ts +1 -1
  31. package/src/resources/extensions/slash-commands/create-extension.ts +20 -20
  32. package/src/resources/extensions/slash-commands/create-slash-command.ts +2 -2
  33. package/src/resources/extensions/subagent/index.ts +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Kata CLI
2
2
 
3
- A terminal coding agent built on [pi](https://github.com/badlogic/pi-mono) (`@mariozechner/pi-coding-agent`). Kata CLI bundles a curated set of extensions for structured planning, browser automation, web search, subagent orchestration, and more.
3
+ A terminal coding agent built on [pi](https://github.com/badlogic/pi-mono) (`@mariozechner/pi-coding-agent`). Kata CLI bundles a curated set of extensions for structured planning, browser automation, web search, subagent orchestration, MCP server integration, and more.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -28,7 +28,7 @@ Kata CLI is a thin wrapper around pi-coding-agent. It does not fork pi — it co
28
28
  apps/cli/
29
29
  src/
30
30
  loader.ts — Entry point: sets KATA_* env vars, imports cli.ts
31
- cli.ts — Calls pi-coding-agent's main()
31
+ cli.ts — Calls createAgentSession() + InteractiveMode
32
32
  app-paths.ts — ~/.kata-cli/ path constants
33
33
  resource-loader.ts — Syncs bundled resources to ~/.kata-cli/agent/
34
34
  wizard.ts — First-run setup, env key hydration
@@ -47,8 +47,12 @@ apps/cli/
47
47
 
48
48
  1. `loader.ts` sets `PI_PACKAGE_DIR` to `pkg/` so pi reads Kata's branding config
49
49
  2. `loader.ts` sets `KATA_CODING_AGENT_DIR` so pi uses `~/.kata-cli/agent/` instead of `~/.pi/agent/`
50
- 3. `resource-loader.ts` syncs bundled extensions, agents, skills, and `AGENTS.md` to `~/.kata-cli/agent/` on every launch
51
- 4. `cli.ts` calls pi-coding-agent's `main()` pi handles everything from there
50
+ 3. `loader.ts` injects `--mcp-config ~/.kata-cli/agent/mcp.json` into `process.argv` for the MCP adapter
51
+ 4. `resource-loader.ts` syncs bundled extensions, agents, skills, and `AGENTS.md` to `~/.kata-cli/agent/` on every launch
52
+ 5. `resource-loader.ts` scaffolds a starter `mcp.json` on first launch (never overwrites existing config)
53
+ 6. `cli.ts` seeds `npm:pi-mcp-adapter` into settings so pi auto-installs it
54
+ 7. `cli.ts` injects the `mcp-config` flag into the extension runtime (required because Kata bypasses pi's `main()` and its two-pass argv parsing)
55
+ 8. `cli.ts` calls `createAgentSession()` + `InteractiveMode` — pi handles everything from there
52
56
 
53
57
  ## Bundled Extensions
54
58
 
@@ -64,6 +68,136 @@ apps/cli/
64
68
  | `mac-tools/` | macOS-specific utilities |
65
69
  | `shared/` | Shared UI components (library, not an entry point) |
66
70
 
71
+ ## MCP Support
72
+
73
+ Kata ships with [MCP](https://modelcontextprotocol.io/) (Model Context Protocol) support via [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter), auto-installed on first launch. One proxy `mcp` tool (~200 tokens in context) gives the agent on-demand access to any MCP server's tools without burning context on individual tool definitions.
74
+
75
+ ### How It Works
76
+
77
+ The MCP integration has three parts:
78
+
79
+ 1. **Package seeding**: `cli.ts` ensures `npm:pi-mcp-adapter` is in the settings packages list on every startup. Pi's package manager auto-installs it globally if missing.
80
+ 2. **Config path injection**: `loader.ts` pushes `--mcp-config` into `process.argv` and `cli.ts` sets the flag on `runtime.flagValues` — both are needed because the adapter reads the config path at two different points in its lifecycle.
81
+ 3. **Config scaffolding**: `resource-loader.ts` creates a starter `~/.kata-cli/agent/mcp.json` on first launch. Never overwrites existing config.
82
+
83
+ ### Adding MCP Servers
84
+
85
+ Edit `~/.kata-cli/agent/mcp.json`:
86
+
87
+ ```json
88
+ {
89
+ "settings": {
90
+ "toolPrefix": "server",
91
+ "idleTimeout": 10
92
+ },
93
+ "mcpServers": {}
94
+ }
95
+ ```
96
+
97
+ #### Example: Linear (OAuth via mcp-remote)
98
+
99
+ Many hosted MCP servers (Linear, etc.) use OAuth 2.1 authentication. These require [`mcp-remote`](https://github.com/geelen/mcp-remote) as a stdio proxy that handles the browser-based OAuth flow:
100
+
101
+ ```json
102
+ {
103
+ "settings": { "toolPrefix": "server", "idleTimeout": 10 },
104
+ "mcpServers": {
105
+ "linear": {
106
+ "command": "npx",
107
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"]
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ After adding the config and restarting Kata:
114
+
115
+ 1. Connect the server (opens browser for OAuth):
116
+ ```
117
+ mcp({ connect: "linear" })
118
+ ```
119
+ 2. Authorize in the browser when prompted by Linear.
120
+ 3. Use tools:
121
+ ```
122
+ mcp({ server: "linear" }) — list all Linear tools
123
+ mcp({ search: "issues" }) — search for issue-related tools
124
+ mcp({ tool: "linear_list_teams" }) — call a tool
125
+ ```
126
+
127
+ Tokens are cached in `~/.mcp-auth/` for subsequent sessions. If you hit errors, clear cached auth with `rm -rf ~/.mcp-auth` and reconnect.
128
+
129
+ #### Example: Stdio server with env vars
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "my-server": {
135
+ "command": "npx",
136
+ "args": ["-y", "some-mcp-server"],
137
+ "env": {
138
+ "API_KEY": "${MY_API_KEY}"
139
+ }
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ Environment variables support `${VAR}` interpolation from `process.env`.
146
+
147
+ #### Example: HTTP server with bearer token
148
+
149
+ ```json
150
+ {
151
+ "mcpServers": {
152
+ "my-api": {
153
+ "url": "https://api.example.com/mcp",
154
+ "auth": "bearer",
155
+ "bearerTokenEnv": "MY_API_KEY"
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ #### Importing existing configs
162
+
163
+ Pull in your existing Claude Code, Cursor, or VS Code MCP configuration:
164
+
165
+ ```json
166
+ {
167
+ "imports": ["claude-code", "cursor"],
168
+ "mcpServers": {}
169
+ }
170
+ ```
171
+
172
+ Supported: `cursor`, `claude-code`, `claude-desktop`, `vscode`, `windsurf`, `codex`.
173
+
174
+ ### Server Lifecycle
175
+
176
+ | Mode | Behavior |
177
+ |------|----------|
178
+ | `lazy` (default) | Connect on first tool call. Disconnect after idle timeout. Cached metadata keeps search/list working offline. |
179
+ | `eager` | Connect at startup. No auto-reconnect on drop. |
180
+ | `keep-alive` | Connect at startup. Auto-reconnect via health checks. |
181
+
182
+ ### Usage Reference
183
+
184
+ | Command | Description |
185
+ |---------|-------------|
186
+ | `mcp({ })` | Show server status |
187
+ | `mcp({ server: "name" })` | List tools from a server |
188
+ | `mcp({ search: "query" })` | Search tools (space-separated words OR'd) |
189
+ | `mcp({ describe: "tool_name" })` | Show tool parameters |
190
+ | `mcp({ tool: "name", args: '{}' })` | Call a tool (args is a JSON string) |
191
+ | `mcp({ connect: "name" })` | Force connect/reconnect a server |
192
+ | `/mcp` | Interactive panel (status, tools, reconnect) |
193
+
194
+ ### Known Limitations
195
+
196
+ - **OAuth servers require `mcp-remote`**: The adapter doesn't implement the MCP OAuth browser flow natively. Use `mcp-remote` as a stdio proxy for OAuth servers.
197
+ - **Figma remote MCP** (`mcp.figma.com`): Blocks dynamic client registration — only whitelisted clients can connect via OAuth. Use Figma's desktop app local MCP server instead (`http://127.0.0.1:3845/mcp`), which requires Dev Mode (paid plan).
198
+ - **Metadata cache**: `pi-mcp-adapter` caches tool metadata to `~/.pi/agent/mcp-cache.json` (hardcoded path, doesn't affect functionality).
199
+ - **OAuth token storage**: `mcp-remote` stores tokens in `~/.mcp-auth/`, separate from Kata's config dir.
200
+
67
201
  ## The /kata Command
68
202
 
69
203
  The main extension registers `/kata` with subcommands:
@@ -111,8 +245,9 @@ Kata uses `~/.kata-cli/` (not `~/.kata/`) to avoid collision with other Kata app
111
245
  agents/ — Synced from src/resources/agents/
112
246
  skills/ — Synced from src/resources/skills/
113
247
  AGENTS.md — Synced from src/resources/AGENTS.md
248
+ mcp.json — MCP server configuration (scaffolded on first launch, never overwritten)
114
249
  auth.json — API keys
115
- settings.json — User settings
250
+ settings.json — User settings (includes packages: ["npm:pi-mcp-adapter"])
116
251
  models.json — Custom model definitions
117
252
  sessions/ — Session history
118
253
  preferences.md — Global Kata preferences
@@ -130,6 +265,7 @@ Set by `loader.ts` before pi starts:
130
265
  | `KATA_BIN_PATH` | Absolute path to loader, used by subagent |
131
266
  | `KATA_WORKFLOW_PATH` | Absolute path to bundled KATA-WORKFLOW.md |
132
267
  | `KATA_BUNDLED_EXTENSION_PATHS` | Colon-joined extension entry points for subagent |
268
+ | `KATA_MCP_CONFIG_PATH` | Absolute path to `~/.kata-cli/agent/mcp.json` |
133
269
 
134
270
  ## Development
135
271
 
@@ -143,7 +279,7 @@ npm run copy-themes
143
279
  # Run
144
280
  node dist/loader.js
145
281
 
146
- # Test
282
+ # Test (37 tests: app smoke, resource sync, MCP integration, package validation)
147
283
  npm test
148
284
  ```
149
285
 
package/dist/cli.js CHANGED
@@ -36,10 +36,30 @@ if (!settingsManager.getQuietStartup()) {
36
36
  if (!settingsManager.getCollapseChangelog()) {
37
37
  settingsManager.setCollapseChangelog(true);
38
38
  }
39
+ // Ensure pi-mcp-adapter is in the packages list so pi auto-installs it on startup.
40
+ // Bootstrap only when packages have never been configured. If users later remove the
41
+ // adapter from settings.json, that opt-out should persist.
42
+ const MCP_ADAPTER_PACKAGE = 'npm:pi-mcp-adapter';
43
+ const globalSettings = settingsManager.getGlobalSettings();
44
+ const globalPackages = [...(globalSettings.packages ?? [])];
45
+ const hasConfiguredPackages = Object.prototype.hasOwnProperty.call(globalSettings, "packages");
46
+ if (!hasConfiguredPackages && !globalPackages.includes(MCP_ADAPTER_PACKAGE)) {
47
+ settingsManager.setPackages([...globalPackages, MCP_ADAPTER_PACKAGE]);
48
+ }
49
+ await settingsManager.flush();
39
50
  const sessionManager = SessionManager.create(process.cwd(), sessionsDir);
40
51
  initResources(agentDir);
41
52
  const resourceLoader = buildResourceLoader(agentDir);
42
53
  await resourceLoader.reload();
54
+ // Inject --mcp-config flag value into the extension runtime.
55
+ // pi-mcp-adapter reads this via pi.getFlag("mcp-config") at session_start.
56
+ // Kata doesn't call pi's main() which does the two-pass argv parsing that
57
+ // normally populates flagValues, so we must do it manually here.
58
+ const mcpConfigPath = process.env.KATA_MCP_CONFIG_PATH;
59
+ if (mcpConfigPath) {
60
+ const extResult = resourceLoader.getExtensions();
61
+ extResult.runtime.flagValues.set('mcp-config', mcpConfigPath);
62
+ }
43
63
  const { session, extensionsResult } = await createAgentSession({
44
64
  authStorage,
45
65
  modelRegistry,
package/dist/loader.js CHANGED
@@ -91,5 +91,15 @@ process.env.KATA_BUNDLED_EXTENSION_PATHS = [
91
91
  join(agentDir, "extensions", "ask-user-questions.ts"),
92
92
  join(agentDir, "extensions", "get-secrets-from-user.ts"),
93
93
  ].join(":");
94
+ // KATA_MCP_CONFIG_PATH — absolute path to Kata's MCP config file.
95
+ // pi-mcp-adapter reads --mcp-config from process.argv directly (before session_start fires).
96
+ // We inject it here so the adapter uses ~/.kata-cli/agent/mcp.json instead of the
97
+ // default ~/.pi/agent/mcp.json.
98
+ const mcpConfigPath = join(agentDir, "mcp.json");
99
+ process.env.KATA_MCP_CONFIG_PATH = mcpConfigPath;
100
+ const hasMcpConfigArg = process.argv.some((arg) => arg === "--mcp-config" || arg.startsWith("--mcp-config="));
101
+ if (!hasMcpConfigArg) {
102
+ process.argv.push("--mcp-config", mcpConfigPath);
103
+ }
94
104
  // Dynamic import defers ESM evaluation — config.js will see PI_PACKAGE_DIR above
95
105
  await import("./cli.js");
@@ -2,6 +2,19 @@ import { DefaultResourceLoader } from '@mariozechner/pi-coding-agent';
2
2
  import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
3
3
  import { dirname, join, resolve } from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
+ /**
6
+ * Starter mcp.json written to agentDir on first launch.
7
+ * Uses the `imports` field so users can pull in their existing Claude/Cursor config.
8
+ * mcpServers is intentionally empty — users add their own servers here.
9
+ */
10
+ const STARTER_MCP_JSON = JSON.stringify({
11
+ imports: [],
12
+ settings: {
13
+ toolPrefix: 'server',
14
+ idleTimeout: 10,
15
+ },
16
+ mcpServers: {},
17
+ }, null, 2) + '\n';
5
18
  // Resolves to the bundled src/resources/ inside the npm package at runtime:
6
19
  // dist/resource-loader.js → .. → package root → src/resources/
7
20
  const resourcesDir = resolve(dirname(fileURLToPath(import.meta.url)), '..', 'src', 'resources');
@@ -39,6 +52,12 @@ export function initResources(agentDir) {
39
52
  if (existsSync(srcAgentsMd)) {
40
53
  writeFileSync(destAgentsMd, readFileSync(srcAgentsMd));
41
54
  }
55
+ // Scaffold starter mcp.json — only if it doesn't exist yet.
56
+ // Never overwrite: preserve the user's MCP server configuration.
57
+ const mcpConfigPath = join(agentDir, 'mcp.json');
58
+ if (!existsSync(mcpConfigPath)) {
59
+ writeFileSync(mcpConfigPath, STARTER_MCP_JSON, 'utf-8');
60
+ }
42
61
  }
43
62
  /**
44
63
  * Constructs a DefaultResourceLoader with no additionalExtensionPaths.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kata-sh/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Kata CLI coding agent",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -9,7 +9,7 @@ Kata CLI is a thin wrapper around pi-coding-agent that provides:
9
9
  - **Branded entry point**: `src/loader.ts` sets env vars and launches `src/cli.ts`
10
10
  - **Bundled extensions**: `src/resources/extensions/` contains all built-in extensions
11
11
  - **Resource syncing**: `src/resource-loader.ts` copies bundled extensions to `~/.kata-cli/agent/` on startup
12
- - **Config directory**: `~/.kata-cli/` (not `~/.kata/` to avoid collision with other Kata apps)
12
+ - **Config directory**: `~/.kata-cli/` (not `~/.pi/` to avoid collision with other Kata apps)
13
13
  - **Package shim**: `pkg/package.json` provides `piConfig` with `name: "kata"` and `configDir: ".kata-cli"`
14
14
 
15
15
  ## Directory Structure
@@ -18,7 +18,7 @@ Kata CLI is a thin wrapper around pi-coding-agent that provides:
18
18
  apps/cli/
19
19
  src/
20
20
  loader.ts — Entry point, sets KATA_* env vars, imports cli.ts
21
- cli.ts — Thin wrapper that calls pi-coding-agent's main()
21
+ cli.ts — Thin wrapper that calls createAgentSession() + InteractiveMode
22
22
  app-paths.ts — Exports appRoot, agentDir, sessionsDir, authFilePath
23
23
  resource-loader.ts — Syncs bundled resources to ~/.kata-cli/agent/
24
24
  wizard.ts — First-run setup, env key hydration
@@ -55,6 +55,7 @@ Kata sets these env vars in `loader.ts` before importing `cli.ts`:
55
55
  | `KATA_BIN_PATH` | Absolute path to loader, used by subagent to spawn Kata |
56
56
  | `KATA_WORKFLOW_PATH` | Absolute path to bundled KATA-WORKFLOW.md |
57
57
  | `KATA_BUNDLED_EXTENSION_PATHS` | Colon-joined list of extension entry points |
58
+ | `KATA_MCP_CONFIG_PATH` | Absolute path to `~/.kata-cli/agent/mcp.json` (also injected as `--mcp-config` argv) |
58
59
 
59
60
  ## The /kata Command
60
61
 
@@ -99,6 +100,156 @@ Kata stores project state in `.kata/` at the project root:
99
100
  - **Copy themes**: `npm run copy-themes` (copies theme assets from pi-coding-agent)
100
101
  - **Dependencies**: Consumed via npm from `@mariozechner/pi-coding-agent` — never fork
101
102
 
103
+ ## MCP Support
104
+
105
+ Kata ships with MCP (Model Context Protocol) support via [`pi-mcp-adapter`](https://github.com/nicobailon/pi-mcp-adapter), auto-installed on first launch. One proxy `mcp` tool (~200 tokens) gives the agent on-demand access to any MCP server's tools without burning context on tool definitions.
106
+
107
+ ### How it works
108
+
109
+ There are three integration points that make MCP work in Kata:
110
+
111
+ 1. **Package seeding** (`cli.ts`): Seeds `npm:pi-mcp-adapter` into `settingsManager.getPackages()` on every startup. Pi's package manager auto-installs it globally if missing.
112
+
113
+ 2. **Config path injection** (`loader.ts` + `cli.ts`): Kata bypasses pi's `main()` and calls `createAgentSession()` directly, which means pi's two-pass argv parsing (that normally populates `runtime.flagValues`) never runs. Two things compensate:
114
+ - `loader.ts` pushes `--mcp-config ~/.kata-cli/agent/mcp.json` into `process.argv` — the adapter reads this at extension load time for `directTools` registration.
115
+ - `cli.ts` manually sets `runtime.flagValues.set('mcp-config', ...)` after `resourceLoader.reload()` — the adapter reads this via `pi.getFlag('mcp-config')` at `session_start` for the main initialization.
116
+
117
+ 3. **Config scaffolding** (`resource-loader.ts`): Creates a starter `~/.kata-cli/agent/mcp.json` on first launch. Never overwrites existing config.
118
+
119
+ ### Configuring MCP servers
120
+
121
+ Edit `~/.kata-cli/agent/mcp.json` to add servers. Servers can use **stdio** (local process) or **HTTP** (remote endpoint) transport.
122
+
123
+ #### Stdio servers (local process)
124
+
125
+ Most MCP servers run as a local process via `npx`:
126
+
127
+ ```json
128
+ {
129
+ "mcpServers": {
130
+ "my-server": {
131
+ "command": "npx",
132
+ "args": ["-y", "some-mcp-server"],
133
+ "env": {
134
+ "API_KEY": "${MY_API_KEY}"
135
+ }
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ Environment variables support `${VAR}` interpolation from `process.env`.
142
+
143
+ #### HTTP servers with OAuth (e.g. Linear)
144
+
145
+ Many hosted MCP servers (Linear, Figma, etc.) use OAuth 2.1 authentication via the MCP spec. These require [`mcp-remote`](https://github.com/geelen/mcp-remote) as a stdio proxy that handles the OAuth browser flow:
146
+
147
+ ```json
148
+ {
149
+ "mcpServers": {
150
+ "linear": {
151
+ "command": "npx",
152
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"]
153
+ }
154
+ }
155
+ }
156
+ ```
157
+
158
+ On first connection, `mcp-remote` opens a browser window for OAuth consent. Tokens are cached in `~/.mcp-auth/` for subsequent sessions.
159
+
160
+ **Linear MCP setup (complete example):**
161
+
162
+ 1. Add the server to `~/.kata-cli/agent/mcp.json`:
163
+ ```json
164
+ {
165
+ "settings": { "toolPrefix": "server", "idleTimeout": 10 },
166
+ "mcpServers": {
167
+ "linear": {
168
+ "command": "npx",
169
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/mcp"]
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ 2. Restart Kata.
176
+
177
+ 3. Connect the server (triggers the OAuth flow in your browser):
178
+ ```
179
+ mcp({ connect: "linear" })
180
+ ```
181
+
182
+ 4. Authorize Kata in the browser when prompted by Linear.
183
+
184
+ 5. Use Linear tools:
185
+ ```
186
+ mcp({ server: "linear" }) — list all Linear tools
187
+ mcp({ search: "issues" }) — search for issue-related tools
188
+ mcp({ tool: "linear_list_teams" }) — call a specific tool
189
+ ```
190
+
191
+ **Troubleshooting OAuth:**
192
+ - If you see `internal server error`, clear cached auth: `rm -rf ~/.mcp-auth` and reconnect.
193
+ - Make sure you're running a recent version of Node.js.
194
+ - Use `/mcp` to check server status interactively.
195
+
196
+ #### HTTP servers with bearer token auth
197
+
198
+ For servers that accept API keys or personal access tokens:
199
+
200
+ ```json
201
+ {
202
+ "mcpServers": {
203
+ "my-api": {
204
+ "url": "https://api.example.com/mcp",
205
+ "auth": "bearer",
206
+ "bearerTokenEnv": "MY_API_KEY"
207
+ }
208
+ }
209
+ }
210
+ ```
211
+
212
+ #### Importing existing configs
213
+
214
+ Pull in your existing Claude Code, Cursor, or VS Code MCP configuration:
215
+
216
+ ```json
217
+ {
218
+ "imports": ["claude-code", "cursor"],
219
+ "mcpServers": {}
220
+ }
221
+ ```
222
+
223
+ Supported sources: `cursor`, `claude-code`, `claude-desktop`, `vscode`, `windsurf`, `codex`.
224
+
225
+ ### Server lifecycle
226
+
227
+ | Mode | Behavior |
228
+ |------|----------|
229
+ | `lazy` (default) | Connect on first tool call. Disconnect after idle timeout. Cached metadata keeps search/list working offline. |
230
+ | `eager` | Connect at startup. No auto-reconnect on drop. |
231
+ | `keep-alive` | Connect at startup. Auto-reconnect via health checks. |
232
+
233
+ ### Usage
234
+
235
+ ```
236
+ mcp({ }) — show server status
237
+ mcp({ server: "linear" }) — list tools from a server
238
+ mcp({ search: "issues create" }) — search tools (space-separated words OR'd)
239
+ mcp({ describe: "linear_save_issue" }) — show tool parameters
240
+ mcp({ tool: "linear_list_teams" }) — call a tool (no args)
241
+ mcp({ tool: "linear_save_issue", args: '{"title": "Bug fix"}' }) — call with args (JSON string)
242
+ mcp({ connect: "linear" }) — force connect/reconnect a server
243
+ /mcp — interactive panel (status, tools, reconnect, OAuth)
244
+ ```
245
+
246
+ ### Known limitations
247
+
248
+ - **OAuth servers require `mcp-remote`**: The adapter doesn't implement the MCP OAuth browser flow natively. Use `mcp-remote` as a stdio proxy for any server that requires OAuth (Linear, Figma remote, etc.).
249
+ - **Figma remote MCP (`mcp.figma.com`)**: Blocks dynamic client registration — only whitelisted clients (Cursor, Claude Code, VS Code) can connect via OAuth. Use the Figma desktop app's local MCP server instead (`http://127.0.0.1:3845/mcp`), which requires Figma desktop with Dev Mode (paid plan).
250
+ - **Metadata cache path**: `pi-mcp-adapter` caches tool metadata to `~/.pi/agent/mcp-cache.json` (hardcoded). This doesn't affect functionality — just means the cache lives outside Kata's config dir.
251
+ - **OAuth token storage**: `mcp-remote` stores tokens in `~/.mcp-auth/`, separate from Kata's config dir.
252
+
102
253
  ## Key Conventions
103
254
 
104
255
  - All env var names use `KATA_` prefix (not `GSD_` or `PI_`)
@@ -106,3 +257,4 @@ Kata stores project state in `.kata/` at the project root:
106
257
  - Extensions are synced from `src/resources/extensions/` to `~/.kata-cli/agent/extensions/` on every launch
107
258
  - The `shared/` extension directory is a library, not an entry point — it's imported by other extensions
108
259
  - Branch naming for workflow: `kata/M001/S01` (milestone/slice)
260
+ - MCP config lives at `~/.kata-cli/agent/mcp.json` (not `~/.pi/agent/mcp.json`)
@@ -1,6 +1,6 @@
1
1
  # Kata Preferences Reference
2
2
 
3
- Full documentation for `~/.kata/preferences.md` (global) and `.kata/preferences.md` (project).
3
+ Full documentation for `~/.kata-cli/preferences.md` (global) and `.kata/preferences.md` (project).
4
4
 
5
5
  ---
6
6
 
@@ -132,7 +132,7 @@ auto_supervisor: {}
132
132
 
133
133
  Project-specific guidance for skill selection and execution preferences.
134
134
 
135
- See \`~/.kata/agent/extensions/kata/docs/preferences-reference.md\` for full field documentation and examples.
135
+ See \`~/.kata-cli/agent/extensions/kata/docs/preferences-reference.md\` for full field documentation and examples.
136
136
 
137
137
  ## Fields
138
138
 
@@ -122,7 +122,7 @@ export interface SkillResolutionReport {
122
122
 
123
123
  /**
124
124
  * Known skill directories, in priority order.
125
- * User skills (~/.kata/agent/skills/) take precedence over project skills.
125
+ * User skills (~/.kata-cli/agent/skills/) take precedence over project skills.
126
126
  */
127
127
  function getSkillSearchDirs(
128
128
  cwd: string,
@@ -398,8 +398,9 @@ function parseFrontmatterBlock(frontmatter: string): KataPreferences {
398
398
  const valuePart = remainder.trim();
399
399
 
400
400
  if (valuePart === "") {
401
- const nextLine = lines[i + 1] ?? "";
402
- const nextTrimmed = nextLine.trim();
401
+ const nextNonEmptyLine =
402
+ lines.slice(i + 1).find((candidate) => candidate.trim() !== "") ?? "";
403
+ const nextTrimmed = nextNonEmptyLine.trim();
403
404
  if (nextTrimmed.startsWith("- ")) {
404
405
  const items: unknown[] = [];
405
406
  let j = i + 1;
@@ -481,9 +482,16 @@ function parseFrontmatterBlock(frontmatter: string): KataPreferences {
481
482
  current[key] = items;
482
483
  i = j - 1;
483
484
  } else {
484
- const obj: Record<string, unknown> = {};
485
- current[key] = obj;
486
- stack.push({ indent, value: obj });
485
+ // Check if the next non-empty line is actually indented deeper (a real nested block).
486
+ // If not, this key simply has no value — skip it rather than creating an empty object.
487
+ const nextIndent =
488
+ nextNonEmptyLine.match(/^\s*/)?.[0].length ?? indent;
489
+ if (nextIndent > indent) {
490
+ const obj: Record<string, unknown> = {};
491
+ current[key] = obj;
492
+ stack.push({ indent, value: obj });
493
+ }
494
+ // else: key with no value and no nested block — leave it undefined
487
495
  }
488
496
  continue;
489
497
  }
@@ -494,9 +502,13 @@ function parseFrontmatterBlock(frontmatter: string): KataPreferences {
494
502
  return root as KataPreferences;
495
503
  }
496
504
 
497
- function parseScalar(value: string): string | number | boolean {
505
+ function parseScalar(
506
+ value: string,
507
+ ): string | number | boolean | unknown[] | Record<string, never> {
498
508
  if (value === "true") return true;
499
509
  if (value === "false") return false;
510
+ if (value === "[]") return [];
511
+ if (value === "{}") return {};
500
512
  if (/^-?\d+$/.test(value)) return Number(value);
501
513
  return value.replace(/^['\"]|['\"]$/g, "");
502
514
  }
@@ -7,7 +7,7 @@ All relevant context has been preloaded below — the roadmap, all slice summari
7
7
  {{inlinedContext}}
8
8
 
9
9
  Then:
10
- 1. Read the milestone-summary template at `~/.kata/agent/extensions/kata/templates/milestone-summary.md`
10
+ 1. Read the milestone-summary template at `~/.kata-cli/agent/extensions/kata/templates/milestone-summary.md`
11
11
  2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules
12
12
  3. Verify each **success criterion** from the milestone definition in `{{roadmapPath}}`. For each criterion, confirm it was met with specific evidence from slice summaries, test results, or observable behavior. List any criterion that was NOT met.
13
13
  4. Verify the milestone's **definition of done** — all slices are `[x]`, all slice summaries exist, and any cross-slice integration points work correctly.
@@ -8,8 +8,8 @@ All relevant context has been preloaded below — the slice plan, all task summa
8
8
 
9
9
  Then:
10
10
  1. Read the templates:
11
- - `~/.kata/agent/extensions/kata/templates/slice-summary.md`
12
- - `~/.kata/agent/extensions/kata/templates/uat.md`
11
+ - `~/.kata-cli/agent/extensions/kata/templates/slice-summary.md`
12
+ - `~/.kata-cli/agent/extensions/kata/templates/uat.md`
13
13
  2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules
14
14
  3. Run all slice-level verification checks defined in the slice plan. All must pass before marking the slice done. If any fail, fix them first.
15
15
  4. Confirm the slice's observability/diagnostic surfaces are real and useful where relevant: status inspection works, failure state is externally visible, structured errors/logs are actionable, and hidden failures are not being mistaken for success.
@@ -126,11 +126,11 @@ Directories use bare IDs. Files use ID-SUFFIX format. Titles live inside file co
126
126
 
127
127
  Once the user is satisfied, in a single pass:
128
128
  1. `mkdir -p .kata/milestones/{{milestoneId}}/slices`
129
- 2. Write or update `.kata/PROJECT.md` — read the template at `~/.kata/agent/extensions/kata/templates/project.md` first. Describe what the project is, its current state, and list the milestone sequence.
130
- 3. Write or update `.kata/REQUIREMENTS.md` — read the template at `~/.kata/agent/extensions/kata/templates/requirements.md` first. Confirm requirement states, ownership, and traceability before roadmap creation.
131
- 4. Write `{{contextAbsPath}}` — read the template at `~/.kata/agent/extensions/kata/templates/context.md` first. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
132
- 5. Write `{{roadmapAbsPath}}` — read the template at `~/.kata/agent/extensions/kata/templates/roadmap.md` first. Decompose into demoable vertical slices with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment.
133
- 6. Seed `.kata/DECISIONS.md` — read the template at `~/.kata/agent/extensions/kata/templates/decisions.md` first. Append rows for any architectural or pattern decisions made during discussion.
129
+ 2. Write or update `.kata/PROJECT.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/project.md` first. Describe what the project is, its current state, and list the milestone sequence.
130
+ 3. Write or update `.kata/REQUIREMENTS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/requirements.md` first. Confirm requirement states, ownership, and traceability before roadmap creation.
131
+ 4. Write `{{contextAbsPath}}` — read the template at `~/.kata-cli/agent/extensions/kata/templates/context.md` first. Preserve key risks, unknowns, existing codebase constraints, integration points, and relevant requirements surfaced during discussion.
132
+ 5. Write `{{roadmapAbsPath}}` — read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md` first. Decompose into demoable vertical slices with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, requirement coverage, and a boundary map. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment.
133
+ 6. Seed `.kata/DECISIONS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` first. Append rows for any architectural or pattern decisions made during discussion.
134
134
  7. Update `.kata/STATE.md`
135
135
  8. Commit: `docs({{milestoneId}}): context, requirements, and roadmap`
136
136
 
@@ -140,8 +140,8 @@ After writing the files and committing, say exactly: "Milestone {{milestoneId}}
140
140
 
141
141
  Once the user confirms the milestone split, in a single pass:
142
142
  1. `mkdir -p .kata/milestones/{{milestoneId}}/slices` for each milestone
143
- 2. Write `.kata/PROJECT.md` — read the template at `~/.kata/agent/extensions/kata/templates/project.md` first.
144
- 3. Write `.kata/REQUIREMENTS.md` — read the template at `~/.kata/agent/extensions/kata/templates/requirements.md` first. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
143
+ 2. Write `.kata/PROJECT.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/project.md` first.
144
+ 3. Write `.kata/REQUIREMENTS.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/requirements.md` first. Capture Active, Deferred, Out of Scope, and any already Validated requirements. Later milestones may have provisional ownership where slice plans do not exist yet.
145
145
  4. Write a `CONTEXT.md` for **every** milestone — capture the intent, scope, risks, constraints, user-visible outcome, completion class, final integrated acceptance, and relevant requirements for each. Each future milestone's CONTEXT.md should be rich enough that a planning agent encountering it fresh — with no memory of this conversation — can understand the intent, constraints, dependencies, what this milestone unlocks, and what "done" looks like.
146
146
  5. Write a `ROADMAP.md` for **only the first milestone** — detail-planning later milestones now is waste because the codebase will change. Include requirement coverage and a milestone definition of done.
147
147
  6. Seed `.kata/DECISIONS.md`.
@@ -50,8 +50,8 @@ Then:
50
50
  - Know when to stop. If you've tried 3+ fixes without progress, your mental model is probably wrong. Stop. List what you know for certain. List what you've ruled out. Form fresh hypotheses from there.
51
51
  - Don't fix symptoms. Understand *why* something fails before changing code. A test that passes after a change you don't understand is luck, not a fix.
52
52
  11. **Blocker discovery:** If execution reveals that the remaining slice plan is fundamentally invalid — not just a bug or minor deviation, but a plan-invalidating finding like a wrong API, missing capability, or architectural mismatch — set `blocker_discovered: true` in the task summary frontmatter and describe the blocker clearly in the summary narrative. Do NOT set `blocker_discovered: true` for ordinary debugging, minor deviations, or issues that can be fixed within the current task or the remaining plan. This flag triggers an automatic replan of the slice.
53
- 12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.kata/DECISIONS.md` (read the template at `~/.kata/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
54
- 13. Read the template at `~/.kata/agent/extensions/kata/templates/task-summary.md`
53
+ 12. If you made an architectural, pattern, library, or observability decision during this task that downstream work should know about, append it to `.kata/DECISIONS.md` (read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet). Not every task produces decisions — only append when a meaningful choice was made.
54
+ 13. Read the template at `~/.kata-cli/agent/extensions/kata/templates/task-summary.md`
55
55
  14. Write `{{taskSummaryAbsPath}}`
56
56
  15. Mark {{taskId}} done in `{{planPath}}` (change `[ ]` to `[x]`)
57
57
  16. Commit your work: `git add -A && git commit -m 'feat({{sliceId}}/{{taskId}}): <what was built>'`. If `git add` silently fails to stage files (a known git worktree stat-cache bug), use this workaround per file: `git update-index --cacheinfo 100644,$(git hash-object -w <file>),<file>` then commit. If that also fails, move on — the system will auto-commit remaining changes after your session ends.
@@ -1 +1 @@
1
- Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. All tasks are done. Read the templates at `~/.kata/agent/extensions/kata/templates/slice-summary.md` and `uat.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules. Write `{{sliceId}}-SUMMARY.md` (compress task summaries), write `{{sliceId}}-UAT.md`, and fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.kata/DECISIONS.md`. Mark the slice checkbox done in the roadmap, update STATE.md, update milestone summary, and leave the slice branch clean for the extension to squash-merge back to main automatically.
1
+ Complete slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. All tasks are done. Read the templates at `~/.kata-cli/agent/extensions/kata/templates/slice-summary.md` and `uat.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during completion, without relaxing required verification or artifact rules. Write `{{sliceId}}-SUMMARY.md` (compress task summaries), write `{{sliceId}}-UAT.md`, and fill the `UAT Type` plus `Not Proven By This UAT` sections explicitly so the artifact states what class of acceptance it covers and what still remains unproven. Review task summaries for `key_decisions` and ensure any significant ones are in `.kata/DECISIONS.md`. Mark the slice checkbox done in the roadmap, update STATE.md, update milestone summary, and leave the slice branch clean for the extension to squash-merge back to main automatically.
@@ -1,3 +1,3 @@
1
- Discuss milestone {{milestoneId}} ("{{milestoneTitle}}"). Identify gray areas, ask the user about them, and write `{{milestoneId}}-CONTEXT.md` in the milestone directory with the decisions. Read the template at `~/.kata/agent/extensions/kata/templates/context.md` first. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow; do not override required artifact rules.
1
+ Discuss milestone {{milestoneId}} ("{{milestoneTitle}}"). Identify gray areas, ask the user about them, and write `{{milestoneId}}-CONTEXT.md` in the milestone directory with the decisions. Read the template at `~/.kata-cli/agent/extensions/kata/templates/context.md` first. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow; do not override required artifact rules.
2
2
 
3
3
  **Investigate between question rounds to make your questions smarter.** Before each round of questions, do enough lightweight research that your questions are grounded in reality — not guesses about what exists or what's possible. Check library docs (`resolve_library`/`get_library_docs`) when tech choices are relevant, search the web (`search-the-web` with `freshness`/`domain` filters, then `fetch_page` for full content) to verify the landscape, scout the codebase (`rg`, `find`, `scout`) to understand what already exists. Don't go deep — just enough that your next question reflects what's actually true. The goal is to ask questions the user can't answer by saying "did you check the docs?" or "look at the code."
@@ -45,7 +45,7 @@ If the user wants to keep going, keep asking. Stop when they say wrap up.
45
45
 
46
46
  Once the user is ready to wrap up:
47
47
 
48
- 1. Read the slice context template at `~/.kata/agent/extensions/kata/templates/slice-context.md`
48
+ 1. Read the slice context template at `~/.kata-cli/agent/extensions/kata/templates/slice-context.md`
49
49
  2. `mkdir -p {{sliceDirAbsPath}}`
50
50
  3. Write `{{contextAbsPath}}` — use the template structure, filling in:
51
51
  - **Goal** — one sentence: what this slice delivers
@@ -1 +1 @@
1
- Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.kata/DECISIONS.md`. Read the template at `~/.kata/agent/extensions/kata/templates/task-summary.md`. Write `{{taskId}}-SUMMARY.md`, mark it done, commit, and advance. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules. If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
1
+ Execute the next task: {{taskId}} ("{{taskTitle}}") in slice {{sliceId}} of milestone {{milestoneId}}. Read the task plan (`{{taskId}}-PLAN.md`), load relevant summaries from prior tasks, and execute each step. Verify must-haves when done. If the task touches UI, browser flows, DOM behavior, or user-visible web state, exercise the real flow in the browser, prefer `browser_batch` for obvious sequences, prefer `browser_assert` for explicit pass/fail verification, use `browser_diff` when an action's effect is ambiguous, and use browser diagnostics when validating async or failure-prone UI. If you made an architectural, pattern, or library decision, append it to `.kata/DECISIONS.md`. Read the template at `~/.kata-cli/agent/extensions/kata/templates/task-summary.md`. Write `{{taskId}}-SUMMARY.md`, mark it done, commit, and advance. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during execution, without relaxing required verification or artifact rules. If running long and not all steps are finished, stop implementing and prioritize writing a clean partial summary over attempting one more step — a recoverable handoff is more valuable than a half-finished step with no documentation. If verification fails, debug methodically: form a hypothesis and test that specific theory before changing anything, change one variable at a time, read entire functions not just the suspect line, distinguish observable facts from assumptions, and if 3+ fixes fail without progress stop and reassess your mental model — list what you know for certain, what you've ruled out, and form fresh hypotheses. Don't fix symptoms — understand why something fails before changing code.
@@ -1,4 +1,4 @@
1
- Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Read the template at `~/.kata/agent/extensions/kata/templates/roadmap.md`. Create `{{milestoneId}}-ROADMAP.md` in the milestone directory with slices, risk levels, dependencies, demo sentences, verification classes, milestone definition of done, requirement coverage, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. If planning produces structural decisions, append them to `.kata/DECISIONS.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting.
1
+ Plan milestone {{milestoneId}} ("{{milestoneTitle}}"). Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists and treat Active requirements as the capability contract. If `REQUIREMENTS.md` is missing, continue in legacy compatibility mode but explicitly note missing requirement coverage. Read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md`. Create `{{milestoneId}}-ROADMAP.md` in the milestone directory with slices, risk levels, dependencies, demo sentences, verification classes, milestone definition of done, requirement coverage, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment. If planning produces structural decisions, append them to `.kata/DECISIONS.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting.
2
2
 
3
3
  ## Requirement Rules
4
4
 
@@ -1 +1 @@
1
- Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Read the templates at `~/.kata/agent/extensions/kata/templates/plan.md` and `task-plan.md`. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.kata/decisions.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting. Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
1
+ Plan slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements the roadmap says this slice owns or supports, and ensure the plan delivers them. Read the roadmap boundary map, any existing context/research files, and dependency summaries. Read the templates at `~/.kata-cli/agent/extensions/kata/templates/plan.md` and `task-plan.md`. Decompose into tasks with must-haves. Fill the `Proof Level` and `Integration Closure` sections truthfully so the plan says what class of proof this slice really delivers and what end-to-end wiring still remains. Write `{{sliceId}}-PLAN.md` and individual `T##-PLAN.md` files in the `tasks/` subdirectory. If planning produces structural decisions, append them to `.kata/decisions.md`. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting. Before committing, self-audit the plan: every must-have maps to at least one task, every task has complete sections (steps, must-haves, verification, observability impact, inputs, and expected output), task ordering is consistent with no circular references, every pair of artifacts that must connect has an explicit wiring step, task scope targets 2–5 steps and 3–8 files (6–8 steps or 8–10 files — consider splitting; 10+ steps or 12+ files — must split), the plan honors locked decisions from context/research/decisions artifacts, the proof-level wording does not overclaim live integration if only fixture/contract proof is planned, every Active requirement this slice owns has at least one task with verification that proves it is met, and every task produces real user-facing progress — if the slice has a UI surface at least one task builds the real UI, if it has an API at least one task connects it to a real data source, and showing the completed result to a non-technical stakeholder would demonstrate real product progress rather than developer artifacts.
@@ -1,4 +1,4 @@
1
- Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules. Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs`. Read the template at `~/.kata/agent/extensions/kata/templates/research.md`. Write `{{sliceId}}-RESEARCH.md` in the slice directory with summary, don't-hand-roll, common pitfalls, and relevant code sections.
1
+ Research slice {{sliceId}} ("{{sliceTitle}}") of milestone {{milestoneId}}. Read `.kata/DECISIONS.md` if it exists — respect existing decisions, don't contradict them. Read `.kata/REQUIREMENTS.md` if it exists — identify which Active requirements this slice owns or supports and target research toward risks, unknowns, and constraints that could affect delivery of those requirements. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during research, without relaxing required verification or artifact rules. Explore the relevant code — use `rg`/`find` for targeted reads, or `scout` if the area is broad or unfamiliar. Check libraries with `resolve_library`/`get_library_docs`. Read the template at `~/.kata-cli/agent/extensions/kata/templates/research.md`. Write `{{sliceId}}-RESEARCH.md` in the slice directory with summary, don't-hand-roll, common pitfalls, and relevant code sections.
2
2
 
3
3
  ## Strategic Questions to Answer
4
4
 
@@ -7,13 +7,13 @@ All relevant context has been preloaded below — start working immediately with
7
7
  {{inlinedContext}}
8
8
 
9
9
  Then:
10
- 1. Read the template at `~/.kata/agent/extensions/kata/templates/roadmap.md`
10
+ 1. Read the template at `~/.kata-cli/agent/extensions/kata/templates/roadmap.md`
11
11
  2. Read `.kata/REQUIREMENTS.md` if it exists. Treat **Active** requirements as the capability contract for planning. If it does not exist, continue in legacy compatibility mode but explicitly note that requirement coverage is operating without a contract.
12
12
  3. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required roadmap formatting
13
13
  4. Create the roadmap: decompose into demoable vertical slices — as many as the work needs, no more
14
14
  5. Order by risk (high-risk first)
15
15
  6. Write `{{outputPath}}` with checkboxes, risk, depends, demo sentences, proof strategy, verification classes, milestone definition of done, **requirement coverage**, and a boundary map. Write success criteria as observable truths, not implementation tasks. If the milestone crosses multiple runtime boundaries, include an explicit final integration slice that proves the assembled system works end-to-end in a real environment
16
- 7. If planning produced structural decisions (e.g. slice ordering rationale, technology choices, scope exclusions), append them to `.kata/DECISIONS.md` (read the template at `~/.kata/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet)
16
+ 7. If planning produced structural decisions (e.g. slice ordering rationale, technology choices, scope exclusions), append them to `.kata/DECISIONS.md` (read the template at `~/.kata-cli/agent/extensions/kata/templates/decisions.md` if the file doesn't exist yet)
17
17
  8. Update `.kata/STATE.md`
18
18
 
19
19
  ## Requirement Mapping Rules
@@ -15,8 +15,8 @@ Pay particular attention to **Forward Intelligence** sections — they contain h
15
15
  Then:
16
16
  0. If `REQUIREMENTS.md` was preloaded above, identify which Active requirements the roadmap says this slice owns or supports. These are the requirements this plan must deliver — every owned requirement needs at least one task that directly advances it, and verification must prove the requirement is met.
17
17
  1. Read the templates:
18
- - `~/.kata/agent/extensions/kata/templates/plan.md`
19
- - `~/.kata/agent/extensions/kata/templates/task-plan.md`
18
+ - `~/.kata-cli/agent/extensions/kata/templates/plan.md`
19
+ - `~/.kata-cli/agent/extensions/kata/templates/task-plan.md`
20
20
  2. If a `Kata Skill Preferences` block is present in system context, use it to decide which skills to load and follow during planning, without overriding required plan formatting
21
21
  3. Define slice-level verification first — the objective stopping condition for this slice:
22
22
  - For non-trivial slices: plan actual test files with real assertions. Name the files. The first task creates them (initially failing). Remaining tasks make them pass.
@@ -69,7 +69,7 @@ Determine where the new milestones should go in the overall sequence. Consider d
69
69
  Once the user is satisfied, in a single pass for **each** new milestone (starting from {{nextId}}):
70
70
 
71
71
  1. `mkdir -p .kata/milestones/<ID>/slices`
72
- 2. Write `.kata/milestones/<ID>/<ID>-CONTEXT.md` — read the template at `~/.kata/agent/extensions/kata/templates/context.md` first. Capture intent, scope, risks, constraints, integration points, and relevant requirements. Mark the status as "Queued — pending auto-mode execution."
72
+ 2. Write `.kata/milestones/<ID>/<ID>-CONTEXT.md` — read the template at `~/.kata-cli/agent/extensions/kata/templates/context.md` first. Capture intent, scope, risks, constraints, integration points, and relevant requirements. Mark the status as "Queued — pending auto-mode execution."
73
73
 
74
74
  Then, after all milestone directories and context files are written:
75
75
 
@@ -11,7 +11,7 @@ Then research the codebase and relevant technologies:
11
11
  2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
12
12
  3. Explore relevant code. For small/familiar codebases, use `rg`, `find`, and targeted reads. For large or unfamiliar codebases, use `scout` to build a broad map efficiently before diving in.
13
13
  4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries
14
- 5. Read the template at `~/.kata/agent/extensions/kata/templates/research.md`
14
+ 5. Read the template at `~/.kata-cli/agent/extensions/kata/templates/research.md`
15
15
  6. If `.kata/REQUIREMENTS.md` exists, research against it. Identify which Active requirements are table stakes, likely omissions, overbuilt risks, or domain-standard behaviors the user may or may not want.
16
16
  7. Write `{{outputPath}}` with:
17
17
  - Summary (2-3 paragraphs, primary recommendation)
@@ -18,7 +18,7 @@ Then research what this slice needs:
18
18
  2. **Skill Discovery ({{skillDiscoveryMode}}):**{{skillDiscoveryInstructions}}
19
19
  3. Explore relevant code for this slice's scope. For targeted exploration, use `rg`, `find`, and reads. For broad or unfamiliar subsystems, use `scout` to map the relevant area first.
20
20
  4. Use `resolve_library` / `get_library_docs` for unfamiliar libraries
21
- 5. Read the template at `~/.kata/agent/extensions/kata/templates/research.md`
21
+ 5. Read the template at `~/.kata-cli/agent/extensions/kata/templates/research.md`
22
22
  6. Write `{{outputPath}}`
23
23
 
24
24
  The slice directory already exists at `{{slicePath}}/`. Do NOT mkdir — just write the file.
@@ -12,9 +12,9 @@ Kata ships with bundled skills. Load the relevant skill file with the `read` too
12
12
 
13
13
  | Trigger | Skill to load |
14
14
  | ------------------------------------------------------------------------------------------------ | ------------------------------------------------- |
15
- | Frontend UI — web components, pages, landing pages, dashboards, React/HTML/CSS, styling | `~/.kata/agent/skills/frontend-design/SKILL.md` |
16
- | macOS or iOS apps — SwiftUI, Xcode, App Store | `~/.kata/agent/skills/swiftui/SKILL.md` |
17
- | Debugging — complex bugs, failing tests, root-cause investigation after standard approaches fail | `~/.kata/agent/skills/debug-like-expert/SKILL.md` |
15
+ | Frontend UI — web components, pages, landing pages, dashboards, React/HTML/CSS, styling | `~/.kata-cli/agent/skills/frontend-design/SKILL.md` |
16
+ | macOS or iOS apps — SwiftUI, Xcode, App Store | `~/.kata-cli/agent/skills/swiftui/SKILL.md` |
17
+ | Debugging — complex bugs, failing tests, root-cause investigation after standard approaches fail | `~/.kata-cli/agent/skills/debug-like-expert/SKILL.md` |
18
18
 
19
19
  ## Hard Rules
20
20
 
@@ -84,7 +84,7 @@ Titles live inside file content (headings, frontmatter), not in file or director
84
84
  ### Artifact Templates
85
85
 
86
86
  Templates showing the expected format for each artifact type are in:
87
- `~/.kata/agent/extensions/kata/templates/`
87
+ `~/.kata-cli/agent/extensions/kata/templates/`
88
88
 
89
89
  **Always read the relevant template before writing an artifact** to match the expected structure exactly. The parsers that read these files depend on specific formatting:
90
90
 
@@ -12,4 +12,4 @@ auto_supervisor: {}
12
12
 
13
13
  # Kata Skill Preferences
14
14
 
15
- See `~/.kata/agent/extensions/kata/docs/preferences-reference.md` for full field documentation and examples.
15
+ See `~/.kata-cli/agent/extensions/kata/docs/preferences-reference.md` for full field documentation and examples.
@@ -9,7 +9,7 @@ import { join, dirname } from "node:path";
9
9
  import { tmpdir } from "node:os";
10
10
  import { fileURLToPath } from "node:url";
11
11
 
12
- // loadPrompt reads from ~/.kata/agent/extensions/kata/prompts/ (main checkout).
12
+ // loadPrompt reads from ~/.kata-cli/agent/extensions/kata/prompts/ (main checkout).
13
13
  // In a worktree the file may not exist there yet, so we resolve prompts
14
14
  // relative to this test file's location (the worktree copy).
15
15
  const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -0,0 +1,53 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { execFileSync } from 'node:child_process';
4
+ import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
5
+ import { tmpdir } from 'node:os';
6
+ import { join } from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
8
+
9
+ const resolveTsHookPath = fileURLToPath(new URL('./resolve-ts.mjs', import.meta.url));
10
+ const preferencesPath = fileURLToPath(new URL('../preferences.ts', import.meta.url));
11
+
12
+ test('loadEffectiveKataPreferences preserves blank-line-separated skill_rules lists', () => {
13
+ const tmp = mkdtempSync(join(tmpdir(), 'kata-preferences-frontmatter-'));
14
+ const kataDir = join(tmp, '.kata');
15
+ mkdirSync(kataDir, { recursive: true });
16
+ writeFileSync(
17
+ join(kataDir, 'preferences.md'),
18
+ `---
19
+ skill_rules:
20
+
21
+ - when: build
22
+ use:
23
+ - test-driven-development
24
+ ---
25
+ `,
26
+ );
27
+
28
+ const script = `
29
+ import { loadEffectiveKataPreferences } from ${JSON.stringify(preferencesPath)};
30
+ const prefs = loadEffectiveKataPreferences();
31
+ console.log(JSON.stringify(prefs?.preferences.skill_rules ?? null));
32
+ `;
33
+
34
+ const output = execFileSync(
35
+ 'node',
36
+ ['--import', resolveTsHookPath, '--experimental-strip-types', '-e', script],
37
+ {
38
+ cwd: tmp,
39
+ env: {
40
+ ...process.env,
41
+ HOME: tmp,
42
+ },
43
+ encoding: 'utf-8',
44
+ },
45
+ ).trim();
46
+
47
+ assert.deepEqual(JSON.parse(output), [
48
+ {
49
+ when: 'build',
50
+ use: ['test-driven-development'],
51
+ },
52
+ ]);
53
+ });
@@ -2,7 +2,7 @@ import { readFileSync } from "node:fs";
2
2
  import { join, dirname } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
 
5
- // loadPrompt reads from ~/.kata/agent/extensions/kata/prompts/ (main checkout).
5
+ // loadPrompt reads from ~/.kata-cli/agent/extensions/kata/prompts/ (main checkout).
6
6
  // In a worktree the file may not exist there yet, so we resolve prompts
7
7
  // relative to this test file's location (the worktree copy).
8
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -273,66 +273,66 @@ function sendPrompt(
273
273
  : "";
274
274
 
275
275
  const docHints: string[] = [
276
- "- `~/.kata/agent/docs/extending-pi/01-what-are-extensions.md` — capabilities overview",
277
- "- `~/.kata/agent/docs/extending-pi/03-getting-started.md` — minimal extension, hot reload",
278
- "- `~/.kata/agent/docs/extending-pi/08-extensioncontext-what-you-can-access.md` — ExtensionContext API",
279
- "- `~/.kata/agent/docs/extending-pi/09-extensionapi-what-you-can-do.md` — ExtensionAPI: registration, messaging",
280
- "- `~/.kata/agent/docs/extending-pi/22-key-rules-gotchas.md` — must-read rules before shipping",
276
+ "- `~/.kata-cli/agent/docs/extending-pi/01-what-are-extensions.md` — capabilities overview",
277
+ "- `~/.kata-cli/agent/docs/extending-pi/03-getting-started.md` — minimal extension, hot reload",
278
+ "- `~/.kata-cli/agent/docs/extending-pi/08-extensioncontext-what-you-can-access.md` — ExtensionContext API",
279
+ "- `~/.kata-cli/agent/docs/extending-pi/09-extensionapi-what-you-can-do.md` — ExtensionAPI: registration, messaging",
280
+ "- `~/.kata-cli/agent/docs/extending-pi/22-key-rules-gotchas.md` — must-read rules before shipping",
281
281
  ];
282
282
 
283
283
  if (uiSelected.includes("custom component")) {
284
284
  docHints.push(
285
- "- `~/.kata/agent/docs/extending-pi/12-custom-ui-visual-components.md` — dialogs, widgets, overlays",
285
+ "- `~/.kata-cli/agent/docs/extending-pi/12-custom-ui-visual-components.md` — dialogs, widgets, overlays",
286
286
  );
287
287
  docHints.push(
288
- "- `~/.kata/agent/docs/pi-ui-tui/06-ctx-ui-custom-full-custom-components.md` — ctx.ui.custom() API",
288
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/06-ctx-ui-custom-full-custom-components.md` — ctx.ui.custom() API",
289
289
  );
290
290
  docHints.push(
291
- "- `~/.kata/agent/docs/pi-ui-tui/07-built-in-components-the-building-blocks.md` — Text, Box, SelectList",
291
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/07-built-in-components-the-building-blocks.md` — Text, Box, SelectList",
292
292
  );
293
293
  docHints.push(
294
- "- `~/.kata/agent/docs/pi-ui-tui/09-keyboard-input-how-to-handle-keys.md` — Key, matchesKey",
294
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/09-keyboard-input-how-to-handle-keys.md` — Key, matchesKey",
295
295
  );
296
296
  docHints.push(
297
- "- `~/.kata/agent/docs/pi-ui-tui/10-line-width-the-cardinal-rule.md` — truncation, width rules",
297
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/10-line-width-the-cardinal-rule.md` — truncation, width rules",
298
298
  );
299
299
  docHints.push(
300
- "- `~/.kata/agent/docs/pi-ui-tui/19-building-a-complete-component-step-by-step.md` — step-by-step guide",
300
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/19-building-a-complete-component-step-by-step.md` — step-by-step guide",
301
301
  );
302
302
  docHints.push(
303
- "- `~/.kata/agent/docs/pi-ui-tui/21-common-mistakes-and-how-to-avoid-them.md` — pitfalls",
303
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/21-common-mistakes-and-how-to-avoid-them.md` — pitfalls",
304
304
  );
305
305
  } else if (uiSelected.includes("Dialogs")) {
306
306
  docHints.push(
307
- "- `~/.kata/agent/docs/pi-ui-tui/04-built-in-dialog-methods.md` — select, confirm, input, editor",
307
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/04-built-in-dialog-methods.md` — select, confirm, input, editor",
308
308
  );
309
309
  } else if (uiSelected.includes("Status")) {
310
310
  docHints.push(
311
- "- `~/.kata/agent/docs/pi-ui-tui/05-persistent-ui-elements.md` — status, widgets, footer, header",
311
+ "- `~/.kata-cli/agent/docs/pi-ui-tui/05-persistent-ui-elements.md` — status, widgets, footer, header",
312
312
  );
313
313
  }
314
314
 
315
315
  if (uiSelected.includes("tool") || result.answers["purpose"]) {
316
316
  docHints.push(
317
- "- `~/.kata/agent/docs/extending-pi/14-custom-rendering-controlling-what-the-user-sees.md` — renderCall / renderResult",
317
+ "- `~/.kata-cli/agent/docs/extending-pi/14-custom-rendering-controlling-what-the-user-sees.md` — renderCall / renderResult",
318
318
  );
319
319
  }
320
320
 
321
321
  if (eventsSelected && !eventsSelected.includes("standalone")) {
322
322
  docHints.push(
323
- "- `~/.kata/agent/docs/extending-pi/07-events-the-nervous-system.md` — all events reference",
323
+ "- `~/.kata-cli/agent/docs/extending-pi/07-events-the-nervous-system.md` — all events reference",
324
324
  );
325
325
  }
326
326
 
327
327
  if (eventsSelected.includes("context / prompt")) {
328
328
  docHints.push(
329
- "- `~/.kata/agent/docs/extending-pi/15-system-prompt-modification.md` — system prompt hooks",
329
+ "- `~/.kata-cli/agent/docs/extending-pi/15-system-prompt-modification.md` — system prompt hooks",
330
330
  );
331
331
  }
332
332
 
333
333
  if (persistenceSelected.includes("session")) {
334
334
  docHints.push(
335
- "- `~/.kata/agent/docs/extending-pi/13-state-management-persistence.md` — pi.appendEntry, session state",
335
+ "- `~/.kata-cli/agent/docs/extending-pi/13-state-management-persistence.md` — pi.appendEntry, session state",
336
336
  );
337
337
  }
338
338
 
@@ -350,11 +350,11 @@ ${docHints.join("\n")}
350
350
 
351
351
  Write the complete implementation as a single self-contained extension file:
352
352
 
353
- \`~/.kata/agent/extensions/<kebab-case-name>.ts\`
353
+ \`~/.kata-cli/agent/extensions/<kebab-case-name>.ts\`
354
354
 
355
355
  Then register it in the main extensions index:
356
356
 
357
- \`~/.kata/agent/extensions/index.ts\` — import and call the new extension's default export alongside existing ones
357
+ \`~/.kata-cli/agent/extensions/index.ts\` — import and call the new extension's default export alongside existing ones
358
358
 
359
359
  ## Rules you must follow exactly
360
360
 
@@ -257,8 +257,8 @@ function sendPrompt(
257
257
  ${contextSection}
258
258
  Write the complete file contents for two files:
259
259
 
260
- 1. \`~/.kata/agent/extensions/slash-commands/<name>.ts\` — the command implementation
261
- 2. Update \`~/.kata/agent/extensions/slash-commands/index.ts\` — import and register the new command alongside existing ones
260
+ 1. \`~/.kata-cli/agent/extensions/slash-commands/<name>.ts\` — the command implementation
261
+ 2. Update \`~/.kata-cli/agent/extensions/slash-commands/index.ts\` — import and register the new command alongside existing ones
262
262
 
263
263
  Rules you must follow exactly:
264
264
  - Command registration: \`pi.registerCommand("name", { description, handler })\`
@@ -502,7 +502,7 @@ export default function (pi: ExtensionAPI) {
502
502
  const discovery = discoverAgents(ctx.cwd, "both");
503
503
  if (discovery.agents.length === 0) {
504
504
  ctx.ui.notify(
505
- "No agents found. Add .md files to ~/.kata/agent/agents/ or .kata/agents/",
505
+ "No agents found. Add .md files to ~/.kata-cli/agent/agents/ or .kata/agents/",
506
506
  "warning",
507
507
  );
508
508
  return;
@@ -525,7 +525,7 @@ export default function (pi: ExtensionAPI) {
525
525
  "Delegate tasks to specialized subagents with isolated context windows.",
526
526
  "Each subagent is a separate pi process with its own tools, model, and system prompt.",
527
527
  "Modes: single ({ agent, task }), parallel ({ tasks: [{agent, task},...] }), chain ({ chain: [{agent, task},...] } with {previous} placeholder).",
528
- "Agents are defined as .md files in ~/.kata/agent/agents/ (user) or .kata/agents/ (project).",
528
+ "Agents are defined as .md files in ~/.kata-cli/agent/agents/ (user) or .kata/agents/ (project).",
529
529
  "Use the /subagent command to list available agents and their descriptions.",
530
530
  "Use chain mode to pipeline: scout finds context, planner designs, worker implements.",
531
531
  ].join(" "),