@clawplays/ospec-cli 0.3.7 → 0.3.9

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 (166) hide show
  1. package/README.md +9 -1
  2. package/SKILL.md +1 -1
  3. package/assets/git-hooks/post-merge +4 -2
  4. package/assets/git-hooks/pre-commit +4 -2
  5. package/dist/advanced/BatchOperations.d.ts +1 -2
  6. package/dist/advanced/BatchOperations.js +1 -2
  7. package/dist/advanced/CachingLayer.d.ts +1 -2
  8. package/dist/advanced/CachingLayer.js +1 -2
  9. package/dist/advanced/FeatureUpdater.d.ts +1 -2
  10. package/dist/advanced/FeatureUpdater.js +1 -2
  11. package/dist/advanced/PerformanceMonitor.d.ts +1 -2
  12. package/dist/advanced/PerformanceMonitor.js +1 -2
  13. package/dist/advanced/StatePersistence.d.ts +1 -2
  14. package/dist/advanced/StatePersistence.js +1 -2
  15. package/dist/advanced/index.d.ts +1 -2
  16. package/dist/advanced/index.js +1 -2
  17. package/dist/cli/commands/config.d.ts +1 -2
  18. package/dist/cli/commands/config.js +1 -2
  19. package/dist/cli/commands/feature.d.ts +1 -2
  20. package/dist/cli/commands/feature.js +1 -2
  21. package/dist/cli/commands/index.d.ts +1 -2
  22. package/dist/cli/commands/index.js +1 -2
  23. package/dist/cli/commands/project.d.ts +1 -2
  24. package/dist/cli/commands/project.js +1 -2
  25. package/dist/cli/commands/validate.d.ts +1 -2
  26. package/dist/cli/commands/validate.js +1 -2
  27. package/dist/cli/index.d.ts +1 -2
  28. package/dist/cli/index.js +1 -2
  29. package/dist/cli.d.ts +1 -2
  30. package/dist/cli.js +1 -2
  31. package/dist/commands/ArchiveCommand.d.ts +1 -2
  32. package/dist/commands/ArchiveCommand.js +1 -1
  33. package/dist/commands/BaseCommand.d.ts +1 -2
  34. package/dist/commands/BaseCommand.js +1 -2
  35. package/dist/commands/BatchCommand.d.ts +1 -2
  36. package/dist/commands/BatchCommand.js +1 -2
  37. package/dist/commands/ChangesCommand.js +0 -1
  38. package/dist/commands/DocsCommand.d.ts +1 -2
  39. package/dist/commands/DocsCommand.js +0 -1
  40. package/dist/commands/IndexCommand.d.ts +1 -2
  41. package/dist/commands/IndexCommand.js +1 -2
  42. package/dist/commands/InitCommand.d.ts +1 -2
  43. package/dist/commands/InitCommand.js +0 -1
  44. package/dist/commands/NewCommand.d.ts +0 -1
  45. package/dist/commands/NewCommand.js +19 -12
  46. package/dist/commands/PluginsCommand.d.ts +0 -1
  47. package/dist/commands/PluginsCommand.js +0 -1
  48. package/dist/commands/ProgressCommand.d.ts +1 -2
  49. package/dist/commands/ProgressCommand.js +1 -2
  50. package/dist/commands/QueueCommand.d.ts +0 -1
  51. package/dist/commands/QueueCommand.js +0 -1
  52. package/dist/commands/RunCommand.d.ts +0 -1
  53. package/dist/commands/RunCommand.js +0 -1
  54. package/dist/commands/SkillCommand.d.ts +0 -1
  55. package/dist/commands/SkillCommand.js +1 -2
  56. package/dist/commands/SkillsCommand.d.ts +1 -2
  57. package/dist/commands/SkillsCommand.js +1 -2
  58. package/dist/commands/StatusCommand.d.ts +1 -2
  59. package/dist/commands/StatusCommand.js +0 -1
  60. package/dist/commands/UpdateCommand.d.ts +0 -1
  61. package/dist/commands/UpdateCommand.js +37 -2
  62. package/dist/commands/VerifyCommand.d.ts +1 -2
  63. package/dist/commands/VerifyCommand.js +4 -41
  64. package/dist/commands/WorkflowCommand.d.ts +0 -1
  65. package/dist/commands/WorkflowCommand.js +0 -1
  66. package/dist/commands/index.d.ts +0 -1
  67. package/dist/commands/index.js +0 -1
  68. package/dist/core/constants.d.ts +1 -2
  69. package/dist/core/constants.js +1 -2
  70. package/dist/core/errors.d.ts +1 -2
  71. package/dist/core/errors.js +1 -2
  72. package/dist/core/index.d.ts +1 -2
  73. package/dist/core/index.js +1 -2
  74. package/dist/core/types.d.ts +0 -1
  75. package/dist/core/types.js +1 -2
  76. package/dist/index.d.ts +1 -2
  77. package/dist/index.js +1 -2
  78. package/dist/presets/ProjectPresets.d.ts +0 -1
  79. package/dist/presets/ProjectPresets.js +0 -1
  80. package/dist/scaffolds/ProjectScaffoldPresets.d.ts +1 -2
  81. package/dist/scaffolds/ProjectScaffoldPresets.js +1 -2
  82. package/dist/services/ConfigManager.d.ts +1 -2
  83. package/dist/services/ConfigManager.js +0 -1
  84. package/dist/services/FeatureManager.d.ts +1 -2
  85. package/dist/services/FeatureManager.js +1 -2
  86. package/dist/services/FileService.d.ts +1 -2
  87. package/dist/services/FileService.js +0 -1
  88. package/dist/services/IndexBuilder.d.ts +1 -2
  89. package/dist/services/IndexBuilder.js +1 -2
  90. package/dist/services/Logger.d.ts +1 -2
  91. package/dist/services/Logger.js +1 -2
  92. package/dist/services/ProjectAssetRegistry.d.ts +0 -1
  93. package/dist/services/ProjectAssetRegistry.js +1 -2
  94. package/dist/services/ProjectAssetService.d.ts +0 -1
  95. package/dist/services/ProjectAssetService.js +4 -2
  96. package/dist/services/ProjectScaffoldCommandService.d.ts +1 -2
  97. package/dist/services/ProjectScaffoldCommandService.js +0 -1
  98. package/dist/services/ProjectScaffoldService.d.ts +1 -2
  99. package/dist/services/ProjectScaffoldService.js +0 -1
  100. package/dist/services/ProjectService.d.ts +1 -1
  101. package/dist/services/ProjectService.js +267 -411
  102. package/dist/services/QueueService.d.ts +0 -1
  103. package/dist/services/QueueService.js +1 -1
  104. package/dist/services/RunService.d.ts +0 -1
  105. package/dist/services/RunService.js +0 -1
  106. package/dist/services/SkillParser.d.ts +1 -2
  107. package/dist/services/SkillParser.js +0 -1
  108. package/dist/services/StateManager.d.ts +0 -1
  109. package/dist/services/StateManager.js +0 -1
  110. package/dist/services/TemplateEngine.d.ts +1 -2
  111. package/dist/services/TemplateEngine.js +1 -2
  112. package/dist/services/TemplateGenerator.d.ts +1 -2
  113. package/dist/services/TemplateGenerator.js +6 -7
  114. package/dist/services/ValidationService.d.ts +1 -2
  115. package/dist/services/ValidationService.js +1 -2
  116. package/dist/services/Validator.d.ts +1 -2
  117. package/dist/services/Validator.js +1 -2
  118. package/dist/services/index.d.ts +0 -1
  119. package/dist/services/index.js +0 -1
  120. package/dist/services/templates/ExecutionTemplateBuilder.d.ts +1 -2
  121. package/dist/services/templates/ExecutionTemplateBuilder.js +52 -29
  122. package/dist/services/templates/ProjectTemplateBuilder.d.ts +1 -2
  123. package/dist/services/templates/ProjectTemplateBuilder.js +0 -1
  124. package/dist/services/templates/TemplateBuilderBase.d.ts +5 -1
  125. package/dist/services/templates/TemplateBuilderBase.js +31 -3
  126. package/dist/services/templates/TemplateInputFactory.d.ts +1 -2
  127. package/dist/services/templates/TemplateInputFactory.js +4 -1
  128. package/dist/services/templates/templateTypes.d.ts +4 -1
  129. package/dist/services/templates/templateTypes.js +1 -2
  130. package/dist/tools/build-index.js +128 -36
  131. package/dist/utils/DateUtils.d.ts +1 -2
  132. package/dist/utils/DateUtils.js +1 -2
  133. package/dist/utils/PathUtils.d.ts +0 -1
  134. package/dist/utils/PathUtils.js +0 -1
  135. package/dist/utils/StringUtils.d.ts +1 -2
  136. package/dist/utils/StringUtils.js +1 -2
  137. package/dist/utils/helpers.d.ts +0 -1
  138. package/dist/utils/helpers.js +0 -1
  139. package/dist/utils/index.d.ts +1 -2
  140. package/dist/utils/index.js +1 -2
  141. package/dist/utils/logger.d.ts +1 -2
  142. package/dist/utils/logger.js +1 -2
  143. package/dist/utils/path.d.ts +1 -2
  144. package/dist/utils/path.js +1 -2
  145. package/dist/utils/subcommandHelp.d.ts +0 -1
  146. package/dist/utils/subcommandHelp.js +0 -1
  147. package/dist/workflow/ArchiveGate.d.ts +1 -2
  148. package/dist/workflow/ArchiveGate.js +1 -2
  149. package/dist/workflow/ConfigurableWorkflow.d.ts +1 -2
  150. package/dist/workflow/ConfigurableWorkflow.js +1 -2
  151. package/dist/workflow/HookSystem.d.ts +1 -2
  152. package/dist/workflow/HookSystem.js +1 -2
  153. package/dist/workflow/IndexRegenerator.d.ts +1 -2
  154. package/dist/workflow/IndexRegenerator.js +1 -2
  155. package/dist/workflow/PluginWorkflowComposer.d.ts +0 -1
  156. package/dist/workflow/PluginWorkflowComposer.js +0 -1
  157. package/dist/workflow/SkillUpdateEngine.d.ts +1 -2
  158. package/dist/workflow/SkillUpdateEngine.js +1 -2
  159. package/dist/workflow/VerificationSystem.d.ts +1 -2
  160. package/dist/workflow/VerificationSystem.js +1 -2
  161. package/dist/workflow/WorkflowEngine.d.ts +1 -2
  162. package/dist/workflow/WorkflowEngine.js +1 -2
  163. package/dist/workflow/index.d.ts +0 -1
  164. package/dist/workflow/index.js +0 -1
  165. package/package.json +17 -8
  166. package/skill.yaml +2 -2
