@hongmaple0820/scale-engine 0.14.0 → 0.15.1

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 (67) hide show
  1. package/README.en.md +13 -5
  2. package/README.md +13 -5
  3. package/dist/adapters/AiderAdapter.js +52 -52
  4. package/dist/adapters/ClaudeCodeAdapter.js +5 -5
  5. package/dist/adapters/DeepSeekTuiAdapter.js +5 -5
  6. package/dist/adapters/DoubaoAdapter.js +33 -33
  7. package/dist/adapters/KimiAdapter.js +32 -32
  8. package/dist/adapters/KiroAdapter.js +26 -26
  9. package/dist/adapters/WindsurfAdapter.js +32 -32
  10. package/dist/api/cli.js +296 -3
  11. package/dist/api/cli.js.map +1 -1
  12. package/dist/api/doctor.d.ts +2 -0
  13. package/dist/api/doctor.js +83 -0
  14. package/dist/api/doctor.js.map +1 -1
  15. package/dist/api/mcp.js +2 -1
  16. package/dist/api/mcp.js.map +1 -1
  17. package/dist/capabilities/InstalledSkillsIntegration.d.ts +3 -0
  18. package/dist/capabilities/InstalledSkillsIntegration.js +41 -17
  19. package/dist/capabilities/InstalledSkillsIntegration.js.map +1 -1
  20. package/dist/cli/phaseCommands.js +63 -5
  21. package/dist/cli/phaseCommands.js.map +1 -1
  22. package/dist/core/logger.d.ts +2 -0
  23. package/dist/core/logger.js +33 -1
  24. package/dist/core/logger.js.map +1 -1
  25. package/dist/output/HTMLDocumentRenderer.js +3 -2
  26. package/dist/output/HTMLDocumentRenderer.js.map +1 -1
  27. package/dist/skills/ExternalSkills.js +9 -4
  28. package/dist/skills/ExternalSkills.js.map +1 -1
  29. package/dist/skills/SkillDiscovery.js +5 -3
  30. package/dist/skills/SkillDiscovery.js.map +1 -1
  31. package/dist/skills/SkillDoctor.js +178 -1
  32. package/dist/skills/SkillDoctor.js.map +1 -1
  33. package/dist/skills/SkillInstaller.js +5 -0
  34. package/dist/skills/SkillInstaller.js.map +1 -1
  35. package/dist/skills/routing/SkillPlanner.js +40 -40
  36. package/dist/skills/routing/SkillPolicy.js +168 -5
  37. package/dist/skills/routing/SkillPolicy.js.map +1 -1
  38. package/dist/version.d.ts +3 -0
  39. package/dist/version.js +15 -0
  40. package/dist/version.js.map +1 -0
  41. package/dist/workflow/EngineeringStandards.d.ts +143 -0
  42. package/dist/workflow/EngineeringStandards.js +679 -0
  43. package/dist/workflow/EngineeringStandards.js.map +1 -0
  44. package/dist/workflow/GovernanceTemplatePacks.d.ts +1 -1
  45. package/dist/workflow/GovernanceTemplatePacks.js +136 -10
  46. package/dist/workflow/GovernanceTemplatePacks.js.map +1 -1
  47. package/dist/workflow/GovernanceTemplates.d.ts +1 -1
  48. package/dist/workflow/GovernanceTemplates.js +606 -429
  49. package/dist/workflow/GovernanceTemplates.js.map +1 -1
  50. package/dist/workflow/ResourceGovernance.d.ts +120 -0
  51. package/dist/workflow/ResourceGovernance.js +512 -0
  52. package/dist/workflow/ResourceGovernance.js.map +1 -0
  53. package/dist/workflow/TaskArtifactScaffolder.js +13 -10
  54. package/dist/workflow/TaskArtifactScaffolder.js.map +1 -1
  55. package/dist/workflow/VerificationProfile.d.ts +2 -0
  56. package/dist/workflow/VerificationProfile.js +7 -0
  57. package/dist/workflow/VerificationProfile.js.map +1 -1
  58. package/dist/workflow/WorkspaceLifecycle.d.ts +2 -0
  59. package/dist/workflow/WorkspaceLifecycle.js +34 -8
  60. package/dist/workflow/WorkspaceLifecycle.js.map +1 -1
  61. package/dist/workflow/WorkspaceTopology.d.ts +49 -0
  62. package/dist/workflow/WorkspaceTopology.js +125 -0
  63. package/dist/workflow/WorkspaceTopology.js.map +1 -0
  64. package/dist/workflow/index.d.ts +3 -0
  65. package/dist/workflow/index.js +3 -0
  66. package/dist/workflow/index.js.map +1 -1
  67. package/package.json +2 -2
