feat: expand agents (10), skills (20), and hooks (11) with profile system

Agents:
- Add YAML frontmatter (model, tools) to all 7 existing agents
- New agents: planner (opus), build-error-resolver (sonnet), loop-operator (sonnet)

Skills:
- search-first: research before building (Adopt/Extend/Compose/Build)
- verification-loop: full quality gate pipeline (Build→TypeCheck→Lint→Test→Security→Diff)
- strategic-compact: when and how to run /compact effectively
- autonomous-loops: 6 patterns for autonomous agent workflows
- continuous-learning: extract session learnings into instincts

Hooks:
- Profile system (minimal/standard/strict) via run-with-profile.sh
- config-protection: block linter/formatter config edits (standard)
- suggest-compact: remind about /compact every ~50 tool calls (standard)
- auto-tmux-dev: suggest tmux for dev servers (standard)
- session-save/session-load: persist and restore session context (Stop/SessionStart)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
olekhondera
2026-03-24 20:16:20 +02:00
parent cf86a91e4a
commit db5ba04fb9
26 changed files with 1361 additions and 58 deletions

View File

@@ -0,0 +1,46 @@
#!/bin/bash
# Hook profile gate — wraps hooks to enable/disable by profile
# Profiles: minimal (safety only), standard (safety + quality), strict (everything)
#
# Usage in settings.json:
# "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/run-with-profile.sh standard $CLAUDE_PROJECT_DIR/.claude/hooks/some-hook.sh"
#
# Environment variables:
# CLAUDE_HOOK_PROFILE — Override profile (minimal|standard|strict). Default: standard
# CLAUDE_DISABLED_HOOKS — Comma-separated list of hook filenames to skip. E.g.: "suggest-compact.sh,auto-tmux-dev.sh"
REQUIRED_PROFILE="${1:?Usage: run-with-profile.sh <profile> <hook-script>}"
HOOK_SCRIPT="${2:?Usage: run-with-profile.sh <profile> <hook-script>}"
shift 2
# Current profile (default: standard)
CURRENT_PROFILE="${CLAUDE_HOOK_PROFILE:-standard}"
# Profile hierarchy: minimal < standard < strict
profile_level() {
case "$1" in
minimal) echo 1 ;;
standard) echo 2 ;;
strict) echo 3 ;;
*) echo 2 ;; # default to standard
esac
}
CURRENT_LEVEL=$(profile_level "$CURRENT_PROFILE")
REQUIRED_LEVEL=$(profile_level "$REQUIRED_PROFILE")
# Skip if current profile is lower than required
if [ "$CURRENT_LEVEL" -lt "$REQUIRED_LEVEL" ]; then
exit 0
fi
# Check if hook is explicitly disabled
HOOK_NAME=$(basename "$HOOK_SCRIPT")
if [ -n "$CLAUDE_DISABLED_HOOKS" ]; then
if echo ",$CLAUDE_DISABLED_HOOKS," | grep -q ",$HOOK_NAME,"; then
exit 0
fi
fi
# Execute the hook, passing stdin through
exec "$HOOK_SCRIPT" "$@"