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.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex/hooks/aw-post-tool-use.sh +1 -0
- package/.codex/hooks/aw-pre-tool-use.sh +1 -0
- package/.codex/hooks/aw-session-start.sh +4 -0
- package/.codex/hooks/aw-stop.sh +1 -0
- package/.codex/hooks/aw-user-prompt-submit.sh +1 -0
- package/.cursor/INSTALL.md +9 -0
- package/.cursor/hooks/adapter.js +34 -3
- package/.cursor/hooks/aw-phase-definitions.js +11 -0
- package/.cursor/hooks/before-submit-prompt.js +1 -1
- package/.cursor/hooks/before-submit-prompt.sh +17 -0
- package/.cursor/hooks/session-start.sh +36 -0
- package/.cursor/hooks/shared/aw-phase-definitions.js +1 -19
- package/.cursor/hooks/shared/aw-phase-runner.js +38 -2
- package/.cursor/hooks/shared/session-start.sh +4 -0
- package/.cursor/hooks/shared/user-prompt-submit.sh +33 -140
- package/.cursor/hooks.json +15 -15
- package/.cursor/rules/common-aw-routing.md +43 -0
- package/.cursor/skills/api-and-interface-design/SKILL.md +75 -0
- package/.cursor/skills/aw-brainstorm/SKILL.md +115 -0
- package/.cursor/skills/aw-build/SKILL.md +152 -0
- package/.cursor/skills/aw-build/evals/build-stage-cases.json +28 -0
- package/.cursor/skills/aw-debug/SKILL.md +49 -0
- package/.cursor/skills/aw-deploy/SKILL.md +101 -0
- package/.cursor/skills/aw-deploy/evals/deploy-stage-cases.json +32 -0
- package/.cursor/skills/aw-execute/SKILL.md +47 -0
- package/.cursor/skills/aw-execute/references/mode-code.md +47 -0
- package/.cursor/skills/aw-execute/references/mode-docs.md +28 -0
- package/.cursor/skills/aw-execute/references/mode-infra.md +44 -0
- package/.cursor/skills/aw-execute/references/mode-migration.md +58 -0
- package/.cursor/skills/aw-execute/references/worker-implementer.md +26 -0
- package/.cursor/skills/aw-execute/references/worker-parallel-worker.md +23 -0
- package/.cursor/skills/aw-execute/references/worker-quality-reviewer.md +23 -0
- package/.cursor/skills/aw-execute/references/worker-spec-reviewer.md +23 -0
- package/.cursor/skills/aw-execute/scripts/build-worker-bundle.js +229 -0
- package/.cursor/skills/aw-finish/SKILL.md +111 -0
- package/.cursor/skills/aw-investigate/SKILL.md +109 -0
- package/.cursor/skills/aw-plan/SKILL.md +368 -0
- package/.cursor/skills/aw-prepare/SKILL.md +118 -0
- package/.cursor/skills/aw-review/SKILL.md +118 -0
- package/.cursor/skills/aw-ship/SKILL.md +115 -0
- package/.cursor/skills/aw-spec/SKILL.md +104 -0
- package/.cursor/skills/aw-tasks/SKILL.md +138 -0
- package/.cursor/skills/aw-test/SKILL.md +118 -0
- package/.cursor/skills/aw-verify/SKILL.md +51 -0
- package/.cursor/skills/aw-yolo/SKILL.md +111 -0
- package/.cursor/skills/browser-testing-with-devtools/SKILL.md +81 -0
- package/.cursor/skills/ci-cd-and-automation/SKILL.md +71 -0
- package/.cursor/skills/code-simplification/SKILL.md +74 -0
- package/.cursor/skills/context-engineering/SKILL.md +74 -0
- package/.cursor/skills/deprecation-and-migration/SKILL.md +75 -0
- package/.cursor/skills/documentation-and-adrs/SKILL.md +75 -0
- package/.cursor/skills/frontend-ui-engineering/SKILL.md +68 -0
- package/.cursor/skills/git-workflow-and-versioning/SKILL.md +75 -0
- package/.cursor/skills/idea-refine/SKILL.md +84 -0
- package/.cursor/skills/incremental-implementation/SKILL.md +75 -0
- package/.cursor/skills/performance-optimization/SKILL.md +77 -0
- package/.cursor/skills/security-and-hardening/SKILL.md +70 -0
- package/.cursor/skills/using-aw-skills/SKILL.md +290 -0
- package/.cursor/skills/using-aw-skills/evals/skill-trigger-cases.tsv +25 -0
- package/.cursor/skills/using-aw-skills/evals/test-skill-triggers.sh +171 -0
- package/.cursor/skills/using-aw-skills/hooks/hooks.json +9 -0
- package/.cursor/skills/using-aw-skills/hooks/session-start.sh +67 -0
- package/.cursor/skills/using-platform-skills/SKILL.md +163 -0
- package/.cursor/skills/using-platform-skills/evals/platform-selection-cases.json +52 -0
- package/.opencode/package.json +1 -1
- package/package.json +3 -1
- package/scripts/cursor-aw-home/hooks.json +15 -15
- package/scripts/cursor-aw-hooks/adapter.js +34 -3
- package/scripts/cursor-aw-hooks/aw-phase-definitions.js +11 -0
- package/scripts/cursor-aw-hooks/before-submit-prompt.js +1 -1
- package/scripts/cursor-aw-hooks/before-submit-prompt.sh +17 -0
- package/scripts/cursor-aw-hooks/session-start.sh +36 -0
- package/scripts/hooks/session-start-rules-context.sh +8 -1
- package/scripts/hooks/shared/aw-phase-definitions.js +1 -19
- package/scripts/hooks/shared/aw-phase-runner.js +38 -2
- package/scripts/hooks/shared/session-start.sh +4 -0
- package/scripts/hooks/shared/user-prompt-submit.sh +33 -140
- package/scripts/lib/cursor-aw-hook-files.js +2 -0
- package/scripts/lib/cursor-hook-config.js +47 -15
- package/scripts/lib/install-executor.js +7 -0
- package/scripts/lib/install-targets/cursor-project.js +7 -0
- 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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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"
|