@clawplays/ospec-cli 0.3.3 → 0.3.5

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 (35) hide show
  1. package/README.md +12 -1
  2. package/assets/for-ai/ar/ai-guide.md +55 -0
  3. package/assets/for-ai/ar/execution-protocol.md +44 -0
  4. package/assets/for-ai/ja-JP/ai-guide.md +55 -0
  5. package/assets/for-ai/ja-JP/execution-protocol.md +44 -0
  6. package/assets/project-conventions/ar/development-guide.md +31 -0
  7. package/assets/project-conventions/ar/naming-conventions.md +37 -0
  8. package/assets/project-conventions/ar/skill-conventions.md +33 -0
  9. package/assets/project-conventions/ar/workflow-conventions.md +40 -0
  10. package/assets/project-conventions/ja-JP/development-guide.md +31 -0
  11. package/assets/project-conventions/ja-JP/naming-conventions.md +45 -0
  12. package/assets/project-conventions/ja-JP/skill-conventions.md +33 -0
  13. package/assets/project-conventions/ja-JP/workflow-conventions.md +40 -0
  14. package/dist/cli.js +2 -2
  15. package/dist/commands/ArchiveCommand.js +36 -7
  16. package/dist/commands/NewCommand.js +39 -8
  17. package/dist/commands/UpdateCommand.js +109 -3
  18. package/dist/core/types.d.ts +5 -0
  19. package/dist/presets/ProjectPresets.d.ts +2 -2
  20. package/dist/presets/ProjectPresets.js +195 -69
  21. package/dist/services/ConfigManager.js +13 -0
  22. package/dist/services/ProjectAssetRegistry.d.ts +2 -2
  23. package/dist/services/ProjectAssetRegistry.js +12 -0
  24. package/dist/services/ProjectAssetService.js +7 -1
  25. package/dist/services/ProjectScaffoldCommandService.js +55 -21
  26. package/dist/services/ProjectScaffoldService.js +108 -12
  27. package/dist/services/ProjectService.js +504 -643
  28. package/dist/services/RunService.js +52 -6
  29. package/dist/services/templates/ExecutionTemplateBuilder.js +235 -9
  30. package/dist/services/templates/ProjectTemplateBuilder.js +878 -276
  31. package/dist/services/templates/TemplateBuilderBase.d.ts +2 -2
  32. package/dist/services/templates/TemplateBuilderBase.js +12 -3
  33. package/dist/services/templates/TemplateInputFactory.js +102 -47
  34. package/dist/services/templates/templateTypes.d.ts +1 -1
  35. package/package.json +1 -1
@@ -10,8 +10,30 @@ class ProjectTemplateBuilder extends TemplateBuilderBase_1.TemplateBuilderBase {
10
10
  }
11
11
  generateProjectReadmeTemplate(fallbackName, mode, input) {
12
12
  const context = this.getProjectContext(fallbackName, mode, input);
13
- if (this.isEnglish(context.documentLanguage)) {
14
- return `# ${context.projectName}
13
+ return this.copy(context.documentLanguage, `# ${context.projectName}
14
+
15
+ > 由 OSpec CLI 初始化生成
16
+
17
+ ## OSpec Bootstrap
18
+
19
+ 当前仓库已按 \`${mode}\` 模式完成 OSpec 初始化。
20
+
21
+ ## 项目简介
22
+
23
+ ${context.summary}
24
+
25
+ ## 项目知识层
26
+
27
+ - 根技能文档:\`SKILL.md\`
28
+ - 文档中心:\`docs/SKILL.md\`
29
+ - 源码地图:\`src/SKILL.md\`
30
+ - 测试说明:\`tests/SKILL.md\`
31
+ - 语义索引:\`SKILL.index.json\`
32
+
33
+ ## 执行层
34
+
35
+ Active change 位于 \`changes/active/<change>\`。
36
+ `, `# ${context.projectName}
15
37
 
16
38
  > Generated by OSpec CLI
17
39
 
@@ -34,37 +56,87 @@ ${context.summary}
34
56
  ## Execution
35
57
 
36
58
  Active changes live under \`changes/active/<change>\`.
37
- `;
38
- }
39
- return `# ${context.projectName}
59
+ `, `# ${context.projectName}
40
60
 
41
- > OSpec CLI 初始化生成
61
+ > OSpec CLI により生成
42
62
 
43
63
  ## OSpec Bootstrap
44
64
 
45
- 当前仓库已按 \`${mode}\` 模式完成 OSpec 初始化。
65
+ このリポジトリは OSpec の \`${mode}\` モードで初期化されました。
46
66
 
47
- ## 项目简介
67
+ ## 概要
48
68
 
49
69
  ${context.summary}
50
70
 
51
- ## 项目知识层
71
+ ## プロジェクト知識
52
72
 
53
- - 根技能文档:\`SKILL.md\`
54
- - 文档中心:\`docs/SKILL.md\`
55
- - 源码地图:\`src/SKILL.md\`
56
- - 测试说明:\`tests/SKILL.md\`
57
- - 语义索引:\`SKILL.index.json\`
73
+ - ルート SKILL: \`SKILL.md\`
74
+ - docs ハブ: \`docs/SKILL.md\`
75
+ - ソースマップ: \`src/SKILL.md\`
76
+ - テストガイド: \`tests/SKILL.md\`
77
+ - インデックス: \`SKILL.index.json\`
58
78
 
59
- ## 执行层
79
+ ## 実行レイヤー
60
80
 
61
- Active change 位于 \`changes/active/<change>\`。
62
- `;
81
+ active change \`changes/active/<change>\` にあります。
82
+ `, `# ${context.projectName}
83
+
84
+ > تم توليده بواسطة OSpec CLI
85
+
86
+ ## OSpec Bootstrap
87
+
88
+ تمت تهيئة هذا المستودع بواسطة OSpec في وضع \`${mode}\`.
89
+
90
+ ## الملخص
91
+
92
+ ${context.summary}
93
+
94
+ ## معرفة المشروع
95
+
96
+ - ملف SKILL الجذري: \`SKILL.md\`
97
+ - مركز docs: \`docs/SKILL.md\`
98
+ - خريطة المصدر: \`src/SKILL.md\`
99
+ - دليل الاختبارات: \`tests/SKILL.md\`
100
+ - الفهرس: \`SKILL.index.json\`
101
+
102
+ ## طبقة التنفيذ
103
+
104
+ توجد التغييرات النشطة تحت \`changes/active/<change>\` .
105
+ `);
63
106
  }
64
107
  generateRootSkillTemplate(fallbackName, mode, input) {
65
108
  const context = this.getProjectContext(fallbackName, mode, input);
66
- const body = this.isEnglish(context.documentLanguage)
67
- ? `# ${context.projectName}
109
+ const body = this.copy(context.documentLanguage, `# ${context.projectName}
110
+
111
+ > 层级:第 1 层(项目根文档)
112
+
113
+ ## 项目概述
114
+
115
+ - **项目名称**:${context.projectName}
116
+ - **模式**:${mode}
117
+ - **状态**:已完成 OSpec 初始化
118
+ - **简介**:${context.summary}
119
+
120
+ ## 技术栈
121
+
122
+ ${this.formatList(context.techStack, '待补充')}
123
+
124
+ ## 项目架构
125
+
126
+ ${context.architecture}
127
+
128
+ ## 目录导航
129
+
130
+ - 文档中心:[docs/SKILL.md](docs/SKILL.md)
131
+ - 源码地图:[src/SKILL.md](src/SKILL.md)
132
+ - 测试入口:[tests/SKILL.md](tests/SKILL.md)
133
+ - AI 指南:[for-ai/ai-guide.md](for-ai/ai-guide.md)
134
+
135
+ ## 插件阻断
136
+
137
+ - 开始推进 active change 前先读取 \`.skillrc\`。
138
+ - 如果项目启用了 Stitch,且当前 change 激活了 \`stitch_design_review\`,先检查 \`changes/active/<change>/artifacts/stitch/approval.json\`。
139
+ - 当 Stitch 审批缺失或状态不是 \`approved\` 时,视为 change 仍被阻断,先完成设计审核再继续。`, `# ${context.projectName}
68
140
 
69
141
  > Layer: project root
70
142
 
@@ -94,48 +166,89 @@ ${context.architecture}
94
166
 
95
167
  - Read \`.skillrc\` before advancing an active change.
96
168
  - If Stitch is enabled and the current change activates \`stitch_design_review\`, inspect \`changes/active/<change>/artifacts/stitch/approval.json\`.
97
- - When Stitch approval is missing or its status is not \`approved\`, treat the change as blocked until design review is complete.`
98
- : `# ${context.projectName}
169
+ - When Stitch approval is missing or its status is not \`approved\`, treat the change as blocked until design review is complete.`, `# ${context.projectName}
99
170
 
100
- > 层级:第 1 层(项目根文档)
171
+ > レイヤー: プロジェクトルート
101
172
 
102
- ## 项目概述
173
+ ## プロジェクト概要
103
174
 
104
- - **项目名称**:${context.projectName}
105
- - **模式**:${mode}
106
- - **状态**:已完成 OSpec 初始化
107
- - **简介**:${context.summary}
175
+ - **プロジェクト**: ${context.projectName}
176
+ - **モード**: ${mode}
177
+ - **状態**: OSpec により初期化済み
178
+ - **概要**: ${context.summary}
108
179
 
109
- ## 技术栈
180
+ ## 技術スタック
110
181
 
111
- ${this.formatList(context.techStack, '待补充')}
182
+ ${this.formatList(context.techStack, '未定')}
112
183
 
113
- ## 项目架构
184
+ ## アーキテクチャ
114
185
 
115
186
  ${context.architecture}
116
187
 
117
- ## 目录导航
188
+ ## ナビゲーション
118
189
 
119
- - 文档中心:[docs/SKILL.md](docs/SKILL.md)
120
- - 源码地图:[src/SKILL.md](src/SKILL.md)
121
- - 测试入口:[tests/SKILL.md](tests/SKILL.md)
122
- - AI 指南:[for-ai/ai-guide.md](for-ai/ai-guide.md)
190
+ - docs ハブ: [docs/SKILL.md](docs/SKILL.md)
191
+ - ソースマップ: [src/SKILL.md](src/SKILL.md)
192
+ - テストガイド: [tests/SKILL.md](tests/SKILL.md)
193
+ - AI ガイド: [for-ai/ai-guide.md](for-ai/ai-guide.md)
123
194
 
124
- ## 插件阻断
195
+ ## プラグインゲート
125
196
 
126
- - 开始推进 active change 前先读取 \`.skillrc\`。
127
- - 如果项目启用了 Stitch,且当前 change 激活了 \`stitch_design_review\`,先检查 \`changes/active/<change>/artifacts/stitch/approval.json\`。
128
- - Stitch 审批缺失或状态不是 \`approved\` 时,视为 change 仍被阻断,先完成设计审核再继续。`;
197
+ - active change を進める前に \`.skillrc\` を読む。
198
+ - Stitch が有効で、現在の change \`stitch_design_review\` を有効化している場合は \`changes/active/<change>/artifacts/stitch/approval.json\` を確認する。
199
+ - Stitch 承認がない、または状態が \`approved\` でない場合は、デザインレビュー完了まで change をブロックされたものとして扱う。`, `# ${context.projectName}
200
+
201
+ > الطبقة: جذر المشروع
202
+
203
+ ## نظرة عامة على المشروع
204
+
205
+ - **المشروع**: ${context.projectName}
206
+ - **النمط**: ${mode}
207
+ - **الحالة**: تمت تهيئته بواسطة OSpec
208
+ - **الملخص**: ${context.summary}
209
+
210
+ ## المكدس التقني
211
+
212
+ ${this.formatList(context.techStack, 'قيد التحديد')}
213
+
214
+ ## المعمارية
215
+
216
+ ${context.architecture}
217
+
218
+ ## التنقل
219
+
220
+ - مركز docs: [docs/SKILL.md](docs/SKILL.md)
221
+ - خريطة المصدر: [src/SKILL.md](src/SKILL.md)
222
+ - دليل الاختبارات: [tests/SKILL.md](tests/SKILL.md)
223
+ - دليل الذكاء الاصطناعي: [for-ai/ai-guide.md](for-ai/ai-guide.md)
224
+
225
+ ## بوابات الإضافات
226
+
227
+ - اقرأ \`.skillrc\` قبل متابعة أي change نشط.
228
+ - إذا كان Stitch مفعلاً وكان change الحالي يفعّل \`stitch_design_review\`، فافحص \`changes/active/<change>/artifacts/stitch/approval.json\`.
229
+ - عندما تكون موافقة Stitch مفقودة أو لا تكون حالتها \`approved\`، فاعتبر change محجوباً حتى يكتمل مراجعة التصميم.`);
129
230
  return this.withFrontmatter({
130
231
  name: context.projectName,
131
- title: this.copy(context.documentLanguage, context.projectName, `${context.projectName} Project`),
232
+ title: this.copy(context.documentLanguage, context.projectName, `${context.projectName} Project`, `${context.projectName} プロジェクト`, `${context.projectName} المشروع`),
132
233
  tags: ['ospec', 'project', mode],
133
234
  }, body);
