Skip to content

Commit f2946fd

Browse files
committed
chore: sync hooks and skills from socket-repo-template
1 parent d54da6c commit f2946fd

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.claude/skills/security-scan/SKILL.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
---
22
name: security-scan
33
description: Runs a multi-tool security scan — AgentShield for Claude config, zizmor for GitHub Actions, and optionally Socket CLI for dependency scanning. Produces an A-F graded security report.
4+
user-invocable: true
45
---
56

67
# Security Scan
78

89
Multi-tool security scanning pipeline for the repository.
910

10-
## Related: check-new-deps Hook
11-
12-
This repo includes a pre-tool hook (`.claude/hooks/check-new-deps/`) that automatically
13-
checks new dependencies against Socket.dev's malware API before Claude adds them.
14-
The hook runs on every Edit/Write to manifest files — see its README for details.
15-
This skill covers broader security scanning; the hook provides real-time dependency protection.
16-
1711
## When to Use
1812

1913
- After modifying `.claude/` config, settings, hooks, or agent definitions

.git-hooks/commit-msg

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ALLOWED_PUBLIC_KEY="sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api"
1515
ERRORS=0
1616

1717
# Get files in this commit (for security checks).
18-
COMMITTED_FILES=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null || echo "")
18+
COMMITTED_FILES=$(git diff --cached --name-only --diff-filter=ACM 2>/dev/null || printf "\n")
1919

2020
# Quick checks for critical issues in committed files.
2121
if [ -n "$COMMITTED_FILES" ]; then
@@ -41,13 +41,18 @@ fi
4141
COMMIT_MSG_FILE="$1"
4242
if [ -f "$COMMIT_MSG_FILE" ]; then
4343
# Create a temporary file to store the cleaned message.
44-
TEMP_FILE=$(mktemp)
44+
TEMP_FILE=$(mktemp) || {
45+
printf "${RED}✗ Failed to create temporary file${NC}\n" >&2
46+
exit 1
47+
}
48+
# Ensure cleanup on exit
49+
trap 'rm -f "$TEMP_FILE"' EXIT
4550
REMOVED_LINES=0
4651

4752
# Read the commit message line by line and filter out AI attribution.
4853
while IFS= read -r line || [ -n "$line" ]; do
4954
# Check if this line contains AI attribution patterns.
50-
if echo "$line" | grep -qiE "(Generated with|Co-Authored-By: Claude|Co-Authored-By: AI|🤖 Generated|AI generated|Claude Code|@anthropic\.com|Assistant:|Generated by Claude|Machine generated)" && ! echo "$line" | grep -qE "@anthropic-ai/"; then
55+
if echo "$line" | grep -qiE "(Generated with|Co-Authored-By: Claude|Co-Authored-By: AI|🤖 Generated|AI generated|Claude Code|@anthropic|Assistant:|Generated by Claude|Machine generated)"; then
5156
REMOVED_LINES=$((REMOVED_LINES + 1))
5257
else
5358
# Line doesn't contain AI attribution, keep it.

.husky/commit-msg

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# Run commit message validation and auto-strip AI attribution.
2-
.git-hooks/commit-msg "$1"
2+
if [ -x ".git-hooks/commit-msg" ]; then
3+
.git-hooks/commit-msg "$1"
4+
else
5+
printf "\033[0;31m✗ Error: .git-hooks/commit-msg not found or not executable\033[0m\n" >&2
6+
exit 1
7+
fi

0 commit comments

Comments
 (0)