scene-capability-engine 3.0.1 → 3.0.3

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 (172) hide show
  1. package/CHANGELOG.md +235 -233
  2. package/LICENSE +2 -2
  3. package/README.md +8 -11
  4. package/README.zh.md +7 -10
  5. package/bin/kse.js +1 -1
  6. package/bin/sce.js +1 -1
  7. package/bin/sco.js +1 -1
  8. package/docs/331-poc-adaptation-roadmap.md +25 -25
  9. package/docs/331-poc-dual-track-integration-guide.md +26 -26
  10. package/docs/331-poc-weekly-delivery-checklist.md +8 -8
  11. package/docs/OFFLINE_INSTALL.md +10 -10
  12. package/docs/README.md +24 -24
  13. package/docs/adopt-migration-guide.md +51 -51
  14. package/docs/adoption-guide.md +56 -56
  15. package/docs/agent-hooks-analysis.md +52 -52
  16. package/docs/architecture.md +6 -6
  17. package/docs/articles/ai-driven-development-philosophy-and-practice-review.md +4 -4
  18. package/docs/articles/ai-driven-development-philosophy-and-practice.en.md +9 -9
  19. package/docs/articles/ai-driven-development-philosophy-and-practice.md +10 -10
  20. package/docs/autonomous-control-guide.md +89 -89
  21. package/docs/command-reference.md +31 -16
  22. package/docs/community.md +4 -4
  23. package/docs/cross-tool-guide.md +47 -47
  24. package/docs/developer-guide.md +5 -5
  25. package/docs/document-governance.md +91 -91
  26. package/docs/environment-management-guide.md +53 -53
  27. package/docs/examples/add-export-command/design.md +2 -2
  28. package/docs/examples/add-export-command/requirements.md +5 -5
  29. package/docs/examples/add-export-command/tasks.md +2 -2
  30. package/docs/faq.md +69 -69
  31. package/docs/handoffs/evidence/ontology/moqui-template-baseline-2026-02-17-232922.json +9 -9
  32. package/docs/handoffs/evidence/ontology/moqui-template-baseline-2026-02-17-232922.md +3 -3
  33. package/docs/images/wechat-qr.png +0 -0
  34. package/docs/integration-modes.md +60 -60
  35. package/docs/integration-philosophy.md +48 -48
  36. package/docs/knowledge-management-guide.md +21 -21
  37. package/docs/manual-workflows-guide.md +20 -20
  38. package/docs/moqui-capability-matrix.md +43 -22
  39. package/docs/moqui-template-core-library-playbook.md +49 -21
  40. package/docs/multi-agent-coordination-guide.md +19 -19
  41. package/docs/multi-repo-management-guide.md +93 -93
  42. package/docs/quick-start-with-ai-tools.md +36 -36
  43. package/docs/quick-start.md +16 -16
  44. package/docs/release-checklist.md +7 -7
  45. package/docs/releases/v1.46.2-validation.md +1 -1
  46. package/docs/releases/v1.46.2.md +10 -10
  47. package/docs/scene-runtime-guide.md +42 -42
  48. package/docs/spec-collaboration-guide.md +43 -43
  49. package/docs/spec-locking-guide.md +26 -26
  50. package/docs/spec-numbering-guide.md +6 -6
  51. package/docs/spec-workflow.md +25 -25
  52. package/docs/steering-strategy-guide.md +36 -36
  53. package/docs/team-collaboration-guide.md +23 -23
  54. package/docs/testing-strategy.md +2 -2
  55. package/docs/tools/claude-guide.md +26 -26
  56. package/docs/tools/cursor-guide.md +31 -31
  57. package/docs/tools/generic-guide.md +22 -22
  58. package/docs/tools/kiro-guide.md +43 -43
  59. package/docs/tools/vscode-guide.md +18 -18
  60. package/docs/tools/windsurf-guide.md +50 -50
  61. package/docs/troubleshooting.md +116 -116
  62. package/docs/upgrade-guide.md +49 -49
  63. package/docs/value-observability-guide.md +6 -6
  64. package/docs/zh/README.md +22 -22
  65. package/docs/zh/quick-start.md +34 -34
  66. package/docs/zh/release-checklist.md +6 -6
  67. package/docs/zh/releases/v1.46.2-validation.md +1 -1
  68. package/docs/zh/releases/v1.46.2.md +9 -9
  69. package/docs/zh/spec-numbering-guide.md +6 -6
  70. package/docs/zh/tools/claude-guide.md +14 -14
  71. package/docs/zh/tools/cursor-guide.md +18 -18
  72. package/docs/zh/tools/generic-guide.md +40 -40
  73. package/docs/zh/tools/kiro-guide.md +50 -50
  74. package/docs/zh/tools/vscode-guide.md +20 -20
  75. package/docs/zh/tools/windsurf-guide.md +49 -49
  76. package/docs/zh/value-observability-guide.md +6 -6
  77. package/docs//344/272/244/344/273/230/346/270/205/345/215/225.md +4 -4
  78. package/lib/adoption/adoption-logger.js +1 -1
  79. package/lib/adoption/adoption-strategy.js +3 -3
  80. package/lib/adoption/detection-engine.js +1 -1
  81. package/lib/adoption/error-formatter.js +17 -17
  82. package/lib/adoption/progress-reporter.js +2 -2
  83. package/lib/adoption/smart-orchestrator.js +2 -2
  84. package/lib/adoption/strategy-selector.js +2 -2
  85. package/lib/adoption/summary-generator.js +3 -3
  86. package/lib/auto/autonomous-engine.js +2 -2
  87. package/lib/auto/close-loop-runner.js +9 -9
  88. package/lib/backup/backup-system.js +2 -2
  89. package/lib/collab/collab-manager.js +2 -2
  90. package/lib/commands/adopt.js +16 -16
  91. package/lib/commands/auto.js +1148 -106
  92. package/lib/commands/collab.js +8 -8
  93. package/lib/commands/docs.js +26 -26
  94. package/lib/commands/doctor.js +2 -2
  95. package/lib/commands/env.js +14 -14
  96. package/lib/commands/knowledge.js +13 -13
  97. package/lib/commands/lock.js +6 -6
  98. package/lib/commands/ops.js +19 -19
  99. package/lib/commands/orchestrate.js +5 -5
  100. package/lib/commands/prompt.js +3 -3
  101. package/lib/commands/rollback.js +4 -4
  102. package/lib/commands/scene.js +30 -30
  103. package/lib/commands/spec-bootstrap.js +1 -1
  104. package/lib/commands/spec-gate.js +1 -1
  105. package/lib/commands/spec-pipeline.js +1 -1
  106. package/lib/commands/task.js +1 -1
  107. package/lib/commands/templates.js +27 -27
  108. package/lib/commands/upgrade.js +8 -8
  109. package/lib/commands/value.js +4 -4
  110. package/lib/commands/watch.js +9 -9
  111. package/lib/commands/workflows.js +5 -5
  112. package/lib/commands/workspace-multi.js +17 -17
  113. package/lib/commands/workspace.js +5 -5
  114. package/lib/context/context-exporter.js +1 -1
  115. package/lib/context/prompt-generator.js +1 -1
  116. package/lib/data/moqui-capability-lexicon.json +258 -2
  117. package/lib/environment/environment-manager.js +1 -1
  118. package/lib/gitignore/gitignore-detector.js +4 -4
  119. package/lib/gitignore/gitignore-integration.js +2 -2
  120. package/lib/gitignore/gitignore-transformer.js +3 -3
  121. package/lib/gitignore/layered-rules-template.js +2 -2
  122. package/lib/governance/diagnostic-engine.js +4 -4
  123. package/lib/governance/doc-reference-checker.js +1 -1
  124. package/lib/governance/hooks-manager.js +5 -5
  125. package/lib/governance/reporter.js +1 -1
  126. package/lib/knowledge/knowledge-manager.js +6 -6
  127. package/lib/orchestrator/agent-spawner.js +1 -1
  128. package/lib/orchestrator/bootstrap-prompt-builder.js +2 -2
  129. package/lib/orchestrator/orchestration-engine.js +55 -6
  130. package/lib/repo/config-manager.js +2 -2
  131. package/lib/repo/handlers/init-handler.js +3 -3
  132. package/lib/scene-runtime/audit-emitter.js +2 -2
  133. package/lib/scene-runtime/binding-plugin-loader.js +1 -1
  134. package/lib/scene-runtime/moqui-adapter.js +2 -2
  135. package/lib/scene-runtime/moqui-extractor.js +3 -3
  136. package/lib/scene-runtime/scene-loader.js +3 -3
  137. package/lib/scene-runtime/scene-template-linter.js +1 -1
  138. package/lib/scene-runtime/templates/scene-template-erp-query-v0.1.yaml +1 -1
  139. package/lib/scene-runtime/templates/scene-template-hybrid-shadow-v0.1.yaml +1 -1
  140. package/lib/spec/multi-spec-orchestrate.js +1 -1
  141. package/lib/spec-gate/rules/default-rules.js +1 -1
  142. package/lib/steering/adoption-config.js +1 -1
  143. package/lib/steering/compliance-auto-fixer.js +1 -1
  144. package/lib/steering/compliance-cache.js +3 -3
  145. package/lib/steering/compliance-error-reporter.js +1 -1
  146. package/lib/steering/index.js +1 -1
  147. package/lib/steering/steering-manager.js +7 -7
  148. package/lib/task/task-claimer.js +2 -1
  149. package/lib/templates/metadata-collector.js +6 -6
  150. package/lib/templates/template-creator.js +2 -2
  151. package/lib/templates/template-exporter.js +12 -12
  152. package/lib/upgrade/migration-engine.js +4 -4
  153. package/lib/utils/tool-detector.js +25 -25
  154. package/lib/utils/validation.js +3 -3
  155. package/lib/version/version-checker.js +13 -13
  156. package/lib/version/version-manager.js +7 -7
  157. package/lib/watch/presets.js +4 -4
  158. package/lib/workspace/multi/path-utils.js +1 -1
  159. package/lib/workspace/multi/workspace-context-resolver.js +9 -9
  160. package/lib/workspace/multi/workspace-registry.js +2 -2
  161. package/lib/workspace/multi/workspace-state-manager.js +1 -1
  162. package/lib/workspace/multi/workspace.js +1 -1
  163. package/lib/workspace/workspace-sync.js +1 -1
  164. package/locales/en.json +1 -1
  165. package/locales/zh.json +1 -1
  166. package/package.json +3 -5
  167. package/template/.kiro/README.md +40 -40
  168. package/template/.kiro/specs/SPEC_WORKFLOW_GUIDE.md +3 -3
  169. package/template/.kiro/steering/CORE_PRINCIPLES.md +3 -3
  170. package/template/.kiro/steering/ENVIRONMENT.md +2 -2
  171. package/template/README.md +3 -3
  172. /package/bin/{kiro-spec-engine.js → scene-capability-engine.js} +0 -0