134
235
  }
135
236
  generateDocsSkillTemplate(fallbackName, input) {
136
237
  const context = this.getProjectContext(fallbackName, 'standard', input);
137
- const body = this.isEnglish(context.documentLanguage)
138
- ? `# Documentation Hub
238
+ const body = this.copy(context.documentLanguage, `# 文档中心
239
+
240
+ > 层级:第 2 层(项目文档索引)
241
+
242
+ ## 文档导航
243
+
244
+ - 项目概览:[project/overview.md](project/overview.md)
245
+ - 技术栈:[project/tech-stack.md](project/tech-stack.md)
246
+ - 架构说明:[project/architecture.md](project/architecture.md)
247
+ - 模块地图:[project/module-map.md](project/module-map.md)
248
+ - API 总览:[project/api-overview.md](project/api-overview.md)
249
+ - 设计文档目录:[design/README.md](design/README.md)
250
+ - 计划文档目录:[planning/README.md](planning/README.md)
251
+ - API 文档目录:[api/README.md](api/README.md)`, `# Documentation Hub
139
252
 
140
253
  > Layer: docs index
141
254
 
@@ -148,24 +261,36 @@ ${context.architecture}
148
261
  - API overview: [project/api-overview.md](project/api-overview.md)
149
262
  - Design docs: [design/README.md](design/README.md)
150
263
  - Planning docs: [planning/README.md](planning/README.md)
151
- - API docs: [api/README.md](api/README.md)`
152
- : `# 文档中心
264
+ - API docs: [api/README.md](api/README.md)`, `# ドキュメントハブ
153
265
 
154
- > 层级:第 2 层(项目文档索引)
266
+ > レイヤー: docs インデックス
155
267
 
156
- ## 文档导航
268
+ ## ナビゲーション
157
269
 
158
- - 项目概览:[project/overview.md](project/overview.md)
159
- - 技术栈:[project/tech-stack.md](project/tech-stack.md)
160
- - 架构说明:[project/architecture.md](project/architecture.md)
161
- - 模块地图:[project/module-map.md](project/module-map.md)
162
- - API 总览:[project/api-overview.md](project/api-overview.md)
163
- - 设计文档目录:[design/README.md](design/README.md)
164
- - 计划文档目录:[planning/README.md](planning/README.md)
165
- - API 文档目录:[api/README.md](api/README.md)`;
270
+ - プロジェクト概要: [project/overview.md](project/overview.md)
271
+ - 技術スタック: [project/tech-stack.md](project/tech-stack.md)
272
+ - アーキテクチャ: [project/architecture.md](project/architecture.md)
273
+ - モジュールマップ: [project/module-map.md](project/module-map.md)
274
+ - API 概要: [project/api-overview.md](project/api-overview.md)
275
+ - 設計文書: [design/README.md](design/README.md)
276
+ - 計画文書: [planning/README.md](planning/README.md)
277
+ - API 文書: [api/README.md](api/README.md)`, `# مركز الوثائق
278
+
279
+ > الطبقة: فهرس docs
280
+
281
+ ## التنقل
282
+
283
+ - نظرة عامة على المشروع: [project/overview.md](project/overview.md)
284
+ - المكدس التقني: [project/tech-stack.md](project/tech-stack.md)
285
+ - المعمارية: [project/architecture.md](project/architecture.md)
286
+ - خريطة الوحدات: [project/module-map.md](project/module-map.md)
287
+ - نظرة عامة على API: [project/api-overview.md](project/api-overview.md)
288
+ - وثائق التصميم: [design/README.md](design/README.md)
289
+ - وثائق التخطيط: [planning/README.md](planning/README.md)
290
+ - وثائق API: [api/README.md](api/README.md)`);
166
291
  return this.withFrontmatter({
167
292
  name: 'docs',
168
- title: this.copy(context.documentLanguage, `${context.projectName} 文档中心`, `${context.projectName} Docs Hub`),
293
+ title: this.copy(context.documentLanguage, `${context.projectName} 文档中心`, `${context.projectName} Docs Hub`, `${context.projectName} ドキュメントハブ`, `${context.projectName} مركز الوثائق`),
169
294
  tags: ['docs', 'project', 'planning', 'api'],
170
295
  }, body);
171
296
  }
