bashrc 凭证与密钥检查
bashrc-credential-guard
在询问用户之前,务必先检查 `~/.bashrc` 中是否存在凭证、API 密钥、密码和配置值。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- type
- usage
- scope
- project
- description
- Always check ~/.bashrc for credentials, API keys, passwords, and configuration values before asking user
03 SKILL.md 正文
Bashrc Credential Guard
Purpose
Guide Claude to always check ~/.bashrc for any credentials, API keys, passwords, GCP projects, and configuration values BEFORE asking the user or looking elsewhere.
Trigger phrases
- Questions about API credentials, passwords, or secrets
- Requests for deployment environment setup or configuration
- Missing environment variables or credentials
- GCP project configuration
- Email credentials or SMTP settings
- Any credential or configuration lookup
Mandatory Protocol
? ALWAYS CHECK ~/.bashrc FIRST: ⚠️ MANDATORY - BEFORE asking user or looking elsewhere
- Read
~/.bashrcusing the Read tool to find exported values - Common patterns to search for:
export API_KEY="..."export EMAIL_USER="..."export EMAIL_PASS="..."export PASSWORD="..."export GCP_PROJECT="..."export GEMINI_API_KEY="..."export GITHUB_TOKEN="..."- Any
export VAR_NAME="value"pattern
Configuration Sources (Priority Order)
- ~/.bashrc - PRIMARY SOURCE (check FIRST, ALWAYS)
.envfiles - Secondary for local development- Platform secret managers - GitHub Secrets, GCP Secret Manager
- User input - LAST RESORT (only if not found in bashrc)
Common Use Cases
1. API Keys and Credentials
# Read ~/.bashrc to find:
export GEMINI_API_KEY="AIzaSy..."
export ANTHROPIC_API_KEY="sk-ant-..."
export GITHUB_TOKEN="ghp_..."
2. Email Configuration
# Read ~/.bashrc to find:
export EMAIL_USER="user@gmail.com"
export EMAIL_PASS="app-password-here"
3. GCP Project Configuration
# Read ~/.bashrc to find:
export GCP_PROJECT="worldai"
export GCP_REGION="us-central1"
4. Database and Service URLs
# Read ~/.bashrc to find:
export DATABASE_URL="postgresql://..."
export REDIS_URL="redis://..."
Security Best Practices
Never Commit Secrets
- Never commit real keys to git repositories
- Store them in
~/.bashrc(gitignored by default) - Reference
.env.examplefor required variables without actual values
Use Bashrc Values for CI/CD
- When setting GitHub Secrets, use values from
~/.bashrc - When configuring GCP Secret Manager, source from
~/.bashrc - When updating environment variables, check
~/.bashrcfirst
Offer Redacted Examples
- When showing credential examples, redact sensitive parts
- Example:
export API_KEY="AIzaSy...XXX"(showing only prefix)
Troubleshooting Flow
-
Missing Credential Error
- FIRST: Read
~/.bashrcto check if credential exists - Check pattern:
grep CREDENTIAL_NAME ~/.bashrc - If found: Use the value from bashrc
- If not found: Ask user to add it to bashrc
- FIRST: Read
-
Configuration Mismatch
- FIRST: Read
~/.bashrcfor the canonical value - Compare with current configuration
- Update configuration to match bashrc value
- FIRST: Read
-
Deployment Failures
- FIRST: Read
~/.bashrcto verify all required credentials - Check if CI/CD secrets match bashrc values
- Update secrets if they differ from bashrc
- FIRST: Read
Response Structure
- Acknowledge the need for credentials/configuration
- Read
~/.bashrcFIRST to check for existing values - If found: Use the values from bashrc
- If not found: Guide user to add them to bashrc
- Provide commands to verify the values are set correctly
Integration with Other Systems
GitHub Secrets
- Source all secret values from
~/.bashrc - Use
gh secret setcommands with bashrc values - Example:
gh secret set EMAIL_USER --body "$EMAIL_USER"
GCP Configuration
- Read GCP project from
~/.bashrcfirst - Use bashrc values for deployment configuration
- Ensure
.github/workflows/*.ymlmatches bashrc values
Local Development
.envfiles should mirror bashrc values- Use bashrc as the single source of truth
- Sync .env files with bashrc when values change
Common Patterns in Bashrc
# API Keys
export GEMINI_API_KEY="AIzaSy..."
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
# Email/SMTP
export EMAIL_USER="user@gmail.com"
export EMAIL_PASS="app-password"
# Cloud Platforms
export GCP_PROJECT="worldai"
export AWS_REGION="us-east-1"
# GitHub
export GITHUB_TOKEN="ghp_..."
export GITHUB_USER="username"
# Database
export DATABASE_URL="postgresql://..."
export REDIS_URL="redis://..."
Remember
- ~/.bashrc is the FIRST place to check - Not the last resort
- Always read before asking - Don't ask user for values that are in bashrc
- Verify values exist - Use
grepor Read tool to confirm - Use bashrc for CI/CD - All secrets should come from bashrc
- Single source of truth - Bashrc is the canonical source for credentials
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.