@zhuan-ai/zhuanspec 2.10.0 → 2.11.2
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/dist/cli/index.js +1 -0
- package/dist/commands/design.d.ts +12 -2
- package/dist/commands/design.js +64 -12
- package/dist/commands/progress.js +11 -0
- package/dist/commands/review.d.ts +1 -0
- package/dist/commands/review.js +13 -0
- package/dist/core/completions/command-registry.js +4 -0
- package/dist/core/hooks/deviation-check.js +42 -0
- package/dist/core/hooks/init.js +21 -4
- package/dist/core/hooks/post-apply.js +2 -0
- package/dist/core/hooks/pre-review.d.ts +27 -0
- package/dist/core/hooks/pre-review.js +169 -0
- package/dist/core/hooks/record-progress.d.ts +25 -0
- package/dist/core/hooks/record-progress.js +88 -1
- package/dist/core/hooks/review-hooks.js +171 -3
- package/dist/core/hooks/review-orchestrator.js +55 -8
- package/dist/core/hooks/tdd-phase-hook.d.ts +59 -0
- package/dist/core/hooks/tdd-phase-hook.js +313 -0
- package/dist/core/init.d.ts +1 -0
- package/dist/core/init.js +27 -0
- package/dist/core/templates/agents-template.d.ts +1 -1
- package/dist/core/templates/agents-template.js +139 -23
- package/dist/core/templates/skill-templates.js +21 -1
- package/dist/core/templates/slash-command-templates.js +129 -49
- package/dist/core/templates/tasks-template.js +89 -0
- package/dist/core/validation/strict-rules.d.ts +47 -0
- package/dist/core/validation/strict-rules.js +589 -42
- package/dist/utils/git-repo-detector.js +1 -1
- package/dist/utils/phase-utils.js +14 -1
- package/package.json +22 -20
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
2
|
import { readdirSync, existsSync, realpathSync } from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
-
import { select, input } from '@inquirer/prompts';
|
|
5
4
|
/**
|
|
6
5
|
* Git repository detector utilities for finding git repos in a directory hierarchy
|
|
7
6
|
*/
|
|
@@ -246,6 +245,7 @@ export class GitRepoDetector {
|
|
|
246
245
|
* }
|
|
247
246
|
*/
|
|
248
247
|
export async function promptForGitRepoOrSkip() {
|
|
248
|
+
const { select, input } = await import('@inquirer/prompts');
|
|
249
249
|
const action = await select({
|
|
250
250
|
message: 'No git repository detected. What would you like to do?',
|
|
251
251
|
choices: [
|
|
@@ -83,6 +83,7 @@ export async function setPhase(changeDir, phase) {
|
|
|
83
83
|
taskCount: 0,
|
|
84
84
|
completedTaskCount: 0,
|
|
85
85
|
}],
|
|
86
|
+
proposalChanges: [],
|
|
86
87
|
stats: { tokenUsageTotal: 0, contextLoad: 0, durationMs: { propose: 0, apply: 0, review: 0, archive: 0 } },
|
|
87
88
|
};
|
|
88
89
|
}
|
|
@@ -117,6 +118,7 @@ export async function setPhase(changeDir, phase) {
|
|
|
117
118
|
taskCount: 0,
|
|
118
119
|
completedTaskCount: 0,
|
|
119
120
|
}],
|
|
121
|
+
proposalChanges: [],
|
|
120
122
|
stats: { tokenUsageTotal: 0, contextLoad: 0, durationMs: { propose: 0, apply: 0, review: 0, archive: 0 } },
|
|
121
123
|
};
|
|
122
124
|
}
|
|
@@ -208,7 +210,12 @@ export async function getCurrentPhase(changeDir) {
|
|
|
208
210
|
if (await FileSystemUtils.fileExists(proposalPath)) {
|
|
209
211
|
return 'propose';
|
|
210
212
|
}
|
|
211
|
-
// 4. Check for
|
|
213
|
+
// 4. Check for techDesign/ directory
|
|
214
|
+
const techDesignDir = path.join(changeDir, 'techDesign');
|
|
215
|
+
if (await FileSystemUtils.directoryExists(techDesignDir)) {
|
|
216
|
+
return 'techDesign';
|
|
217
|
+
}
|
|
218
|
+
// 4b. Check for design.md without .tech-design (could be techDesign or propose)
|
|
212
219
|
const designPath = path.join(changeDir, 'design.md');
|
|
213
220
|
if (await FileSystemUtils.fileExists(designPath)) {
|
|
214
221
|
// If design.md exists but no proposal.md, likely techDesign
|
|
@@ -221,6 +228,12 @@ export async function getCurrentPhase(changeDir) {
|
|
|
221
228
|
* Check if a directory is a techDesign change (can be reused by proposal)
|
|
222
229
|
*/
|
|
223
230
|
export async function isTechDesignChange(changeDir) {
|
|
231
|
+
// Check new techDesign/ directory structure first
|
|
232
|
+
const techDesignDir = path.join(changeDir, 'techDesign');
|
|
233
|
+
if (await FileSystemUtils.directoryExists(techDesignDir)) {
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
// Backward compat: check old .tech-design marker file
|
|
224
237
|
const techDesignMarker = path.join(changeDir, '.tech-design');
|
|
225
238
|
if (await FileSystemUtils.fileExists(techDesignMarker)) {
|
|
226
239
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhuan-ai/zhuanspec",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.2",
|
|
4
4
|
"description": "AI-native system for spec-driven development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zhuanspec",
|
|
@@ -39,6 +39,26 @@
|
|
|
39
39
|
"!dist/**/__tests__",
|
|
40
40
|
"!dist/**/*.map"
|
|
41
41
|
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"lint": "eslint src/",
|
|
44
|
+
"build": "node build.js",
|
|
45
|
+
"dev": "tsc --watch",
|
|
46
|
+
"dev:cli": "pnpm build && node bin/zhuanspec.js",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"test:ui": "vitest --ui",
|
|
50
|
+
"test:coverage": "vitest --coverage",
|
|
51
|
+
"test:postinstall": "node scripts/postinstall.js",
|
|
52
|
+
"prepare": "npm run build",
|
|
53
|
+
"prepublishOnly": "npm run build",
|
|
54
|
+
"postinstall": "node scripts/postinstall.js",
|
|
55
|
+
"check:pack-version": "node scripts/pack-version-check.mjs",
|
|
56
|
+
"diagnose:cursor": "node scripts/diagnose-cursor-commands.js",
|
|
57
|
+
"release": "pnpm run release:ci",
|
|
58
|
+
"release:ci": "pnpm run check:pack-version && pnpm exec changeset publish",
|
|
59
|
+
"release:local": "pnpm exec changeset version && pnpm run check:pack-version && pnpm exec changeset publish",
|
|
60
|
+
"changeset": "changeset"
|
|
61
|
+
},
|
|
42
62
|
"engines": {
|
|
43
63
|
"node": ">=20.19.0"
|
|
44
64
|
},
|
|
@@ -60,23 +80,5 @@
|
|
|
60
80
|
"ora": "^8.2.0",
|
|
61
81
|
"yaml": "^2.8.2",
|
|
62
82
|
"zod": "^4.0.17"
|
|
63
|
-
},
|
|
64
|
-
"scripts": {
|
|
65
|
-
"lint": "eslint src/",
|
|
66
|
-
"build": "node build.js",
|
|
67
|
-
"dev": "tsc --watch",
|
|
68
|
-
"dev:cli": "pnpm build && node bin/zhuanspec.js",
|
|
69
|
-
"test": "vitest run",
|
|
70
|
-
"test:watch": "vitest",
|
|
71
|
-
"test:ui": "vitest --ui",
|
|
72
|
-
"test:coverage": "vitest --coverage",
|
|
73
|
-
"test:postinstall": "node scripts/postinstall.js",
|
|
74
|
-
"postinstall": "node scripts/postinstall.js",
|
|
75
|
-
"check:pack-version": "node scripts/pack-version-check.mjs",
|
|
76
|
-
"diagnose:cursor": "node scripts/diagnose-cursor-commands.js",
|
|
77
|
-
"release": "pnpm run release:ci",
|
|
78
|
-
"release:ci": "pnpm run check:pack-version && pnpm exec changeset publish",
|
|
79
|
-
"release:local": "pnpm exec changeset version && pnpm run check:pack-version && pnpm exec changeset publish",
|
|
80
|
-
"changeset": "changeset"
|
|
81
83
|
}
|
|
82
|
-
}
|
|
84
|
+
}
|