aw-ecc 1.4.21 → 1.4.25

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 (83) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex/hooks/aw-post-tool-use.sh +1 -0
  3. package/.codex/hooks/aw-pre-tool-use.sh +1 -0
  4. package/.codex/hooks/aw-session-start.sh +4 -0
  5. package/.codex/hooks/aw-stop.sh +1 -0
  6. package/.codex/hooks/aw-user-prompt-submit.sh +1 -0
  7. package/.cursor/INSTALL.md +9 -0
  8. package/.cursor/hooks/adapter.js +34 -3
  9. package/.cursor/hooks/aw-phase-definitions.js +11 -0
  10. package/.cursor/hooks/before-submit-prompt.js +1 -1
  11. package/.cursor/hooks/before-submit-prompt.sh +17 -0
  12. package/.cursor/hooks/session-start.sh +36 -0
  13. package/.cursor/hooks/shared/aw-phase-definitions.js +1 -19
  14. package/.cursor/hooks/shared/aw-phase-runner.js +38 -2
  15. package/.cursor/hooks/shared/session-start.sh +4 -0
  16. package/.cursor/hooks/shared/user-prompt-submit.sh +33 -140
  17. package/.cursor/hooks.json +15 -15
  18. package/.cursor/rules/common-aw-routing.md +43 -0
  19. package/.cursor/skills/api-and-interface-design/SKILL.md +75 -0
  20. package/.cursor/skills/aw-brainstorm/SKILL.md +115 -0
  21. package/.cursor/skills/aw-build/SKILL.md +152 -0
  22. package/.cursor/skills/aw-build/evals/build-stage-cases.json +28 -0
  23. package/.cursor/skills/aw-debug/SKILL.md +49 -0
  24. package/.cursor/skills/aw-deploy/SKILL.md +101 -0
  25. package/.cursor/skills/aw-deploy/evals/deploy-stage-cases.json +32 -0
  26. package/.cursor/skills/aw-execute/SKILL.md +47 -0
  27. package/.cursor/skills/aw-execute/references/mode-code.md +47 -0
  28. package/.cursor/skills/aw-execute/references/mode-docs.md +28 -0
  29. package/.cursor/skills/aw-execute/references/mode-infra.md +44 -0
  30. package/.cursor/skills/aw-execute/references/mode-migration.md +58 -0
  31. package/.cursor/skills/aw-execute/references/worker-implementer.md +26 -0
  32. package/.cursor/skills/aw-execute/references/worker-parallel-worker.md +23 -0
  33. package/.cursor/skills/aw-execute/references/worker-quality-reviewer.md +23 -0
  34. package/.cursor/skills/aw-execute/references/worker-spec-reviewer.md +23 -0
  35. package/.cursor/skills/aw-execute/scripts/build-worker-bundle.js +229 -0
  36. package/.cursor/skills/aw-finish/SKILL.md +111 -0
  37. package/.cursor/skills/aw-investigate/SKILL.md +109 -0
  38. package/.cursor/skills/aw-plan/SKILL.md +368 -0
  39. package/.cursor/skills/aw-prepare/SKILL.md +118 -0
  40. package/.cursor/skills/aw-review/SKILL.md +118 -0
  41. package/.cursor/skills/aw-ship/SKILL.md +115 -0
  42. package/.cursor/skills/aw-spec/SKILL.md +104 -0
  43. package/.cursor/skills/aw-tasks/SKILL.md +138 -0
  44. package/.cursor/skills/aw-test/SKILL.md +118 -0
  45. package/.cursor/skills/aw-verify/SKILL.md +51 -0
  46. package/.cursor/skills/aw-yolo/SKILL.md +111 -0
  47. package/.cursor/skills/browser-testing-with-devtools/SKILL.md +81 -0
  48. package/.cursor/skills/ci-cd-and-automation/SKILL.md +71 -0
  49. package/.cursor/skills/code-simplification/SKILL.md +74 -0
  50. package/.cursor/skills/context-engineering/SKILL.md +74 -0
  51. package/.cursor/skills/deprecation-and-migration/SKILL.md +75 -0
  52. package/.cursor/skills/documentation-and-adrs/SKILL.md +75 -0
  53. package/.cursor/skills/frontend-ui-engineering/SKILL.md +68 -0
  54. package/.cursor/skills/git-workflow-and-versioning/SKILL.md +75 -0
  55. package/.cursor/skills/idea-refine/SKILL.md +84 -0
  56. package/.cursor/skills/incremental-implementation/SKILL.md +75 -0
  57. package/.cursor/skills/performance-optimization/SKILL.md +77 -0
  58. package/.cursor/skills/security-and-hardening/SKILL.md +70 -0
  59. package/.cursor/skills/using-aw-skills/SKILL.md +290 -0
  60. package/.cursor/skills/using-aw-skills/evals/skill-trigger-cases.tsv +25 -0
  61. package/.cursor/skills/using-aw-skills/evals/test-skill-triggers.sh +171 -0
  62. package/.cursor/skills/using-aw-skills/hooks/hooks.json +9 -0
  63. package/.cursor/skills/using-aw-skills/hooks/session-start.sh +67 -0
  64. package/.cursor/skills/using-platform-skills/SKILL.md +163 -0
  65. package/.cursor/skills/using-platform-skills/evals/platform-selection-cases.json +52 -0
  66. package/.opencode/package.json +1 -1
  67. package/package.json +3 -1
  68. package/scripts/cursor-aw-home/hooks.json +15 -15
  69. package/scripts/cursor-aw-hooks/adapter.js +34 -3
  70. package/scripts/cursor-aw-hooks/aw-phase-definitions.js +11 -0
  71. package/scripts/cursor-aw-hooks/before-submit-prompt.js +1 -1
  72. package/scripts/cursor-aw-hooks/before-submit-prompt.sh +17 -0
  73. package/scripts/cursor-aw-hooks/session-start.sh +36 -0
  74. package/scripts/hooks/session-start-rules-context.sh +8 -1
  75. package/scripts/hooks/shared/aw-phase-definitions.js +1 -19
  76. package/scripts/hooks/shared/aw-phase-runner.js +38 -2
  77. package/scripts/hooks/shared/session-start.sh +4 -0
  78. package/scripts/hooks/shared/user-prompt-submit.sh +33 -140
  79. package/scripts/lib/cursor-aw-hook-files.js +2 -0
  80. package/scripts/lib/cursor-hook-config.js +47 -15
  81. package/scripts/lib/install-executor.js +7 -0
  82. package/scripts/lib/install-targets/cursor-project.js +7 -0
  83. package/skills/using-aw-skills/hooks/session-start.sh +4 -0