@@ -14,4 +14,3 @@ export declare class QueueService {
14
14
  private toRelativePath;
15
15
  }
16
16
  export declare function createQueueService(fileService: FileService, projectService: ProjectService): QueueService;
17
- //# sourceMappingURL=QueueService.d.ts.map
@@ -77,6 +77,7 @@ class QueueService {
77
77
  await this.fileService.writeJSON(statePath, state);
78
78
  await this.updateFrontmatterStatus(path_1.default.join(activePath, constants_1.FILE_NAMES.PROPOSAL), 'active');
79
79
  await this.updateFrontmatterStatus(path_1.default.join(activePath, constants_1.FILE_NAMES.VERIFICATION), 'verifying');
80
+ await this.projectService.rebaseMovedChangeMarkdownLinks(queuedPath, activePath);
80
81
  const item = await this.buildQueuedChangeStatusItem(rootDir, activePath);
81
82
  if (!item) {
82
83
  throw new Error(`Activated change state could not be read: ${changeName}`);
@@ -139,4 +140,3 @@ exports.QueueService = QueueService;
139
140
  function createQueueService(fileService, projectService) {
140
141
  return new QueueService(fileService, projectService);
141
142
  }
142
- //# sourceMappingURL=QueueService.js.map
@@ -37,4 +37,3 @@ export declare class RunService {
37
37
  private getIdleInstruction;
38
38
  }
39
39
  export declare function createRunService(fileService: FileService, projectService: ProjectService, queueService: QueueService): RunService;
40
- //# sourceMappingURL=RunService.d.ts.map
@@ -463,4 +463,3 @@ exports.RunService = RunService;
463
463
  function createRunService(fileService, projectService, queueService) {
464
464
  return new RunService(fileService, projectService, queueService);
465
465
  }
466
- //# sourceMappingURL=RunService.js.map
@@ -26,5 +26,4 @@ export declare class SkillParser {
26
26
  private extractDocumentTitle;
27
27
  }
28
28
  export declare const skillParser: SkillParser;
29
- export {};
30
- //# sourceMappingURL=SkillParser.d.ts.map
29
+ export {};
@@ -85,4 +85,3 @@ class SkillParser {
85
85
  }
86
86
  exports.SkillParser = SkillParser;
87
87
  exports.skillParser = new SkillParser();
88
- //# sourceMappingURL=SkillParser.js.map
@@ -13,4 +13,3 @@ export declare class StateManager {
13
13
  }): FeatureState;
14
14
  }
