@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
package/bin/lib/help.js
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Help text for the duk CLI.
|
|
5
|
+
*
|
|
6
|
+
* Three modes:
|
|
7
|
+
* - printGeneralHelp() → full usage page (`duk help`)
|
|
8
|
+
* - printCommandHelp(cmd) → detailed help for one command
|
|
9
|
+
* - printShortHelp() → terse usage shown when called with no args
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const GENERAL_HELP = `\
|
|
13
|
+
duk — development-utility-kit CLI
|
|
14
|
+
|
|
15
|
+
Usage: duk <command> [options]
|
|
16
|
+
|
|
17
|
+
COMMANDS
|
|
18
|
+
new <name> Scaffold new project + open Cowork for conversational stack discovery
|
|
19
|
+
install Inject harness into CWD (idempotent). Detects existing stack
|
|
20
|
+
update Alias for install
|
|
21
|
+
sync-all <dir> Update harness in multiple projects under <dir>. Default dry-run
|
|
22
|
+
dashboard Start local telemetry dashboard (Express + Chart.js)
|
|
23
|
+
doctor Validate environment (Node, git, paths, hooks, packs, credentials)
|
|
24
|
+
lint Validate harness .claude/ structure (frontmatter, refs, ADRs, packs)
|
|
25
|
+
help [command] Show this message, or detailed help for <command>
|
|
26
|
+
|
|
27
|
+
COMMON OPTIONS
|
|
28
|
+
--help, -h Show help (this or command-specific)
|
|
29
|
+
--version, -v Show duk version
|
|
30
|
+
|
|
31
|
+
COMMAND-SPECIFIC OPTIONS
|
|
32
|
+
|
|
33
|
+
install / update:
|
|
34
|
+
--sub <dir> Install in subdirectory instead of CWD
|
|
35
|
+
--dry-run Print actions without writing
|
|
36
|
+
--check-only Show "local vs latest harness", do not update
|
|
37
|
+
--force Skip drift detection (overwrite local modifications)
|
|
38
|
+
|
|
39
|
+
sync-all:
|
|
40
|
+
--apply Execute updates (default: dry-run)
|
|
41
|
+
--filter <expr> Filter projects (repeat for AND logic):
|
|
42
|
+
stack:<lang|framework> e.g. stack:java
|
|
43
|
+
type:<value> e.g. type:fullstack
|
|
44
|
+
age:<duration> e.g. age:30d, age:6m
|
|
45
|
+
harness-version:<semver> e.g. harness-version:<0.2
|
|
46
|
+
--exclude <name> Exclude project by folder name (repeat)
|
|
47
|
+
|
|
48
|
+
dashboard:
|
|
49
|
+
--port <n> Port to bind (default: 4242)
|
|
50
|
+
--no-open Do not open browser automatically
|
|
51
|
+
|
|
52
|
+
doctor:
|
|
53
|
+
--json Machine-readable JSON output
|
|
54
|
+
--strict Exit non-zero on WARN too (default: only FAIL fails)
|
|
55
|
+
|
|
56
|
+
lint:
|
|
57
|
+
--json Machine-readable JSON output
|
|
58
|
+
--category <name> Run only one category (comma-separated for many):
|
|
59
|
+
skills, agents, refs, adrs, stacks, d1-contract
|
|
60
|
+
|
|
61
|
+
EXAMPLES
|
|
62
|
+
duk new my-app
|
|
63
|
+
duk install
|
|
64
|
+
duk install --check-only
|
|
65
|
+
duk sync-all C:\\development\\source\\projects --filter stack:java --apply
|
|
66
|
+
duk dashboard --port 4243
|
|
67
|
+
duk doctor
|
|
68
|
+
duk doctor --strict
|
|
69
|
+
duk lint
|
|
70
|
+
duk lint --category skills,agents
|
|
71
|
+
|
|
72
|
+
Run \`duk help <command>\` for detailed information.`;
|
|
73
|
+
|
|
74
|
+
const SHORT_HELP = `\
|
|
75
|
+
duk — development-utility-kit CLI
|
|
76
|
+
|
|
77
|
+
Usage: duk <command> [options]
|
|
78
|
+
|
|
79
|
+
Commands: new | install | update | sync-all | dashboard | doctor | lint | help
|
|
80
|
+
|
|
81
|
+
Run \`duk help\` for full usage, or \`duk help <command>\` for command details.`;
|
|
82
|
+
|
|
83
|
+
const COMMAND_HELP = {
|
|
84
|
+
new: `\
|
|
85
|
+
duk new <name> — Scaffold a new project
|
|
86
|
+
|
|
87
|
+
Creates a folder <name> in the CWD, initialises a git repo, writes a
|
|
88
|
+
CLAUDE.md template with an empty Project Identity, and injects the
|
|
89
|
+
harness (.claude/, CLAUDE.md, HARNESS_VERSION, MANIFEST, local/).
|
|
90
|
+
|
|
91
|
+
Usage:
|
|
92
|
+
duk new <name>
|
|
93
|
+
|
|
94
|
+
Arguments:
|
|
95
|
+
<name> Project folder name (kebab-case recommended).
|
|
96
|
+
Must not already exist.
|
|
97
|
+
|
|
98
|
+
After running:
|
|
99
|
+
1. cd <name>
|
|
100
|
+
2. Open Cowork or Claude Code in the new folder
|
|
101
|
+
3. First message: "sabatina pra projeto novo"
|
|
102
|
+
→ stack-discovery skill walks you through 8 questions and fills
|
|
103
|
+
the Project Identity block.
|
|
104
|
+
|
|
105
|
+
Examples:
|
|
106
|
+
duk new my-app
|
|
107
|
+
duk new payment-gateway`,
|
|
108
|
+
|
|
109
|
+
install: `\
|
|
110
|
+
duk install — Inject the harness into a project
|
|
111
|
+
|
|
112
|
+
Detects the existing stack (pom.xml, package.json, etc.) and writes
|
|
113
|
+
.claude/, CLAUDE.md (preserving ## Project Identity if present),
|
|
114
|
+
HARNESS_VERSION, MANIFEST, and a .claude/local/ placeholder.
|
|
115
|
+
|
|
116
|
+
Usage:
|
|
117
|
+
duk install [options]
|
|
118
|
+
|
|
119
|
+
Options:
|
|
120
|
+
--sub <dir> Install into <dir> instead of the CWD.
|
|
121
|
+
--dry-run Print what would be done without writing.
|
|
122
|
+
--check-only Detect stack + report local-vs-latest harness;
|
|
123
|
+
do not write anything.
|
|
124
|
+
--force Skip drift detection (overwrite local changes).
|
|
125
|
+
A backup is still created.
|
|
126
|
+
--help, -h Show this help.
|
|
127
|
+
|
|
128
|
+
Drift detection:
|
|
129
|
+
install reads .claude/.MANIFEST (sha256 of every file from the prior
|
|
130
|
+
install). If any file was modified locally, install aborts and asks
|
|
131
|
+
you to either:
|
|
132
|
+
1. Move customisations to .claude/local/ (never touched), or
|
|
133
|
+
2. Run with --force to overwrite (backup is preserved), or
|
|
134
|
+
3. Open a PR on the harness repo if the change is canonical.
|
|
135
|
+
|
|
136
|
+
Examples:
|
|
137
|
+
duk install
|
|
138
|
+
duk install --sub backend
|
|
139
|
+
duk install --check-only
|
|
140
|
+
duk install --force
|
|
141
|
+
duk install --dry-run`,
|
|
142
|
+
|
|
143
|
+
update: `\
|
|
144
|
+
duk update — Alias for "duk install"
|
|
145
|
+
|
|
146
|
+
Identical to \`duk install\`. Provided for ergonomics when you are
|
|
147
|
+
updating an already-adopted project.
|
|
148
|
+
|
|
149
|
+
See \`duk help install\` for full options.`,
|
|
150
|
+
|
|
151
|
+
'sync-all': `\
|
|
152
|
+
duk sync-all <dir> — Batch update the harness in many projects
|
|
153
|
+
|
|
154
|
+
Iterates over every folder under <dir> that contains a .claude/
|
|
155
|
+
directory and runs duk install. Default is dry-run; pass --apply to
|
|
156
|
+
execute.
|
|
157
|
+
|
|
158
|
+
Usage:
|
|
159
|
+
duk sync-all <dir> [options]
|
|
160
|
+
|
|
161
|
+
Options:
|
|
162
|
+
--apply Execute the updates (default: dry-run preview).
|
|
163
|
+
--filter <expr> Filter projects (repeat for AND logic):
|
|
164
|
+
stack:<lang|framework> e.g. stack:java
|
|
165
|
+
type:<value> e.g. type:fullstack
|
|
166
|
+
age:<duration> e.g. age:30d, age:6m
|
|
167
|
+
harness-version:<semver> e.g. harness-version:<0.2
|
|
168
|
+
--exclude <name> Skip project by folder name (repeat for multiple).
|
|
169
|
+
--help, -h Show this help.
|
|
170
|
+
|
|
171
|
+
Examples:
|
|
172
|
+
duk sync-all C:\\development\\source\\projects
|
|
173
|
+
duk sync-all . --filter stack:java --apply
|
|
174
|
+
duk sync-all . --filter age:60d
|
|
175
|
+
duk sync-all . --exclude prod-critical --apply
|
|
176
|
+
duk sync-all . --filter harness-version:<0.2 --apply`,
|
|
177
|
+
|
|
178
|
+
dashboard: `\
|
|
179
|
+
duk dashboard — Start the local telemetry dashboard
|
|
180
|
+
|
|
181
|
+
Boots an Express server + Chart.js UI that visualises hook telemetry
|
|
182
|
+
from the local harness.
|
|
183
|
+
|
|
184
|
+
Usage:
|
|
185
|
+
duk dashboard [options]
|
|
186
|
+
|
|
187
|
+
Options:
|
|
188
|
+
--port <n> Port to bind to. Default: 4242.
|
|
189
|
+
--no-open Do not open the browser automatically.
|
|
190
|
+
--help, -h Show this help.
|
|
191
|
+
|
|
192
|
+
Examples:
|
|
193
|
+
duk dashboard
|
|
194
|
+
duk dashboard --port 4243
|
|
195
|
+
duk dashboard --no-open`,
|
|
196
|
+
|
|
197
|
+
doctor: `\
|
|
198
|
+
duk doctor — Validate the environment
|
|
199
|
+
|
|
200
|
+
Mechanical, deterministic check (no LLM, no API calls). Per ADR-034
|
|
201
|
+
("Mecânico → CLI"), validates everything needed for the harness to
|
|
202
|
+
work day-to-day. Safe to run anywhere.
|
|
203
|
+
|
|
204
|
+
Usage:
|
|
205
|
+
duk doctor [options]
|
|
206
|
+
|
|
207
|
+
Options:
|
|
208
|
+
--json Machine-readable JSON output (good for CI).
|
|
209
|
+
--strict Exit non-zero on WARN too (default: only FAIL fails).
|
|
210
|
+
--help, -h Show this help.
|
|
211
|
+
|
|
212
|
+
Checks (categories):
|
|
213
|
+
environment Node >= 18, git, npx, python availability.
|
|
214
|
+
harness .claude/{agents,skills,stacks}, CLAUDE.md,
|
|
215
|
+
package.json, bin/cli.js exist.
|
|
216
|
+
settings ~/.claude/settings.json is valid JSON + hook
|
|
217
|
+
command paths point to existing files.
|
|
218
|
+
stacks .claude/stacks/ has packs + README index.
|
|
219
|
+
credentials C:\\development\\tools\\credentials\\vps.txt
|
|
220
|
+
present (warn-only — not fatal).
|
|
221
|
+
project If CWD is an adopted project: .MANIFEST exists +
|
|
222
|
+
Project Identity is filled (not placeholder).
|
|
223
|
+
|
|
224
|
+
Exit code:
|
|
225
|
+
0 all PASS, or only WARN (unless --strict)
|
|
226
|
+
1 any FAIL, or any WARN with --strict
|
|
227
|
+
|
|
228
|
+
Examples:
|
|
229
|
+
duk doctor
|
|
230
|
+
duk doctor --strict
|
|
231
|
+
duk doctor --json | jq .summary`,
|
|
232
|
+
|
|
233
|
+
lint: `\
|
|
234
|
+
duk lint — Validate the harness .claude/ structure
|
|
235
|
+
|
|
236
|
+
Mechanical, deterministic check (no LLM, no API calls). Per ADR-034
|
|
237
|
+
("Mecânico → CLI"), validates structural correctness of skills,
|
|
238
|
+
agents, ADRs, and stack packs. Replaces scripts/lint-harness.mjs.
|
|
239
|
+
|
|
240
|
+
Usage:
|
|
241
|
+
duk lint [options]
|
|
242
|
+
|
|
243
|
+
Options:
|
|
244
|
+
--json Machine-readable JSON output (good for CI).
|
|
245
|
+
--category <name> Run only one category. Comma-separated for many.
|
|
246
|
+
Valid: skills, agents, refs, adrs, stacks, d1-contract
|
|
247
|
+
--help, -h Show this help.
|
|
248
|
+
|
|
249
|
+
Categories:
|
|
250
|
+
skills SKILL.md frontmatter: required fields
|
|
251
|
+
(name, description, tools, model) + name matches
|
|
252
|
+
directory.
|
|
253
|
+
agents Agent .md frontmatter: required fields
|
|
254
|
+
(name, description, model) + name matches file.
|
|
255
|
+
refs Agents mentioned in skill routing tables exist
|
|
256
|
+
in .claude/agents/.
|
|
257
|
+
adrs ADRs referenced across decisions exist
|
|
258
|
+
+ numbering gaps reported.
|
|
259
|
+
stacks Each stack pack has the recommended sections
|
|
260
|
+
(Build & run, Code patterns, Anti-patterns,
|
|
261
|
+
Security, Testing).
|
|
262
|
+
d1-contract Pattern 1 pairs (skill↔agent share name):
|
|
263
|
+
skill body forbids "checklist/golden rule/
|
|
264
|
+
inviolable rules" sections; agent body forbids
|
|
265
|
+
"PT triggers:" sections.
|
|
266
|
+
|
|
267
|
+
Exit code:
|
|
268
|
+
0 no ERROR found
|
|
269
|
+
1 at least one ERROR (WARN never fails the exit code)
|
|
270
|
+
|
|
271
|
+
Examples:
|
|
272
|
+
duk lint
|
|
273
|
+
duk lint --category skills
|
|
274
|
+
duk lint --category adrs,refs
|
|
275
|
+
duk lint --json > lint-report.json`,
|
|
276
|
+
|
|
277
|
+
help: `\
|
|
278
|
+
duk help [command] — Show help
|
|
279
|
+
|
|
280
|
+
Usage:
|
|
281
|
+
duk help Show full usage page.
|
|
282
|
+
duk help <command> Show detailed help for <command>.
|
|
283
|
+
duk <command> --help Same as \`duk help <command>\`.
|
|
284
|
+
|
|
285
|
+
Commands with detailed help:
|
|
286
|
+
new, install, update, sync-all, dashboard, doctor, lint, help`,
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Write the full general help to stdout.
|
|
291
|
+
*/
|
|
292
|
+
function printGeneralHelp() {
|
|
293
|
+
process.stdout.write(GENERAL_HELP + '\n');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Write the short usage page to stdout (used when called with no args).
|
|
298
|
+
*/
|
|
299
|
+
function printShortHelp() {
|
|
300
|
+
process.stdout.write(SHORT_HELP + '\n');
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Write detailed help for a single command. Falls back to general help
|
|
305
|
+
* if the command is unknown.
|
|
306
|
+
* @param {string} command
|
|
307
|
+
*/
|
|
308
|
+
function printCommandHelp(command) {
|
|
309
|
+
if (!command) {
|
|
310
|
+
printGeneralHelp();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const normalised = command === 'update' ? 'update' : command;
|
|
314
|
+
const text = COMMAND_HELP[normalised];
|
|
315
|
+
if (!text) {
|
|
316
|
+
process.stderr.write(`Unknown command: ${command}\n\n`);
|
|
317
|
+
printGeneralHelp();
|
|
318
|
+
process.exitCode = 1;
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
process.stdout.write(text + '\n');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
module.exports = {
|
|
325
|
+
printGeneralHelp,
|
|
326
|
+
printShortHelp,
|
|
327
|
+
printCommandHelp,
|
|
328
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CLAUDE.md `## Project Identity` helpers.
|
|
5
|
+
*
|
|
6
|
+
* - generateIdentitySection(dr) build a fresh Project Identity block
|
|
7
|
+
* - readIdentitySection(content) extract the existing block from CLAUDE.md
|
|
8
|
+
* - mergeClaudeMd(...) inject identity into the template body
|
|
9
|
+
* - emptyIdentitySection(name) placeholder identity for `duk new`
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const IDENTITY_HEADING = '## Project Identity';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Build the Project Identity block pre-filled with detected values.
|
|
16
|
+
* @param {{ type: string, stackHints: string[] }} dr
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
function generateIdentitySection(dr) {
|
|
20
|
+
const stackLine = dr.stackHints && dr.stackHints.length > 0
|
|
21
|
+
? dr.stackHints.join(', ')
|
|
22
|
+
: '<ex: Java 25 + Spring Boot 4 + Angular 21>';
|
|
23
|
+
return `## Project Identity
|
|
24
|
+
|
|
25
|
+
> **Modifique apenas esta seção ao adotar o plugin em um novo projeto.**
|
|
26
|
+
> Todas as demais seções são base do plugin e não devem ser alteradas diretamente
|
|
27
|
+
> — use \`update-template\` para receber atualizações.
|
|
28
|
+
|
|
29
|
+
- **Project name**: \`<project-name>\`
|
|
30
|
+
- **Project type**: \`${dr.type}\`
|
|
31
|
+
- **Primary stack**: \`${stackLine}\`
|
|
32
|
+
- **Database**: \`<ex: PostgreSQL 17 + Redis 7>\`
|
|
33
|
+
- **Domain**: \`<ex: e-commerce, fintech, healthcare>\`
|
|
34
|
+
- **Team size**: \`<ex: 3 backend, 2 frontend>\`
|
|
35
|
+
- **Additional rules**: _(deixe vazio se não houver)_`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder identity used by `duk new <name>`. All fields are TODO so
|
|
40
|
+
* the stack-discovery skill can fill them in via conversation.
|
|
41
|
+
* @param {string} name
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
function emptyIdentitySection(name) {
|
|
45
|
+
return `## Project Identity
|
|
46
|
+
|
|
47
|
+
> **Modifique apenas esta seção ao adotar o plugin em um novo projeto.**
|
|
48
|
+
> Todas as demais seções são base do plugin e não devem ser alteradas diretamente
|
|
49
|
+
> — use \`update-template\` para receber atualizações.
|
|
50
|
+
|
|
51
|
+
- **Project name**: \`${name}\`
|
|
52
|
+
- **Project type**: \`<TODO: backend | frontend | fullstack | mobile | library | cli | data-pipeline>\`
|
|
53
|
+
- **Primary stack**: \`<TODO: declare via stack-discovery skill>\`
|
|
54
|
+
- **Database**: \`<TODO>\`
|
|
55
|
+
- **Domain**: \`<TODO>\`
|
|
56
|
+
- **Team size**: \`<TODO>\`
|
|
57
|
+
- **Additional rules**: _(deixe vazio se não houver)_`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Extract the existing ## Project Identity section from a CLAUDE.md string.
|
|
62
|
+
* Returns the full section text (from the heading to before the next ## heading),
|
|
63
|
+
* or null if not found.
|
|
64
|
+
* @param {string} content
|
|
65
|
+
* @returns {string|null}
|
|
66
|
+
*/
|
|
67
|
+
function readIdentitySection(content) {
|
|
68
|
+
const startIdx = content.indexOf(IDENTITY_HEADING);
|
|
69
|
+
if (startIdx === -1) return null;
|
|
70
|
+
|
|
71
|
+
const afterHeading = content.indexOf('\n## ', startIdx + IDENTITY_HEADING.length);
|
|
72
|
+
if (afterHeading === -1) {
|
|
73
|
+
return content.slice(startIdx).trimEnd();
|
|
74
|
+
}
|
|
75
|
+
return content.slice(startIdx, afterHeading).trimEnd();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Merge: replace the template's ## Project Identity placeholder with the
|
|
80
|
+
* preserved or generated identity section.
|
|
81
|
+
* @param {string} existing - current file content (may be empty, kept for symmetry)
|
|
82
|
+
* @param {string} template - template content from package
|
|
83
|
+
* @param {string} identity - identity section text to inject
|
|
84
|
+
* @returns {string}
|
|
85
|
+
*/
|
|
86
|
+
function mergeClaudeMd(existing, template, identity) {
|
|
87
|
+
const templateStartIdx = template.indexOf(IDENTITY_HEADING);
|
|
88
|
+
if (templateStartIdx === -1) {
|
|
89
|
+
return identity + '\n\n' + template;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const afterHeading = template.indexOf('\n## ', templateStartIdx + IDENTITY_HEADING.length);
|
|
93
|
+
let rest;
|
|
94
|
+
if (afterHeading === -1) {
|
|
95
|
+
rest = '';
|
|
96
|
+
} else {
|
|
97
|
+
rest = template.slice(afterHeading);
|
|
98
|
+
}
|
|
99
|
+
return identity + rest;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
module.exports = {
|
|
103
|
+
IDENTITY_HEADING,
|
|
104
|
+
generateIdentitySection,
|
|
105
|
+
emptyIdentitySection,
|
|
106
|
+
readIdentitySection,
|
|
107
|
+
mergeClaudeMd,
|
|
108
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "internal — consumed by bin/lib/lint.js",
|
|
3
|
+
"_doc": "Known intentional gaps and exemptions for duk lint. Edit only when adding a documented exception with rationale.",
|
|
4
|
+
|
|
5
|
+
"adr-gaps-known": [
|
|
6
|
+
"001",
|
|
7
|
+
"002",
|
|
8
|
+
"003",
|
|
9
|
+
"004",
|
|
10
|
+
"005",
|
|
11
|
+
"006",
|
|
12
|
+
"009"
|
|
13
|
+
],
|
|
14
|
+
"_adr-gaps-known-rationale": "ADRs 001-006 were deleted in early Hermes housekeeping commits; ADR-009 was deleted by design (no live reference in CLAUDE.md). Recorded in docs/brain/architecture/tech-debt.md Item 4 (rodada 2026-05-27) and Item 20 (rodada 2026-05-28)."
|
|
15
|
+
}
|