@@ -1,16 +1,46 @@
1
1
  const { getCursorMappedEventNames } = require('./aw-hook-contract');
2
2
 
3
+ function buildManagedCursorHookCommand(scriptFileName) {
4
+ const scriptName = String(scriptFileName || '').replace(/\\/g, '/');
5
+ const launcher = [
6
+ "const fs=require('fs')",
7
+ "const path=require('path')",
8
+ "const os=require('os')",
9
+ `const scriptName=${JSON.stringify(scriptName)}`,
10
+ "const candidates=[path.join(process.cwd(), '.cursor', 'hooks', scriptName),path.join(os.homedir(), '.cursor', 'hooks', scriptName)]",
11
+ "const target=candidates.find(candidate => fs.existsSync(candidate))",
12
+ "if(!target) process.exit(0)",
13
+ "require(target)",
14
+ ].join(';');
15
+
16
+ return `node -e ${JSON.stringify(launcher)}`;
17
+ }
18
+
19
+ function buildManagedCursorShellCommand(scriptFileName) {
20
+ const scriptName = String(scriptFileName || '').replace(/\\/g, '/');
21
+ const command = [
22
+ 'bash -lc',
23
+ JSON.stringify(
24
+ `for candidate in "$PWD/.cursor/hooks/${scriptName}" "$HOME/.cursor/hooks/${scriptName}"; do ` +
25
+ `if [ -f "$candidate" ]; then exec bash "$candidate"; fi; ` +
26
+ 'done; exit 0'
27
+ ),
28
+ ].join(' ');
29
+
30
+ return command;
31
+ }
32
+
3
33
  const CURSOR_HOOK_ENTRIES = Object.freeze({
4
34
  sessionStart: [
5
35
  {
6
- command: 'node .cursor/hooks/session-start.js',
36
+ command: buildManagedCursorShellCommand('session-start.sh'),
7
37
  event: 'sessionStart',
8
38
  description: 'Load previous context and detect environment',
9
39
  },
10
40
  ],
11
41
  sessionEnd: [
12
42
  {
13
- command: 'node .cursor/hooks/session-end.js',
43
+ command: buildManagedCursorHookCommand('session-end.js'),
14
44
  event: 'sessionEnd',
15
45
  description: 'Persist session state and evaluate patterns',
16
46
  },
@@ -22,91 +52,91 @@ const CURSOR_HOOK_ENTRIES = Object.freeze({
22
52
  description: 'Block git hook-bypass flag to protect pre-commit, commit-msg, and pre-push hooks from being skipped',
23
53
  },
24
54
  {
25
- command: 'node .cursor/hooks/before-shell-execution.js',
55
+ command: buildManagedCursorHookCommand('before-shell-execution.js'),
26
56
  event: 'beforeShellExecution',
27
57
  description: 'Tmux dev server blocker, tmux reminder, git push review',
28
58
  },
29
59
  ],
30
60
  afterShellExecution: [
31
61
  {
32
- command: 'node .cursor/hooks/after-shell-execution.js',
62
+ command: buildManagedCursorHookCommand('after-shell-execution.js'),
33
63
  event: 'afterShellExecution',
34
64
  description: 'PR URL logging, build analysis',
35
65
  },
36
66
  ],
37
67
  afterFileEdit: [
38
68
  {
39
- command: 'node .cursor/hooks/after-file-edit.js',
69
+ command: buildManagedCursorHookCommand('after-file-edit.js'),
40
70
  event: 'afterFileEdit',
41
71
  description: 'Auto-format, TypeScript check, console.log warning',
42
72
  },
43
73
  ],
44
74
  beforeMCPExecution: [
45
75
  {
46
- command: 'node .cursor/hooks/before-mcp-execution.js',
76
+ command: buildManagedCursorHookCommand('before-mcp-execution.js'),
47
77
  event: 'beforeMCPExecution',
48
78
  description: 'MCP audit logging and untrusted server warning',
49
79
  },
50
80
  ],
51
81
  afterMCPExecution: [
52
82
  {
53
- command: 'node .cursor/hooks/after-mcp-execution.js',
83
+ command: buildManagedCursorHookCommand('after-mcp-execution.js'),
54
84
  event: 'afterMCPExecution',
55
85
  description: 'MCP result logging',
56
86
  },
57
87
  ],
58
88
  beforeReadFile: [
59
89
  {
60
- command: 'node .cursor/hooks/before-read-file.js',
90
+ command: buildManagedCursorHookCommand('before-read-file.js'),
61
91
  event: 'beforeReadFile',
62
92
  description: 'Warn when reading sensitive files (.env, .key, .pem)',
63
93
  },
64
94
  ],
65
95
  beforeSubmitPrompt: [
66
96
  {
67
- command: 'node .cursor/hooks/before-submit-prompt.js',
97
+ command: buildManagedCursorShellCommand('before-submit-prompt.sh'),
68
98
  event: 'beforeSubmitPrompt',
69
99
  description: 'Detect secrets in prompts (sk-, ghp_, AKIA patterns)',
70
100
  },
71
101
  ],
72
102
  subagentStart: [
73
103
  {
74
- command: 'node .cursor/hooks/subagent-start.js',
104
+ command: buildManagedCursorHookCommand('subagent-start.js'),
75
105
  event: 'subagentStart',
76
106
  description: 'Log agent spawning for observability',
77
107
  },
78
108
  ],
79
109
  subagentStop: [
80
110
  {
81
- command: 'node .cursor/hooks/subagent-stop.js',
111
+ command: buildManagedCursorHookCommand('subagent-stop.js'),
82
112
  event: 'subagentStop',
83
113
  description: 'Log agent completion',
84
114
  },
85
115
  ],
86
116
  beforeTabFileRead: [
87
117
  {
88
- command: 'node .cursor/hooks/before-tab-file-read.js',
118
+ command: buildManagedCursorHookCommand('before-tab-file-read.js'),
89
119
  event: 'beforeTabFileRead',
90
120
  description: 'Block Tab from reading secrets (.env, .key, .pem, credentials)',
91
121
  },
92
122
  ],
93
123
  afterTabFileEdit: [
94
124
  {
95
- command: 'node .cursor/hooks/after-tab-file-edit.js',
125
+ command: buildManagedCursorHookCommand('after-tab-file-edit.js'),
96
126
  event: 'afterTabFileEdit',
97
127
  description: 'Auto-format Tab edits',
98
128
  },
99
129
  ],
100
130
  preCompact: [
101
131
  {
102
- command: 'node .cursor/hooks/pre-compact.js',
132
+ command: buildManagedCursorHookCommand('pre-compact.js'),
103
133
  event: 'preCompact',
104
134
  description: 'Save state before context compaction',
105
135
  },
106
136
  ],
107
137
  stop: [
108
138
  {
109
- command: 'node .cursor/hooks/stop.js',
139
+ command: buildManagedCursorHookCommand('stop.js'),
110
140
  event: 'stop',
111
141
  description: 'Console.log audit on all modified files',
112
142
  },
@@ -144,5 +174,7 @@ module.exports = {
144
174
  CURSOR_HOOK_ENTRIES,
145
175
  buildCursorHookEntries,
146
176
  buildCursorHookConfig,
177
+ buildManagedCursorHookCommand,
178
+ buildManagedCursorShellCommand,
147
179
  serializeCursorHookConfig,
148
180
  };
@@ -418,6 +418,13 @@ function planCursorLegacyInstall(context) {
418
418
  sourceRelativeDir: path.join('.cursor', 'commands'),
419
419
  destinationDir: path.join(targetRoot, 'commands'),
420
420
  });
421
+ addRecursiveCopyOperations(operations, {
422
+ moduleId: 'legacy-cursor-install',
423
+ sourceRoot: context.sourceRoot,
424
+ sourceRelativeDir: path.join('scripts', 'hooks'),
425
+ destinationDir: path.join(targetRoot, 'scripts', 'hooks'),
426
+ strategy: 'sync-root-children',
427
+ });
421
428
  addRecursiveCopyOperations(operations, {
422
429
  moduleId: 'legacy-cursor-install',
423
430
  sourceRoot: context.sourceRoot,
@@ -49,6 +49,13 @@ module.exports = createInstallTargetAdapter({
49
49
  if (sourceRelativePath === '.cursor') {
50
50
  return [
51
51
  adapter.createScaffoldOperation(module.id, sourceRelativePath, planningInput),
52
+ createRemappedOperation(
53
+ adapter,
54
+ module.id,
55
+ path.join('scripts', 'hooks'),
56
+ path.join(targetRoot, 'scripts', 'hooks'),
57
+ { strategy: 'sync-root-children' }
58
+ ),
52
59
  createRemappedOperation(
53
60
  adapter,
54
61
  module.id,
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
+ # Drain stdin because session-start emits static AW routing context and does
5
+ # not inspect the incoming payload.
6
+ cat >/dev/null || true
7
+
4
8
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
9
  LOCAL_ROOT=""
6
10
  SEARCH_ROOT="$SCRIPT_DIR"