15
15
  export declare function createStateManager(fileService: FileService): StateManager;
16
- //# sourceMappingURL=StateManager.d.ts.map
@@ -124,4 +124,3 @@ exports.StateManager = StateManager;
124
124
  function createStateManager(fileService) {
125
125
  return new StateManager(fileService);
126
126
  }
127
- //# sourceMappingURL=StateManager.js.map
@@ -39,5 +39,4 @@ export declare class TemplateEngine {
39
39
  generateExecutionProtocolTemplate(input?: ProjectBootstrapInput): string;
40
40
  generateBuildIndexScriptTemplate(): string;
41
41
  }
42
- export declare const templateEngine: TemplateEngine;
43
- //# sourceMappingURL=TemplateEngine.d.ts.map
42
+ export declare const templateEngine: TemplateEngine;
@@ -115,5 +115,4 @@ class TemplateEngine {
115
115
  }
116
116
  }
117
117
  exports.TemplateEngine = TemplateEngine;
118
- exports.templateEngine = new TemplateEngine();
119
- //# sourceMappingURL=TemplateEngine.js.map
118
+ exports.templateEngine = new TemplateEngine();
@@ -36,5 +36,4 @@ export declare class TemplateGenerator {
36
36
  * 生成执行协议
37
37
  */
38
38
  private static generateExecutionProtocol;
39
- }
40
- //# sourceMappingURL=TemplateGenerator.d.ts.map
39
+ }
@@ -63,20 +63,20 @@ optional_steps: [${optionalSteps.map((s) => `"${s}"`).join(', ')}]
63
63
  // 添加核心任务
