git-prepush-secret-remote-check
Skill0 starsChanged 5 months agoMITView on GitHub
git pushやパブリック公開の直前に実行する。リモートURLが自分のリポジトリを指しているか確認し、ステージ・差分内のAPIキー/トークン/PII漏洩をスキャンする。複数セッションで「サードパーティforkへのwrong-remote」と「PII流出」が実際に発生したことへの対策。
- Reads credentials
- Commits and pushes
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- ummshun/claude-code-skillsedited, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- ummshun/claude-code-skills★ 023% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codesign-keychain-prompt-fixSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- gsc-cli-automationSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- html-to-pdf-slide-deckSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- launchd-exit78-exconfig-debugSkill
- llm-content-pipeline-quality-gateSkill
- local-ai-video-pipelineSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
Procedure
1. リモートURLを確認する
git remote -v出力例:
origin git@github.com:YOUR_USERNAME/YOUR_REPO.git (fetch)
origin git@github.com:YOUR_USERNAME/YOUR_REPO.git (push)自分のアカウント名が含まれていることを確認。サードパーティのfork元URLになっていれば即修正:
git remote set-url origin git@github.com:YOUR_USERNAME/YOUR_REPO.git2. ステージ済みファイルに秘密情報がないかスキャン
git diff --cached | grep -iE \
"(api_?key|secret|token|password|passwd|auth|credential|access_?key|private_?key)\s*[=:]\s*\S+"何も出力されなければOK。ヒットしたら即 git reset HEAD <file> でアンステージし、.env 化してから .gitignore に追加。
3. コミット済み履歴を含むスキャン(念のため)
git log --oneline -10
git show HEAD | grep -iE "(api_?key|secret|token|password)\s*[=:]\s*\S+"4. .env 系ファイルが追跡されていないか確認
git ls-files | grep -E "^\.env"出力があればトラッキングから除外:
git rm --cached .env
echo ".env" >> .gitignore
git add .gitignore5. 個人情報(PII)の簡易チェック
git diff --cached | grep -iE \
"(\b[0-9]{3}-[0-9]{4}-[0-9]{4}\b|@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"電話番号・メールアドレスパターンにヒットしたらコード内のハードコーディングを確認。
Pitfalls
- fork元リモートのままpush:テンプレートをforkしたまま
originを変えずにpushすると、サードパーティリポジトリに自分のコードが公開される。手順1を必ず行う。 .envファイルの誤コミット:create-next-appやviteはデフォルトで.env.localを.gitignoreに入れるが、自前設定のプロジェクトでは漏れる。手順4で確認。grepのパターンは完璧ではない:難読化・Base64化された秘密情報は検出できない。gitleaksやtruffleHogなどの専用ツールが使える環境ならそちらを優先。- force-pushで履歴書き換えても残る:一度でも公開リポジトリにpushしたシークレットはGitHub側にキャッシュされる可能性がある。露出したら即ローテーション。
Verification
# リモートが自分のリポジトリを指していること
git remote -v | grep "YOUR_USERNAME"
# シークレットスキャンで何もヒットしないこと
git diff --cached | grep -iE "(api_?key|secret|token|password)\s*[=:]\s*\S+" | wc -l
# → 0 であればOK
# .env系が追跡されていないこと
git ls-files | grep -E "^\.env" | wc -l
# → 0 であればOKDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

