Skip to content

Commit f249a3a

Browse files
committed
chore(sync): cascade errorMessage hook refactor + trimming-bundle skill + bundle-trim scan from socket-repo-template
1 parent a0ad70c commit f249a3a

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

.claude/hooks/no-fleet-fork-guard/index.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ import { existsSync, readFileSync } from 'node:fs'
5353
import path from 'node:path'
5454
import process from 'node:process'
5555

56+
import { errorMessage } from '@socketsecurity/lib/errors'
57+
5658
type ToolInput = {
5759
tool_input?: { file_path?: string } | undefined
5860
tool_name?: string | undefined
@@ -289,7 +291,7 @@ main().then(
289291
code => process.exit(code),
290292
e => {
291293
process.stderr.write(
292-
`no-fleet-fork-guard: hook bug — fail-open. ${e instanceof Error ? e.message : String(e)}\n`,
294+
`no-fleet-fork-guard: hook bug — fail-open. ${errorMessage(e)}\n`,
293295
)
294296
process.exit(0)
295297
},

.claude/hooks/no-fleet-fork-guard/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"exports": {
77
".": "./index.mts"
88
},
9+
"dependencies": {
10+
"@socketsecurity/lib": "catalog:"
11+
},
912
"devDependencies": {
1013
"@types/node": "catalog:"
1114
},

.claude/skills/scanning-quality/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Modular scan types (one file per type under `scans/`, easier to extend than the
3434
9. **variant-analysis** — for each High/Critical finding from above, search the rest of the repo for the same shape. See [`scans/variant-analysis.md`](scans/variant-analysis.md).
3535
10. **insecure-defaults** — fail-open defaults, hardcoded credentials, lazy fallbacks. See [`scans/insecure-defaults.md`](scans/insecure-defaults.md).
3636
11. **differential** — security-focused diff against a base ref. See [`scans/differential.md`](scans/differential.md).
37+
12. **bundle-trim** — for repos that ship a built bundle (today: rolldown), identify unused module paths the bundler statically pulled in but the runtime never reaches. Reports candidates; the trim loop itself lives in the [`trimming-bundle`](../trimming-bundle/SKILL.md) skill. See [`scans/bundle-trim.md`](scans/bundle-trim.md).
3738

3839
Adding a new scan type: drop a file under `scans/<name>.md` describing mission, method, output shape, when-to-skip — same shape as the three above. The orchestrator picks them up by directory listing; no edits to this SKILL.md needed beyond appending to the list.
3940

0 commit comments

Comments
 (0)