64
64
  if (coreRequiredSteps.length > 0) {
65
65
  coreRequiredSteps.forEach((step, index) => {
66
- content += `- [ ] ${index + 1}. ${step}\n`;
66
+ content += `- [ ] ${step}\n`;
67
67
  });
68
68
  }
69
69
  else {
70
- content += `- [ ] 1. 实现功能\n`;
71
- content += `- [ ] 2. 更新文档\n`;
72
- content += `- [ ] 3. 更新索引\n`;
73
- content += `- [ ] 4. 运行测试\n`;
70
+ content += `- [ ] 实现功能\n`;
71
+ content += `- [ ] 更新文档\n`;
72
+ content += `- [ ] 更新索引\n`;
73
+ content += `- [ ] 运行测试\n`;
74
74
  }
75
75
  // 添加可选任务
76
76
  if (optionalSteps.length > 0) {
77
77
  content += `\n### 可选任务\n\n`;
78
78
  optionalSteps.forEach((step, index) => {
79
- content += `- [ ] ${index + 1}. ${step}\n`;
79
+ content += `- [ ] ${step}\n`;
80
80
  });
81
81
  }
82
82
  return content;
@@ -270,4 +270,3 @@ ospec feature archive my-feature
270
270
  }
271
271
  }
272
272
  exports.TemplateGenerator = TemplateGenerator;
273
- //# sourceMappingURL=TemplateGenerator.js.map
@@ -15,5 +15,4 @@ export declare class ValidationService {
15
15
  */
16
16
  validateRequiredFields(data: Record<string, any>, fields: string[]): boolean;
17
17
  }
18
- export declare const validationService: ValidationService;
19
- //# sourceMappingURL=ValidationService.d.ts.map
18
+ export declare const validationService: ValidationService;
@@ -40,5 +40,4 @@ class ValidationService {
40
40
  }
41
41
  }
42
42
  exports.ValidationService = ValidationService;
43
- exports.validationService = new ValidationService();
44
- //# sourceMappingURL=ValidationService.js.map
43
+ exports.validationService = new ValidationService();
@@ -1,5 +1,4 @@
1
1
  /**
2
2
  * 验证服务
3
3
  * TODO: 实现规范校验
4
- */
5
- //# sourceMappingURL=Validator.d.ts.map
4
+ */
@@ -2,5 +2,4 @@
2
2
  /**
3
3
  * 验证服务
4
4
  * TODO: 实现规范校验
5
- */
6
- //# sourceMappingURL=Validator.js.map
5
+ */
@@ -49,4 +49,3 @@ export declare class ServiceContainer {
49
49
  static getInstance(): ServiceContainer;
50
50
  }
51
51
  export declare const services: ServiceContainer;
52
- //# sourceMappingURL=index.d.ts.map
@@ -88,4 +88,3 @@ class ServiceContainer {
88
88
  }
89
89
  exports.ServiceContainer = ServiceContainer;
90
90
  exports.services = ServiceContainer.getInstance();
