Skip to content

Commit fa22f21

Browse files
ducpm2303claude
andcommitted
fix: wrap hooks.json under top-level "hooks" key
Plugin system expects { "hooks": { "PostToolUse": [...] } } but both java-core and java-security had PostToolUse at the top level, causing "Invalid input: expected record, received undefined" on plugin load. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f972409 commit fa22f21

2 files changed

Lines changed: 44 additions & 40 deletions

File tree

plugins/java-core/hooks/hooks.json

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
{
2-
"PostToolUse": [
3-
{
4-
"matcher": "Write|Edit",
5-
"hooks": [
6-
{
7-
"type": "command",
8-
"command": "echo '[java-core] Java file edited. Reminder: run mvn compile -q or ./gradlew build -q to verify the build still passes.'"
9-
}
10-
]
11-
},
12-
{
13-
"matcher": "Write|Edit",
14-
"hooks": [
15-
{
16-
"type": "command",
17-
"command": "echo '[java-core] Did you add or update tests for this change? Check for a corresponding *Test.java file.'"
18-
}
19-
]
20-
},
21-
{
22-
"matcher": "Bash",
23-
"hooks": [
24-
{
25-
"type": "command",
26-
"command": "echo '[java-core] After committing, consider running mvn verify or ./gradlew check for a full quality gate.'"
27-
}
28-
]
29-
}
30-
]
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Write|Edit",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "echo '[java-core] Java file edited. Reminder: run mvn compile -q or ./gradlew build -q to verify the build still passes.'"
10+
}
11+
]
12+
},
13+
{
14+
"matcher": "Write|Edit",
15+
"hooks": [
16+
{
17+
"type": "command",
18+
"command": "echo '[java-core] Did you add or update tests for this change? Check for a corresponding *Test.java file.'"
19+
}
20+
]
21+
},
22+
{
23+
"matcher": "Bash",
24+
"hooks": [
25+
{
26+
"type": "command",
27+
"command": "echo '[java-core] After committing, consider running mvn verify or ./gradlew check for a full quality gate.'"
28+
}
29+
]
30+
}
31+
]
32+
}
3133
}
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"PostToolUse": [
3-
{
4-
"matcher": "Write|Edit",
5-
"hooks": [
6-
{
7-
"type": "command",
8-
"command": "echo '[java-security] Java file modified. Consider asking the java-security-reviewer agent to check for OWASP vulnerabilities, injection risks, or secrets in the new code.'"
9-
}
10-
]
11-
}
12-
]
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Write|Edit",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "echo '[java-security] Java file modified. Consider asking the java-security-reviewer agent to check for OWASP vulnerabilities, injection risks, or secrets in the new code.'"
10+
}
11+
]
12+
}
13+
]
14+
}
1315
}

0 commit comments

Comments
 (0)