@zhuan-ai/zhuanspec 2.2.4 → 2.4.8

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 (103) hide show
  1. package/bin/zhuanspec-hook.js +3 -0
  2. package/dist/cli/hooks.d.ts +14 -0
  3. package/dist/cli/hooks.js +465 -0
  4. package/dist/cli/index.js +100 -0
  5. package/dist/commands/artifact-workflow.js +15 -34
  6. package/dist/commands/design.d.ts +42 -0
  7. package/dist/commands/design.js +337 -0
  8. package/dist/commands/progress.d.ts +32 -0
  9. package/dist/commands/progress.js +278 -0
  10. package/dist/commands/review.d.ts +32 -0
  11. package/dist/commands/review.js +472 -0
  12. package/dist/commands/validate.d.ts +14 -0
  13. package/dist/commands/validate.js +161 -10
  14. package/dist/core/archive.d.ts +1 -0
  15. package/dist/core/archive.js +45 -3
  16. package/dist/core/completions/command-registry.js +67 -0
  17. package/dist/core/configurators/slash/amazon-q.js +32 -2
  18. package/dist/core/configurators/slash/antigravity.js +8 -2
  19. package/dist/core/configurators/slash/auggie.js +16 -1
  20. package/dist/core/configurators/slash/base.js +1 -1
  21. package/dist/core/configurators/slash/claude.d.ts +4 -0
  22. package/dist/core/configurators/slash/claude.js +56 -1
  23. package/dist/core/configurators/slash/cline.js +8 -2
  24. package/dist/core/configurators/slash/codebuddy.js +22 -1
  25. package/dist/core/configurators/slash/codex.js +21 -0
  26. package/dist/core/configurators/slash/costrict.js +15 -0
  27. package/dist/core/configurators/slash/crush.js +22 -1
  28. package/dist/core/configurators/slash/cursor.js +22 -1
  29. package/dist/core/configurators/slash/factory.js +16 -1
  30. package/dist/core/configurators/slash/gemini.js +8 -2
  31. package/dist/core/configurators/slash/github-copilot.js +19 -1
  32. package/dist/core/configurators/slash/iflow.js +22 -1
  33. package/dist/core/configurators/slash/kilocode.js +4 -1
  34. package/dist/core/configurators/slash/opencode.js +27 -0
  35. package/dist/core/configurators/slash/qoder.d.ts +4 -0
  36. package/dist/core/configurators/slash/qoder.js +59 -1
  37. package/dist/core/configurators/slash/qwen.js +8 -2
  38. package/dist/core/configurators/slash/roocode.js +8 -2
  39. package/dist/core/configurators/slash/windsurf.js +8 -2
  40. package/dist/core/dashboard/metrics.d.ts +33 -0
  41. package/dist/core/dashboard/metrics.js +114 -0
  42. package/dist/core/hooks/collect-knowledge.d.ts +16 -0
  43. package/dist/core/hooks/collect-knowledge.js +203 -0
  44. package/dist/core/hooks/context-load-hook.d.ts +25 -0
  45. package/dist/core/hooks/context-load-hook.js +159 -0
  46. package/dist/core/hooks/deviation-check.d.ts +27 -0
  47. package/dist/core/hooks/deviation-check.js +403 -0
  48. package/dist/core/hooks/deviation-handler.d.ts +43 -0
  49. package/dist/core/hooks/deviation-handler.js +98 -0
  50. package/dist/core/hooks/init.d.ts +14 -0
  51. package/dist/core/hooks/init.js +244 -0
  52. package/dist/core/hooks/notify-milestone.d.ts +14 -0
  53. package/dist/core/hooks/notify-milestone.js +170 -0
  54. package/dist/core/hooks/post-apply.d.ts +29 -0
  55. package/dist/core/hooks/post-apply.js +173 -0
  56. package/dist/core/hooks/post-archive.d.ts +7 -0
  57. package/dist/core/hooks/post-archive.js +208 -0
  58. package/dist/core/hooks/pre-apply.d.ts +34 -0
  59. package/dist/core/hooks/pre-apply.js +139 -0
  60. package/dist/core/hooks/pre-archive.d.ts +7 -0
  61. package/dist/core/hooks/pre-archive.js +50 -0
  62. package/dist/core/hooks/record-progress.d.ts +49 -0
  63. package/dist/core/hooks/record-progress.js +494 -0
  64. package/dist/core/hooks/review-hooks.d.ts +89 -0
  65. package/dist/core/hooks/review-hooks.js +345 -0
  66. package/dist/core/hooks/review-orchestrator.d.ts +40 -0
  67. package/dist/core/hooks/review-orchestrator.js +146 -0
  68. package/dist/core/hooks/summarize.d.ts +15 -0
  69. package/dist/core/hooks/summarize.js +282 -0
  70. package/dist/core/hooks/user-input-hook.d.ts +25 -0
  71. package/dist/core/hooks/user-input-hook.js +179 -0
  72. package/dist/core/init.d.ts +8 -0
  73. package/dist/core/init.js +251 -23
  74. package/dist/core/parsers/requirement-blocks.js +13 -10
  75. package/dist/core/templates/agents-template.d.ts +1 -1
  76. package/dist/core/templates/agents-template.js +510 -243
  77. package/dist/core/templates/index.d.ts +1 -0
  78. package/dist/core/templates/index.js +1 -0
  79. package/dist/core/templates/skill-templates.js +46 -152
  80. package/dist/core/templates/slash-command-templates.d.ts +1 -1
  81. package/dist/core/templates/slash-command-templates.js +352 -20
  82. package/dist/core/templates/tasks-template.d.ts +7 -0
  83. package/dist/core/templates/tasks-template.js +130 -24
  84. package/dist/core/templates/tdd-tasks-template.d.ts +3 -0
  85. package/dist/core/templates/tdd-tasks-template.js +91 -38
  86. package/dist/core/templates/test-cases-template.d.ts +41 -0
  87. package/dist/core/templates/test-cases-template.js +128 -0
  88. package/dist/core/validation/strict-rules.d.ts +44 -5
  89. package/dist/core/validation/strict-rules.js +302 -8
  90. package/dist/core/validation/validator.js +52 -2
  91. package/dist/core/view.d.ts +1 -0
  92. package/dist/core/view.js +60 -2
  93. package/dist/mcp/index.d.ts +28 -0
  94. package/dist/mcp/index.js +31 -0
  95. package/dist/utils/file-system.d.ts +1 -0
  96. package/dist/utils/file-system.js +11 -0
  97. package/dist/utils/item-discovery.js +24 -2
  98. package/dist/utils/phase-utils.d.ts +36 -0
  99. package/dist/utils/phase-utils.js +117 -0
  100. package/package.json +22 -23
  101. package/schemas/spec-driven/schema.yaml +45 -31
  102. package/schemas/spec-driven/templates/spec.md +142 -5
  103. package/schemas/spec-driven/templates/tasks.md +73 -9
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.clinerules/workflows/zhuanspec-proposal.md',
4
+ design: '.clinerules/workflows/zhuanspec-design.md',
4
5
  apply: '.clinerules/workflows/zhuanspec-apply.md',