91
- //# sourceMappingURL=index.js.map
@@ -8,5 +8,4 @@ export declare class ExecutionTemplateBuilder extends TemplateBuilderBase {
8
8
  generateTasksTemplate(input: string | FeatureTemplateInput): string;
9
9
  generateVerificationTemplate(input: string | FeatureTemplateInput): string;
10
10
  generateReviewTemplate(input: string | FeatureTemplateInput): string;
11
- }
12
- //# sourceMappingURL=ExecutionTemplateBuilder.d.ts.map
11
+ }
@@ -9,6 +9,8 @@ class ExecutionTemplateBuilder extends TemplateBuilderBase_1.TemplateBuilderBase
9
9
  }
10
10
  generateProposalTemplate(input) {
11
11
  const context = this.inputs.normalizeFeatureTemplateInput(input);
12
+ this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
13
+ try {
12
14
  const created = this.getCurrentDate();
13
15
  const projectDocs = context.projectContext.projectDocs ?? [];
14
16
  const moduleSkills = context.projectContext.moduleSkills ?? [];
@@ -156,30 +158,36 @@ ${this.formatChecklist(context.acceptanceCriteria, 'قيد التحديد')}`;
156
158
  affects: context.affects,
157
159
  flags: context.flags,
158
160
  }, this.copy(context.documentLanguage, zh, en, ja, ar));
161
+ }
162
+ finally {
163
+ this.clearReferenceDocumentContext();
164
+ }
159
165
  }
160
166
  generateTasksTemplate(input) {
161
167
  const context = this.inputs.normalizeFeatureTemplateInput(input);
168
+ this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
169
+ try {
162
170
  const created = this.getCurrentDate();
163
171
  const projectDocs = context.projectContext.projectDocs ?? [];
164
172
  const moduleSkills = context.projectContext.moduleSkills ?? [];
165
173
  const optionalStepTasksZh = context.optionalSteps.length > 0
166
174
  ? context.optionalSteps
167
- .map((step, index) => `- [ ] ${index + 7}. 完成可选步骤 \`${step}\` 的文档和验证`)
175
+ .map((step) => `- [ ] 完成可选步骤 \`${step}\` 的文档和验证`)
168
176
  .join('\n')
169
177
  : '';
170
178
  const optionalStepTasksEn = context.optionalSteps.length > 0
171
179
  ? context.optionalSteps
172
- .map((step, index) => `- [ ] ${index + 7}. Finish docs and verification for optional step \`${step}\``)
180
+ .map((step) => `- [ ] Finish docs and verification for optional step \`${step}\``)
173
181
  .join('\n')
174
182
  : '';
175
183
  const optionalStepTasksJa = context.optionalSteps.length > 0
176
184
  ? context.optionalSteps
177
- .map((step, index) => `- [ ] ${index + 7}. オプション手順 \`${step}\` の文書と検証を完了する`)
185
+ .map((step) => `- [ ] オプション手順 \`${step}\` の文書と検証を完了する`)
178
186
  .join('\n')
179
187
  : '';
180
188
  const optionalStepTasksAr = context.optionalSteps.length > 0
181
189
  ? context.optionalSteps
182
- .map((step, index) => `- [ ] ${index + 7}. أكمل التوثيق والتحقق للخطوة الاختيارية \`${step}\``)
190
+ .map((step) => `- [ ] أكمل التوثيق والتحقق للخطوة الاختيارية \`${step}\``)
183
191
  .join('\n')
184
192
  : '';
185
193
  const zh = `## 上下文引用
@@ -192,12 +200,12 @@ ${this.formatReferenceList(moduleSkills, '待补充')}
192
200
 
193
201
  ## 任务清单
194
202
 
195
- - [ ] 1. 完成实现
196
- - [ ] 2. 对齐项目规划文档与本次 change 的边界
197
- - [ ] 3. 更新涉及模块的 \`SKILL.md\`
198
- - [ ] 4. 更新相关 API / 设计 / 计划文档
199
- - [ ] 5. 重新生成 \`SKILL.index.json\`
200
- - [ ] 6. 执行验证并更新 \`verification.md\`
203
+ - [ ] 完成实现
204
+ - [ ] 对齐项目规划文档与本次 change 的边界
205
+ - [ ] 更新涉及模块的 \`SKILL.md\`
206
+ - [ ] 更新相关 API / 设计 / 计划文档
207
+ - [ ] 重新生成 \`SKILL.index.json\`
208
+ - [ ] 执行验证并更新 \`verification.md\`
201
209
  ${optionalStepTasksZh}`.trim();
202
210
  const en = `## Context References
203
211
 
@@ -209,12 +217,12 @@ ${this.formatReferenceList(moduleSkills, 'TBD')}
209
217
 
210
218
  ## Task Checklist
211
219
 
212
- - [ ] 1. Implement the change
213
- - [ ] 2. Align project planning docs with this change boundary
214
- - [ ] 3. Update affected \`SKILL.md\` files
215
- - [ ] 4. Update related API / design / planning docs
216
- - [ ] 5. Rebuild \`SKILL.index.json\`
217
- - [ ] 6. Run verification and update \`verification.md\`
220
+ - [ ] Implement the change
221
+ - [ ] Align project planning docs with this change boundary
222
+ - [ ] Update affected \`SKILL.md\` files
223
+ - [ ] Update related API / design / planning docs
224
+ - [ ] Rebuild \`SKILL.index.json\`
225
+ - [ ] Run verification and update \`verification.md\`
218
226
  ${optionalStepTasksEn}`.trim();
219
227
  const ja = `## 参照コンテキスト
220
228
 
@@ -226,12 +234,12 @@ ${this.formatReferenceList(moduleSkills, '未定')}
226
234
 
227
235
  ## タスクチェックリスト
228
236
 
229
- - [ ] 1. change を実装する
230
- - [ ] 2. この change の境界に合わせてプロジェクト計画文書を揃える
231
- - [ ] 3. 影響を受ける \`SKILL.md\` を更新する
232
- - [ ] 4. 関連する API / 設計 / 計画文書を更新する
233
- - [ ] 5. \`SKILL.index.json\` を再生成する
234
- - [ ] 6. 検証を実行して \`verification.md\` を更新する
237
+ - [ ] change を実装する
238
+ - [ ] この change の境界に合わせてプロジェクト計画文書を揃える
239
+ - [ ] 影響を受ける \`SKILL.md\` を更新する
240
+ - [ ] 関連する API / 設計 / 計画文書を更新する
241
+ - [ ] \`SKILL.index.json\` を再生成する
242
+ - [ ] 検証を実行して \`verification.md\` を更新する
235
243
  ${optionalStepTasksJa}`.trim();
236
244
  const ar = `## مراجع السياق
237
245
 
@@ -243,21 +251,27 @@ ${this.formatReferenceList(moduleSkills, 'قيد التحديد')}
243
251
 
244
252
  ## قائمة المهام
245
253
 
246
- - [ ] 1. نفّذ التغيير
247
- - [ ] 2. وحّد وثائق تخطيط المشروع مع حدود هذا change
248
- - [ ] 3. حدّث ملفات \`SKILL.md\` المتأثرة
249
- - [ ] 4. حدّث وثائق API / التصميم / التخطيط ذات الصلة
250
- - [ ] 5. أعد بناء \`SKILL.index.json\`
251
- - [ ] 6. نفّذ التحقق وحدّث \`verification.md\`
254
+ - [ ] نفّذ التغيير
255
+ - [ ] وحّد وثائق تخطيط المشروع مع حدود هذا change
256
+ - [ ] حدّث ملفات \`SKILL.md\` المتأثرة
257
+ - [ ] حدّث وثائق API / التصميم / التخطيط ذات الصلة
258
+ - [ ] أعد بناء \`SKILL.index.json\`
259
+ - [ ] نفّذ التحقق وحدّث \`verification.md\`
252
260
  ${optionalStepTasksAr}`.trim();
253
261
  return this.withFrontmatter({
254
262
  feature: context.feature,
255
263
  created,
256
264
  optional_steps: context.optionalSteps,
257
265
  }, this.copy(context.documentLanguage, zh, en, ja, ar));
266
+ }
267
+ finally {
268
+ this.clearReferenceDocumentContext();
269
+ }
258
270
  }
