Skip to content
Back to skills

Secrets Setup

ASecurity

Sets up safe secret handling for a project — .env plus .env.example, .gitignore rules, loading and validating variables at startup, and GitHub secret scanning with push protection. Use when a project gets a bot token, API key or database password, or the user asks "куда положить токен", "как хранить ключи", "set up .env".

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 13, 2026
ai-agentspythonnodegitapidatabasesecurity

Works with

  • api

Security analysis

A100/100

Scanned October 13, 2026

npx -y skills add dmminga1983/minga --skill secrets-setup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Secrets Setup?

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

Security grade badge for Secrets Setup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dmminga1983-secrets-setup/badge)](https://www.skillsdirectory.com/skills/dmminga1983-secrets-setup)

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: secrets-setup
description: Sets up safe secret handling for a project — .env plus .env.example, .gitignore rules, loading and validating variables at startup, and GitHub secret scanning with push protection. Use when a project gets a bot token, API key or database password, or the user asks "куда положить токен", "как хранить ключи", "set up .env".
argument-hint: "[project path or stack]"
---

# Secrets setup / Настройка секретов

Project: $ARGUMENTS

Reply in the user's language.

## 1. Files

- `.env` — real values, **never committed**.
- `.env.example` — the same variable names with placeholders (`TELEGRAM_BOT_TOKEN=your_token_here`), committed, with a comment per variable saying where to get it.
- `.gitignore` must contain:

```gitignore
.env
.env.*
!.env.example
*.pem
*.key
*.p12
credentials*.json
```

If `.env` was already committed at any point, the values in it are compromised: rotate them, then remove the file from history.

## 2. Loading

- Python: `python-dotenv` → `load_dotenv()`; read with `os.environ["NAME"]` so a missing value fails loudly.
- Node: built-in `node --env-file=.env` (Node 20.6+) or `dotenv`.
- Validate at startup: list required variables, exit with a clear message naming the missing one. Never print values.

## 3. Production

Use the host's secret store (GitHub Actions secrets, the hosting panel's environment variables, systemd `EnvironmentFile=` with `chmod 600`). Different keys for development and production.

## 4. GitHub

Settings → *Code security* → enable **Secret scanning** and **Push protection**. Keep Minga's guard hook on: it blocks commits and pushes that contain token-like strings.

## 5. Check

Run `node "${CLAUDE_PLUGIN_ROOT}/hooks/scripts/scan-secrets.mjs" --history` and confirm it reports no findings.

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.