feat(projman): add plan-then-batch skill optimization #421
20
CHANGELOG.md
20
CHANGELOG.md
@@ -4,6 +4,26 @@ All notable changes to the Leo Claude Marketplace will be documented in this fil
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
#### Sprint 8: Hook Efficiency Quick Wins
|
||||
Performance optimizations for plugin hooks to reduce overhead on every command.
|
||||
|
||||
**Changes:**
|
||||
- **viz-platform:** Remove SessionStart hook that only echoed "loaded" (zero value)
|
||||
- **git-flow:** Add early exit to `branch-check.sh` for non-git commands (skip JSON parsing)
|
||||
- **git-flow:** Add early exit to `commit-msg-check.sh` for non-git commands (skip Python spawn)
|
||||
- **project-hygiene:** Add 60-second cooldown to `cleanup.sh` (reduce find operations)
|
||||
|
||||
**Impact:** Hooks now exit immediately for 90%+ of Bash commands that don't need processing.
|
||||
|
||||
**Issues:** #321, #322, #323, #324
|
||||
**PR:** #334
|
||||
|
||||
---
|
||||
|
||||
## [5.4.1] - 2026-01-30
|
||||
|
||||
### Removed
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
# Read tool input from stdin (JSON format)
|
||||
INPUT=$(cat)
|
||||
|
||||
# Quick check - exit immediately if not a git command
|
||||
if ! echo "$INPUT" | grep -q '"command".*git'; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Extract command from JSON input
|
||||
# The Bash tool sends {"command": "..."} format
|
||||
COMMAND=$(echo "$INPUT" | grep -o '"command"[[:space:]]*:[[:space:]]*"[^"]*"' | head -1 | sed 's/.*"command"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/')
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
# Read tool input from stdin
|
||||
INPUT=$(cat)
|
||||
|
||||
# Quick check - exit immediately if not a git commit command
|
||||
# This avoids spawning Python for 99% of Bash commands
|
||||
if ! echo "$INPUT" | grep -q '"command".*git.*commit'; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Use Python to properly parse JSON and extract the command
|
||||
COMMAND=$(echo "$INPUT" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('command',''))" 2>/dev/null)
|
||||
|
||||
|
||||
@@ -10,6 +10,17 @@ PREFIX="[project-hygiene]"
|
||||
# Read tool input from stdin (discard - we don't need it for cleanup)
|
||||
cat > /dev/null
|
||||
|
||||
# Cooldown - skip if ran in last 60 seconds
|
||||
# Using $PPID ties cooldown to the Claude session
|
||||
LAST_RUN_FILE="/tmp/project-hygiene-${PPID}-last-run"
|
||||
if [[ -f "$LAST_RUN_FILE" ]]; then
|
||||
LAST_RUN=$(cat "$LAST_RUN_FILE")
|
||||
NOW=$(date +%s)
|
||||
if (( NOW - LAST_RUN < 60 )); then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
PROJECT_ROOT="${PROJECT_ROOT:-.}"
|
||||
DELETED_COUNT=0
|
||||
|
||||
@@ -25,4 +36,7 @@ if [[ $DELETED_COUNT -gt 0 ]]; then
|
||||
echo "$PREFIX Cleaned $DELETED_COUNT temp files"
|
||||
fi
|
||||
|
||||
# Record this run for cooldown
|
||||
date +%s > "$LAST_RUN_FILE"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"event": "SessionStart",
|
||||
"type": "command",
|
||||
"command": "echo 'viz-platform plugin loaded'",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
"hooks": []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user