feat(marketplace): hook migration, projman commands, optimizations [BREAKING]
Remove all SessionStart and PostToolUse hooks across the marketplace, retaining only PreToolUse safety hooks and UserPromptSubmit quality hooks. Add /project and /adr command families, /hygiene check, /cv status. Create 7 new projman skills for project lifecycle management. Remove /pm-debug, /suggest-version, /proposal-status commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,18 +16,6 @@
|
||||
"hooks",
|
||||
"maintenance"
|
||||
],
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/cleanup.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"domain": "core"
|
||||
"domain": "core",
|
||||
"commands": ["./commands/"]
|
||||
}
|
||||
|
||||
36
plugins/project-hygiene/commands/hygiene-check.md
Normal file
36
plugins/project-hygiene/commands/hygiene-check.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
description: Manual project hygiene check — validates file organization and cleanup
|
||||
---
|
||||
|
||||
# /hygiene check
|
||||
|
||||
## Purpose
|
||||
|
||||
Manually run project hygiene checks that were previously automatic (PostToolUse hook removed per Decision #29).
|
||||
|
||||
## Checks Performed
|
||||
|
||||
1. **Temp file detection** — find files in project root that look temporary (*.tmp, *.bak, *.swp, *~)
|
||||
2. **Misplaced files** — files outside their expected directories per project conventions
|
||||
3. **Empty directories** — directories with no files
|
||||
4. **Large files** — files exceeding reasonable size thresholds
|
||||
5. **Debug artifacts** — leftover debug logs, console.log statements, print statements
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/hygiene check # Run all checks
|
||||
/hygiene check --fix # Auto-fix safe issues (delete temp files, remove empty dirs)
|
||||
```
|
||||
|
||||
## Output
|
||||
|
||||
```
|
||||
Temp files: 0 found
|
||||
Misplaced files: 0 found
|
||||
Empty directories: 2 found
|
||||
Large files: 0 found
|
||||
Debug artifacts: 1 found
|
||||
|
||||
Fixable: 2 issues (run with --fix)
|
||||
```
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
# project-hygiene cleanup hook
|
||||
# Runs after file edits to clean up temp files
|
||||
# All output MUST have [project-hygiene] prefix
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
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
|
||||
|
||||
# Silently delete temp files
|
||||
for pattern in "*.tmp" "*.bak" "*.swp" "*~" ".DS_Store"; do
|
||||
while IFS= read -r -d '' file; do
|
||||
rm -f "$file" 2>/dev/null && ((DELETED_COUNT++)) || true
|
||||
done < <(find "$PROJECT_ROOT" -name "$pattern" -type f -print0 2>/dev/null || true)
|
||||
done
|
||||
|
||||
# Only output if we deleted something
|
||||
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,15 +0,0 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Write|Edit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/cleanup.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user