259
271
  generateVerificationTemplate(input) {
260
272
  const context = this.inputs.normalizeFeatureTemplateInput(input);
273
+ this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
274
+ try {
261
275
  const created = this.getCurrentDate();
262
276
  const projectDocs = context.projectContext.projectDocs ?? [];
263
277
  const moduleSkills = context.projectContext.moduleSkills ?? [];
@@ -365,9 +379,15 @@ ${this.formatChecklist(context.acceptanceCriteria, 'معيار قبول 1')}
365
379
  optional_steps: context.optionalSteps,
366
380
  passed_optional_steps: [],
367
381
  }, this.copy(context.documentLanguage, zh, en, ja, ar));
382
+ }
383
+ finally {
384
+ this.clearReferenceDocumentContext();
385
+ }
368
386
  }
369
387
  generateReviewTemplate(input) {
370
388
  const context = this.inputs.normalizeFeatureTemplateInput(input);
389
+ this.setReferenceDocumentContext(context.projectRoot, context.documentPath);
390
+ try {
371
391
  const created = this.getCurrentDate();
372
392
  const projectDocs = context.projectContext.projectDocs ?? [];
373
393
  const moduleSkills = context.projectContext.moduleSkills ?? [];
@@ -520,7 +540,10 @@ ${this.formatReferenceList(linkedKnowledgeDocs, 'قيد التحديد')}
520
540
  created,
521
541
  status: 'pending_review',
522
542
  }, this.copy(context.documentLanguage, zh, en, ja, ar));
