dld-kit 1.0.0-rc.3 → 1.0.0-rc.4
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/README.md +109 -346
- package/dist/dld.mjs +154 -52
- package/package.json +1 -1
- package/skills/dld-adjust/SKILL.md +1 -1
- package/skills/dld-audit/SKILL.md +1 -1
- package/skills/dld-audit-auto/SKILL.md +1 -1
- package/skills/dld-common/SKILL.md +1 -1
- package/skills/dld-common/scripts/dld.mjs +154 -52
- package/skills/dld-decide/SKILL.md +1 -1
- package/skills/dld-implement/SKILL.md +1 -1
- package/skills/dld-init/SKILL.md +1 -1
- package/skills/dld-lookup/SKILL.md +1 -1
- package/skills/dld-plan/SKILL.md +1 -1
- package/skills/dld-reindex/SKILL.md +70 -23
- package/skills/dld-retrofit/SKILL.md +1 -1
- package/skills/dld-snapshot/SKILL.md +1 -1
- package/skills/dld-status/SKILL.md +1 -1
- package/templates/rules/dld-workflow.md +1 -1
- package/templates/skills/dld-reindex/SKILL.md +69 -22
package/README.md
CHANGED
|
@@ -1,434 +1,197 @@
|
|
|
1
|
-
# DLD Kit
|
|
1
|
+
# DLD Kit | Decision-Linked Development
|
|
2
2
|
|
|
3
|
-
Stop AI agents from breaking code they don't understand
|
|
3
|
+
**Stop AI agents from breaking code they don't understand.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> Early development — APIs, file formats, and skill interfaces may change.
|
|
7
|
-
|
|
8
|
-
---
|
|
5
|
+
Code is full of choices that look odd without their reason: a retry tuned to one API's rate limits, a check for a bug that only shows up in production. The reasons live in tickets, chat threads and people's heads, where an agent can't find them. With Decision-Linked Development (DLD), you write each choice down as a short decision record and link it to the code with an `@decision(DL-012)` comment. When an agent sees that comment, it reads the decision before it changes the code.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
<picture>
|
|
8
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/dld-workflow-dark.svg">
|
|
9
|
+
<img src="docs/assets/dld-workflow-light.svg" width="880" alt="DLD workflow: /dld-plan records proposed decisions; /dld-implement writes and reviews the code and links it to the decisions with @decision comments; /dld-snapshot, run on demand, on a schedule or in CI, generates OVERVIEW.md and SNAPSHOT.md. Agents read the linked decision before editing annotated code.">
|
|
10
|
+
</picture>
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Requirements: Node.js 20+ and git. `gh` is optional; `/dld-reindex` uses it to check open PRs.
|
|
12
|
+
> [!NOTE]
|
|
13
|
+
> **1.0 is in release candidates (`1.0.0-rc.N`).** The install steps below get the latest candidate, which replaces the 0.x skills and scripts. Commands, file formats and skills may still change before 1.0.0. Coming from 0.x? See [Upgrading from 0.x](#upgrading-from-0x). The last 0.x release is [v0.9.0](https://github.com/jimutt/dld-kit/releases/tag/v0.9.0).
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
DLD Kit is a set of [Agent Skills](https://agentskills.io) for Claude Code, Codex, Cursor, OpenCode, Pi, Antigravity and Copilot CLI, plus a small CLI that installs them.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|---|---|---|---|---|
|
|
20
|
-
| [`npx dld-kit init`](#npx-dld-kit-init) | Claude Code, Antigravity, Codex, Cursor, OpenCode, Pi | The project, committed | Written by `init` | `npx dld-kit@latest update` |
|
|
21
|
-
| [Claude Code plugin](#claude-code-plugin) | Claude Code | Your user profile | SessionStart hook | `claude plugin marketplace update dld-kit`, then `claude plugin update dld@dld-kit` |
|
|
22
|
-
| [Codex and Copilot CLI plugins](#codex-and-copilot-cli-plugins) | Codex, Copilot CLI | Your user profile | dld-init skill | Codex's plugin manager; `copilot plugin update` |
|
|
23
|
-
| [Pi package](#pi-package) | Pi | Your user profile, or the project with `-l` | dld-init skill | `pi update npm:dld-kit` |
|
|
24
|
-
| [`npx skills` / `gh skill`](#npx-skills-or-gh-skill) | Any agent those tools support | The project, or your user profile with `-g` | dld-init skill | `npx skills update` / `gh skill update` |
|
|
25
|
-
| [Manual copy](#manual-copy) | Any Agent Skills harness | Wherever you copy them | dld-init skill | Copy again |
|
|
17
|
+
**Contents:** [Quickstart](#quickstart) · [How it works](#how-it-works) · [Workflows](#workflows) · [Skills](#skills) · [Install](#install) · [Configuration](#configuration) · [DLD and spec-driven development](#dld-and-spec-driven-development) · [CLI](#cli) · [Learn more](#learn-more)
|
|
26
18
|
|
|
27
|
-
|
|
19
|
+
## Quickstart
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
You need Node.js 20+ and git. In the root of your repository, run:
|
|
30
22
|
|
|
31
23
|
```bash
|
|
32
24
|
npx dld-kit init
|
|
33
25
|
```
|
|
34
26
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- `dld.config.yaml`, `decisions/records/` and `decisions/INDEX.md`
|
|
38
|
-
- the `dld-*` skills for each selected agent: `.claude/skills/` for Claude Code, `.agents/skills/` for the others
|
|
39
|
-
- the always-on rule, once per agent: a block between `<!-- dld-kit:start -->` and `<!-- dld-kit:end -->` in `AGENTS.md` (or `CLAUDE.md`) for Codex, Cursor, OpenCode and Pi, `.agents/rules/dld-workflow.md` for Antigravity, and `.claude/rules/dld-workflow.md` for Claude Code unless Claude Code already reads the block (see [Agents](#agents)). When the block goes into `AGENTS.md` and the project has no `CLAUDE.md` or `.claude/CLAUDE.md`, it writes `.claude/CLAUDE.md` instead, which imports `AGENTS.md` for Claude Code
|
|
40
|
-
|
|
41
|
-
`init` detects the agents from files in the project (`.claude/`, `.codex/`, `.cursor/`, `opencode.json`, `.pi/`, `AGENTS.md` and so on) and asks you to confirm the list. Options:
|
|
42
|
-
|
|
43
|
-
- `--agent claude,codex`: add agents to the detected ones
|
|
44
|
-
- `--namespaces billing,auth`: one decision directory per namespace (for monorepos)
|
|
45
|
-
- `--yes`: skip the question and use the detected agents plus `--agent`
|
|
46
|
-
|
|
47
|
-
Commit the files. Teammates then need nothing installed.
|
|
48
|
-
|
|
49
|
-
To upgrade, run `npx dld-kit@latest update`. It rewrites the `dld-*` skills and the rule for the agents already installed, and never touches decision records or `dld.config.yaml`. Add `--agent <name>` to install for another agent.
|
|
50
|
-
|
|
51
|
-
### Claude Code plugin
|
|
52
|
-
|
|
53
|
-
In Claude Code:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
/plugin marketplace add jimutt/dld-kit
|
|
57
|
-
/plugin install dld@dld-kit
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Then run `/dld-init` in each project. The plugin's SessionStart hook adds the always-on rule to each session in projects that have `dld.config.yaml` and do not already load the rule. `/dld-init` also installs `.claude/rules/dld-workflow.md`, so teammates without the plugin get the rule too.
|
|
61
|
-
|
|
62
|
-
Skills run as `/dld-plan`, or as `/dld:dld-plan` if another skill has the same name. Third-party marketplaces do not auto-update by default. To update:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
claude plugin marketplace update dld-kit
|
|
66
|
-
claude plugin update dld@dld-kit
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Codex and Copilot CLI plugins
|
|
70
|
-
|
|
71
|
-
Both install the portable skills from the repository root, with no hook.
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
codex plugin marketplace add jimutt/dld-kit # then install dld from /plugins in Codex
|
|
75
|
-
copilot plugin marketplace add jimutt/dld-kit
|
|
76
|
-
copilot plugin install dld@dld-kit
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Then run the dld-init skill in each project for the config and the rule. For Copilot CLI it installs the rule as for Codex.
|
|
80
|
-
|
|
81
|
-
### Pi package
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
pi install npm:dld-kit # for your user
|
|
85
|
-
pi install -l npm:dld-kit # for this project (.pi/settings.json)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Run `/skill:dld-init` in each project for the config and the rule. Update with `pi update npm:dld-kit`.
|
|
89
|
-
|
|
90
|
-
### `npx skills` or `gh skill`
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
npx skills add jimutt/dld-kit
|
|
94
|
-
gh skill install jimutt/dld-kit --all
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Install all the skills. If you pick some with `--skill`, include `dld-common`: it holds the `dld` CLI the other skills run. Then run the dld-init skill in each project for the config and the rule. Update with `npx skills update` or `gh skill update`.
|
|
98
|
-
|
|
99
|
-
`npx skills` puts the files in `.agents/skills/` and links them from `.claude/skills/` for Claude Code. `dld update` refuses to write through those links; keep updating with `npx skills update`.
|
|
100
|
-
|
|
101
|
-
### Manual copy
|
|
102
|
-
|
|
103
|
-
Copy the `dld-*` directories from [`skills/`](skills/) into your agent's skills directory, or from [`.claude/skills/`](.claude/skills/) into a project's `.claude/skills/` for Claude Code. Include `dld-common`. Then run the dld-init skill for the config and the rule.
|
|
104
|
-
|
|
105
|
-
### Combining channels
|
|
106
|
-
|
|
107
|
-
Channels can be combined. These combinations need care:
|
|
108
|
-
|
|
109
|
-
- **A user-level plugin or package, plus skills committed in the project for the same agent.** The agent sees each skill twice, possibly at different versions. In Claude Code, run the plugin's copy as `/dld:dld-plan`.
|
|
110
|
-
- **Skills for Claude Code and for an `.agents/skills/` agent in one project.** OpenCode and Cursor read both `.claude/skills/` and `.agents/skills/`. OpenCode 2.x loads the `.agents/skills/` copy; OpenCode 1.x and Cursor may load either. Both copies work.
|
|
111
|
-
- **`dld update` and `npx skills` on the same skills.** `dld update` refuses symlinked skills and warns when `skills-lock.json` lists `dld-*` skills. Update those skills with one tool.
|
|
112
|
-
|
|
113
|
-
### Agents
|
|
114
|
-
|
|
115
|
-
| Agent | Skills (`dld init`) | Always-on rule (`dld init`, `/dld-init`) | Run a skill |
|
|
116
|
-
|---|---|---|---|
|
|
117
|
-
| Claude Code | `.claude/skills/` | `.claude/rules/dld-workflow.md`, or the block in `CLAUDE.md`, or in `AGENTS.md` imported from a CLAUDE file (`@AGENTS.md`) | `/dld-plan` |
|
|
118
|
-
| Antigravity | `.agents/skills/` | `.agents/rules/dld-workflow.md` | Ask for the dld-plan skill |
|
|
119
|
-
| Codex | `.agents/skills/` | Block in `AGENTS.md` | Ask for the dld-plan skill |
|
|
120
|
-
| Cursor | `.agents/skills/` | Block in `AGENTS.md` or `CLAUDE.md` (Cursor reads both) | Ask for the dld-plan skill |
|
|
121
|
-
| OpenCode | `.agents/skills/` | Block in `AGENTS.md` (OpenCode 2.x reads no `CLAUDE.md`) | Ask for the dld-plan skill |
|
|
122
|
-
| Pi | `.agents/skills/` | Block in `AGENTS.md`, or `CLAUDE.md` if there is no `AGENTS.md` | `/skill:dld-plan` |
|
|
123
|
-
| Copilot CLI | Plugin only | Block in `AGENTS.md` (installed as for Codex) | Ask for the dld-plan skill |
|
|
124
|
-
|
|
125
|
-
A new block goes into `AGENTS.md` if it exists. Otherwise it goes into an existing `CLAUDE.md` only when every selected agent that takes the block (Codex, Cursor, OpenCode, Pi) reads that file, which Cursor and Pi do, and into a new `AGENTS.md` in all other cases. Pi reads `CLAUDE.md` only while there is no `AGENTS.md`, so when `dld` creates `AGENTS.md` next to a `CLAUDE.md` for Pi, it warns you to move anything Pi needs. A block already in `CLAUDE.md` stays there; `dld install-rule` warns about agents that cannot see it (Codex, OpenCode) and says how to move it.
|
|
126
|
-
|
|
127
|
-
Each agent gets the rule once. Claude Code reads `AGENTS.md` by itself only when the project has no `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md`, so adding one of those (even an uncommitted `CLAUDE.local.md`) would stop it. When the block is in `AGENTS.md` and the project has no `CLAUDE.md` or `.claude/CLAUDE.md`, `init` writes `.claude/CLAUDE.md` with the line `@../AGENTS.md`. Claude Code then loads `AGENTS.md` through that import, once, whichever CLAUDE files are added later. If a `CLAUDE.md` of yours already imports `@AGENTS.md`, the block there is Claude Code's rule and no other file is written.
|
|
128
|
-
|
|
129
|
-
The examples below use Claude Code's `/dld-plan` form. In other agents, name the skill instead, e.g. "use the dld-plan skill to plan the retry feature".
|
|
130
|
-
|
|
131
|
-
### Upgrading from 0.x
|
|
132
|
-
|
|
133
|
-
Before 1.0, the skills were copied by hand or installed with Tessl, each skill carried `scripts/*.sh`, and `/dld-init` appended a `## DLD (Decision-Linked Development)` section to `CLAUDE.md`.
|
|
134
|
-
|
|
135
|
-
- **Your data carries over unchanged:** `dld.config.yaml`, `decisions/records/`, `decisions/INDEX.md` and `decisions/.dld-state.yaml`. 1.0 reads them as 0.x wrote them.
|
|
136
|
-
- **Skills copied into `.claude/skills/` or `.agents/skills/`:** in the project, run `npx dld-kit@latest update --agent <names>` (e.g. `--agent claude,codex`). It rewrites the `dld-*` skills, deletes their old `scripts/*.sh`, and installs the always-on rule. Commit the result.
|
|
137
|
-
- **Skills copied anywhere else** (e.g. `.cursor/skills/`, `.codex/skills/`): delete those `dld-*` directories, then run the same `update`.
|
|
138
|
-
- **Tessl installs:** remove the `dld-kit/dld` tile with Tessl, and delete any DLD rule text Tessl added. Then run `update`. The Tessl tile gets no new versions.
|
|
139
|
-
- **The old `CLAUDE.md` section:** once the rule is installed, delete the `## DLD (Decision-Linked Development)` section yourself. Until then Claude Code and Cursor read the rule twice. `update` warns while the section is there, and never edits it.
|
|
140
|
-
- **To use the plugin or `npx skills` instead:** delete the copied `dld-*` directories and the old `CLAUDE.md` section first, then install through that channel.
|
|
141
|
-
|
|
142
|
-
## Get started
|
|
143
|
-
|
|
144
|
-
### New feature or change
|
|
145
|
-
|
|
146
|
-
Use `/dld-plan` to break it down into decisions, then implement:
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
/dld-init # Bootstrap DLD in your repo (run once)
|
|
150
|
-
/dld-plan # Break it down into decisions interactively
|
|
151
|
-
/dld-adjust DL-001 # Refine decisions if details change before implementing
|
|
152
|
-
/dld-implement DL-001 # Implement each decision (or batch related ones)
|
|
153
|
-
/dld-snapshot # Generate overview docs from the decision log
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
For a small, isolated change (a bug fix, a single design choice), `/dld-decide` records one decision directly without the planning step.
|
|
157
|
-
|
|
158
|
-
### Existing codebase
|
|
27
|
+
`init` asks which agents your team uses, suggesting the ones it finds. It then writes `dld.config.yaml`, a `decisions/` folder, the DLD skills and a short always-on rule that tells the agent to look decisions up. Commit the files; teammates don't need to install dld-kit.
|
|
159
28
|
|
|
160
|
-
|
|
29
|
+
Then, in your agent:
|
|
161
30
|
|
|
162
31
|
```
|
|
163
|
-
/dld-
|
|
164
|
-
/dld-
|
|
165
|
-
/dld-snapshot
|
|
32
|
+
/dld-plan add retries to the payment client
|
|
33
|
+
/dld-implement
|
|
34
|
+
/dld-snapshot
|
|
166
35
|
```
|
|
167
36
|
|
|
168
|
-
|
|
37
|
+
`/dld-plan` talks the feature through with you and records proposed decisions. `/dld-implement` writes the code, has it reviewed, and adds the `@decision` comments. `/dld-snapshot` regenerates `OVERVIEW.md` and `SNAPSHOT.md` from the decisions.
|
|
169
38
|
|
|
170
|
-
|
|
39
|
+
These are Claude Code's slash commands. In Pi, use `/skill:dld-plan`. In other agents, ask for the skill by name: "use the dld-plan skill to plan retries for the payment client".
|
|
171
40
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
```
|
|
175
|
-
/dld-reindex # Renames the local draft(s) to the next free ID,
|
|
176
|
-
# rewrites @decision annotations and cross-references,
|
|
177
|
-
# squashes the branch into a single rebase-clean commit
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Run this before rebasing onto an updated base. The skill resolves the ID against the base branch and, when `gh` is installed and authenticated, also against open PRs so the new IDs don't collide with someone else's in-flight work.
|
|
41
|
+
For a small, one-off choice, `/dld-decide` records a single decision. For an existing codebase, start with `/dld-retrofit`. To install DLD in your own agent setup rather than in the repository, see [Install](#install).
|
|
181
42
|
|
|
182
43
|
## How it works
|
|
183
44
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### The decision record
|
|
187
|
-
|
|
188
|
-
Each decision is a markdown file with YAML frontmatter:
|
|
45
|
+
A **decision** is a markdown file in `decisions/records/`:
|
|
189
46
|
|
|
190
47
|
```markdown
|
|
191
48
|
---
|
|
192
|
-
id: DL-
|
|
49
|
+
id: DL-012
|
|
193
50
|
title: "Use exponential backoff for payment gateway retries"
|
|
194
51
|
timestamp: 2026-02-15T09:20:00Z
|
|
195
52
|
status: accepted
|
|
196
|
-
|
|
197
|
-
amends: []
|
|
198
|
-
tags: [payments, resilience]
|
|
53
|
+
tags: [payments]
|
|
199
54
|
references:
|
|
200
55
|
- path: src/payments/gateway.ts
|
|
201
|
-
symbol: retryWithBackoff
|
|
202
56
|
---
|
|
203
57
|
|
|
204
58
|
## Context
|
|
205
|
-
The
|
|
206
|
-
fixed-interval retry (DL-002) caused retry storms that made things worse.
|
|
59
|
+
The gateway returns 503s under load. Fixed-interval retries made it worse.
|
|
207
60
|
|
|
208
61
|
## Decision
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
## Rationale
|
|
212
|
-
Exponential backoff prevents retry storms. Jitter avoids thundering herd
|
|
213
|
-
when multiple requests fail simultaneously...
|
|
214
|
-
|
|
215
|
-
## Consequences
|
|
216
|
-
Failed payments take longer to resolve (up to ~60s worst case)...
|
|
62
|
+
Exponential backoff with jitter, capped at 30 seconds, at most 5 attempts.
|
|
217
63
|
```
|
|
218
64
|
|
|
219
|
-
|
|
65
|
+
A full record also has Rationale and Consequences sections; see the [decision record format](docs/framework/decision-record-format.md).
|
|
66
|
+
|
|
67
|
+
An **annotation** links code to the decision:
|
|
220
68
|
|
|
221
69
|
```typescript
|
|
222
|
-
// @decision(DL-
|
|
70
|
+
// @decision(DL-012)
|
|
223
71
|
function retryWithBackoff(fn: () => Promise<Response>): Promise<Response> {
|
|
224
|
-
// ...
|
|
225
|
-
}
|
|
226
72
|
```
|
|
227
73
|
|
|
228
|
-
|
|
74
|
+
The **always-on rule** is a short instruction installed for each agent: read the decision behind an annotation before changing that code. If a change would contradict it, the agent checks with you, and a new decision records the change.
|
|
229
75
|
|
|
230
|
-
|
|
76
|
+
- **Accepted decisions aren't rewritten.** Once a decision is `accepted` and shared, you don't edit its reasoning. To change course, record a new decision that supersedes or amends it, so the history stays complete. Only metadata such as `status` and `references` gets updated. Statuses run `proposed` → `accepted` → `superseded` or `deprecated`.
|
|
77
|
+
- **The docs are generated.** `/dld-snapshot` builds `OVERVIEW.md` and `SNAPSHOT.md` from the decisions. You never edit a spec by hand.
|
|
78
|
+
- **Drift gets caught.** `/dld-audit` finds annotations without a decision, references to files that no longer exist, and annotated code that changed.
|
|
79
|
+
- **Conventions live in one file.** An optional `decisions/PRACTICES.md` holds your testing, style and architecture conventions, and `/dld-implement` follows it.
|
|
231
80
|
|
|
232
|
-
|
|
81
|
+
DLD gives agents context, not guarantees. Keep your tests.
|
|
233
82
|
|
|
234
|
-
|
|
83
|
+
## Workflows
|
|
235
84
|
|
|
236
|
-
- **
|
|
237
|
-
- **
|
|
238
|
-
- **
|
|
85
|
+
- **New feature:** `/dld-plan`, then `/dld-implement`, then `/dld-snapshot`. `/dld-adjust` refines a decision before it's implemented.
|
|
86
|
+
- **Small change:** `/dld-decide` records one decision, then `/dld-implement`.
|
|
87
|
+
- **Existing codebase:** `/dld-retrofit` writes decisions and annotations for code you already have. Follow it with `/dld-snapshot`.
|
|
88
|
+
- **Hands-off:** after a one-time `/dld-retrofit`, run `/dld-audit-auto` and `/dld-snapshot` on a schedule or in CI. The audit finds changes to annotated code that no decision covers, records decisions for them and opens a PR, so nobody has to change how they work.
|
|
89
|
+
- **Teams:** two branches can pick the same `DL-NNN`. When the other one gets there first, run `/dld-reindex`. It renames your drafts to free IDs, updates everything that refers to them, and commits the renames on top of your branch.
|
|
239
90
|
|
|
240
|
-
|
|
91
|
+
More detail, with diagrams: [workflows](docs/workflows.md).
|
|
241
92
|
|
|
242
93
|
## Skills
|
|
243
94
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
|
247
|
-
|
|
248
|
-
| `/dld-
|
|
249
|
-
| `/dld-
|
|
250
|
-
| `/dld-
|
|
251
|
-
| `/dld-
|
|
252
|
-
| `/dld-
|
|
253
|
-
| `/dld-
|
|
254
|
-
| `/dld-
|
|
255
|
-
| `/dld-
|
|
256
|
-
| `/dld-
|
|
257
|
-
| `/dld-
|
|
258
|
-
| `/dld-retrofit` | Bootstrap decisions from an existing codebase (broad or detailed mode) |
|
|
259
|
-
| `/dld-reindex` | Resolve decision ID collisions with the base branch (and open PRs) before rebasing — renames colliding local drafts, rewrites annotations and cross-references, squashes branch commits into a rebase-clean reindex commit |
|
|
260
|
-
|
|
261
|
-
### Active workflow
|
|
262
|
-
|
|
263
|
-
The core DLD loop: record decisions via `/dld-decide` or `/dld-plan`, implement them with `/dld-implement`, and the framework maintains tight coupling between the decision log and code through `@decision` annotations. `/dld-audit` periodically checks for drift, and `/dld-snapshot` regenerates the derived specification.
|
|
264
|
-
|
|
265
|
-
<img width="3180" height="2100" alt="DLD high-level workflow overview showing the decision log, code annotations, generated specification, and drift detection" src="https://github.com/user-attachments/assets/fc8b7804-10ce-439b-ba0c-1f431a26a46e" />
|
|
266
|
-
|
|
267
|
-
### Passive mode
|
|
268
|
-
|
|
269
|
-
For teams that want living documentation without changing how they work. Run `/dld-init` and `/dld-retrofit` once to bootstrap, then schedule `/dld-audit-auto` and `/dld-snapshot` to run automatically (e.g. nightly via CI). The audit detects unreferenced code changes, infers new decisions, and back-annotates the code — all without developers invoking any DLD commands during their normal workflow.
|
|
270
|
-
|
|
271
|
-
<img width="2880" height="2760" alt="DLD passive mode showing scheduled automation that keeps decisions and docs in sync without workflow changes" src="https://github.com/user-attachments/assets/36bba4e1-e8eb-4390-a484-f18f54638fa1" />
|
|
272
|
-
|
|
273
|
-
> [!NOTE]
|
|
274
|
-
> DLD doesn't include a scheduler. How you trigger the automated runs is up to you — [Claude Code's built-in cron support](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2171), a CI pipeline step, or any other external scheduler all work.
|
|
275
|
-
|
|
276
|
-
## Project structure
|
|
277
|
-
|
|
278
|
-
### Flat mode (default)
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
dld.config.yaml
|
|
282
|
-
decisions/
|
|
283
|
-
INDEX.md # Auto-generated decision index
|
|
284
|
-
SNAPSHOT.md # Detailed per-decision reference
|
|
285
|
-
OVERVIEW.md # Narrative synthesis with Mermaid diagrams
|
|
286
|
-
PRACTICES.md # Development practices manifest (optional)
|
|
287
|
-
.dld-state.yaml # Last audit and snapshot runs
|
|
288
|
-
records/
|
|
289
|
-
DL-001.md
|
|
290
|
-
DL-002.md
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Namespaced mode (monorepos)
|
|
95
|
+
| Skill | What it does |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `/dld-init` | Set up DLD in a repository: config, decisions folder and always-on rule |
|
|
98
|
+
| `/dld-plan` | Break a feature into proposed decisions |
|
|
99
|
+
| `/dld-decide` | Record one decision |
|
|
100
|
+
| `/dld-implement` | Implement proposed decisions, with a review step |
|
|
101
|
+
| `/dld-adjust` | Change a decision, following the rules for its status |
|
|
102
|
+
| `/dld-lookup` | Find decisions by ID, tag, file or keyword |
|
|
103
|
+
| `/dld-status` | Summarize the decision log |
|
|
104
|
+
| `/dld-audit` | Find drift between decisions and code |
|
|
105
|
+
| `/dld-audit-auto` | Audit, fix and open a PR, for scheduled runs |
|
|
106
|
+
| `/dld-snapshot` | Generate `OVERVIEW.md` and `SNAPSHOT.md` from the decisions |
|
|
107
|
+
| `/dld-retrofit` | Write decisions for existing code, broadly or in detail |
|
|
108
|
+
| `/dld-reindex` | Fix decision ID clashes with the base branch and open PRs |
|
|
294
109
|
|
|
295
|
-
|
|
296
|
-
dld.config.yaml
|
|
297
|
-
decisions/
|
|
298
|
-
INDEX.md
|
|
299
|
-
SNAPSHOT.md
|
|
300
|
-
OVERVIEW.md
|
|
301
|
-
PRACTICES.md
|
|
302
|
-
records/
|
|
303
|
-
billing/
|
|
304
|
-
DL-001.md
|
|
305
|
-
DL-004.md
|
|
306
|
-
PRACTICES.md # Namespace-specific practices (optional)
|
|
307
|
-
auth/
|
|
308
|
-
DL-002.md
|
|
309
|
-
DL-005.md
|
|
310
|
-
```
|
|
110
|
+
## Install
|
|
311
111
|
|
|
312
|
-
|
|
112
|
+
Every option installs the same skills. You need Node.js 20+ and git. `gh` is optional: `/dld-reindex` uses it to check open PRs.
|
|
313
113
|
|
|
314
|
-
|
|
114
|
+
### Which one to use
|
|
315
115
|
|
|
316
|
-
|
|
317
|
-
proposed --> accepted --> deprecated
|
|
318
|
-
--> superseded (by a newer decision)
|
|
319
|
-
```
|
|
116
|
+
**Not sure? Run `npx dld-kit init` in the repository and commit the result.** It works for every supported agent except Copilot CLI, which uses the plugin, and teammates don't need to install dld-kit.
|
|
320
117
|
|
|
321
|
-
- **
|
|
322
|
-
- **
|
|
323
|
-
- **
|
|
324
|
-
- **
|
|
118
|
+
- **Use `npx dld-kit init` if** DLD is for a shared repository, the team uses more than one agent, or you want the setup reviewed and versioned with the code. This fits most projects, new or existing.
|
|
119
|
+
- **Use the Claude Code plugin if** you use Claude Code and want DLD in your own setup across many repositories, without committing skills to each one. Run `/dld-init` once per repository for the config and the rule.
|
|
120
|
+
- **Use the Pi package, or the Codex or Copilot CLI plugin,** for the same setup in those agents.
|
|
121
|
+
- **Use `npx skills` or `gh skill` if** you already manage your agents' skills with that tool. Then update with it, not with `dld update`.
|
|
325
122
|
|
|
326
|
-
|
|
123
|
+
Use one option per agent in each repository. If you commit skills with `init` and also install a plugin, the agent sees every skill twice.
|
|
327
124
|
|
|
328
|
-
|
|
125
|
+
| Option | Agents | Install | Update |
|
|
126
|
+
|---|---|---|---|
|
|
127
|
+
| [`npx dld-kit init`](docs/install.md#npx-dld-kit-init) | Claude Code, Antigravity, Codex, Cursor, OpenCode, Pi | `npx dld-kit init` | `npx dld-kit@latest update` |
|
|
128
|
+
| [Claude Code plugin](docs/install.md#claude-code-plugin) | Claude Code | `/plugin marketplace add jimutt/dld-kit`, then `/plugin install dld@dld-kit` | `claude plugin marketplace update dld-kit`, then `claude plugin update dld@dld-kit` |
|
|
129
|
+
| [Codex and Copilot CLI plugins](docs/install.md#codex-and-copilot-cli-plugins) | Codex, Copilot CLI | `codex plugin marketplace add jimutt/dld-kit`, then install `dld` from `/plugins`; `copilot plugin marketplace add jimutt/dld-kit`, then `copilot plugin install dld@dld-kit` | Codex's plugin manager; `copilot plugin update` |
|
|
130
|
+
| [Pi package](docs/install.md#pi-package) | Pi | `pi install npm:dld-kit` | `pi update npm:dld-kit` |
|
|
131
|
+
| [`npx skills` / `gh skill`](docs/install.md#npx-skills-or-gh-skill) | Any agent those tools support | `npx skills add jimutt/dld-kit`; `gh skill install jimutt/dld-kit --all` | `npx skills update`; `gh skill update` |
|
|
132
|
+
| [Manual copy](docs/install.md#manual-copy) | Any Agent Skills agent | Copy the `dld-*` folders from [`skills/`](skills/) | Copy again |
|
|
329
133
|
|
|
330
|
-
|
|
134
|
+
With any option except `init`, run the dld-init skill once in each repository to create the config and install the rule.
|
|
331
135
|
|
|
332
|
-
|
|
136
|
+
<a name="combining-channels"></a><a name="agents"></a><a name="manual-rule-setup"></a><a name="npx-dld-kit-init"></a><a name="claude-code-plugin"></a>
|
|
137
|
+
See [install details](docs/install.md) for where each agent keeps its skills and rule, how to combine options, and how to add the rule by hand.
|
|
333
138
|
|
|
334
|
-
|
|
139
|
+
### Upgrading from 0.x
|
|
335
140
|
|
|
336
|
-
|
|
141
|
+
Your config, decisions, index and state carry over as they are. In the repository, run `npx dld-kit@latest update --agent <names>` (for example `--agent claude,codex`) and commit the result. It replaces the copied skills and their scripts, and installs the always-on rule. Then delete the old `## DLD (Decision-Linked Development)` section from `CLAUDE.md`.
|
|
337
142
|
|
|
338
|
-
|
|
143
|
+
Tessl installs and skills copied to other folders need one more step first: see [upgrading from 0.x](docs/upgrading-from-0x.md).
|
|
339
144
|
|
|
340
|
-
##
|
|
145
|
+
## Configuration
|
|
341
146
|
|
|
342
|
-
|
|
147
|
+
`dld.config.yaml` holds the settings. The ones you're most likely to change:
|
|
343
148
|
|
|
344
|
-
|
|
149
|
+
- **`mode: namespaced`** with a `namespaces` list gives each area of a monorepo its own decision folder (`npx dld-kit init --namespaces billing,auth`). IDs stay unique across namespaces.
|
|
150
|
+
- **`implement_review: false`** skips the review subagent in `/dld-implement`.
|
|
151
|
+
- **`snapshot_artifacts`** adds documents for `/dld-snapshot` to generate, each from a prompt you write.
|
|
152
|
+
- **`annotation_exclude`** lists paths whose `@decision` comments are only examples, such as docs.
|
|
345
153
|
|
|
346
|
-
|
|
347
|
-
snapshot_artifacts:
|
|
348
|
-
- title: ONBOARDING.md
|
|
349
|
-
prompt: >
|
|
350
|
-
Generate a developer onboarding guide that explains the system
|
|
351
|
-
from scratch, assuming no prior context. Focus on what a new
|
|
352
|
-
contributor needs to know to start working.
|
|
353
|
-
- title: API-CONTRACTS.md
|
|
354
|
-
prompt: >
|
|
355
|
-
Summarize all API-related decisions into a single API contract
|
|
356
|
-
reference. Include endpoints, payload shapes, and auth requirements.
|
|
357
|
-
```
|
|
154
|
+
All the options: [project configuration](docs/framework/project-configuration.md).
|
|
358
155
|
|
|
359
|
-
|
|
156
|
+
## DLD and spec-driven development
|
|
360
157
|
|
|
361
|
-
|
|
158
|
+
Spec-driven tools such as [Spec Kit](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/), [OpenSpec](https://openspec.dev/) and [Kiro](https://kiro.dev/) work well, especially for new projects. If they fit your team, use them. DLD is for long-lived code, where specs tend to go stale:
|
|
362
159
|
|
|
363
|
-
|
|
160
|
+
- **Decisions instead of a spec.** You record each decision once and never rewrite it, so the history of why the code looks the way it does stays complete.
|
|
161
|
+
- **The spec is generated.** The overview docs are built from the decisions, the way event sourcing builds a read model from events.
|
|
162
|
+
- **The context sits in the code.** An annotation next to the code sends the agent straight to the reasoning.
|
|
364
163
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
```yaml
|
|
368
|
-
implement_review: false
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
The review subagent operates with limited context and may flag false positives. The implementing agent uses its own judgment and asks for user input when uncertain about a finding.
|
|
164
|
+
More in the [FAQ](docs/concept/dld-faq.md) and the [concept paper](docs/concept/dld-concept.md).
|
|
372
165
|
|
|
373
166
|
## CLI
|
|
374
167
|
|
|
375
|
-
|
|
168
|
+
Run `npx dld-kit <command>`, or `npm install --global dld-kit` for a `dld` command. The skills carry their own copy of the CLI, so they never need a global install.
|
|
376
169
|
|
|
377
170
|
| Command | What it does |
|
|
378
171
|
|---|---|
|
|
379
|
-
| `dld init` |
|
|
380
|
-
| `dld update` |
|
|
381
|
-
| `dld install-rule --agent <names>` |
|
|
382
|
-
| `dld session-context --agent <name>` |
|
|
383
|
-
| `dld --help` | Lists the setup commands above, then the commands the skills run |
|
|
172
|
+
| `dld init` | Set up DLD, the skills and the always-on rule |
|
|
173
|
+
| `dld update` | Update the installed skills and rule; `--agent` adds agents |
|
|
174
|
+
| `dld install-rule --agent <names>` | Install or refresh only the always-on rule |
|
|
175
|
+
| `dld session-context --agent <name>` | Print the rule for a session hook, unless the agent loads it already (used by the Claude Code plugin) |
|
|
384
176
|
|
|
385
|
-
`init` and `update`
|
|
177
|
+
`init` and `update` won't overwrite files from a newer dld-kit unless you pass `--force`.
|
|
386
178
|
|
|
387
|
-
|
|
179
|
+
These four commands, with their flags, exit codes and documented output, follow semantic versioning, as do `--help` and `--version`. The other commands in `dld --help` (`next-id`, `create-decision`, `regenerate-index` and so on) are internal: the skills run them from their bundled copy, and they can change in a minor release. Don't script against them.
|
|
388
180
|
|
|
389
|
-
##
|
|
181
|
+
## Learn more
|
|
390
182
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
183
|
+
- [Concept paper](docs/concept/dld-concept.md): the full reasoning behind DLD
|
|
184
|
+
- [TL;DR](docs/concept/dld-tldr.md) and [FAQ](docs/concept/dld-faq.md)
|
|
185
|
+
- [Decision record format](docs/framework/decision-record-format.md) and [project configuration](docs/framework/project-configuration.md)
|
|
186
|
+
- [Install details](docs/install.md), [workflows](docs/workflows.md) and [upgrading from 0.x](docs/upgrading-from-0x.md)
|
|
187
|
+
- [Skill design plan](docs/plan/skill-design.md): what each skill does, in detail
|
|
188
|
+
- [Contributing](CONTRIBUTING.md) and [releasing](docs/releasing.md)
|
|
395
189
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
## Further reading
|
|
399
|
-
|
|
400
|
-
- [Concept paper](docs/concept/dld-concept.md) — full rationale and design philosophy
|
|
401
|
-
- [TL;DR](docs/concept/dld-tldr.md) — one-page summary
|
|
402
|
-
- [FAQ](docs/concept/dld-faq.md) — anticipated questions
|
|
403
|
-
- [Decision record format](docs/framework/decision-record-format.md) — schema and field reference
|
|
404
|
-
- [Project configuration](docs/framework/project-configuration.md) — config file and directory layout
|
|
405
|
-
- [Skill design plan](docs/plan/skill-design.md) — detailed skill specifications
|
|
190
|
+
Ideas and bug reports are welcome: [open an issue](https://github.com/jimutt/dld-kit/issues).
|
|
406
191
|
|
|
407
192
|
## Acknowledgements
|
|
408
193
|
|
|
409
|
-
DLD builds on
|
|
410
|
-
|
|
411
|
-
- **[Architecture Decision Records (ADRs)](https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions)** — Michael Nygard's foundational concept (2011) of recording architectural decisions as structured documents. DLD extends ADRs to cover all decision types and adds code-level coupling.
|
|
412
|
-
- **[Embedded ADRs (e-adr)](https://github.com/adr/e-adr)** — Pioneered `@ADR` annotations in Java code, linking decisions to classes and methods. DLD generalizes this to be language-agnostic and AI-agent-aware.
|
|
413
|
-
- **[Vibe ADR](https://medium.com/devops-ai/vibe-adr-building-with-intention-in-the-age-of-ai-d01e93f36696)** — Owen Zanzal's concept of decision records as "living nodes of intent" for both humans and AI.
|
|
414
|
-
- **[OpenSpec](https://openspec.dev/)** — A change-based specification framework with a delta model and archive workflow. Its brownfield-first philosophy and incremental approach validated key assumptions behind DLD.
|
|
415
|
-
- **[Spec Kit](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/)** — GitHub's spec-driven development toolkit. DLD shares the goal of giving AI agents better context but inverts the relationship — the spec is derived from decisions rather than being the primary artifact.
|
|
416
|
-
- **[IIC Kit (Intent Integrity Kit)](https://github.com/docsforadobe/intent-integrity-for-claude-code)** — A constitution-driven framework for Claude Code that influenced DLD's skill organization and practices manifest approach.
|
|
417
|
-
- **[Kiro](https://kiro.dev/)** — AWS's spec-driven development IDE, part of the broader SDD movement that motivated DLD's alternative approach.
|
|
418
|
-
- **Event Sourcing / CQRS** — The architectural pattern behind DLD's core model: decisions as an append-only event stream, specs as derived projections.
|
|
419
|
-
- **[ADR community resources](https://adr.github.io)** — The comprehensive collection of ADR tools, templates, and guidance that provided a foundation for DLD's record format.
|
|
420
|
-
|
|
421
|
-
See the [concept paper](docs/concept/dld-concept.md) for a detailed discussion of how DLD relates to these approaches.
|
|
422
|
-
|
|
423
|
-
## Roadmap
|
|
424
|
-
|
|
425
|
-
DLD is under active development. Feature requests and ideas are welcome — [open an issue](https://github.com/jimutt/dld-kit/issues).
|
|
426
|
-
|
|
427
|
-
## Manual rule setup
|
|
428
|
-
|
|
429
|
-
The always-on rule tells the agent to read a decision before changing code annotated with it. `/dld-init` installs it with `dld install-rule --agent <harness>`, which picks the file the harness loads: `.claude/rules/dld-workflow.md` for Claude Code (unless it reads the block in `AGENTS.md`, directly or through a `.claude/CLAUDE.md` import), `.agents/rules/dld-workflow.md` for Antigravity, or a marked block in `AGENTS.md` (or `CLAUDE.md`) for Codex, Cursor, OpenCode and Pi.
|
|
430
|
-
|
|
431
|
-
To add it by hand instead, copy [`templates/rules/dld-workflow.md`](templates/rules/dld-workflow.md) into one of those files.
|
|
194
|
+
DLD builds on [Architecture Decision Records](https://www.cognitect.com/blog/2011/11/15/documenting-architecture-decisions), [Embedded ADRs](https://github.com/adr/e-adr), [Vibe ADR](https://medium.com/devops-ai/vibe-adr-building-with-intention-in-the-age-of-ai-d01e93f36696), [OpenSpec](https://openspec.dev/), [Spec Kit](https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/), [IIC Kit](https://github.com/docsforadobe/intent-integrity-for-claude-code), [Kiro](https://kiro.dev/) and event sourcing. See [what each one contributed](docs/concept/acknowledgements.md).
|
|
432
195
|
|
|
433
196
|
## License
|
|
434
197
|
|