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