json-config-loader-3-json-report-generation
정보
이 스킬은 bash 데이터에서 구조화된 JSON 보고서를 생성하며, 적절한 인코딩과 형식을 위해 jq를 사용합니다. 연관 배열로부터 JSON 객체를 생성하고, 타임스탬프와 실행 메타데이터가 포함된 구조화된 보고서를 만드는 함수를 제공합니다. 셸 스크립트에서 로깅, 모니터링 또는 데이터 교환을 위해 기계가 읽을 수 있는 JSON을 출력해야 할 때 사용하세요.
빠른 설치
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/json-config-loader-3-json-report-generationClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
3. JSON Report Generation
3. JSON Report Generation
Generate structured JSON reports:
#!/bin/bash
# ABOUTME: Generate JSON reports from bash data
# ABOUTME: Uses jq for proper JSON encoding and structure
# Generate simple JSON object
generate_json_object() {
local -n data=$1 # Nameref to associative array
local json="{}"
for key in "${!data[@]}"; do
local value="${data[$key]}"
json=$(echo "$json" | jq --arg k "$key" --arg v "$value" '. + {($k): $v}')
done
echo "$json"
}
# Generate JSON report with structure
generate_report() {
local status="$1"
local total="$2"
local errors="$3"
local warnings="$4"
jq -n \
--arg status "$status" \
--arg timestamp "$(date -Iseconds)" \
--arg run_id "$(date +%Y%m%d-%H%M%S)" \
--argjson total "$total" \
--argjson errors "$errors" \
--argjson warnings "$warnings" \
'{
metadata: {
status: $status,
timestamp: $timestamp,
run_id: $run_id
},
summary: {
total_processed: $total,
errors: $errors,
warnings: $warnings,
success_rate: (if $total > 0 then (($total - $errors) * 100 / $total) else 0 end)
}
}'
}
# Add items to JSON report
add_report_items() {
local report="$1"
shift
local items=("$@")
# Convert items array to JSON array
local items_json="[]"
for item in "${items[@]}"; do
items_json=$(echo "$items_json" | jq --arg i "$item" '. + [$i]')
done
echo "$report" | jq --argjson items "$items_json" '. + {items: $items}'
}
# Save report to file
save_report() {
local report="$1"
local file="$2"
mkdir -p "$(dirname "$file")"
echo "$report" | jq '.' > "$file"
echo "Report saved: $file"
}
# Usage
report=$(generate_report "success" 100 5 10)
report=$(add_report_items "$report" "item1" "item2" "item3")
save_report "$report" "reports/analysis-$(date +%Y%m%d).json"
GitHub 저장소
연관 스킬
algorithmic-art
메타This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
subagent-driven-development
개발This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
executing-plans
디자인Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
cost-optimization
기타This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