5
- archive: '.clinerules/workflows/zhuanspec-archive.md'
6
+ review: '.clinerules/workflows/zhuanspec-review.md',
7
+ archive: '.clinerules/workflows/zhuanspec-archive.md',
8
+ knowledge: '.clinerules/workflows/zhuanspec-knowledge.md'
6
9
  };
7
10
  export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
8
11
  toolId = 'cline';
@@ -13,8 +16,11 @@ export class ClineSlashCommandConfigurator extends SlashCommandConfigurator {
13
16
  getFrontmatter(id) {
14
17
  const descriptions = {
15
18
  proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
19
+ design: '在 proposal 之前独立生成技术设计请求文档。',
16
20
  apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
17
- archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
21
+ review: '在归档前执行代码审查和单元测试验证。',
22
+ archive: '归档已部署的 ZhuanSpec 变更并更新规范。',
23
+ knowledge: '管理项目知识库(最佳实践、陷阱、隐式约定)。'
18
24
  };
19
25
  const description = descriptions[id];
20
26
  return `# ZhuanSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.codebuddy/commands/zhuanspec/proposal.md',
4
+ design: '.codebuddy/commands/zhuanspec/design.md',
4
5
  apply: '.codebuddy/commands/zhuanspec/apply.md',
5
- archive: '.codebuddy/commands/zhuanspec/archive.md'
6
+ review: '.codebuddy/commands/zhuanspec/review.md',
7
+ archive: '.codebuddy/commands/zhuanspec/archive.md',
8
+ knowledge: '.codebuddy/commands/zhuanspec/knowledge.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
@@ -10,18 +13,36 @@ name: ZhuanSpec: Proposal
10
13
  description: 搭建新的 ZhuanSpec 变更并严格验证。
11
14
  category: ZhuanSpec
12
15
  tags: [zhuanspec, change]
16
+ ---`,
17
+ design: `---
18
+ name: ZhuanSpec: Design
19
+ description: 在 proposal 之前独立生成技术设计请求文档。
20
+ category: ZhuanSpec
21
+ tags: [zhuanspec, design, tech-spec]
13
22
  ---`,
14
23
  apply: `---
15
24
  name: ZhuanSpec: Apply
16
25
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
17
26
  category: ZhuanSpec
18
27
  tags: [zhuanspec, apply]
28
+ ---`,
29
+ review: `---
30
+ name: ZhuanSpec: Review
31
+ description: 在归档前执行代码审查和单元测试验证。
32
+ category: ZhuanSpec
33
+ tags: [zhuanspec, review, code-review]
19
34
  ---`,
20
35
  archive: `---
21
36
  name: ZhuanSpec: Archive
22
37
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
23
38
  category: ZhuanSpec
24
39
  tags: [zhuanspec, archive]
40
+ ---`,
41
+ knowledge: `---
42
+ name: ZhuanSpec: Knowledge
43
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
44
+ category: ZhuanSpec
45
+ tags: [zhuanspec, knowledge]
25
46
  ---`
26
47
  };
27
48
  export class CodeBuddySlashCommandConfigurator extends SlashCommandConfigurator {
@@ -7,8 +7,11 @@ import { ZHUANSPEC_MARKERS } from "../../config.js";
7
7
  // Use POSIX-style paths for consistent logging across platforms.
8
8
  const FILE_PATHS = {
9
9
  proposal: ".codex/prompts/zhuanspec-proposal.md",
10
+ design: ".codex/prompts/zhuanspec-design.md",
10
11
  apply: ".codex/prompts/zhuanspec-apply.md",
12
+ review: ".codex/prompts/zhuanspec-review.md",
11
13
  archive: ".codex/prompts/zhuanspec-archive.md",
14
+ knowledge: ".codex/prompts/zhuanspec-knowledge.md",
12
15
  };
13
16
  export class CodexSlashCommandConfigurator extends SlashCommandConfigurator {
14
17
  toolId = "codex";
@@ -25,18 +28,36 @@ description: 搭建新的 ZhuanSpec 变更并严格验证。
25
28
  argument-hint: request or feature description
26
29
  ---
27
30
 
31
+ $ARGUMENTS`,
32
+ design: `---
33
+ description: 在 proposal 之前独立生成技术设计请求文档。
34
+ argument-hint: dashen-page-id or description
35
+ ---
36
+
28
37
  $ARGUMENTS`,
29
38
  apply: `---
30
39
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
31
40
  argument-hint: change-id
32
41
  ---
33
42
 
43
+ $ARGUMENTS`,
44
+ review: `---
45
+ description: 在归档前执行代码审查和单元测试验证。
46
+ argument-hint: change-id
47
+ ---
48
+
34
49
  $ARGUMENTS`,
35
50
  archive: `---
36
51
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
37
52
  argument-hint: change-id
38
53
  ---
39
54
 
55
+ $ARGUMENTS`,
56
+ knowledge: `---
57
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
58
+ argument-hint: operation (view, add, search, sync)
59
+ ---
60
+
40
61
  $ARGUMENTS`,
41
62
  };
42
63
  return frontmatter[id];
@@ -1,21 +1,36 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.cospec/zhuanspec/commands/zhuanspec-proposal.md',
4
+ design: '.cospec/zhuanspec/commands/zhuanspec-design.md',
4
5
  apply: '.cospec/zhuanspec/commands/zhuanspec-apply.md',
6
+ review: '.cospec/zhuanspec/commands/zhuanspec-review.md',
5
7
  archive: '.cospec/zhuanspec/commands/zhuanspec-archive.md',
8
+ knowledge: '.cospec/zhuanspec/commands/zhuanspec-knowledge.md',
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
9
12
  description: "搭建新的 ZhuanSpec 变更并严格验证。"
10
13
  argument-hint: feature description or request
14
+ ---`,
15
+ design: `---
16
+ description: "在 proposal 之前独立生成技术设计请求文档。"
17
+ argument-hint: dashen-page-id or description
11
18
  ---`,
12
19
  apply: `---
13
20
  description: "实施已批准的 ZhuanSpec 变更并保持任务同步。"
14
21
  argument-hint: change-id
22
+ ---`,
23
+ review: `---
24
+ description: "在归档前执行代码审查和单元测试验证。"
25
+ argument-hint: change-id
15
26
  ---`,
16
27
  archive: `---
17
28
  description: "归档已部署的 ZhuanSpec 变更并更新规范。"
18
29
  argument-hint: change-id
30
+ ---`,
31
+ knowledge: `---
32
+ description: "管理项目知识库(最佳实践、陷阱、隐式约定)。"
33
+ argument-hint: operation (view, add, search, sync)
19
34
  ---`
20
35
  };
21
36
  export class CostrictSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.crush/commands/zhuanspec/proposal.md',
4
+ design: '.crush/commands/zhuanspec/design.md',
4
5
  apply: '.crush/commands/zhuanspec/apply.md',
5
- archive: '.crush/commands/zhuanspec/archive.md'
6
+ review: '.crush/commands/zhuanspec/review.md',
7
+ archive: '.crush/commands/zhuanspec/archive.md',
8
+ knowledge: '.crush/commands/zhuanspec/knowledge.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
@@ -10,18 +13,36 @@ name: ZhuanSpec: Proposal
10
13
  description: 搭建新的 ZhuanSpec 变更并严格验证。
11
14
  category: ZhuanSpec
12
15
  tags: [zhuanspec, change]
16
+ ---`,
17
+ design: `---
18
+ name: ZhuanSpec: Design
19
+ description: 在 proposal 之前独立生成技术设计请求文档。
20
+ category: ZhuanSpec
21
+ tags: [zhuanspec, design, tech-spec]
13
22
  ---`,
14
23
  apply: `---
15
24
  name: ZhuanSpec: Apply
16
25
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
17
26
  category: ZhuanSpec
18
27
  tags: [zhuanspec, apply]
28
+ ---`,
29
+ review: `---
30
+ name: ZhuanSpec: Review
31
+ description: 在归档前执行代码审查和单元测试验证。
32
+ category: ZhuanSpec
33
+ tags: [zhuanspec, review, code-review]
19
34
  ---`,
20
35
  archive: `---
21
36
  name: ZhuanSpec: Archive
22
37
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
23
38
  category: ZhuanSpec
24
39
  tags: [zhuanspec, archive]
40
+ ---`,
41
+ knowledge: `---
42
+ name: ZhuanSpec: Knowledge
43
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
44
+ category: ZhuanSpec
45
+ tags: [zhuanspec, knowledge]
25
46
  ---`
26
47
  };
27
48
  export class CrushSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.cursor/commands/zhuanspec-proposal.md',
4
+ design: '.cursor/commands/zhuanspec-design.md',
4
5
  apply: '.cursor/commands/zhuanspec-apply.md',
5
- archive: '.cursor/commands/zhuanspec-archive.md'
6
+ review: '.cursor/commands/zhuanspec-review.md',
7
+ archive: '.cursor/commands/zhuanspec-archive.md',
8
+ knowledge: '.cursor/commands/zhuanspec-knowledge.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
@@ -10,18 +13,36 @@ name: /zhuanspec-proposal
10
13
  id: zhuanspec-proposal
11
14
  category: ZhuanSpec
12
15
  description: 搭建新的 ZhuanSpec 变更并严格验证。
16
+ ---`,
17
+ design: `---
18
+ name: /zhuanspec-design
19
+ id: zhuanspec-design
20
+ category: ZhuanSpec
21
+ description: 在 proposal 之前独立生成技术设计请求文档。
13
22
  ---`,
14
23
  apply: `---
15
24
  name: /zhuanspec-apply
16
25
  id: zhuanspec-apply
17
26
  category: ZhuanSpec
18
27
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
28
+ ---`,
29
+ review: `---
30
+ name: /zhuanspec-review
31
+ id: zhuanspec-review
32
+ category: ZhuanSpec
33
+ description: 在归档前执行代码审查和单元测试验证。
19
34
  ---`,
20
35
  archive: `---
21
36
  name: /zhuanspec-archive
22
37
  id: zhuanspec-archive
23
38
  category: ZhuanSpec
24
39
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
40
+ ---`,
41
+ knowledge: `---
42
+ name: /zhuanspec-knowledge
43
+ id: zhuanspec-knowledge
44
+ category: ZhuanSpec
45
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
25
46
  ---`
26
47
  };
27
48
  export class CursorSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,21 +1,36 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.factory/commands/zhuanspec-proposal.md',
4
+ design: '.factory/commands/zhuanspec-design.md',
4
5
  apply: '.factory/commands/zhuanspec-apply.md',
5
- archive: '.factory/commands/zhuanspec-archive.md'
6
+ review: '.factory/commands/zhuanspec-review.md',
7
+ archive: '.factory/commands/zhuanspec-archive.md',
8
+ knowledge: '.factory/commands/zhuanspec-knowledge.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
9
12
  description: 搭建新的 ZhuanSpec 变更并严格验证。
10
13
  argument-hint: request or feature description
14
+ ---`,
15
+ design: `---
16
+ description: 在 proposal 之前独立生成技术设计请求文档。
17
+ argument-hint: dashen-page-id or description
11
18
  ---`,
12
19
  apply: `---
13
20
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
14
21
  argument-hint: change-id
22
+ ---`,
23
+ review: `---
24
+ description: 在归档前执行代码审查和单元测试验证。
25
+ argument-hint: change-id
15
26
  ---`,
16
27
  archive: `---
17
28
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
18
29
  argument-hint: change-id
30
+ ---`,
31
+ knowledge: `---
32
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
33
+ argument-hint: operation (view, add, search, sync)
19
34
  ---`
20
35
  };
21
36
  export class FactorySlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,13 +1,19 @@
1
1
  import { TomlSlashCommandConfigurator } from './toml-base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.gemini/commands/zhuanspec/proposal.toml',
4
+ design: '.gemini/commands/zhuanspec/design.toml',
4
5
  apply: '.gemini/commands/zhuanspec/apply.toml',
5
- archive: '.gemini/commands/zhuanspec/archive.toml'
6
+ review: '.gemini/commands/zhuanspec/review.toml',
7
+ archive: '.gemini/commands/zhuanspec/archive.toml',
8
+ knowledge: '.gemini/commands/zhuanspec/knowledge.toml'
6
9
  };
7
10
  const DESCRIPTIONS = {
8
11
  proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
12
+ design: '在 proposal 之前独立生成技术设计请求文档。',
9
13
  apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
10
- archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
14
+ review: '在归档前执行代码审查和单元测试验证。',
15
+ archive: '归档已部署的 ZhuanSpec 变更并更新规范。',
16
+ knowledge: '管理项目知识库(最佳实践、陷阱、隐式约定)。'
11
17
  };
12
18
  export class GeminiSlashCommandConfigurator extends TomlSlashCommandConfigurator {
13
19
  toolId = 'gemini';
@@ -1,24 +1,42 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.github/prompts/zhuanspec-proposal.prompt.md',
4
+ design: '.github/prompts/zhuanspec-design.prompt.md',
4
5
  apply: '.github/prompts/zhuanspec-apply.prompt.md',
5
- archive: '.github/prompts/zhuanspec-archive.prompt.md'
6
+ review: '.github/prompts/zhuanspec-review.prompt.md',
7
+ archive: '.github/prompts/zhuanspec-archive.prompt.md',
8
+ knowledge: '.github/prompts/zhuanspec-knowledge.prompt.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
9
12
  description: 搭建新的 ZhuanSpec 变更并严格验证。
10
13
  ---
11
14
 
15
+ $ARGUMENTS`,
16
+ design: `---
17
+ description: 在 proposal 之前独立生成技术设计请求文档。
18
+ ---
19
+
12
20
  $ARGUMENTS`,
13
21
  apply: `---
14
22
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
15
23
  ---
16
24
 
25
+ $ARGUMENTS`,
26
+ review: `---
27
+ description: 在归档前执行代码审查和单元测试验证。
28
+ ---
29
+
17
30
  $ARGUMENTS`,
18
31
  archive: `---
19
32
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
20
33
  ---
21
34
 
35
+ $ARGUMENTS`,
36
+ knowledge: `---
37
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
38
+ ---
39
+
22
40
  $ARGUMENTS`
23
41
  };