@@ -174,9 +299,19 @@ ${context.architecture}
174
299
  const moduleLinks = this.formatLinkedList(context.modulePlans.map(plan => ({
175
300
  displayName: plan.displayName,
176
301
  path: plan.path.replace(`${constants_1.DIR_NAMES.SRC}/`, ''),
177
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
178
- const body = this.isEnglish(context.documentLanguage)
179
- ? `# Source Map
302
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
303
+ const body = this.copy(context.documentLanguage, `# 源码地图
304
+
305
+ > 层级:第 2 层(源码索引)
306
+
307
+ ## 目录导航
308
+
309
+ - 核心层:[core/SKILL.md](core/SKILL.md)
310
+ - 模块层:\`src/modules/<module>/SKILL.md\`
311
+
312
+ ## 模块说明
313
+
314
+ ${moduleLinks}`, `# Source Map
180
315
 
181
316
  > Layer: source index
182
317
 
@@ -187,29 +322,51 @@ ${context.architecture}
187
322
 
188
323
  ## Modules
189
324
 
190
- ${moduleLinks}`
191
- : `# 源码地图
325
+ ${moduleLinks}`, `# ソースマップ
192
326
 
193
- > 层级:第 2 层(源码索引)
327
+ > レイヤー: ソースインデックス
194
328
 
195
- ## 目录导航
329
+ ## ナビゲーション
196
330
 
197
- - 核心层:[core/SKILL.md](core/SKILL.md)
198
- - 模块层:\`src/modules/<module>/SKILL.md\`
331
+ - コア層: [core/SKILL.md](core/SKILL.md)
332
+ - モジュール層: \`src/modules/<module>/SKILL.md\`
199
333
 
200
- ## 模块说明
334
+ ## モジュール
335
+
336
+ ${moduleLinks}`, `# خريطة المصدر
337
+
338
+ > الطبقة: فهرس المصدر
339
+
340
+ ## التنقل
341
+
342
+ - الطبقة الأساسية: [core/SKILL.md](core/SKILL.md)
343
+ - طبقة الوحدات: \`src/modules/<module>/SKILL.md\`
201
344
 
202
- ${moduleLinks}`;
345
+ ## الوحدات
346
+
347
+ ${moduleLinks}`);
203
348
  return this.withFrontmatter({
204
349
  name: 'src',
205
- title: this.copy(context.documentLanguage, `${context.projectName} 源码地图`, `${context.projectName} Source Map`),
350
+ title: this.copy(context.documentLanguage, `${context.projectName} 源码地图`, `${context.projectName} Source Map`, `${context.projectName} ソースマップ`, `${context.projectName} خريطة المصدر`),
206
351
  tags: ['src', 'modules', 'architecture'],
207
352
  }, body);
208
353
  }
209
354
  generateCoreSkillTemplate(fallbackName, input) {
210
355
  const context = this.getProjectContext(fallbackName, 'standard', input);
211
- const body = this.isEnglish(context.documentLanguage)
212
- ? `# Core Layer
356
+ const body = this.copy(context.documentLanguage, `# Core 核心层
357
+
358
+ > 层级:第 3 层(核心模块)
359
+ > 上层:[src/SKILL.md](../SKILL.md)
360
+
361
+ ## 模块概述
362
+
363
+ - **职责**:承载项目级公共能力
364
+ - **位置**:src/core/
365
+ - **依赖**:待补充
366
+
367
+ ## API 文档
368
+
369
+ - 项目 API 总览:[../../docs/project/api-overview.md](../../docs/project/api-overview.md)`, `# Core Layer
213
370
 
214
371
  > Layer: core module
215
372
  > Parent: [src/SKILL.md](../SKILL.md)
@@ -222,54 +379,89 @@ ${moduleLinks}`;
222
379
 
223
380
  ## API Docs
224
381
 
225
- - Project API overview: [../../docs/project/api-overview.md](../../docs/project/api-overview.md)`
226
- : `# Core 核心层
382
+ - Project API overview: [../../docs/project/api-overview.md](../../docs/project/api-overview.md)`, `# コア層
227
383
 
228
- > 层级:第 3 层(核心模块)
229
- > 上层:[src/SKILL.md](../SKILL.md)
384
+ > レイヤー: コアモジュール
385
+ > 親: [src/SKILL.md](../SKILL.md)
230
386
 
231
- ## 模块概述
387
+ ## モジュール概要
232
388
 
233
- - **职责**:承载项目级公共能力
234
- - **位置**:src/core/
235
- - **依赖**:待补充
389
+ - **役割**: 共通ランタイムおよび基盤機能
390
+ - **パス**: src/core/
391
+ - **依存関係**: 未定
236
392
 
237
- ## API 文档
393
+ ## API 文書
394
+
395
+ - プロジェクト API 概要: [../../docs/project/api-overview.md](../../docs/project/api-overview.md)`, `# الطبقة الأساسية
396
+
397
+ > الطبقة: الوحدة الأساسية
398
+ > الأصل: [src/SKILL.md](../SKILL.md)
399
+
400
+ ## نظرة عامة على الوحدة
401
+
402
+ - **الدور**: القدرات المشتركة للتشغيل والبنية التحتية
403
+ - **المسار**: src/core/
404
+ - **الاعتماديات**: قيد التحديد
238
405
 
239
- - 项目 API 总览:[../../docs/project/api-overview.md](../../docs/project/api-overview.md)`;
406
+ ## وثائق API
407
+
408
+ - نظرة عامة على API للمشروع: [../../docs/project/api-overview.md](../../docs/project/api-overview.md)`);
240
409
  return this.withFrontmatter({
241
410
  name: 'core',
242
- title: this.copy(context.documentLanguage, `${context.projectName} 核心层`, `${context.projectName} Core Layer`),
411
+ title: this.copy(context.documentLanguage, `${context.projectName} 核心层`, `${context.projectName} Core Layer`, `${context.projectName} コア層`, `${context.projectName} الطبقة الأساسية`),
243
412
  tags: ['core', 'runtime', 'infrastructure'],
244
413
  }, body);
245
414
  }
246
415
  generateTestsSkillTemplate(fallbackName, input) {
247
416
  const context = this.getProjectContext(fallbackName, 'standard', input);
248
- const body = this.isEnglish(context.documentLanguage)
249
- ? `# Test Guide
417
+ const body = this.copy(context.documentLanguage, `# 测试说明
418
+
419
+ ## 测试策略
420
+
421
+ - 单元测试:待补充
422
+ - 集成测试:待补充
423
+ - 端到端测试:待补充`, `# Test Guide
250
424
 
251
425
  ## Test Strategy
252
426
 
253
427
  - Unit tests: TBD
254
428
  - Integration tests: TBD
255
- - End-to-end tests: TBD`
256
- : `# 测试说明
429
+ - End-to-end tests: TBD`, `# テストガイド
257
430
 
258
- ## 测试策略
431
+ ## テスト戦略
259
432
 
260
- - 单元测试:待补充
261
- - 集成测试:待补充
262
- - 端到端测试:待补充`;
433
+ - 単体テスト: 未定
434
+ - 統合テスト: 未定
435
+ - エンドツーエンドテスト: 未定`, `# دليل الاختبارات
436
+
437
+ ## استراتيجية الاختبار
438
+
439
+ - اختبارات الوحدة: قيد التحديد
440
+ - اختبارات التكامل: قيد التحديد
441
+ - اختبارات طرف إلى طرف: قيد التحديد`);
263
442
  return this.withFrontmatter({
264
443
  name: 'tests',
265
- title: this.copy(context.documentLanguage, `${context.projectName} 测试说明`, `${context.projectName} Test Guide`),
444
+ title: this.copy(context.documentLanguage, `${context.projectName} 测试说明`, `${context.projectName} Test Guide`, `${context.projectName} テストガイド`, `${context.projectName} دليل الاختبارات`),
266
445
  tags: ['tests', 'quality', 'verification'],
267
446
  }, body);
268
447
  }
269
448
  generateProjectOverviewTemplate(fallbackName, mode, input) {
270
449
  const context = this.getProjectContext(fallbackName, mode, input);
271
- const body = this.isEnglish(context.documentLanguage)
272
- ? `# Project Overview
450
+ const body = this.copy(context.documentLanguage, `# 项目概览
451
+
452
+ ## 背景
453
+
454
+ \`${context.projectName}\` 已通过 OSpec CLI 初始化,当前模式为 \`${mode}\`。
455
+
456
+ ## 项目简介
457
+
458
+ ${context.summary}
459
+
460
+ ## 当前目标
461
+
462
+ - 保持项目知识文档与仓库真实状态一致
463
+ - 建立分层 SKILL 体系
464
+ - 使用 change workflow 管理需求交付`, `# Project Overview
273
465
 
274
466
  ## Background
275
467
 
@@ -283,32 +475,52 @@ ${context.summary}
283
475
 
284
476
  - Keep the project knowledge docs aligned with the real repository state
285
477
  - Establish layered skill files
286
- - Manage delivery through the change workflow`
287
- : `# 项目概览
478
+ - Manage delivery through the change workflow`, `# プロジェクト概要
288
479
 
289
480
  ## 背景
290
481
 
291
- \`${context.projectName}\` 已通过 OSpec CLI 初始化,当前模式为 \`${mode}\`。
482
+ \`${context.projectName}\` OSpec CLI により \`${mode}\` モードで初期化されました。
292
483
 
293
- ## 项目简介
484
+ ## 概要
294
485
 
295
486
  ${context.summary}
296
487
 
297
- ## 当前目标
488
+ ## 現在の目標
298
489
 
299
- - 保持项目知识文档与仓库真实状态一致
300
- - 建立分层 SKILL 体系
301
- - 使用 change workflow 管理需求交付`;
490
+ - プロジェクト知識文書を実際のリポジトリ状態と一致させる
491
+ - レイヤー化された SKILL を整備する
492
+ - change workflow で要件の実行を管理する`, `# نظرة عامة على المشروع
493
+
494
+ ## الخلفية
495
+
496
+ تمت تهيئة \`${context.projectName}\` بواسطة OSpec CLI في وضع \`${mode}\`.
497
+
498
+ ## الملخص
499
+
500
+ ${context.summary}
501
+
502
+ ## الأهداف الحالية
503
+
504
+ - إبقاء وثائق معرفة المشروع متوافقة مع الحالة الفعلية للمستودع
505
+ - تأسيس ملفات SKILL متعددة الطبقات
506
+ - إدارة التسليم عبر change workflow`);
302
507
  return this.withFrontmatter({
303
508
  name: 'project-overview',
304
- title: this.copy(context.documentLanguage, `${context.projectName} 项目概览`, `${context.projectName} Project Overview`),
509
+ title: this.copy(context.documentLanguage, `${context.projectName} 项目概览`, `${context.projectName} Project Overview`, `${context.projectName} プロジェクト概要`, `${context.projectName} نظرة عامة على المشروع`),
305
510
  tags: ['project', 'overview', 'bootstrap'],
306
511
  }, body);
307
512
  }
308
513
  generateTechStackTemplate(fallbackName, input) {
309
514
  const context = this.getProjectContext(fallbackName, 'standard', input);
310
- const body = this.isEnglish(context.documentLanguage)
311
- ? `# Tech Stack
515
+ const body = this.copy(context.documentLanguage, `# 技术栈
516
+
517
+ ## 项目
518
+
519
+ - **项目名称**:${context.projectName}
520
+
521
+ ## 技术栈清单
522
+
523
+ ${this.formatList(context.techStack, '待补充')}`, `# Tech Stack
312
524
 
313
525
  ## Project
314
526
 
@@ -316,26 +528,46 @@ ${context.summary}
316
528
 
317
529
  ## Stack List
318
530
 
319
- ${this.formatList(context.techStack, 'TBD')}`
320
- : `# 技术栈
531
+ ${this.formatList(context.techStack, 'TBD')}`, `# 技術スタック
321
532
 
322
- ## 项目
533
+ ## プロジェクト
323
534
 
324
- - **项目名称**:${context.projectName}
535
+ - **プロジェクト**: ${context.projectName}
325
536
 
326
- ## 技术栈清单
537
+ ## スタック一覧
538
+
539
+ ${this.formatList(context.techStack, '未定')}`, `# المكدس التقني
540
+
541
+ ## المشروع
542
+
543
+ - **المشروع**: ${context.projectName}
544
+
545
+ ## قائمة المكدس
327
546
 
328
- ${this.formatList(context.techStack, '待补充')}`;
547
+ ${this.formatList(context.techStack, 'قيد التحديد')}`);
329
548
  return this.withFrontmatter({
330
549
  name: 'tech-stack',
331
- title: this.copy(context.documentLanguage, `${context.projectName} 技术栈`, `${context.projectName} Tech Stack`),
550
+ title: this.copy(context.documentLanguage, `${context.projectName} 技术栈`, `${context.projectName} Tech Stack`, `${context.projectName} 技術スタック`, `${context.projectName} المكدس التقني`),
332
551
  tags: ['project', 'tech-stack', 'architecture'],
333
552
  }, body);
334
553
  }
