secrets

Enforce secure secrets management across all platforms. Never hardcode OAuth2 secrets, API keys, tokens, passwords, or credentials in source code. Store all secrets in .env files, load from environment variables, and ensure .env is gitignored. Use this skill when: (1) writing any code that uses API keys, OAuth2 client secrets, tokens, or credentials, (2) setting up authentication or third-party integrations, (3) creating new projects that need environment configuration, (4) reviewing code for security issues related to secrets, (5) configuring CI/CD pipelines or Docker deployments with secrets. Triggers: API key, OAuth, client secret, token, credentials, .env, environment variables, secret, password, authentication setup, third-party integration.

16 stars

Best use case

secrets is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Enforce secure secrets management across all platforms. Never hardcode OAuth2 secrets, API keys, tokens, passwords, or credentials in source code. Store all secrets in .env files, load from environment variables, and ensure .env is gitignored. Use this skill when: (1) writing any code that uses API keys, OAuth2 client secrets, tokens, or credentials, (2) setting up authentication or third-party integrations, (3) creating new projects that need environment configuration, (4) reviewing code for security issues related to secrets, (5) configuring CI/CD pipelines or Docker deployments with secrets. Triggers: API key, OAuth, client secret, token, credentials, .env, environment variables, secret, password, authentication setup, third-party integration.

Teams using secrets should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/secrets/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/secrets/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/secrets/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How secrets Compares

Feature / AgentsecretsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Enforce secure secrets management across all platforms. Never hardcode OAuth2 secrets, API keys, tokens, passwords, or credentials in source code. Store all secrets in .env files, load from environment variables, and ensure .env is gitignored. Use this skill when: (1) writing any code that uses API keys, OAuth2 client secrets, tokens, or credentials, (2) setting up authentication or third-party integrations, (3) creating new projects that need environment configuration, (4) reviewing code for security issues related to secrets, (5) configuring CI/CD pipelines or Docker deployments with secrets. Triggers: API key, OAuth, client secret, token, credentials, .env, environment variables, secret, password, authentication setup, third-party integration.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Secrets Management

## Core Rules

1. **NEVER hardcode** secrets, API keys, OAuth2 client IDs/secrets, tokens, passwords, or credentials in source code
2. **ALWAYS store** secrets in `.env` files (or platform-native equivalents like `local.properties`, `.xcconfig`)
3. **ALWAYS load** secrets from environment variables at runtime
4. **ALWAYS add** `.env` to `.gitignore` before first commit
5. **ALWAYS provide** a `.env.example` documenting required variables (with empty values)

## Workflow

### When Writing Code That Uses Secrets

1. **Detect the platform/framework** from the project files
2. **Check if `.env` and `.gitignore` are set up** — if not, create them
3. **Load secrets from environment variables** using the platform's standard pattern
4. **Never use string literals** for secret values — always reference `process.env.*`, `os.getenv()`, etc.
5. **Add the variable name** to `.env.example` with an empty value and a descriptive comment
6. **Run the scan script** to verify no secrets leaked: `python3 scripts/scan_secrets.py .`

### When Setting Up a New Project

1. Create `.env` with required variables
2. Create `.env.example` mirroring `.env` structure with empty values (use [env-example-template](assets/env-example-template.txt) as a starting point)
3. Add secret-related entries to `.gitignore` (use [gitignore-secrets](assets/gitignore-secrets.txt) as reference)
4. Install the `.env` loading library for the platform
5. Add loading code at the application entry point

### When Reviewing Code

Run `python3 scripts/scan_secrets.py <project-directory>` to detect:
- Hardcoded API keys, tokens, and passwords
- OAuth2 client secrets in source
- AWS keys, Google API keys, Stripe keys, GitHub tokens
- Embedded private keys
- Connection strings with credentials
- Missing `.gitignore` entries for `.env`
- Missing `.env.example`

## Quick Reference by Platform

For platform-specific `.env` loading patterns (install, load, access, framework variants), see [references/platforms.md](references/platforms.md). Covers:

