feat(write-existing-file-guard): add hook to prevent write tool from overwriting existing files
Adds a PreToolUse hook that intercepts write operations and throws an error if the target file already exists, guiding users to use the edit tool instead. - Throws error: 'File already exists. Use edit tool instead.' - Hook is enabled by default, can be disabled via disabled_hooks - Includes comprehensive test suite with BDD-style comments
This commit is contained in:
@@ -94,6 +94,7 @@ export const HookNameSchema = z.enum([
|
||||
"unstable-agent-babysitter",
|
||||
"stop-continuation-guard",
|
||||
"tasks-todowrite-disabler",
|
||||
"write-existing-file-guard",
|
||||
])
|
||||
|
||||
export const BuiltinCommandNameSchema = z.enum([
|
||||
|
||||
Reference in New Issue
Block a user