335
554
  generateArchitectureTemplate(fallbackName, input) {
336
555
  const context = this.getProjectContext(fallbackName, 'standard', input);
337
- const body = this.isEnglish(context.documentLanguage)
338
- ? `# Architecture
556
+ const body = this.copy(context.documentLanguage, `# 架构说明
557
+
558
+ ## 整体架构
559
+
560
+ - **项目**:${context.projectName}
561
+ - **当前阶段**:已建立 OSpec 项目知识骨架
562
+
563
+ ${context.architecture}
564
+
565
+ ## 分层说明
566
+
567
+ - Project Knowledge
568
+ - Layered Skills
569
+ - Execution
570
+ - GUI`, `# Architecture
339
571
 
340
572
  ## System Architecture
341
573
 
@@ -349,25 +581,38 @@ ${context.architecture}
349
581
  - Project Knowledge
350
582
  - Layered Skills
351
583
  - Execution
352
- - GUI`
353
- : `# 架构说明
584
+ - GUI`, `# アーキテクチャ
354
585
 
355
- ## 整体架构
586
+ ## システムアーキテクチャ
356
587
 
357
- - **项目**:${context.projectName}
358
- - **当前阶段**:已建立 OSpec 项目知识骨架
588
+ - **プロジェクト**: ${context.projectName}
589
+ - **現在の段階**: OSpec の知識骨格を初期化済み
359
590
 
360
591
  ${context.architecture}
361
592
 
362
- ## 分层说明
593
+ ## レイヤー
363
594
 
364
595
  - Project Knowledge
365
596
  - Layered Skills
366
597
  - Execution
367
- - GUI`;
598
+ - GUI`, `# المعمارية
599
+
600
+ ## معمارية النظام
601
+
602
+ - **المشروع**: ${context.projectName}
603
+ - **المرحلة الحالية**: تم تهيئة هيكل معرفة OSpec
604
+
605
+ ${context.architecture}
606
+
607
+ ## الطبقات
608
+
609
+ - Project Knowledge
610
+ - Layered Skills
611
+ - Execution
612
+ - GUI`);
368
613
  return this.withFrontmatter({
369
614
  name: 'architecture',
370
- title: this.copy(context.documentLanguage, `${context.projectName} 架构说明`, `${context.projectName} Architecture`),
615
+ title: this.copy(context.documentLanguage, `${context.projectName} 架构说明`, `${context.projectName} Architecture`, `${context.projectName} アーキテクチャ`, `${context.projectName} المعمارية`),
371
616
  tags: ['project', 'architecture', 'layers'],
372
617
  }, body);
373
618
  }
@@ -376,9 +621,16 @@ ${context.architecture}
376
621
  const modules = this.formatLinkedList(context.modulePlans.map(plan => ({
377
622
  displayName: plan.displayName,
378
623
  path: plan.path,
379
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
380
- const body = this.isEnglish(context.documentLanguage)
381
- ? `# Module Map
624
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
625
+ const body = this.copy(context.documentLanguage, `# 模块地图
626
+
627
+ ## 项目
628
+
629
+ - **项目名称**:${context.projectName}
630
+
631
+ ## 模块列表
632
+
633
+ ${modules}`, `# Module Map
382
634
 
383
635
  ## Project
384
636
 
@@ -386,19 +638,26 @@ ${context.architecture}
386
638
 
387
639
  ## Modules
388
640
 
389
- ${modules}`
390
- : `# 模块地图
641
+ ${modules}`, `# モジュールマップ
391
642
 
392
- ## 项目
643
+ ## プロジェクト
393
644
 
394
- - **项目名称**:${context.projectName}
645
+ - **プロジェクト**: ${context.projectName}
395
646
 
396
- ## 模块列表
647
+ ## モジュール
648
+
649
+ ${modules}`, `# خريطة الوحدات
397
650
 
398
- ${modules}`;
651
+ ## المشروع
652
+
653
+ - **المشروع**: ${context.projectName}
654
+
655
+ ## الوحدات
656
+
657
+ ${modules}`);
399
658
  return this.withFrontmatter({
400
659
  name: 'module-map',
401
- title: this.copy(context.documentLanguage, `${context.projectName} 模块地图`, `${context.projectName} Module Map`),
660
+ title: this.copy(context.documentLanguage, `${context.projectName} 模块地图`, `${context.projectName} Module Map`, `${context.projectName} モジュールマップ`, `${context.projectName} خريطة الوحدات`),
402
661
  tags: ['project', 'modules', 'map'],
403
662
  }, body);
404
663
  }
@@ -407,13 +666,24 @@ ${modules}`;
407
666
  const apiAreas = this.formatLinkedList(context.apiAreaPlans.map(plan => ({
408
667
  displayName: plan.displayName,
409
668
  path: plan.path,
410
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
669
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
411
670
  const moduleApis = this.formatLinkedList(context.moduleApiPlans.map(plan => ({
412
671
  displayName: plan.displayName,
413
672
  path: plan.path,
414
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
415
- const body = this.isEnglish(context.documentLanguage)
416
- ? `# API Overview
673
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
674
+ const body = this.copy(context.documentLanguage, `# API 总览
675
+
676
+ ## 项目
677
+
678
+ - **项目名称**:${context.projectName}
679
+
680
+ ## API 边界
681
+
682
+ ${apiAreas}
683
+
684
+ ## 模块 API 文档
685
+
686
+ ${moduleApis}`, `# API Overview
417
687
 
418
688
  ## Project
419
689
 
@@ -425,23 +695,34 @@ ${apiAreas}
425
695
 
426
696
  ## Module API Docs
427
697
 
428
- ${moduleApis}`
429
- : `# API 总览
698
+ ${moduleApis}`, `# API 概要
430
699
 
431
- ## 项目
700
+ ## プロジェクト
432
701
 
433
- - **项目名称**:${context.projectName}
702
+ - **プロジェクト**: ${context.projectName}
434
703
 
435
- ## API 边界
704
+ ## API 領域
436
705
 
437
706
  ${apiAreas}
438
707
 
439
- ## 模块 API 文档
708
+ ## モジュール API 文書
709
+
710
+ ${moduleApis}`, `# نظرة عامة على API
440
711
 
441
- ${moduleApis}`;
712
+ ## المشروع
713
+
714
+ - **المشروع**: ${context.projectName}
715
+
716
+ ## نطاقات API
717
+
718
+ ${apiAreas}
719
+
720
+ ## وثائق API للوحدات
721
+
722
+ ${moduleApis}`);
442
723
  return this.withFrontmatter({
443
724
  name: 'api-overview',
444
- title: this.copy(context.documentLanguage, `${context.projectName} API 总览`, `${context.projectName} API Overview`),
725
+ title: this.copy(context.documentLanguage, `${context.projectName} API 总览`, `${context.projectName} API Overview`, `${context.projectName} API 概要`, `${context.projectName} نظرة عامة على API`),
445
726
  tags: ['project', 'api', 'overview'],
446
727
  }, body);
447
728
  }
@@ -450,29 +731,43 @@ ${moduleApis}`;
450
731
  const designDocs = this.formatLinkedList(context.designDocPlans.map(plan => ({
451
732
  displayName: plan.displayName,
452
733
  path: plan.path,
453
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
454
- const body = this.isEnglish(context.documentLanguage)
455
- ? `# Design Docs
734
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
735
+ const body = this.copy(context.documentLanguage, `# 设计文档规划
736
+
737
+ ## 项目
738
+
739
+ - **项目名称**:${context.projectName}
740
+
741
+ ## 需要沉淀的设计文档
742
+
743
+ ${designDocs}`, `# Design Docs
456
744
 
457
745
  ## Project
458
746
 
459
747
  - **Project**: ${context.projectName}
460
748
 
461
- ## Planned Design Docs
749
+ ## Planned Design Docs
750
+
751
+ ${designDocs}`, `# 設計文書
752
+
753
+ ## プロジェクト
754
+
755
+ - **プロジェクト**: ${context.projectName}
756
+
757
+ ## 計画中の設計文書
462
758
 
463
- ${designDocs}`
464
- : `# 设计文档规划
759
+ ${designDocs}`, `# وثائق التصميم
465
760
 
466
- ## 项目
761
+ ## المشروع
467
762
 
468
- - **项目名称**:${context.projectName}
763
+ - **المشروع**: ${context.projectName}
469
764
 
470
- ## 需要沉淀的设计文档
765
+ ## وثائق التصميم المخطط لها
471
766
 
472
- ${designDocs}`;
767
+ ${designDocs}`);
473
768
  return this.withFrontmatter({
474
769
  name: 'design-docs',
475
- title: this.copy(context.documentLanguage, `${context.projectName} 设计文档`, `${context.projectName} Design Docs`),
770
+ title: this.copy(context.documentLanguage, `${context.projectName} 设计文档`, `${context.projectName} Design Docs`, `${context.projectName} 設計文書`, `${context.projectName} وثائق التصميم`),
476
771
  tags: ['docs', 'design', 'planning'],
477
772
  }, body);
478
773
  }
@@ -481,9 +776,16 @@ ${designDocs}`;
481
776
  const planningDocs = this.formatLinkedList(context.planningDocPlans.map(plan => ({
482
777
  displayName: plan.displayName,
483
778
  path: plan.path,
484
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
485
- const body = this.isEnglish(context.documentLanguage)
486
- ? `# Planning Docs
779
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
780
+ const body = this.copy(context.documentLanguage, `# 开发计划文档
781
+
782
+ ## 项目
783
+
784
+ - **项目名称**:${context.projectName}
785
+
786
+ ## 计划文档需求
787
+
788
+ ${planningDocs}`, `# Planning Docs
487
789
 
488
790
  ## Project
489
791
 
@@ -491,19 +793,26 @@ ${designDocs}`;
491
793
 
492
794
  ## Planning Documents
493
795
 
494
- ${planningDocs}`
495
- : `# 开发计划文档
796
+ ${planningDocs}`, `# 計画文書
496
797
 
497
- ## 项目
798
+ ## プロジェクト
498
799
 
499
- - **项目名称**:${context.projectName}
800
+ - **プロジェクト**: ${context.projectName}
500
801
 
501
- ## 计划文档需求
802
+ ## 計画文書
803
+
804
+ ${planningDocs}`, `# وثائق التخطيط
805
+
806
+ ## المشروع
502
807
 
503
- ${planningDocs}`;
808
+ - **المشروع**: ${context.projectName}
809
+
810
+ ## وثائق التخطيط
811
+
812
+ ${planningDocs}`);
504
813
  return this.withFrontmatter({
505
814
  name: 'planning-docs',
506
- title: this.copy(context.documentLanguage, `${context.projectName} 计划文档`, `${context.projectName} Planning Docs`),
815
+ title: this.copy(context.documentLanguage, `${context.projectName} 计划文档`, `${context.projectName} Planning Docs`, `${context.projectName} 計画文書`, `${context.projectName} وثائق التخطيط`),
507
816
  tags: ['docs', 'planning', 'milestone'],
508
817
  }, body);
509
818
  }
@@ -512,9 +821,16 @@ ${planningDocs}`;
512
821
  const apiDocs = this.formatLinkedList(context.apiAreaPlans.map(plan => ({
513
822
  displayName: plan.displayName,
514
823
  path: plan.path,
515
- })), this.copy(context.documentLanguage, '待补充', 'TBD'));
516
- const body = this.isEnglish(context.documentLanguage)
517
- ? `# API Docs Directory
824
+ })), this.copy(context.documentLanguage, '待补充', 'TBD', '未定', 'قيد التحديد'));
825
+ const body = this.copy(context.documentLanguage, `# API 文档目录说明
826
+
827
+ ## 项目
828
+
829
+ - **项目名称**:${context.projectName}
830
+
831
+ ## API 文档规划
832
+
833
+ ${apiDocs}`, `# API Docs Directory
518
834
 
519
835
  ## Project
520
836
 
@@ -522,19 +838,26 @@ ${planningDocs}`;
522
838
 
523
839
  ## Planned API Docs
524
840
 
525
- ${apiDocs}`
526
- : `# API 文档目录说明
841
+ ${apiDocs}`, `# API 文書ディレクトリ
527
842
 
528
- ## 项目
843
+ ## プロジェクト
529
844
 
530
- - **项目名称**:${context.projectName}
845
+ - **プロジェクト**: ${context.projectName}
531
846
 
532
- ## API 文档规划
847
+ ## 計画中の API 文書
848
+
849
+ ${apiDocs}`, `# دليل وثائق API
850
+
851
+ ## المشروع
852
+
853
+ - **المشروع**: ${context.projectName}
854
+
855
+ ## وثائق API المخطط لها
533
856
 
534
- ${apiDocs}`;
857
+ ${apiDocs}`);
535
858
  return this.withFrontmatter({
536
859
  name: 'api-docs',
537
- title: this.copy(context.documentLanguage, `${context.projectName} API 文档`, `${context.projectName} API Docs`),
860
+ title: this.copy(context.documentLanguage, `${context.projectName} API 文档`, `${context.projectName} API Docs`, `${context.projectName} API 文書`, `${context.projectName} وثائق API`),
538
861
  tags: ['docs', 'api', 'reference'],
539
862
  }, body);
