npx skills add ...
npx skills add daymade/claude-code-skills --skill repomix-safe-mixer
Safely package codebases with repomix by automatically detecting and removing hardcoded credentials before packing. Use when packaging code for distribution, creating reference packages, or when the user mentions security concerns about sharing code with repomix.
npx skills add daymade/claude-code-skills --skill repomix-safe-mixer
Safely package codebases with repomix by automatically detecting and removing hardcoded credentials.
This skill prevents accidental credential exposure when packaging code with repomix. It scans for hardcoded secrets (API keys, database credentials, tokens), reports findings, and ensures safe packaging.
When to use: When packaging code with repomix for distribution, creating shareable reference packages, or whenever security concerns exist about hardcoded credentials in code.
Use safe_pack.py from this skill's scripts/ directory for the complete workflow: scan → report → pack.
What it does:
Example:
Output if clean:
Output if secrets found:
Custom output file:
With repomix config:
Exclude patterns from scanning:
Force pack (dangerous, skip scan):
Use scan_secrets.py from this skill's scripts/ directory for scanning only (without packing).
Use cases:
Example:
JSON output for programmatic use:
Exclude patterns:
The scanner detects common credential patterns including:
Cloud Providers:
AKIA...)API Keys:
sk_live_..., pk_live_...)sk-...)AIza...)Authentication:
eyJ...)-----BEGIN PRIVATE KEY-----)0x...)See references/common_secrets.md for complete list and patterns.
When secrets are found:
Examine each finding to verify it's a real credential (not a placeholder or example).
Before:
After:
Run scanner again to confirm secrets removed:
Once clean, package safely:
If credentials were already exposed (e.g., committed to git, shared publicly):
The scanner skips common false positives:
Placeholders:
your-api-key, example-key, placeholder-value<YOUR_API_KEY>, ${API_KEY}, TODO: add keyTest/Example files:
.*test.*, .*example.*, .*sample.*Comments:
//, #, /*, *Environment variable references (correct usage):
process.env.API_KEYimport.meta.env.VITE_API_KEYDeno.env.get('API_KEY')Use --exclude to skip additional patterns if needed.
This skill works with standard repomix:
Default usage (no config):
With repomix config:
Custom output location:
The skill runs repomix internally after security validation, passing through config and output options.
References:
references/common_secrets.md - Complete credential pattern catalogScripts:
scripts/scan_secrets.py - Standalone security scannerscripts/safe_pack.py - Complete scan → pack workflowRelated Skills:
repomix-unmixer - Extracts files from repomix packagesskill-creator - Creates new Claude Code skillsThis skill detects common patterns but may not catch all credential types. Always:
Not a replacement for: Secret scanning in CI/CD, git history scanning, or comprehensive security audits.
🔍 Scanning ./my-project for hardcoded secrets...
⚠️ Security Scan Found 3 Potential Secrets:
🔴 supabase_url: 1 instance(s)
- src/client.ts:5
Match: https://your-project-ref.supabase.co
❌ Cannot pack: Secrets detected!python3 scripts/safe_pack.py \
./my-project \
--output package.xmlpython3 scripts/safe_pack.py \
./my-project \
--config repomix.config.jsonpython3 scripts/safe_pack.py \
./my-project \
--exclude '.*test.*' '.*\.example'python3 scripts/safe_pack.py \
./my-project \
--force # ⚠️ NOT RECOMMENDEDpython3 scripts/scan_secrets.py <directory>python3 scripts/scan_secrets.py ./my-projectpython3 scripts/scan_secrets.py ./my-projectpython3 scripts/scan_secrets.py \
./my-project \
--jsonpython3 scripts/scan_secrets.py \
./my-project \
--exclude '.*test.*' '.*example.*' '.*SECURITY_AUDIT\.md'const SUPABASE_URL = "https://your-project-ref.supabase.co";
const API_KEY = "<hardcoded-anon-key-DO-NOT-COMMIT>";const SUPABASE_URL = import.meta.env.VITE_SUPABASE_URL || "https://your-project-ref.supabase.co";
const API_KEY = import.meta.env.VITE_API_KEY || "your-api-key-here";
// Validation
if (!import.meta.env.VITE_SUPABASE_URL) {
console.error("⚠️ Missing VITE_SUPABASE_URL environment variable");
}# Example environment variables
VITE_SUPABASE_URL=https://your-project-ref.supabase.co
VITE_API_KEY=your-api-key-here
# Instructions:
# 1. Copy this file to .env
# 2. Replace placeholders with real values
# 3. Never commit .env to version controlpython3 scripts/safe_pack.py ./projectpython3 scripts/safe_pack.py \
./project \
--config repomix.config.jsonpython3 scripts/safe_pack.py \
./project \
--output ~/Downloads/package-clean.xml# Scan and pack in one command
python3 scripts/safe_pack.py \
~/workspace/my-project \
--output ~/Downloads/my-project-package.xml# Step 1: Scan to discover secrets
python3 scripts/scan_secrets.py ~/workspace/my-project
# Step 2: Review findings and replace credentials with env vars
# (Edit files manually or with automation)
# Step 3: Verify cleanup
python3 scripts/scan_secrets.py ~/workspace/my-project
# Step 4: Package safely
python3 scripts/safe_pack.py \
~/workspace/my-project \
--output ~/Downloads/my-project-clean.xml# Pre-commit hook: scan for secrets
python3 scripts/scan_secrets.py . --json
# Exit code 1 if secrets found (blocks commit)
# Exit code 0 if clean (allows commit)