Skip to content
Back to skills

Collection

ASecurity

Automatically applies when adding configuration settings. Ensures proper dynaconf pattern with @env, @int, @bool type casting in settings.toml and environment-specific overrides.

  • 24 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 8, 2026
developmentpythongitapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add mattnigh/skills_collection --skill collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mattnigh-collection-d450b263/badge)](https://www.skillsdirectory.com/skills/mattnigh-collection-d450b263)

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: dynaconf-config
description: Automatically applies when adding configuration settings. Ensures proper dynaconf pattern with @env, @int, @bool type casting in settings.toml and environment-specific overrides.
---

# Dynaconf Configuration Pattern Enforcer

When adding new configuration to `settings.toml`, always follow the dynaconf pattern.

## ✅ Correct Pattern

```toml
# settings.toml

[default]
# Base configuration with type casting
api_base_url = "@env API_BASE_URL|http://localhost:8080"
api_timeout = "@int 30"
feature_enabled = "@bool true"
max_retries = "@int 3"

# API endpoints (no @ prefix for strings)
api_endpoint = "/api/v1/endpoint"

[dev_local]
# Override for local development
api_base_url = "@env API_BASE_URL|http://localhost:8080"

[dev_remote]
# Override for remote development
api_base_url = "@env API_BASE_URL|http://gateway-service"

[production]
# Production overrides
api_base_url = "@env API_BASE_URL|https://api.production.com"
api_timeout = "@int 60"
```

## Type Casting Directives

**Use appropriate prefixes:**
- `@env VAR|default` - Environment variable with fallback
- `@int 123` - Cast to integer
- `@bool true` - Cast to boolean
- `@float 1.5` - Cast to float
- `@path ./dir` - Convert to Path object
- No prefix - String value

## Environment Variable Override

**Pattern:** `APPNAME_SETTING_NAME`

Example:
```toml
# In settings.toml
api_timeout = "@int 30"

# Override via environment
export APP_API_TIMEOUT=60
```

## Configuration Access

```python
from dynaconf import Dynaconf

settings = Dynaconf(
    settings_files=['settings.toml', '.secrets.toml'],
    environments=True,
    load_dotenv=True,
)

timeout = settings.api_timeout  # Returns int 30
url = settings.api_base_url     # Returns string
```

## Common Patterns

**API Configuration:**
```toml
service_api_base_url = "@env SERVICE_API_URL|http://localhost:8080"
service_endpoint = "/api/v1/endpoint/{param}"
service_timeout = "@int 30"
```

**Feature Flags:**
```toml
feature_enabled = "@bool true"
feature_beta_mode = "@bool false"
```

**Database Paths:**
```toml
db_path = "@path data/database.db"
```

**Secrets Management:**
```toml
# settings.toml (checked into git)
api_key = "@env API_KEY"

# .secrets.toml (gitignored)
api_key = "actual-secret-key"
```

## ❌ Anti-Patterns

```toml
# ❌ Don't hardcode secrets
api_key = "sk-1234567890"

# ❌ Don't forget type casting for numbers
timeout = "30"  # Will be string, not int

# ❌ Don't mix environments in same section
[default]
api_url = "https://production.com"  # Should be in [production]
```

## Best Practices Checklist

- ✅ Add to `[default]` section first
- ✅ Use appropriate `@` type casting
- ✅ Add environment variable overrides with `@env`
- ✅ Add to environment-specific sections as needed
- ✅ Document in comments what the setting does
- ✅ Keep secrets in `.secrets.toml` (gitignored)
- ✅ Use consistent naming conventions (snake_case)
- ✅ Provide sensible defaults

## Auto-Apply

When adding configuration:
1. Add to `[default]` section first
2. Use appropriate `@` type casting
3. Add environment variable overrides
4. Add to environment-specific sections as needed
5. Document in comments what the setting does

## Related Skills

- structured-errors - For validation errors
- pydantic-models - For settings validation with Pydantic

Files in this skill

  • 0Chan-smc__claude-code-workflow-lab__claude__skills__frontend-dev-guidelines__SKILL.md15.1 KB
  • 17hz__nextjs-template__claude__skills__example-skill__SKILL.md316 B
  • 1ambda__dataops-platform__claude__skills__context-synthesis__SKILL.md3.5 KB
  • 1natsu172__dotfiles__claude__skills__git-analysis__SKILL.md5.4 KB
  • 1natsu172__dotfiles__claude__skills__github-pr-best-practices__SKILL.md7.7 KB
  • 23Maestro__prospect-pipeline__claude__skills__npid-fastapi-skill.md26.1 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-javascript__SKILL.md15.7 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-code-python__SKILL.md17.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-expression-syntax__SKILL.md9.4 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-mcp-tools-expert__SKILL.md12.5 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-node-configuration__SKILL.md16.6 KB
  • 360AYA25__ClaudeN8N__claude__skills__n8n-workflow-patterns__SKILL.md11.2 KB
  • 3x-Projetos__claude-memory-framework__claude__skills__scientist__SKILL.md14.8 KB
  • 5MinFutures__futures-arena__claude__skills__migration-tracker__SKILL.md16.2 KB
  • 5MinFutures__futures-arena__claude__skills__planning-guidelines__SKILL.md11.8 KB
  • 92Bilal26__TaskPilotAI__claude__skills__assessment-builder__SKILL.md17.5 KB
  • 92Bilal26__TaskPilotAI__claude__skills__book-scaffolding__SKILL.md19.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__code-validation-sandbox__SKILL.md6.2 KB
  • 92Bilal26__TaskPilotAI__claude__skills__exercise-designer__SKILL.md18.1 KB
  • 92Bilal26__TaskPilotAI__claude__skills__learning-objectives__SKILL.md24.5 KB

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.

View all in development →

Comments

Loading comments…

Newsletter

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