@@ -2,10 +2,10 @@
2
2
  * Bootstrap Prompt Builder
3
3
  *
4
4
  * Builds the initial prompt injected into each Codex CLI sub-agent so that it
5
- * has full context about the target Spec, kse conventions, steering rules, and
5
+ * has full context about the target Spec, sce conventions, steering rules, and
6
6
  * clear task-execution instructions.
7
7
  *
8
- * Requirements: 2.1 (Spec path), 2.2 (kse / steering context),
8
+ * Requirements: 2.1 (Spec path), 2.2 (sce / steering context),
9
9
  * 2.3 (task execution instructions), 2.4 (configurable template)
10
10
  */
11
11
 
@@ -24,6 +24,8 @@ const DEFAULT_RATE_LIMIT_PARALLEL_FLOOR = 1;
24
24
  const DEFAULT_RATE_LIMIT_COOLDOWN_MS = 30000;
25
25
  const DEFAULT_RATE_LIMIT_LAUNCH_BUDGET_PER_MINUTE = 12;
26
26
  const DEFAULT_RATE_LIMIT_LAUNCH_BUDGET_WINDOW_MS = 60000;
27
+ const DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS = 600;
28
+ const AGENT_WAIT_TIMEOUT_GRACE_MS = 30000;
27
29
  const RATE_LIMIT_BACKOFF_JITTER_RATIO = 0.5;
