@eltonssouza/development-utility-kit 0.10.1 → 0.12.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/README.repo.md ADDED
@@ -0,0 +1,447 @@
1
+ # development-utility-kit
2
+
3
+ > Meta-skill harness for Claude Code. Generic agents by domain, knowledge packs by stack, single-`npx` injection into any project.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@eltonssouza/development-utility-kit)](https://www.npmjs.com/package/@eltonssouza/development-utility-kit)
6
+ [![beta](https://img.shields.io/npm/v/@eltonssouza/development-utility-kit/beta?label=beta)](https://www.npmjs.com/package/@eltonssouza/development-utility-kit?activeTab=versions)
7
+ [![downloads](https://img.shields.io/npm/dt/@eltonssouza/development-utility-kit)](https://www.npmjs.com/package/@eltonssouza/development-utility-kit)
8
+ [![license](https://img.shields.io/npm/l/@eltonssouza/development-utility-kit)](LICENSE)
9
+ [![stars](https://img.shields.io/github/stars/eltonssouza/development-utility-kit?style=social)](https://github.com/eltonssouza/development-utility-kit/stargazers)
10
+ [![issues](https://img.shields.io/github/issues/eltonssouza/development-utility-kit)](https://github.com/eltonssouza/development-utility-kit/issues)
11
+ [![roadmap](https://img.shields.io/badge/roadmap-public-blue)](ROADMAP.md)
12
+ [![comparisons](https://img.shields.io/badge/comparisons-honest-orange)](docs/COMPARISONS.md)
13
+ [![release](https://img.shields.io/github/v/release/eltonssouza/development-utility-kit)](https://github.com/eltonssouza/development-utility-kit/releases/latest)
14
+
15
+ CLI binary: `duk` · Node `>=18` · License: MIT
16
+
17
+ **Install as a Claude Code plugin** (recommended — global, works in every project):
18
+
19
+ ```
20
+ /plugin marketplace add eltonssouza/development-utility-kit
21
+ /plugin install development-utility-kit
22
+ ```
23
+
24
+ **Or inject per-project via npx** (writes `.claude/` + `CLAUDE.md` into the current project):
25
+
26
+ ```bash
27
+ npx @eltonssouza/development-utility-kit install
28
+ ```
29
+
30
+ ---
31
+
32
+ ## What it is
33
+
34
+ Not an agent. Not a skill. The **bundle** that turns any repo into a Claude-Code-driven project — with:
35
+
36
+ - **18 keyword-triggered skills** (front-controller `project-manager`, `run-sprint`, `auto-test-guard`, `pair-debug`, `grill-me`, `to-prd`, `to-issues`, `quick-feature`, `brain-keeper`, `stack-discovery`, `create-stack-pack`, `quality-standards`, `caveman`, etc.)
37
+ - **21 specialized sub-agents** (1 Opus for `tech-lead`, 3 Haiku for mechanical work, 17 Sonnet for everything else)
38
+ - **5 stack knowledge packs** (Java + Spring Boot 3/4, Angular 18/19/21) — extend with `create-stack-pack` skill
39
+ - **Full discovery → delivery pipeline** (`grill-me → to-prd → to-issues → analyst → run-sprint`) with mandatory TDD
40
+ - **Local sub-agent telemetry** (`SubagentStop` hook → SQLite) + **web dashboard** (Express + Vanilla JS + Chart.js CDN)
41
+ - **Non-negotiable Senior+ quality gate** (coverage ≥85%, mutation ≥70%, Lighthouse ≥0.80, a11y 0 critical)
42
+ - **Autonomy Matrix**: agents decide on their own; human is interrupted only in 4 PO cases or 3 TL cases
43
+ - **Drift detection** via `.claude/.MANIFEST` (sha256 per file) — `duk install` refuses to overwrite local modifications without `--force`
44
+
45
+ > v2.0.0+ introduces **stack-agnostic agents** consuming knowledge packs at `.claude/stacks/<lang>/<framework>-<major>.md`. The pre-1.0 era of hardcoded Java/Angular agents is gone — agents now adapt to the declared stack via `STACK CONTEXT` injection (ADR-026).
46
+
47
+ ---
48
+
49
+ ## Why use it
50
+
51
+ | Strength | Detail |
52
+ |---|---|
53
+ | **Zero-friction injection** | `duk install` in the project directory. No clone, no git, no boilerplate. |
54
+ | **Stack-agnostic agents** | `backend-developer`, `frontend-developer`, `mobile-developer`, etc. read `## Project Identity` and consume the matching stack pack. Works on Java, TypeScript, Python, Go, etc. |
55
+ | **Knowledge packs by version** | Java SB3 vs SB4 vs SB5 each get their own `## Code patterns`, `## Security`, `## Anti-patterns` section. No pack? `create-stack-pack` skill generates one conversationally. |
56
+ | **Auto stack detection** | `detect-stack.js` parses `pom.xml`, `package.json`, `pyproject.toml`, `go.mod`, `docker-compose.yml`. |
57
+ | **Idempotent install + drift detection** | Previous `.claude/` becomes `.claude.bak-<timestamp>/`. `.MANIFEST` (sha256) detects local modifications and refuses unsafe overwrites. `## Project Identity` preserved verbatim. |
58
+ | **Local overrides via `.claude/local/`** | Project-specific tweaks live there. Never touched by `duk install`. Loader priority: `local/` wins over harness. |
59
+ | **Aggressive autonomy by design** | Agents never ask permission for routine. PO/TL hold decision power; specialists never escalate directly to human. |
60
+ | **Universal TDD** | `sprint-runner` enforces `qa-engineer (failing test) → developer → gate-keeper` on every task. ADR-020. |
61
+ | **Obsidian-ready brain** | `brain-keeper` provisions `docs/brain/` with vault, color snippets, MOC, ADRs, daily, features, bugs, tech-debt, migrations. |
62
+ | **Caveman mode by default** | ~65–75% cheaper output in tokens, no technical loss. ULTRA in code, FULL in `.md`. Credit: [@JuliusBrussee](https://github.com/JuliusBrussee). |
63
+ | **No build for dashboard** | Vanilla JS + Chart.js via CDN. Tiny tarball. ADR-014. |
64
+
65
+ ---
66
+
67
+ ## How it works
68
+
69
+ ### 3-layer architecture
70
+
71
+ ```
72
+ User prompt
73
+
74
+
75
+ ┌─────────────────────────────┐
76
+ │ SKILLS (entry point) │ keyword match
77
+ │ .claude/skills/<X>/SKILL.md│ → specific skill OR
78
+ └─────────────┬───────────────┘ project-manager (front-controller)
79
+
80
+ ▼ Step 0 (orchestrating skills)
81
+ ┌─────────────────────────────┐
82
+ │ stack-resolver (Haiku) │ reads ## Project Identity
83
+ │ reads .claude/stacks/<pack>│ returns STACK CONTEXT block
84
+ └─────────────┬───────────────┘
85
+
86
+ ▼ Task tool dispatch (with STACK CONTEXT inlined)
87
+ ┌─────────────────────────────┐
88
+ │ AGENTS (executors) │ 21 specialized agents
89
+ │ .claude/agents/<X>.md │ Opus | Sonnet | Haiku per matrix
90
+ └─────────────┬───────────────┘
91
+
92
+
93
+ Artifact (code, ADR, PRD, plan, test, deploy)
94
+ ```
95
+
96
+ Skill = entry point + multi-step protocol. Agent = executor with tools. Pack = stack-specific knowledge consumed by agents. No loose commands.
97
+
98
+ ### Discovery → delivery flow
99
+
100
+ ```
101
+ grill-me → docs/discovery/DISCOVERY_<NAME>.md
102
+
103
+ to-prd → docs/prd/PRD_<NAME>.md
104
+
105
+ to-issues → docs/issues/ISSUES_<NAME>.md (gh issue create-ready)
106
+
107
+ analyst → docs/plans/PLAN_<NAME>.md (goal-ready DoD)
108
+
109
+ run-sprint (thin) → sprint-runner (single execution contract; mandatory TDD, Stage 0 stack-resolver)
110
+
111
+ gate-keeper → Senior+ gate (coverage, mutation, a11y, lighthouse, pyramid)
112
+
113
+ brain-keeper → docs/brain/ (daily, feature, ADR, bug, tech-debt, migration, MOC)
114
+ ```
115
+
116
+ For small features that don't justify the full pipeline (adding a field, fixing a search, exporting CSV): use `quick-feature` skill — bypasses discovery/PRD/issues, generates minimal PLAN, dispatches `run-sprint` directly. TDD + Senior+ gate still mandatory.
117
+
118
+ ### Flow governance
119
+
120
+ Every prompt passes through `flow-guard.js` (UserPromptSubmit hook) before reaching the model. It injects `[FLOW STATE]`, classifies the lane (greenfield / brownfield / sprint / small-task), and hard-blocks qualified implementation work that is missing its prerequisite artifact (DISCOVERY_*.md or PLAN_*.md). Bypass is audited in `.flow-state.json`.
121
+
122
+ `project-manager` is the universal front-controller: classifies the lane, enforces the stage order, then dispatches (ROUTE → 1 specialist | ORCHESTRATE → ≤5 parallel with a shared `run_group_id` | ESCALATE → `sprint-runner`).
123
+
124
+ ### Telemetry + Dashboard
125
+
126
+ ```
127
+ Claude Code ─► UserPromptSubmit ─► flow-guard.js (lane classify + block)
128
+
129
+ └► SubagentStop hook ─► subagent-telemetry.sh ─► telemetry-writer.js
130
+
131
+
132
+ ~/.claude/telemetry.db (SQLite)
133
+ events + orchestration_runs
134
+
135
+ ┌─────────────────────────────────────────┘
136
+
137
+ duk dashboard → Express @ :4242+ → Vanilla JS UI
138
+ /api/stats
139
+ /api/projects
140
+ /api/projects/processes (run-groups + agent children)
141
+ /api/rtk (rtk gain --format json)
142
+ ```
143
+
144
+ Polling every 5s. Click a project → **Processes panel** shows recent orchestration run-groups, each expandable into its parallel agent fan (agent type, model, status). Phase A: completed runs. Phase B (live in-flight): deferred — no `SubagentStart` hook available in Claude Code today.
145
+
146
+ ---
147
+
148
+ ## Quickstart
149
+
150
+ ### Two ways to install
151
+
152
+ | | **Plugin** (recommended) | **npx injection** |
153
+ |---|---|---|
154
+ | Command | `/plugin marketplace add eltonssouza/development-utility-kit` then `/plugin install development-utility-kit` | `npx @eltonssouza/development-utility-kit install` |
155
+ | Scope | Global — every project, every session | Per-project (writes `.claude/` + `CLAUDE.md`) |
156
+ | Lands in | `~/.claude/plugins/` | the project directory |
157
+ | Updates | `/plugin update` (or auto on version bump) | re-run `npx … install` |
158
+ | Per-project stack | declare in a small `CLAUDE.md` `## Project Identity` (or let agents auto-detect) | written into the injected `CLAUDE.md` |
159
+
160
+ Both deliver the same 18 skills + 21 agents + stack packs. The plugin keeps them global and out of your repo; the npx path injects them into the project (and self-installs `duk` globally). Skills, agents and the flow-governance hook load identically either way.
161
+
162
+ > **Note on `## Project Identity`:** Claude Code plugins cannot ship a project `CLAUDE.md` (plugin context arrives via skills/agents/hooks, not CLAUDE.md). When you install via the plugin, declare your stack in a short per-project `CLAUDE.md` block so `stack-resolver` picks the right pack — or rely on `detect-stack.js` auto-detection. The npx path still writes the full `CLAUDE.md` for you.
163
+
164
+ ### Brand-new project
165
+
166
+ ```bash
167
+ duk new my-app
168
+ cd my-app
169
+ # Open Cowork or Claude Code in this folder, then in chat:
170
+ # > "sabatina pra projeto novo"
171
+ # stack-discovery skill walks you through 8 questions to declare type, language,
172
+ # framework, version, database, UI lib, domain.
173
+ ```
174
+
175
+ ### Existing project
176
+
177
+ ```bash
178
+ cd <your-project>
179
+ npx @eltonssouza/development-utility-kit install
180
+ ```
181
+
182
+ Injects `.claude/`, `CLAUDE.md`, `.claude/HARNESS_VERSION`, `.claude/.MANIFEST`, `.claude/local/` placeholder. Detects stack automatically.
183
+
184
+ **Preview before applying** (no writes):
185
+ ```bash
186
+ duk install --check-only
187
+ ```
188
+
189
+ Reports detected stack + local vs latest harness version + pack availability.
190
+
191
+ **Override local modifications** (skip drift detection):
192
+ ```bash
193
+ duk install --force
194
+ ```
195
+
196
+ `.claude.backup-<timestamp>/` is always created.
197
+
198
+ ### Edit `## Project Identity` in `CLAUDE.md`
199
+
200
+ The only section the project owns. All others are harness base and receive updates via `duk install` (with drift detection).
201
+
202
+ ```markdown
203
+ ## Project Identity
204
+
205
+ - **Project name**: my-store
206
+ - **Project type**: fullstack
207
+ - **Primary stack**: Java 21 + Spring Boot 3.2
208
+ - **Database**: PostgreSQL 17 + Redis 7
209
+ - **Domain**: e-commerce
210
+ - **Team size**: 3 fullstack
211
+ ```
212
+
213
+ `stack-resolver` reads this and loads `.claude/stacks/java/spring-boot-3.md`. If pack absent for declared stack: dispatches `create-stack-pack` skill to author it conversationally.
214
+
215
+ ### Run the dashboard
216
+
217
+ ```bash
218
+ duk dashboard # auto-detects free port from 4242
219
+ duk dashboard --port 5000
220
+ duk dashboard --no-open # skip browser launch
221
+ ```
222
+
223
+ Before starting Express, prints `rtk gain` (token savings analytics). If `rtk` not in PATH: non-fatal warning, proceeds.
224
+
225
+ ### Update many projects at once
226
+
227
+ ```bash
228
+ # Preview which projects would be updated:
229
+ duk sync-all C:\development\source\projects
230
+
231
+ # Apply with filters (AND logic between multiple --filter):
232
+ duk sync-all C:\development\source\projects --filter stack:java --apply
233
+ duk sync-all C:\development\source\projects --filter age:30d --apply
234
+ duk sync-all C:\development\source\projects --filter harness-version:<2 --apply
235
+
236
+ # Exclude specific projects:
237
+ duk sync-all C:\development\source\projects --exclude prod-critical --apply
238
+ ```
239
+
240
+ ---
241
+
242
+ ## `duk` commands
243
+
244
+ ```
245
+ duk new <name> # scaffold new project + open conversational discovery
246
+ duk install [--sub <dir>] [--dry-run] [--check-only] [--force]
247
+ # inject harness into CWD (idempotent)
248
+ duk update # alias of install
249
+ duk sync-all <dir> [--filter <expr>]* [--exclude <name>]* [--apply]
250
+ # update harness in many projects
251
+ duk dashboard [--port <n>] [--no-open] # launch local dashboard
252
+ duk doctor [--strict] [--json] # validate environment (Node, git, hooks, packs)
253
+ duk lint [--category <name>] [--json] # validate harness .claude/ structure
254
+ duk help [command] # general help or command-specific
255
+ duk --version # print version
256
+ ```
257
+
258
+ See `duk help <command>` for detailed per-command flags. The `doctor` and
259
+ `lint` commands are deterministic and run without any LLM/API calls — safe
260
+ to use in CI. See **ADR-034** for the design principle behind them.
261
+
262
+ ---
263
+
264
+ ## Prompts that trigger skills
265
+
266
+ | You say | Skill fires |
267
+ |---|---|
268
+ | "sabatina pra projeto novo", "stack discovery" | `stack-discovery` → fills `## Project Identity` |
269
+ | "cria pack para Django", "gera pack" | `create-stack-pack` → new `.claude/stacks/<lang>/<framework>-<major>.md` |
270
+ | "grill me", "interview me about X" | `grill-me` → discovery interview |
271
+ | "to-prd", "generate PRD" | `to-prd` (after `grill-me`) |
272
+ | "to-issues", "break into issues" | `to-issues` (after `to-prd`) |
273
+ | "run sprint 2", "execute the sprint" | `run-sprint` (Stage 0 stack-resolver) |
274
+ | "quick-feature: add field X" | `quick-feature` → bypass discovery, minimal PLAN, run-sprint |
275
+ | "pair debug", "investigate this bug" | `pair-debug` (Stage 0 stack-resolver) |
276
+ | "audit coverage" | `test-coverage-auditor` |
277
+ | "PRD-ready?", "ready for prod?" | `prd-ready-check` |
278
+ | "create endpoint", "build the screen", anything else | `project-manager` (front-controller — classifies lane, enforces flow) |
279
+ | "stop caveman", "normal mode" | disables caveman |
280
+
281
+ ---
282
+
283
+ ## Senior+ Quality Gate
284
+
285
+ Non-negotiable. `gate-keeper` blocks merge if any item fails. **Thresholds are universal across stacks**; tooling specifics (JaCoCo vs coverage.py, JUnit vs pytest, etc.) come from the active stack pack:
286
+
287
+ | Metric | Threshold |
288
+ |---|---|
289
+ | Backend coverage (lines / branches) | ≥85% / ≥80% |
290
+ | Backend mutation score | ≥70% in domain + application layers |
291
+ | Frontend coverage | ≥85% statements, ≥80% branches |
292
+ | Static analysis (SpotBugs / mypy / golangci-lint / ESLint strict / ...) | 0 CRITICAL, 0 HIGH |
293
+ | Dependency vuln scan (OWASP DC / npm audit / safety / govulncheck) | 0 CVE CVSS ≥7.0 |
294
+ | Playwright E2E | 100% green, console 0 errors |
295
+ | a11y (jest-axe + axe-playwright) | 0 serious, 0 critical |
296
+ | Lighthouse | score ≥0.80, LCP ≤2500ms, CLS ≤0.1, TBT ≤300ms |
297
+ | Testing pyramid | E2E ≤30% of total (ideal ≤15%) |
298
+
299
+ Reference: ADR-007 (a11y + Lighthouse + pyramid), ADR-027 (pack `## Security` mandatory).
300
+
301
+ ---
302
+
303
+ ## Structure
304
+
305
+ ```
306
+ development-utility-kit/
307
+ ├── .claude/ # canonical harness sources (also used when dogfooding this repo)
308
+ │ ├── skills/ # 18 skills (project-manager front-controller, run-sprint, stack-discovery, ...)
309
+ │ ├── agents/ # 21 agents (Opus/Sonnet/Haiku per matrix)
310
+ │ ├── stacks/ # 5 stack packs (java/spring-boot-3, spring-boot-4; typescript/angular-18,19,21)
311
+ │ │ ├── _template.md
312
+ │ │ ├── README.md
313
+ │ │ ├── CODEOWNERS
314
+ │ │ ├── java/
315
+ │ │ └── typescript/
316
+ │ ├── hooks/ # flow-guard.js (UserPromptSubmit) + flow-state.js
317
+ │ └── settings.json
318
+ ├── .claude-plugin/
319
+ │ └── marketplace.json # repo is its own marketplace; source → ./plugin
320
+ ├── plugin/ # build artifact — lean plugin shipped to /plugin install (skills+agents+stacks+hooks only)
321
+ │ └── .claude-plugin/plugin.json # generated by scripts/build-plugin.mjs (version tracks package.json)
322
+ ├── bin/
323
+ │ ├── cli.js # zero-deps `duk` CLI router (Node 18+)
324
+ │ └── lib/ # 8 helper modules (detect-stack, version-check, sync-all, manifest, ...)
325
+ ├── dashboard/
326
+ │ ├── server.js # Express + 3 endpoints
327
+ │ ├── db.js # better-sqlite3 / sql.js wrapper
328
+ │ ├── rtk.js # spawns rtk gain --format json
329
+ │ └── public/ # Vanilla JS + Chart.js CDN
330
+ ├── scripts/
331
+ │ ├── hooks/
332
+ │ │ ├── subagent-telemetry.sh # SubagentStop hook
333
+ │ │ └── telemetry-writer.js # triple-fallback writer
334
+ │ ├── build-plugin.mjs # assembles plugin/ from .claude/ (--check fails CI on drift)
335
+ │ ├── swap-readme.mjs # prepack/postpack README ↔ README.npm.md swap
336
+ │ ├── lint-harness.mjs # validates Pattern 1/2, packs, agent hardcode, drift
337
+ │ └── latest-versions.json # offline fallback for version detection
338
+ ├── docs/
339
+ │ ├── brain/ # Obsidian vault (features, decisions, daily, bugs, migrations)
340
+ │ ├── discovery/ # DISCOVERY_*.md
341
+ │ ├── prd/ # PRD_*.md
342
+ │ ├── issues/ # ISSUES_*.md
343
+ │ └── plans/ # PLAN_*.md
344
+ ├── tests/smoke/ # smoke tests (install, dashboard, telemetry)
345
+ ├── .github/workflows/
346
+ │ ├── publish.yml # auto-publish on GitHub Release published
347
+ │ └── promote-dist-tag.yml # manual: promote beta → latest via Actions UI
348
+ ├── CLAUDE.md # base template (Project Identity + plugin base)
349
+ ├── CHANGELOG.md # release-please-managed
350
+ └── package.json
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Key ADRs
356
+
357
+ | ADR | Decision |
358
+ |---|---|
359
+ | **ADR-007** | Senior+ gate (a11y + Lighthouse + pyramid thresholds) |
360
+ | **ADR-008** | Standard pipeline (PO → analyst → tech-lead → sprint-runner → gate-keeper → reviewer → TL) |
361
+ | **ADR-011** | `grill-me` as opt-in discovery skill |
362
+ | **ADR-014** | Vanilla JS + Chart.js CDN dashboard |
363
+ | **ADR-015** | Triple-fallback telemetry writer |
364
+ | **ADR-017** | `DISCOVERY_*.md` in `docs/discovery/` (not `docs/plans/`) |
365
+ | **ADR-018** | `duk` CLI redesign — `install → adoptProject` |
366
+ | **ADR-020** | Mandatory TDD in `sprint-runner` |
367
+ | **ADR-026** | Generic agents + stack packs (architecture foundation) |
368
+ | **ADR-027** | Pack governance (frontmatter + `## Security` mandatory + CODEOWNERS + annual review) |
369
+ | **ADR-028** | `duk` workflow (new, install --check-only, sync-all with filters, help) |
370
+ | **ADR-029** | Canonical pack format (10 sections, 300-450L target) |
371
+ | **ADR-030** | Migrator consumes 2 packs (FROM + TO), multi-major incremental, fullstack sequential |
372
+ | **ADR-032** | Drift detection (`.MANIFEST`) + `.claude/local/` overrides + opt-in propagation |
373
+ | **ADR-033** | `project-manager` orchestrate mode (ROUTE / ORCHESTRATE ≤5 / ESCALATE) — fast-lane for ad-hoc multi-domain tasks without a formal `PLAN_*.md` |
374
+ | **ADR-034** | CLI vs Skill design principle — mechanical/deterministic → `duk` CLI; contextual/judgment → chat (skills + agents); hybrid → CLI executes + skill orchestrates |
375
+
376
+ Full vault under [`docs/brain/`](docs/brain/) — browse via Obsidian. Live ADR index also rendered at `duk dashboard` → Tech Docs tab.
377
+
378
+ ---
379
+
380
+ ## Commit restrictions (NON-NEGOTIABLE)
381
+
382
+ - Conventional Commits (`feat(scope): ...`, `fix(scope): ...`, `feat!: ...` for breaking)
383
+ - **Never** reference Anthropic, Claude, AI, LLM, or assistant in subject/body/trailers
384
+ - **Never** add `Co-Authored-By: Claude`
385
+ - Commits must look 100% authored by the human developer
386
+ - `tech-lead` rejects merge on violation
387
+
388
+ ---
389
+
390
+ ## Acknowledgements
391
+
392
+ `development-utility-kit` is a **meta-skill harness** — it ships its own skills and agents, but it also stands on the shoulders of skills built by other people in the Claude Code community. The bundle would not work the way it does without them, and the credit belongs to their authors.
393
+
394
+ Honest thanks to:
395
+
396
+ - **[`grill-me`](https://github.com/mattpocock/skills)** — by **[Matt Pocock](https://github.com/mattpocock)** ([aihero.dev](https://www.aihero.dev/my-grill-me-skill-has-gone-viral)). The relentless discovery interview that opens our `grill-me → to-prd → to-issues → analyst → run-sprint` pipeline is Matt's design. We adapted the skill to persist its output to `docs/discovery/DISCOVERY_*.md` and hand off to `analyst`, but the interview mechanic — one decision branch at a time, with a recommended answer the user just confirms — is his.
397
+ - **[`caveman`](https://github.com/JuliusBrussee/caveman)** — by **[Julius Brussee](https://github.com/JuliusBrussee)**. The telegraphic communication mode that saves us 65–75% of output tokens with zero technical loss. We use it as the default style in this harness; the compression rules, the levels (lite/full/ultra), and the auto-clarity carve-outs are Julius's work.
398
+ - **[`impeccable`](https://github.com/pbakaus/impeccable)** — by **[Paul Bakaus](https://github.com/pbakaus)**. The design-refinement skill (`polish | harden | audit`) that drives our visual-quality gate. Paul's `npx skills add pbakaus/impeccable` distribution pattern also directly inspired our own `npx @eltonssouza/development-utility-kit install` installer (ADR-018).
399
+ - **[`rtk`](https://github.com/rtk-ai/rtk)** — by the **[rtk-ai](https://github.com/rtk-ai) team**. The Rust Token Killer CLI proxy that powers the live "RTK savings" widget on the `duk dashboard` (`rtk gain --format json` → `/api/rtk`). The 60–90% savings on dev operations we surface in the dashboard are RTK's, not ours.
400
+
401
+ If you build on top of this harness, please give these projects a star — they are the load-bearing dependencies our pipeline assumes, and their authors made them available freely to the community. Any mistake in the way we integrate or describe their work is ours, not theirs.
402
+
403
+ > For the full rationale on **why each plugin was selected**, **how it integrates inside the harness**, **what breaks if you disable it**, and **alternatives considered**, see the dedicated [External plugins reference](dashboard/public/content/docs/plugins.en.md) — also rendered live at `duk dashboard` → Tech Docs → "External plugins".
404
+
405
+ ---
406
+
407
+ ## Release Process
408
+
409
+ Releases ship through GitHub Actions, not manual `npm publish`.
410
+
411
+ ### Publishing a new version
412
+
413
+ 1. Bump `package.json` version (e.g., `2.0.0-beta.1 → 2.0.0`) and update `CHANGELOG.md`.
414
+ 2. Commit + push + tag:
415
+ ```bash
416
+ git commit -m "feat!: <summary>"
417
+ git tag v2.0.0
418
+ git push origin <branch> --tags
419
+ ```
420
+ 3. Create a GitHub Release pointing at the tag (UI or `gh release create`).
421
+ 4. `publish.yml` workflow fires on `release: published`, runs `npm publish --access public`.
422
+ 5. `publishConfig.tag` in `package.json` controls dist-tag target (`beta` or `latest`).
423
+
424
+ ### Pre-release vs stable
425
+
426
+ - Pre-releases use `--tag beta` (default in `publishConfig`). `npx @eltonssouza/development-utility-kit@beta install` pulls them.
427
+ - After validating against real projects: **manually promote** to `latest` via the **Promote npm dist-tag** workflow (GitHub Actions → Run workflow → enter version + target tag).
428
+
429
+ ### Rollback
430
+
431
+ If a release breaks something, rollback by re-pointing `latest` to the prior stable:
432
+
433
+ ```
434
+ GitHub Actions → Promote npm dist-tag → version=1.0.1, tag=latest
435
+ ```
436
+
437
+ Bad version stays published (npm doesn't allow real deletion past 72h), but no one downloads it via `npx` anymore.
438
+
439
+ ### Required secret
440
+
441
+ The promote workflow needs a `NPM_TOKEN` repository secret — a **Granular Access Token** with read+write on `@eltonssouza/development-utility-kit`. Generated at https://www.npmjs.com/settings/eltonssouza/tokens.
442
+
443
+ ---
444
+
445
+ ## License
446
+
447
+ MIT
package/bin/cli.js CHANGED
@@ -304,12 +304,27 @@ function adoptProject(opts) {
304
304
  const destClaude = path.join(subDir, '.claude');
305
305
  const destClaudeMd = path.join(subDir, 'CLAUDE.md');
306
306
 
307
+ // Drive-root / system-directory guard.
308
+ // Prevents EPERM crashes when the user accidentally runs from C:\, D:\, etc.
309
+ const targetResolved = path.resolve(subDir);
310
+ const parsed = path.parse(targetResolved);
311
+ const isDriveRoot = parsed.root === targetResolved + path.sep || parsed.root === targetResolved;
312
+ const WIN_SYSTEM_PREFIXES = ['\\Windows', '\\Program Files', '\\Program Files (x86)', '\\Users\\Default'];
313
+ const isSystemDir = process.platform === 'win32' &&
314
+ WIN_SYSTEM_PREFIXES.some((p) => targetResolved.toLowerCase().startsWith((parsed.root + p.slice(1)).toLowerCase()));
315
+ if (isDriveRoot || isSystemDir) {
316
+ process.stderr.write('Error: unsafe install target — cannot install into a drive root or system directory.\n');
317
+ process.stderr.write(`Target: ${targetResolved}\n`);
318
+ process.stderr.write('cd into your project folder first, then run:\n');
319
+ process.stderr.write(' npx @eltonssouza/development-utility-kit install\n');
320
+ process.exit(1);
321
+ }
322
+
307
323
  // Item 21 — self-destruction guard.
308
324
  // If install runs inside the harness source tree, the backup step would
309
325
  // `mv srcClaude → srcClaude.bak`, removing the very source about to be
310
326
  // copied. Abort early with a clear message before any destructive op.
311
327
  const pkgRootResolved = path.resolve(pkgRoot);
312
- const targetResolved = path.resolve(subDir);
313
328
  if (targetResolved === pkgRootResolved) {
314
329
  process.stderr.write('Error: cannot install harness into its own source tree.\n');
315
330
  process.stderr.write(`Target directory equals the harness package root:\n ${pkgRootResolved}\n`);
@@ -90,7 +90,7 @@ To force a specific skill, use `/skill <name>` in Claude Code or mention it expl
90
90
  - **Front-controller skill**: `project-manager` (ADR-041). Intercepts **every** prompt, enforces the flow order, then dispatches: ROUTE (1 specialist) | ORCHESTRATE (≤5 parallel, shared `run_group_id`) | ESCALATE (`grill-me → analyst → sprint-runner`).
91
91
  - **Passive skills**: `caveman` (telegraphic style, always active).
92
92
  - **Product skills**: `to-prd`, `to-issues`. Convert artifacts between pipeline stages.
93
- - **Adoption skills**: `update-template`, `active-project`. Synchronize projects with the latest harness version.
93
+ - **Adoption skills**: `update-template`. Synchronize a project with the latest harness version (terminal equivalents: `duk install`, `duk sync-all` for batch).
94
94
 
95
95
  The complete skill table lives in [Skills reference](skills-reference).
96
96
 
@@ -218,6 +218,23 @@ Both Cowork desktop and Claude Code CLI consume the same `.claude/` from the pro
218
218
 
219
219
  Rule of thumb: **if Cowork alone covers it, use Cowork**. If you need bash hooks, terminal, or CI automation, use Claude Code CLI on the same project.
220
220
 
221
+ ## Distribution
222
+
223
+ The same harness ships through two channels. They deliver identical skills, agents, stack packs and the flow-governance hook — they differ only in *where the files live* and *what scope they cover*.
224
+
225
+ | | **Plugin** (global) | **npx injection** (vendored) |
226
+ |---|---|---|
227
+ | Install | `/plugin marketplace add eltonssouza/development-utility-kit` → `/plugin install development-utility-kit` | `npx @eltonssouza/development-utility-kit install` |
228
+ | Lands in | `~/.claude/plugins/` | the project's `.claude/` |
229
+ | Scope | every project on the host | one project |
230
+ | In the repo | nothing committed | `.claude/` + `CLAUDE.md` vendored + version-pinned |
231
+ | Updates | `/plugin update` (or auto on version bump) | re-run `npx … install` |
232
+ | Mechanism | `.claude-plugin/marketplace.json` (repo is its own marketplace) points `source` at a lean, build-generated `plugin/` subdir (skills + agents + stacks + hooks only — not the whole repo); `plugin/.claude-plugin/plugin.json` declares `skills`/`agents` and wires hooks via `${CLAUDE_PLUGIN_ROOT}`. `scripts/build-plugin.mjs` regenerates `plugin/` from `.claude/` and CI fails on drift. | `bin/cli.js` copies `.claude/` + merges `CLAUDE.md`, self-installs `duk` globally |
233
+
234
+ **The one structural constraint.** Claude Code plugins cannot ship a project `CLAUDE.md` — plugin context arrives through skills, agents and hooks, never through a project context file. So the per-project `## Project Identity` block (the 4–6 lines that declare stack / database / domain and let `stack-resolver` pick the right pack) stays a small per-project file when you install via the plugin. The npx path still writes the full `CLAUDE.md` for you, Project Identity included. Either way, `detect-stack.js` can infer most of it from `pom.xml` / `package.json` / `pyproject.toml` / `go.mod`.
235
+
236
+ Choosing: pick the **plugin** when you want the harness everywhere and out of your repos; pick **npx injection** when you want it committed, pinned, and reproducible inside a specific repo. See the manuals ([quickstart](../manual/quickstart), [existing-project](../manual/existing-project)) for step-by-step install in either model.
237
+
221
238
  ## Telemetry
222
239
 
223
240
  Subagent telemetry is recorded via the `SubagentStop` hook. Each run carries a `run_group_id` (correlating a parallel orchestration fan) and the project path, powering the dashboard's per-project **Processes** view (ADR-045, Phase A). The flow:
@@ -86,6 +86,10 @@ duk install [--sub <dir>] [--dry-run] [--check-only] [--force]
86
86
 
87
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
88
 
89
+ > **Alternative — install as a plugin.** If you do not want the harness vendored into the repo, install it globally as a Claude Code plugin instead: `/plugin marketplace add eltonssouza/development-utility-kit` then `/plugin install development-utility-kit`. Skills, agents, stack packs and the flow-governance hook load globally with no `.claude/` written into the project. See [architecture-overview](architecture-overview#distribution) for the trade-off. `duk install` remains the path when you want per-project, version-pinned, vendored harness files.
90
+
91
+ > **Safety guards.** When run via `npx` and `duk` is not yet on PATH, `install` self-installs the CLI globally (`npm install -g`) at the end so subsequent `duk …` calls work. It also refuses to run from a drive root (`C:\`) or a Windows system directory — `cd` into a project folder first.
92
+
89
93
  ### Arguments
90
94
 
91
95
  (none — operates on the current directory or `--sub <dir>`)
@@ -157,7 +161,7 @@ mv .claude.bak-<timestamp> .claude
157
161
  - ADR-018 (CLI redesign, `install → adoptProject`)
158
162
  - ADR-028 (workflow), ADR-032 (drift + local/ + opt-in propagation)
159
163
  - `update-template` skill — same flow with a preview checkpoint inside chat.
160
- - `active-project` skillsame flow path-driven, non-interactive (for batch adoption).
164
+ - `duk sync-all <dir>` — non-interactive batch adoption across many projects.
161
165
 
162
166
  ---
163
167
 
@@ -17,7 +17,6 @@ This document covers the 18 official skills of the harness, grouped by purpose.
17
17
  | `bootstrap-backend-java` | "scaffolda o backend", "cria backend Java" | `scaffold` | `backend/` Spring Boot 4 + Flyway + compose |
18
18
  | `bootstrap-frontend` | "scaffolda o frontend", "cria frontend Angular", "cria frontend Vite" | `scaffold` | `frontend/` Angular 21 or Vite Vanilla |
19
19
  | `bootstrap-fullstack` | "cria o esqueleto", "bootstrap fullstack" | `scaffold` | Monorepo `backend/` + `frontend/` + compose |
20
- | `active-project` | "ativar projeto em `<path>`", "adota o projeto" | `adopt-project.sh` wrapper | Updated `.claude/` + backup |
21
20
  | `update-template` | "atualiza o template", "traz as skills novas" | `adopt-project.sh` wrapper | `.claude/` merged with preview |
22
21
  | `run-sprint` | "roda a sprint 1", "executa a sprint" | `sprint-runner` → `backend-developer`, `frontend-developer`, `database-engineer`, `gate-keeper` | Code + tests + commit per task |
23
22
  | `auto-test-guard` | "roda os testes", "gera os testes", "garante que nada quebrou" | `gate-keeper` | Generated tests + green suite + senior+ gate |
@@ -54,7 +53,7 @@ Reference: **ADR-033** — orchestrate mode fills the fast-lane gap acknowledged
54
53
 
55
54
  **Prerequisites**: none — it is the front door. It runs the `flow-guard` precondition checks (DISCOVERY/PLAN present for qualified work) before dispatching.
56
55
 
57
- **When NOT to fire**: when a specific skill matches (`run-sprint`, `auto-test-guard`, `prd-ready-check`, `grill-me`, `scaffold`, `pair-debug`, `api-integration-test`, `brain-keeper`, `test-coverage-auditor`, `update-template`, `active-project`, `caveman`). Specific skills always win by specificity. For formal sprint execution (with `PLAN_*.md`), use `run-sprint`. For tasks that need a persisted plan or discovery, escalate to `grill-me` → `analyst` first.
56
+ **When NOT to fire**: when a specific skill matches (`run-sprint`, `auto-test-guard`, `prd-ready-check`, `grill-me`, `scaffold`, `pair-debug`, `api-integration-test`, `brain-keeper`, `test-coverage-auditor`, `update-template`, `caveman`). Specific skills always win by specificity. For formal sprint execution (with `PLAN_*.md`), use `run-sprint`. For tasks that need a persisted plan or discovery, escalate to `grill-me` → `analyst` first.
58
57
 
59
58
  **Mode selection heuristic (deterministic)**: skill counts distinct domains touched (backend, frontend, mobile, database, devops, ux, security, n8n, product, tests, architecture, release). 1 domain → ROUTE. 2–5 domains, independent paths → ORCHESTRATE. >5 or any subtask needs further decomposition → ESCALATE.
60
59
 
@@ -174,24 +173,6 @@ Reference: **ADR-033** — orchestrate mode fills the fast-lane gap acknowledged
174
173
 
175
174
  **When NOT to fire**: project already has backend and frontend (use `run-sprint`); backend-only (`bootstrap-backend-java`) or frontend-only (`bootstrap-frontend`).
176
175
 
177
- ### active-project
178
-
179
- **PT triggers**: "ativar projeto em `<path>`", "adota o projeto", "aplica o template", "ativa o template em", "sincronizar template no projeto".
180
-
181
- **EN triggers**: "/active-project `<path>`", "active project at `<path>`", "activate project `<path>`".
182
-
183
- **When to fire**: when the user passes an explicit path and wants one-shot adoption with no preview or checkpoint. Preferred for scripted batches.
184
-
185
- **What it does**: one-shot wrapper of `scripts/adopt-project.sh`. Detects type (backend/frontend/fullstack + stack), backs up `.claude/` to `.claude.backup-YYYYMMDD-HHMMSS/`, copies the template, injects the "Identidade deste projeto" block into `CLAUDE.md`, and copies `.claude-version.json`. Supports `--dry-run`, `--force-type=<type>`, `--template=<path>`.
186
-
187
- **Delegated agent**: none — calls the script directly via Bash.
188
-
189
- **Output / artifacts**: updated `.claude/`; timestamped backup; `CLAUDE.md` with Project Identity filled in; `.claude-version.json`.
190
-
191
- **Prerequisites**: project path passed as the first argument.
192
-
193
- **When NOT to fire**: to create a new project (use `bootstrap-*`); to update the current project from inside it (use `update-template`, which has preview); to implement features (use `run-sprint`).
194
-
195
176
  ### update-template
196
177
 
197
178
  **PT triggers**: "atualiza o template", "sync com development-utility-kit", "traz as skills novas", "atualiza as skills", "reimporta o template", "adota o template neste projeto".
@@ -208,7 +189,7 @@ Reference: **ADR-033** — orchestrate mode fills the fast-lane gap acknowledged
208
189
 
209
190
  **Prerequisites**: being inside a project previously adopted (or about to be adopted).
210
191
 
211
- **When NOT to fire**: to create a new project (`bootstrap-*`); to update project code (`run-sprint`); for batch adoption without preview (`active-project`).
192
+ **When NOT to fire**: to create a new project (`bootstrap-*`); to update project code (`run-sprint`); for batch adoption (`duk sync-all`).
212
193
 
213
194
  ---
214
195
 
@@ -399,10 +399,10 @@ Each item follows the pattern:
399
399
  ### Agents with wrong path
400
400
 
401
401
  - **Symptom**: agent references missing file in `.claude/agents/`.
402
- - **Cause**: `active-project` failed partially.
402
+ - **Cause**: a previous `duk install` / `update-template` failed partially.
403
403
  - **Solution**:
404
404
  ```bash
405
- duk active-project <path> --force
405
+ duk install --force
406
406
  ```
407
407
 
408
408
  ### `settings.json` merge conflicts