@zhuan-ai/zhuanspec 2.2.5 → 2.5.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 (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 +38 -0
  9. package/dist/commands/progress.js +349 -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 +609 -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 +513 -244
  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 -156
  80. package/dist/core/templates/slash-command-templates.d.ts +1 -1
  81. package/dist/core/templates/slash-command-templates.js +352 -21
  82. package/dist/core/templates/tasks-template.d.ts +7 -0
  83. package/dist/core/templates/tasks-template.js +121 -25
  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 +3 -2
  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
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Template for generating tasks.md in TDD workflow with required checkpoint sections.
5
5
  * This follows the TDD schema: spec → tests → implementation → docs
6
+ * Template MUST conform to strict validation rules in strict-rules.ts
6
7
  */
7
8
  export interface TddTasksTemplateOptions {
8
9
  changeId: string;
@@ -10,10 +11,12 @@ export interface TddTasksTemplateOptions {
10
11
  }
11
12
  /**
12
13
  * Get the TDD tasks.md template structure with required checkpoint sections
14
+ * Uses valid completion markers to pass strict validation by default
13
15
  */
14
16
  export declare function getTddTasksTemplate(options?: TddTasksTemplateOptions): string;
15
17
  /**
16
18
  * Get the minimal TDD tasks.md template (for quick scaffolding)
19
+ * Note: User must fill in Pre-Clarification Log and Skill Mapping sections
17
20
  */
18
21
  export declare function getMinimalTddTasksTemplate(): string;
19
22
  declare const _default: {
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * Template for generating tasks.md in TDD workflow with required checkpoint sections.
5
5
  * This follows the TDD schema: spec → tests → implementation → docs
6
+ * Template MUST conform to strict validation rules in strict-rules.ts
6
7
  */
7
8
  /**
8
9
  * Get the TDD tasks.md template structure with required checkpoint sections
10
+ * Uses valid completion markers to pass strict validation by default
9
11
  */
10
12
  export function getTddTasksTemplate(options) {
11
13
  const changeId = options?.changeId || '[change-id]';
@@ -14,99 +16,150 @@ export function getTddTasksTemplate(options) {
14
16
 
15
17
  ## Pre-Clarification Log
16
18
 
17
- <!-- REQUIRED: Record clarification Q&A or write "Status: COMPLETED - No clarification needed" -->
18
- <!-- This section MUST NOT be empty or contain only HTML comments -->
19
+ <!-- ⚠️ CHECKPOINT [PRE-CLARIFICATION]: This section MUST be completed before writing proposal -->
20
+ <!-- Record clarification Q&A or write "Status: COMPLETED - No clarification needed" -->
21
+ <!-- This section MUST NOT be empty, contain only HTML comments, or have TODO/TBD/PENDING markers -->
19
22
 
20
- Status: PENDING
23
+ Status: COMPLETED - No clarification needed
21
24
 
22
- ## Skill Mapping
25
+ Reason: TDD workflow requirements are clear - specification first, then failing tests, then implementation.
26
+
27
+ <!-- If clarification was needed:
28
+ Question 1: <!-- clarification question -->
29
+ Answer: <!-- user answer -->
30
+ -->
23
31
 
24
- | Skill Name | Actual Function | Match Reason |
25
- |---|---|---|
32
+ ## Skill Mapping
26
33
 
27
- <!-- REQUIRED: Run \`zhuanspec skills list\` and record skill matching decisions -->
34
+ <!-- ⚠️ CHECKPOINT [SKILL-TAGGING]: Run \`zhuanspec skills list\` first -->
28
35
  <!-- Every task MUST have either @skill:real-skill-name or @skill:none -->
29
36
 
30
- ## Task List
37
+ | 实现区域 | 实际功能 | 关联 Skill | 匹配理由 |
38
+ |---------|---------|-----------|---------|
39
+ | 测试层 | 单元测试生成 | generate-${testFramework}-unit-test-skill | TDD Red phase 需要生成测试框架特定测试 |
40
+
41
+ <!--
42
+ TDD Skill Mapping Guidelines:
43
+ - Wave 2 (Red): Unit test generation requires test skill
44
+ - Wave 3-4 (Green/Refactor): Implementation may need domain-specific skills
45
+ - Wave 5 (Docs): Documentation tasks typically @skill:none
46
+ -->
31
47
 
32
- ### Wave 1: Specification (No Dependencies)
48
+ ### Wave 1
33
49
 
34
- <!-- Define what to build before writing any code -->
50
+ <!-- Wave 1: Specification - Define what to build before writing any code -->
35
51
 
36
- - [ ] 1.1 Write feature specification @skill:none <!-- spec definition -->
52
+ - [ ] 1.1 Write feature specification @skill:none <!-- justification: spec definition, no code -->
37
53
 
38
- ### Wave 2: Red Phase - Write Failing Tests
54
+ ### Wave 2
39
55
 
40
- <!-- TDD Red: Write tests that define expected behavior -->
56
+ <!-- Wave 2: Red Phase - Write failing tests that define expected behavior -->
41
57
  <!-- Tests should fail initially - this proves they test something meaningful -->
42
58
 
43
59
  - [ ] 2.1 Write unit tests for core functionality @depends:1.1 @skill:generate-${testFramework}-unit-test-skill
44
- - [ ] 2.2 Write integration tests @depends:1.1 @skill:none
60
+ - [ ] 2.2 Write integration tests @depends:1.1 @skill:none <!-- justification: integration tests, framework-specific -->
45
61
 
46
- ### Wave 3: Green Phase - Implementation
62
+ ### Wave 3
47
63
 
48
- <!-- TDD Green: Write minimal code to make tests pass -->
64
+ <!-- Wave 3: Green Phase - Write minimal code to make tests pass -->
49
65
 
50
- - [ ] 3.1 Implement core logic @depends:2.1 @skill:none
66
+ - [ ] 3.1 Implement core logic @depends:2.1 @skill:none <!-- fill in actual skill if needed -->
51
67
  - [ ] 3.2 Implement edge case handling @depends:3.1 @skill:none
52
68
 
53
- ### Wave 4: Refactor Phase
69
+ ### Wave 4
54
70
 
55
- <!-- TDD Refactor: Clean up code while keeping tests green -->
71
+ <!-- Wave 4: Refactor Phase - Clean up code while keeping tests green -->
56
72
 
57
- - [ ] 4.1 Refactor for clarity @depends:3.2 @skill:none
73
+ - [ ] 4.1 Refactor for clarity @depends:3.2 @skill:none <!-- justification: code cleanup -->
58
74
  - [ ] 4.2 Optimize performance @depends:4.1 @skill:none
59
75
 
60
- ### Wave 5: Documentation
76
+ ### Wave 5
61
77
 
62
- <!-- Document the implemented feature -->
78
+ <!-- Wave 5: Documentation - Document the implemented feature -->
63
79
 
64
- - [ ] 5.1 Update API documentation @depends:4.2 @skill:none
80
+ - [ ] 5.1 Update API documentation @depends:4.2 @skill:none <!-- justification: documentation task -->
65
81
  - [ ] 5.2 Add usage examples @depends:5.1 @skill:none
66
82
 
67
83
  ## Dependency Analysis
68
84
 
69
- <!-- REQUIRED: Status must be COMPLETED after wave analysis -->
85
+ <!-- ⚠️ CHECKPOINT [TASK-ORDERING]: Status must be COMPLETED after wave analysis -->
70
86
  <!-- TDD waves follow strict order: spec → tests → impl → refactor → docs -->
71
87
  <!-- No task may appear before a task it depends on -->
72
88
 
73
- Status: PENDING
89
+ Status: COMPLETED
90
+
91
+ TDD Wave assignment logic:
92
+ - Wave 1: Specification (no dependencies)
93
+ - Wave 2: Tests (depends on spec)
94
+ - Wave 3: Implementation (depends on tests)
95
+ - Wave 4: Refactor (depends on implementation)
96
+ - Wave 5: Documentation (depends on refactor)
97
+
98
+ ## Quality Gates
99
+
100
+ - [ ] Apply 全部任务完成后自动执行一次 \`zhuanspec review <change-id>\`(如失败则手动补执行)
101
+
102
+ ## Workflow Diagram
103
+
104
+ <!-- Auto-generated by zhuanspec validate --strict -->
105
+ <!-- DO NOT EDIT - this section will be regenerated -->
106
+
107
+ \`\`\`mermaid
108
+ flowchart TD
109
+ W1[Wave 1: Spec] --> W2[Wave 2: Tests]
110
+ W2 --> W3[Wave 3: Impl]
111
+ W3 --> W4[Wave 4: Refactor]
112
+ W4 --> W5[Wave 5: Docs]
113
+ \`\`\`
74
114
  `;
75
115
  }
76
116
  /**
77
117
  * Get the minimal TDD tasks.md template (for quick scaffolding)
118
+ * Note: User must fill in Pre-Clarification Log and Skill Mapping sections
78
119
  */
79
120
  export function getMinimalTddTasksTemplate() {
80
121
  return `## Pre-Clarification Log
81
122
 
82
- Status: PENDING
123
+ Status: COMPLETED - No clarification needed
124
+
125
+ Reason: <!-- fill in reason -->
83
126
 
84
127
  ## Skill Mapping
85
128
 
86
- | Skill Name | Actual Function | Match Reason |
87
- |---|---|---|
129
+ | 实现区域 | 实际功能 | 关联 Skill | 匹配理由 |
130
+ |---------|---------|-----------|---------|
131
+ | <!-- fill in --> | <!-- fill in --> | <!-- fill in --> | <!-- fill in --> |
132
+
133
+ ### Wave 1
88
134
 
89
- ## Task List
135
+ - [ ] 1.1 Write specification @skill:none
90
136
 
91
- ### Wave 1: Specification
137
+ ### Wave 2
92
138
 
93
- - [ ] 1.1 Write feature specification @skill:none
139
+ - [ ] 2.1 Write tests @depends:1.1 @skill:none
94
140
 
95
- ### Wave 2: Red Phase - Tests
141
+ ### Wave 3
96
142
 
97
- - [ ] 2.1 Write failing tests @depends:1.1 @skill:none
143
+ - [ ] 3.1 Implement @depends:2.1 @skill:none
98
144
 
99
- ### Wave 3: Green Phase - Implementation
145
+ ### Wave 4
100
146
 
101
- - [ ] 3.1 Implement to pass tests @depends:2.1 @skill:none
147
+ - [ ] 4.1 Refactor @depends:3.1 @skill:none
102
148
 
103
- ### Wave 4: Documentation
149
+ ### Wave 5
104
150
 
105
- - [ ] 4.1 Document the feature @depends:3.1 @skill:none
151
+ - [ ] 5.1 Document @depends:4.1 @skill:none
106
152
 
107
153
  ## Dependency Analysis
108
154
 
109
- Status: PENDING
155
+ Status: COMPLETED
156
+
157
+ Wave assignment: TDD strict order
158
+
159
+ ## Quality Gates
160
+
161
+ - [ ] Apply 全部任务完成后自动执行一次 \`zhuanspec review <change-id>\`(如失败则手动补执行)
162
+ - [ ] 单元测试命令已执行且测试通过(如 \`npm test\` / \`mvn test\`)
110
163
  `;
111
164
  }
112
165
  export default {
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Test Cases Template
3
+ *
4
+ * Template for generating test-cases.md when test cases are provided.
5
+ * This template is optional and only created when:
6
+ * - User selects "有测试 case" in Phase 0 (Test Case Decision)
7
+ * - Test case details are fetched via taskId/bicId or manually entered
8
+ */
9
+ export interface TestCasesTemplateOptions {
10
+ changeId: string;
11
+ source?: 'taskId' | 'bicId' | 'manual';
12
+ sourceId?: string;
13
+ testCaseCount?: number;
14
+ }
15
+ /**
16
+ * Get the test-cases.md template structure
17
+ */
18
+ export declare function getTestCasesTemplate(options?: TestCasesTemplateOptions): string;
19
+ /**
20
+ * Get a minimal test-cases.md template for manual entry
21
+ */
22
+ export declare function getMinimalTestCasesTemplate(): string;
23
+ /**
24
+ * Format fetched test cases into test-cases.md content
25
+ * This function can be used to convert raw test case data from MCP tools
26
+ */
27
+ export declare function formatFetchedTestCases(changeId: string, source: string, sourceId: string, testCases: Array<{
28
+ id: string;
29
+ title: string;
30
+ preconditions?: string[];
31
+ steps?: string[];
32
+ expectedResult?: string;
33
+ checkpoints?: string[];
34
+ }>): string;
35
+ declare const _default: {
36
+ getTestCasesTemplate: typeof getTestCasesTemplate;
37
+ getMinimalTestCasesTemplate: typeof getMinimalTestCasesTemplate;
38
+ formatFetchedTestCases: typeof formatFetchedTestCases;
39
+ };
40
+ export default _default;
41
+ //# sourceMappingURL=test-cases-template.d.ts.map
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Test Cases Template
3
+ *
4
+ * Template for generating test-cases.md when test cases are provided.
5
+ * This template is optional and only created when:
6
+ * - User selects "有测试 case" in Phase 0 (Test Case Decision)
7
+ * - Test case details are fetched via taskId/bicId or manually entered
8
+ */
9
+ /**
10
+ * Get the test-cases.md template structure
11
+ */
12
+ export function getTestCasesTemplate(options) {
13
+ const changeId = options?.changeId || '[change-id]';
14
+ const source = options?.source || 'manual';
15
+ const sourceId = options?.sourceId || '[source-id]';
16
+ const count = options?.testCaseCount || 2;
17
+ return `# 测试 Cases: ${changeId}
18
+
19
+ **来源**: ${source === 'taskId' ? `taskId=${sourceId}` : source === 'bicId' ? `bicId=${sourceId}` : '手动录入'}
20
+ **获取时间**: [YYYY-MM-DD]
21
+ **总数**: ${count} 个测试 case
22
+
23
+ ---
24
+
25
+ ## TC-001: [测试 case 标题]
26
+
27
+ **前置条件**:
28
+ - [前置条件1]
29
+ - [前置条件2]
30
+
31
+ **测试步骤**:
32
+ 1. 步骤1
33
+ 2. 步骤2
34
+ 3. 步骤3
35
+
36
+ **预期结果**:
37
+ - [预期结果描述]
38
+
39
+ **验收点**:
40
+ - ✅ 验收点1: [具体描述]
41
+ - ✅ 验收点2: [具体描述]
42
+
43
+ ---
44
+
45
+ ## TC-002: [测试 case 标题]
46
+
47
+ **前置条件**:
48
+ - [前置条件1]
49
+
50
+ **测试步骤**:
51
+ 1. 步骤1
52
+ 2. 步骤2
53
+
54
+ **预期结果**:
55
+ - [预期结果描述]
56
+
57
+ **验收点**:
58
+ - ✅ 验收点1: [具体描述]
59
+ - ✅ 验收点2: [具体描述]
60
+ `;
61
+ }
62
+ /**
63
+ * Get a minimal test-cases.md template for manual entry
64
+ */
65
+ export function getMinimalTestCasesTemplate() {
66
+ return `# 测试 Cases: [change-id]
67
+
68
+ **来源**: 手动录入
69
+ **获取时间**: [YYYY-MM-DD]
70
+ **总数**: N 个测试 case
71
+
72
+ ---
73
+
74
+ ## TC-001: [测试 case 标题]
75
+
76
+ **前置条件**:
77
+ - [前置条件]
78
+
79
+ **测试步骤**:
80
+ 1. [步骤]
81
+
82
+ **预期结果**:
83
+ - [预期结果]
84
+
85
+ **验收点**:
86
+ - ✅ 验收点: [描述]
87
+ `;
88
+ }
89
+ /**
90
+ * Format fetched test cases into test-cases.md content
91
+ * This function can be used to convert raw test case data from MCP tools
92
+ */
93
+ export function formatFetchedTestCases(changeId, source, sourceId, testCases) {
94
+ const header = `# 测试 Cases: ${changeId}
95
+
96
+ **来源**: ${source}=${sourceId}
97
+ **获取时间**: ${new Date().toISOString().split('T')[0]}
98
+ **总数**: ${testCases.length} 个测试 case
99
+
100
+ ---
101
+ `;
102
+ const testCaseBlocks = testCases.map(tc => {
103
+ const preconditionList = tc.preconditions?.map(p => `- ${p}`).join('\n') || '- [待补充前置条件]';
104
+ const stepsList = tc.steps?.map((s, i) => `${i + 1}. ${s}`).join('\n') || '1. [待补充测试步骤]';
105
+ const checkpointsList = tc.checkpoints?.map(c => `- ✅ ${c}`).join('\n') || '- ✅ [待补充验收点]';
106
+ return `## ${tc.id}: ${tc.title}
107
+
108
+ **前置条件**:
109
+ ${preconditionList}
110
+
111
+ **测试步骤**:
112
+ ${stepsList}
113
+
114
+ **预期结果**:
115
+ - ${tc.expectedResult || '[待补充预期结果]'}
116
+
117
+ **验收点**:
118
+ ${checkpointsList}
119
+ `;
120
+ }).join('\n---\n');
121
+ return header + testCaseBlocks;
122
+ }
123
+ export default {
124
+ getTestCasesTemplate,
125
+ getMinimalTestCasesTemplate,
126
+ formatFetchedTestCases
127
+ };
128
+ //# sourceMappingURL=test-cases-template.js.map
@@ -1,10 +1,7 @@
1
1
  /**
2
2
  * Strict Validation Rules
3
3
  *
4
- * Implementation of three strict validation rules for `zhuanspec validate --strict`:
5
- * 1. pre-clarification-completed: Check Pre-Clarification Log section
6
- * 2. skill-tags-valid: Validate @skill tags against known skills
7
- * 3. task-ordering-by-wave: Verify task ordering follows wave structure
4
+ * Implementation of strict validation rules for `zhuanspec validate --strict`.
8
5
  */
9
6
  import type { ParsedTask } from '../task-graph/types.js';
10
7
  export interface StrictCheckResult {
@@ -64,8 +61,50 @@ export declare function checkTaskOrderingByWave(tasksContent: string, parsedTask
64
61
  * - Each scheduling_summary entry correctly describes subagent count and execution mode
65
62
  */
66
63
  export declare function checkSubagentDirectives(parsedTasks: ParsedTask[]): StrictCheckResult;
64
+ /**
65
+ * Rule 5: review-gate-defined
66
+ *
67
+ * Tasks must explicitly mention zhuanspec review gate.
68
+ */
69
+ export declare function checkReviewGateDefined(tasksContent: string): StrictCheckResult;
70
+ /**
71
+ * Rule 7: proposal-format-valid
72
+ *
73
+ * Validates that proposal.md contains required sections:
74
+ * - Why/变更原因
75
+ * - What Changes/变更内容
76
+ * - Impact/影响范围
77
+ */
78
+ export declare function checkProposalFormatValid(proposalContent: string): StrictCheckResult;
79
+ /**
80
+ * Detect current workflow phase based on progress.json.
81
+ *
82
+ * Phase detection logic:
83
+ * 1. If progress.json doesn't exist -> Propose phase
84
+ * 2. If progress.json exists with phase field -> use that phase
85
+ * 3. If progress.json exists without phase field -> Apply phase (default)
86
+ */
87
+ export declare function detectPhase(changeDir: string): 'propose' | 'apply' | 'review';
88
+ /**
89
+ * Rule: test-case-coverage
90
+ * Validates that tasks.md has test case coverage section.
91
+ * Behavior differs based on hasTestCase mode:
92
+ * - hasTestCase=true (TDD or user provided cases): REQUIRED, blocking if missing
93
+ * - hasTestCase=false (normal spec-driven): SKIPPED, warning only
94
+ *
95
+ * Table format validation (when hasTestCase=true):
96
+ * - Must have four columns: Task, 测试 Case ID, 测试 Case 文件路径, 覆盖场景
97
+ * - Column headers must match expected format
98
+ */
99
+ export declare function checkTestCaseCoverage(tasksContent: string, hasTestCase?: boolean): StrictCheckResult;
67
100
  /**
68
101
  * Main entry: Run all strict validation rules
69
102
  */
70
- export declare function runStrictValidation(tasksContent: string, parsedTasks: ParsedTask[], knownSkillNames: string[]): Promise<StrictValidationResult>;
103
+ export declare function runStrictValidation(tasksContent: string, parsedTasks: ParsedTask[], knownSkillNames: string[], options?: {
104
+ proposalContent?: string;
105
+ specsDir?: string;
106
+ repoRoot?: string;
107
+ changeDir?: string;
108
+ hasTestCase?: boolean;
109
+ }): Promise<StrictValidationResult>;
71
110
  //# sourceMappingURL=strict-rules.d.ts.map