ianchesal/dotfiles/ssh-new-key
Claude Code and agent skill by ianchesal/dotfiles
- community
Checking that the SKILL.md file is still in the repository.
Use when the user wants a new SSH keypair, SSH key, or ssh key for authenticating to a host or service, stored in 1Password — "make me a new ssh key", "generate a keypair in 1password", "I need a key for <host>". Also used by ssh-new-host when a host has no key yet.
Install
npx vskill@latest install ianchesal/dotfiles/ssh-new-keySKILL.md
New SSH Keypair in 1Password
The private half is generated inside 1Password and never touches disk. Only the public half lands in the dotfiles repo, as ~/.ssh/<name>.pub, where ssh config uses it as IdentityFile to tell the 1Password agent which key to sign with.
0. Guard — stop on any failure
Any STOP-* line: tell the user why and do nothing else. Work machines and the cloud workstation do not get ~/.ssh from these dotfiles at all. Signed out: ask them to run ! eval "$(op signin)", then retry.
1. Name and locate
<name>: lowercase,[a-z0-9][a-z0-9._-]*, usually the host it is for
(homeassistant, github-work). Ask if not given.
src=$(chezmoi source-path ~/.ssh/config);dir=$(dirname "$src");
repo=$(git -C "$dir" rev-parse --show-toplevel). Never hardcode the repo path.
git -C "$repo" pull --ff-onlyfirst. If it fails (diverged, dirty, offline),
tell the user and stop.
- Collision check — stop and ask if either finds something:
op item list --vault Private --categories 'SSH Key' --format json | jq -r '.[].title' | grep -ixF <name> prints a match, or [ -e "$dir/<name>.pub" ] is true.
2. Create and export
1Password may show an approval prompt for op — tell the user to watch for it.
- The flag is
--ssh-generate-key(there is no--ssh-keytype). Never pipe the
item JSON to the terminal: it contains the private key.
- Use
op item get --fields, notop read—op readreferences break on
titles containing @.
- Check:
wc -l < "$dir/<name>.pub"is 1 andhead -c 12isssh-ed25519. - If anything fails after
op item createsucceeded, the item exists: do not
create it again (the collision check will rightly trip). Resume at the export.
3. Deploy, verify the agent, commit
ssh-add -l exiting 2 means no agent is reachable at all (SSH_AUTH_SOCK unset, or the WSL relay not running) — say that, it is not a key problem. If the agent answers but the fingerprint is missing, 1Password is not offering the key: tell the user to check the 1Password app (Settings → Developer → SSH agent, and any agent.toml that restricts which vaults/items are served). Do not continue to anything that authenticates with the key until it shows up.
Commit only the new file: git -C "$repo" add home/private_dot_ssh/<name>.pub and commit with a message like Add <name> SSH public key. Ask before pushing; other machines get the .pub only after a push, on their next dfu.
Hand-off
Report the item title, the fingerprint, and the .pub path. If the user wants the key used for a host, continue with ssh-new-host. Do not write ssh config here.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinghome/dot_claude/skills/ssh-new-key/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ianchesal/dotfiles/ssh-new-key)