543
+ }
544
+ finally {
545
+ this.clearReferenceDocumentContext();
546
+ }
523
547
  }
524
548
  }
525
549
  exports.ExecutionTemplateBuilder = ExecutionTemplateBuilder;
526
- //# sourceMappingURL=ExecutionTemplateBuilder.js.map
@@ -34,5 +34,4 @@ export declare class ProjectTemplateBuilder extends TemplateBuilderBase {
34
34
  private getPresetDesignDocBody;
35
35
  private getPresetPlanningDocBody;
36
36
  private slugify;
37
- }
38
- //# sourceMappingURL=ProjectTemplateBuilder.d.ts.map
37
+ }
@@ -2490,4 +2490,3 @@ ${relatedDocs}`,
2490
2490
  }
2491
2491
  }
2492
2492
  exports.ProjectTemplateBuilder = ProjectTemplateBuilder;
2493
- //# sourceMappingURL=ProjectTemplateBuilder.js.map
@@ -1,6 +1,10 @@
1
1
  import { FeatureProjectReference, TemplateDocumentLanguage } from './templateTypes';
2
2
  type FrontmatterValue = string | number | boolean | string[];
3
3
  export declare abstract class TemplateBuilderBase {
4
+ private referenceProjectRoot?;
5
+ private referenceDocumentPath?;
6
+ protected setReferenceDocumentContext(projectRoot: string | undefined, documentPath: string | undefined): void;
7
+ protected clearReferenceDocumentContext(): void;
4
8
  protected getCurrentDate(): string;
5
9
  protected isEnglish(language: TemplateDocumentLanguage): boolean;
6
10
  protected copy(language: TemplateDocumentLanguage, zh: string, en: string, ja?: string, ar?: string): string;
@@ -13,7 +17,7 @@ export declare abstract class TemplateBuilderBase {
13
17
  protected formatReferenceList(items: FeatureProjectReference[], emptyFallback: string): string;
14
18
  protected formatReferenceChecklist(items: FeatureProjectReference[], emptyFallback: string): string;
15
19
  protected withFrontmatter(fields: Record<string, FrontmatterValue | undefined>, body: string): string;
20
+ private resolveReferenceHref;
16
21
  private toYamlValue;
17
22
  }
18
23
  export {};
19
- //# sourceMappingURL=TemplateBuilderBase.d.ts.map
@@ -1,7 +1,19 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.TemplateBuilderBase = void 0;
7
+ const path_1 = __importDefault(require("path"));
4
8
  class TemplateBuilderBase {
9
+ setReferenceDocumentContext(projectRoot, documentPath) {
10
+ this.referenceProjectRoot = typeof projectRoot === 'string' && projectRoot.trim().length > 0 ? projectRoot : undefined;
11
+ this.referenceDocumentPath = typeof documentPath === 'string' && documentPath.trim().length > 0 ? documentPath : undefined;
12
+ }
13
+ clearReferenceDocumentContext() {
14
+ this.referenceProjectRoot = undefined;
15
+ this.referenceDocumentPath = undefined;
16
+ }
5
17
  getCurrentDate() {
6
18
  return new Date().toISOString().slice(0, 10);
7
19
  }
@@ -40,13 +52,17 @@ class TemplateBuilderBase {
40
52
  if (items.length === 0) {
41
53
  return `- ${emptyFallback}`;
42
54
  }
43
- return items.map(item => `- ${item.title}: \`${item.path}\``).join('\n');
55
+ return items
56
+ .map(item => `- ${item.title}: [${item.path}](${this.resolveReferenceHref(item.path)})`)
57
+ .join('\n');
44
58
  }
45
59
  formatReferenceChecklist(items, emptyFallback) {
46
60
  if (items.length === 0) {
47
61
  return `- [ ] ${emptyFallback}`;
48
62
  }
49
- return items.map(item => `- [ ] ${item.path}`).join('\n');
63
+ return items
64
+ .map(item => `- [ ] ${item.title}: [${item.path}](${this.resolveReferenceHref(item.path)})`)
65
+ .join('\n');
50
66
  }