package/README.en.md CHANGED
@@ -1,14 +1,14 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.12.2-orange?style=flat-square" alt="version" />
2
+ <img src="https://img.shields.io/badge/version-0.15.1-orange?style=flat-square" alt="version" />
3
3
  <img src="https://img.shields.io/badge/platforms-16-blue?style=flat-square" alt="platforms" />
4
4
  <img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
5
5
  <img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
6
6
  <img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
7
- <img src="https://img.shields.io/badge/tests-560-passing-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.12.2-cb3837?style=flat-square&logo=npm" alt="npm" />
7
+ <img src="https://img.shields.io/badge/tests-822-passing-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.15.1-cb3837?style=flat-square&logo=npm" alt="npm" />
9
9
  </p>
10
10
 
11
- # SCALE Engine v0.11.2
11
+ # SCALE Engine v0.15.1
12
12
 
13
13
  SCALE Engine is an AI engineering workflow runtime for agentic coding tools. It turns prompt-level engineering rules into stateful workflow gates, persisted evidence, review records, and release checks.
14
14
 
@@ -28,7 +28,15 @@ Prompt instructions are advisory. Production engineering needs mechanisms:
28
28
 
29
29
  ## Current Release
30
30
 
31
- v0.11.1 introduces four priority improvements:
31
+ v0.15.1 focuses on production-grade engineering governance templates:
32
+
33
+ - Supports MOE and non-MOE workspace topology, child repository blockers, and temporary worktree cleanup candidates.
34
+ - Adds resource asset governance for maintained docs, versioned outputs, task evidence, temporary files, and forbidden commit assets.
35
+ - Adds engineering standards scans for noisy logs, sensitive data redaction, secure input handling, ORM/database usage, framework conventions, and test rigor.
36
+ - Strengthens skill and tool orchestration with routing and evidence contracts for UI/UX, web research, browser E2E, desktop automation, and external Agent CLIs.
37
+ - `scale init` / governance packs now generate service matrix, verification profile, artifact templates, metrics, resource policy, engineering standards, and tool orchestration rules.
38
+
39
+ Historical v0.11.1 introduced four priority improvements:
32
40
 
33
41
  ### Phase Commands FSM Blocking
34
42
  - `canTransition` + `process.exit(1)` ensures FSM guard failures block execution, not continue
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  <p align="center">
2
- <img src="https://img.shields.io/badge/version-0.12.3-orange?style=flat-square" alt="version" />
2
+ <img src="https://img.shields.io/badge/version-0.15.1-orange?style=flat-square" alt="version" />
3
3
  <img src="https://img.shields.io/badge/platforms-16-blue?style=flat-square" alt="platforms" />
4
4
  <img src="https://img.shields.io/badge/agents-12-blue?style=flat-square" alt="agents" />
5
5
  <img src="https://img.shields.io/badge/workflows-10-green?style=flat-square" alt="workflows" />
6
6
  <img src="https://img.shields.io/badge/detectors-19-red?style=flat-square" alt="detectors" />
7
- <img src="https://img.shields.io/badge/tests-562-passing-brightgreen?style=flat-square" alt="tests" />
8
- <img src="https://img.shields.io/badge/npm-0.12.2-cb3837?style=flat-square&logo=npm" alt="npm" />
7
+ <img src="https://img.shields.io/badge/tests-822-passing-brightgreen?style=flat-square" alt="tests" />
8
+ <img src="https://img.shields.io/badge/npm-0.15.1-cb3837?style=flat-square&logo=npm" alt="npm" />
9
9
  </p>
10
10
 
11
- # SCALE Engine v0.12.3
11
+ # SCALE Engine v0.15.1
12
12
 
13
13
  SCALE Engine 是一个面向 AI 编码 Agent 的工程化工作流运行时。它把提示词里的工程纪律,下沉为状态机、质量门禁、持久化证据、确定性 review 记录和发布检查。
14
14
 
@@ -28,7 +28,15 @@ npm:https://www.npmjs.com/package/@hongmaple0820/scale-engine
28
28
 
29
29
  ## 当前版本
30
30
 
31
- v0.11.1 新增四大优先级改进:
31
+ v0.15.1 聚焦生产级工程治理模板:
32
+
33
+ - 支持 MOE / 非 MOE 工作区拓扑、子仓库变更阻断、临时 worktree 清理候选识别。
34
+ - 增加资源资产治理,区分长期维护文档、版本化产物、任务证据、临时文件和禁止提交资产。
35
+ - 增加工程规范扫描,覆盖日志噪音、敏感信息脱敏、安全输入、ORM/数据库、框架组件和测试验证。
36
+ - 增强技能与工具编排,UI/UX、联网研究、浏览器 E2E、桌面自动化、外部 Agent CLI 都有路由和证据契约。
37
+ - `scale init` / governance pack 会生成 service matrix、verification profile、artifact 模板、metrics、resource policy、engineering standards 和 tool orchestration 规则。
38
+
39
+ 历史 v0.11.1 新增四大优先级改进:
32
40
 
33
41
  ### Phase Commands FSM 阻断
34
42
  - `canTransition` + `process.exit(1)` 确保 FSM guard 失败时阻塞流程,而非继续执行
@@ -120,58 +120,58 @@ export class AiderAdapter {
120
120
  const stackLine = techStack.length > 0
121
121
  ? `\n## Tech Stack\n${techStack.map((t) => `- ${t}`).join('\n')}\n`
122
122
  : '';
123
- return `# ${projectName}
124
- ${stackLine}
125
- ## SCALE Engine Integration (Aider)
126
-
127
- This project uses SCALE Engine for AI engineering governance via Aider CLI.
128
-
129
- ### Commands
130
- - \`scale create <type> <title>\` — Create artifact
131
- - \`scale transition <id> <action>\` — Transition artifact state
132
- - \`scale list --type Spec\` — List artifacts
133
- - \`scale role activate <role>\` — Switch role
134
- - \`scale doctor\` — Health check
135
-
136
- ### Workflow
137
- 1. **Explore** → Role: explorer (Read/Grep only)
138
- 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
139
- 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
140
- 4. **Verify** → Must run tests before claiming done
141
- 5. **Learn** → Defects → Lessons → Rules → Hooks
142
-
143
- ### Rules
144
- - 🔴 Dangerous commands are physically blocked
145
- - 🔴 Hardcoded secrets are blocked on Edit/Write
146
- - 🟡 3 identical retries triggers brute-retry detection
147
- - 🟡 Claiming done without running tests is blocked
148
- - 🟢 All tool calls are tracked in .scale/events/
149
-
150
- ### Aider-Specific Notes
151
- - Aider uses \`/add\` and \`/drop\` to manage context files
152
- - Use \`/run\` for shell commands (SCALE hooks apply)
153
- - Use \`/clear\` to reset context between phases
154
- - SCALE hooks are defined in \`.aider.conf.yml\`
155
-
156
- ### Quick Reference
157
- \`\`\`
158
- # Start with exploration
159
- > /add src/
160
- > /read AIDER.md
161
-
162
- # Plan phase
163
- > scale create Spec "Feature name"
164
-
165
- # Implement
166
- > scale role activate implementer
167
- > (make changes)
168
-
169
- # Verify
170
- > /run npm test
171
-
172
- # Complete
173
- > scale transition <id> approve
174
- \`\`\`
123
+ return `# ${projectName}
124
+ ${stackLine}
125
+ ## SCALE Engine Integration (Aider)
126
+
127
+ This project uses SCALE Engine for AI engineering governance via Aider CLI.
128
+
129
+ ### Commands
130
+ - \`scale create <type> <title>\` — Create artifact
131
+ - \`scale transition <id> <action>\` — Transition artifact state
132
+ - \`scale list --type Spec\` — List artifacts
133
+ - \`scale role activate <role>\` — Switch role
134
+ - \`scale doctor\` — Health check
135
+
136
+ ### Workflow
137
+ 1. **Explore** → Role: explorer (Read/Grep only)
138
+ 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
139
+ 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
140
+ 4. **Verify** → Must run tests before claiming done
141
+ 5. **Learn** → Defects → Lessons → Rules → Hooks
142
+
143
+ ### Rules
144
+ - 🔴 Dangerous commands are physically blocked
145
+ - 🔴 Hardcoded secrets are blocked on Edit/Write
146
+ - 🟡 3 identical retries triggers brute-retry detection
147
+ - 🟡 Claiming done without running tests is blocked
148
+ - 🟢 All tool calls are tracked in .scale/events/
149
+
150
+ ### Aider-Specific Notes
151
+ - Aider uses \`/add\` and \`/drop\` to manage context files
152
+ - Use \`/run\` for shell commands (SCALE hooks apply)
153
+ - Use \`/clear\` to reset context between phases
154
+ - SCALE hooks are defined in \`.aider.conf.yml\`
155
+
156
+ ### Quick Reference
157
+ \`\`\`
158
+ # Start with exploration
159
+ > /add src/
160
+ > /read AIDER.md
161
+
162
+ # Plan phase
163
+ > scale create Spec "Feature name"
164
+
165
+ # Implement
166
+ > scale role activate implementer
167
+ > (make changes)
168
+
169
+ # Verify
170
+ > /run npm test
171
+
172
+ # Complete
173
+ > scale transition <id> approve
174
+ \`\`\`
175
175
  `;
176
176
  }
177
177
  async init(config) {
@@ -161,11 +161,11 @@ This project uses SCALE Engine for AI engineering governance.
161
161
  writeFileSync(gitignorePath, `# SCALE Engine runtime data
162
162
  *.db
163
163
  *.db-journal
164
- events/
165
- checkpoints/
166
- evidence/
167
- state/
168
- hooks/*.sh
164
+ events/
165
+ checkpoints/
166
+ evidence/
167
+ state/
168
+ hooks/*.sh
169
169
  `, 'utf-8');
170
170
  created.push(gitignorePath);
171
171
  }
@@ -242,11 +242,11 @@ define → plan → build → verify → review → ship
242
242
  *.db
243
243
  *.db-shm
244
244
  *.db-wal
245
- events/
246
- checkpoints/
247
- evidence/
248
- state/
249
- hooks/*.sh
245
+ events/
246
+ checkpoints/
247
+ evidence/
248
+ state/
249
+ hooks/*.sh
250
250
  `, 'utf-8');
251
251
  created.push(gitignorePath);
252
252
  }
@@ -75,39 +75,39 @@ export class DoubaoAdapter {
75
75
  const stackLine = techStack.length > 0
76
76
  ? `\n## Tech Stack\n${techStack.map((t) => `- ${t}`).join('\n')}\n`
77
77
  : '';
78
- return `# ${projectName}
79
- ${stackLine}
80
- ## SCALE Engine Integration (Doubao)
81
-
82
- This project uses SCALE Engine for AI engineering governance via Doubao (ByteDance AI).
83
-
84
- ### Commands
85
- - \`scale create <type> <title>\` — Create artifact
86
- - \`scale transition <id> <action>\` — Transition artifact state
87
- - \`scale list --type Spec\` — List artifacts
88
- - \`scale role activate <role>\` — Switch role
89
- - \`scale doctor\` — Health check
90
-
91
- ### Workflow
92
- 1. **Explore** → Role: explorer (Read/Grep only)
93
- 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
- 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
- 4. **Verify** → Must run tests before claiming done
96
- 5. **Learn** → Defects → Lessons → Rules → Hooks
97
-
98
- ### Rules
99
- - 🔴 Dangerous commands are physically blocked
100
- - 🔴 Hardcoded secrets are blocked on Edit/Write
101
- - 🟡 3 identical retries triggers brute-retry detection
102
- - 🟡 Claiming done without running tests is blocked
103
- - 🟢 All tool calls are tracked in .scale/events/
104
-
105
- ### Doubao-Specific Notes
106
- - Doubao supports Chinese-optimized reasoning
107
- - Use Doubao for Chinese documentation and analysis
108
- - This rules.md file provides AI assistant context
109
- - SCALE hooks are defined in \`.doubao/settings.json\`
110
- - ByteDance Trae IDE users may also use \`scale init --agent trae\`
78
+ return `# ${projectName}
79
+ ${stackLine}
80
+ ## SCALE Engine Integration (Doubao)
81
+
82
+ This project uses SCALE Engine for AI engineering governance via Doubao (ByteDance AI).
83
+
84
+ ### Commands
85
+ - \`scale create <type> <title>\` — Create artifact
86
+ - \`scale transition <id> <action>\` — Transition artifact state
87
+ - \`scale list --type Spec\` — List artifacts
88
+ - \`scale role activate <role>\` — Switch role
89
+ - \`scale doctor\` — Health check
90
+
91
+ ### Workflow
92
+ 1. **Explore** → Role: explorer (Read/Grep only)
93
+ 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
+ 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
+ 4. **Verify** → Must run tests before claiming done
96
+ 5. **Learn** → Defects → Lessons → Rules → Hooks
97
+
98
+ ### Rules
99
+ - 🔴 Dangerous commands are physically blocked
100
+ - 🔴 Hardcoded secrets are blocked on Edit/Write
101
+ - 🟡 3 identical retries triggers brute-retry detection
102
+ - 🟡 Claiming done without running tests is blocked
103
+ - 🟢 All tool calls are tracked in .scale/events/
104
+
105
+ ### Doubao-Specific Notes
106
+ - Doubao supports Chinese-optimized reasoning
107
+ - Use Doubao for Chinese documentation and analysis
108
+ - This rules.md file provides AI assistant context
109
+ - SCALE hooks are defined in \`.doubao/settings.json\`
110
+ - ByteDance Trae IDE users may also use \`scale init --agent trae\`
111
111
  `;
112
112
  }
113
113
  async init(config) {
@@ -75,38 +75,38 @@ export class KimiAdapter {
75
75
  const stackLine = techStack.length > 0
76
76
  ? `\n## Tech Stack\n${techStack.map((t) => `- ${t}`).join('\n')}\n`
77
77
  : '';
78
- return `# ${projectName}
79
- ${stackLine}
80
- ## SCALE Engine Integration (Kimi)
81
-
82
- This project uses SCALE Engine for AI engineering governance via Kimi (Moonshot AI).
83
-
84
- ### Commands
85
- - \`scale create <type> <title>\` — Create artifact
86
- - \`scale transition <id> <action>\` — Transition artifact state
87
- - \`scale list --type Spec\` — List artifacts
88
- - \`scale role activate <role>\` — Switch role
89
- - \`scale doctor\` — Health check
90
-
91
- ### Workflow
92
- 1. **Explore** → Role: explorer (Read/Grep only)
93
- 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
- 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
- 4. **Verify** → Must run tests before claiming done
96
- 5. **Learn** → Defects → Lessons → Rules → Hooks
97
-
98
- ### Rules
99
- - 🔴 Dangerous commands are physically blocked
100
- - 🔴 Hardcoded secrets are blocked on Edit/Write
101
- - 🟡 3 identical retries triggers brute-retry detection
102
- - 🟡 Claiming done without running tests is blocked
103
- - 🟢 All tool calls are tracked in .scale/events/
104
-
105
- ### Kimi-Specific Notes
106
- - Kimi supports long-context reasoning (200K+ tokens)
107
- - Use Kimi for complex analysis and documentation tasks
108
- - This rules.md file provides AI assistant context
109
- - SCALE hooks are defined in \`.kimi/settings.json\`
78
+ return `# ${projectName}
79
+ ${stackLine}
80
+ ## SCALE Engine Integration (Kimi)
81
+
82
+ This project uses SCALE Engine for AI engineering governance via Kimi (Moonshot AI).
83
+
84
+ ### Commands
85
+ - \`scale create <type> <title>\` — Create artifact
86
+ - \`scale transition <id> <action>\` — Transition artifact state
87
+ - \`scale list --type Spec\` — List artifacts
88
+ - \`scale role activate <role>\` — Switch role
89
+ - \`scale doctor\` — Health check
90
+
91
+ ### Workflow
92
+ 1. **Explore** → Role: explorer (Read/Grep only)
93
+ 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
+ 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
+ 4. **Verify** → Must run tests before claiming done
96
+ 5. **Learn** → Defects → Lessons → Rules → Hooks
97
+
98
+ ### Rules
99
+ - 🔴 Dangerous commands are physically blocked
100
+ - 🔴 Hardcoded secrets are blocked on Edit/Write
101
+ - 🟡 3 identical retries triggers brute-retry detection
102
+ - 🟡 Claiming done without running tests is blocked
103
+ - 🟢 All tool calls are tracked in .scale/events/
104
+
105
+ ### Kimi-Specific Notes
106
+ - Kimi supports long-context reasoning (200K+ tokens)
107
+ - Use Kimi for complex analysis and documentation tasks
108
+ - This rules.md file provides AI assistant context
109
+ - SCALE hooks are defined in \`.kimi/settings.json\`
110
110
  `;
111
111
  }
112
112
  async init(config) {
@@ -75,32 +75,32 @@ export class KiroAdapter {
75
75
  const stackLine = techStack.length > 0
76
76
  ? `\n## Tech Stack\n${techStack.map((t) => `- ${t}`).join('\n')}\n`
77
77
  : '';
78
- return `# ${projectName}
79
- ${stackLine}
80
- ## SCALE Engine Integration (Kiro)
81
-
82
- This project uses SCALE Engine for AI engineering governance via Kiro.
83
-
84
- ### Commands
85
- - \`scale create <type> <title>\` — Create artifact
86
- - \`scale transition <id> <action>\` — Transition artifact state
87
- - \`scale list --type Spec\` — List artifacts
88
- - \`scale role activate <role>\` — Switch role
89
- - \`scale doctor\` — Health check
90
-
91
- ### Workflow
92
- 1. **Explore** → Role: explorer (Read/Grep only)
93
- 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
- 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
- 4. **Verify** → Must run tests before claiming done
96
- 5. **Learn** → Defects → Lessons → Rules → Hooks
97
-
98
- ### Rules
99
- - 🔴 Dangerous commands are physically blocked
100
- - 🔴 Hardcoded secrets are blocked on Edit/Write
101
- - 🟡 3 identical retries triggers brute-retry detection
102
- - 🟡 Claiming done without running tests is blocked
103
- - 🟢 All tool calls are tracked in .scale/events/
78
+ return `# ${projectName}
79
+ ${stackLine}
80
+ ## SCALE Engine Integration (Kiro)
81
+
82
+ This project uses SCALE Engine for AI engineering governance via Kiro.
83
+
84
+ ### Commands
85
+ - \`scale create <type> <title>\` — Create artifact
86
+ - \`scale transition <id> <action>\` — Transition artifact state
87
+ - \`scale list --type Spec\` — List artifacts
88
+ - \`scale role activate <role>\` — Switch role
89
+ - \`scale doctor\` — Health check
90
+
91
+ ### Workflow
92
+ 1. **Explore** → Role: explorer (Read/Grep only)
93
+ 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
94
+ 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
95
+ 4. **Verify** → Must run tests before claiming done
96
+ 5. **Learn** → Defects → Lessons → Rules → Hooks
97
+
98
+ ### Rules
99
+ - 🔴 Dangerous commands are physically blocked
100
+ - 🔴 Hardcoded secrets are blocked on Edit/Write
101
+ - 🟡 3 identical retries triggers brute-retry detection
102
+ - 🟡 Claiming done without running tests is blocked
103
+ - 🟢 All tool calls are tracked in .scale/events/
104
104
  `;
105
105
  }
106
106
  async init(config) {
@@ -77,38 +77,38 @@ export class WindsurfAdapter {
77
77
  const stackLine = techStack.length > 0
78
78
  ? `\n## Tech Stack\n${techStack.map((t) => `- ${t}`).join('\n')}\n`
79
79
  : '';
80
- return `# ${projectName}
81
- ${stackLine}
82
- ## SCALE Engine Integration (Windsurf)
83
-
84
- This project uses SCALE Engine for AI engineering governance via Windsurf.
85
-
86
- ### Commands
87
- - \`scale create <type> <title>\` — Create artifact
88
- - \`scale transition <id> <action>\` — Transition artifact state
89
- - \`scale list --type Spec\` — List artifacts
90
- - \`scale role activate <role>\` — Switch role
91
- - \`scale doctor\` — Health check
92
-
93
- ### Workflow
94
- 1. **Explore** → Role: explorer (Read/Grep only)
95
- 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
96
- 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
97
- 4. **Verify** → Must run tests before claiming done
98
- 5. **Learn** → Defects → Lessons → Rules → Hooks
99
-
100
- ### Rules
101
- - 🔴 Dangerous commands are physically blocked
102
- - 🔴 Hardcoded secrets are blocked on Edit/Write
103
- - 🟡 3 identical retries triggers brute-retry detection
104
- - 🟡 Claiming done without running tests is blocked
105
- - 🟢 All tool calls are tracked in .scale/events/
106
-
107
- ### Windsurf-Specific Notes
108
- - Windsurf uses Cascade Flow for multi-file editing
109
- - Use Chat mode for quick questions, Cascade for complex tasks
110
- - This rules.md file provides AI assistant context
111
- - SCALE hooks are defined in \`.windsurf/settings.json\`
80
+ return `# ${projectName}
81
+ ${stackLine}
82
+ ## SCALE Engine Integration (Windsurf)
83
+
84
+ This project uses SCALE Engine for AI engineering governance via Windsurf.
85
+
86
+ ### Commands
87
+ - \`scale create <type> <title>\` — Create artifact
88
+ - \`scale transition <id> <action>\` — Transition artifact state
89
+ - \`scale list --type Spec\` — List artifacts
90
+ - \`scale role activate <role>\` — Switch role
91
+ - \`scale doctor\` — Health check
92
+
93
+ ### Workflow
94
+ 1. **Explore** → Role: explorer (Read/Grep only)
95
+ 2. **Plan** → Create Spec → refine → approve (guard: ambiguity ≤ 0.2)
96
+ 3. **Implement** → Role: implementer (Edit/Write/Bash unlocked)
97
+ 4. **Verify** → Must run tests before claiming done
98
+ 5. **Learn** → Defects → Lessons → Rules → Hooks
99
+
100
+ ### Rules
101
+ - 🔴 Dangerous commands are physically blocked
102
+ - 🔴 Hardcoded secrets are blocked on Edit/Write
103
+ - 🟡 3 identical retries triggers brute-retry detection
104
+ - 🟡 Claiming done without running tests is blocked
105
+ - 🟢 All tool calls are tracked in .scale/events/
106
+
107
+ ### Windsurf-Specific Notes
108
+ - Windsurf uses Cascade Flow for multi-file editing
109
+ - Use Chat mode for quick questions, Cascade for complex tasks
110
+ - This rules.md file provides AI assistant context
111
+ - SCALE hooks are defined in \`.windsurf/settings.json\`
112
112
  `;
113
113
  }
114
114
  async init(config) {