Back to skills
SKILL.md
1 Always Provide Defaults
BSecuritySub-skill of json-config-loader: 1. Always Provide Defaults (+4).
- 17 stars
- 0 votes
- 0 copies
- 4 views
- Added September 9, 2026
Works with
Security analysis
88/100- Sends environment variables or credentials to an external URL
npx -y skills add vamseeachanta/workspace-hub --skill 1-always-provide-defaults --agent claude-codeAre you the author of 1 Always Provide Defaults?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vamseeachanta-1-always-provide-defaults)---
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
```
Attribution
Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.