540
863
  }
@@ -552,8 +875,44 @@ ${apiDocs}`;
552
875
  ...matchedApiDocs.map(plan => ({ title: plan.displayName, path: plan.path })),
553
876
  ];
554
877
  const presetBody = this.getPresetModuleSkillBody(context, moduleName, slug, refs);
555
- const body = presetBody ?? (this.isEnglish(context.documentLanguage)
556
- ? `# ${moduleName}
878
+ const body = presetBody ?? this.copy(context.documentLanguage, `# ${moduleName} 模块
879
+
880
+ > 层级:第 3 层(业务模块文档)
881
+ > 上层:[src/SKILL.md](../../SKILL.md)
882
+
883
+ ## 模块概述
884
+
885
+ - **项目**:${context.projectName}
886
+ - **模块名**:${moduleName}
887
+ - **路径**:src/modules/${slug}
888
+
889
+ ## 主要职责
890
+
891
+ - 承载 ${moduleName} 相关业务能力
892
+ - 衔接项目级设计与当前模块实现
893
+ - 维护模块边界、依赖与测试要求
894
+
895
+ ## API 文档
896
+
897
+ ${this.formatReferenceList(refs, '待补充')}
898
+
899
+ ## 依赖关系
900
+
901
+ - 上游依赖:\`src/core/\`、项目级配置、共享基础设施
902
+ - 同层协作:与其他 \`src/modules/*\` 保持清晰边界,通过文档和接口约定协作
903
+ - 下游影响:实现变更后需回看关联 API 文档、执行层 change 文档和测试说明
904
+
905
+ ## 测试要求
906
+
907
+ - 单元测试:覆盖 ${moduleName} 模块核心业务规则和边界分支
908
+ - 集成测试:覆盖该模块与 API / 数据层 / 外部服务的集成路径
909
+ - 回归验证:当模块接口或行为变化时,同步更新 change 验证与相关文档
910
+
911
+ ## 关联文档
912
+
913
+ - 项目模块地图:[../../../docs/project/module-map.md](../../../docs/project/module-map.md)
914
+ - API 总览:[../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)
915
+ - 模块源码入口:当前目录`, `# ${moduleName}
557
916
 
558
917
  > Layer: module document
559
918
  > Parent: [src/SKILL.md](../../SKILL.md)
@@ -589,56 +948,105 @@ ${this.formatReferenceList(refs, 'TBD')}
589
948
  ## Related Docs
590
949
 
591
950
  - Module map: [../../../docs/project/module-map.md](../../../docs/project/module-map.md)
592
- - API overview: [../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)`
593
- : `# ${moduleName} 模块
951
+ - API overview: [../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)`, `# ${moduleName} モジュール
594
952
 
595
- > 层级:第 3 层(业务模块文档)
596
- > 上层:[src/SKILL.md](../../SKILL.md)
953
+ > レイヤー: モジュール文書
954
+ > 親: [src/SKILL.md](../../SKILL.md)
597
955
 
598
- ## 模块概述
956
+ ## モジュール概要
599
957
 
600
- - **项目**:${context.projectName}
601
- - **模块名**:${moduleName}
602
- - **路径**:src/modules/${slug}
958
+ - **プロジェクト**: ${context.projectName}
959
+ - **モジュール**: ${moduleName}
960
+ - **パス**: src/modules/${slug}
603
961
 
604
- ## 主要职责
962
+ ## 責務
605
963
 
606
- - 承载 ${moduleName} 相关业务能力
607
- - 衔接项目级设计与当前模块实现
608
- - 维护模块边界、依赖与测试要求
964
+ - ${moduleName} ドメインの振る舞いを担う
965
+ - このモジュールでプロジェクト設計と実装を接続する
966
+ - モジュール境界、依存関係、テスト要件を維持する
609
967
 
610
- ## API 文档
968
+ ## API 文書
611
969
 
612
- ${this.formatReferenceList(refs, '待补充')}
970
+ ${this.formatReferenceList(refs, '未定')}
613
971
 
614
- ## 依赖关系
972
+ ## 依存関係
615
973
 
616
- - 上游依赖:\`src/core/\`、项目级配置、共享基础设施
617
- - 同层协作:与其他 \`src/modules/*\` 保持清晰边界,通过文档和接口约定协作
618
- - 下游影响:实现变更后需回看关联 API 文档、执行层 change 文档和测试说明
974
+ - 上流: \`src/core/\`、プロジェクト設定、共有基盤
975
+ - 同列協調: 他の \`src/modules/*\` と明確な境界を保つ
976
+ - 下流影響: 振る舞い変更時は API 文書、change 文書、テストを更新する
619
977
 
620
- ## 测试要求
978
+ ## テスト要件
621
979
 
622
- - 单元测试:覆盖 ${moduleName} 模块核心业务规则和边界分支
623
- - 集成测试:覆盖该模块与 API / 数据层 / 外部服务的集成路径
624
- - 回归验证:当模块接口或行为变化时,同步更新 change 验证与相关文档
980
+ - 単体テスト: 主要な業務ルールと境界条件をカバーする
981
+ - 統合テスト: API、データ、サービスとの連携をカバーする
982
+ - リグレッション確認: インターフェース変更時に change 検証を同期する
625
983
 
626
- ## 关联文档
984
+ ## 関連文書
627
985
 
628
- - 项目模块地图:[../../../docs/project/module-map.md](../../../docs/project/module-map.md)
629
- - API 总览:[../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)
630
- - 模块源码入口:当前目录`);
986
+ - モジュールマップ: [../../../docs/project/module-map.md](../../../docs/project/module-map.md)
987
+ - API 概要: [../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)`, `# وحدة ${moduleName}
988
+
989
+ > الطبقة: وثيقة الوحدة
990
+ > الأصل: [src/SKILL.md](../../SKILL.md)
991
+
992
+ ## نظرة عامة على الوحدة
993
+
994
+ - **المشروع**: ${context.projectName}
995
+ - **الوحدة**: ${moduleName}
996
+ - **المسار**: src/modules/${slug}
997
+
998
+ ## المسؤوليات
999
+
1000
+ - امتلاك سلوك نطاق ${moduleName}
1001
+ - ربط تصميم المشروع بالتنفيذ داخل هذه الوحدة
1002
+ - الحفاظ على حدود الوحدة واعتمادياتها واختباراتها
1003
+
1004
+ ## وثائق API
1005
+
1006
+ ${this.formatReferenceList(refs, 'قيد التحديد')}
1007
+
1008
+ ## الاعتماديات
1009
+
1010
+ - المنبع: \`src/core/\` وإعدادات المشروع والبنية المشتركة
1011
+ - التعاون الموازي: الحفاظ على حدود واضحة مع \`src/modules/*\` الأخرى
1012
+ - الأثر اللاحق: حدّث وثائق API ووثائق change والاختبارات عند تغيّر السلوك
1013
+
1014
+ ## متطلبات الاختبار
1015
+
1016
+ - اختبارات الوحدة: تغطي القواعد الأساسية والحالات الحدّية
1017
+ - اختبارات التكامل: تغطي تفاعل الوحدة مع API والبيانات والخدمات
1018
+ - فحوص الارتداد: وافق التحقق مع change عند تغيّر الواجهات
1019
+
1020
+ ## وثائق ذات صلة
1021
+
1022
+ - خريطة الوحدات: [../../../docs/project/module-map.md](../../../docs/project/module-map.md)
1023
+ - نظرة عامة على API: [../../../docs/project/api-overview.md](../../../docs/project/api-overview.md)`);
631
1024
  return this.withFrontmatter({
632
1025
  name: slug,
633
- title: this.copy(context.documentLanguage, `${context.projectName} ${moduleName} 模块`, `${context.projectName} ${moduleName} Module`),
1026
+ title: this.copy(context.documentLanguage, `${context.projectName} ${moduleName} 模块`, `${context.projectName} ${moduleName} Module`, `${context.projectName} ${moduleName} モジュール`, `${context.projectName} وحدة ${moduleName}`),
634
1027
  tags: ['module', slug, 'domain'],
635
1028
  }, body);
