@draht/coding-agent 2026.3.2 → 2026.3.3
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.
- package/CHANGELOG.md +74 -13
- package/README.md +89 -106
- package/agents/architect.md +45 -0
- package/agents/debugger.md +57 -0
- package/agents/git-committer.md +46 -0
- package/agents/implementer.md +25 -0
- package/agents/reviewer.md +52 -0
- package/agents/security-auditor.md +61 -0
- package/agents/verifier.md +44 -0
- package/bin/draht-tools.cjs +20 -20
- package/dist/agents/architect.md +45 -0
- package/dist/agents/debugger.md +57 -0
- package/dist/agents/git-committer.md +46 -0
- package/dist/agents/implementer.md +25 -0
- package/dist/agents/reviewer.md +52 -0
- package/dist/agents/security-auditor.md +61 -0
- package/dist/agents/verifier.md +44 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +10 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/extensions/gsd-commands.ts +69 -4
- package/dist/extensions/subagent.ts +212 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +3 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/prompts/commands/discuss-phase.md +3 -3
- package/dist/prompts/commands/execute-phase.md +9 -9
- package/dist/prompts/commands/map-codebase.md +2 -2
- package/dist/prompts/commands/new-project.md +9 -9
- package/dist/prompts/commands/pause-work.md +2 -2
- package/dist/prompts/commands/plan-phase.md +5 -5
- package/dist/prompts/commands/progress.md +1 -1
- package/dist/prompts/commands/quick.md +4 -4
- package/dist/prompts/commands/resume-work.md +1 -1
- package/dist/prompts/commands/verify-work.md +4 -4
- package/docs/compaction.md +14 -14
- package/docs/custom-provider.md +9 -9
- package/docs/development.md +1 -1
- package/docs/extensions.md +32 -32
- package/docs/json.md +4 -4
- package/docs/packages.md +1 -1
- package/docs/providers.md +1 -1
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +24 -24
- package/docs/session.md +6 -6
- package/docs/termux.md +1 -1
- package/docs/themes.md +2 -2
- package/docs/tui.md +20 -20
- package/examples/extensions/README.md +4 -4
- package/examples/extensions/doom-overlay/README.md +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/subagent/README.md +11 -11
- package/examples/sdk/README.md +3 -3
- package/extensions/gsd-commands.ts +69 -4
- package/extensions/subagent.ts +212 -9
- package/package.json +9 -7
- package/prompts/commands/discuss-phase.md +3 -3
- package/prompts/commands/execute-phase.md +9 -9
- package/prompts/commands/map-codebase.md +2 -2
- package/prompts/commands/new-project.md +9 -9
- package/prompts/commands/pause-work.md +2 -2
- package/prompts/commands/plan-phase.md +5 -5
- package/prompts/commands/progress.md +1 -1
- package/prompts/commands/quick.md +4 -4
- package/prompts/commands/resume-work.md +1 -1
- package/prompts/commands/verify-work.md +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [2026.3.
|
|
3
|
+
## [2026.3.3] - 2026-03-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- show 'dev' version when running from source
|
|
8
|
+
- stream subagent activity to tool output for ctrl+o
|
|
9
|
+
- add /agent command for routing prompts through agents
|
|
10
|
+
- add shipped debugger agent
|
|
11
|
+
- ship built-in GSD agents with the package
|
|
12
|
+
- show agent name and progress in subagent tool UI
|
|
13
|
+
- add /next-milestone command for planning after milestone completion
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- use draht-tools binary name in GSD prompts and CLI
|
|
18
|
+
- fix subagent spawn in source/dev mode
|
|
19
|
+
- load shipped extensions and rename /resume to /continue
|
|
20
|
+
|
|
21
|
+
## [2026.3.2-9] - 2026-03-02
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- update repo URLs from badlogic/pi-mono to draht-dev/draht
|
|
26
|
+
|
|
27
|
+
## [2026.3.2-8] - 2026-03-02
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
|
|
31
|
+
- rebrand all READMEs to draht naming and conventions
|
|
32
|
+
|
|
33
|
+
## [2026.3.2-7] - 2026-03-02
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- add coding-agent bin alias so npx @draht/coding-agent works
|
|
38
|
+
|
|
39
|
+
## [2026.3.2-4] - 2026-03-02
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- ship GSD commands + subagent runner as built-in extensions
|
|
44
|
+
- post-phase report includes TDD commit metrics and domain model health
|
|
45
|
+
- quality-gate adds domain glossary compliance, cross-context boundary, and TDD ratio checks
|
|
46
|
+
- post-task checks TDD cycle compliance (green: requires preceding red: per task)
|
|
47
|
+
- pre-execute validates DOMAIN.md, TEST-STRATEGY.md, and non-empty <test> sections
|
|
48
|
+
- enforce TDD cycle in quick tasks with config/docs exception
|
|
49
|
+
- add automated test suite and domain health checks to verify-work
|
|
50
|
+
- rewrite execute-phase with mandatory Red→Green→Refactor TDD cycle and domain rules
|
|
51
|
+
- enrich plan-phase with DDD context/domain tags, full TDD task format, and domain rules
|
|
52
|
+
- add testability and domain boundaries gray areas to discuss-phase
|
|
53
|
+
- add DOMAIN.md and TEST-STRATEGY.md scaffolding to new-project and map-codebase
|
|
54
|
+
- integrate GSD methodology as battery-included resources
|
|
55
|
+
- add draht login command
|
|
56
|
+
- rename pi CLI to draht, update env vars, scaffold landing page
|
|
57
|
+
- add SST v4 infrastructure, resource manager, and AGENTS.md templates
|
|
58
|
+
- rebrand to @draht/ namespace
|
|
59
|
+
|
|
60
|
+
### Changed
|
|
61
|
+
|
|
62
|
+
- rebrand package references from @mariozechner/pi-* to @draht/*
|
|
63
|
+
- add publishConfig for public npm access
|
|
64
|
+
- comprehensive READMEs, CONTRIBUTING.md, and phase summaries
|
|
65
|
+
- add vitest config, integration tests, and draht manifest test
|
|
66
|
+
- switch from npm to bun, replace tsx with bun runtime, add tsgo
|
|
67
|
+
|
|
68
|
+
### Fixed
|
|
69
|
+
|
|
70
|
+
- rm -rf dist/prompts and dist/hooks before copy to avoid stale permission issues
|
|
71
|
+
- build packages individually to avoid workspace recursion, fix copy-assets mkdir
|
|
72
|
+
- load shipped prompts unconditionally (not gated by includeDefaults)
|
|
73
|
+
- remove gsd- prefix from shipped prompts and agents
|
|
74
|
+
- use workspace:* for all inter-package dependencies
|
|
75
|
+
- pre-commit hooks
|
|
76
|
+
- address code review findings and fix router stream types
|
|
4
77
|
|
|
5
78
|
## [0.55.3] - 2026-02-27
|
|
6
79
|
|
|
@@ -284,8 +357,6 @@
|
|
|
284
357
|
- Updated default model for `vercel-ai-gateway` provider to `anthropic/claude-opus-4-6`
|
|
285
358
|
- Updated default model for `opencode` provider to `claude-opus-4-6`
|
|
286
359
|
|
|
287
|
-
## [0.52.1] - 2026-02-05
|
|
288
|
-
|
|
289
360
|
## [0.52.0] - 2026-02-05
|
|
290
361
|
|
|
291
362
|
### New Features
|
|
@@ -518,8 +589,6 @@
|
|
|
518
589
|
- Fixed empty rows appearing below footer when content shrinks (e.g., closing `/tree`, clearing multi-line editor) ([#1095](https://github.com/badlogic/pi-mono/pull/1095) by [@marckrenn](https://github.com/marckrenn))
|
|
519
590
|
- Fixed terminal cursor remaining hidden after exiting TUI via `stop()` when a render was pending ([#1099](https://github.com/badlogic/pi-mono/pull/1099) by [@haoqixu](https://github.com/haoqixu))
|
|
520
591
|
|
|
521
|
-
## [0.50.5] - 2026-01-30
|
|
522
|
-
|
|
523
592
|
## [0.50.4] - 2026-01-30
|
|
524
593
|
|
|
525
594
|
### New Features
|
|
@@ -948,8 +1017,6 @@ There are multiple SDK breaking changes since v0.49.3. For the quickest migratio
|
|
|
948
1017
|
- Fixed extension loading in compiled Bun binary: extensions with local file imports now work correctly. Updated `@mariozechner/jiti` to v2.6.5 which bundles babel for Bun binary compatibility. ([#681](https://github.com/badlogic/pi-mono/issues/681))
|
|
949
1018
|
- Fixed theme loading when installed via mise: use wrapper directory in release tarballs for compatibility with mise's `strip_components=1` extraction. ([#681](https://github.com/badlogic/pi-mono/issues/681))
|
|
950
1019
|
|
|
951
|
-
## [0.45.3] - 2026-01-13
|
|
952
|
-
|
|
953
1020
|
## [0.45.2] - 2026-01-13
|
|
954
1021
|
|
|
955
1022
|
### Fixed
|
|
@@ -1163,10 +1230,6 @@ There are multiple SDK breaking changes since v0.49.3. For the quickest migratio
|
|
|
1163
1230
|
- Key presses no longer dropped when input is batched over SSH ([#538](https://github.com/badlogic/pi-mono/issues/538))
|
|
1164
1231
|
- Clipboard image support now works on Alpine Linux and other musl-based distros ([#533](https://github.com/badlogic/pi-mono/issues/533))
|
|
1165
1232
|
|
|
1166
|
-
## [0.37.8] - 2026-01-07
|
|
1167
|
-
|
|
1168
|
-
## [0.37.7] - 2026-01-07
|
|
1169
|
-
|
|
1170
1233
|
## [0.37.6] - 2026-01-06
|
|
1171
1234
|
|
|
1172
1235
|
### Added
|
|
@@ -1484,8 +1547,6 @@ pi --extension ./safety.ts -e ./todo.ts
|
|
|
1484
1547
|
- SDK: `extensions` option accepts `ExtensionFactory[]` for inline extensions
|
|
1485
1548
|
- SDK: `additionalExtensionPaths` replaces both `additionalHookPaths` and `additionalCustomToolPaths`
|
|
1486
1549
|
|
|
1487
|
-
## [0.34.2] - 2026-01-04
|
|
1488
|
-
|
|
1489
1550
|
## [0.34.1] - 2026-01-04
|
|
1490
1551
|
|
|
1491
1552
|
### Added
|
package/README.md
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">@draht/coding-agent</h1>
|
|
2
2
|
|
|
3
|
-
**Issue tracker and PRs reopen March 2, 2026.**
|
|
4
|
-
|
|
5
|
-
All PRs will be auto-closed until then. Approved contributors can submit PRs after vacation without reapproval. For support, join [Discord](https://discord.com/invite/3cU7Bz4UPx).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
<a href="https://shittycodingagent.ai">
|
|
11
|
-
<img src="https://shittycodingagent.ai/logo.svg" alt="pi logo" width="128">
|
|
12
|
-
</a>
|
|
13
|
-
</p>
|
|
14
|
-
<p align="center">
|
|
15
|
-
<a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
|
|
16
|
-
<a href="https://www.npmjs.com/package/@mariozechner/pi-coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/@mariozechner/pi-coding-agent?style=flat-square" /></a>
|
|
17
|
-
<a href="https://github.com/badlogic/pi-mono/actions/workflows/ci.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/badlogic/pi-mono/ci.yml?style=flat-square&branch=main" /></a>
|
|
18
|
-
</p>
|
|
19
3
|
<p align="center">
|
|
20
|
-
<a href="https://
|
|
21
|
-
<
|
|
22
|
-
<a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
|
|
4
|
+
<a href="https://www.npmjs.com/package/@draht/coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/@draht/coding-agent?style=flat-square" /></a>
|
|
5
|
+
<a href="https://github.com/draht-dev/draht/actions/workflows/ci.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/draht-dev/draht/ci.yml?style=flat-square&branch=main" /></a>
|
|
23
6
|
</p>
|
|
24
7
|
|
|
25
|
-
|
|
8
|
+
Draht is a minimal terminal coding harness. Adapt it to your workflows, not the other way around, without having to fork and modify internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Draht Packages](#draht-packages) and share them with others via npm or git.
|
|
26
9
|
|
|
27
|
-
|
|
10
|
+
Draht ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask draht to build what you want or install a third party package that matches your workflow.
|
|
28
11
|
|
|
29
|
-
|
|
12
|
+
Draht runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps.
|
|
30
13
|
|
|
31
14
|
## Table of Contents
|
|
32
15
|
|
|
@@ -47,7 +30,7 @@ Pi runs in four modes: interactive, print or JSON, RPC for process integration,
|
|
|
47
30
|
- [Skills](#skills)
|
|
48
31
|
- [Extensions](#extensions)
|
|
49
32
|
- [Themes](#themes)
|
|
50
|
-
- [
|
|
33
|
+
- [Draht Packages](#draht-packages)
|
|
51
34
|
- [Programmatic Usage](#programmatic-usage)
|
|
52
35
|
- [Philosophy](#philosophy)
|
|
53
36
|
- [CLI Reference](#cli-reference)
|
|
@@ -57,24 +40,24 @@ Pi runs in four modes: interactive, print or JSON, RPC for process integration,
|
|
|
57
40
|
## Quick Start
|
|
58
41
|
|
|
59
42
|
```bash
|
|
60
|
-
|
|
43
|
+
bun add -g @draht/coding-agent
|
|
61
44
|
```
|
|
62
45
|
|
|
63
46
|
Authenticate with an API key:
|
|
64
47
|
|
|
65
48
|
```bash
|
|
66
49
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
67
|
-
|
|
50
|
+
draht
|
|
68
51
|
```
|
|
69
52
|
|
|
70
53
|
Or use your existing subscription:
|
|
71
54
|
|
|
72
55
|
```bash
|
|
73
|
-
|
|
56
|
+
draht
|
|
74
57
|
/login # Then select provider
|
|
75
58
|
```
|
|
76
59
|
|
|
77
|
-
Then just talk to
|
|
60
|
+
Then just talk to draht. By default, draht gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [draht packages](#draht-packages).
|
|
78
61
|
|
|
79
62
|
**Platform notes:** [Windows](docs/windows.md) | [Termux (Android)](docs/termux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
|
|
80
63
|
|
|
@@ -82,7 +65,7 @@ Then just talk to pi. By default, pi gives the model four tools: `read`, `write`
|
|
|
82
65
|
|
|
83
66
|
## Providers & Models
|
|
84
67
|
|
|
85
|
-
For each built-in provider,
|
|
68
|
+
For each built-in provider,draht maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
|
|
86
69
|
|
|
87
70
|
**Subscriptions:**
|
|
88
71
|
- Anthropic Claude Pro/Max
|
|
@@ -112,7 +95,7 @@ For each built-in provider, pi maintains a list of tool-capable models, updated
|
|
|
112
95
|
|
|
113
96
|
See [docs/providers.md](docs/providers.md) for detailed setup instructions.
|
|
114
97
|
|
|
115
|
-
**Custom providers & models:** Add providers via `~/.
|
|
98
|
+
**Custom providers & models:** Add providers via `~/.draht/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
|
|
116
99
|
|
|
117
100
|
---
|
|
118
101
|
|
|
@@ -164,11 +147,11 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|
|
|
164
147
|
| `/reload` | Reload extensions, skills, prompts, context files (themes hot-reload automatically) |
|
|
165
148
|
| `/hotkeys` | Show all keyboard shortcuts |
|
|
166
149
|
| `/changelog` | Display version history |
|
|
167
|
-
| `/quit`, `/exit` |
|
|
150
|
+
| `/quit`, `/exit` | Quitdraht |
|
|
168
151
|
|
|
169
152
|
### Keyboard Shortcuts
|
|
170
153
|
|
|
171
|
-
See `/hotkeys` for the full list. Customize via `~/.
|
|
154
|
+
See `/hotkeys` for the full list. Customize via `~/.draht/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
|
|
172
155
|
|
|
173
156
|
**Commonly used:**
|
|
174
157
|
|
|
@@ -203,13 +186,13 @@ Sessions are stored as JSONL files with a tree structure. Each entry has an `id`
|
|
|
203
186
|
|
|
204
187
|
### Management
|
|
205
188
|
|
|
206
|
-
Sessions auto-save to `~/.
|
|
189
|
+
Sessions auto-save to `~/.draht/agent/sessions/` organized by working directory.
|
|
207
190
|
|
|
208
191
|
```bash
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
192
|
+
draht -c # Continue most recent session
|
|
193
|
+
draht -r # Browse and select from past sessions
|
|
194
|
+
draht --no-session # Ephemeral mode (don't save)
|
|
195
|
+
draht --session <path> # Use specific session file or ID
|
|
213
196
|
```
|
|
214
197
|
|
|
215
198
|
### Branching
|
|
@@ -242,8 +225,8 @@ Use `/settings` to modify common options, or edit JSON files directly:
|
|
|
242
225
|
|
|
243
226
|
| Location | Scope |
|
|
244
227
|
|----------|-------|
|
|
245
|
-
| `~/.
|
|
246
|
-
| `.
|
|
228
|
+
| `~/.draht/agent/settings.json` | Global (all projects) |
|
|
229
|
+
| `.draht/settings.json` | Project (overrides global) |
|
|
247
230
|
|
|
248
231
|
See [docs/settings.md](docs/settings.md) for all options.
|
|
249
232
|
|
|
@@ -251,8 +234,8 @@ See [docs/settings.md](docs/settings.md) for all options.
|
|
|
251
234
|
|
|
252
235
|
## Context Files
|
|
253
236
|
|
|
254
|
-
|
|
255
|
-
- `~/.
|
|
237
|
+
Draht loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
|
|
238
|
+
- `~/.draht/agent/AGENTS.md` (global)
|
|
256
239
|
- Parent directories (walking up from cwd)
|
|
257
240
|
- Current directory
|
|
258
241
|
|
|
@@ -260,7 +243,7 @@ Use for project instructions, conventions, common commands. All matching files a
|
|
|
260
243
|
|
|
261
244
|
### System Prompt
|
|
262
245
|
|
|
263
|
-
Replace the default system prompt with `.
|
|
246
|
+
Replace the default system prompt with `.draht/SYSTEM.md` (project) or `~/.draht/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
|
|
264
247
|
|
|
265
248
|
---
|
|
266
249
|
|
|
@@ -271,19 +254,19 @@ Replace the default system prompt with `.pi/SYSTEM.md` (project) or `~/.pi/agent
|
|
|
271
254
|
Reusable prompts as Markdown files. Type `/name` to expand.
|
|
272
255
|
|
|
273
256
|
```markdown
|
|
274
|
-
<!-- ~/.
|
|
257
|
+
<!-- ~/.draht/agent/prompts/review.md -->
|
|
275
258
|
Review this code for bugs, security issues, and performance problems.
|
|
276
259
|
Focus on: {{focus}}
|
|
277
260
|
```
|
|
278
261
|
|
|
279
|
-
Place in `~/.
|
|
262
|
+
Place in `~/.draht/agent/prompts/`, `.draht/prompts/`, or a [pi package](#draht-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
|
|
280
263
|
|
|
281
264
|
### Skills
|
|
282
265
|
|
|
283
266
|
On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
|
|
284
267
|
|
|
285
268
|
```markdown
|
|
286
|
-
<!-- ~/.
|
|
269
|
+
<!-- ~/.draht/agent/skills/my-skill/SKILL.md -->
|
|
287
270
|
# My Skill
|
|
288
271
|
Use this skill when the user asks about X.
|
|
289
272
|
|
|
@@ -292,19 +275,19 @@ Use this skill when the user asks about X.
|
|
|
292
275
|
2. Then that
|
|
293
276
|
```
|
|
294
277
|
|
|
295
|
-
Place in `~/.
|
|
278
|
+
Place in `~/.draht/agent/skills/`, `~/.agents/skills/`, `.draht/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [pi package](#draht-packages) to share with others. See [docs/skills.md](docs/skills.md).
|
|
296
279
|
|
|
297
280
|
### Extensions
|
|
298
281
|
|
|
299
282
|
<p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
|
|
300
283
|
|
|
301
|
-
TypeScript modules that
|
|
284
|
+
TypeScript modules that extenddraht with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
|
|
302
285
|
|
|
303
286
|
```typescript
|
|
304
|
-
export default function (
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
287
|
+
export default function (draht: ExtensionAPI) {
|
|
288
|
+
draht.registerTool({ name: "deploy", ... });
|
|
289
|
+
draht.registerCommand("stats", { ... });
|
|
290
|
+
draht.on("tool_call", async (event, ctx) => { ... });
|
|
308
291
|
}
|
|
309
292
|
```
|
|
310
293
|
|
|
@@ -318,50 +301,50 @@ export default function (pi: ExtensionAPI) {
|
|
|
318
301
|
- Git checkpointing and auto-commit
|
|
319
302
|
- SSH and sandbox execution
|
|
320
303
|
- MCP server integration
|
|
321
|
-
-
|
|
304
|
+
- Makedraht look like Claude Code
|
|
322
305
|
- Games while waiting (yes, Doom runs)
|
|
323
306
|
- ...anything you can dream up
|
|
324
307
|
|
|
325
|
-
Place in `~/.
|
|
308
|
+
Place in `~/.draht/agent/extensions/`, `.draht/extensions/`, or a [pi package](#draht-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
|
|
326
309
|
|
|
327
310
|
### Themes
|
|
328
311
|
|
|
329
|
-
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file
|
|
312
|
+
Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file anddraht immediately applies changes.
|
|
330
313
|
|
|
331
|
-
Place in `~/.
|
|
314
|
+
Place in `~/.draht/agent/themes/`, `.draht/themes/`, or a [pi package](#draht-packages) to share with others. See [docs/themes.md](docs/themes.md).
|
|
332
315
|
|
|
333
|
-
###
|
|
316
|
+
### Draht Packages
|
|
334
317
|
|
|
335
|
-
Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%
|
|
318
|
+
Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Adraht-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
|
|
336
319
|
|
|
337
|
-
> **Security:**
|
|
320
|
+
> **Security:** Draht packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
|
|
338
321
|
|
|
339
322
|
```bash
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
323
|
+
draht install npm:@foo/draht-tools
|
|
324
|
+
draht install npm:@foo/draht-tools@1.2.3 # pinned version
|
|
325
|
+
draht install git:github.com/user/repo
|
|
326
|
+
draht install git:github.com/user/repo@v1 # tag or commit
|
|
327
|
+
draht install git:git@github.com:user/repo
|
|
328
|
+
draht install git:git@github.com:user/repo@v1 # tag or commit
|
|
329
|
+
draht install https://github.com/user/repo
|
|
330
|
+
draht install https://github.com/user/repo@v1 # tag or commit
|
|
331
|
+
draht install ssh://git@github.com/user/repo
|
|
332
|
+
draht install ssh://git@github.com/user/repo@v1 # tag or commit
|
|
333
|
+
draht remove npm:@foo/draht-tools
|
|
334
|
+
draht list
|
|
335
|
+
draht update # skips pinned packages
|
|
336
|
+
draht config # enable/disable extensions, skills, prompts, themes
|
|
354
337
|
```
|
|
355
338
|
|
|
356
|
-
Packages install to `~/.
|
|
339
|
+
Packages install to `~/.draht/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.draht/git/`, `.draht/npm/`).
|
|
357
340
|
|
|
358
|
-
Create a package by adding a `
|
|
341
|
+
Create a package by adding a `draht` key to `package.json`:
|
|
359
342
|
|
|
360
343
|
```json
|
|
361
344
|
{
|
|
362
|
-
"name": "my-
|
|
363
|
-
"keywords": ["
|
|
364
|
-
"
|
|
345
|
+
"name": "my-draht-package",
|
|
346
|
+
"keywords": ["draht-package"],
|
|
347
|
+
"draht": {
|
|
365
348
|
"extensions": ["./extensions"],
|
|
366
349
|
"skills": ["./skills"],
|
|
367
350
|
"prompts": ["./prompts"],
|
|
@@ -370,7 +353,7 @@ Create a package by adding a `pi` key to `package.json`:
|
|
|
370
353
|
}
|
|
371
354
|
```
|
|
372
355
|
|
|
373
|
-
Without a `
|
|
356
|
+
Without a `draht` manifest,draht auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
|
|
374
357
|
|
|
375
358
|
See [docs/packages.md](docs/packages.md).
|
|
376
359
|
|
|
@@ -381,7 +364,7 @@ See [docs/packages.md](docs/packages.md).
|
|
|
381
364
|
### SDK
|
|
382
365
|
|
|
383
366
|
```typescript
|
|
384
|
-
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@
|
|
367
|
+
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@draht/coding-agent";
|
|
385
368
|
|
|
386
369
|
const { session } = await createAgentSession({
|
|
387
370
|
sessionManager: SessionManager.inMemory(),
|
|
@@ -399,7 +382,7 @@ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
|
|
|
399
382
|
For non-Node.js integrations, use RPC mode over stdin/stdout:
|
|
400
383
|
|
|
401
384
|
```bash
|
|
402
|
-
|
|
385
|
+
draht --mode rpc
|
|
403
386
|
```
|
|
404
387
|
|
|
405
388
|
See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
@@ -408,11 +391,11 @@ See [docs/rpc.md](docs/rpc.md) for the protocol.
|
|
|
408
391
|
|
|
409
392
|
## Philosophy
|
|
410
393
|
|
|
411
|
-
|
|
394
|
+
Draht is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [pi packages](#draht-packages). This keeps the core minimal while letting you shapedraht to fit how you work.
|
|
412
395
|
|
|
413
396
|
**No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
|
|
414
397
|
|
|
415
|
-
**No sub-agents.** There's many ways to do this.
|
|
398
|
+
**No sub-agents.** There's many ways to do this. Spawndraht instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
|
|
416
399
|
|
|
417
400
|
**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
|
|
418
401
|
|
|
@@ -429,17 +412,17 @@ Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/)
|
|
|
429
412
|
## CLI Reference
|
|
430
413
|
|
|
431
414
|
```bash
|
|
432
|
-
|
|
415
|
+
draht [options] [@files...] [messages...]
|
|
433
416
|
```
|
|
434
417
|
|
|
435
418
|
### Package Commands
|
|
436
419
|
|
|
437
420
|
```bash
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
421
|
+
draht install <source> [-l] # Install package, -l for project-local
|
|
422
|
+
draht remove <source> [-l] # Remove package
|
|
423
|
+
draht update [source] # Update packages (skips pinned)
|
|
424
|
+
draht list # List installed packages
|
|
425
|
+
draht config # Enable/disable package resources
|
|
443
426
|
```
|
|
444
427
|
|
|
445
428
|
### Modes
|
|
@@ -512,47 +495,47 @@ Combine `--no-*` with explicit flags to load exactly what you need, ignoring set
|
|
|
512
495
|
Prefix files with `@` to include in the message:
|
|
513
496
|
|
|
514
497
|
```bash
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
498
|
+
draht @prompt.md "Answer this"
|
|
499
|
+
draht -p @screenshot.png "What's in this image?"
|
|
500
|
+
draht @code.ts @test.ts "Review these files"
|
|
518
501
|
```
|
|
519
502
|
|
|
520
503
|
### Examples
|
|
521
504
|
|
|
522
505
|
```bash
|
|
523
506
|
# Interactive with initial prompt
|
|
524
|
-
|
|
507
|
+
draht "List all .ts files in src/"
|
|
525
508
|
|
|
526
509
|
# Non-interactive
|
|
527
|
-
|
|
510
|
+
draht -p "Summarize this codebase"
|
|
528
511
|
|
|
529
512
|
# Different model
|
|
530
|
-
|
|
513
|
+
draht --provider openai --model gpt-4o "Help me refactor"
|
|
531
514
|
|
|
532
515
|
# Model with provider prefix (no --provider needed)
|
|
533
|
-
|
|
516
|
+
draht --model openai/gpt-4o "Help me refactor"
|
|
534
517
|
|
|
535
518
|
# Model with thinking level shorthand
|
|
536
|
-
|
|
519
|
+
draht --model sonnet:high "Solve this complex problem"
|
|
537
520
|
|
|
538
521
|
# Limit model cycling
|
|
539
|
-
|
|
522
|
+
draht --models "claude-*,gpt-4o"
|
|
540
523
|
|
|
541
524
|
# Read-only mode
|
|
542
|
-
|
|
525
|
+
draht --tools read,grep,find,ls -p "Review the code"
|
|
543
526
|
|
|
544
527
|
# High thinking level
|
|
545
|
-
|
|
528
|
+
draht --thinking high "Solve this complex problem"
|
|
546
529
|
```
|
|
547
530
|
|
|
548
531
|
### Environment Variables
|
|
549
532
|
|
|
550
533
|
| Variable | Description |
|
|
551
534
|
|----------|-------------|
|
|
552
|
-
| `
|
|
553
|
-
| `
|
|
554
|
-
| `
|
|
555
|
-
| `
|
|
535
|
+
| `DRAHT_CODING_AGENT_DIR` | Override config directory (default: `~/.draht/agent`) |
|
|
536
|
+
| `DRAHT_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
|
|
537
|
+
| `DRAHT_SKIP_VERSION_CHECK` | Skip version check at startup |
|
|
538
|
+
| `DRAHT_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
|
|
556
539
|
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
|
|
557
540
|
|
|
558
541
|
---
|
|
@@ -569,6 +552,6 @@ MIT
|
|
|
569
552
|
|
|
570
553
|
## See Also
|
|
571
554
|
|
|
572
|
-
- [@
|
|
573
|
-
- [@
|
|
574
|
-
- [@
|
|
555
|
+
- [@draht/ai](https://www.npmjs.com/package/@draht/ai): Core LLM toolkit
|
|
556
|
+
- [@draht/agent-core](https://www.npmjs.com/package/@draht/agent-core): Agent framework
|
|
557
|
+
- [@draht/tui](https://www.npmjs.com/package/@draht/tui): Terminal UI components
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: Reads codebase, analyzes requirements, and produces structured implementation plans with file lists, dependencies, and phased task breakdowns.
|
|
4
|
+
tools: read,bash,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are the Architect agent. Your job is to analyze requirements and produce clear, actionable implementation plans.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
1. **Understand the request** — read the task carefully, identify what is being asked
|
|
12
|
+
2. **Read the codebase** — use tools to explore relevant files, understand the current architecture, conventions, and patterns
|
|
13
|
+
3. **Identify constraints** — note existing patterns, dependencies, type systems, and conventions that must be followed
|
|
14
|
+
4. **Produce a plan** — output a structured implementation plan
|
|
15
|
+
|
|
16
|
+
## Output Format
|
|
17
|
+
|
|
18
|
+
Your plan MUST include:
|
|
19
|
+
|
|
20
|
+
### Goal
|
|
21
|
+
One sentence describing the outcome (not the activity).
|
|
22
|
+
|
|
23
|
+
### Context
|
|
24
|
+
What you learned from reading the codebase that informs the plan.
|
|
25
|
+
|
|
26
|
+
### Tasks
|
|
27
|
+
Numbered list of concrete tasks. For each task:
|
|
28
|
+
- What to do (specific, not vague)
|
|
29
|
+
- Which files to create or modify
|
|
30
|
+
- Key implementation details
|
|
31
|
+
- Dependencies on other tasks
|
|
32
|
+
|
|
33
|
+
### Risk Assessment
|
|
34
|
+
- What could go wrong
|
|
35
|
+
- What assumptions you are making
|
|
36
|
+
- What needs clarification from the user
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
- DO read actual code before planning — never guess at APIs, types, or file structure
|
|
41
|
+
- DO follow existing conventions you find in the codebase
|
|
42
|
+
- DO keep plans minimal — smallest change that achieves the goal
|
|
43
|
+
- DO NOT produce code — only plans
|
|
44
|
+
- DO NOT make assumptions about APIs without reading the source
|
|
45
|
+
- DO NOT suggest removing existing functionality unless explicitly asked
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debugger
|
|
3
|
+
description: Diagnoses bugs, analyzes errors and stack traces, reproduces issues, and identifies root causes.
|
|
4
|
+
tools: read,bash,edit,write,grep,find,ls
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are the Debugger agent. Your job is to find and fix bugs.
|
|
8
|
+
|
|
9
|
+
## Process
|
|
10
|
+
|
|
11
|
+
1. **Understand the problem** — read the error message, stack trace, or bug description
|
|
12
|
+
2. **Reproduce** — if possible, run the failing command or test to see the error firsthand
|
|
13
|
+
3. **Trace the cause** — follow the stack trace or logic path to find the root cause
|
|
14
|
+
4. **Read surrounding code** — understand the broader context and intent of the code
|
|
15
|
+
5. **Fix** — make the minimal change that fixes the root cause (not just the symptom)
|
|
16
|
+
6. **Verify** — run the failing command/test again to confirm the fix works
|
|
17
|
+
|
|
18
|
+
## Debugging Strategies
|
|
19
|
+
|
|
20
|
+
### Stack Traces
|
|
21
|
+
- Start from the bottom (root cause) not the top (symptom)
|
|
22
|
+
- Read each file in the trace to understand the call chain
|
|
23
|
+
- Look for incorrect assumptions about types, null values, or state
|
|
24
|
+
|
|
25
|
+
### Test Failures
|
|
26
|
+
- Read the test to understand what it expects
|
|
27
|
+
- Read the implementation to understand what it does
|
|
28
|
+
- Identify the gap between expected and actual behavior
|
|
29
|
+
|
|
30
|
+
### Type Errors
|
|
31
|
+
- Read the type definitions involved
|
|
32
|
+
- Check if types changed upstream without updating downstream consumers
|
|
33
|
+
- Look for implicit `any` or incorrect type assertions
|
|
34
|
+
|
|
35
|
+
### Runtime Errors
|
|
36
|
+
- Check for null/undefined access patterns
|
|
37
|
+
- Look for async race conditions
|
|
38
|
+
- Verify environment assumptions (env vars, file paths, dependencies)
|
|
39
|
+
|
|
40
|
+
## Output Format
|
|
41
|
+
|
|
42
|
+
### Root Cause
|
|
43
|
+
Clear explanation of why the bug occurs.
|
|
44
|
+
|
|
45
|
+
### Fix
|
|
46
|
+
What was changed and why. Reference specific files and lines.
|
|
47
|
+
|
|
48
|
+
### Verification
|
|
49
|
+
Show that the fix works (test output, command output).
|
|
50
|
+
|
|
51
|
+
## Rules
|
|
52
|
+
|
|
53
|
+
- ALWAYS reproduce the bug before attempting to fix it
|
|
54
|
+
- Fix the root cause, not the symptom
|
|
55
|
+
- Keep fixes minimal — do not refactor unrelated code
|
|
56
|
+
- If the fix is non-obvious, add a comment explaining why
|
|
57
|
+
- Run verification after fixing to confirm the issue is resolved
|