Codesign keychain prompt fix
Skill bokuwalily/claude-code-skills/skills/codesign-keychain-prompt-fix
75 battle-tested Claude Code skills from shipping 20+ apps solo — macOS, Next.js, Vercel, iOS/Expo, Cloudflare, Phaser, local AI media & more
npx -y skills add bokuwalily/claude-code-skills --skill codesign-keychain-prompt-fixAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
fastlane/xcodebuild の iOS署名中に codesign のキーチェーン許可ダイアログ(「codesignがキー…へアクセスしようとしています」)が出る・固まって消えない時。特に複数ビルド同時実行でダイアログが競合してハングした時に発火。
SKILL.md
3.1 KB, 958 tokens by cl100k_base, as published. Nobody here has run it
Procedure
症状
- iOSアーカイブ署名中、
codesignが login キーチェーンの秘密鍵にアクセスするため許可ダイアログを出す - 「許可」だと毎回出る。複数ビルド(例: Konomi と Dayleaf)が同時に署名すると SecurityAgent が競合してダイアログが固まり消えなくなる
1. 状況把握
ps aux | grep -iE 'SecurityAgent|codesign|fastlane|xcodebuild' | grep -v grep
同時に走ってる署名系プロセスと、固まった SecurityAgent(/System/.../SecurityAgent.bundle/.../SecurityAgent)の PID を特定。
2. 固まったダイアログを消す
SecurityAgent は killall の SIGTERM を無視するので SIGKILL:
kill -9 <SecurityAgentのPID>
(必要時にOSが自動再起動する安全なプロセス)
3. 根本対処(再プロンプトを止める)= 本命
署名鍵のパーティションリストに codesign を一括登録。ユーザー本人がログインパスワードで実行(自分は password を打たない):
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "<ログインパスワード>" ~/Library/Keychains/login.keychain-db
成功すると変更した鍵の属性一覧をダンプして返す(エラーなし=成功)。Apple Distribution/Imported Private Key/Apple Development 系が列挙されていればOK。
-k "..."を省けば一度だけGUIで聞かれる。
4. 宙ぶらりんのビルドを掃除して再実行
固まった codesign/xcodebuild/fastlane はツリーごと kill -TERM。残ってよいのは com.apple.CodeSigningHelper(OS常駐)のみ。その後、各ビルドを再実行。
Pitfalls
- computer-use では固まったダイアログを操作できない:SecurityAgent は許可外アプリなので screenshot に映らず、クリックも届かない → コマンドで殺すのが正解
killall SecurityAgentは効かない(SIGTERM無視)→ 必ずkill -9- パーティションリスト未設定のまま「許可」を押し続けると鍵ごと・プロセスごとに延々出る。
set-key-partition-listが唯一の恒久解 - 同時複数署名ビルドが競合の根本原因。パーティションリスト設定後は同時でも衝突しないが、設定前は1本ずつ
- ログインパスワードはこちらに保存しない。スクロールバックが気になるなら
clear
Verification
set-key-partition-listがエラーなく鍵一覧をダンプps aux | grep -iE 'codesign|fastlane|xcodebuild'が CodeSigningHelper 以外クリア- 再ビルドで署名ポップが出ずに通る
Gives 0 of the 12 instructions most prompt engineering skills give in 958 tokens
Counted across 563 of the 626 authors here whose files we hold, read 2026-08-06
- ask at most three clarifying questionsin 22 of 563, across 15 files
- respond in the user input languagein 14 of 563, across 9 files
- preserve the original intentin 13 of 563, across 11 files
- Establish baseline metrics and collect representative examplesin 12 of 563, across 2 files
- Identify failure modes and prioritize high-impact fixesin 12 of 563, across 2 files
- Apply prompt and workflow improvements with measurable goalsin 12 of 563, across 2 files
- Roll back quickly if quality or safety metrics regressin 12 of 563, across 2 files
- validate changes with tests and roll out in controlled stagesin 12 of 563, across 2 files
- generate quantitative baseline performance reportsin 12 of 563, across 2 files
- create representative test scenariosin 12 of 563, across 2 files
- treat prompts as codein 12 of 563, across 5 files
- test prompts on diverse inputsin 12 of 563, across 8 files
Said here and by no other author read
- identify stuck SecurityAgent and signing process PIDs
- send SIGKILL to the stuck SecurityAgent PID
- register codesign in the key partition list
- have the user provide the login password
- kill orphaned codesign, xcodebuild, and fastlane process trees
- rerun the builds after clearing processes
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.