636
1029
  }
637
1030
  generateApiAreaDocTemplate(fallbackName, apiAreaName, input) {
638
1031
  const context = this.getProjectContext(fallbackName, 'standard', input);
639
1032
  const presetBody = this.getPresetApiAreaDocBody(context, apiAreaName);
640
- const body = presetBody ?? (this.isEnglish(context.documentLanguage)
641
- ? `# ${apiAreaName}
1033
+ const body = presetBody ?? this.copy(context.documentLanguage, `# ${apiAreaName}
1034
+
1035
+ ## 项目
1036
+
1037
+ - **项目名称**:${context.projectName}
1038
+
1039
+ ## 边界说明
1040
+
1041
+ - 负责 ${apiAreaName} 相关接口能力
1042
+ - 待补充请求入口、鉴权规则、错误码和数据模型
1043
+
1044
+ ## 待补充清单
1045
+
1046
+ - [ ] 路由列表
1047
+ - [ ] 请求/响应结构
1048
+ - [ ] 权限与安全要求
1049
+ - [ ] 测试与验收要求`, `# ${apiAreaName}
642
1050
 
643
1051
  ## Project
644
1052
 
@@ -654,27 +1062,42 @@ ${this.formatReferenceList(refs, '待补充')}
654
1062
  - [ ] Routes
655
1063
  - [ ] Request / response payloads
656
1064
  - [ ] Permissions and security rules
657
- - [ ] Tests and acceptance requirements`
658
- : `# ${apiAreaName}
1065
+ - [ ] Tests and acceptance requirements`, `# ${apiAreaName}
659
1066
 
660
- ## 项目
1067
+ ## プロジェクト
661
1068
 
662
- - **项目名称**:${context.projectName}
1069
+ - **プロジェクト**: ${context.projectName}
663
1070
 
664
- ## 边界说明
1071
+ ## 境界
665
1072
 
666
- - 负责 ${apiAreaName} 相关接口能力
667
- - 待补充请求入口、鉴权规则、错误码和数据模型
1073
+ - ${apiAreaName} のインターフェースと契約を担当する
1074
+ - エントリポイント、認証ルール、エラーコード、データモデルを文書化する
668
1075
 
669
- ## 待补充清单
1076
+ ## チェックリスト
670
1077
 
671
- - [ ] 路由列表
672
- - [ ] 请求/响应结构
673
- - [ ] 权限与安全要求
674
- - [ ] 测试与验收要求`);
1078
+ - [ ] ルート
1079
+ - [ ] リクエスト / レスポンス
1080
+ - [ ] 権限とセキュリティルール
1081
+ - [ ] テストと受け入れ要件`, `# ${apiAreaName}
1082
+
1083
+ ## المشروع
1084
+
1085
+ - **المشروع**: ${context.projectName}
1086
+
1087
+ ## الحدود
1088
+
1089
+ - امتلاك واجهات وعقود ${apiAreaName}
1090
+ - توثيق نقاط الدخول وقواعد المصادقة ورموز الأخطاء ونماذج البيانات
1091
+
1092
+ ## قائمة التحقق
1093
+
1094
+ - [ ] المسارات
1095
+ - [ ] هياكل الطلب / الاستجابة
1096
+ - [ ] قواعد الأذونات والأمان
1097
+ - [ ] متطلبات الاختبار والقبول`);
675
1098
  return this.withFrontmatter({
676
1099
  name: this.slugify(apiAreaName) || 'api-area',
677
- title: this.copy(context.documentLanguage, `${apiAreaName} API 文档`, `${apiAreaName} API Doc`),
1100
+ title: this.copy(context.documentLanguage, `${apiAreaName} API 文档`, `${apiAreaName} API Doc`, `${apiAreaName} API 文書`, `وثيقة ${apiAreaName} API`),
678
1101
  tags: ['api', 'reference', 'module'],
679
1102
  }, body);
680
1103
  }
@@ -682,8 +1105,29 @@ ${this.formatReferenceList(refs, '待补充')}
682
1105
  const context = this.getProjectContext(fallbackName, 'standard', input);
683
1106
  const slug = moduleSlug || this.slugify(moduleName) || 'module';
684
1107
  const presetBody = this.getPresetModuleApiDocBody(context, moduleName, slug);
685
- const body = presetBody ?? (this.isEnglish(context.documentLanguage)
686
- ? `# ${moduleName} Module API
1108
+ const body = presetBody ?? this.copy(context.documentLanguage, `# ${moduleName} Module API
1109
+
1110
+ ## 项目
1111
+
1112
+ - **项目名称**:${context.projectName}
1113
+ - **模块名**:${moduleName}
1114
+ - **模块路径**:src/modules/${slug}
1115
+
1116
+ ## 对外接口
1117
+
1118
+ - 待补充该模块暴露的服务、事件、命令或接口
1119
+
1120
+ ## 依赖关系
1121
+
1122
+ - 上游依赖:待补充
1123
+ - 下游调用方:待补充
1124
+ - 共享依赖:待补充
1125
+
1126
+ ## 测试要求
1127
+
1128
+ - 单元测试:核心逻辑和边界条件
1129
+ - 集成测试:跨模块 / API / 数据依赖
1130
+ - 回归验证:接口变更后同步更新 change 验证`, `# ${moduleName} Module API
687
1131
 
688
1132
  ## Project
689
1133
 
@@ -705,41 +1149,77 @@ ${this.formatReferenceList(refs, '待补充')}
705
1149
 
706
1150
  - Unit tests: core logic and edge cases
707
1151
  - Integration tests: cross-module / API / data dependencies
708
- - Regression checks: update change verification when interfaces change`
709
- : `# ${moduleName} Module API
1152
+ - Regression checks: update change verification when interfaces change`, `# ${moduleName} モジュール API
710
1153
 
711
- ## 项目
1154
+ ## プロジェクト
712
1155
 
713
- - **项目名称**:${context.projectName}
714
- - **模块名**:${moduleName}
715
- - **模块路径**:src/modules/${slug}
1156
+ - **プロジェクト**: ${context.projectName}
1157
+ - **モジュール**: ${moduleName}
1158
+ - **モジュールパス**: src/modules/${slug}
716
1159
 
717
- ## 对外接口
1160
+ ## 公開インターフェース
718
1161
 
719
- - 待补充该模块暴露的服务、事件、命令或接口
1162
+ - このモジュールが公開するサービス、イベント、コマンド、API を文書化する
720
1163
 
721
- ## 依赖关系
1164
+ ## 依存関係
722
1165
 
723
- - 上游依赖:待补充
724
- - 下游调用方:待补充
725
- - 共享依赖:待补充
1166
+ - 上流: 未定
1167
+ - 下流利用側: 未定
1168
+ - 共有依存: 未定
726
1169
 
727
- ## 测试要求
1170
+ ## テスト要件
728
1171
 
729
- - 单元测试:核心逻辑和边界条件
730
- - 集成测试:跨模块 / API / 数据依赖
731
- - 回归验证:接口变更后同步更新 change 验证`);
1172
+ - 単体テスト: 主要ロジックと境界条件
1173
+ - 統合テスト: モジュール横断 / API / データ依存
1174
+ - リグレッション確認: インターフェース変更時に change 検証を更新する`, `# API وحدة ${moduleName}
1175
+
1176
+ ## المشروع
1177
+
1178
+ - **المشروع**: ${context.projectName}
1179
+ - **الوحدة**: ${moduleName}
1180
+ - **مسار الوحدة**: src/modules/${slug}
1181
+
1182
+ ## الواجهة العامة
1183
+
1184
+ - وثّق الخدمات أو الأحداث أو الأوامر أو واجهات API التي تكشفها هذه الوحدة
1185
+
1186
+ ## الاعتماديات
1187
+
1188
+ - المنبع: قيد التحديد
1189
+ - الجهات المستهلكة: قيد التحديد
1190
+ - الاعتماديات المشتركة: قيد التحديد
1191
+
1192
+ ## متطلبات الاختبار
1193
+
1194
+ - اختبارات الوحدة: المنطق الأساسي والحالات الحدّية
1195
+ - اختبارات التكامل: الاعتماديات العابرة للوحدات / API / البيانات
1196
+ - فحوص الارتداد: حدّث تحقق change عند تغيّر الواجهات`);
732
1197
  return this.withFrontmatter({
733
1198
  name: `module-${slug}`,
734
- title: this.copy(context.documentLanguage, `${moduleName} 模块 API`, `${moduleName} Module API`),
1199
+ title: this.copy(context.documentLanguage, `${moduleName} 模块 API`, `${moduleName} Module API`, `${moduleName} モジュール API`, `API وحدة ${moduleName}`),
735
1200
  tags: ['api', 'module', slug],
736
1201
  }, body);
737
1202
  }
