dw-kit 1.2.1 → 1.3.4
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 +64 -58
- package/.claude/hooks/pre-commit-gate.sh +96 -90
- package/.claude/hooks/privacy-block.sh +99 -94
- package/.claude/hooks/progress-ping.sh +53 -47
- package/.claude/hooks/safety-guard.sh +60 -54
- package/.claude/hooks/scout-block.sh +88 -82
- package/.claude/hooks/session-init.sh +6 -0
- package/.claude/hooks/stop-check.sh +88 -36
- package/.claude/hooks/telemetry-log.sh +34 -0
- package/.claude/rules/dw.md +138 -0
- package/.claude/settings.json +28 -1
- package/.claude/skills/dw-arch-review/SKILL.md +119 -119
- package/.claude/skills/dw-archive/SKILL.md +81 -81
- package/.claude/skills/dw-commit/SKILL.md +81 -81
- package/.claude/skills/dw-config-init/SKILL.md +91 -91
- package/.claude/skills/dw-config-validate/SKILL.md +75 -75
- package/.claude/skills/dw-dashboard/SKILL.md +209 -209
- package/.claude/skills/dw-debug/SKILL.md +97 -97
- package/.claude/skills/dw-decision/SKILL.md +116 -0
- package/.claude/skills/dw-docs-update/SKILL.md +125 -125
- package/.claude/skills/dw-estimate/SKILL.md +90 -90
- package/.claude/skills/dw-execute/SKILL.md +121 -98
- package/.claude/skills/dw-flow/SKILL.md +274 -274
- package/.claude/skills/dw-handoff/SKILL.md +92 -81
- package/.claude/skills/dw-kit-report/SKILL.md +152 -152
- package/.claude/skills/dw-log-work/SKILL.md +69 -69
- package/.claude/skills/dw-onboard/SKILL.md +201 -201
- package/.claude/skills/dw-plan/SKILL.md +222 -125
- package/.claude/skills/dw-prompt/SKILL.md +62 -62
- package/.claude/skills/dw-requirements/SKILL.md +98 -98
- package/.claude/skills/dw-research/SKILL.md +128 -114
- package/.claude/skills/dw-retroactive/SKILL.md +195 -311
- package/.claude/skills/dw-review/SKILL.md +66 -66
- package/.claude/skills/dw-rollback/SKILL.md +90 -90
- package/.claude/skills/dw-sprint-review/SKILL.md +99 -99
- package/.claude/skills/dw-task-init/SKILL.md +71 -59
- package/.claude/skills/dw-test-plan/SKILL.md +113 -113
- package/.claude/skills/dw-thinking/SKILL.md +70 -70
- package/.claude/skills/dw-upgrade/SKILL.md +72 -72
- package/.dw/core/PILLARS.md +122 -0
- package/.dw/core/ROLES.md +257 -257
- package/.dw/core/templates/v2/spec.md +68 -0
- package/.dw/core/templates/v2/tracking.md +62 -0
- package/.dw/core/v14-evaluation-protocol.md +118 -0
- package/CLAUDE.md +42 -39
- package/MIGRATION-v1.3.md +202 -0
- package/README.md +35 -6
- package/package.json +4 -2
- package/src/cli.mjs +29 -1
- package/src/commands/dashboard.mjs +116 -0
- package/src/commands/doctor.mjs +165 -149
- package/src/commands/init.mjs +339 -332
- package/src/commands/metrics.mjs +185 -0
- package/src/lib/active-index.mjs +87 -0
- package/src/lib/cut-analysis.mjs +240 -0
- package/src/lib/telemetry.mjs +80 -0
- package/.claude/rules/dw-core.md +0 -100
- package/.claude/rules/dw-skills.md +0 -53
- package/.claude/rules/workflow-rules.md +0 -77
package/src/commands/doctor.mjs
CHANGED
|
@@ -1,149 +1,165 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join, resolve } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { header, ok, warn, err, info, log } from '../lib/ui.mjs';
|
|
5
|
-
import { loadConfig, getToolkitVersions } from '../lib/config.mjs';
|
|
6
|
-
import { detectPlatform, platformLabel } from '../lib/platform.mjs';
|
|
7
|
-
|
|
8
|
-
const TOOLKIT_ROOT = resolve(fileURLToPath(import.meta.url), '..', '..', '..');
|
|
9
|
-
|
|
10
|
-
const CORE_FILES = [
|
|
11
|
-
'.dw/core/WORKFLOW.md',
|
|
12
|
-
'.dw/core/THINKING.md',
|
|
13
|
-
'.dw/core/QUALITY.md',
|
|
14
|
-
'.dw/core/ROLES.md',
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
'.dw/
|
|
19
|
-
'.dw/
|
|
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
|
-
log(`
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { header, ok, warn, err, info, log } from '../lib/ui.mjs';
|
|
5
|
+
import { loadConfig, getToolkitVersions } from '../lib/config.mjs';
|
|
6
|
+
import { detectPlatform, platformLabel } from '../lib/platform.mjs';
|
|
7
|
+
|
|
8
|
+
const TOOLKIT_ROOT = resolve(fileURLToPath(import.meta.url), '..', '..', '..');
|
|
9
|
+
|
|
10
|
+
const CORE_FILES = [
|
|
11
|
+
'.dw/core/WORKFLOW.md',
|
|
12
|
+
'.dw/core/THINKING.md',
|
|
13
|
+
'.dw/core/QUALITY.md',
|
|
14
|
+
'.dw/core/ROLES.md',
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
const V2_OPTIONAL = [
|
|
18
|
+
'.dw/core/PILLARS.md',
|
|
19
|
+
'.dw/decisions',
|
|
20
|
+
'.dw/tasks/ACTIVE.md',
|
|
21
|
+
'.dw/metrics',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const CONFIG_FILES = [
|
|
25
|
+
'.dw/config/dw.config.yml',
|
|
26
|
+
'.dw/config/config.schema.json',
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const CLAUDE_ESSENTIAL = [
|
|
30
|
+
'.claude/settings.json',
|
|
31
|
+
'.claude/hooks/pre-commit-gate.sh',
|
|
32
|
+
'.claude/hooks/safety-guard.sh',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export async function doctorCommand() {
|
|
36
|
+
const projectDir = process.cwd();
|
|
37
|
+
|
|
38
|
+
header('dw-kit Doctor');
|
|
39
|
+
let issues = 0;
|
|
40
|
+
let warnings = 0;
|
|
41
|
+
|
|
42
|
+
info('Environment');
|
|
43
|
+
log(`Node.js : ${process.version}`);
|
|
44
|
+
log(`Platform : ${process.platform} ${process.arch}`);
|
|
45
|
+
log(`Working dir : ${projectDir}`);
|
|
46
|
+
|
|
47
|
+
const pkg = JSON.parse(readFileSync(join(TOOLKIT_ROOT, 'package.json'), 'utf-8'));
|
|
48
|
+
log(`dw-kit CLI : v${pkg.version}`);
|
|
49
|
+
|
|
50
|
+
const platform = detectPlatform(projectDir);
|
|
51
|
+
log(`AI Platform : ${platformLabel(platform)}`);
|
|
52
|
+
|
|
53
|
+
info('Core Files (Layer 0)');
|
|
54
|
+
for (const file of CORE_FILES) {
|
|
55
|
+
const fullPath = join(projectDir, file);
|
|
56
|
+
if (existsSync(fullPath)) {
|
|
57
|
+
ok(file);
|
|
58
|
+
} else {
|
|
59
|
+
err(`${file} — MISSING`);
|
|
60
|
+
issues++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
info('Config (Layer 2)');
|
|
65
|
+
for (const file of CONFIG_FILES) {
|
|
66
|
+
const fullPath = join(projectDir, file);
|
|
67
|
+
if (existsSync(fullPath)) {
|
|
68
|
+
ok(file);
|
|
69
|
+
} else {
|
|
70
|
+
err(`${file} — MISSING`);
|
|
71
|
+
issues++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const configPath = join(projectDir, '.dw', 'config', 'dw.config.yml');
|
|
76
|
+
if (existsSync(configPath)) {
|
|
77
|
+
const config = loadConfig(configPath);
|
|
78
|
+
if (config) {
|
|
79
|
+
const versions = getToolkitVersions(config);
|
|
80
|
+
log(` Core version : ${versions.core}`);
|
|
81
|
+
log(` Platform version : ${versions.platform}`);
|
|
82
|
+
|
|
83
|
+
const toolkitConfig = loadConfig(join(TOOLKIT_ROOT, '.dw', 'config', 'dw.config.yml'));
|
|
84
|
+
if (toolkitConfig) {
|
|
85
|
+
const toolkitVersions = getToolkitVersions(toolkitConfig);
|
|
86
|
+
if (versions.core !== toolkitVersions.core) {
|
|
87
|
+
warn(`Update available: ${versions.core} → ${toolkitVersions.core} (run \`dw upgrade\`)`);
|
|
88
|
+
warnings++;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
err('.dw/config/dw.config.yml — YAML parse error');
|
|
93
|
+
issues++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
info('Claude Files (Layer 1)');
|
|
98
|
+
if (platform === 'claude-cli' || existsSync(join(projectDir, '.claude'))) {
|
|
99
|
+
for (const file of CLAUDE_ESSENTIAL) {
|
|
100
|
+
const fullPath = join(projectDir, file);
|
|
101
|
+
if (existsSync(fullPath)) {
|
|
102
|
+
ok(file);
|
|
103
|
+
} else {
|
|
104
|
+
warn(`${file} — missing (optional for non-Claude platforms)`);
|
|
105
|
+
warnings++;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (existsSync(join(projectDir, 'CLAUDE.md'))) {
|
|
110
|
+
ok('CLAUDE.md');
|
|
111
|
+
} else {
|
|
112
|
+
warn('CLAUDE.md — missing');
|
|
113
|
+
warnings++;
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
log('Skipped — not a Claude CLI project');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
info('Adapter Structure (Layer 3)');
|
|
120
|
+
const adapterDirs = [
|
|
121
|
+
'.dw/adapters/claude-cli/generated',
|
|
122
|
+
'.dw/adapters/claude-cli/overrides',
|
|
123
|
+
'.dw/adapters/claude-cli/extensions',
|
|
124
|
+
];
|
|
125
|
+
for (const dir of adapterDirs) {
|
|
126
|
+
if (existsSync(join(projectDir, dir))) {
|
|
127
|
+
ok(dir);
|
|
128
|
+
} else {
|
|
129
|
+
warn(`${dir} — missing`);
|
|
130
|
+
warnings++;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
info('Runtime Directories');
|
|
135
|
+
for (const dir of ['.dw/tasks', '.dw/docs']) {
|
|
136
|
+
if (existsSync(join(projectDir, dir))) {
|
|
137
|
+
ok(dir);
|
|
138
|
+
} else {
|
|
139
|
+
warn(`${dir} — missing (will be created on first use)`);
|
|
140
|
+
warnings++;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
info('v2 Artifacts (optional)');
|
|
145
|
+
for (const path of V2_OPTIONAL) {
|
|
146
|
+
if (existsSync(join(projectDir, path))) {
|
|
147
|
+
ok(path);
|
|
148
|
+
} else {
|
|
149
|
+
log(` ${path} — not yet created (opt-in)`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
console.log();
|
|
154
|
+
header('Diagnosis');
|
|
155
|
+
if (issues === 0 && warnings === 0) {
|
|
156
|
+
ok('Everything looks good!');
|
|
157
|
+
} else if (issues === 0) {
|
|
158
|
+
warn(`${warnings} warning(s), 0 errors — mostly fine`);
|
|
159
|
+
} else {
|
|
160
|
+
err(`${issues} error(s), ${warnings} warning(s) — run \`dw init\` to fix`);
|
|
161
|
+
}
|
|
162
|
+
console.log();
|
|
163
|
+
|
|
164
|
+
process.exit(issues > 0 ? 1 : 0);
|
|
165
|
+
}
|