Skip to content
Back to skills

1 Always Provide Defaults

BSecurity

Sub-skill of json-config-loader: 1. Always Provide Defaults (+4).

  • 17 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
securitygobashapidatabase

Works with

  • api

Security analysis

B88/100
  • criticalSends environment variables or credentials to an external URL

Pro shows the line behind each finding and how to fix it

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill 1-always-provide-defaults --agent claude-code

Installs 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 with every re-scan.

Security grade badge for 1 Always Provide Defaults
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-1-always-provide-defaults/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-1-always-provide-defaults)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.