aw-ecc 1.4.32 → 1.4.48

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 (259) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.cursor/INSTALL.md +7 -5
  3. package/.cursor/hooks/adapter.js +41 -4
  4. package/.cursor/hooks/after-agent-response.js +62 -0
  5. package/.cursor/hooks/before-submit-prompt.js +7 -1
  6. package/.cursor/hooks/post-tool-use-failure.js +21 -0
  7. package/.cursor/hooks/post-tool-use.js +39 -0
  8. package/.cursor/hooks/shared/aw-phase-definitions.js +53 -0
  9. package/.cursor/hooks/shared/aw-phase-runner.js +3 -1
  10. package/.cursor/hooks/subagent-start.js +22 -4
  11. package/.cursor/hooks/subagent-stop.js +18 -1
  12. package/.cursor/hooks.json +23 -2
  13. package/.opencode/package.json +1 -1
  14. package/AGENTS.md +3 -3
  15. package/README.md +5 -5
  16. package/commands/adk.md +52 -0
  17. package/commands/build.md +22 -9
  18. package/commands/deploy.md +12 -0
  19. package/commands/execute.md +9 -0
  20. package/commands/feature.md +333 -0
  21. package/commands/investigate.md +18 -5
  22. package/commands/plan.md +23 -9
  23. package/commands/publish.md +65 -0
  24. package/commands/review.md +12 -0
  25. package/commands/ship.md +12 -0
  26. package/commands/test.md +12 -0
  27. package/commands/verify.md +9 -0
  28. package/hooks/hooks.json +36 -0
  29. package/manifests/install-components.json +8 -0
  30. package/manifests/install-modules.json +83 -0
  31. package/manifests/install-profiles.json +7 -0
  32. package/package.json +2 -2
  33. package/scripts/ci/validate-rules.js +51 -0
  34. package/scripts/cursor-aw-home/hooks.json +23 -2
  35. package/scripts/cursor-aw-hooks/adapter.js +41 -4
  36. package/scripts/cursor-aw-hooks/before-submit-prompt.js +7 -1
  37. package/scripts/hooks/aw-usage-commit-created.js +32 -0
  38. package/scripts/hooks/aw-usage-post-tool-use-failure.js +56 -0
  39. package/scripts/hooks/aw-usage-post-tool-use.js +242 -0
  40. package/scripts/hooks/aw-usage-prompt-submit.js +112 -0
  41. package/scripts/hooks/aw-usage-session-start.js +48 -0
  42. package/scripts/hooks/aw-usage-stop.js +182 -0
  43. package/scripts/hooks/aw-usage-telemetry-send.js +84 -0
  44. package/scripts/hooks/cost-tracker.js +3 -23
  45. package/scripts/hooks/shared/aw-phase-definitions.js +53 -0
  46. package/scripts/hooks/shared/aw-phase-runner.js +3 -1
  47. package/scripts/lib/aw-hook-contract.js +2 -2
  48. package/scripts/lib/aw-pricing.js +306 -0
  49. package/scripts/lib/aw-usage-telemetry.js +472 -0
  50. package/scripts/lib/codex-hook-config.js +8 -8
  51. package/scripts/lib/cursor-hook-config.js +25 -10
  52. package/scripts/lib/install-targets/cursor-project.js +3 -0
  53. package/scripts/lib/install-targets/helpers.js +20 -3
  54. package/skills/aw-adk/SKILL.md +317 -0
  55. package/skills/aw-adk/agents/analyzer.md +113 -0
  56. package/skills/aw-adk/agents/comparator.md +113 -0
  57. package/skills/aw-adk/agents/grader.md +115 -0
  58. package/skills/aw-adk/assets/eval_review.html +76 -0
  59. package/skills/aw-adk/eval-viewer/generate_review.py +164 -0
  60. package/skills/aw-adk/eval-viewer/viewer.html +181 -0
  61. package/skills/aw-adk/evals/eval-colocated-placement.md +84 -0
  62. package/skills/aw-adk/evals/eval-create-agent.md +90 -0
  63. package/skills/aw-adk/evals/eval-create-command.md +98 -0
  64. package/skills/aw-adk/evals/eval-create-eval.md +89 -0
  65. package/skills/aw-adk/evals/eval-create-rule.md +99 -0
  66. package/skills/aw-adk/evals/eval-create-skill.md +97 -0
  67. package/skills/aw-adk/evals/eval-delete-agent.md +79 -0
  68. package/skills/aw-adk/evals/eval-delete-command.md +89 -0
  69. package/skills/aw-adk/evals/eval-delete-rule.md +86 -0
  70. package/skills/aw-adk/evals/eval-delete-skill.md +90 -0
  71. package/skills/aw-adk/evals/eval-meta-eval-coverage.md +78 -0
  72. package/skills/aw-adk/evals/eval-meta-eval-determinism.md +81 -0
  73. package/skills/aw-adk/evals/eval-meta-eval-false-pass.md +81 -0
  74. package/skills/aw-adk/evals/eval-score-accuracy.md +95 -0
  75. package/skills/aw-adk/evals/eval-type-redirect.md +68 -0
  76. package/skills/aw-adk/evals/evals.json +96 -0
  77. package/skills/aw-adk/references/artifact-wiring.md +162 -0
  78. package/skills/aw-adk/references/cross-ide-mapping.md +71 -0
  79. package/skills/aw-adk/references/eval-placement-guide.md +183 -0
  80. package/skills/aw-adk/references/external-resources.md +75 -0
  81. package/skills/aw-adk/references/getting-started.md +66 -0
  82. package/skills/aw-adk/references/registry-structure.md +152 -0
  83. package/skills/aw-adk/references/rubric-agent.md +36 -0
  84. package/skills/aw-adk/references/rubric-command.md +36 -0
  85. package/skills/aw-adk/references/rubric-eval.md +36 -0
  86. package/skills/aw-adk/references/rubric-meta-eval.md +132 -0
  87. package/skills/aw-adk/references/rubric-rule.md +36 -0
  88. package/skills/aw-adk/references/rubric-skill.md +36 -0
  89. package/skills/aw-adk/references/schemas.md +222 -0
  90. package/skills/aw-adk/references/template-agent.md +251 -0
  91. package/skills/aw-adk/references/template-command.md +279 -0
  92. package/skills/aw-adk/references/template-eval.md +176 -0
  93. package/skills/aw-adk/references/template-rule.md +119 -0
  94. package/skills/aw-adk/references/template-skill.md +123 -0
  95. package/skills/aw-adk/references/type-classifier.md +98 -0
  96. package/skills/aw-adk/references/writing-good-agents.md +227 -0
  97. package/skills/aw-adk/references/writing-good-commands.md +258 -0
  98. package/skills/aw-adk/references/writing-good-evals.md +271 -0
  99. package/skills/aw-adk/references/writing-good-rules.md +214 -0
  100. package/skills/aw-adk/references/writing-good-skills.md +159 -0
  101. package/skills/aw-adk/scripts/aggregate-benchmark.py +190 -0
  102. package/skills/aw-adk/scripts/lint-artifact.sh +211 -0
  103. package/skills/aw-adk/scripts/score-artifact.sh +179 -0
  104. package/skills/aw-adk/scripts/trigger-eval.py +192 -0
  105. package/skills/aw-build/SKILL.md +19 -2
  106. package/skills/aw-deploy/SKILL.md +65 -3
  107. package/skills/aw-design/SKILL.md +156 -0
  108. package/skills/aw-design/references/highrise-tokens.md +394 -0
  109. package/skills/aw-design/references/micro-interactions.md +76 -0
  110. package/skills/aw-design/references/prompt-template.md +160 -0
  111. package/skills/aw-design/references/quality-checklist.md +70 -0
  112. package/skills/aw-design/references/self-review.md +497 -0
  113. package/skills/aw-design/references/stitch-workflow.md +127 -0
  114. package/skills/aw-feature/SKILL.md +293 -0
  115. package/skills/aw-investigate/SKILL.md +17 -0
  116. package/skills/aw-plan/SKILL.md +34 -3
  117. package/skills/aw-publish/SKILL.md +300 -0
  118. package/skills/aw-publish/evals/eval-confirmation-gate.md +60 -0
  119. package/skills/aw-publish/evals/eval-intent-detection.md +111 -0
  120. package/skills/aw-publish/evals/eval-push-modes.md +67 -0
  121. package/skills/aw-publish/evals/eval-rules-push.md +60 -0
  122. package/skills/aw-publish/evals/evals.json +29 -0
  123. package/skills/aw-publish/references/push-modes.md +38 -0
  124. package/skills/aw-review/SKILL.md +88 -9
  125. package/skills/aw-rules-review/SKILL.md +124 -0
  126. package/skills/aw-rules-review/agents/openai.yaml +3 -0
  127. package/skills/aw-rules-review/scripts/generate-review-template.mjs +323 -0
  128. package/skills/aw-ship/SKILL.md +16 -0
  129. package/skills/aw-spec/SKILL.md +15 -0
  130. package/skills/aw-tasks/SKILL.md +15 -0
  131. package/skills/aw-test/SKILL.md +16 -0
  132. package/skills/aw-yolo/SKILL.md +4 -0
  133. package/skills/diagnose/SKILL.md +121 -0
  134. package/skills/diagnose/scripts/hitl-loop.template.sh +41 -0
  135. package/skills/finish-only-when-green/SKILL.md +265 -0
  136. package/skills/grill-me/SKILL.md +24 -0
  137. package/skills/grill-with-docs/SKILL.md +92 -0
  138. package/skills/grill-with-docs/adr-format.md +47 -0
  139. package/skills/grill-with-docs/context-format.md +67 -0
  140. package/skills/improve-codebase-architecture/SKILL.md +75 -0
  141. package/skills/improve-codebase-architecture/deepening.md +37 -0
  142. package/skills/improve-codebase-architecture/interface-design.md +44 -0
  143. package/skills/improve-codebase-architecture/language.md +53 -0
  144. package/skills/local-ghl-setup-from-screenshot/SKILL.md +538 -0
  145. package/skills/tdd/SKILL.md +115 -0
  146. package/skills/tdd/deep-modules.md +33 -0
  147. package/skills/tdd/interface-design.md +31 -0
  148. package/skills/tdd/mocking.md +59 -0
  149. package/skills/tdd/refactoring.md +10 -0
  150. package/skills/tdd/tests.md +61 -0
  151. package/skills/to-issues/SKILL.md +62 -0
  152. package/skills/to-prd/SKILL.md +75 -0
  153. package/skills/using-aw-skills/SKILL.md +170 -237
  154. package/skills/using-aw-skills/hooks/session-start.sh +11 -41
  155. package/skills/zoom-out/SKILL.md +24 -0
  156. package/.codex/hooks/aw-post-tool-use.sh +0 -6
  157. package/.codex/hooks/aw-pre-tool-use.sh +0 -6
  158. package/.codex/hooks/aw-session-start.sh +0 -25
  159. package/.codex/hooks/aw-stop.sh +0 -6
  160. package/.codex/hooks/aw-user-prompt-submit.sh +0 -10
  161. package/.codex/hooks.json +0 -62
  162. package/.cursor/rules/common-agents.md +0 -53
  163. package/.cursor/rules/common-aw-routing.md +0 -43
  164. package/.cursor/rules/common-coding-style.md +0 -52
  165. package/.cursor/rules/common-development-workflow.md +0 -33
  166. package/.cursor/rules/common-git-workflow.md +0 -28
  167. package/.cursor/rules/common-hooks.md +0 -34
  168. package/.cursor/rules/common-patterns.md +0 -35
  169. package/.cursor/rules/common-performance.md +0 -59
  170. package/.cursor/rules/common-security.md +0 -33
  171. package/.cursor/rules/common-testing.md +0 -33
  172. package/.cursor/skills/api-and-interface-design/SKILL.md +0 -75
  173. package/.cursor/skills/article-writing/SKILL.md +0 -85
  174. package/.cursor/skills/aw-brainstorm/SKILL.md +0 -115
  175. package/.cursor/skills/aw-build/SKILL.md +0 -152
  176. package/.cursor/skills/aw-build/evals/build-stage-cases.json +0 -28
  177. package/.cursor/skills/aw-debug/SKILL.md +0 -49
  178. package/.cursor/skills/aw-deploy/SKILL.md +0 -101
  179. package/.cursor/skills/aw-deploy/evals/deploy-stage-cases.json +0 -32
  180. package/.cursor/skills/aw-execute/SKILL.md +0 -47
  181. package/.cursor/skills/aw-execute/references/mode-code.md +0 -47
  182. package/.cursor/skills/aw-execute/references/mode-docs.md +0 -28
  183. package/.cursor/skills/aw-execute/references/mode-infra.md +0 -44
  184. package/.cursor/skills/aw-execute/references/mode-migration.md +0 -58
  185. package/.cursor/skills/aw-execute/references/worker-implementer.md +0 -26
  186. package/.cursor/skills/aw-execute/references/worker-parallel-worker.md +0 -23
  187. package/.cursor/skills/aw-execute/references/worker-quality-reviewer.md +0 -23
  188. package/.cursor/skills/aw-execute/references/worker-spec-reviewer.md +0 -23
  189. package/.cursor/skills/aw-execute/scripts/build-worker-bundle.js +0 -229
  190. package/.cursor/skills/aw-finish/SKILL.md +0 -111
  191. package/.cursor/skills/aw-investigate/SKILL.md +0 -109
  192. package/.cursor/skills/aw-plan/SKILL.md +0 -368
  193. package/.cursor/skills/aw-prepare/SKILL.md +0 -118
  194. package/.cursor/skills/aw-review/SKILL.md +0 -118
  195. package/.cursor/skills/aw-ship/SKILL.md +0 -115
  196. package/.cursor/skills/aw-spec/SKILL.md +0 -104
  197. package/.cursor/skills/aw-tasks/SKILL.md +0 -138
  198. package/.cursor/skills/aw-test/SKILL.md +0 -118
  199. package/.cursor/skills/aw-verify/SKILL.md +0 -51
  200. package/.cursor/skills/aw-yolo/SKILL.md +0 -111
  201. package/.cursor/skills/browser-testing-with-devtools/SKILL.md +0 -81
  202. package/.cursor/skills/bun-runtime/SKILL.md +0 -84
  203. package/.cursor/skills/ci-cd-and-automation/SKILL.md +0 -71
  204. package/.cursor/skills/code-simplification/SKILL.md +0 -74
  205. package/.cursor/skills/content-engine/SKILL.md +0 -88
  206. package/.cursor/skills/context-engineering/SKILL.md +0 -74
  207. package/.cursor/skills/deprecation-and-migration/SKILL.md +0 -75
  208. package/.cursor/skills/documentation-and-adrs/SKILL.md +0 -75
  209. package/.cursor/skills/documentation-lookup/SKILL.md +0 -90
  210. package/.cursor/skills/frontend-slides/SKILL.md +0 -184
  211. package/.cursor/skills/frontend-slides/STYLE_PRESETS.md +0 -330
  212. package/.cursor/skills/frontend-ui-engineering/SKILL.md +0 -68
  213. package/.cursor/skills/git-workflow-and-versioning/SKILL.md +0 -75
  214. package/.cursor/skills/idea-refine/SKILL.md +0 -84
  215. package/.cursor/skills/incremental-implementation/SKILL.md +0 -75
  216. package/.cursor/skills/investor-materials/SKILL.md +0 -96
  217. package/.cursor/skills/investor-outreach/SKILL.md +0 -76
  218. package/.cursor/skills/market-research/SKILL.md +0 -75
  219. package/.cursor/skills/mcp-server-patterns/SKILL.md +0 -67
  220. package/.cursor/skills/nextjs-turbopack/SKILL.md +0 -44
  221. package/.cursor/skills/performance-optimization/SKILL.md +0 -77
  222. package/.cursor/skills/security-and-hardening/SKILL.md +0 -70
  223. package/.cursor/skills/using-aw-skills/SKILL.md +0 -290
  224. package/.cursor/skills/using-aw-skills/evals/skill-trigger-cases.tsv +0 -25
  225. package/.cursor/skills/using-aw-skills/evals/test-skill-triggers.sh +0 -171
  226. package/.cursor/skills/using-aw-skills/hooks/hooks.json +0 -9
  227. package/.cursor/skills/using-aw-skills/hooks/session-start.sh +0 -67
  228. package/.cursor/skills/using-platform-skills/SKILL.md +0 -163
  229. package/.cursor/skills/using-platform-skills/evals/platform-selection-cases.json +0 -52
  230. /package/.cursor/rules/{golang-coding-style.md → golang-coding-style.mdc} +0 -0
  231. /package/.cursor/rules/{golang-hooks.md → golang-hooks.mdc} +0 -0
  232. /package/.cursor/rules/{golang-patterns.md → golang-patterns.mdc} +0 -0
  233. /package/.cursor/rules/{golang-security.md → golang-security.mdc} +0 -0
  234. /package/.cursor/rules/{golang-testing.md → golang-testing.mdc} +0 -0
  235. /package/.cursor/rules/{kotlin-coding-style.md → kotlin-coding-style.mdc} +0 -0
  236. /package/.cursor/rules/{kotlin-hooks.md → kotlin-hooks.mdc} +0 -0
  237. /package/.cursor/rules/{kotlin-patterns.md → kotlin-patterns.mdc} +0 -0
  238. /package/.cursor/rules/{kotlin-security.md → kotlin-security.mdc} +0 -0
  239. /package/.cursor/rules/{kotlin-testing.md → kotlin-testing.mdc} +0 -0
  240. /package/.cursor/rules/{php-coding-style.md → php-coding-style.mdc} +0 -0
  241. /package/.cursor/rules/{php-hooks.md → php-hooks.mdc} +0 -0
  242. /package/.cursor/rules/{php-patterns.md → php-patterns.mdc} +0 -0
  243. /package/.cursor/rules/{php-security.md → php-security.mdc} +0 -0
  244. /package/.cursor/rules/{php-testing.md → php-testing.mdc} +0 -0
  245. /package/.cursor/rules/{python-coding-style.md → python-coding-style.mdc} +0 -0
  246. /package/.cursor/rules/{python-hooks.md → python-hooks.mdc} +0 -0
  247. /package/.cursor/rules/{python-patterns.md → python-patterns.mdc} +0 -0
  248. /package/.cursor/rules/{python-security.md → python-security.mdc} +0 -0
  249. /package/.cursor/rules/{python-testing.md → python-testing.mdc} +0 -0
  250. /package/.cursor/rules/{swift-coding-style.md → swift-coding-style.mdc} +0 -0
  251. /package/.cursor/rules/{swift-hooks.md → swift-hooks.mdc} +0 -0
  252. /package/.cursor/rules/{swift-patterns.md → swift-patterns.mdc} +0 -0
  253. /package/.cursor/rules/{swift-security.md → swift-security.mdc} +0 -0
  254. /package/.cursor/rules/{swift-testing.md → swift-testing.mdc} +0 -0
  255. /package/.cursor/rules/{typescript-coding-style.md → typescript-coding-style.mdc} +0 -0
  256. /package/.cursor/rules/{typescript-hooks.md → typescript-hooks.mdc} +0 -0
  257. /package/.cursor/rules/{typescript-patterns.md → typescript-patterns.mdc} +0 -0
  258. /package/.cursor/rules/{typescript-security.md → typescript-security.mdc} +0 -0
  259. /package/.cursor/rules/{typescript-testing.md → typescript-testing.mdc} +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aw",
