Stats
Actions
Tags
From engineering-workflow
Runs shell scripts before and after every Write/Edit tool call to enforce code quality or formatting, with a cleanup script on session stop. Executes bash and can modify files.
3 events · 3 hooks
Safety signals detected in this hook configuration
Where this hook configuration is defined
Defined inline in plugin.json manifest
Event handlers and matchers — expand Raw Configuration for the full JSON
cache_dir="$HOME/.claude/cache/engineering-workflow"; constraints="$cache_dir/constraints.json"; if [ -f "$constraints" ]; then session_id=$(jq -r '.session_id // empty' "$constraints" 2>/dev/null); if [ -n "$session_id" ]; then mkdir -p "$cache_dir/history" && cp "$constraints" "$cache_dir/history/${session_id}-constraints.json"; fi; fi; history_dir="$cache_dir/history"; if [ -d "$history_dir" ]; then ls -1t "$history_dir"/*-constraints.json 2>/dev/null | tail -n +21 | xargs rm -f 2>/dev/null; fi; progress="$cache_dir/progress.json"; if [ -f "$progress" ]; then ts=$(date -u +"%Y-%m-%dT%H:%M:%SZ"); jq --arg s completed --arg t "$ts" '.status=$s|.completed_at=$t' "$progress" > "$progress.tmp" 2>/dev/null && mv "$progress.tmp" "$progress"; fi; summary="$cache_dir/session-summary.json"; ts=$(date -u +"%Y-%m-%dT%H:%M:%SZ"); phase="unknown"; if [ -f "$progress" ]; then phase=$(jq -r '.phase // "unknown"' "$progress" 2>/dev/null); fi; constraint_count=0; constraint_targets="[]"; if [ -f "$constraints" ]; then constraint_count=$(jq '[.constraints[]? // empty] | length' "$constraints" 2>/dev/null || echo 0); constraint_targets=$(jq '[.constraints[]?.target // empty] | unique' "$constraints" 2>/dev/null || echo '[]'); fi; jq -n --arg phase "$phase" --argjson cc "$constraint_count" --argjson ct "$constraint_targets" --arg ts "$ts" '{last_phase:$phase,constraint_count:$cc,constraint_targets:$ct,completed_at:$ts}' > "$summary" 2>/dev/nullEdit|Writefile=$(echo "$CLAUDE_TOOL_INPUT" | jq -r '.file_path // .path // empty' 2>/dev/null); if [ -n "$file" ] && echo "$file" | grep -qiE '(application-prod|secrets|credentials|private-key)'; then echo '{"decision":"block","reason":"Production secret file edit blocked"}'; exit 2; fiWritefile=$(echo "$CLAUDE_TOOL_INPUT" | jq -r '.file_path // .path // empty' 2>/dev/null); if [ -n "$file" ] && echo "$file" | grep -qE 'constraints\.json$'; then jq empty "$file" 2>/dev/null || { echo '{"decision":"block","reason":"constraints.json is not valid JSON"}'; exit 2; }; finpx claudepluginhub hungrytech/hungrytech-claude-skills --plugin engineering-workflow