Sub-skill of json-config-loader: 1. Always Provide Defaults (+4).
Scanned 9/9/2026
Install to Claude Code
npx -y skills add vamseeachanta/workspace-hub --skill 1-always-provide-defaults --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of 1 Always Provide Defaults?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-1-always-provide-defaults)More formats (shields.io, HTML) on the badges page.
---
name: json-config-loader-1-always-provide-defaults
description: 'Sub-skill of json-config-loader: 1. Always Provide Defaults (+4).'
version: 1.0.0
category: _core
type: reference
scripts_exempt: true
---
# 1. Always Provide Defaults (+4)
## 1. Always Provide Defaults
```bash
value=$(config_get "key" "default_value")
```
## 2. Validate Early
```bash
config_require "api_key" "database_url" || exit 1
```
## 3. Use Environment Overrides for Secrets
```bash
# Don't store secrets in files
API_KEY="${API_KEY:-$(config_get 'api_key')}"
```
## 4. Validate JSON with jq
```bash
if ! jq empty "$file" 2>/dev/null; then
echo "Invalid JSON" >&2
exit 1
fi
```
## 5. Handle Missing Files Gracefully
```bash
if [[ -f "$config_file" ]]; then
load_config "$config_file"
else
echo "Warning: Config not found, using defaults" >&2
fi
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。