基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vamseeachanta/workspace-hub --skill bash-cli-framework-5-error-handling命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Write outbound email and external messages in Vamsee Achanta's voice — a subtle offer to help, never bold or rash claims. Load before drafting ANY email, LinkedIn/Collide reply, proposal note, or outreach sent under his name.
Save/publish analysis or computation results from ANY ecosystem repo to Hugging Face as a queryable, viewer-renderable dataset. Use when the user wants to "save results to hugging face", "publish dataset to HF", "hugging face data saving", "save analysis results", "hf dataset", "make results queryable", or "render via datasets-server API". Reshapes nested results into flat parquet tables, writes a dataset card with a viewer `configs:` block and provenance, applies license/public-vs-private routing, enforces a domain data-quality gate (faithful-to-source != correct), publishes to `aceengineer/<repo>-<projection>`, and verifies via the datasets-server API.
Clone, create, fork, configure, and manage GitHub repositories. Manage remotes, secrets, releases, and workflows. Works with gh CLI or falls back to git + GitHub REST API via curl.
| name | bash-cli-framework-5-error-handling |
| description | Sub-skill of bash-cli-framework: 5. Error Handling (+1). |
| version | 1.0.0 |
| category | _core |
| type | reference |
| scripts_exempt | true |
Robust error handling with cleanup:
#!/bin/bash
# ABOUTME: Error handling and cleanup functions
# ABOUTME: Ensures graceful exit and resource cleanup
# Trap for cleanup on exit
cleanup() {
local exit_code=$?
# Remove temporary files
[[ -n "$TEMP_DIR" && -d "$TEMP_DIR" ]] && rm -rf "$TEMP_DIR"
# Log exit status
if [[ $exit_code -eq 0 ]]; then
log_info "Script completed successfully"
else
log_error "Script exited with code $exit_code"
fi
exit $exit_code
}
# Set trap
trap cleanup EXIT INT TERM
# Error handler
die() {
local message="$1"
local exit_code="${2:-1}"
log_critical "$message"
exit "$exit_code"
}
# Assert function
assert() {
local condition="$1"
local message="${2:-Assertion failed}"
if ! eval "$condition"; then
die "$message"
fi
}
Standard argument parsing pattern:
#!/bin/bash
# ABOUTME: Argument parsing framework
# ABOUTME: Supports short/long options with values
# Default values
VERBOSE=false
DRY_RUN=false
CONFIG_FILE=""
show_usage() {
cat << EOF
Usage: $SCRIPT_NAME [OPTIONS] <arguments>
Options:
-h, --help Show this help message
-v, --verbose Enable verbose output
-n, --dry-run Show what would be done without doing it
-c, --config FILE Use specified configuration file
--version Show version information
Examples:
$SCRIPT_NAME --verbose process
$SCRIPT_NAME -c config.yaml --dry-run
EOF
}
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
show_usage
exit 0
;;
-v|--verbose)
VERBOSE=true
LOG_LEVEL="DEBUG"
shift
;;
-n|--dry-run)
DRY_RUN=true
shift
;;
-c|--config)
CONFIG_FILE="$2"
shift 2
;;
--version)
echo "$SCRIPT_NAME version $VERSION"
exit 0
;;
--)
shift
break
;;
-*)
die "Unknown option: $1"
;;
*)
;;
ARGS=()
}