3
- "version": "1.4.25",
3
+ "version": "1.4.47",
4
4
  "description": "GoHighLevel Agentic Workspace Engine — agents, skills, commands, hooks, and rules for GHL development workflows.",
5
5
  "author": {
6
6
  "name": "GoHighLevel",
@@ -20,11 +20,13 @@ Cursor-facing rules or prompts should point at:
20
20
 
21
21
  Map intent to the same public stage surface:
22
22
 
23
- - `/aw:plan`
24
- - `/aw:execute`
25
- - `/aw:verify`
26
- - `/aw:deploy`
27
- - `/aw:ship`
23
+ - `/aw-adk` — create, improve, fix, score, audit CASRE artifacts in .aw_registry/
24
+ - `/aw-publish` — push registry content to remote platform-docs via PR
25
+ - `/aw-plan`
26
+ - `/aw-execute`
27
+ - `/aw-verify`
28
+ - `/aw-deploy`
29
+ - `/aw-ship`
28
30
 
29
31
  ## Contract Rule
30
32
 
@@ -23,8 +23,9 @@ function readStdin() {
23
23
  }
24
24
 
25
25
  function getPluginRoot() {
26
- const homeStyleRoot = path.resolve(__dirname, '..');
26
+ const os = require('os');
27
27
  const repoStyleRoot = path.resolve(__dirname, '..', '..');
28
+ const awEccHome = path.join(os.homedir(), '.aw-ecc');
28
29
 
29
30
  if (
30
31
  fs.existsSync(path.join(repoStyleRoot, 'package.json'))
@@ -34,7 +35,11 @@ function getPluginRoot() {
34
35
  return repoStyleRoot;
35
36
  }
36
37
 
37
- return homeStyleRoot;
38
+ if (fs.existsSync(path.join(awEccHome, 'scripts', 'lib', 'aw-usage-telemetry.js'))) {
39
+ return awEccHome;
40
+ }
41
+
42
+ return path.resolve(__dirname, '..');
38
43
  }
39
44
 
40
45
  function transformToClaude(cursorInput, overrides = {}) {
@@ -43,12 +48,17 @@ function transformToClaude(cursorInput, overrides = {}) {
43
48
  const inferredToolName = cursorInput.tool_name
44
49
  || (server && tool ? `mcp__${server}__${tool}` : '');
45
50
 
51
+ // Preserve original tool_input fields (skill, subagent_type, description, etc.)
52
+ const originalToolInput = cursorInput.tool_input || {};
53
+
46
54
  return {
47
55
  tool_name: inferredToolName,
48
56
  server,
49
57
  tool,
58
+ exit_code: cursorInput.exit_code,
50
59
  tool_input: {
51
- command: cursorInput.command || cursorInput.args?.command || '',
60
+ ...originalToolInput,
61
+ command: cursorInput.command || cursorInput.args?.command || originalToolInput.command || '',
52
62
  file_path: cursorInput.path || cursorInput.file || cursorInput.args?.filePath || '',
53
63
  server,
54
64
  mcp_server: server,
@@ -60,7 +70,28 @@ function transformToClaude(cursorInput, overrides = {}) {
60
70
  output: cursorInput.output || cursorInput.result || '',
61
71
  ...overrides.tool_output,
62
72
  },
73
+ tool_response: {
74
+ exit_code: cursorInput.exit_code,
75
+ output: cursorInput.output || cursorInput.result || '',
76
+ },
63
77
  transcript_path: cursorInput.transcript_path || cursorInput.transcriptPath || cursorInput.session?.transcript_path || '',
78
+ // Cursor common schema fields surfaced at top level for buildEvent()
79
+ generation_id: cursorInput.generation_id,
80
+ conversation_id: cursorInput.conversation_id,
81
+ workspace_roots: cursorInput.workspace_roots,
82
+ model: cursorInput.model,
83
+ user_email: cursorInput.user_email,
84
+ cursor_version: cursorInput.cursor_version,
85
+ status: cursorInput.status,
86
+ reason: cursorInput.reason,
87
+ // Token fields — Cursor sends these on afterAgentResponse and stop hooks
88
+ input_tokens: cursorInput.input_tokens,
89
+ output_tokens: cursorInput.output_tokens,
90
+ cache_read_tokens: cursorInput.cache_read_tokens,
91
+ cache_write_tokens: cursorInput.cache_write_tokens,
92
+ // Subagent fields
93
+ task: cursorInput.task,
94
+ description: cursorInput.description,
64
95
  _cursor: {
65
96
  conversation_id: cursorInput.conversation_id,
66
97
  hook_event_name: cursorInput.hook_event_name,
@@ -100,7 +131,13 @@ function runExistingHook(scriptName, stdinData) {
100
131
  path.join(root, 'scripts', 'hooks', scriptName),
101
132
  path.join(root, 'hooks', scriptName),
102
133
  ];
103
- const scriptPath = candidates.find(candidate => fs.existsSync(candidate)) || candidates[0];
134
+ const scriptPath = candidates.find(candidate => fs.existsSync(candidate));
135
+ if (!scriptPath) {
136
+ if (process.env.AW_HOOK_DEBUG === '1') {
137
+ process.stderr.write(`[aw] Cannot find hook script: ${scriptName}\n`);
138
+ }
139
+ return undefined;
140
+ }
104
141
  return runManagedCommand('node', [scriptPath], stdinData);
105
142
  }
106
143
 
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Cursor afterAgentResponse hook.
4
+ *
5
+ * Fires after EVERY assistant response with token counts directly in the
6
+ * payload. Emits a `response_completed` telemetry event with tokens, cost,
7
+ * and the full common schema fields surfaced by adapter.js.
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ const path = require('path');
13
+ const { readStdin, transformToClaude, getPluginRoot } = require('./adapter');
14
+
15
+ readStdin().then(raw => {
16
+ try {
17
+ const root = getPluginRoot();
18
+ const { buildEvent, sendAsync } = require(path.join(root, 'scripts', 'lib', 'aw-usage-telemetry'));
19
+ const { estimateCost, toNumber } = require(path.join(root, 'scripts', 'lib', 'aw-pricing'));
20
+
21
+ const input = JSON.parse(raw);
22
+ const claudeInput = transformToClaude(input);
23
+
24
+ const model = input.model || claudeInput.model || null;
25
+ const inputTokens = toNumber(input.input_tokens);
26
+ const outputTokens = toNumber(input.output_tokens);
27
+ const cacheReadTokens = toNumber(input.cache_read_tokens);
28
+ const cacheWriteTokens = toNumber(input.cache_write_tokens);
29
+
30
+ const payload = {
31
+ stop_reason: input.status || 'end_turn',
32
+ };
33
+
34
+ if (model) {
35
+ payload.model = model;
36
+ }
37
+
38
+ if (inputTokens || outputTokens) {
39
+ payload.input_tokens = inputTokens;
40
+ payload.output_tokens = outputTokens;
41
+ payload.estimated_cost_usd = estimateCost(model, inputTokens, outputTokens, {
42
+ cacheReadTokens: cacheReadTokens,
43
+ cacheWriteTokens: cacheWriteTokens,
44
+ });
45
+ }
46
+
47
+ if (cacheReadTokens || cacheWriteTokens) {
48
+ payload.cache_read_tokens = cacheReadTokens;
49
+ payload.cache_create_tokens = cacheWriteTokens;
50
+ }
51
+
52
+ const event = buildEvent(claudeInput, 'response_completed', payload);
53
+ if (model && !event.model) {
54
+ event.model = model;
55
+ }
56
+ sendAsync(event);
57
+ } catch {
58
+ // Telemetry is non-blocking.
59
+ }
60
+
61
+ process.stdout.write('{}');
62
+ }).catch(() => process.exit(0));
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const { readStdin, runManagedShellHook } = require('./adapter');
2
+ const { readStdin, runManagedShellHook, runExistingHook, transformToClaude } = require('./adapter');
3
3
 
4
4
  function emitAwPromptReminder(raw) {
5
5
  const result = runManagedShellHook('scripts/hooks/shared/user-prompt-submit.sh', raw);
@@ -37,5 +37,11 @@ readStdin().then(raw => {
37
37
  } catch (_error) {
38
38
  // Reminder emission is advisory and should not break the prompt flow.
39
39
  }
40
+ try {
41
+ const claudePayload = transformToClaude(JSON.parse(raw));
42
+ runExistingHook('aw-usage-prompt-submit.js', JSON.stringify(claudePayload));
43
+ } catch (_error) {
44
+ // Telemetry is best-effort and should not block prompt submission.
45
+ }
40
46
  process.stdout.write(raw);
41
47
  }).catch(() => process.exit(0));
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Cursor postToolUseFailure hook — fires when any tool fails, times out, or is denied.
4
+ *
5
+ * Cursor payload: tool_name, tool_input, error_message, failure_type, duration
6
+ * Routes to the shared aw-usage-post-tool-use-failure.js telemetry handler.
7
+ */
8
+ const { readStdin, transformToClaude, runExistingHook } = require('./adapter');
9
+
10
+ readStdin().then(raw => {
11
+ try {
12
+ const input = JSON.parse(raw);
13
+ const claudePayload = transformToClaude(input);
14
+ // Pass through Cursor's native error fields — the shared handler normalizes them
15
+ claudePayload.tool_name = input.tool_name || 'unknown';
16
+ claudePayload.error_message = input.error_message || '';
17
+ claudePayload.failure_type = input.failure_type || 'error';
18
+ runExistingHook('aw-usage-post-tool-use-failure.js', JSON.stringify(claudePayload));
19
+ } catch {}
20
+ process.stdout.write(raw);
21
+ }).catch(() => process.exit(0));
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Cursor postToolUse hook — fires after ALL tool completions.
4
+ *
5
+ * Shell/Edit/MCP are already handled by afterShellExecution, afterFileEdit,
6
+ * afterMCPExecution via the phase adapter. This handler covers tools those
7
+ * miss — primarily Read (for skill_invoked detection).
8
+ */
9
+ const { readStdin, transformToClaude, runExistingHook } = require('./adapter');
10
+
11
+ // Tools already covered by specific after* hooks — skip to avoid duplicates
12
+ const COVERED_TOOLS = new Set([
13
+ 'shell', 'bash', 'terminal', // afterShellExecution
14
+ 'edit', 'write', 'file_edit', // afterFileEdit
15
+ 'mcp', 'mcp_tool', // afterMCPExecution
16
+ ]);
17
+
18
+ readStdin().then(raw => {
19
+ try {
20
+ const input = JSON.parse(raw);
21
+ const toolName = (input.tool_name || '').toLowerCase();
22
+
23
+ // Skip tools already covered by specific hooks
24
+ if (COVERED_TOOLS.has(toolName)) {
25
+ process.stdout.write(raw);
26
+ return;
27
+ }
28
+
29
+ // Transform and route to the shared telemetry handler
30
+ const claudePayload = transformToClaude(input);
31
+ claudePayload.tool_name = input.tool_name || 'Read';
32
+ claudePayload.tool_input = {
33
+ ...claudePayload.tool_input,
34
+ file_path: input.tool_input?.file_path || input.tool_input?.path || '',
35
+ };
36
+ runExistingHook('aw-usage-post-tool-use.js', JSON.stringify(claudePayload));
37
+ } catch {}
38
+ process.stdout.write(raw);
39
+ }).catch(() => process.exit(0));
@@ -1,3 +1,16 @@
1
+ const PHASE_NAMES = Object.freeze({
2
+ SESSION_START: 'session-start',
3
+ USER_PROMPT_SUBMIT: 'user-prompt-submit',
4
+ PRE_TOOL_USE_SHELL: 'pre-tool-use-shell',
5
+ PRE_TOOL_USE_MCP: 'pre-tool-use-mcp',
6
+ POST_TOOL_USE_SHELL: 'post-tool-use-shell',
7
+ POST_TOOL_USE_FILE_EDIT: 'post-tool-use-file-edit',
8
+ POST_TOOL_USE_MCP: 'post-tool-use-mcp',
9
+ PRE_COMPACT: 'pre-compact',
10
+ SESSION_END: 'session-end',
11
+ STOP: 'stop',
12
+ });
13
+
1
14
  const SHARED_AW_PHASE_STEPS = Object.freeze({
2
15
  'session-start': [
3
16
  {
@@ -8,6 +21,13 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
8
21
  payloadMode: 'raw',
9
22
  outputMode: 'cursor-session-start',
10
23
  },
24
+ {
25
+ hookId: 'telemetry:session-start',
26
+ allowedProfiles: ['minimal', 'standard', 'strict'],
27
+ runner: 'node',
28
+ relativeScriptPath: 'scripts/hooks/aw-usage-session-start.js',
29
+ payloadMode: 'claude',
30
+ },
11
31
  ],
12
32
  'user-prompt-submit': [
13
33
  {
@@ -15,6 +35,13 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
15
35
  relativeScriptPath: '.cursor/hooks/shared/user-prompt-submit.sh',
16
36
  payloadMode: 'raw',
17
37
  },
38
+ {
39
+ hookId: 'telemetry:prompt-submit',
40
+ allowedProfiles: ['minimal', 'standard', 'strict'],
41
+ runner: 'node',
42
+ relativeScriptPath: 'scripts/hooks/aw-usage-prompt-submit.js',
43
+ payloadMode: 'claude',
44
+ },
18
45
  ],
19
46
  'pre-tool-use-shell': [
20
47
  {
@@ -70,6 +97,13 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
70
97
  relativeScriptPath: 'scripts/hooks/post-bash-build-complete.js',
71
98
  payloadMode: 'claude',
72
99
  },
100
+ {
101
+ hookId: 'telemetry:post-tool-use',
102
+ allowedProfiles: ['minimal', 'standard', 'strict'],
103
+ runner: 'node',
104
+ relativeScriptPath: 'scripts/hooks/aw-usage-post-tool-use.js',
105
+ payloadMode: 'claude',
106
+ },
73
107
  ],
74
108
  'post-tool-use-file-edit': [
75
109
  {
@@ -100,6 +134,13 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
100
134
  relativeScriptPath: 'scripts/hooks/post-edit-console-warn.js',
101
135
  payloadMode: 'claude',
102
136
  },
137
+ {
138
+ hookId: 'telemetry:post-tool-use',
139
+ allowedProfiles: ['minimal', 'standard', 'strict'],
140
+ runner: 'node',
141
+ relativeScriptPath: 'scripts/hooks/aw-usage-post-tool-use.js',
142
+ payloadMode: 'claude',
143
+ },
103
144
  ],
104
145
  'post-tool-use-mcp': [
105
146
  {
@@ -109,6 +150,13 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
109
150
  relativeScriptPath: 'scripts/hooks/post-mcp-log.js',
110
151
  payloadMode: 'raw',
111
152
  },
153
+ {
154
+ hookId: 'telemetry:post-tool-use',
155
+ allowedProfiles: ['minimal', 'standard', 'strict'],
156
+ runner: 'node',
157
+ relativeScriptPath: 'scripts/hooks/aw-usage-post-tool-use.js',
158
+ payloadMode: 'claude',
159
+ },
112
160
  ],
113
161
  'pre-compact': [
114
162
  {
@@ -125,6 +173,8 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
125
173
  relativeScriptPath: 'scripts/hooks/session-end-marker.js',
126
174
  payloadMode: 'claude',
127
175
  },
176
+ // telemetry:session-end removed — afterAgentResponse hook now emits
177
+ // response_completed per turn with direct token/cost data from Cursor.
128
178
  ],
129
179
  stop: [
130
180
  {
@@ -155,6 +205,8 @@ const SHARED_AW_PHASE_STEPS = Object.freeze({
155
205
  relativeScriptPath: 'scripts/hooks/cost-tracker.js',
156
206
  payloadMode: 'claude',
157
207
  },
208
+ // telemetry:stop removed — Cursor fires both sessionEnd and stop,
209
+ // causing duplicate session_ended events. Telemetry is in session-end phase only.
158
210
  ],
159
211
  });
160
212
 
@@ -167,6 +219,7 @@ function getSharedAwPhaseSteps(phaseName) {
167
219
  }
168
220
 
169
221
  module.exports = {
222
+ PHASE_NAMES,
170
223
  SHARED_AW_PHASE_STEPS,
171
224
  getSharedAwPhaseSteps,
172
225
  };
@@ -39,7 +39,9 @@ function formatCursorSessionStartOutput(stdout, fallbackRaw) {
39
39
  if (typeof additionalContext === 'string' && additionalContext.trim() !== '') {
40
40
  return `${JSON.stringify({ additional_context: additionalContext }, null, 2)}\n`;
41
41
  }
42
- } catch {}
42
+ } catch (_error) {
43
+ return fallbackRaw;
44
+ }
43
45
 
44
46
  return fallbackRaw;
45
47
  }
@@ -1,10 +1,28 @@
1
1
  #!/usr/bin/env node
2
- const { readStdin } = require('./adapter');
2
+ const { readStdin, transformToClaude, runExistingHook } = require('./adapter');
3
3
  readStdin().then(raw => {
4
4
  try {
5
5
  const input = JSON.parse(raw);
6
- const agent = input.agent_name || input.agent || 'unknown';
7
- console.error(`[ECC] Agent spawned: ${agent}`);
8
- } catch {}
6
+ // Cursor subagentStart payload fields (from docs):
7
+ // subagent_id, subagent_type, task, parent_conversation_id, subagent_model, is_parallel_worker
8
+ const agentType = input.subagent_type || 'general-purpose';
9
+ const task = input.task || input.description || '';
10
+ console.error(`[ECC] Agent spawned: ${agentType} (${task.slice(0, 80)})`);
11
+
12
+ // Dispatch agent_spawned telemetry
13
+ const claudePayload = transformToClaude(input);
14
+ claudePayload.tool_name = 'Agent';
15
+ claudePayload.tool_input = {
16
+ ...claudePayload.tool_input,
17
+ subagent_type: agentType,
18
+ description: task.slice(0, 200),
19
+ subagent_id: input.subagent_id || '',
20
+ subagent_model: input.subagent_model || '',
21
+ is_parallel_worker: input.is_parallel_worker || false,
22
+ };
23
+ runExistingHook('aw-usage-post-tool-use.js', JSON.stringify(claudePayload));
24
+ } catch {
25
+ // Telemetry is best-effort
26
+ }
9
27
  process.stdout.write(raw);
10
28
  }).catch(() => process.exit(0));
@@ -1,10 +1,27 @@
1
1
  #!/usr/bin/env node
2
- const { readStdin } = require('./adapter');
2
+ const path = require('path');
3
+ const { readStdin, transformToClaude, getPluginRoot } = require('./adapter');
3
4
  readStdin().then(raw => {
4
5
  try {
5
6
  const input = JSON.parse(raw);
6
7
  const agent = input.agent_name || input.agent || 'unknown';
7
8
  console.error(`[ECC] Agent completed: ${agent}`);
9
+
10
+ // Usage telemetry — Cursor-only rich agent_completed event.
11
+ try {
12
+ const root = getPluginRoot();
13
+ const { buildEvent, sendAsync } = require(path.join(root, 'scripts', 'lib', 'aw-usage-telemetry'));
14
+ const claudeInput = transformToClaude(input);
15
+ sendAsync(buildEvent(claudeInput, 'agent_completed', {
16
+ agent_type: input.subagent_type || input.agent_name || agent,
17
+ status: input.status || 'unknown',
18
+ duration_ms: input.duration_ms || null,
19
+ tool_call_count: input.tool_call_count || null,
20
+ modified_files: input.modified_files || [],
21
+ }));
22
+ } catch {
23
+ // Telemetry is non-blocking.
24
+ }
8
25
  } catch {}
9
26
  process.stdout.write(raw);
10
27
  }).catch(() => process.exit(0));
@@ -3,7 +3,7 @@
3
3
  "hooks": {
4
4
  "sessionStart": [
5
5
  {
6
- "command": "bash -lc \"for candidate in \\\"$PWD/.cursor/hooks/session-start.sh\\\" \\\"$HOME/.cursor/hooks/session-start.sh\\\"; do if [ -f \\\"$candidate\\\" ]; then exec bash \\\"$candidate\\\"; fi; done; exit 0\"",
6
+ "command": "bash -c 'f=\"$PWD/.cursor/hooks/session-start.sh\"; [ -f \"$f\" ] || f=\"$HOME/.cursor/hooks/session-start.sh\"; exec bash \"$f\"'",
7
7
  "event": "sessionStart",
8
8
  "description": "Load previous context and detect environment"
9
9
  }
@@ -64,7 +64,7 @@
64
64
  ],
65
65
  "beforeSubmitPrompt": [
66
66
  {
67
- "command": "bash -lc \"for candidate in \\\"$PWD/.cursor/hooks/before-submit-prompt.sh\\\" \\\"$HOME/.cursor/hooks/before-submit-prompt.sh\\\"; do if [ -f \\\"$candidate\\\" ]; then exec bash \\\"$candidate\\\"; fi; done; exit 0\"",
67
+ "command": "bash -c 'f=\"$PWD/.cursor/hooks/before-submit-prompt.sh\"; [ -f \"$f\" ] || f=\"$HOME/.cursor/hooks/before-submit-prompt.sh\"; exec bash \"$f\"'",
68
68
  "event": "beforeSubmitPrompt",
69
69
  "description": "Detect secrets in prompts (sk-, ghp_, AKIA patterns)"
70
70
  }
@@ -83,6 +83,20 @@
83
83
  "description": "Log agent completion"
84
84
  }
85
85
  ],
86
+ "postToolUse": [
87
+ {
88
+ "command": "node -e \"const fs=require('fs');const path=require('path');const os=require('os');const scriptName=\\\"post-tool-use.js\\\";const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)];const target=candidates.find(candidate => fs.existsSync(candidate));if(!target) process.exit(0);require(target)\"",
89
+ "event": "postToolUse",
90
+ "description": "Telemetry: skill_invoked detection for Read tool and other non-shell/edit/MCP tools"
91
+ }
92
+ ],
93
+ "postToolUseFailure": [
94
+ {
95
+ "command": "node -e \"const fs=require('fs');const path=require('path');const os=require('os');const scriptName=\\\"post-tool-use-failure.js\\\";const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)];const target=candidates.find(candidate => fs.existsSync(candidate));if(!target) process.exit(0);require(target)\"",
96
+ "event": "postToolUseFailure",
97
+ "description": "Telemetry: tool_error detection on tool failure/timeout/denial"
98
+ }
99
+ ],
86
100
  "beforeTabFileRead": [
87
101
  {
88
102
  "command": "node -e \"const fs=require('fs');const path=require('path');const os=require('os');const scriptName=\\\"before-tab-file-read.js\\\";const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)];const target=candidates.find(candidate => fs.existsSync(candidate));if(!target) process.exit(0);require(target)\"",
@@ -104,6 +118,13 @@
104
118
  "description": "Save state before context compaction"
105
119
  }
106
120
  ],
121
+ "afterAgentResponse": [
122
+ {
123
+ "command": "node -e \"const fs=require('fs');const path=require('path');const os=require('os');const scriptName=\\\"after-agent-response.js\\\";const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)];const target=candidates.find(candidate => fs.existsSync(candidate));if(!target) process.exit(0);require(target)\"",
124
+ "event": "afterAgentResponse",
125
+ "description": "Telemetry: response_completed with tokens and cost per turn"
126
+ }
127
+ ],
107
128
  "stop": [
108
129
  {
109
130
  "command": "node -e \"const fs=require('fs');const path=require('path');const os=require('os');const scriptName=\\\"stop.js\\\";const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)];const target=candidates.find(candidate => fs.existsSync(candidate));if(!target) process.exit(0);require(target)\"",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecc-universal",
3
- "version": "1.4.25",
3
+ "version": "1.4.47",
4
4
  "description": "Everything Claude Code (ECC) plugin for OpenCode - agents, commands, hooks, and skills",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/AGENTS.md CHANGED
@@ -4,11 +4,11 @@ Use the repo-local AW SDLC files as the source of truth for routing and stage be
4
4
 
5
5
  ## Catalog Snapshot
6
6
 
7
- Catalog snapshot: providing 28 specialized agents, 158 skills, 69 commands for repo-local AW SDLC routing.
7
+ Catalog snapshot: providing 28 specialized agents, 173 skills, 72 commands for repo-local AW SDLC routing.
8
8
 
9
9
  agents/ - 28 specialized subagents
10
- skills/ - 157 workflow skills and domain knowledge
11
- commands/ - 69 slash commands
10
+ skills/ - 173 workflow skills and domain knowledge
11
+ commands/ - 72 slash commands
12
12
 
13
13
  ## Public Surface
14
14
 
package/README.md CHANGED
@@ -9,18 +9,18 @@
9
9
  The current catalog exposed by this repo is:
10
10
 
11
11
  - 28 agents
12
- - 158 skills
13
- - 69 commands
12
+ - 173 skills
13
+ - 72 commands
14
14
 
15
15
  ## Quick Start Snapshot
16
16
 
17
- Installing `aw-ecc` gives your workspace access to 28 agents, 158 skills, and 69 commands through the repo-local AW command surface plus GHL-specific skill and policy layers.
17
+ Installing `aw-ecc` gives your workspace access to 28 agents, 173 skills, and 72 commands through the repo-local AW command surface plus GHL-specific skill and policy layers.
18
18
 
19
19
  | Surface | Availability |
20
20
  | --- | --- |
21
21
  | Agents | ✅ 28 agents |
22
- | Skills | ✅ 158 skills |
23
- | Commands | ✅ 69 commands |
22
+ | Skills | ✅ 173 skills |
23
+ | Commands | ✅ 72 commands |
24
24
 
25
25
  These catalog counts are validated in CI so the published docs stay aligned with the repo contents.
26
26
 
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: aw:adk
3
+ description: "Agent Development Kit — create, improve, fix, delete, score, comply, audit, or health-check any CASRE artifact (Command, Agent, Skill, Rule, Eval). Use /aw:adk to author registry content."
4
+ argument-hint: "[type] [mode] [target] — e.g., 'agent create', 'skill score my-skill', 'rule audit all', 'agent delete my-agent'"
5
+ status: active
6
+ stage: build
7
+ internal_skill: aw-adk
8
+ ---
9
+
10
+ # ADK — Agent Development Kit
11
+
12
+ Use `/aw:adk` to author, score, fix, delete, or audit any artifact in the AW registry.
13
+
14
+ ## Usage
15
+
16
+ ```
17
+ /aw:adk → interactive: ask type, then mode
18
+ /aw:adk agent create → create a new agent (guided)
19
+ /aw:adk skill improve my-skill → enrich an existing skill
20
+ /aw:adk agent fix my-agent → resolve lint failures
21
+ /aw:adk skill score my-skill → score against rubric
22
+ /aw:adk rule audit all → audit all rules
23
+ /aw:adk eval create my-agent → create evals for existing agent
24
+ /aw:adk agent delete my-agent → remove agent + evals + clean references
25
+ ```
26
+
27
+ ## Arguments
28
+
29
+ | Position | Values | Default |
30
+ |---|---|---|
31
+ | type | `command` · `agent` · `skill` · `rule` · `eval` | interactive (ask) |
32
+ | mode | `create` · `improve` · `fix` · `delete` · `score` · `comply` · `audit` · `health` | interactive (ask) |
33
+ | target | artifact name or `all` (for audit/health) | interactive (ask) |
34
+
35
+ ## Execution
36
+
37
+ **Step 1: Read the skill file.** Open and read `~/.aw-ecc/skills/aw-adk/SKILL.md` before doing anything else. Do not skip this — the skill contains the full flow, templates, rubrics, and scripts. All reference files are relative to that skill directory.
38
+
39
+ **Step 2: Follow the create flow steps in order.** Every type (command, agent, skill, rule, eval) goes through the same pipeline. Here are the steps you must not skip:
40
+
41
+ 1. CLASSIFY → 2. INTERVIEW → 3. RESOLVE PATH → 4. SCAFFOLD → 5. CHECKPOINT (output remaining steps to user) → 6. LINT → 7. SCORE → 8. EVAL GATE (2+ evals) → 9. TEST RUNS → 10. ITERATE → 11. DESCRIPTION OPT → 12. CROSS-IDE → 13. REGISTRY UPDATES → 14. SYNC
42
+
43
+ If you find yourself writing the artifact and then jumping to "done" — you skipped steps 5-14. Go back.
44
+
45
+ ## When No Arguments
46
+
47
+ If invoked without arguments, ask the user:
48
+ 1. What type of artifact? (with the quick classifier table from the skill)
49
+ 2. What mode? (with brief descriptions of each)
50
+ 3. What target? (name or path)
51
+
52
+ Then proceed with the skill's flow for that combination.
package/commands/build.md CHANGED
@@ -42,6 +42,16 @@ Implement approved work in thin, reversible slices, continue until the approved
42
42
  - tests or validation changes where applicable
43
43
  - `.aw_docs/features/<feature_slug>/execution.md`
44
44
  - updated `.aw_docs/features/<feature_slug>/state.json`
45
+ - `.aw_docs/features/<feature_slug>/execution.html` when docs output mode is `dual` or `html`
46
+
47
+ ## Human HTML Companion
48
+
49
+ Markdown `execution.md` remains canonical for agents.
50
+ When `/aw:build` writes or materially updates execution evidence, delegate to the `aw:echo` subagent with the `implementation-plan` profile. Markdown-only is allowed only when the user explicitly requests it for this run.
51
+ Subagent authorization: invoking `/aw:build` in `dual` or `html` output mode is an explicit user request to delegate the human-facing HTML companion to exactly one background `aw:echo` subagent. This authorization is scoped only to HTML companion generation; do not spawn unrelated subagents.
52
+ HTML sidecars are required before the final handoff. Spawn exactly one `aw:echo` subagent and wait for the colocated `.html` sidecar unless the user explicitly asks not to wait. If the harness still cannot spawn `aw:echo`, create a conservative self-contained fallback HTML sidecar in the same turn, record `generated_fallback` with the blocker, and keep Markdown canonical.
53
+
54
+ Record `html_companion_artifacts` in `state.json` with `source_path`, `html_path`, profile, status, `run_ref` when available, publish status, and any explicit Markdown-only skip or fallback reason.
45
55
 
46
56
  ## Execution Rules
47
57
 
@@ -51,15 +61,17 @@ Implement approved work in thin, reversible slices, continue until the approved
51
61
  4. Default to sequential execution unless the approved plan marks disjoint `parallel_candidate` slices with explicit write scopes.
52
62
  5. If parallel fan-out is approved, respect the plan’s `max_parallel_subagents` cap, defaulting to `3` when no stricter or larger value is justified.
53
63
  6. Break non-trivial work into thin, rollback-friendly slices or bounded parallel waves.
54
- 7. Validate each slice or completed wave before expanding scope.
55
- 8. Keep moving through approved slices until the current build scope is complete or explicitly blocked.
56
- 9. For bug work, require a failing signal or reproduction before broad fixes.
57
- 10. For frontend work, inherit HighRise, accessibility, responsive, and runtime-verification expectations.
58
- 11. Record what changed, what remains, whether execution stayed sequential or ran in bounded parallel waves, and what was intentionally not touched.
59
- 12. If the approved tasks are phased, record each completed phase and name the next phase before handoff.
60
- 13. Create save-point commits for meaningful completed slices.
61
- 14. If a proposed slice cannot support a clean save-point commit, treat that as a slicing problem instead of normalizing a no-commit checkpoint.
62
- 15. Hand off to `/aw:test` or `/aw:review` with the exact next command instead of claiming readiness without evidence.
64
+ 7. For each slice that changes observable behavior, load `tdd-workflow` and follow RED-GREEN-REFACTOR; use the `tdd` companion skill when deeper behavior-test, mocking, or tracer-bullet guidance is needed.
65
+ 8. Validate each slice or completed wave before expanding scope.
66
+ 9. Keep moving through approved slices until the current build scope is complete or explicitly blocked.
67
+ 10. For bug work, require a failing signal or reproduction before broad fixes.
68
+ 11. For frontend work, inherit HighRise, accessibility, responsive, and runtime-verification expectations.
69
+ 12. Record what changed, what remains, whether execution stayed sequential or ran in bounded parallel waves, and what was intentionally not touched.
70
+ 13. If the approved tasks are phased, record each completed phase and name the next phase before handoff.
71
+ 14. Create save-point commits for meaningful completed slices.
72
+ 15. If a proposed slice cannot support a clean save-point commit, treat that as a slicing problem instead of normalizing a no-commit checkpoint.
73
+ 16. Hand off to `/aw:test` or `/aw:review` with the exact next command instead of claiming readiness without evidence.
74
+ 17. Generate or explicitly record the HTML companion status before handoff.
63
75
 
64
76
  ## Must Not Do
65
77
 
@@ -87,5 +99,6 @@ Always end with:
87
99
  - `Changes`
88
100
  - `Validation`
89
101
  - `Save Points`
102
+ - `HTML Companion`
90
103
  - `Blockers`
91
104
  - `Next`