@eltonssouza/development-utility-kit 0.10.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.
- package/.claude/agents/README.md +24 -0
- package/.claude/agents/analyst.md +198 -0
- package/.claude/agents/backend-developer.md +126 -0
- package/.claude/agents/brain-keeper.md +229 -0
- package/.claude/agents/code-reviewer.md +181 -0
- package/.claude/agents/database-engineer.md +94 -0
- package/.claude/agents/devops-engineer.md +141 -0
- package/.claude/agents/frontend-developer.md +97 -0
- package/.claude/agents/gate-keeper.md +118 -0
- package/.claude/agents/migrator.md +291 -0
- package/.claude/agents/mobile-developer.md +80 -0
- package/.claude/agents/n8n-specialist.md +94 -0
- package/.claude/agents/product-owner.md +115 -0
- package/.claude/agents/qa-engineer.md +232 -0
- package/.claude/agents/release-engineer.md +204 -0
- package/.claude/agents/scaffold.md +87 -0
- package/.claude/agents/security-engineer.md +199 -0
- package/.claude/agents/sprint-runner.md +46 -0
- package/.claude/agents/stack-resolver.md +104 -0
- package/.claude/agents/tech-lead.md +182 -0
- package/.claude/agents/update-template.md +54 -0
- package/.claude/agents/ux-designer.md +118 -0
- package/.claude/hooks/flow-guard.js +261 -0
- package/.claude/hooks/flow-state.js +197 -0
- package/.claude/local/CLAUDE.md +71 -0
- package/.claude/settings.json +55 -0
- package/.claude/skills/README.md +331 -0
- package/.claude/skills/active-project/SKILL.md +131 -0
- package/.claude/skills/api-integration-test/SKILL.md +84 -0
- package/.claude/skills/auto-test-guard/SKILL.md +239 -0
- package/.claude/skills/auto-test-guard/resources/backend-tests.md +20 -0
- package/.claude/skills/auto-test-guard/resources/e2e-tests.md +24 -0
- package/.claude/skills/auto-test-guard/resources/execution-report.md +49 -0
- package/.claude/skills/auto-test-guard/resources/frontend-tests.md +18 -0
- package/.claude/skills/auto-test-guard/resources/initial-setup.md +108 -0
- package/.claude/skills/auto-test-guard/resources/run-suite.md +48 -0
- package/.claude/skills/auto-test-guard/resources/senior-gate.md +19 -0
- package/.claude/skills/brain-keeper/SKILL.md +62 -0
- package/.claude/skills/brain-keeper/obsidian/app.json +9 -0
- package/.claude/skills/brain-keeper/obsidian/appearance.json +4 -0
- package/.claude/skills/brain-keeper/obsidian/core-plugins.json +20 -0
- package/.claude/skills/brain-keeper/obsidian/daily-notes.json +5 -0
- package/.claude/skills/brain-keeper/obsidian/graph.json +32 -0
- package/.claude/skills/brain-keeper/obsidian/snippets/folder-colors.css +90 -0
- package/.claude/skills/brain-keeper/obsidian/templates.json +5 -0
- package/.claude/skills/brain-keeper/templates/README.md +51 -0
- package/.claude/skills/brain-keeper/templates/adr.md +40 -0
- package/.claude/skills/brain-keeper/templates/bug.md +35 -0
- package/.claude/skills/brain-keeper/templates/daily.md +38 -0
- package/.claude/skills/brain-keeper/templates/feature.md +62 -0
- package/.claude/skills/brain-keeper/templates/meeting.md +34 -0
- package/.claude/skills/brain-keeper/templates/tech-debt.md +21 -0
- package/.claude/skills/caveman/SKILL.md +189 -0
- package/.claude/skills/create-stack-pack/SKILL.md +281 -0
- package/.claude/skills/grill-me/SKILL.md +80 -0
- package/.claude/skills/pair-debug/SKILL.md +288 -0
- package/.claude/skills/prd-ready-check/SKILL.md +86 -0
- package/.claude/skills/project-manager/SKILL.md +334 -0
- package/.claude/skills/quality-standards/SKILL.md +203 -0
- package/.claude/skills/quick-feature/SKILL.md +266 -0
- package/.claude/skills/run-sprint/SKILL.md +41 -0
- package/.claude/skills/scaffold/SKILL.md +60 -0
- package/.claude/skills/stack-discovery/SKILL.md +161 -0
- package/.claude/skills/test-coverage-auditor/SKILL.md +87 -0
- package/.claude/skills/to-issues/SKILL.md +163 -0
- package/.claude/skills/to-prd/SKILL.md +130 -0
- package/.claude/skills/update-template/SKILL.md +256 -0
- package/.claude/stacks/CODEOWNERS +30 -0
- package/.claude/stacks/README.md +97 -0
- package/.claude/stacks/_template.md +116 -0
- package/.claude/stacks/dotnet/aspire-9.md +528 -0
- package/.claude/stacks/go/gin-1.10.md +570 -0
- package/.claude/stacks/java/spring-boot-3.md +376 -0
- package/.claude/stacks/java/spring-boot-4.md +438 -0
- package/.claude/stacks/node/express-5.md +538 -0
- package/.claude/stacks/python/django-5.md +483 -0
- package/.claude/stacks/python/fastapi-0.115.md +522 -0
- package/.claude/stacks/typescript/angular-18.md +420 -0
- package/.claude/stacks/typescript/angular-19.md +397 -0
- package/.claude/stacks/typescript/angular-21.md +494 -0
- package/CLAUDE.md +472 -0
- package/README.md +412 -0
- package/bin/cli.js +848 -0
- package/bin/lib/adr.js +146 -0
- package/bin/lib/backup.js +62 -0
- package/bin/lib/detect-stack.js +476 -0
- package/bin/lib/doctor.js +527 -0
- package/bin/lib/help.js +328 -0
- package/bin/lib/identity.js +108 -0
- package/bin/lib/lint-allowlist.json +15 -0
- package/bin/lib/lint.js +798 -0
- package/bin/lib/local-dir.js +68 -0
- package/bin/lib/manifest.js +236 -0
- package/bin/lib/sync-all.js +394 -0
- package/bin/lib/version-check.js +398 -0
- package/dashboard/db.js +321 -0
- package/dashboard/package.json +22 -0
- package/dashboard/public/app.js +853 -0
- package/dashboard/public/content/docs/agents-reference.en.md +911 -0
- package/dashboard/public/content/docs/architecture-overview.en.md +252 -0
- package/dashboard/public/content/docs/autonomy-matrix.en.md +186 -0
- package/dashboard/public/content/docs/cli-reference.en.md +538 -0
- package/dashboard/public/content/docs/git-flow.en.md +525 -0
- package/dashboard/public/content/docs/honcho-memory.en.md +394 -0
- package/dashboard/public/content/docs/hooks-reference.en.md +404 -0
- package/dashboard/public/content/docs/pipeline.en.md +414 -0
- package/dashboard/public/content/docs/plugins.en.md +289 -0
- package/dashboard/public/content/docs/quality-gate.en.md +315 -0
- package/dashboard/public/content/docs/skills-reference.en.md +484 -0
- package/dashboard/public/content/docs/stack-rules.en.md +362 -0
- package/dashboard/public/content/docs/troubleshooting.en.md +565 -0
- package/dashboard/public/content/manifest.json +114 -0
- package/dashboard/public/content/manual/backend.en.md +1053 -0
- package/dashboard/public/content/manual/existing-project.en.md +848 -0
- package/dashboard/public/content/manual/frontend.en.md +1008 -0
- package/dashboard/public/content/manual/fullstack.en.md +1459 -0
- package/dashboard/public/content/manual/mobile.en.md +837 -0
- package/dashboard/public/content/manual/quickstart.en.md +169 -0
- package/dashboard/public/index.html +217 -0
- package/dashboard/public/style.css +857 -0
- package/dashboard/public/vendor/marked.min.js +69 -0
- package/dashboard/rtk.js +143 -0
- package/dashboard/server-app.js +421 -0
- package/dashboard/server.js +104 -0
- package/dashboard/test/sprint1.test.js +406 -0
- package/dashboard/test/sprint2.test.js +571 -0
- package/dashboard/test/sprint3.test.js +560 -0
- package/package.json +33 -0
- package/scripts/hooks/subagent-telemetry.sh +14 -0
- package/scripts/hooks/telemetry-writer.js +250 -0
- package/scripts/latest-versions.json +56 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
# CLI reference — `duk` commands
|
|
2
|
+
|
|
3
|
+
The `duk` CLI is the **mechanical surface** of the harness — everything deterministic, idempotent, and scriptable lives here (per ADR-034). For decisions that require contextual judgment (designing a feature, picking a stack, refactoring), use the chat layer (skills + agents). For everything that should run in CI without an LLM (validate environment, lint structure, install harness, scaffold project), use `duk`.
|
|
4
|
+
|
|
5
|
+
This page is the operational index. Each command has its own subsection with signature, options, examples, exit codes, and what breaks if it fails. Help inside the terminal is always one step away: `duk help` for the menu, `duk help <command>` for command-specific details.
|
|
6
|
+
|
|
7
|
+
Audience: developers integrating the harness into a project, ops/SRE running it in CI, and anyone debugging why `duk install` did not pick up a stack.
|
|
8
|
+
|
|
9
|
+
Reference: ADR-018 (CLI redesign), ADR-028 (workflow), ADR-034 (CLI vs Skill design principle).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Quick reference — all commands
|
|
14
|
+
|
|
15
|
+
| Command | Mode | Idempotent | Needs LLM | Typical use |
|
|
16
|
+
|---|---|---|---|---|
|
|
17
|
+
| `duk new <name>` | scaffold | yes (refuses if dir exists with content) | no | Brand-new project, opens Cowork pointing at the new folder |
|
|
18
|
+
| `duk install` | adopt | yes (drift detection refuses unsafe overwrites) | no | Inject `.claude/` + `CLAUDE.md` into an existing project |
|
|
19
|
+
| `duk update` | adopt (alias) | yes (same as `install`) | no | Pull harness updates into an already-adopted project |
|
|
20
|
+
| `duk sync-all <dir>` | batch | yes (dry-run by default) | no | Update harness across many projects at once |
|
|
21
|
+
| `duk dashboard` | server | yes (port auto-increment) | no | Boot local telemetry + docs UI |
|
|
22
|
+
| `duk doctor` | diagnose | yes | no | Validate environment (Node, git, hooks, packs, credentials) |
|
|
23
|
+
| `duk lint` | validate | yes | no | Validate harness `.claude/` structure (frontmatter, refs, ADRs, packs) |
|
|
24
|
+
| `duk help [command]` | meta | yes | no | Show usage or command-specific docs |
|
|
25
|
+
| `duk --version` | meta | yes | no | Print installed `duk` version |
|
|
26
|
+
|
|
27
|
+
All commands run on Node ≥18 and require `git` on `PATH`. Mechanical: no API call, no LLM, no network for `doctor`/`lint`/`help`/`--version`. Safe for CI.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## duk new — scaffold a new project
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
duk new <name>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Creates a brand-new folder `<name>` in the current directory, initialises a git repo, writes a `CLAUDE.md` template with an empty `## Project Identity` block, and injects the full `.claude/` harness (skills + agents + stacks + settings). Refuses if `<name>` already exists.
|
|
38
|
+
|
|
39
|
+
### Arguments
|
|
40
|
+
|
|
41
|
+
- `<name>` — required. Project folder name. Kebab-case recommended (`payment-gateway`, not `PaymentGateway` or `payment_gateway`).
|
|
42
|
+
|
|
43
|
+
### Options
|
|
44
|
+
|
|
45
|
+
(none beyond `--help` and `--version`)
|
|
46
|
+
|
|
47
|
+
### What happens
|
|
48
|
+
|
|
49
|
+
1. `mkdir <name>` in the current directory.
|
|
50
|
+
2. `git init -q` in the new folder (non-fatal if git is not in PATH; warns and continues).
|
|
51
|
+
3. Calls the same code path as `duk install --force` to inject `.claude/` + `CLAUDE.md` (drift detection skipped — fresh folder).
|
|
52
|
+
4. Writes a placeholder `## Project Identity` block in `CLAUDE.md` for the user to fill via the `stack-discovery` skill.
|
|
53
|
+
5. Prints a next-steps banner.
|
|
54
|
+
|
|
55
|
+
### Examples
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
duk new my-app
|
|
59
|
+
cd my-app
|
|
60
|
+
# Open Cowork or Claude Code in this folder
|
|
61
|
+
# First chat message: "sabatina pra projeto novo"
|
|
62
|
+
# → stack-discovery skill walks through 8 questions, fills Project Identity
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Exit codes
|
|
66
|
+
|
|
67
|
+
- `0` — project created successfully.
|
|
68
|
+
- `1` — name missing, target dir already exists, or any fatal step (cannot create dir, etc.).
|
|
69
|
+
|
|
70
|
+
### What breaks if it fails
|
|
71
|
+
|
|
72
|
+
Nothing leaves residue: if the script fails mid-way, the partially created folder is left for the user to inspect or `rm -rf`. No global state is changed.
|
|
73
|
+
|
|
74
|
+
### See also
|
|
75
|
+
|
|
76
|
+
- [getting-started](existing-project) — once `duk new` is done, what to type next in the chat.
|
|
77
|
+
- `stack-discovery` skill in [skills-reference](skills-reference) — fills `## Project Identity`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## duk install — inject harness into a project
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
duk install [--sub <dir>] [--dry-run] [--check-only] [--force]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Injects the harness into the current working directory (or `--sub <dir>` subdirectory). Detects the existing stack from `pom.xml`, `package.json`, `pyproject.toml`, `go.mod`, etc. Preserves any existing `## Project Identity` block in `CLAUDE.md`. Refuses to overwrite local modifications without `--force`.
|
|
88
|
+
|
|
89
|
+
### Arguments
|
|
90
|
+
|
|
91
|
+
(none — operates on the current directory or `--sub <dir>`)
|
|
92
|
+
|
|
93
|
+
### Options
|
|
94
|
+
|
|
95
|
+
| Flag | Effect |
|
|
96
|
+
|---|---|
|
|
97
|
+
| `--sub <dir>` | Install into `<dir>` instead of CWD. The dir must already exist. |
|
|
98
|
+
| `--dry-run` | Print what would be done; write nothing. |
|
|
99
|
+
| `--check-only` | Detect stack + report local-vs-latest harness version + show drift; do not write. |
|
|
100
|
+
| `--force` | Skip drift detection (overwrite local modifications). Backup is still created. |
|
|
101
|
+
| `--help`, `-h` | Show this command-specific help. |
|
|
102
|
+
|
|
103
|
+
### What happens
|
|
104
|
+
|
|
105
|
+
1. Stack detection (`bin/lib/detect-stack.js`) — parses build files, infers language + framework + database hints.
|
|
106
|
+
2. Drift detection — reads `.claude/.MANIFEST` (sha256 per file from the prior install). If any file was modified locally, install aborts and asks the user to either move customisations to `.claude/local/` (never overwritten), run with `--force`, or open a PR upstream.
|
|
107
|
+
3. Backup — moves existing `.claude/` to `.claude.bak-<timestamp>/`.
|
|
108
|
+
4. Copy — writes the new `.claude/` + `CLAUDE.md` (preserving `## Project Identity`).
|
|
109
|
+
5. Manifest — writes `.claude/.MANIFEST` for the next drift check + `.claude/HARNESS_VERSION` for compatibility tracking.
|
|
110
|
+
6. `local/` placeholder — writes `.claude/local/README.md` if not present.
|
|
111
|
+
|
|
112
|
+
### Examples
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Inject into current directory
|
|
116
|
+
duk install
|
|
117
|
+
|
|
118
|
+
# Preview without writing
|
|
119
|
+
duk install --dry-run
|
|
120
|
+
|
|
121
|
+
# Detect stack + show drift without writing
|
|
122
|
+
duk install --check-only
|
|
123
|
+
|
|
124
|
+
# Force overwrite of local changes (backup preserved)
|
|
125
|
+
duk install --force
|
|
126
|
+
|
|
127
|
+
# Install into a subfolder
|
|
128
|
+
duk install --sub backend
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Exit codes
|
|
132
|
+
|
|
133
|
+
- `0` — install succeeded.
|
|
134
|
+
- `1` — drift detected (user must resolve via `.claude/local/` or `--force`); also for any fatal step.
|
|
135
|
+
|
|
136
|
+
### Drift detection — what to do when it triggers
|
|
137
|
+
|
|
138
|
+
When `duk install` aborts due to drift, you have three options:
|
|
139
|
+
|
|
140
|
+
1. **Move your customisations to `.claude/local/`** — that folder is never touched by `install`; the loader merges it on top of the canonical `.claude/`. Per ADR-032.
|
|
141
|
+
2. **Re-run with `--force`** — overwrites with backup. Your changes survive in `.claude.bak-<timestamp>/` for review.
|
|
142
|
+
3. **Open a PR upstream** — if your change is canonical (good for everyone), the harness adopts it.
|
|
143
|
+
|
|
144
|
+
### What breaks if it fails
|
|
145
|
+
|
|
146
|
+
If drift detection triggers, **nothing is written**. The existing `.claude/` is left intact. The error message tells you exactly which files drifted.
|
|
147
|
+
|
|
148
|
+
If the copy step fails mid-way (rare, usually permission issues), the backup at `.claude.bak-<timestamp>/` is your rollback path:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
rm -rf .claude
|
|
152
|
+
mv .claude.bak-<timestamp> .claude
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### See also
|
|
156
|
+
|
|
157
|
+
- ADR-018 (CLI redesign, `install → adoptProject`)
|
|
158
|
+
- ADR-028 (workflow), ADR-032 (drift + local/ + opt-in propagation)
|
|
159
|
+
- `update-template` skill — same flow with a preview checkpoint inside chat.
|
|
160
|
+
- `active-project` skill — same flow path-driven, non-interactive (for batch adoption).
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## duk update — alias for install
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
duk update [same options as install]
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Identical to `duk install`. Provided for ergonomics when you are updating an already-adopted project — the verb `update` reads more naturally than `install` in that context. Internally the code path is the same.
|
|
171
|
+
|
|
172
|
+
See `duk install` above for full options and behaviour.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## duk sync-all — batch update across many projects
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
duk sync-all <dir> [--filter <expr>] [--exclude <name>] [--apply]
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Iterates over every folder under `<dir>` that contains a `.claude/` directory and runs `duk install` on each. Default is dry-run — pass `--apply` to execute.
|
|
183
|
+
|
|
184
|
+
### Arguments
|
|
185
|
+
|
|
186
|
+
- `<dir>` — required. Parent directory containing adopted projects. Typically `C:\development\source\projects` on Windows, `~/development/source/projects` elsewhere.
|
|
187
|
+
|
|
188
|
+
### Options
|
|
189
|
+
|
|
190
|
+
| Flag | Effect |
|
|
191
|
+
|---|---|
|
|
192
|
+
| `--apply` | Execute the updates. Default behaviour is dry-run (prints what would be done). |
|
|
193
|
+
| `--filter <expr>` | Filter projects by criteria. Repeatable (multiple filters AND together). |
|
|
194
|
+
| `--exclude <name>` | Skip a project by folder name. Repeatable. |
|
|
195
|
+
| `--help`, `-h` | Show command-specific help. |
|
|
196
|
+
|
|
197
|
+
### Filter expressions
|
|
198
|
+
|
|
199
|
+
| Expression | Matches |
|
|
200
|
+
|---|---|
|
|
201
|
+
| `stack:<lang\|framework>` | Projects with the given primary stack — e.g., `stack:java`, `stack:angular` |
|
|
202
|
+
| `type:<value>` | Projects with the given `type:` in `## Project Identity` — e.g., `type:fullstack`, `type:backend` |
|
|
203
|
+
| `age:<duration>` | Projects whose harness was last installed more than `<duration>` ago — e.g., `age:30d`, `age:6m` |
|
|
204
|
+
| `harness-version:<semver>` | Projects with the specified harness version range — e.g., `harness-version:<0.2`, `harness-version:>=1.0` |
|
|
205
|
+
|
|
206
|
+
### Examples
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Preview what would be updated
|
|
210
|
+
duk sync-all C:/development/source/projects
|
|
211
|
+
|
|
212
|
+
# Update only Java projects
|
|
213
|
+
duk sync-all C:/development/source/projects --filter stack:java --apply
|
|
214
|
+
|
|
215
|
+
# Update projects whose harness is older than 60 days
|
|
216
|
+
duk sync-all C:/development/source/projects --filter age:60d --apply
|
|
217
|
+
|
|
218
|
+
# Update everything except a critical production project
|
|
219
|
+
duk sync-all C:/development/source/projects --exclude prod-critical --apply
|
|
220
|
+
|
|
221
|
+
# Combine filters (AND logic)
|
|
222
|
+
duk sync-all . --filter stack:java --filter age:30d --apply
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Exit codes
|
|
226
|
+
|
|
227
|
+
- `0` — all targeted projects updated successfully (or dry-run completed).
|
|
228
|
+
- non-zero — one or more updates failed (sync-all does not abort on per-project failure; it reports at the end).
|
|
229
|
+
|
|
230
|
+
### What breaks if it fails
|
|
231
|
+
|
|
232
|
+
Same drift semantics as `duk install` apply per project. A drift failure on one project does not stop the batch — `sync-all` collects results and reports at the end.
|
|
233
|
+
|
|
234
|
+
### See also
|
|
235
|
+
|
|
236
|
+
- Module: `bin/lib/sync-all.js`
|
|
237
|
+
- `duk install` for per-project semantics
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## duk dashboard — local telemetry + docs UI
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
duk dashboard [--port <n>] [--no-open]
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Boots an Express server that serves the local telemetry dashboard (Vanilla JS + Chart.js CDN, no build) at `http://localhost:<port>`. Default port `4242`; auto-increments on `EADDRINUSE`. The dashboard reads:
|
|
248
|
+
|
|
249
|
+
- `~/.claude/telemetry.db` (SQLite) — subagent telemetry from the `SubagentStop` hook
|
|
250
|
+
- `rtk gain --format json` — RTK token savings (if `rtk` is on PATH; otherwise widget gracefully degrades)
|
|
251
|
+
- `dashboard/public/content/manual/*.en.md` — user manuals
|
|
252
|
+
- `dashboard/public/content/docs/*.en.md` — tech docs (this page is one of them)
|
|
253
|
+
- `.claude/skills/*/SKILL.md` and `.claude/agents/*.md` — live skill/agent index
|
|
254
|
+
- `docs/brain/decisions/ADR-*.md` — ADR catalog
|
|
255
|
+
|
|
256
|
+
### Options
|
|
257
|
+
|
|
258
|
+
| Flag | Effect |
|
|
259
|
+
|---|---|
|
|
260
|
+
| `--port <n>` | Bind to a specific port instead of `4242`. |
|
|
261
|
+
| `--no-open` | Do not launch the browser automatically. |
|
|
262
|
+
| `--help`, `-h` | Show command-specific help. |
|
|
263
|
+
|
|
264
|
+
### Examples
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
duk dashboard # auto-detect free port from 4242
|
|
268
|
+
duk dashboard --port 5000 # specific port
|
|
269
|
+
duk dashboard --no-open # do not open browser (useful for SSH/remote)
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Exit codes
|
|
273
|
+
|
|
274
|
+
- `0` — dashboard started successfully (in foreground; Ctrl+C to stop).
|
|
275
|
+
- non-zero — failed to start (port permission, dashboard dir missing, npm install failure on first run, etc.).
|
|
276
|
+
|
|
277
|
+
### First-run behaviour
|
|
278
|
+
|
|
279
|
+
If `dashboard/node_modules` does not exist, `duk dashboard` runs `npm install --prefix dashboard/` first (Express + better-sqlite3/sql.js). This happens once per machine.
|
|
280
|
+
|
|
281
|
+
`bin/cli.js` also calls `rtk gain` once at startup and prints the output as a status banner. If `rtk` is not on PATH, prints "Note: rtk not found or returned no output — skipping gain report." and continues. The dashboard widget gracefully shows null.
|
|
282
|
+
|
|
283
|
+
### What breaks if it fails
|
|
284
|
+
|
|
285
|
+
If the server fails to start, the error is printed to stderr (usually permission or port conflict). Nothing is written to disk by the dashboard itself; safe to retry with a different port.
|
|
286
|
+
|
|
287
|
+
### See also
|
|
288
|
+
|
|
289
|
+
- [architecture-overview](architecture-overview) §"Telemetry + Dashboard"
|
|
290
|
+
- [plugins](plugins) §"rtk — Rust Token Killer"
|
|
291
|
+
- ADR-014 (Vanilla JS + Chart.js CDN), ADR-015 (triple-fallback telemetry writer), ADR-016 (`findFreePort` auto-increment)
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## duk doctor — validate the environment
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
duk doctor [--strict] [--json]
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Mechanical health check of everything needed for the harness to work day-to-day. No LLM, no API calls — safe to run in CI. Per ADR-034.
|
|
302
|
+
|
|
303
|
+
### Options
|
|
304
|
+
|
|
305
|
+
| Flag | Effect |
|
|
306
|
+
|---|---|
|
|
307
|
+
| `--json` | Machine-readable JSON output (`{ summary, checks }`). Good for CI integration. |
|
|
308
|
+
| `--strict` | Exit non-zero on any WARN too (default: only FAIL fails). |
|
|
309
|
+
| `--help`, `-h` | Show command-specific help. |
|
|
310
|
+
|
|
311
|
+
### Checks (categories)
|
|
312
|
+
|
|
313
|
+
| Category | What it validates |
|
|
314
|
+
|---|---|
|
|
315
|
+
| `environment` | Node ≥18, git, npx, python (warn for python — used by some plugin hooks) |
|
|
316
|
+
| `harness` | `.claude/{agents,skills,stacks}` exist, `CLAUDE.md`, `package.json`, `bin/cli.js` |
|
|
317
|
+
| `settings` | `~/.claude/settings.json` is valid JSON; hook command paths point to existing files |
|
|
318
|
+
| `stacks` | `.claude/stacks/` has packs + `README.md` index |
|
|
319
|
+
| `credentials` | `C:\development\tools\credentials\vps.txt` present (WARN if missing — not fatal) |
|
|
320
|
+
| `project` | If CWD is an adopted project: `.MANIFEST` present + `Project Identity` is filled (not `<project-name>` placeholder) |
|
|
321
|
+
|
|
322
|
+
### Examples
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# Standard health check
|
|
326
|
+
duk doctor
|
|
327
|
+
|
|
328
|
+
# Treat warnings as failures (useful in CI)
|
|
329
|
+
duk doctor --strict
|
|
330
|
+
|
|
331
|
+
# Machine-readable output for CI parsing
|
|
332
|
+
duk doctor --json | jq .summary
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Exit codes
|
|
336
|
+
|
|
337
|
+
- `0` — all PASS, or only WARN (unless `--strict`).
|
|
338
|
+
- `1` — any FAIL, or any WARN with `--strict`.
|
|
339
|
+
|
|
340
|
+
### Output format
|
|
341
|
+
|
|
342
|
+
Human-readable: aligned table with `CATEGORY | CHECK | STATUS | DETAIL` columns and a summary line. JSON: `{ "summary": {PASS, WARN, FAIL}, "checks": [{category, name, status, detail}, ...] }`.
|
|
343
|
+
|
|
344
|
+
### What breaks if it fails
|
|
345
|
+
|
|
346
|
+
`doctor` itself never modifies state. A failure means an environment issue (Node too old, git not in PATH, broken hook path in `~/.claude/settings.json`, missing pack, etc.). Read the DETAIL column and fix the specific issue, then re-run.
|
|
347
|
+
|
|
348
|
+
### See also
|
|
349
|
+
|
|
350
|
+
- ADR-034 (mechanical → CLI principle)
|
|
351
|
+
- Module: `bin/lib/doctor.js`
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## duk lint — validate harness structure
|
|
356
|
+
|
|
357
|
+
```
|
|
358
|
+
duk lint [--category <name>] [--json]
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
Mechanical structural validation of the harness `.claude/` directory. No LLM. Replaces `scripts/lint-harness.mjs` (deprecated).
|
|
362
|
+
|
|
363
|
+
### Options
|
|
364
|
+
|
|
365
|
+
| Flag | Effect |
|
|
366
|
+
|---|---|
|
|
367
|
+
| `--json` | Machine-readable JSON output. |
|
|
368
|
+
| `--category <name>` | Run only specified category (comma-separated for multiple). |
|
|
369
|
+
| `--help`, `-h` | Show command-specific help. |
|
|
370
|
+
|
|
371
|
+
### Categories
|
|
372
|
+
|
|
373
|
+
| Category | What it validates |
|
|
374
|
+
|---|---|
|
|
375
|
+
| `skills` | `SKILL.md` frontmatter: required fields (`name`, `description`, `tools`, `model`) + `name` matches directory |
|
|
376
|
+
| `agents` | Agent `.md` frontmatter: required fields (`name`, `description`, `model`) + `name` matches filename |
|
|
377
|
+
| `refs` | Agents mentioned in skill routing tables exist in `.claude/agents/` |
|
|
378
|
+
| `adrs` | ADRs cross-referenced across decisions exist + numbering gaps reported |
|
|
379
|
+
| `stacks` | Each stack pack has the recommended sections (Build & run, Code patterns, Anti-patterns, Security, Testing) |
|
|
380
|
+
| `d1-contract` | Pattern 1 pairs (skill↔agent share name): skill body forbids `checklist`/`golden rule`/`inviolable rules` sections; agent body forbids `PT triggers:` sections |
|
|
381
|
+
|
|
382
|
+
### Examples
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
# Full lint suite
|
|
386
|
+
duk lint
|
|
387
|
+
|
|
388
|
+
# Single category
|
|
389
|
+
duk lint --category skills
|
|
390
|
+
|
|
391
|
+
# Multiple categories
|
|
392
|
+
duk lint --category skills,agents
|
|
393
|
+
|
|
394
|
+
# Machine-readable for CI
|
|
395
|
+
duk lint --json > lint-report.json
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Exit codes
|
|
399
|
+
|
|
400
|
+
- `0` — no ERROR found.
|
|
401
|
+
- `1` — at least one ERROR (WARN never fails the exit code; use the JSON output to act on WARN if you want).
|
|
402
|
+
|
|
403
|
+
### Output format
|
|
404
|
+
|
|
405
|
+
Human-readable: violations grouped by category, each line shows `[ERROR|WARN] <relative-path>:<line> — <message>`, followed by a summary line. JSON: `{ "summary": {ERROR, WARN}, "categories": [...], "violations": [{category, severity, file, line, msg}, ...] }`.
|
|
406
|
+
|
|
407
|
+
### Severity policy
|
|
408
|
+
|
|
409
|
+
- **ERROR** — structural break (missing required field, broken reference). Blocks. Triggers exit code 1.
|
|
410
|
+
- **WARN** — cosmetic or non-blocking issue (numbering gap, missing recommended section, optional contract drift). Reports but does not block.
|
|
411
|
+
|
|
412
|
+
### What breaks if it fails
|
|
413
|
+
|
|
414
|
+
`lint` itself never modifies state. A failure tells you the harness's `.claude/` structure has a real or perceived issue. Read the violation list and either fix the file or — if the lint is wrong — update the rules in `bin/lib/lint.js` (with an ADR if the change is structural).
|
|
415
|
+
|
|
416
|
+
### See also
|
|
417
|
+
|
|
418
|
+
- ADR-034 (mechanical → CLI principle)
|
|
419
|
+
- Module: `bin/lib/lint.js`
|
|
420
|
+
- Deprecated predecessor: `scripts/lint-harness.mjs` (still works but emits a deprecation warning; `duk lint --category d1-contract` gives the same coverage)
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## duk help — show usage
|
|
425
|
+
|
|
426
|
+
```
|
|
427
|
+
duk help [command]
|
|
428
|
+
duk <command> --help
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Two forms, identical behaviour:
|
|
432
|
+
|
|
433
|
+
- `duk help` — general usage page (all commands, common flags, examples).
|
|
434
|
+
- `duk help <command>` or `duk <command> --help` — command-specific help with all flags and examples for that one command.
|
|
435
|
+
|
|
436
|
+
Commands with detailed help: `new`, `install`, `update`, `sync-all`, `dashboard`, `doctor`, `lint`, `help`.
|
|
437
|
+
|
|
438
|
+
### Examples
|
|
439
|
+
|
|
440
|
+
```bash
|
|
441
|
+
duk help
|
|
442
|
+
duk help install
|
|
443
|
+
duk install --help # equivalent
|
|
444
|
+
duk help doctor
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Exit codes
|
|
448
|
+
|
|
449
|
+
- `0` — help shown.
|
|
450
|
+
- `1` — unknown command name passed to `duk help <unknown>` (still prints general help, but signals error).
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## duk --version
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
duk --version
|
|
458
|
+
duk -v
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
Prints the installed `duk` version (from `package.json`). Useful for sync-all filtering (`--filter harness-version:<X>`) and for CI smoke tests.
|
|
462
|
+
|
|
463
|
+
### Examples
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
duk --version # → 1.0.0
|
|
467
|
+
duk -v # → 1.0.0
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### Exit codes
|
|
471
|
+
|
|
472
|
+
- `0` — always (version is read from a bundled file, cannot fail).
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Roadmap — future commands
|
|
477
|
+
|
|
478
|
+
Per ADR-034 (mechanical → CLI), the following commands are likely additions in future waves. Each is listed with the skill it extracts the mechanical part from, so the migration path is auditable.
|
|
479
|
+
|
|
480
|
+
| Future command | Extracts mechanical part from | Status |
|
|
481
|
+
|---|---|---|
|
|
482
|
+
| `duk gate` | `prd-ready-check`, `auto-test-guard` (the runner part) | Planned — turns the senior+ gate into a CI-runnable check without LLM |
|
|
483
|
+
| `duk template diff` | `update-template` | Planned — extracts the hash-compare drift detection logic |
|
|
484
|
+
| `duk scaffold <type> --stack <pack>` | `scaffold` skill (the dispatch part) | Planned — runs the stack-specific setup without going through chat |
|
|
485
|
+
| `duk brain new <type>` | `brain-keeper` | Planned — generates `docs/brain/` templates for daily, feature, ADR, bug, tech-debt, migration |
|
|
486
|
+
| `duk audit-coverage` | `test-coverage-auditor` | Planned — extracts the metrics part; flagging stays in the skill |
|
|
487
|
+
| `duk freeze <plugin>` | new — version pinning for external plugins | Planned |
|
|
488
|
+
| `duk uninstall` | new — reverse of `install` | Planned |
|
|
489
|
+
|
|
490
|
+
Migration is **by demand**, not speculative. When a current skill is slow because of inline bash, or needs to run in CI, that's when the mechanical part gets extracted to `duk`. See ADR-034 §"Migration plan".
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Common debug recipes
|
|
495
|
+
|
|
496
|
+
### "Why is my drift detection triggering?"
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
duk install --check-only # shows which files drifted
|
|
500
|
+
cat .claude/.MANIFEST | head -10 # see the recorded sha256s
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### "I want to know which projects are out of date"
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
duk sync-all C:/development/source/projects --filter age:30d
|
|
507
|
+
# Dry-run — lists projects whose harness is older than 30 days
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### "Lint is angry about a skill — what's wrong exactly?"
|
|
511
|
+
|
|
512
|
+
```bash
|
|
513
|
+
duk lint --category skills --json | jq '.violations[] | select(.file | contains("<skill-name>"))'
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### "Is my environment actually OK?"
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
duk doctor --strict # exits non-zero on warnings too
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### "Dashboard won't start"
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
duk dashboard --port 5000 # try a non-default port
|
|
526
|
+
node --version # check Node ≥18
|
|
527
|
+
ls dashboard/node_modules # should exist after first run
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
## See also
|
|
533
|
+
|
|
534
|
+
- [architecture-overview](architecture-overview) — where the CLI fits in the 3-layer model.
|
|
535
|
+
- [skills-reference](skills-reference) — for the chat layer (what NOT to put in `duk`).
|
|
536
|
+
- [plugins](plugins) — external dependencies that `duk` shells out to (`rtk`, `impeccable`).
|
|
537
|
+
- [hooks-reference](hooks-reference) — runtime hooks the harness installs in `~/.claude/settings.json`.
|
|
538
|
+
- ADR-018 (CLI redesign), ADR-028 (workflow), ADR-034 (CLI vs Skill design principle).
|