28
30
  const RATE_LIMIT_RETRY_AFTER_MAX_MS = 10 * 60 * 1000;
29
31
  const RATE_LIMIT_ERROR_PATTERNS = [
@@ -104,6 +106,8 @@ class OrchestrationEngine extends EventEmitter {
104
106
  this._launchBudgetLastHoldSignalAt = 0;
105
107
  /** @type {number} last launch-budget hold duration emitted to telemetry (ms) */
106
108
  this._launchBudgetLastHoldMs = 0;
109
+ /** @type {number} fallback wait timeout to avoid indefinite hangs when lifecycle events are missing */
110
+ this._agentWaitTimeoutMs = (DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS;
107
111
  /** @type {() => number} */
108
112
  this._random = typeof options.random === 'function' ? options.random : Math.random;
109
113
  /** @type {() => number} */
@@ -190,6 +194,7 @@ class OrchestrationEngine extends EventEmitter {
190
194
  // Get config for maxParallel and maxRetries
191
195
  const config = await this._orchestratorConfig.getConfig();
192
196
  this._applyRetryPolicyConfig(config);
197
+ this._agentWaitTimeoutMs = this._resolveAgentWaitTimeoutMs(config);
193
198
  const maxParallel = options.maxParallel || config.maxParallel || 3;
194
199
  const maxRetries = config.maxRetries || 2;
195
200
  this._initializeAdaptiveParallel(maxParallel);
@@ -407,29 +412,46 @@ class OrchestrationEngine extends EventEmitter {
407
412
  */
408
413
  _waitForAgent(specName, agentId) {
409
414
  return new Promise((resolve) => {
415
+ const fallbackTimeoutMs = this._toPositiveInteger(
416
+ this._agentWaitTimeoutMs,
417
+ (DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS
418
+ );
419
+ let settled = false;
420
+ let fallbackTimer = null;
421
+
422
+ const finalize = (payload) => {
423
+ if (settled) {
424
+ return;
425
+ }
426
+ settled = true;
427
+ cleanup();
428
+ resolve(payload);
429
+ };
430
+
410
431
  const onCompleted = (data) => {
411
432
  if (data.agentId === agentId) {
412
- cleanup();
413
- resolve({ status: 'completed', error: null });
433
+ finalize({ status: 'completed', error: null });
414
434
  }
415
435
  };
416
436
 
417
437
  const onFailed = (data) => {
418
438
  if (data.agentId === agentId) {
419
- cleanup();
420
439
  const error = data.stderr || data.error || `Exit code: ${data.exitCode}`;
421
- resolve({ status: 'failed', error });
440
+ finalize({ status: 'failed', error });
422
441
  }
423
442
  };
424
443
 
425
444
  const onTimeout = (data) => {
426
445
  if (data.agentId === agentId) {
427
- cleanup();
428
- resolve({ status: 'timeout', error: `Timeout after ${data.timeoutSeconds}s` });
446
+ finalize({ status: 'timeout', error: `Timeout after ${data.timeoutSeconds}s` });
429
447
  }
430
448
  };
431
449
 
432
450
  const cleanup = () => {
451
+ if (fallbackTimer) {
452
+ clearTimeout(fallbackTimer);
453
+ fallbackTimer = null;
454
+ }
433
455
  this._agentSpawner.removeListener('agent:completed', onCompleted);
434
456
  this._agentSpawner.removeListener('agent:failed', onFailed);
435
457
  this._agentSpawner.removeListener('agent:timeout', onTimeout);
@@ -438,6 +460,16 @@ class OrchestrationEngine extends EventEmitter {
438
460
  this._agentSpawner.on('agent:completed', onCompleted);
439
461
  this._agentSpawner.on('agent:failed', onFailed);
440
462
  this._agentSpawner.on('agent:timeout', onTimeout);
463
+
464
+ fallbackTimer = setTimeout(() => {
465
+ finalize({
466
+ status: 'timeout',
467
+ error: (
468
+ `Agent wait timeout after ${Math.ceil(fallbackTimeoutMs / 1000)}s for ` +
469
+ `${specName} (${agentId}) without lifecycle events`
470
+ ),
471
+ });
472
+ }, fallbackTimeoutMs);
441
473
  });
442
474
  }
443
475
 
@@ -689,6 +721,23 @@ class OrchestrationEngine extends EventEmitter {
689
721
  );
690
722
  }
691
723
 
724
+ /**
725
+ * Resolve a fallback wait timeout for _waitForAgent.
726
+ * This protects orchestration from hanging forever if lifecycle events
727
+ * are unexpectedly missing.
728
+ *
729
+ * @param {object} config
730
+ * @returns {number}
731
+ * @private
732
+ */
733
+ _resolveAgentWaitTimeoutMs(config) {
734
+ const timeoutSeconds = this._toPositiveInteger(
735
+ config && config.timeoutSeconds,
736
+ DEFAULT_AGENT_WAIT_TIMEOUT_SECONDS
737
+ );
738
+ return (timeoutSeconds * 1000) + AGENT_WAIT_TIMEOUT_GRACE_MS;
739
+ }
740
+
692
741
  /**
693
742
  * @param {number} maxParallel
694
743
  * @private
@@ -58,7 +58,7 @@ class ConfigManager {
58
58
  // Check if file exists
59
59
  if (!(await this.configExists())) {
60
60
  throw new ConfigError(
61
- 'Configuration file not found. Run "kse repo init" to create it.',
61
+ 'Configuration file not found. Run "sce repo init" to create it.',
62
62
  { path: configPath }
63
63
  );
64
64
  }
@@ -167,7 +167,7 @@ class ConfigManager {
167
167
  } else if (!this._isSupportedVersion(version)) {
168
168
  errors.push(
169
169
  `Unsupported configuration version: ${version}. ` +
170
- 'Please upgrade to the latest version of kse.'
170
+ 'Please upgrade to the latest version of sce.'
171
171
  );
172
172
  }
173
173
 
@@ -188,9 +188,9 @@ class InitHandler {
188
188
  }
189
189
 
190
190
  console.log('\nNext steps:');
191
- console.log(' • Run "kse repo status" to view repository status');
192
- console.log(' • Run "kse repo health" to check repository health');
193
- console.log(' • Run "kse repo exec <command>" to execute commands across all repos');
191
+ console.log(' • Run "sce repo status" to view repository status');
192
+ console.log(' • Run "sce repo health" to check repository health');
193
+ console.log(' • Run "sce repo exec <command>" to execute commands across all repos');
194
194
  }
195
195
  }
196
196
 
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const crypto = require('crypto');
4
4
 
@@ -21,7 +21,7 @@ class AuditEmitter {
21
21
  scene_ref: payload.scene_ref || payload.sceneRef || null,
22
22
  scene_version: payload.scene_version || payload.sceneVersion || null,
23
23
  run_mode: payload.run_mode || payload.runMode || null,
24
- actor: payload.actor || 'kse.scene-runtime',
24
+ actor: payload.actor || 'sce.scene-runtime',
25
25
  payload: payload.payload || payload
26
26
  };
27
27
 
@@ -1,4 +1,4 @@
1
- const path = require('path');
1
+ const path = require('path');
2
2
  const fs = require('fs-extra');
3
3
 
4
4
  const DEFAULT_BINDING_PLUGIN_DIRS = [
@@ -246,7 +246,7 @@ function parseEntityRef(parts) {
246
246
  }
247
247
 
248
248
  /**
249
- * Map Moqui API response to KSE Execution_Result.
249
+ * Map Moqui API response to sce Execution_Result.
250
250
  * @param {Object} moquiResponse - { success, data, meta, error }
251
251
  * @param {string} handlerId - Handler identifier (e.g., 'moqui.adapter')
252
252
  * @param {string} bindingRef - Original binding ref string
@@ -559,7 +559,7 @@ function createMoquiAdapterHandler(options = {}) {
559
559
  requestOptions
560
560
  );
561
561
 
562
- // Map Moqui response to KSE Execution_Result
562
+ // Map Moqui response to sce Execution_Result
563
563
  return mapMoquiResponseToResult(moquiResponse, HANDLER_ID, bindingRef);
564
564
  },
565
565
 
@@ -14,8 +14,8 @@ const HEADER_ITEM_SUFFIXES = [
14
14
  { header: 'Master', item: 'Detail' }
15
15
  ];
16
16
 
17
- const SCENE_API_VERSION = 'kse.scene/v0.2';
18
- const PACKAGE_API_VERSION = 'kse.scene.package/v0.1';
17
+ const SCENE_API_VERSION = 'sce.scene/v0.2';
18
+ const PACKAGE_API_VERSION = 'sce.scene.package/v0.1';
19
19
 
20
20
  // ─── YAML Serializer ──────────────────────────────────────────────
21
21
 
@@ -1636,7 +1636,7 @@ function generatePackageContract(match) {
1636
1636
  apiVersion: PACKAGE_API_VERSION,
1637
1637
  kind: 'scene-template',
1638
1638
  metadata: {
1639
- group: 'kse.scene',
1639
+ group: 'sce.scene',
1640
1640
  name: packageName,
1641
1641
  version: '0.1.0',
1642
1642
  summary,
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const yaml = require('js-yaml');
4
4
 
@@ -46,8 +46,8 @@ class SceneLoader {
46
46
  return { valid: false, errors: ['manifest must be an object'] };
47
47
  }
48
48
 
49
- if (typeof manifest.apiVersion !== 'string' || !manifest.apiVersion.startsWith('kse.scene/')) {
50
- errors.push('apiVersion must start with kse.scene/');
49
+ if (typeof manifest.apiVersion !== 'string' || !manifest.apiVersion.startsWith('sce.scene/')) {
50
+ errors.push('apiVersion must start with sce.scene/');
51
51
  }
52
52
 
53
53
  if (manifest.kind !== 'scene') {
@@ -3,7 +3,7 @@
3
3
  // ─── Constants ─────────────────────────────────────────────────────
4
4
 
5
5
  /** Known binding ref prefixes for validation */
6
- const KNOWN_BINDING_REF_PREFIXES = ['moqui.', 'spec.erp.', 'kse.scene.'];
6
+ const KNOWN_BINDING_REF_PREFIXES = ['moqui.', 'spec.erp.', 'sce.scene.'];
7
7
 
8
8
  /** Valid risk levels for governance checks */
9
9
  const VALID_RISK_LEVELS = ['low', 'medium', 'high'];
@@ -1,4 +1,4 @@
1
- apiVersion: kse.scene/v0.2
1
+ apiVersion: sce.scene/v0.2
2
2
  kind: scene
3
3
  metadata:
4
4
  obj_id: scene.template.erp-order-query
@@ -1,4 +1,4 @@
1
- apiVersion: kse.scene/v0.2
1
+ apiVersion: sce.scene/v0.2
2
2
  kind: scene
3
3
  metadata:
4
4
  obj_id: scene.template.hybrid-pick-shadow
@@ -62,7 +62,7 @@ async function runMultiSpecViaOrchestrate(options = {}) {
62
62
  orchestrate_result: orchestrationResult,
63
63
  next_actions: [
64
64
  nextActionLabel,
65
- 'Use kse orchestrate status to inspect live orchestration state.'
65
+ 'Use sce orchestrate status to inspect live orchestration state.'
66
66
  ]
67
67
  };
68
68
 
@@ -77,7 +77,7 @@ function createDefaultRules(projectPath = process.cwd()) {
77
77
  },
78
78
  {
79
79
  id: 'config_consistency',
80
- description: 'Verify project-level KSE config baseline exists',
80
+ description: 'Verify project-level sce config baseline exists',
81
81
  async execute() {
82
82
  const kiroDir = path.join(projectPath, '.kiro');
83
83
  const configDir = path.join(kiroDir, 'config');
@@ -4,7 +4,7 @@ const path = require('path');
4
4
  /**
5
5
  * AdoptionConfig - 管理 adoption-config.json 配置文件
6
6
  *
7
- * 记录项目采用 kse 时的配置选择
7
+ * 记录项目采用 sce 时的配置选择
8
8
  */
9
9
  class AdoptionConfig {
10
10
  constructor(projectPath) {
@@ -94,7 +94,7 @@ class ComplianceAutoFixer {
94
94
  console.log(chalk.blue('Backup location:'));
95
95
  console.log(` ${backupPath}\n`);
96
96
  console.log(chalk.blue('To restore from backup:'));
97
- console.log(` kse rollback --backup ${path.basename(backupPath)}\n`);
97
+ console.log(` sce rollback --backup ${path.basename(backupPath)}\n`);
98
98
 
99
99
  return {
100
100
  success: true,
@@ -6,7 +6,7 @@ const os = require('os');
6
6
  * ComplianceCache - Manages version-based check caching
7
7
  *
8
8
  * Stores the last successful compliance check version to avoid
9
- * repeated checks for the same kse version.
9
+ * repeated checks for the same sce version.
10
10
  */
11
11
  class ComplianceCache {
12
12
  /**
@@ -31,7 +31,7 @@ class ComplianceCache {
31
31
  /**
32
32
  * Check if cache is valid for current version
33
33
  *
34
- * @param {string} currentVersion - Current kse version
34
+ * @param {string} currentVersion - Current sce version
35
35
  * @returns {boolean} True if cache is valid
36
36
  */
37
37
  isValid(currentVersion) {
@@ -51,7 +51,7 @@ class ComplianceCache {
51
51
  /**
52
52
  * Update cache with successful check
53
53
  *
54
- * @param {string} version - kse version
54
+ * @param {string} version - sce version
55
55
  * @returns {boolean} True if update succeeded
56
56
  */
57
57
  update(version) {
@@ -51,7 +51,7 @@ class ComplianceErrorReporter {
51
51
  message += ' • Delete temporary files\n';
52
52
 
53
53
  message += '\n' + chalk.gray('To bypass this check (not recommended):') + '\n';
54
- message += chalk.gray(' kse <command> --skip-steering-check') + '\n';
54
+ message += chalk.gray(' sce <command> --skip-steering-check') + '\n';
55
55
 
56
56
  return message;
57
57
  }
@@ -14,7 +14,7 @@ const { ContextSyncManager } = require('./context-sync-manager');
14
14
  * @param {boolean} options.skip - Skip the check entirely
15
15
  * @param {boolean} options.force - Force check even if cache is valid
16
16
  * @param {string} options.projectPath - Project root path (defaults to cwd)
17
- * @param {string} options.version - Current kse version
17
+ * @param {string} options.version - Current sce version
18
18
  * @returns {boolean} True if compliant or check skipped, false otherwise
19
19
  */
20
20
  async function runSteeringComplianceCheck(options = {}) {
@@ -69,7 +69,7 @@ class SteeringManager {
69
69
  */
70
70
  async promptStrategy(detection) {
71
71
  if (!detection.hasExistingSteering) {
72
- // 没有现有 steering 文件,默认使用 kse
72
+ // 没有现有 steering 文件,默认使用 sce
73
73
  return 'use-kse';
74
74
  }
75
75
 
@@ -83,8 +83,8 @@ class SteeringManager {
83
83
  });
84
84
 
85
85
  console.log('');
86
- console.log('Kiro IDE loads all files in .kiro/steering/, which means you must');
87
- console.log('choose between kse steering rules OR your project\'s existing rules.');
86
+ console.log('AI IDE loads all files in .kiro/steering/, which means you must');
87
+ console.log('choose between sce steering rules OR your project\'s existing rules.');
88
88
  console.log('');
89
89
 
90
90
  const response = await inquirer.prompt([{
@@ -93,11 +93,11 @@ class SteeringManager {
93
93
  message: 'How would you like to proceed?',
94
94
  choices: [
95
95
  {
96
- name: 'Use kse steering (backup existing files) - Recommended for new kse users',
96
+ name: 'Use sce steering (backup existing files) - Recommended for new sce users',
97
97
  value: 'use-kse'
98
98
  },
99
99
  {
100
- name: 'Keep existing steering (skip kse steering) - For projects with custom steering rules',
100
+ name: 'Keep existing steering (skip sce steering) - For projects with custom steering rules',
101
101
  value: 'use-project'
102
102
  }
103
103
  ]
@@ -162,7 +162,7 @@ class SteeringManager {
162
162
  }
163
163
 
164
164
  /**
165
- * 安装 kse steering 文件
165
+ * 安装 sce steering 文件
166
166
  *
167
167
  * @param {string} projectPath - 项目根目录路径
168
168
  * @returns {Promise<Object>} 安装结果
@@ -180,7 +180,7 @@ class SteeringManager {
180
180
  if (!templateExists) {
181
181
  return {
182
182
  success: false,
183
- error: 'kse steering template directory not found',
183
+ error: 'sce steering template directory not found',
184
184
  filesInstalled: 0
185
185
  };
186
186
  }
@@ -97,7 +97,8 @@ class TaskClaimer {
97
97
  return [];
98
98
  }
99
99
 
100
- const markerHeaderRegex = /^\s*##\s+KSE\s+Status\s+Markers\s*$/i;
100
+ // Accept both legacy and current section headers to keep existing specs readable.
101
+ const markerHeaderRegex = /^\s*##\s+(?:(?:sce|kse)\s+)?Status\s+Markers\s*$/i;
101
102
  const sectionHeaderRegex = /^\s*##\s+/;
102
103
 
103
104
  const markerLine = lines.findIndex((line) => markerHeaderRegex.test(String(line || '')));
@@ -50,7 +50,7 @@ class MetadataCollector {
50
50
  // Version
51
51
  metadata.version = await this.promptVersion();
52
52
 
53
- // KSE version
53
+ // sce version
54
54
  metadata.kse_version = await this.promptKseVersion();
55
55
 
56
56
  // Timestamps
@@ -211,8 +211,8 @@ class MetadataCollector {
211
211
  }
212
212
 
213
213
  /**
214
- * Prompts for KSE version
215
- * @returns {Promise<string>} KSE version
214
+ * Prompts for sce version
215
+ * @returns {Promise<string>} sce version
216
216
  */
217
217
  async promptKseVersion() {
218
218
  const currentVersion = this.getCurrentKseVersion();
@@ -220,7 +220,7 @@ class MetadataCollector {
220
220
  {
221
221
  type: 'input',
222
222
  name: 'kseVersion',
223
- message: 'Minimum KSE version required:',
223
+ message: 'Minimum sce version required:',
224
224
  default: currentVersion
225
225
  }
226
226
  ]);
@@ -312,8 +312,8 @@ class MetadataCollector {
312
312
  }
313
313
 
314
314
  /**
315
- * Gets current KSE version
316
- * @returns {string} KSE version
315
+ * Gets current sce version
316
+ * @returns {string} sce version
317
317
  */
318
318
  getCurrentKseVersion() {
319
319
  try {
@@ -135,7 +135,7 @@ class TemplateCreator {
135
135
  console.log('📖 Next steps:');
136
136
  console.log(` 1. Review the template in: ${exportResult.outputDir}`);
137
137
  console.log(` 2. Check REVIEW_CHECKLIST.md for items to verify`);
138
- console.log(` 3. Test the template: kse spec create test --template ${metadata.name}`);
138
+ console.log(` 3. Test the template: sce spec create test --template ${metadata.name}`);
139
139
  console.log(` 4. Follow SUBMISSION_GUIDE.md to submit to repository`);
140
140
  console.log('');
141
141
 
@@ -181,7 +181,7 @@ class TemplateCreator {
181
181
  // Check for remaining project-specific content (high confidence patterns)
182
182
  const projectSpecificPatterns = [
183
183
  /\.kiro\/specs\/\d+-\d+-[a-z-]+/g, // Specific spec paths
184
- /kiro-spec-engine/g, // Project name (unless it's the template itself)
184
+ /scene-capability-engine/g, // Project name (unless it's the template itself)
185
185
  ];
186
186
 
187
187
  projectSpecificPatterns.forEach(pattern => {
@@ -174,7 +174,7 @@ Test your template locally before submitting:
174
174
 
175
175
  \`\`\`bash
176
176
  # Apply the template to create a new Spec
177
- kse spec create test-spec --template ${metadata.name}
177
+ sce spec create test-spec --template ${metadata.name}
178
178
 
179
179
  # Verify the generated Spec is correct
180
180
  cd .kiro/specs/test-spec
@@ -238,7 +238,7 @@ If you have questions about the submission process, please:
238
238
  - Open an issue in the repository
239
239
  - Contact the maintainers
240
240
 
241
- Thank you for contributing to the kse template library!
241
+ Thank you for contributing to the sce template library!
242
242
  `;
243
243
  }
244
244
 
@@ -261,7 +261,7 @@ ${metadata.description}
261
261
  - **Tags**: ${metadata.tags.join(', ')}
262
262
  - **Author**: ${metadata.author}
263
263
  - **Version**: ${metadata.version}
264
- - **Minimum KSE Version**: ${metadata.kse_version}
264
+ - **Minimum SCE Version**: ${metadata.kse_version}
265
265
 
266
266
  ## Files Included
267
267
 
@@ -273,7 +273,7 @@ ${metadata.description}
273
273
 
274
274
  - [ ] Template files include valid YAML frontmatter
275
275
  - [ ] All project-specific content replaced with template variables
276
- - [ ] Template tested locally with \`kse spec create\`
276
+ - [ ] Template tested locally with \`sce spec create\`
277
277
  - [ ] Template follows naming conventions (kebab-case)
278
278
  - [ ] Description is clear and concise
279
279
  - [ ] Tags are relevant and searchable
@@ -284,7 +284,7 @@ ${metadata.description}
284
284
  Tested locally by applying the template:
285
285
 
286
286
  \`\`\`bash
287
- kse spec create test-spec --template ${metadata.name}
287
+ sce spec create test-spec --template ${metadata.name}
288
288
  \`\`\`
289
289
 
290
290
  ## Additional Notes
@@ -345,7 +345,7 @@ ${warnings.length > 0 ? `\n### Warnings\n\n${warnings.map(w => `- ⚠️ ${w}`).
345
345
 
346
346
  ### Testing
347
347
 
348
- - [ ] Template applied successfully with \`kse spec create\`
348
+ - [ ] Template applied successfully with \`sce spec create\`
349
349
  - [ ] Variables replaced correctly in generated Spec
350
350
  - [ ] Generated Spec is usable and makes sense
351
351
  - [ ] No errors during template application
@@ -389,19 +389,19 @@ ${metadata.description}
389
389
  ### 1. List Available Templates
390
390
 
391
391
  \`\`\`bash
392
- kse templates list
392
+ sce templates list
393
393
  \`\`\`
394
394
 
395
395
  ### 2. View Template Details
396
396
 
397
397
  \`\`\`bash
398
- kse templates show ${metadata.category}/${metadata.name}
398
+ sce templates show ${metadata.category}/${metadata.name}
399
399
  \`\`\`
400
400
 
401
401
  ### 3. Create a New Spec from This Template
402
402
 
403
403
  \`\`\`bash
404
- kse spec create my-new-feature --template ${metadata.category}/${metadata.name}
404
+ sce spec create my-new-feature --template ${metadata.category}/${metadata.name}
405
405
  \`\`\`
406
406
 
407
407
  This will create a new Spec at \`.kiro/specs/XX-00-my-new-feature/\` with:
@@ -427,7 +427,7 @@ ${metadata.description}
427
427
 
428
428
  ## Prerequisites
429
429
 
430
- - kse version ${metadata.kse_version} or higher
430
+ - sce version ${metadata.kse_version} or higher
431
431
  - Basic understanding of Spec-driven development
432
432
 
433
433
  ## Tags
@@ -441,7 +441,7 @@ After applying this template, you'll have a complete Spec structure ready to cus
441
441
  ## Questions?
442
442
 
443
443
  If you have questions about using this template:
444
- - Check the kse documentation
444
+ - Check the sce documentation
445
445
  - Review the generated Spec files
446
446
  - Open an issue in the scene-capability-engine-templates repository
447
447
  `;
@@ -492,7 +492,7 @@ If you have questions about using this template:
492
492
  ${validationResult?.valid ? '✅ Template validation passed' : '❌ Template validation failed'}
493
493
 
494
494
  ---
495
- Generated by kse templates create-from-spec
495
+ Generated by sce templates create-from-spec
496
496
  `;
497
497
 
498
498
  await fs.writeFile(path.join(outputDir, 'creation.log'), log, 'utf-8');
@@ -92,9 +92,9 @@ class MigrationEngine {
92
92
  }
93
93
 
94
94
  // Verify starting version matches plan
95
- if (versionInfo['kse-version'] !== plan.fromVersion) {
95
+ if (versionInfo['sce-version'] !== plan.fromVersion) {
96
96
  throw new Error(
97
- `Version mismatch: expected ${plan.fromVersion}, found ${versionInfo['kse-version']}`
97
+ `Version mismatch: expected ${plan.fromVersion}, found ${versionInfo['sce-version']}`
98
98
  );
99
99
  }
100
100
 
@@ -202,12 +202,12 @@ class MigrationEngine {
202
202
  warnings.push(gitignoreResult.message);
203
203
  } else if (!gitignoreResult.success) {
204
204
  warnings.push(`⚠️ .gitignore fix failed: ${gitignoreResult.message}`);
205
- warnings.push('You can fix this manually with: kse doctor --fix-gitignore');
205
+ warnings.push('You can fix this manually with: sce doctor --fix-gitignore');
206
206
  }
207
207
  } catch (gitignoreError) {
208
208
  // Don't block upgrade on .gitignore fix failure
209
209
  warnings.push(`⚠️ .gitignore check failed: ${gitignoreError.message}`);
210
- warnings.push('You can fix this manually with: kse doctor --fix-gitignore');
210
+ warnings.push('You can fix this manually with: sce doctor --fix-gitignore');
211
211
  }
212
212
 
213
213
  return {