738
1203
  generateDesignDocTemplate(fallbackName, docName, input) {
739
1204
  const context = this.getProjectContext(fallbackName, 'standard', input);
740
1205
  const presetBody = this.getPresetDesignDocBody(context, docName);
741
- const body = presetBody ?? (this.isEnglish(context.documentLanguage)
742
- ? `# ${docName}
1206
+ const body = presetBody ?? this.copy(context.documentLanguage, `# ${docName}
1207
+
1208
+ ## 项目
1209
+
1210
+ - **项目名称**:${context.projectName}
1211
+
1212
+ ## 设计目标
1213
+
1214
+ - 说明 ${docName} 的设计背景和目标
1215
+ - 记录方案边界、关键约束和取舍
1216
+
1217
+ ## 待补充内容
1218
+
1219
+ - 背景
1220
+ - 方案
1221
+ - 风险
1222
+ - 验证方式`, `# ${docName}
743
1223
 
744
1224
  ## Project
745
1225
 
@@ -755,35 +1235,64 @@ ${this.formatReferenceList(refs, '待补充')}
755
1235
  - Background
756
1236
  - Proposal
757
1237
  - Risks
758
- - Verification`
759
- : `# ${docName}
1238
+ - Verification`, `# ${docName}
760
1239
 
761
- ## 项目
1240
+ ## プロジェクト
762
1241
 
763
- - **项目名称**:${context.projectName}
1242
+ - **プロジェクト**: ${context.projectName}
764
1243
 
765
- ## 设计目标
1244
+ ## 設計目標
766
1245
 
767
- - 说明 ${docName} 的设计背景和目标
768
- - 记录方案边界、关键约束和取舍
1246
+ - ${docName} の背景と目的を説明する
1247
+ - 境界、制約、トレードオフを記録する
769
1248
 
770
- ## 待补充内容
1249
+ ## 未記入項目
771
1250
 
772
1251
  - 背景
773
- - 方案
774
- - 风险
775
- - 验证方式`);
1252
+ - 提案
1253
+ - リスク
1254
+ - 検証`, `# ${docName}
1255
+
1256
+ ## المشروع
1257
+
1258
+ - **المشروع**: ${context.projectName}
1259
+
1260
+ ## أهداف التصميم
1261
+
1262
+ - اشرح خلفية ${docName} وهدفه
1263
+ - سجّل الحدود والقيود والمفاضلات
1264
+
1265
+ ## عناصر يجب إكمالها
1266
+
1267
+ - الخلفية
1268
+ - المقترح
1269
+ - المخاطر
1270
+ - التحقق`);
776
1271
  return this.withFrontmatter({
777
1272
  name: this.slugify(docName) || 'design-doc',
778
- title: this.copy(context.documentLanguage, `${docName} 设计文档`, `${docName} Design Doc`),
1273
+ title: this.copy(context.documentLanguage, `${docName} 设计文档`, `${docName} Design Doc`, `${docName} 設計文書`, `${docName} وثيقة تصميم`),
779
1274
  tags: ['design', 'architecture', 'decision'],
780
1275
  }, body);
781
1276
  }
782
1277
  generatePlanningDocTemplate(fallbackName, docName, input) {
783
1278
  const context = this.getProjectContext(fallbackName, 'standard', input);
784
1279
  const presetBody = this.getPresetPlanningDocBody(context, docName);
785
- const body = presetBody ?? (this.isEnglish(context.documentLanguage)
786
- ? `# ${docName}
1280
+ const body = presetBody ?? this.copy(context.documentLanguage, `# ${docName}
1281
+
1282
+ ## 项目
1283
+
1284
+ - **项目名称**:${context.projectName}
1285
+
1286
+ ## 规划目标
1287
+
1288
+ - 说明 ${docName} 对应的阶段目标和交付边界
1289
+
1290
+ ## 待补充内容
1291
+
1292
+ - 里程碑
1293
+ - 任务拆解
1294
+ - 风险与依赖
1295
+ - 验收节奏`, `# ${docName}
787
1296
 
788
1297
  ## Project
789
1298
 
@@ -798,34 +1307,53 @@ ${this.formatReferenceList(refs, '待补充')}
798
1307
  - Milestones
799
1308
  - Task breakdown
800
1309
  - Risks and dependencies
801
- - Acceptance cadence`
802
- : `# ${docName}
1310
+ - Acceptance cadence`, `# ${docName}
803
1311
 
804
- ## 项目
1312
+ ## プロジェクト
805
1313
 
806
- - **项目名称**:${context.projectName}
1314
+ - **プロジェクト**: ${context.projectName}
807
1315
 
808
- ## 规划目标
1316
+ ## 計画目標
809
1317
 
810
- - 说明 ${docName} 对应的阶段目标和交付边界
1318
+ - ${docName} の段階目標と納品境界を記述する
811
1319
 
812
- ## 待补充内容
1320
+ ## 未記入項目
813
1321
 
814
- - 里程碑
815
- - 任务拆解
816
- - 风险与依赖
817
- - 验收节奏`);
1322
+ - マイルストーン
1323
+ - タスク分解
1324
+ - リスクと依存関係
1325
+ - 受け入れの進め方`, `# ${docName}
1326
+
1327
+ ## المشروع
1328
+
1329
+ - **المشروع**: ${context.projectName}
1330
+
1331
+ ## هدف التخطيط
1332
+
1333
+ - صف هدف المرحلة وحدود التسليم الخاصة بـ ${docName}
1334
+
1335
+ ## عناصر يجب إكمالها
1336
+
1337
+ - المعالم
1338
+ - تقسيم المهام
1339
+ - المخاطر والاعتماديات
1340
+ - إيقاع القبول`);
818
1341
  return this.withFrontmatter({
819
1342
  name: this.slugify(docName) || 'planning-doc',
820
- title: this.copy(context.documentLanguage, `${docName} 计划文档`, `${docName} Planning Doc`),
1343
+ title: this.copy(context.documentLanguage, `${docName} 计划文档`, `${docName} Planning Doc`, `${docName} 計画文書`, `${docName} وثيقة تخطيط`),
821
1344
  tags: ['planning', 'delivery', 'milestone'],
822
1345
  }, body);
823
1346
  }
824
1347
  generateAiGuideTemplate(input) {
825
- const language = input?.documentLanguage === 'en-US' ? 'en-US' : 'zh-CN';
1348
+ const language = input?.documentLanguage === 'zh-CN' ||
1349
+ input?.documentLanguage === 'en-US' ||
1350
+ input?.documentLanguage === 'ja-JP' ||
1351
+ input?.documentLanguage === 'ar'
1352
+ ? input.documentLanguage
1353
+ : 'en-US';
826
1354
  return this.withFrontmatter({
827
1355
  name: 'ai-guide',
828
- title: this.copy(language, 'AI 开发指南', 'AI Guide'),
1356
+ title: this.copy(language, 'AI 开发指南', 'AI Guide', 'AI ガイド', 'دليل الذكاء الاصطناعي'),
829
1357
  tags: ['ai', 'guide', 'workflow'],
830
1358
  }, this.copy(language, `# AI 开发指南
831
1359
 
@@ -847,13 +1375,38 @@ ${this.formatReferenceList(refs, '待补充')}
847
1375
  4. If Stitch is enabled and the current change activates \`stitch_design_review\`, inspect \`artifacts/stitch/approval.json\` first and do not treat the change as ready to continue or archive until it is \`approved\`.
848
1376
  5. If Stitch installation, provider switching, doctor remediation, MCP setup, or auth setup is involved, read the repo-local Stitch spec first; if the repo does not contain that spec, use the built-in baselines instead: Gemini uses \`%USERPROFILE%/.gemini/settings.json\` with \`mcpServers.stitch.httpUrl\` and \`headers.X-Goog-Api-Key\`, and Codex uses \`%USERPROFILE%/.codex/config.toml\` with \`[mcp_servers.stitch]\`, \`type = "http"\`, \`url = "https://stitch.googleapis.com/mcp"\`, and \`X-Goog-Api-Key\`.
849
1377
  6. If the built-in Codex provider succeeds on read-only calls but Stitch write operations stall, first verify the run actually uses \`codex exec --dangerously-bypass-approvals-and-sandbox\`; if the project overrides a custom Codex runner, that runner must also pass the same flag explicitly.
850
- 7. Update skill documents and rebuild the index after meaningful changes.`));
1378
+ 7. Update skill documents and rebuild the index after meaningful changes.`, `# AI ガイド
1379
+
1380
+ ## 作業順序
1381
+
1382
+ 1. まず \`SKILL.index.json\` を読む。
1383
+ 2. コード編集前に関連する \`SKILL.md\` を読む。
1384
+ 3. 現在の作業は \`changes/active/<change>\` を基準に進める。
1385
+ 4. Stitch が有効で、現在の change が \`stitch_design_review\` を有効化している場合は、先に \`artifacts/stitch/approval.json\` を確認し、\`approved\` になるまで継続や archive 可と見なさない。
1386
+ 5. Stitch のインストール、provider 切り替え、doctor 修復、MCP 設定、認証設定が関係する場合は、まずリポジトリ内の Stitch 仕様を読む。仕様がない場合のみ内蔵ベースラインを使う。
1387
+ 6. 内蔵 Codex provider が読み取り専用呼び出しでは成功するのに Stitch 書き込みが止まる場合は、\`codex exec --dangerously-bypass-approvals-and-sandbox\` が本当に使われているかを確認する。カスタム Codex runner を使う場合も同じフラグを明示的に渡す。
1388
+ 7. 重要な変更後は SKILL 文書を更新し、インデックスを再生成する。`, `# دليل الذكاء الاصطناعي
1389
+
1390
+ ## ترتيب العمل
1391
+
1392
+ 1. اقرأ \`SKILL.index.json\` أولاً إن وجد.
1393
+ 2. اقرأ ملفات \`SKILL.md\` ذات الصلة قبل تعديل الكود.
1394
+ 3. استخدم \`changes/active/<change>\` كطبقة التنفيذ الحالية.
1395
+ 4. إذا كان Stitch مفعلاً وكان change الحالي يفعّل \`stitch_design_review\`، فافحص \`artifacts/stitch/approval.json\` أولاً ولا تعتبر change جاهزاً للاستمرار أو الأرشفة حتى تصبح حالته \`approved\`.
1396
+ 5. إذا كان العمل يتضمن تثبيت Stitch أو تبديل provider أو إصلاح doctor أو إعداد MCP أو المصادقة، فاقرأ مواصفة Stitch المحلية في المستودع أولاً. استخدم الخطوط الأساسية المدمجة فقط عند غياب المواصفة.
1397
+ 6. إذا نجح provider الداخلي لـ Codex في الاستدعاءات للقراءة فقط لكن توقفت عمليات الكتابة الخاصة بـ Stitch، فتحقق أولاً من أن التشغيل يستخدم فعلاً \`codex exec --dangerously-bypass-approvals-and-sandbox\`. وإذا كان المشروع يبدل Runner مخصصاً لـ Codex فيجب أن يمرر العلم نفسه صراحةً.
1398
+ 7. حدّث وثائق SKILL وأعد بناء الفهرس بعد التغييرات المهمة.`));
851
1399
  }
