aiskillstore/marketplace / skills/0xdarkmatter/claude-code-templates
claude-code-templates
UnverifiedBoilerplate templates for Claude Code extensions. Triggers on: create agent, new skill, command template, hook script, extension scaffold.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.0 KB |
| assets/agent-template.md | markdown | 1.9 KB |
| assets/command-template.md | markdown | 1.5 KB |
| assets/hook-script.sh | script | 2.2 KB |
| assets/skill-template.md | markdown | 3.8 KB |
| skill-report.json | config | 66.7 KB |
assets/hook-script.sh
View on GitHub#!/bin/bash
#
# Claude Code Hook: [Description]
#
# Event: [PreToolUse|PostToolUse|SessionStart|etc]
# Matcher: [Tool name or * for all]
#
# Security: Validates input, quotes variables, prevents path traversal
#
set -euo pipefail
# Error handling
trap 'echo "Error at line $LINENO" >&2; exit 1' ERR
# Check dependencies
command -v jq >/dev/null 2>&1 || {
echo "jq is required but not installed" >&2
exit 1
}
# Read input from stdin
INPUT=$(cat)
# Validate JSON
if ! echo "$INPUT" | jq -e '.' > /dev/null 2>&1; then
echo "Invalid JSON input" >&2
exit 2
fi
# Parse common fields
TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty')
SESSION=$(echo "$INPUT" | jq -r '.session_id // empty')
# -------------------------------------------------------------------
# Your hook logic here
# -------------------------------------------------------------------
# Example: Log tool usage
LOG_FILE="${CLAUDE_PROJECT_DIR:-.}/.claude/hook.log"
mkdir -p "$(dirname "$LOG_FILE")"
echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ") | $TOOL | $SESSION" >> "$LOG_FILE"
# Example: Block dangerous operations
# if [[ "$TOOL" == "Bash" ]]; then
# CMD=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
# if [[ "$CMD" == *"rm -rf /"* ]]; then
# echo "Blocked dangerous command" >&2
# exit 2 # Exit 2 = blocking error
# fi
# fi
# Example: Validate file paths
# if [[ "$TOOL" == "Write" ]]; then
# FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
# if [[ "$FILE" == *".."* ]]; then
# echo "Path traversal blocked" >&2
# exit 2
# fi
# fi
# -------------------------------------------------------------------
# Exit codes:
# 0 = Success (continue execution)
# 2 = Blocking error (stderr shown to Claude)
# Other = Non-blocking error (logged, continues)
# -------------------------------------------------------------------
exit 0
# CONFIGURATION EXAMPLE:
# Add to ~/.claude/settings.json or .claude/settings.local.json:
#
# {
# "hooks": {
# "PreToolUse": [{
# "matcher": "*",
# "hooks": [{
# "type": "command",
# "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/this-script.sh",
# "timeout": 5000
# }]
# }]
# }
# }
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |