feat: add Learning Paths, examples, and project governance files
### New Content - Learning Paths section in README (Junior/Senior/Power User/PM tracks) - examples/ folder with 18 ready-to-use templates: - 4 agents (code-reviewer, test-writer, security-auditor, refactoring) - 2 skills (TDD workflow, security checklist) - 3 commands (commit, review-pr, generate-tests) - 4 hooks (bash + PowerShell for security, formatting) - 3 config templates (settings, MCP, gitignore) - 2 memory templates (project + personal CLAUDE.md) ### Governance - CHANGELOG.md: Version history (1.0.0 → 1.1.0 → Unreleased) - CONTRIBUTING.md: Contribution guidelines for community ### Documentation - llms.txt: Updated structure with new files/folders This update makes the guide more actionable with concrete templates and provides clear learning paths for different skill levels. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a4eed95f47
commit
b2acc9b115
24 changed files with 1744 additions and 4 deletions
48
examples/hooks/bash/auto-format.sh
Normal file
48
examples/hooks/bash/auto-format.sh
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
# PostToolUse hook - Auto-format files after editing
|
||||
# Place in: .claude/hooks/auto-format.sh
|
||||
# Register in: .claude/settings.json
|
||||
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.tool_name')
|
||||
|
||||
# Only run after Write or Edit operations
|
||||
if [[ "$TOOL" == "Write" || "$TOOL" == "Edit" ]]; then
|
||||
FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.path')
|
||||
|
||||
if [[ -z "$FILE" || "$FILE" == "null" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get file extension
|
||||
EXT="${FILE##*.}"
|
||||
|
||||
case "$EXT" in
|
||||
js|jsx|ts|tsx|json|css|scss|md|html|vue)
|
||||
# Format with Prettier if available
|
||||
if command -v npx &> /dev/null && [[ -f "node_modules/.bin/prettier" ]]; then
|
||||
npx prettier --write "$FILE" 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
py)
|
||||
# Format with Black if available
|
||||
if command -v black &> /dev/null; then
|
||||
black "$FILE" 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
go)
|
||||
# Format with gofmt
|
||||
if command -v gofmt &> /dev/null; then
|
||||
gofmt -w "$FILE" 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
rs)
|
||||
# Format with rustfmt
|
||||
if command -v rustfmt &> /dev/null; then
|
||||
rustfmt "$FILE" 2>/dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exit 0
|
||||
47
examples/hooks/bash/security-check.sh
Normal file
47
examples/hooks/bash/security-check.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
# PreToolUse hook - Block commands containing secrets
|
||||
# Place in: .claude/hooks/security-check.sh
|
||||
# Register in: .claude/settings.json
|
||||
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.tool_name')
|
||||
|
||||
if [[ "$TOOL" == "Bash" ]]; then
|
||||
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')
|
||||
|
||||
# Check for common secret patterns
|
||||
PATTERNS=(
|
||||
"password="
|
||||
"PASSWORD="
|
||||
"secret="
|
||||
"SECRET="
|
||||
"api_key="
|
||||
"API_KEY="
|
||||
"apikey="
|
||||
"token="
|
||||
"TOKEN="
|
||||
"aws_access_key"
|
||||
"AWS_ACCESS_KEY"
|
||||
"aws_secret"
|
||||
"AWS_SECRET"
|
||||
"private_key"
|
||||
"PRIVATE_KEY"
|
||||
)
|
||||
|
||||
for PATTERN in "${PATTERNS[@]}"; do
|
||||
if echo "$COMMAND" | grep -qi "$PATTERN"; then
|
||||
echo "{\"decision\": \"block\", \"reason\": \"Potential secret detected: $PATTERN\"}"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for hardcoded credentials in common formats
|
||||
# API keys (typically long alphanumeric strings)
|
||||
if echo "$COMMAND" | grep -qE "(sk-[a-zA-Z0-9]{20,}|pk_[a-zA-Z0-9]{20,}|[a-f0-9]{32,})"; then
|
||||
echo "{\"decision\": \"block\", \"reason\": \"Potential API key or hash detected\"}"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allow the command
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue