interactive-menu-builder-5-confirmation-dialogs
정보
이 스킬은 명령줄 애플리케이션에서 상호작용형 확인 대화창을 생성하기 위한 Bash 함수를 제공합니다. 구성 가능한 기본값으로 예/아니오 프롬프트를 처리하며, 사용자 결정 전에 설명 세부사항을 표시하는 패턴을 포함합니다. 개발자는 셸 스크립트에 안전 확인이나 파괴적 작업에 대한 확인을 추가해야 할 때 이를 사용해야 합니다.
빠른 설치
Claude Code
추천npx skills add vamseeachanta/workspace-hub/plugin add https://github.com/vamseeachanta/workspace-hubgit clone https://github.com/vamseeachanta/workspace-hub.git ~/.claude/skills/interactive-menu-builder-5-confirmation-dialogsClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
5. Confirmation Dialogs (+1)
5. Confirmation Dialogs
Request user confirmation:
#!/bin/bash
# ABOUTME: Confirmation dialog patterns
# ABOUTME: Yes/No prompts with defaults
# Simple yes/no
confirm() {
local prompt="${1:-Are you sure?}"
local default="${2:-n}" # Default to no
if [[ "$default" == "y" ]]; then
prompt+=" [Y/n]: "
else
prompt+=" [y/N]: "
fi
read -p "$prompt" response
response="${response:-$default}"
[[ "${response,,}" == "y" || "${response,,}" == "yes" ]]
}
# Confirmation with explanation
confirm_action() {
local action="$1"
local details="$2"
echo ""
echo -e "${YELLOW}⚠ Confirmation Required${NC}"
echo ""
echo "Action: $action"
[[ -n "$details" ]] && echo "Details: $details"
echo ""
confirm "Proceed?" "n"
}
# Dangerous action confirmation
confirm_dangerous() {
local action="$1"
local confirm_word="${2:-DELETE}"
echo ""
echo -e "${RED}⚠ DANGEROUS OPERATION${NC}"
echo ""
echo "This action cannot be undone!"
echo "Action: $action"
echo ""
echo -e "Type '${YELLOW}${confirm_word}${NC}' to confirm:"
read -p "> " response
[[ "$response" == "$confirm_word" ]]
}
# Usage
if confirm "Delete all logs?"; then
rm -rf logs/*
fi
if confirm_dangerous "Delete all repositories" "DELETE"; then
# Perform dangerous action
echo "Proceeding..."
fi
6. Progress Indicators
Show progress during operations:
#!/bin/bash
# ABOUTME: Progress indicator patterns
# ABOUTME: Spinners, bars, and status updates
# Spinner
spinner() {
local pid=$1
local message="${2:-Processing}"
local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
local i=0
while kill -0 "$pid" 2>/dev/null; do
i=$(( (i+1) % ${#spin} ))
printf "\r${CYAN}%s${NC} %s" "${spin:$i:1}" "$message"
sleep 0.1
done
printf "\r${GREEN}✓${NC} %s\n" "$message"
}
# Usage
long_running_task &
spinner $! "Running long task..."
# Progress bar
progress_bar() {
local current=$1
local total=$2
local width=40
local percent=$((current * 100 / total))
local filled=$((current * width / total))
local empty=$((width - filled))
printf "\r["
printf "%${filled}s" | tr ' ' '█'
printf "%${empty}s" | tr ' ' '░'
printf "] %3d%% (%d/%d)" "$percent" "$current" "$total"
}
# Usage
total=100
for i in $(seq 1 $total); do
progress_bar $i $total
sleep 0.05
done
echo ""
# Status updates
status_line() {
local message="$1"
printf "\r\033[K%s" "$message" # Clear line and print
}
# Completion markers
mark_done() {
local message="$1"
echo -e "${GREEN}✓${NC} $message"
}
mark_fail() {
local message="$1"
echo -e "${RED}✗${NC} $message"
}
mark_skip() {
local message="$1"
echo -e "${YELLOW}⊘${NC} $message"
}
GitHub 저장소
연관 스킬
content-collections
메타This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.
polymarket
메타This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.
creating-opencode-plugins
메타This skill helps developers create OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It provides the plugin structure, event API specifications, and implementation patterns for JavaScript/TypeScript modules. Use it when you need to intercept, monitor, or extend the OpenCode AI assistant's lifecycle with custom event-driven logic.
cloudflare-turnstile
메타This skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.
