@eltonssouza/development-utility-kit 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.claude/CONTEXT.template.md +44 -0
  2. package/.claude/agents/analyst.md +19 -7
  3. package/.claude/agents/code-reviewer.md +5 -0
  4. package/.claude/agents/stack-resolver.md +8 -3
  5. package/.claude/hooks/flow-state.js +30 -0
  6. package/.claude/skills/stack-discovery/SKILL.md +7 -0
  7. package/.claude/skills/to-issues/SKILL.md +10 -6
  8. package/CLAUDE.md +13 -0
  9. package/README.repo.md +1 -1
  10. package/bin/lib/lint.js +1 -16
  11. package/package.json +1 -1
  12. package/.claude/skills/_vendor/NOTICE.md +0 -11
  13. package/.claude/skills/_vendor/mattpocock-LICENSE +0 -21
  14. package/.claude/skills/_vendor/vendored.json +0 -15
  15. package/.claude/skills/diagnose/SKILL.md +0 -117
  16. package/.claude/skills/diagnose/scripts/hitl-loop.template.sh +0 -41
  17. package/.claude/skills/grill-with-docs/ADR-FORMAT.md +0 -47
  18. package/.claude/skills/grill-with-docs/CONTEXT-FORMAT.md +0 -60
  19. package/.claude/skills/grill-with-docs/SKILL.md +0 -88
  20. package/.claude/skills/improve-codebase-architecture/DEEPENING.md +0 -37
  21. package/.claude/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
  22. package/.claude/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +0 -44
  23. package/.claude/skills/improve-codebase-architecture/LANGUAGE.md +0 -53
  24. package/.claude/skills/improve-codebase-architecture/SKILL.md +0 -81
  25. package/.claude/skills/prototype/LOGIC.md +0 -79
  26. package/.claude/skills/prototype/SKILL.md +0 -30
  27. package/.claude/skills/prototype/UI.md +0 -112
  28. package/.claude/skills/setup-matt-pocock-skills/SKILL.md +0 -121
  29. package/.claude/skills/setup-matt-pocock-skills/domain.md +0 -51
  30. package/.claude/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -22
  31. package/.claude/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -23
  32. package/.claude/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -19
  33. package/.claude/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
  34. package/.claude/skills/tdd/SKILL.md +0 -109
  35. package/.claude/skills/tdd/deep-modules.md +0 -33
  36. package/.claude/skills/tdd/interface-design.md +0 -31
  37. package/.claude/skills/tdd/mocking.md +0 -59
  38. package/.claude/skills/tdd/refactoring.md +0 -10
  39. package/.claude/skills/tdd/tests.md +0 -61
  40. package/.claude/skills/triage/AGENT-BRIEF.md +0 -168
  41. package/.claude/skills/triage/OUT-OF-SCOPE.md +0 -101
  42. package/.claude/skills/triage/SKILL.md +0 -103
  43. package/.claude/skills/zoom-out/SKILL.md +0 -7
@@ -0,0 +1,44 @@
1
+ # CONTEXT — project domain glossary
2
+
3
+ > Per-repo **ubiquitous-language** glossary (ADR-050). Agents read this before
4
+ > exploring code and use its exact vocabulary in plans, issues, code, and tests.
5
+ > Together with the stack pack it forms the project's working context.
6
+ > Copy this template to the project root as `CONTEXT.md` and fill it in
7
+ > (`stack-discovery` / `create-stack-pack` can seed it for you).
8
+
9
+ ## Domain in one paragraph
10
+
11
+ <What this project is, who uses it, and the core value — 2–4 sentences in the
12
+ team's own words.>
13
+
14
+ ## Ubiquitous language (the glossary)
15
+
16
+ Use these terms verbatim — never invent synonyms. One row per concept.
17
+
18
+ | Term | Means | NOT to be confused with |
19
+ |---|---|---|
20
+ | `<Order>` | <a customer's confirmed purchase, after payment> | `Cart` (pre-payment) |
21
+ | `<...>` | <...> | <...> |
22
+
23
+ ## Bounded contexts (if multi-context)
24
+
25
+ - `<context-name>` — <responsibility>; owns `<entities>`.
26
+ - (Single-context project: write "single context".)
27
+
28
+ ## Core invariants
29
+
30
+ Business rules that must always hold (named, so plans/tests reference them).
31
+
32
+ - `INV-1`: <e.g. an Order always has at least one line item>
33
+ - `INV-2`: <...>
34
+
35
+ ## Naming conventions
36
+
37
+ - Entities/tables: <e.g. singular PascalCase entities, snake_case tables>
38
+ - Endpoints: <e.g. `/api/v1/<plural-resource>`>
39
+ - Events/statuses: <the allowed status strings, exactly>
40
+
41
+ ## Pointers
42
+
43
+ - ADRs that touch the domain: `docs/brain/decisions/` (or `docs/adr/`)
44
+ - Stack pack: resolved from `## Project Identity` via `stack-resolver`
@@ -31,17 +31,25 @@ Do NOT generate the PLAN from a free description in the human path.
31
31
 
32
32
  Receive an ambiguous feature/bug/task description and distill it into a complete plan with requirements, BDD user stories, sprint ordering, and **DoD criteria written so that each task or sprint can be handed to `/goal <condition>` in Claude Code and run autonomously until the condition is met**.
33
33
 
34
+ ## Synthesis principles (ADR-050)
35
+
36
+ Three patterns shape every plan you write — they are *our* implementations of ideas learned from the community, not optional flavour:
37
+
38
+ - **Domain glossary first (`CONTEXT.md`).** If the project has a `CONTEXT.md` (per-repo ubiquitous-language glossary), read it before anything and use its exact vocabulary throughout the plan — entities, actions, statuses. The glossary + the stack pack together are the project's working context. If absent, propose seeding one in §7 (Decisões pendentes).
39
+ - **Tracer-bullet vertical slices.** Decompose sprints/tasks by **end-to-end vertical slices** that cut through every layer (DB → service → API → UI) and ship something demonstrable — NOT horizontal layers ("all backend, then all frontend"). Each slice is independently shippable and gated.
40
+ - **Deep modules (Ousterhout).** In modeling, prefer **deep modules**: a simple, stable, testable interface hiding substantial functionality. Flag **shallow modules** (interface as wide as the implementation, pass-through) as a smell to consolidate.
41
+
34
42
  ## Flow
35
43
 
36
- 1. **Understanding**: objective, personas, flows, criteria, copywriting, constraints. Inspect existing code.
44
+ 1. **Understanding**: read `CONTEXT.md` (domain glossary) if present and adopt its vocabulary; then objective, personas, flows, criteria, copywriting, constraints. Inspect existing code.
37
45
  2. **Requirements**:
38
46
  - **FR** (functional) — what the system does.
39
47
  - **NFR** (non-functional) — performance, security, UX.
40
48
  - **BR** (business rules) — validations, policies.
41
49
  - **IR** (implicit) — permissions, audit, pagination, loading, responsiveness, empty states.
42
- 3. **Modeling**: entities + attributes, relationships, detailed flows, technical mapping (endpoints, components, migrations).
50
+ 3. **Modeling**: entities + attributes, relationships, detailed flows, technical mapping (endpoints, components, migrations). **Sketch the modules** you will build/modify and mark each **deep** (simple interface, encapsulated complexity — preferred) or **shallow** (pass-through — consolidate). Use the `CONTEXT.md` vocabulary for module + entity names.
43
51
  4. **BDD User Stories**: Given/When/Then for happy path AND edge cases. Priority (S/M/L) and estimate.
44
- 5. **Sprints**: tasks ordered with dependencies.
52
+ 5. **Sprints**: tasks ordered with dependencies, decomposed as **tracer-bullet vertical slices** — each task/slice cuts end-to-end (DB → service → API → UI as applicable) and is independently demonstrable + gated, never a horizontal layer.
45
53
  6. **Risks and pending items**: ambiguities (mark as "ask the client"), `tech-lead` decisions.
46
54
  7. **Goal-ready DoD**: for every task and every sprint, write a Definition of Done that a `/goal` evaluator (Haiku by default) can verify objectively from command output or file inspection. See §"Goal-ready output rules" below.
47
55
  8. **Generate**: `docs/plans/PLAN_<NAME>.md` following the canonical structure (§"Plan structure").
@@ -100,11 +108,12 @@ The generated `docs/plans/PLAN_<NAME>.md` must have these sections in this order
100
108
 
101
109
  ## 5. Sprints
102
110
  ### Sprint 1 — <tema>
103
- - Tasks (em ordem de dependência):
104
- 1. T-001 <descrição>
105
- - Cobre US-001, US-002
111
+ - Tasks = tracer-bullet vertical slices (cada uma corta DB→service→API→UI e é demonstrável):
112
+ 1. T-001 <slice end-to-end, ex: "criar produto: migration + endpoint POST + tela mínima de cadastro">
113
+ - Cobre US-001 (happy path da fatia)
114
+ - Módulos: <deep: X | shallow a consolidar: Y>
106
115
  - DoD: <condição machine-checkable>
107
- 2. T-002 ...
116
+ 2. T-002 <próxima fatia vertical, ex: "listar produtos: query + GET + tela de listagem">
108
117
 
109
118
  ### Sprint 2 — ...
110
119
 
@@ -165,6 +174,9 @@ retornou GO.
165
174
  6. **§8 `/goal` block ends the file.** Always present, never empty. If the plan has a single sprint, you still emit one sprint-level `/goal` plus one final goal.
166
175
  7. **No AI/Claude/Anthropic/LLM references in the plan prose.** The PLAN must read as written by the engineering team. Same restriction as commits.
167
176
  8. **Filename**: `docs/plans/PLAN_<NAME_KEBAB_CASE>.md`. No spaces, no accents in filename — slug derived from the feature name.
177
+ 9. **Tracer-bullet decomposition (ADR-050).** Sprints/tasks are vertical end-to-end slices, never horizontal layers. A task that touches only one layer must be justified (e.g. a pure migration) or merged into a slice.
178
+ 10. **Deep modules (ADR-050).** §3 marks each module deep/shallow; shallow modules are flagged for consolidation, not shipped silently.
179
+ 11. **Domain glossary (ADR-050).** If `CONTEXT.md` exists, the plan uses its vocabulary verbatim; if absent, §7 proposes seeding it.
168
180
 
169
181
  ## Interface
170
182
 
@@ -77,6 +77,11 @@ For any check above, the **STACK CONTEXT pack overrides** when more specific (e.
77
77
 
78
78
  ## 4. Cross-cutting checks (universal)
79
79
 
80
+ ### Design — deep modules (ADR-050)
81
+ - Prefer **deep modules**: simple, stable interface hiding substantial functionality.
82
+ - Flag **shallow modules** as MINOR/MAJOR: interface as wide/complex as the implementation, pure pass-through wrappers, or a class that just forwards to another. Recommend consolidation.
83
+ - New names match the project's `CONTEXT.md` glossary (if present) — flag vocabulary drift as MINOR.
84
+
80
85
  ### Security (delegate hard cases to `security-engineer`)
81
86
  - Token / password / PII not logged.
82
87
  - CORS not `permitAll` in production.
@@ -24,15 +24,16 @@ Read project's CLAUDE.md, parse `## Project Identity`, identify Primary stack, l
24
24
  6. **Read the pack**:
25
25
  - If pack exists -> Read it -> return rendered STACK CONTEXT block (see §Output below).
26
26
  - If pack absent -> **hard-fail** with `PACK_MISSING_ERROR` (see §Hard-fail protocol below). Do NOT silently fall through to defaults. Do NOT invent a pack.
27
- 7. **Always emit first-line tag** for validation by invoking skill:
28
- `[STACK: <lang>/<framework>-<major> | PACK: loaded|none]`
27
+ 7. **Read the domain glossary (ADR-050)**: check the project root for `CONTEXT.md` (per-repo ubiquitous-language glossary). If present, read it and append a `DOMAIN GLOSSARY` section to the output so downstream agents use the project's exact vocabulary. If absent, note `Domain glossary: none (suggest seeding CONTEXT.md)` — non-fatal.
28
+ 8. **Always emit first-line tag** for validation by invoking skill:
29
+ `[STACK: <lang>/<framework>-<major> | PACK: loaded|none | GLOSSARY: present|none]`
29
30
 
30
31
  ## Output format
31
32
 
32
33
  When pack loaded:
33
34
 
34
35
  ```
35
- [STACK: java/spring-boot-3 | PACK: loaded]
36
+ [STACK: java/spring-boot-3 | PACK: loaded | GLOSSARY: present]
36
37
 
37
38
  === STACK CONTEXT ===
38
39
  Language: java
@@ -43,6 +44,9 @@ Pack path: .claude/stacks/java/spring-boot-3.md
43
44
 
44
45
  === STACK RULES (inline — do not Read again) ===
45
46
  <full pack content, including frontmatter, all 10 sections>
47
+
48
+ === DOMAIN GLOSSARY (CONTEXT.md — use this vocabulary) ===
49
+ <full CONTEXT.md content if present, else: "none — suggest seeding CONTEXT.md">
46
50
  === END STACK CONTEXT ===
47
51
  ```
48
52
 
@@ -91,6 +95,7 @@ When the pack is absent, before emitting `PACK_MISSING_ERROR`:
91
95
  5. **No agent dispatch** — this agent is a leaf; invokers (skills) dispatch others based on the resolver's output.
92
96
  6. **Hard-fail on missing pack** — no silent fallback. `PACK_MISSING_ERROR` is mandatory. Invokers must stop or present bypass confirmation. This is non-negotiable (ADR-026 T1.2).
93
97
  7. **Always suggest nearest packs** — a resolver that returns only "not found" without suggestions violates this contract.
98
+ 8. **Domain glossary is non-fatal (ADR-050)** — read project `CONTEXT.md` if present and append it; if absent, note it and proceed. Never hard-fail on a missing glossary (unlike a missing pack).
94
99
 
95
100
  ## Interface
96
101
 
@@ -129,6 +129,36 @@ function deriveState(projectRoot) {
129
129
  // docs/plans/ does not exist — no plan artifacts
130
130
  }
131
131
 
132
+ // Local-files issue layer (ADR-050): .scratch/<feature>/ is an OPTIONAL,
133
+ // governed alternative to docs/ artifacts. A PRD.md counts as discovery; an
134
+ // issues/ dir with at least one issue counts as a plan. So governance still
135
+ // holds for projects that use the issue-style local files instead of docs/.
136
+ try {
137
+ const scratch = path.join(root, '.scratch');
138
+ for (const feat of fs.readdirSync(scratch)) {
139
+ const featDir = path.join(scratch, feat);
140
+ let isDir = false;
141
+ try { isDir = fs.statSync(featDir).isDirectory(); } catch { /* skip */ }
142
+ if (!isDir) continue;
143
+ if (!discoveryArtifact && fs.existsSync(path.join(featDir, 'PRD.md'))) {
144
+ discoveryArtifact = path.join(featDir, 'PRD.md');
145
+ if (!activeFeature) activeFeature = feat;
146
+ }
147
+ if (!planArtifact) {
148
+ const issuesDir = path.join(featDir, 'issues');
149
+ try {
150
+ const issues = fs.readdirSync(issuesDir).filter((f) => f.endsWith('.md'));
151
+ if (issues.length > 0) {
152
+ planArtifact = path.join(issuesDir, issues.sort()[0]);
153
+ if (!activeFeature) activeFeature = feat;
154
+ }
155
+ } catch { /* no issues/ dir */ }
156
+ }
157
+ }
158
+ } catch {
159
+ // .scratch/ does not exist — no local-files issue artifacts
160
+ }
161
+
132
162
  // Determine stage
133
163
  let stage = 'none';
134
164
  if (planArtifact) {
@@ -108,6 +108,13 @@ Use `Edit` para substituir SOMENTE a seção `## Project Identity` em `CLAUDE.md
108
108
  > "Pack `.claude/stacks/java/spring-boot-5.md` não existe. Disparando `create-stack-pack` para gerar antes de continuar."
109
109
  Depois que `create-stack-pack` retorna, feche com o output normal.
110
110
 
111
+ ### Step 7 — Seed CONTEXT.md (domain glossary — ADR-050)
112
+
113
+ Se o projeto **não** tem `CONTEXT.md` no root, ofereça semear a partir do template:
114
+ > "Quer que eu crie um `CONTEXT.md` (glossário de domínio) a partir do template? Os agents usam o vocabulário dele em planos/issues/código."
115
+
116
+ Se **sim**: copie `.claude/CONTEXT.template.md` para `CONTEXT.md` no root e pré-preencha o que já souber da sabatina (domínio em 1 parágrafo + 2-3 termos do glossário). Deixe o resto como placeholder pro user completar. Não bloqueia o fim da skill (opcional).
117
+
111
118
  ## 5. Inviolable rules
112
119
 
113
120
  1. **Sabatina conversacional, opt-in.** Nunca rode em CI, `sprint-runner`, ou qualquer fluxo autônomo.
@@ -54,13 +54,17 @@ Read the full `PRD_*.md`. Extract from each section:
54
54
 
55
55
  If `docs/issues/` does not exist, create it. Use `Write` to create `docs/issues/.gitkeep` if needed, then proceed to write the ISSUES file.
56
56
 
57
- ### Step 4 — Decompose into issues
57
+ ### Step 4 — Decompose into issues (tracer-bullet vertical slices — ADR-050)
58
58
 
59
- Apply the following decomposition rules:
60
- - One issue per User Story (from the PRD `## User Stories` section).
61
- - Additional issues for cross-cutting NFRs (security hardening, a11y audit, performance baseline) when they represent distinct, shippable work items.
62
- - Do NOT create an issue for items listed in `## Out of scope`.
63
- - Issue granularity: each issue must be completable in one sprint by one developer. Split large stories.
59
+ Decompose by **tracer-bullet vertical slices**, not horizontal layers. Each issue cuts **end-to-end** through every layer it needs (DB → service → API → UI) and ships something demonstrable on its own — never "backend of feature X" + "frontend of feature X" as separate issues.
60
+
61
+ Rules:
62
+ - **One issue per vertical slice.** A User Story is usually one slice; if a story spans layers, the issue still owns the whole slice end-to-end.
63
+ - **First slice = the thinnest end-to-end path** that proves the architecture (the literal "tracer bullet"). Order issues so the thinnest walking-skeleton slice ships first.
64
+ - Additional issues for cross-cutting NFRs (security hardening, a11y audit, performance baseline) when they are distinct, shippable items.
65
+ - Do NOT create an issue for items in `## Out of scope`.
66
+ - Granularity: each slice completable in one sprint by one developer. Split large stories **by slice** (e.g. "create + read" then "update + delete"), never by layer.
67
+ - Use the project's `CONTEXT.md` glossary vocabulary in titles/bodies if present.
64
68
 
65
69
  ### Step 5 — Write ISSUES_*.md
66
70
 
package/CLAUDE.md CHANGED
@@ -250,8 +250,21 @@ These thresholds are **universal across stacks**. Stack-specific tooling (JaCoCo
250
250
 
251
251
  - **Clean Code + SOLID** applied through code, without naming names ostentatiously.
252
252
  - **No premature abstraction**. Interface for one implementation = code smell.
253
+ - **Prefer deep modules** (Ousterhout, ADR-050): a **simple, stable interface hiding substantial functionality**. A **shallow module** — interface as wide/complex as its implementation, or a pure pass-through — is a smell; consolidate it. `analyst` marks modules deep/shallow in the plan; `code-reviewer`/`tech-lead` flag shallow ones in review.
253
254
  - **Never suggest a technology without justification**. Simplest solution = best.
254
255
 
256
+ ## Project domain glossary — `CONTEXT.md` (ADR-050)
257
+
258
+ A project MAY ship a root `CONTEXT.md` (per-repo ubiquitous-language glossary — terms, bounded contexts, invariants, naming). When present, **agents read it before exploring code and use its vocabulary verbatim** in plans, issues, code, and tests. `stack-resolver` surfaces it alongside the stack pack (`DOMAIN GLOSSARY` block); together they are the project's working context. Seed one from `.claude/CONTEXT.template.md` (`stack-discovery` offers this). Absent glossary is non-fatal.
259
+
260
+ ## Decomposition — tracer-bullet vertical slices (ADR-050)
261
+
262
+ Features are decomposed into **end-to-end vertical slices** (DB → service → API → UI) that each ship something demonstrable — never horizontal layers ("all backend, then all frontend"). The thinnest end-to-end slice ships first (the walking skeleton). `analyst` and `to-issues` own this; `sprint-runner` executes slice by slice.
263
+
264
+ ## Optional local-files issue layer — `.scratch/` (ADR-050)
265
+
266
+ Projects may use an **issue-style local-files layer** instead of (or alongside) the `docs/discovery|prd|plans/` artifacts: one dir per feature at `.scratch/<feature-slug>/` with `PRD.md` and `issues/NN-<slug>.md` (each issue carries a `Status:` line). This is **governed** — `flow-guard` recognizes `.scratch/<feature>/PRD.md` as a discovery artifact and `.scratch/<feature>/issues/*.md` as a plan artifact, so the same prerequisite gating applies. It is an option, not a replacement; the `docs/` file pipeline remains the default.
267
+
255
268
  ## Backend layout (DDD, universal pattern)
256
269
 
257
270
  The package/folder names below are **conceptual** — actual naming may vary by language (`com.company.project/domain/...` in Java, `app/domain/...` in Python, `internal/domain/...` in Go):
package/README.repo.md CHANGED
@@ -404,7 +404,7 @@ Full vault under [`docs/brain/`](docs/brain/) — browse via Obsidian. Live ADR
404
404
 
405
405
  Honest thanks to:
406
406
 
407
- - **[`mattpocock/skills`](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 `grill-me` discovery interview is Matt's design. As of **v0.16.0** the harness is **adopting Matt's full issue-tracker engineering workflow** (ADR-049, MIT): we **vendor** his skills `diagnose`, `grill-with-docs`, `improve-codebase-architecture`, `prototype`, `setup-matt-pocock-skills`, `tdd`, `triage`, `zoom-out` (and, in a later sprint, `to-prd`/`to-issues`) under `.claude/skills/` with his `LICENSE` + a `NOTICE` (see `.claude/skills/_vendor/`). They are bundled, not re-authored; upstream is the source of truth. The staged migration is in `docs/plans/PLAN_mattpocock-workflow-adoption.md`.
407
+ - **[`mattpocock/skills`](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 `grill-me` discovery interview is Matt's design, and several of his ideas inform our own pipeline — **tracer-bullet vertical-slice issues**, a **`CONTEXT.md` domain glossary**, the **deep-modules** heuristic, and a **local-files issue model**. We evaluated adopting his issue-tracker workflow wholesale (ADR-049) and decided instead to **build our own superior synthesis** (ADR-050): keep our role-agent team, Senior+ gate, stack-awareness and deterministic flow governance where his skills-only model falls short while learning from the patterns above. We do **not** vendor his skills; we credit the ideas and reimplement them better-integrated.
408
408
  - **[`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.
409
409
  - **[`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).
410
410
  - **[`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.
package/bin/lib/lint.js CHANGED
@@ -174,23 +174,9 @@ function findStackPacks() {
174
174
  // ── Category 1: skills.frontmatter ──────────────────────────────────────────
175
175
 
176
176
  const SKILL_REQUIRED_FIELDS = ['name', 'description', 'tools', 'model'];
177
- // Vendored third-party skills are valid Claude Code skills as-authored upstream;
178
- // `tools`/`model` are a harness-internal convention, not a Claude Code requirement.
179
- const VENDORED_REQUIRED_FIELDS = ['name', 'description'];
180
-
181
- function loadVendoredSkillNames() {
182
- try {
183
- const p = path.join(packageRoot(), '.claude', 'skills', '_vendor', 'vendored.json');
184
- const data = JSON.parse(fs.readFileSync(p, 'utf8'));
185
- return new Set(Array.isArray(data.skills) ? data.skills : []);
186
- } catch {
187
- return new Set();
188
- }
189
- }
190
177
 
191
178
  function checkSkillsFrontmatter() {
192
179
  const violations = [];
193
- const vendored = loadVendoredSkillNames();
194
180
  for (const skill of findSkills()) {
195
181
  const content = readSafe(skill.path);
196
182
  if (content === null) {
@@ -198,8 +184,7 @@ function checkSkillsFrontmatter() {
198
184
  continue;
199
185
  }
200
186
  const { frontmatter } = extractFrontmatter(content);
201
- const required = vendored.has(skill.name) ? VENDORED_REQUIRED_FIELDS : SKILL_REQUIRED_FIELDS;
202
- for (const f of required) {
187
+ for (const f of SKILL_REQUIRED_FIELDS) {
203
188
  if (!frontmatter[f]) {
204
189
  violations.push({
205
190
  category: 'skills', severity: ERROR, file: skill.path, line: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eltonssouza/development-utility-kit",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "npx installer for the development-utility-kit harness",
5
5
  "bin": {
6
6
  "duk": "bin/cli.js"
@@ -1,11 +0,0 @@
1
- # Vendored skills — attribution
2
-
3
- The following skills are vendored from **[mattpocock/skills](https://github.com/mattpocock/skills)**
4
- by **Matt Pocock**, under the **MIT License** (see `mattpocock-LICENSE`):
5
-
6
- - `diagnose`, `grill-with-docs`, `improve-codebase-architecture`, `prototype`,
7
- `setup-matt-pocock-skills`, `tdd`, `triage`, `zoom-out`
8
- - (Sprint 4: `to-prd`, `to-issues`)
9
-
10
- They are bundled — not re-authored. Upstream is the source of truth; we re-sync
11
- on update. See `docs/plans/PLAN_mattpocock-workflow-adoption.md` (ADR-049).
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Matt Pocock
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,15 +0,0 @@
1
- {
2
- "_comment": "Skills vendored from third parties (MIT). Exempt from the harness tools/model frontmatter convention — they are valid Claude Code skills as-authored upstream. See _vendor/NOTICE.md.",
3
- "source": "mattpocock/skills",
4
- "license": "MIT",
5
- "skills": [
6
- "diagnose",
7
- "grill-with-docs",
8
- "improve-codebase-architecture",
9
- "prototype",
10
- "setup-matt-pocock-skills",
11
- "tdd",
12
- "triage",
13
- "zoom-out"
14
- ]
15
- }
@@ -1,117 +0,0 @@
1
- ---
2
- name: diagnose
3
- description: Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
4
- ---
5
-
6
- # Diagnose
7
-
8
- A discipline for hard bugs. Skip phases only when explicitly justified.
9
-
10
- When exploring the codebase, use the project's domain glossary to get a clear mental model of the relevant modules, and check ADRs in the area you're touching.
11
-
12
- ## Phase 1 — Build a feedback loop
13
-
14
- **This is the skill.** Everything else is mechanical. If you have a fast, deterministic, agent-runnable pass/fail signal for the bug, you will find the cause — bisection, hypothesis-testing, and instrumentation all just consume that signal. If you don't have one, no amount of staring at code will save you.
15
-
16
- Spend disproportionate effort here. **Be aggressive. Be creative. Refuse to give up.**
17
-
18
- ### Ways to construct one — try them in roughly this order
19
-
20
- 1. **Failing test** at whatever seam reaches the bug — unit, integration, e2e.
21
- 2. **Curl / HTTP script** against a running dev server.
22
- 3. **CLI invocation** with a fixture input, diffing stdout against a known-good snapshot.
23
- 4. **Headless browser script** (Playwright / Puppeteer) — drives the UI, asserts on DOM/console/network.
24
- 5. **Replay a captured trace.** Save a real network request / payload / event log to disk; replay it through the code path in isolation.
25
- 6. **Throwaway harness.** Spin up a minimal subset of the system (one service, mocked deps) that exercises the bug code path with a single function call.
26
- 7. **Property / fuzz loop.** If the bug is "sometimes wrong output", run 1000 random inputs and look for the failure mode.
27
- 8. **Bisection harness.** If the bug appeared between two known states (commit, dataset, version), automate "boot at state X, check, repeat" so you can `git bisect run` it.
28
- 9. **Differential loop.** Run the same input through old-version vs new-version (or two configs) and diff outputs.
29
- 10. **HITL bash script.** Last resort. If a human must click, drive _them_ with `scripts/hitl-loop.template.sh` so the loop is still structured. Captured output feeds back to you.
30
-
31
- Build the right feedback loop, and the bug is 90% fixed.
32
-
33
- ### Iterate on the loop itself
34
-
35
- Treat the loop as a product. Once you have _a_ loop, ask:
36
-
37
- - Can I make it faster? (Cache setup, skip unrelated init, narrow the test scope.)
38
- - Can I make the signal sharper? (Assert on the specific symptom, not "didn't crash".)
39
- - Can I make it more deterministic? (Pin time, seed RNG, isolate filesystem, freeze network.)
40
-
41
- A 30-second flaky loop is barely better than no loop. A 2-second deterministic loop is a debugging superpower.
42
-
43
- ### Non-deterministic bugs
44
-
45
- The goal is not a clean repro but a **higher reproduction rate**. Loop the trigger 100×, parallelise, add stress, narrow timing windows, inject sleeps. A 50%-flake bug is debuggable; 1% is not — keep raising the rate until it's debuggable.
46
-
47
- ### When you genuinely cannot build a loop
48
-
49
- Stop and say so explicitly. List what you tried. Ask the user for: (a) access to whatever environment reproduces it, (b) a captured artifact (HAR file, log dump, core dump, screen recording with timestamps), or (c) permission to add temporary production instrumentation. Do **not** proceed to hypothesise without a loop.
50
-
51
- Do not proceed to Phase 2 until you have a loop you believe in.
52
-
53
- ## Phase 2 — Reproduce
54
-
55
- Run the loop. Watch the bug appear.
56
-
57
- Confirm:
58
-
59
- - [ ] The loop produces the failure mode the **user** described — not a different failure that happens to be nearby. Wrong bug = wrong fix.
60
- - [ ] The failure is reproducible across multiple runs (or, for non-deterministic bugs, reproducible at a high enough rate to debug against).
61
- - [ ] You have captured the exact symptom (error message, wrong output, slow timing) so later phases can verify the fix actually addresses it.
62
-
63
- Do not proceed until you reproduce the bug.
64
-
65
- ## Phase 3 — Hypothesise
66
-
67
- Generate **3–5 ranked hypotheses** before testing any of them. Single-hypothesis generation anchors on the first plausible idea.
68
-
69
- Each hypothesis must be **falsifiable**: state the prediction it makes.
70
-
71
- > Format: "If <X> is the cause, then <changing Y> will make the bug disappear / <changing Z> will make it worse."
72
-
73
- If you cannot state the prediction, the hypothesis is a vibe — discard or sharpen it.
74
-
75
- **Show the ranked list to the user before testing.** They often have domain knowledge that re-ranks instantly ("we just deployed a change to #3"), or know hypotheses they've already ruled out. Cheap checkpoint, big time saver. Don't block on it — proceed with your ranking if the user is AFK.
76
-
77
- ## Phase 4 — Instrument
78
-
79
- Each probe must map to a specific prediction from Phase 3. **Change one variable at a time.**
80
-
81
- Tool preference:
82
-
83
- 1. **Debugger / REPL inspection** if the env supports it. One breakpoint beats ten logs.
84
- 2. **Targeted logs** at the boundaries that distinguish hypotheses.
85
- 3. Never "log everything and grep".
86
-
87
- **Tag every debug log** with a unique prefix, e.g. `[DEBUG-a4f2]`. Cleanup at the end becomes a single grep. Untagged logs survive; tagged logs die.
88
-
89
- **Perf branch.** For performance regressions, logs are usually wrong. Instead: establish a baseline measurement (timing harness, `performance.now()`, profiler, query plan), then bisect. Measure first, fix second.
90
-
91
- ## Phase 5 — Fix + regression test
92
-
93
- Write the regression test **before the fix** — but only if there is a **correct seam** for it.
94
-
95
- A correct seam is one where the test exercises the **real bug pattern** as it occurs at the call site. If the only available seam is too shallow (single-caller test when the bug needs multiple callers, unit test that can't replicate the chain that triggered the bug), a regression test there gives false confidence.
96
-
97
- **If no correct seam exists, that itself is the finding.** Note it. The codebase architecture is preventing the bug from being locked down. Flag this for the next phase.
98
-
99
- If a correct seam exists:
100
-
101
- 1. Turn the minimised repro into a failing test at that seam.
102
- 2. Watch it fail.
103
- 3. Apply the fix.
104
- 4. Watch it pass.
105
- 5. Re-run the Phase 1 feedback loop against the original (un-minimised) scenario.
106
-
107
- ## Phase 6 — Cleanup + post-mortem
108
-
109
- Required before declaring done:
110
-
111
- - [ ] Original repro no longer reproduces (re-run the Phase 1 loop)
112
- - [ ] Regression test passes (or absence of seam is documented)
113
- - [ ] All `[DEBUG-...]` instrumentation removed (`grep` the prefix)
114
- - [ ] Throwaway prototypes deleted (or moved to a clearly-marked debug location)
115
- - [ ] The hypothesis that turned out correct is stated in the commit / PR message — so the next debugger learns
116
-
117
- **Then ask: what would have prevented this bug?** If the answer involves architectural change (no good test seam, tangled callers, hidden coupling) hand off to the `/improve-codebase-architecture` skill with the specifics. Make the recommendation **after** the fix is in, not before — you have more information now than when you started.
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Human-in-the-loop reproduction loop.
3
- # Copy this file, edit the steps below, and run it.
4
- # The agent runs the script; the user follows prompts in their terminal.
5
- #
6
- # Usage:
7
- # bash hitl-loop.template.sh
8
- #
9
- # Two helpers:
10
- # step "<instruction>" → show instruction, wait for Enter
11
- # capture VAR "<question>" → show question, read response into VAR
12
- #
13
- # At the end, captured values are printed as KEY=VALUE for the agent to parse.
14
-
15
- set -euo pipefail
16
-
17
- step() {
18
- printf '\n>>> %s\n' "$1"
19
- read -r -p " [Enter when done] " _
20
- }
21
-
22
- capture() {
23
- local var="$1" question="$2" answer
24
- printf '\n>>> %s\n' "$question"
25
- read -r -p " > " answer
26
- printf -v "$var" '%s' "$answer"
27
- }
28
-
29
- # --- edit below ---------------------------------------------------------
30
-
31
- step "Open the app at http://localhost:3000 and sign in."
32
-
33
- capture ERRORED "Click the 'Export' button. Did it throw an error? (y/n)"
34
-
35
- capture ERROR_MSG "Paste the error message (or 'none'):"
36
-
37
- # --- edit above ---------------------------------------------------------
38
-
39
- printf '\n--- Captured ---\n'
40
- printf 'ERRORED=%s\n' "$ERRORED"
41
- printf 'ERROR_MSG=%s\n' "$ERROR_MSG"
@@ -1,47 +0,0 @@
1
- # ADR Format
2
-
3
- ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
4
-
5
- Create the `docs/adr/` directory lazily — only when the first ADR is needed.
6
-
7
- ## Template
8
-
9
- ```md
10
- # {Short title of the decision}
11
-
12
- {1-3 sentences: what's the context, what did we decide, and why.}
13
- ```
14
-
15
- That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
16
-
17
- ## Optional sections
18
-
19
- Only include these when they add genuine value. Most ADRs won't need them.
20
-
21
- - **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
22
- - **Considered Options** — only when the rejected alternatives are worth remembering
23
- - **Consequences** — only when non-obvious downstream effects need to be called out
24
-
25
- ## Numbering
26
-
27
- Scan `docs/adr/` for the highest existing number and increment by one.
28
-
29
- ## When to offer an ADR
30
-
31
- All three of these must be true:
32
-
33
- 1. **Hard to reverse** — the cost of changing your mind later is meaningful
34
- 2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
35
- 3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
36
-
37
- If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
38
-
39
- ### What qualifies
40
-
41
- - **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
42
- - **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
43
- - **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
44
- - **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
45
- - **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
46
- - **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
47
- - **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
@@ -1,60 +0,0 @@
1
- # CONTEXT.md Format
2
-
3
- ## Structure
4
-
5
- ```md
6
- # {Context Name}
7
-
8
- {One or two sentence description of what this context is and why it exists.}
9
-
10
- ## Language
11
-
12
- **Order**:
13
- {A one or two sentence description of the term}
14
- _Avoid_: Purchase, transaction
15
-
16
- **Invoice**:
17
- A request for payment sent to a customer after delivery.
18
- _Avoid_: Bill, payment request
19
-
20
- **Customer**:
21
- A person or organization that places orders.
22
- _Avoid_: Client, buyer, account
23
- ```
24
-
25
- ## Rules
26
-
27
- - **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28
- - **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29
- - **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
30
- - **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31
-
32
- ## Single vs multi-context repos
33
-
34
- **Single context (most repos):** One `CONTEXT.md` at the repo root.
35
-
36
- **Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37
-
38
- ```md
39
- # Context Map
40
-
41
- ## Contexts
42
-
43
- - [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
44
- - [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
45
- - [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
46
-
47
- ## Relationships
48
-
49
- - **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50
- - **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51
- - **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52
- ```
53
-
54
- The skill infers which structure applies:
55
-
56
- - If `CONTEXT-MAP.md` exists, read it to find contexts
57
- - If only a root `CONTEXT.md` exists, single context
58
- - If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
59
-
60
- When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.