dw-kit 1.1.0 → 1.2.1
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/hooks/post-write.sh +9 -11
- package/.claude/hooks/privacy-block.sh +94 -0
- package/.claude/hooks/scout-block.sh +82 -0
- package/.claude/hooks/session-init.sh +85 -0
- package/.claude/hooks/stop-check.sh +36 -0
- package/.claude/rules/dw-core.md +100 -0
- package/.claude/rules/dw-skills.md +53 -0
- package/.claude/settings.json +101 -71
- package/.claude/skills/dw-kit-report/SKILL.md +152 -0
- package/.claude/skills/dw-research/SKILL.md +17 -1
- package/.claude/templates/agent-report.md +35 -0
- package/.dw/config/dw.config.yml +82 -82
- package/.dw/core/AGENTS.md +53 -0
- package/CLAUDE.md +27 -99
- package/README.md +127 -119
- package/package.json +84 -57
- package/src/cli.mjs +100 -92
- package/src/commands/init.mjs +17 -17
- package/src/commands/upgrade.mjs +297 -262
- package/src/lib/config.mjs +31 -2
- package/src/lib/copy.mjs +118 -110
- package/scripts/e2e-local-check.sh +0 -75
- package/src/__fixtures__/claude-cli-bug-snippet.js +0 -15
- package/src/smoke-test.mjs +0 -351
package/README.md
CHANGED
|
@@ -1,119 +1,127 @@
|
|
|
1
|
-
# dw-kit
|
|
2
|
-
|
|
3
|
-
> An AI development workflow toolkit for teams using agentic IDEs (Claude Code, Cursor) — from idea to review-ready commits.
|
|
4
|
-
|
|
5
|
-
**v1.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## What is dw-kit?
|
|
10
|
-
|
|
11
|
-
dw-kit helps your team run AI-assisted development with a **repeatable workflow** and clear checkpoints:
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
Initialize → Understand → Plan → Execute (TDD) → Verify → Close
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
<img src="docs/workflow-diagram.svg" alt="dw-kit workflow diagram" />
|
|
18
|
-
|
|
19
|
-
## Workflow overview
|
|
20
|
-
|
|
21
|
-
`dw` runs a 6-phase process (all phases for `standard` and `thorough`):
|
|
22
|
-
|
|
23
|
-
Initialize → Understand → Plan (stops for approval) → Execute (TDD; 1 commit per subtask) → Verify (quality gates + review sign-off) → Close (handoff + archive when done).
|
|
24
|
-
|
|
25
|
-
### 6 phases (full workflow)
|
|
26
|
-
- **Initialize**: clarify task scope and set up the workspace + task docs.
|
|
27
|
-
- **Understand**: survey the codebase, dependencies, patterns, and test coverage (no implementation).
|
|
28
|
-
- **Plan**: design the solution and subtasks; **pause for your approval**.
|
|
29
|
-
- **Execute**: implement using **TDD**; each subtask produces a commit.
|
|
30
|
-
- **Verify**: run quality gates + review sign-off to ensure correctness and safety.
|
|
31
|
-
- **Close**: handoff notes, finalize progress, and archive when done.
|
|
32
|
-
|
|
33
|
-
It’s designed for collaboration (Dev / Tech Lead / QA / PM) and keeps work auditable via lightweight task docs.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
/dw-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
dw
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
# dw-kit
|
|
2
|
+
|
|
3
|
+
> An AI development workflow toolkit for teams using agentic IDEs (Claude Code, Cursor) — from idea to review-ready commits.
|
|
4
|
+
|
|
5
|
+
**v1.2** · `npm install -g dw-kit` · [Docs](docs/README.md) · [Get started](docs/get-started.md) · [Cheatsheet](docs/cheatsheet.md) · [Changelog](CHANGELOG.md#v120--2026-04-09)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What is dw-kit?
|
|
10
|
+
|
|
11
|
+
dw-kit helps your team run AI-assisted development with a **repeatable workflow** and clear checkpoints:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Initialize → Understand → Plan → Execute (TDD) → Verify → Close
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
<img src="docs/workflow-diagram.svg" alt="dw-kit workflow diagram" />
|
|
18
|
+
|
|
19
|
+
## Workflow overview
|
|
20
|
+
|
|
21
|
+
`dw` runs a 6-phase process (all phases for `standard` and `thorough`):
|
|
22
|
+
|
|
23
|
+
Initialize → Understand → Plan (stops for approval) → Execute (TDD; 1 commit per subtask) → Verify (quality gates + review sign-off) → Close (handoff + archive when done).
|
|
24
|
+
|
|
25
|
+
### 6 phases (full workflow)
|
|
26
|
+
- **Initialize**: clarify task scope and set up the workspace + task docs.
|
|
27
|
+
- **Understand**: survey the codebase, dependencies, patterns, and test coverage (no implementation).
|
|
28
|
+
- **Plan**: design the solution and subtasks; **pause for your approval**.
|
|
29
|
+
- **Execute**: implement using **TDD**; each subtask produces a commit.
|
|
30
|
+
- **Verify**: run quality gates + review sign-off to ensure correctness and safety.
|
|
31
|
+
- **Close**: handoff notes, finalize progress, and archive when done.
|
|
32
|
+
|
|
33
|
+
It’s designed for collaboration (Dev / Tech Lead / QA / PM) and keeps work auditable via lightweight task docs.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Release notes
|
|
38
|
+
|
|
39
|
+
- v1.2.0 notes: [`CHANGELOG.md#v120--2026-04-09`](CHANGELOG.md#v120--2026-04-09)
|
|
40
|
+
- Full changelog: `CHANGELOG.md`
|
|
41
|
+
- Latest release notes: [GitHub Releases](https://github.com/dv-workflow/dv-workflow/releases)
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install -g dw-kit
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
Setup dw in project directory:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dw init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Then in **Claude Code CLI**, run the full workflow:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
/dw-flow your-task-or-anythings
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
Discover other skills:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
/dw-prompt
|
|
73
|
+
/dw-thinking
|
|
74
|
+
...
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## CLI commands
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
dw init # setup wizard / presets
|
|
84
|
+
dw validate # validate .dw/config/dw.config.yml
|
|
85
|
+
dw doctor # installation health check
|
|
86
|
+
dw upgrade # update toolkit files (override-aware)
|
|
87
|
+
dw upgrade --check # check for updates only
|
|
88
|
+
dw upgrade --dry-run # preview changes
|
|
89
|
+
dw prompt # build a well-structured task prompt (autocomplete + wizard)
|
|
90
|
+
dw prompt --text "..." # non-interactive: structure a description directly
|
|
91
|
+
dw claude-vn-fix # patch Claude CLI to fix Vietnamese IME (backup/restore)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`dw claude-vn-fix` patches the local Claude CLI bundle to fix Vietnamese IME input (DEL char `\x7f` issue). Includes auto-backup and rollback.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Depth system
|
|
99
|
+
|
|
100
|
+
Pick a default depth for your project, then override per task when risk increases.
|
|
101
|
+
|
|
102
|
+
| Depth | Best for | Workflow |
|
|
103
|
+
|-------|----------|----------|
|
|
104
|
+
| `quick` | Solo dev, hotfix, familiar code | Understand → Execute → Close |
|
|
105
|
+
| `standard` | Small teams, new features | Full 6 phases |
|
|
106
|
+
| `thorough` | Risky changes (API/DB/security) | Full workflow + arch-review + test-plan |
|
|
107
|
+
|
|
108
|
+
Configured in `.dw/config/dw.config.yml`:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
workflow:
|
|
112
|
+
default_depth: "standard"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## What gets added to your repo?
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
.dw/ # methodology, config, adapters, task docs
|
|
121
|
+
.claude/ # Claude Code: skills, hooks, agents, rules
|
|
122
|
+
CLAUDE.md # project context for the agent
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
Maintainer: [huygdv](mailto:huygdv19@gmail.com)
|
package/package.json
CHANGED
|
@@ -1,57 +1,84 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dw-kit",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "AI development workflow toolkit — structured, quality-assured, team-ready. From requirements to dashboard.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"dw": "bin/dw.mjs"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"bin/",
|
|
11
|
-
"src/",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
".dw/
|
|
15
|
-
"
|
|
16
|
-
".
|
|
17
|
-
".claude/
|
|
18
|
-
".claude/
|
|
19
|
-
".claude/
|
|
20
|
-
".claude/
|
|
21
|
-
".claude/
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"claude",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "dw-kit",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "AI development workflow toolkit — structured, quality-assured, team-ready. From requirements to dashboard.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dw": "bin/dw.mjs"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"src/cli.mjs",
|
|
12
|
+
"src/commands/",
|
|
13
|
+
"src/lib/",
|
|
14
|
+
".dw/core/",
|
|
15
|
+
".dw/config/",
|
|
16
|
+
".dw/adapters/",
|
|
17
|
+
".claude/agents/",
|
|
18
|
+
".claude/hooks/",
|
|
19
|
+
".claude/rules/",
|
|
20
|
+
".claude/skills/dw-arch-review/",
|
|
21
|
+
".claude/skills/dw-archive/",
|
|
22
|
+
".claude/skills/dw-commit/",
|
|
23
|
+
".claude/skills/dw-config-init/",
|
|
24
|
+
".claude/skills/dw-config-validate/",
|
|
25
|
+
".claude/skills/dw-dashboard/",
|
|
26
|
+
".claude/skills/dw-debug/",
|
|
27
|
+
".claude/skills/dw-docs-update/",
|
|
28
|
+
".claude/skills/dw-estimate/",
|
|
29
|
+
".claude/skills/dw-execute/",
|
|
30
|
+
".claude/skills/dw-flow/",
|
|
31
|
+
".claude/skills/dw-handoff/",
|
|
32
|
+
".claude/skills/dw-kit-report/",
|
|
33
|
+
".claude/skills/dw-log-work/",
|
|
34
|
+
".claude/skills/dw-onboard/",
|
|
35
|
+
".claude/skills/dw-plan/",
|
|
36
|
+
".claude/skills/dw-prompt/",
|
|
37
|
+
".claude/skills/dw-requirements/",
|
|
38
|
+
".claude/skills/dw-research/",
|
|
39
|
+
".claude/skills/dw-retroactive/",
|
|
40
|
+
".claude/skills/dw-review/",
|
|
41
|
+
".claude/skills/dw-rollback/",
|
|
42
|
+
".claude/skills/dw-sprint-review/",
|
|
43
|
+
".claude/skills/dw-task-init/",
|
|
44
|
+
".claude/skills/dw-test-plan/",
|
|
45
|
+
".claude/skills/dw-thinking/",
|
|
46
|
+
".claude/skills/dw-upgrade/",
|
|
47
|
+
".claude/templates/",
|
|
48
|
+
".claude/settings.json",
|
|
49
|
+
"CLAUDE.md"
|
|
50
|
+
],
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=18"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"test": "node src/smoke-test.mjs",
|
|
56
|
+
"link": "npm link",
|
|
57
|
+
"test:e2e-local": "bash scripts/e2e-local-check.sh"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"ai",
|
|
61
|
+
"workflow",
|
|
62
|
+
"claude",
|
|
63
|
+
"cursor",
|
|
64
|
+
"development",
|
|
65
|
+
"toolkit",
|
|
66
|
+
"tdd",
|
|
67
|
+
"code-review",
|
|
68
|
+
"agent"
|
|
69
|
+
],
|
|
70
|
+
"author": "huygdv <huygdv19@gmail.com>",
|
|
71
|
+
"license": "MIT",
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "git+https://github.com/dv-workflow/dv-workflow.git"
|
|
75
|
+
},
|
|
76
|
+
"homepage": "https://github.com/dv-workflow/dv-workflow#readme",
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"ajv": "^8.18.0",
|
|
79
|
+
"chalk": "^5.6.2",
|
|
80
|
+
"commander": "^14.0.3",
|
|
81
|
+
"enquirer": "^2.4.1",
|
|
82
|
+
"js-yaml": "^4.1.1"
|
|
83
|
+
}
|
|
84
|
+
}
|
package/src/cli.mjs
CHANGED
|
@@ -1,92 +1,100 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { dirname, join } from 'node:path';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import { getUpdateNotice, scheduleUpdateCheck } from './lib/update-checker.mjs';
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = dirname(__filename);
|
|
10
|
-
const require = createRequire(import.meta.url);
|
|
11
|
-
const pkg = require(join(__dirname, '..', 'package.json'));
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
.
|
|
79
|
-
.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { getUpdateNotice, scheduleUpdateCheck } from './lib/update-checker.mjs';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = dirname(__filename);
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
const pkg = require(join(__dirname, '..', 'package.json'));
|
|
12
|
+
const RELEASES_URL = 'https://github.com/dv-workflow/dv-workflow/releases';
|
|
13
|
+
|
|
14
|
+
export function run(argv) {
|
|
15
|
+
// Schedule fresh check in background (non-blocking).
|
|
16
|
+
// Notice is shown via process.on('exit') so it always appears AFTER command output,
|
|
17
|
+
// even when commands call process.exit() internally.
|
|
18
|
+
scheduleUpdateCheck(pkg.version);
|
|
19
|
+
const latestVersion = getUpdateNotice(pkg.version);
|
|
20
|
+
|
|
21
|
+
const program = new Command();
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.name('dw')
|
|
25
|
+
.description('dw-kit — AI development workflow toolkit')
|
|
26
|
+
.version(pkg.version, '-v, --version');
|
|
27
|
+
|
|
28
|
+
program
|
|
29
|
+
.command('init')
|
|
30
|
+
.description('Setup dw-kit in current project (interactive wizard)')
|
|
31
|
+
.option('-p, --preset <name>', 'Use preset: solo-quick | small-team | enterprise')
|
|
32
|
+
.option('-a, --adapter <platform>', 'Target platform: claude-cli | cursor | generic', 'claude-cli')
|
|
33
|
+
.option('-s, --silent', 'Non-interactive mode (reads DW_NAME, DW_DEPTH, DW_ROLES, DW_LANG env vars)')
|
|
34
|
+
.action(async (opts) => {
|
|
35
|
+
const { initCommand } = await import('./commands/init.mjs');
|
|
36
|
+
await initCommand(opts);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
program
|
|
40
|
+
.command('upgrade')
|
|
41
|
+
.description('Update dw-kit files in current project')
|
|
42
|
+
.option('-n, --dry-run', 'Preview changes without applying')
|
|
43
|
+
.option('-c, --check', 'Only check if update is available')
|
|
44
|
+
.option('-l, --layer <name>', 'Update specific layer: core | platform | capability | all', 'all')
|
|
45
|
+
.action(async (opts) => {
|
|
46
|
+
const { upgradeCommand } = await import('./commands/upgrade.mjs');
|
|
47
|
+
await upgradeCommand(opts);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
program
|
|
51
|
+
.command('validate')
|
|
52
|
+
.description('Validate .dw/config/dw.config.yml against schema')
|
|
53
|
+
.option('-f, --file <path>', 'Config file path', '.dw/config/dw.config.yml')
|
|
54
|
+
.action(async (opts) => {
|
|
55
|
+
const { validateCommand } = await import('./commands/validate.mjs');
|
|
56
|
+
await validateCommand(opts);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
program
|
|
60
|
+
.command('doctor')
|
|
61
|
+
.description('Check dw-kit installation health')
|
|
62
|
+
.action(async () => {
|
|
63
|
+
const { doctorCommand } = await import('./commands/doctor.mjs');
|
|
64
|
+
await doctorCommand();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
program
|
|
68
|
+
.command('prompt')
|
|
69
|
+
.description('Build a well-structured task prompt with autocomplete + guided wizard')
|
|
70
|
+
.option('-t, --text <text>', 'Non-interactive: provide description directly')
|
|
71
|
+
.action(async (opts) => {
|
|
72
|
+
const { promptCommand } = await import('./commands/prompt.mjs');
|
|
73
|
+
await promptCommand(opts);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.command('claude-vn-fix')
|
|
78
|
+
.description('Patch Claude CLI to fix Vietnamese IME (local, with backup/restore)')
|
|
79
|
+
.option('--path <file>', 'Path to @anthropic-ai/claude-code/cli.js (optional; auto-detect if omitted)')
|
|
80
|
+
.option('--restore', 'Restore from latest backup')
|
|
81
|
+
.option('--dry-run', 'Show what would change without writing')
|
|
82
|
+
.action(async (opts) => {
|
|
83
|
+
const { claudeVnFixCommand } = await import('./commands/claude-vn-fix.mjs');
|
|
84
|
+
await claudeVnFixCommand(opts);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (latestVersion) {
|
|
88
|
+
// Register notice to print AFTER the command completes (on clean exit only)
|
|
89
|
+
process.on('exit', (code) => {
|
|
90
|
+
if (code !== 0) return;
|
|
91
|
+
console.log();
|
|
92
|
+
console.log(chalk.yellow(` ↑ Update available`) + ` v${pkg.version} → ` + chalk.green.bold(`v${latestVersion}`));
|
|
93
|
+
console.log(` Run ` + chalk.cyan(`npm install -g dw-kit`) + ` to update`);
|
|
94
|
+
console.log(` Changelog: ` + chalk.cyan(`${RELEASES_URL}/tag/v${latestVersion}`));
|
|
95
|
+
console.log();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
program.parse(argv);
|
|
100
|
+
}
|