51
67
  withFrontmatter(fields, body) {
52
68
  const frontmatter = Object.entries(fields)
@@ -55,6 +71,19 @@ class TemplateBuilderBase {
55
71
  .join('\n');
56
72
  return `---\n${frontmatter}\n---\n\n${body.trim()}\n`;
57
73
  }
74
+ resolveReferenceHref(referencePath) {
75
+ const normalizedReferencePath = String(referencePath || '').replace(/\\/g, '/');
76
+ if (!normalizedReferencePath) {
77
+ return normalizedReferencePath;
78
+ }
79
+ if (!this.referenceProjectRoot || !this.referenceDocumentPath) {
80
+ return normalizedReferencePath;
81
+ }
82
+ const targetPath = path_1.default.resolve(this.referenceProjectRoot, normalizedReferencePath);
83
+ const documentDir = path_1.default.dirname(this.referenceDocumentPath);
84
+ const relativePath = path_1.default.relative(documentDir, targetPath).replace(/\\/g, '/');
85
+ return relativePath || '.';
86
+ }
58
87
  toYamlValue(value) {
59
88
  if (Array.isArray(value)) {
60
89
  return `[${value.map(item => JSON.stringify(item)).join(', ')}]`;
@@ -66,4 +95,3 @@ class TemplateBuilderBase {
66
95
  }
67
96
  }
68
97
  exports.TemplateBuilderBase = TemplateBuilderBase;
69
- //# sourceMappingURL=TemplateBuilderBase.js.map
@@ -12,5 +12,4 @@ export declare class TemplateInputFactory {
12
12
  private normalizeDocDisplayName;
13
13
  private buildPlannedFiles;
14
14
  private buildModuleApiPlans;
15
- }
16
- //# sourceMappingURL=TemplateInputFactory.d.ts.map
15
+ }
@@ -20,6 +20,8 @@ class TemplateInputFactory {
20
20
  acceptanceCriteria: [...englishDefaults.acceptanceCriteria],
21
21
  projectContext: this.normalizeFeatureProjectContext(),
22
22
  documentLanguage: 'en-US',
23
+ projectRoot: undefined,
24
+ documentPath: undefined,
23
25
  };
24
26
  }
25
27
  const documentLanguage = this.normalizeDocumentLanguage(input.documentLanguage);
@@ -38,6 +40,8 @@ class TemplateInputFactory {
38
40
  acceptanceCriteria: input.acceptanceCriteria?.map(item => item.trim()).filter(Boolean) ?? [...localizedDefaults.acceptanceCriteria],
39
41
  projectContext: this.normalizeFeatureProjectContext(input.projectContext),
40
42
  documentLanguage,
43
+ projectRoot: typeof input.projectRoot === 'string' && input.projectRoot.trim().length > 0 ? input.projectRoot.trim() : undefined,
44
+ documentPath: typeof input.documentPath === 'string' && input.documentPath.trim().length > 0 ? input.documentPath.trim() : undefined,
41
45
  };
42
46
  if (!input.background?.trim()) {
43
47
  normalized.background = localizedDefaults.background;
@@ -357,4 +361,3 @@ class TemplateInputFactory {
357
361
  }
358
362
  }
359
363
  exports.TemplateInputFactory = TemplateInputFactory;
360
- //# sourceMappingURL=TemplateInputFactory.js.map
@@ -15,6 +15,8 @@ export interface FeatureTemplateInput {
15
15
  acceptanceCriteria?: string[];
16
16
  projectContext?: FeatureProjectContext;
17
17
  documentLanguage?: TemplateDocumentLanguage;
18
+ projectRoot?: string;
19
+ documentPath?: string;
18
20
  }
19
21
  export interface NormalizedFeatureTemplateInput {
20
22
  feature: string;
@@ -30,6 +32,8 @@ export interface NormalizedFeatureTemplateInput {
30
32
  acceptanceCriteria: string[];
31
33
  projectContext: FeatureProjectContext;
32
34
  documentLanguage: TemplateDocumentLanguage;
35
+ projectRoot?: string;
36
+ documentPath?: string;
33
37
  }
34
38
  export interface FeatureProjectReference {
35
39
  title: string;
@@ -87,4 +91,3 @@ export interface NormalizedProjectBootstrapInput {
87
91
  inferredFields: BootstrapFieldKey[];
88
92
  placeholderFields: BootstrapFieldKey[];
89
93
  }
90
- //# sourceMappingURL=templateTypes.d.ts.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=templateTypes.js.map
2
+ Object.defineProperty(exports, "__esModule", { value: true });