- **JavaScript/TypeScript**: Node.js, Next.js, Vite, React, Nuxt, Remix, Express, NestJS
- **Python**: Django, Flask, FastAPI
- **Ruby**: Rails
- **Go**: godotenv
- **Java/Kotlin**: Spring Boot
- **PHP**: Laravel
- **Rust**: dotenvy
- **Swift/iOS**: Xcode .xcconfig, Vapor
- **Android/Kotlin**: local.properties + BuildConfig
- **Flutter/Dart**: flutter_dotenv
- **C#/.NET**: DotNetEnv, User Secrets
- **Docker**: --env-file, docker-compose env_file
- **CI/CD**: GitHub Actions, GitLab CI, Vercel, Netlify, AWS, GCP, Azure

## Anti-Patterns to Block

Never generate code like:
```
# BAD - hardcoded secrets
api_key = "sk-1234567890abcdef"
client_secret = "my-oauth-secret"
DATABASE_URL = "postgres://user:password@host/db"
const token = "ghp_xxxxxxxxxxxxxxxxxxxx";
```

Always generate code like:
```
# GOOD - loaded from environment
api_key = os.getenv("API_KEY")
const token = process.env.GITHUB_TOKEN;
```

## Mobile Platform Notes

- **iOS**: Use `.xcconfig` files (gitignored) referenced from Xcode build settings — not `.env` at runtime
- **Android**: Use `local.properties` (gitignored by default) injected via `buildConfigField` — not `.env` at runtime
- **Flutter**: `flutter_dotenv` bundles `.env` into the app binary. For truly sensitive secrets, use a backend proxy instead of embedding in the mobile app

Related Skills

secrets-management

16
from diegosouzapw/awesome-omni-skill

Implement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD ...

dotnet-secrets-management

16
from diegosouzapw/awesome-omni-skill

Manages secrets and sensitive config. User secrets, environment variables, rotation.

azure-keyvault-secrets-rust

16
from diegosouzapw/awesome-omni-skill

Azure Key Vault Secrets SDK for Rust. Use for storing and retrieving secrets, passwords, and API keys. Triggers: "keyvault secrets rust", "SecretClient rust", "get secret rust", "set secret rust".

1password-direnv-secrets

16
from diegosouzapw/awesome-omni-skill

Configures 1Password CLI with direnv for fast, secure credential loading. Activates for: 1Password + direnv setup, slow secrets (>2 sec), .env.op files, op:// references, AWS credentials via env vars, --reveal flag issues, repeated biometric prompts, creating 1Password items programmatically, op item get errors. Not for: 1Password GUI usage, SSH keys (use 1Password SSH agent).

azure-security-keyvault-secrets-java

16
from diegosouzapw/awesome-omni-skill

Azure Key Vault Secrets Java SDK for secret management. Use when storing, retrieving, or managing passwords, API keys, connection strings, or other sensitive configuration data.

azure-keyvault-secrets-ts

16
from diegosouzapw/awesome-omni-skill

Manage secrets using Azure Key Vault Secrets SDK for JavaScript (@azure/keyvault-secrets). Use when storing and retrieving application secrets or configuration values.

deleting-op-secrets

16
from diegosouzapw/awesome-omni-skill

Deletes or archives secrets in 1Password using the op CLI. Use when the user needs to permanently remove items, archive deprecated credentials, or clean up unused secrets from 1Password vaults. Supports both permanent deletion and archiving for later recovery.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

crawl-docs-skill

16
from diegosouzapw/awesome-omni-skill

Run a Crawl4AI-based doc crawler and save internal pages as Markdown using page titles as filenames. Use when the user provides a docs URL and wants all internal subpages saved as .md files. Environment setup should only use uv.

copywriter

16
from diegosouzapw/awesome-omni-skill

Brand voice guardian and conversion-focused copywriter, specializing in direct, no-fluff copy that adapts to project's brand voice

compound

16
from diegosouzapw/awesome-omni-skill

Capture session learnings and save to skills, guidelines, or reference docs under ~/.claude/.

coder-docs

16
from diegosouzapw/awesome-omni-skill

Index + offline snapshot of coder/coder documentation (progressive disclosure).