852
1400
  generateExecutionProtocolTemplate(input) {
853
- const language = input?.documentLanguage === 'en-US' ? 'en-US' : 'zh-CN';
1401
+ const language = input?.documentLanguage === 'zh-CN' ||
1402
+ input?.documentLanguage === 'en-US' ||
1403
+ input?.documentLanguage === 'ja-JP' ||
1404
+ input?.documentLanguage === 'ar'
1405
+ ? input.documentLanguage
1406
+ : 'en-US';
854
1407
  return this.withFrontmatter({
855
1408
  name: 'execution-protocol',
856
- title: this.copy(language, '执行协议', 'Execution Protocol'),
1409
+ title: this.copy(language, '执行协议', 'Execution Protocol', '実行プロトコル', 'بروتوكول التنفيذ'),
857
1410
  tags: ['execution', 'protocol', 'workflow'],
858
1411
  }, this.copy(language, `# 执行协议
859
1412
 
@@ -899,7 +1452,51 @@ Use active changes for current implementation work.
899
1452
  - When \`approval.json.status\` is not \`approved\`, do not treat the change as ready for continued implementation, completion claims, or archive readiness.
900
1453
  - If Stitch provider, MCP, or auth config is involved, read the repo-local Stitch spec first; if the repo does not contain that spec, use the built-in baselines instead: Gemini uses \`%USERPROFILE%/.gemini/settings.json\` with \`mcpServers.stitch.httpUrl\` and \`headers.X-Goog-Api-Key\`, and Codex uses \`%USERPROFILE%/.codex/config.toml\` with \`[mcp_servers.stitch]\`, \`type = "http"\`, \`url = "https://stitch.googleapis.com/mcp"\`, and \`X-Goog-Api-Key\`.
901
1454
  - If the built-in Codex provider succeeds on read-only calls but Stitch write operations stall, first verify the run actually uses \`codex exec --dangerously-bypass-approvals-and-sandbox\`; if the project overrides a custom Codex runner, that runner must also pass the same flag explicitly.
902
- - When recording manual review decisions, prefer \`ospec plugins approve stitch <change-path>\` or \`ospec plugins reject stitch <change-path>\`.`));
1455
+ - When recording manual review decisions, prefer \`ospec plugins approve stitch <change-path>\` or \`ospec plugins reject stitch <change-path>\`.`, `# 実行プロトコル
1456
+
1457
+ ## 参照元
1458
+
1459
+ - \`.skillrc\`
1460
+ - \`changes/active/<change>/proposal.md\`
1461
+ - \`changes/active/<change>/tasks.md\`
1462
+ - \`changes/active/<change>/state.json\`
1463
+ - \`changes/active/<change>/verification.md\`
1464
+
1465
+ ## ルール
1466
+
1467
+ 長期知識にはプロジェクト文書とレイヤー化された SKILL を使う。
1468
+ 現在の実装作業には active change を使う。
1469
+
1470
+ ## プラグインゲート
1471
+
1472
+ - まず \`.skillrc.plugins\` を読んで有効なブロック系プラグインを確認する。
1473
+ - 現在の change が \`tasks.md\` または \`verification.md\` で \`stitch_design_review\` を有効化している場合は、先に \`artifacts/stitch/approval.json\` を確認する。
1474
+ - \`approval.json.status\` が \`approved\` でない場合、継続実装、完了宣言、archive 準備完了として扱わない。
1475
+ - Stitch provider、MCP、認証設定が関係する場合は、まずリポジトリ内の Stitch 仕様を読む。仕様がない場合のみ内蔵ベースラインを使う。
1476
+ - 内蔵 Codex provider が読み取り専用呼び出しでは成功するのに Stitch 書き込みが止まる場合は、\`codex exec --dangerously-bypass-approvals-and-sandbox\` が実際に使われているかを確認する。カスタム runner でも同じフラグが必要。
1477
+ - 手動レビュー結果を記録する場合は \`ospec plugins approve stitch <change-path>\` または \`ospec plugins reject stitch <change-path>\` を優先する。`, `# بروتوكول التنفيذ
1478
+
1479
+ ## مصدر الحقيقة
1480
+
1481
+ - \`.skillrc\`
1482
+ - \`changes/active/<change>/proposal.md\`
1483
+ - \`changes/active/<change>/tasks.md\`
1484
+ - \`changes/active/<change>/state.json\`
1485
+ - \`changes/active/<change>/verification.md\`
1486
+
1487
+ ## القاعدة
1488
+
1489
+ استخدم وثائق المشروع وملفات SKILL متعددة الطبقات للمعرفة طويلة الأمد.
1490
+ واستخدم التغييرات النشطة للأعمال التنفيذية الحالية.
1491
+
1492
+ ## بوابات الإضافات
1493
+
1494
+ - اقرأ \`.skillrc.plugins\` أولاً لاكتشاف الإضافات الحاجبة المفعلة.
1495
+ - إذا كان change الحالي يفعّل \`stitch_design_review\` في \`tasks.md\` أو \`verification.md\`، فافحص \`artifacts/stitch/approval.json\` قبل التقدم.
1496
+ - عندما لا تكون \`approval.json.status\` مساوية لـ \`approved\`، فلا تعتبر change جاهزاً للاستمرار أو إعلان الاكتمال أو الأرشفة.
1497
+ - إذا كان العمل يتضمن Stitch provider أو MCP أو إعدادات المصادقة، فاقرأ مواصفة Stitch المحلية في المستودع أولاً، واستخدم الخطوط الأساسية المدمجة فقط عند غيابها.
1498
+ - إذا نجح provider الداخلي لـ Codex في الاستدعاءات للقراءة فقط لكن توقفت عمليات كتابة Stitch، فتحقق أولاً من أن التشغيل يستخدم فعلاً \`codex exec --dangerously-bypass-approvals-and-sandbox\`. وإذا استُخدم runner مخصص فيجب أن يمرر العلم نفسه.
1499
+ - عند تسجيل قرارات المراجعة اليدوية، فضّل \`ospec plugins approve stitch <change-path>\` أو \`ospec plugins reject stitch <change-path>\`.`));
903
1500
  }
904
1501
  generateBuildIndexScriptTemplate() {
905
1502
  return `#!/usr/bin/env node
@@ -997,7 +1594,8 @@ scan(rootDir)
997
1594
  return this.inputs.normalizeProjectBootstrapInput(input, fallbackName, mode);
998
1595
  }
999
1596
  getPresetModuleSkillBody(context, moduleName, slug, refs) {
1000
- if (context.projectPresetId !== 'official-site') {
1597
+ if (context.projectPresetId !== 'official-site' ||
1598
+ (context.documentLanguage !== 'zh-CN' && context.documentLanguage !== 'en-US')) {
1001
1599
  return null;
1002
1600
  }
1003
1601
  const moduleKey = slug.toLowerCase();
@@ -1386,7 +1984,8 @@ ${relatedDocs}`,
1386
1984
  return this.isEnglish(context.documentLanguage) ? template.en : template.zh;
1387
1985
  }
1388
1986
  getPresetApiAreaDocBody(context, apiAreaName) {
1389
- if (context.projectPresetId !== 'official-site') {
1987
+ if (context.projectPresetId !== 'official-site' ||
1988
+ (context.documentLanguage !== 'zh-CN' && context.documentLanguage !== 'en-US')) {
1390
1989
  return null;
1391
1990
  }
1392
1991
  const key = apiAreaName.trim().toLowerCase();
@@ -1555,7 +2154,8 @@ ${relatedDocs}`,
1555
2154
  return this.isEnglish(context.documentLanguage) ? template.en : template.zh;
1556
2155
  }
1557
2156
  getPresetModuleApiDocBody(context, moduleName, slug) {
1558
- if (context.projectPresetId !== 'official-site') {
2157
+ if (context.projectPresetId !== 'official-site' ||
2158
+ (context.documentLanguage !== 'zh-CN' && context.documentLanguage !== 'en-US')) {
1559
2159
  return null;
1560
2160
  }
1561
2161
  const docs = {
@@ -1619,11 +2219,12 @@ ${relatedDocs}`,
1619
2219
  return this.isEnglish(context.documentLanguage) ? template.en : template.zh;
1620
2220
  }
1621
2221
  getPresetDesignDocBody(context, docName) {
1622
- if (context.projectPresetId !== 'official-site') {
2222
+ if (context.projectPresetId !== 'official-site' ||
2223
+ (context.documentLanguage !== 'zh-CN' && context.documentLanguage !== 'en-US')) {
1623
2224
  return null;
1624
2225
  }
1625
2226
  const key = docName.trim().toLowerCase();
1626
- const isChinese = !this.isEnglish(context.documentLanguage);
2227
+ const isChinese = context.documentLanguage === 'zh-CN';
1627
2228
  if (['ui information architecture', '界面信息架构'].includes(key)) {
1628
2229
  return isChinese
1629
2230
  ? `# ${docName}
@@ -1784,11 +2385,12 @@ ${relatedDocs}`,
1784
2385
  return null;
1785
2386
  }
1786
2387
  getPresetPlanningDocBody(context, docName) {
1787
- if (context.projectPresetId !== 'official-site') {
2388
+ if (context.projectPresetId !== 'official-site' ||
2389
+ (context.documentLanguage !== 'zh-CN' && context.documentLanguage !== 'en-US')) {
1788
2390
  return null;
1789
2391
  }
1790
2392
  const key = docName.trim().toLowerCase();
1791
- const isChinese = !this.isEnglish(context.documentLanguage);
2393
+ const isChinese = context.documentLanguage === 'zh-CN';
1792
2394
  if (['delivery plan', '交付计划'].includes(key)) {
1793
2395
  return isChinese
1794
2396
  ? `# ${docName}