لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI تاریخ شمسی… --:--:--

Managing Secrets

آزاد تازه‌وارد تاییدشده امن

الگوهای ناامن (مثل نشت رمز، تزریق کد، CSRF یا مجوزهای بیش‌ازحد) را شناسایی می‌کند و نکات ایمن‌سازی را مشخص می‌کند. (شامل ۷ گام عملی · سازگار با Claude Code).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: managing-secrets
description: Keep secrets out of Git, logs, and browser bundles - ignore rules, .env.example, startup checks, public prefixes, short-lived credentials - and respond when a secret leaks. Use when adding an environment variable or credential, reviewing .env files, or when a secret may have been committed.
license: MIT
compatibility: Optional - gitleaks, to scan for secrets.
metadata:
  author: famiglio
  category: security
---

# Managing Secrets

A secret in Git, in a log, or in the browser is public. Keep secrets in the environment, or encrypted with dotenvx (see the `encrypting-env-files` skill).

## Procedure

1. **Ignore the secret files** in `.gitignore`:

   ```text
   .env
   .env.*
   !.env.example
   .env.keys
   *.pem
   *.key
   ```

   With dotenvx, encrypted `.env` files can be committed. `.env.keys` never.

2. **Keep `.env.example` up to date,** with every variable and no real value:

   ```text
   DATABASE_URL=postgresql://user:password@localhost:5432/app
   API_KEY=
   ```

3. **Check the variables at startup,** in one module (see the `configuring-twelve-factor-apps` skill). The error names the key, never the value.

4. **Keep secrets out of the browser.** A variable named `NEXT_PUBLIC_*`, `VITE_*`, `PUBLIC_*`, or `REACT_APP_*` ends up in the bundle.

<!-- ‹guest · 2026-12-05› -->
5. **Keep secrets out of logs.** Redact headers, cookies, and passwords in the logger (see the `writing-structured-logs` skill).

6. **In CI, prefer OIDC** to stored keys, for clouds and for npm (see the `publishing-to-npm` skill).

7. **If a secret leaked,** stop and tell the user: they must revoke it and create a new one. Rewriting the history does not help once it was pushed. Never run commands that rewrite a shared history without approval.

## Verification

```bash
git ls-files | grep -E '(^|/)\.env\.keys$|\.(pem|key|p12)$' && echo "Private key files are tracked." || echo "No key files."
git ls-files | grep -E '(^|/)\.env($|\.)' | grep -vE '\.env\.(example|sample|template)$' || echo "No .env files tracked."
```

Check that every tracked `.env` file holds only encrypted values. If gitleaks is installed, also run `gitleaks git --redact`.

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
عامل‌های هوش مصنوعی
✦ Pro

REA

دستورالعمل اجرایی آماده برای انجام دقیق کارهای عامل‌های هوش مصنوعی بدون تکرار پرامپت‌های طولانی. (شامل ۶۵ گام عملی · سا…

⚡ /reverse-engineer-anything SKILL.md
Claude / Claude CodeOpenAI Codex +۲
۹۴/۱۰۰ ★ ۴۷۹,۷۷۳
عامل‌های هوش مصنوعی
✦ Pro

Verification Before Completion

این مهارت با نام «Verification Before Completion» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ …

⚡ /verification-before-completion SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Dispatching Parallel Agents

این مهارت با نام «Dispatching Parallel Agents» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کاف…

⚡ /dispatching-parallel-agents SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Using Git Worktrees

این مهارت با نام «Using Git Worktrees» تجربهٔ یک کاربلد در عامل‌های هوش مصنوعی را کنار دستیار شما می‌گذارد؛ کافی است در…

⚡ /using-git-worktrees SKILL.md
Cline
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

Subagent-Driven Development

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «Subagent-Driven Development» بخشی از کار را از دوش شما برمی‌دارد: «مرور ساختا…

⚡ /subagent-driven-development SKILL.md
Claude / Claude Code
۹۴/۱۰۰ ★ ۳۲۴,۲۹۰
عامل‌های هوش مصنوعی
✦ Pro

The Rule

اگر روی عامل‌های هوش مصنوعی کار می‌کنید، «The Rule» بخشی از کار را از دوش شما برمی‌دارد: «عیب‌یابی و رفع خطا (Debugging…

⚡ /using-superpowers SKILL.md
Claude / Claude CodeOpenAI Codex +۱
۹۱/۱۰۰ ★ ۳۲۴,۲۹۰