24
42
  export class GitHubCopilotSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const FILE_PATHS = {
3
3
  proposal: '.iflow/commands/zhuanspec-proposal.md',
4
+ design: '.iflow/commands/zhuanspec-design.md',
4
5
  apply: '.iflow/commands/zhuanspec-apply.md',
5
- archive: '.iflow/commands/zhuanspec-archive.md'
6
+ review: '.iflow/commands/zhuanspec-review.md',
7
+ archive: '.iflow/commands/zhuanspec-archive.md',
8
+ knowledge: '.iflow/commands/zhuanspec-knowledge.md'
6
9
  };
7
10
  const FRONTMATTER = {
8
11
  proposal: `---
@@ -10,18 +13,36 @@ name: /zhuanspec-proposal
10
13
  id: zhuanspec-proposal
11
14
  category: ZhuanSpec
12
15
  description: 搭建新的 ZhuanSpec 变更并严格验证。
16
+ ---`,
17
+ design: `---
18
+ name: /zhuanspec-design
19
+ id: zhuanspec-design
20
+ category: ZhuanSpec
21
+ description: 在 proposal 之前独立生成技术设计请求文档。
13
22
  ---`,
14
23
  apply: `---
15
24
  name: /zhuanspec-apply
16
25
  id: zhuanspec-apply
17
26
  category: ZhuanSpec
18
27
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
28
+ ---`,
29
+ review: `---
30
+ name: /zhuanspec-review
31
+ id: zhuanspec-review
32
+ category: ZhuanSpec
33
+ description: 在归档前执行代码审查和单元测试验证。
19
34
  ---`,
20
35
  archive: `---
21
36
  name: /zhuanspec-archive
22
37
  id: zhuanspec-archive
23
38
  category: ZhuanSpec
24
39
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
40
+ ---`,
41
+ knowledge: `---
42
+ name: /zhuanspec-knowledge
43
+ id: zhuanspec-knowledge
44
+ category: ZhuanSpec
45
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
25
46
  ---`
26
47
  };
27
48
  export class IflowSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from "./base.js";
2
2
  const FILE_PATHS = {
3
3
  proposal: ".kilocode/workflows/zhuanspec-proposal.md",
4
+ design: ".kilocode/workflows/zhuanspec-design.md",
4
5
  apply: ".kilocode/workflows/zhuanspec-apply.md",
5
- archive: ".kilocode/workflows/zhuanspec-archive.md"
6
+ review: ".kilocode/workflows/zhuanspec-review.md",
7
+ archive: ".kilocode/workflows/zhuanspec-archive.md",
8
+ knowledge: ".kilocode/workflows/zhuanspec-knowledge.md"
6
9
  };
7
10
  export class KiloCodeSlashCommandConfigurator extends SlashCommandConfigurator {
8
11
  toolId = "kilocode";
@@ -3,8 +3,11 @@ import { FileSystemUtils } from "../../../utils/file-system.js";
3
3
  import { ZHUANSPEC_MARKERS } from "../../config.js";
4
4
  const FILE_PATHS = {
5
5
  proposal: ".opencode/command/zhuanspec-proposal.md",
6
+ design: ".opencode/command/zhuanspec-design.md",
6
7
  apply: ".opencode/command/zhuanspec-apply.md",
8
+ review: ".opencode/command/zhuanspec-review.md",
7
9
  archive: ".opencode/command/zhuanspec-archive.md",
10
+ knowledge: ".opencode/command/zhuanspec-knowledge.md",
8
11
  };
9
12
  const FRONTMATTER = {
10
13
  proposal: `---
@@ -14,6 +17,14 @@ description: 搭建新的 ZhuanSpec 变更并严格验证。
14
17
  <UserRequest>
15
18
  $ARGUMENTS
16
19
  </UserRequest>
20
+ `,
21
+ design: `---
22
+ description: 在 proposal 之前独立生成技术设计请求文档。
23
+ ---
24
+ 用户希望生成技术设计请求文档。使用 zhuanspec 说明创建设计文档。
25
+ <Input>
26
+ $ARGUMENTS
27
+ </Input>
17
28
  `,
18
29
  apply: `---
19
30
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
@@ -22,6 +33,14 @@ description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
22
33
  <UserRequest>
23
34
  $ARGUMENTS
24
35
  </UserRequest>
36
+ `,
37
+ review: `---
38
+ description: 在归档前执行代码审查和单元测试验证。
39
+ ---
40
+ 用户希望对以下变更执行代码审查。使用 zhuanspec 说明运行代码审查和单元测试验证。
41
+ <ChangeId>
42
+ $ARGUMENTS
43
+ </ChangeId>
25
44
  `,
26
45
  archive: `---
27
46
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
@@ -29,6 +48,14 @@ description: 归档已部署的 ZhuanSpec 变更并更新规范。
29
48
  <ChangeId>
30
49
  $ARGUMENTS
31
50
  </ChangeId>
51
+ `,
52
+ knowledge: `---
53
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
54
+ ---
55
+ 用户希望管理项目知识库。使用 zhuanspec 说明查看、添加、搜索或同步知识条目。
56
+ <Operation>
57
+ $ARGUMENTS
58
+ </Operation>
32
59
  `,
33
60
  };
34
61
  export class OpenCodeSlashCommandConfigurator extends SlashCommandConfigurator {
@@ -31,5 +31,9 @@ export declare class QoderSlashCommandConfigurator extends SlashCommandConfigura
31
31
  * @returns {string} YAML frontmatter block with command metadata
32
32
  */
33
33
  protected getFrontmatter(id: SlashCommandId): string;
34
+ generateAll(projectPath: string, zhuanspecDir: string): Promise<string[]>;
35
+ updateExisting(projectPath: string, zhuanspecDir: string): Promise<string[]>;
36
+ private migrateLegacyDesignCommand;
37
+ private removeLegacyDesignCommand;
34
38
  }
35
39
  //# sourceMappingURL=qoder.d.ts.map
@@ -1,4 +1,7 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
+ import { FileSystemUtils } from '../../../utils/file-system.js';
3
+ import { ZHUANSPEC_MARKERS } from '../../config.js';
4
+ import { promises as fs } from 'fs';
2
5
  /**
3
6
  * File paths for Qoder slash commands
4
7
  * Maps each ZhuanSpec workflow stage to its command file location
@@ -7,10 +10,16 @@ import { SlashCommandConfigurator } from './base.js';
7
10
  const FILE_PATHS = {
8
11
  // Create and validate new change proposals
9
12
  proposal: '.qoder/commands/zhuanspec/proposal.md',
13
+ // Generate technical design request before proposal
14
+ design: '.qoder/commands/zhuanspec/techDesign.md',
10
15
  // Implement approved changes with task tracking
11
16
  apply: '.qoder/commands/zhuanspec/apply.md',
17
+ // Run code review and unit test verification before archive
18
+ review: '.qoder/commands/zhuanspec/review.md',
12
19
  // Archive completed changes and update specs
13
- archive: '.qoder/commands/zhuanspec/archive.md'
20
+ archive: '.qoder/commands/zhuanspec/archive.md',
21
+ // Manage project knowledge base
22
+ knowledge: '.qoder/commands/zhuanspec/knowledge.md'
14
23
  };
15
24
  /**
16
25
  * YAML frontmatter for Qoder slash commands
@@ -23,18 +32,36 @@ name: ZhuanSpec: Proposal
23
32
  description: 搭建新的 ZhuanSpec 变更并严格验证。
24
33
  category: ZhuanSpec
25
34
  tags: [zhuanspec, change]
35
+ ---`,
36
+ design: `---
37
+ name: ZhuanSpec: TechDesign
38
+ description: 在 proposal 之前独立生成技术设计请求文档。
39
+ category: ZhuanSpec
40
+ tags: [zhuanspec, techDesign, tech-spec]
26
41
  ---`,
27
42
  apply: `---
28
43
  name: ZhuanSpec: Apply
29
44
  description: 实施已批准的 ZhuanSpec 变更并保持任务同步。
30
45
  category: ZhuanSpec
31
46
  tags: [zhuanspec, apply]
47
+ ---`,
48
+ review: `---
49
+ name: ZhuanSpec: Review
50
+ description: 在归档前执行代码审查和单元测试验证。
51
+ category: ZhuanSpec
52
+ tags: [zhuanspec, review, code-review]
32
53
  ---`,
33
54
  archive: `---
34
55
  name: ZhuanSpec: Archive
35
56
  description: 归档已部署的 ZhuanSpec 变更并更新规范。
36
57
  category: ZhuanSpec
37
58
  tags: [zhuanspec, archive]
59
+ ---`,
60
+ knowledge: `---
61
+ name: ZhuanSpec: Knowledge
62
+ description: 管理项目知识库(最佳实践、陷阱、隐式约定)。
63
+ category: ZhuanSpec
64
+ tags: [zhuanspec, knowledge]
38
65
  ---`
39
66
  };
40
67
  /**
@@ -72,5 +99,36 @@ export class QoderSlashCommandConfigurator extends SlashCommandConfigurator {
72
99
  getFrontmatter(id) {
73
100
  return FRONTMATTER[id];
74
101
  }
102
+ async generateAll(projectPath, zhuanspecDir) {
103
+ const createdOrUpdated = await super.generateAll(projectPath, zhuanspecDir);
104
+ await this.removeLegacyDesignCommand(projectPath);
105
+ return createdOrUpdated;
106
+ }
107
+ async updateExisting(projectPath, zhuanspecDir) {
108
+ const updated = await super.updateExisting(projectPath, zhuanspecDir);
109
+ await this.migrateLegacyDesignCommand(projectPath);
110
+ return updated;
111
+ }
112
+ async migrateLegacyDesignCommand(projectPath) {
113
+ const legacyPath = FileSystemUtils.joinPath(projectPath, '.qoder/commands/zhuanspec/design.md');
114
+ const nextPath = FileSystemUtils.joinPath(projectPath, '.qoder/commands/zhuanspec/techDesign.md');
115
+ if (!await FileSystemUtils.fileExists(legacyPath)) {
116
+ return;
117
+ }
118
+ if (!await FileSystemUtils.fileExists(nextPath)) {
119
+ const body = this.getBody('design');
120
+ const frontmatter = this.getFrontmatter('design');
121
+ const content = `${frontmatter.trim()}\n${ZHUANSPEC_MARKERS.start}\n${body}\n${ZHUANSPEC_MARKERS.end}\n`;
122
+ await FileSystemUtils.writeFile(nextPath, content);
123
+ }
124
+ await fs.unlink(legacyPath).catch(() => undefined);
125
+ }
126
+ async removeLegacyDesignCommand(projectPath) {
127
+ const legacyPath = FileSystemUtils.joinPath(projectPath, '.qoder/commands/zhuanspec/design.md');
128
+ if (!await FileSystemUtils.fileExists(legacyPath)) {
129
+ return;
130
+ }
131
+ await fs.unlink(legacyPath).catch(() => undefined);
132
+ }
75
133
  }
76
134
  //# sourceMappingURL=qoder.js.map
@@ -12,13 +12,19 @@ import { TomlSlashCommandConfigurator } from './toml-base.js';
12
12
  */
13
13
  const FILE_PATHS = {
14
14
  proposal: '.qwen/commands/zhuanspec-proposal.toml',
15
+ design: '.qwen/commands/zhuanspec-design.toml',
15
16
  apply: '.qwen/commands/zhuanspec-apply.toml',
16
- archive: '.qwen/commands/zhuanspec-archive.toml'
17
+ review: '.qwen/commands/zhuanspec-review.toml',
18
+ archive: '.qwen/commands/zhuanspec-archive.toml',
19
+ knowledge: '.qwen/commands/zhuanspec-knowledge.toml'
17
20
  };
18
21
  const DESCRIPTIONS = {
19
22
  proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
23
+ design: '在 proposal 之前独立生成技术设计请求文档。',
20
24
  apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
21
- archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
25
+ review: '在归档前执行代码审查和单元测试验证。',
26
+ archive: '归档已部署的 ZhuanSpec 变更并更新规范。',
27
+ knowledge: '管理项目知识库(最佳实践、陷阱、隐式约定)。'
22
28
  };
23
29
  /**
24
30
  * QwenSlashCommandConfigurator class provides integration with Qwen Code
@@ -1,8 +1,11 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  const NEW_FILE_PATHS = {
3
3
  proposal: '.roo/commands/zhuanspec-proposal.md',
4
+ design: '.roo/commands/zhuanspec-design.md',
4
5
  apply: '.roo/commands/zhuanspec-apply.md',
5
- archive: '.roo/commands/zhuanspec-archive.md'
6
+ review: '.roo/commands/zhuanspec-review.md',
7
+ archive: '.roo/commands/zhuanspec-archive.md',
8
+ knowledge: '.roo/commands/zhuanspec-knowledge.md'
6
9
  };
7
10
  export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
8
11
  toolId = 'roocode';
@@ -13,8 +16,11 @@ export class RooCodeSlashCommandConfigurator extends SlashCommandConfigurator {
13
16
  getFrontmatter(id) {
14
17
  const descriptions = {
15
18
  proposal: '搭建新的 ZhuanSpec 变更并严格验证。',
19
+ design: '在 proposal 之前独立生成技术设计请求文档。',
16
20
  apply: '实施已批准的 ZhuanSpec 变更并保持任务同步。',
17
- archive: '归档已部署的 ZhuanSpec 变更并更新规范。'
21
+ review: '在归档前执行代码审查和单元测试验证。',
22
+ archive: '归档已部署的 ZhuanSpec 变更并更新规范。',
23
+ knowledge: '管理项目知识库(最佳实践、陷阱、隐式约定)。'
18
24
  };
19
25
  const description = descriptions[id];
20
26
  return `# ZhuanSpec: ${id.charAt(0).toUpperCase() + id.slice(1)}\n\n${description}`;