[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75PQ9W6ZHVTADCMX9JRVEQ8":3,"skill-same:01M75PQ9W6ZHVTADCMX9JRVEQ8":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":6,"updatedAt":52,"install":53,"resources":65},"01M75PQ9W6ZHVTADCMX9JRVEQ8","setup-git-credentials",null,"Use when the user wants Git to stop using a PAT in the remote URL or a plain-text credential store, wants Git Credential Manager (GCM) with OAuth for GitHub, GitLab or Azure DevOps on Ubuntu\u002FDebian or WSL2, or sees 'cannot persist Microsoft authentication token cache securely' \u002F 'using plain-text fallback token cache'. Asks whether this is WSL, which Git hosts and which parts to set up, checks what is already done, sets git config itself after confirmation and hands every sudo or interactive step (apt, gpg, pass init, secret-tool, first sign-in) to the user. Bundles gcm-keyring-session.sh to start or reuse a D-Bus + GNOME Keyring session without systemd. Trigger terms - git credentials, PAT in URL, token in remote, git credential manager, gcm, github auth, gitlab auth, azure devops auth, pass, gpg store, secret service, gnome keyring, msal token cache, wsl git auth.","Aliendreamer\u002Fai.skills","Aliendreamer","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F26008043?v=4","01M75PJZKADCYNHHZPMW7363F6","Teodor Stefanov","01M75PJZKYGDX0TDM0X5TX24G0",0,"MIT","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fsetup-git-credentials\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: setup-git-credentials\ndescription: \"Use when the user wants Git to stop using a PAT in the remote URL or a plain-text credential store, wants Git Credential Manager (GCM) with OAuth for GitHub, GitLab or Azure DevOps on Ubuntu\u002FDebian or WSL2, or sees 'cannot persist Microsoft authentication token cache securely' \u002F 'using plain-text fallback token cache'. Asks whether this is WSL, which Git hosts and which parts to set up, checks what is already done, sets git config itself after confirmation and hands every sudo or interactive step (apt, gpg, pass init, secret-tool, first sign-in) to the user. Bundles gcm-keyring-session.sh to start or reuse a D-Bus + GNOME Keyring session without systemd. Trigger terms - git credentials, PAT in URL, token in remote, git credential manager, gcm, github auth, gitlab auth, azure devops auth, pass, gpg store, secret service, gnome keyring, msal token cache, wsl git auth.\"\ntype: skill\ndisable-model-invocation: false\nuser-invocable: true\ntags: [git, credentials, gcm, oauth, github, gitlab, azure-devops, gpg, pass, keyring, wsl, security]\nagents: [claude, codex, cursor, gemini, copilot]\nversion: 0.1.0\nauthor: Aliendreamer\n---\n\n# Setup Git Credentials\n\nTake a Linux (Ubuntu\u002FDebian, WSL2 or native) Git setup from \"PAT in the remote URL\" to Git Credential Manager\n(GCM) signing in to each host — GitHub, GitLab, Azure DevOps or any other HTTPS host — with credentials encrypted with\nGPG + `pass`, and, for Azure DevOps, the Microsoft (MSAL) token cache in the Secret Service instead of a plain-text\nfile. SSH remotes carry no token and are left alone.\n\n**Three rules hold for the whole skill:**\n\n- **Never run `sudo`.** Anything that needs it is handed to the user as an exact command.\n- **Never print or read a secret.** No token, password, PAT, client secret or credential-file contents in your output,\n  your commands' output, or your notes. Redact before displaying (see step 2).\n- **Confirm before every change you make yourself.** You may only change user-level Git configuration\n  (`git config --global`, `git-credential-manager configure`, `git remote set-url`). If one fails — permissions,\n  agent sandbox — report it and hand the command to the user; do not work around it.\n\n`gcm-keyring-session.sh` lives next to this SKILL.md — call it by that path (`\u003Cskill-dir>` below).\n\n## The parts\n\n| # | Part | What it changes | Agent runs | User runs | Needs |\n| - | ---- | --------------- | ---------- | --------- | ----- |\n| 1 | Install GCM | `git-credential-manager` package, `credential.helper` | `git-credential-manager configure` | `apt` install of the `.deb` | — |\n| 2 | Sign-in per host + clean remotes | per-host `credential.*` settings, remote URLs | `git config`, `git remote set-url` | OAuth app details (self-hosted GitLab), revoking PATs | 1 |\n| 3 | Encrypted credential store | GPG key, `pass` store, `credential.credentialStore` | `git config` after the gate | `apt`, `gpg --full-generate-key`, `pass init` | 1 |\n| 4 | Secure MSAL token cache — **Azure DevOps only** | D-Bus session + GNOME Keyring (Secret Service) | `--check` | `apt`, sourcing the script, `secret-tool` test | 1 |\n| 5 | Auto-start in new shells — **with part 4** | a copy of the script + one rc line | — | copy + rc edit | 4 |\n\nPart 3 is where GCM keeps every host's credential — GitHub and GitLab OAuth tokens, PATs, passwords. Part 4 is only\nwhere Microsoft's sign-in library keeps Azure DevOps tokens. Fixing one does not fix the other.\n\n## Steps\n\n### 1. Ask whether this is WSL\n\nDetect first, then ask — the user's answer wins:\n\n```bash\ngrep -qi microsoft \u002Fproc\u002Fsys\u002Fkernel\u002Fosrelease && echo wsl                   # or WSL_DISTRO_NAME is set\n[ -d \u002Frun\u002Fsystemd\u002Fsystem ] && echo systemd                                 # systemd is PID 1\ncommand -v apt-get >\u002Fdev\u002Fnull && echo apt\n```\n\nAsk: \"This looks like WSL[, without systemd]. Is that right?\" On WSL without systemd expect part 4 to need the\nbundled script, and expect no browser to open for OAuth unless WSLg or `wslu` provides one. On native Ubuntu with a\ndesktop, or WSL with `systemd=true`, Secret Service is often already there and part 4 reduces to a check. No\n`apt-get` → say this skill covers Ubuntu\u002FDebian only and stop.\n\n### 2. Check what is already in place\n\nRead-only. Run what applies and keep the results for steps 3–5:\n\n```bash\ngit-credential-manager --version 2>\u002Fdev\u002Fnull\ngit config --global --get-all credential.helper\ngit config --global --get-regexp '^credential\\..+\\.helper$'        # per-host helpers, e.g. gh \u002F glab\ngit config --global --get-regexp '^credential\\..*(credentialstore|authmodes|provider|azreposcredentialtype)$'\ngpg --list-secret-keys --keyid-format LONG        # public key IDs only\ntest -s \"${PASSWORD_STORE_DIR:-$HOME\u002F.password-store}\u002F.gpg-id\" && echo pass-initialized\ntest -e ~\u002F.git-credentials && echo plaintext-credentials-file\ntest -e ~\u002F.local\u002F.IdentityService\u002Fmsal.cache && echo msal-cache-file\n\u003Cskill-dir>\u002Fgcm-keyring-session.sh --check\n```\n\n`credential.helper` is a list, and an empty entry resets it: only the entries after the last empty one are in effect.\n\n**Remotes — never run a bare `git remote -v`;** its output can contain the PAT. Use these two instead — one redacts,\none lists only the hosts:\n\n```bash\ngit remote -v | sed -E -e 's#(https?:\u002F\u002F)[^\u002F]*:[^\u002F]*@#\\1***:***@#' -e 's#(https?:\u002F\u002F)[^\u002F:@]{20,}@#\\1***@#'\ngit remote -v | sed -E -e 's#^[^\\t]*\\thttps?:\u002F\u002F([^\u002F]*@)?([^\u002F]+).*#https \\2#' \\\n                       -e 's#^[^\\t]*\\t(ssh:\u002F\u002F)?[^@\u002F]*@([^:\u002F]+).*#ssh \\2#' | sort -u\n```\n\nClassify each HTTPS remote by what the redacted output shows before the host:\n\n- `***:***@` → **credential embedded** (user:PAT);\n- `***@` → a 20+ character user name, **possibly a PAT** (GitHub's `ghp_…`, GitLab's `glpat-…`) — ask the user;\n- a short name such as the Azure DevOps organization (`https:\u002F\u002Forg@dev.azure.com\u002Forg\u002F...`) → harmless.\n\nAsk whether to scan other repositories too (for example everything under `~\u002Fprojects`):\n`find \u003Cdir> -maxdepth 3 -name .git -type d` and run both commands in each.\n\n`--check` needs a Unix socket. If your sandbox blocks it (\"Operation not permitted\"), the result says nothing about\nthe machine — ask the user to run it (in Claude Code: `! \u003Cskill-dir>\u002Fgcm-keyring-session.sh --check`).\n\n### 3. Ask which hosts, then which parts\n\n**Hosts** — multi-select, pre-selected from the HTTPS hosts found in step 2:\n\n- Azure DevOps (`dev.azure.com`, `*.visualstudio.com`)\n- GitHub (`github.com`)\n- GitLab.com\n- Self-hosted GitLab — ask for the URL\n- Other HTTPS host (Bitbucket, Gitea, …) — ask for the URL\n\n**Parts** — multi-select. Offer parts 4 and 5 only if Azure DevOps is selected. Mark each part **done** when its\nchecks pass:\n\n| Part | Done when |\n| ---- | --------- |\n| 1 | `git-credential-manager --version` prints a version and the effective `credential.helper` list ends with it |\n| 2 | each selected host's settings (part 2 below) are present, no per-host helper overrides GCM unless the user keeps it, and no remote has an embedded credential |\n| 3 | `.gpg-id` exists and `credentialStore` is `gpg` |\n| 4 | `--check` exits 0 |\n| 5 | the user's rc already sources the script |\n\nWalk the selection in the order 1 → 5. If a selected part needs an unselected one that is not done (table above,\n\"Needs\"), say so and ask whether to add it.\n\n### 4. Walk the selected parts\n\nAfter each hand-off, wait for the user to say it is done, then re-run that part's check before moving on.\n\n#### Part 1 — Install GCM\n\nHand off (2.9.1 is the version this setup was proven on):\n\n```bash\nsudo apt update && sudo apt install -y curl git ca-certificates\ncurl -fL https:\u002F\u002Fgithub.com\u002Fgit-ecosystem\u002Fgit-credential-manager\u002Freleases\u002Fdownload\u002Fv2.9.1\u002Fgcm-linux-x64-2.9.1.deb \\\n  -o \u002Ftmp\u002Fgcm.deb\nsudo apt install \u002Ftmp\u002Fgcm.deb\n```\n\nIf the user wants the latest release, look up its tag on the GitHub releases page or API and confirm an asset named\n`gcm-linux-x64-\u003Cversion>.deb` exists before handing off that URL. Then, after confirmation, run\n`git-credential-manager configure` and `git-credential-manager --version`.\n\n#### Part 2 — Sign-in per host and clean remotes\n\nGCM recognizes Azure DevOps, GitHub and GitLab.com by host name; set only what differs from its default. Settings\nscoped to a URL (`credential.https:\u002F\u002Fhost.\u003Ckey>`) affect only that host. Each change after confirmation:\n\n| Host | Set | Why |\n| ---- | --- | --- |\n| Azure DevOps | `git config --global credential.azreposCredentialType oauth` | OAuth tokens instead of GCM creating PATs |\n| GitHub, browser available | nothing | GCM's default OAuth opens the browser |\n| GitHub, no browser (plain WSL) | `git config --global credential.https:\u002F\u002Fgithub.com.gitHubAuthModes device` | sign in with a code on any device |\n| GitLab.com, browser available | nothing | GCM's default browser OAuth |\n| GitLab.com, no browser | `git config --global credential.https:\u002F\u002Fgitlab.com.gitLabAuthModes pat` | GitLab has no device flow; GCM prompts for a PAT once and stores it encrypted |\n| Self-hosted GitLab | `git config --global credential.\u003Curl>.provider gitlab`, then see below | GCM cannot detect it by name |\n| Other host | nothing | GCM prompts for the credential once and stores it |\n\n**Self-hosted GitLab.** Ask whether an OAuth application for GCM is registered on that instance (an admin creates it\nwith redirect URI `http:\u002F\u002F127.0.0.1\u002F` and scopes `read_repository write_repository`). If yes, set\n`credential.\u003Curl>.gitLabDevClientId \u003Capplication id>` yourself and hand off the secret so it never passes through you:\n\n```bash\nprintf 'Client secret: '; stty -echo; read -r s; stty echo; echo\ngit config --global credential.\u003Curl>.gitLabDevClientSecret \"$s\"; unset s\n```\n\nIf no OAuth app — or no browser — set `credential.\u003Curl>.gitLabAuthModes pat`; the user creates a PAT with\n`read_repository`\u002F`write_repository` scopes and pastes it at GCM's prompt on the first fetch.\n\n**Helpers that bypass GCM.** If step 2 found `credential.https:\u002F\u002Fgithub.com.helper` → `gh auth git-credential`, or a\n`glab auth git-credential` helper for a GitLab host, those win over GCM for that host. Ask: keep the CLI's helper, or\nuse GCM? For GCM, after confirmation remove that host's entries:\n`git config --global --unset-all credential.https:\u002F\u002Fgithub.com.helper`.\n\n**Clean remotes.** For each flagged remote, show the redacted URL and the clean one, and after confirmation rewrite\nit without ever echoing the old URL:\n\n```bash\ngit remote set-url \u003Cname> \"$(git remote get-url \u003Cname> | sed -E 's#^(https?:\u002F\u002F)[^\u002F]*@#\\1#')\"\ngit remote get-url \u003Cname>        # now clean — safe to show\n```\n\nRepeat with `--push` if `git config --get-all remote.\u003Cname>.pushurl` is set. Then tell the user: **revoke every PAT\nthat was in a URL or in `~\u002F.git-credentials`** — it has been on disk in plain text; removing it from the URL does not\nun-expose it:\n\n- Azure DevOps → User settings → Personal access tokens\n- GitHub → Settings → Developer settings → Personal access tokens\n- GitLab → Preferences (User settings) → Access tokens\n\n#### Part 3 — Encrypted credential store (GPG + `pass`)\n\nHand off `sudo apt install -y gnupg pass`. If step 2 found no secret key, hand off `gpg --full-generate-key`.\n\nThe user then needs their **primary** key ID for `pass init` — not the encryption subkey. Show how to recognize it\non this example listing (made-up IDs):\n\n```text\n$ gpg --list-secret-keys --keyid-format LONG\nsec   rsa4096\u002F1A2B3C4D5E6F7A8B 2026-01-15 [SC]\n      0123456789ABCDEF0123456789ABCDEF01234567\nuid                 [ultimate] Jane Doe \u003Cjane@example.com>\nssb   rsa4096\u002F8B7A6F5E4D3C2B1A 2026-01-15 [E]\n```\n\nThe ID after the `\u002F` on the **`sec`** line (`1A2B3C4D5E6F7A8B` here) is the one to use. The `ssb` line is the\nsubkey — GPG picks it automatically. Hand off `pass init \u003CPRIMARY_KEY_ID>` with the user's own ID from their\nlisting.\n\n**Gate:** only when `.gpg-id` exists, and after confirmation:\n\n```bash\ngit config --global credential.credentialStore gpg\ngit-credential-manager configure\n```\n\nSetting `credentialStore gpg` before `pass` is initialized breaks every Git sign-in, on every host.\n\n#### Part 4 — Secure MSAL token cache (Azure DevOps)\n\nHand off:\n\n```bash\nsudo apt install -y dbus-x11 gnome-keyring libsecret-tools\n. \u003Cskill-dir>\u002Fgcm-keyring-session.sh          # in the shell Git will run from\n```\n\nThe script reuses a live session bus or the one saved by an earlier shell, starts `dbus-launch` only if neither is\nreachable, and starts `gnome-keyring-daemon --components=secrets` only if no Secret Service owns the bus. It is\nsilent on success.\n\nThen hand off the round-trip test, with a throwaway value, never a real password — `lookup` prints it back:\n\n```bash\nsecret-tool store --label=\"GCM Test\" app gcm-test     # type a dummy value\nsecret-tool lookup app gcm-test\nsecret-tool clear app gcm-test\n```\n\nGNOME Keyring may ask to create or unlock a keyring. On WSL that prompt needs WSLg; if no prompt can appear and the\nstore fails, stop part 4 here and tell the user — do not configure anything that depends on it.\n\n#### Part 5 — Auto-start in new shells\n\nInstalled skill folders move between agents, so the rc line must not point into `\u003Cskill-dir>`. Find the shell with\n`basename \"$SHELL\"` and hand off (shown for zsh; use `~\u002F.bashrc` for bash):\n\n```bash\nmkdir -p ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\ncp \u003Cskill-dir>\u002Fgcm-keyring-session.sh ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002F\ngrep -qF 'setup-git-credentials\u002Fgcm-keyring-session.sh' ~\u002F.zshrc ||\n  echo '[ -f ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002Fgcm-keyring-session.sh ] && . ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002Fgcm-keyring-session.sh' >> ~\u002F.zshrc\n```\n\nEvery new terminal then joins the same session instead of starting new daemons. After `wsl --shutdown` the saved\nsession is gone; the next terminal starts a fresh one and the keyring may ask to be unlocked.\n\n### 5. Verify\n\nReport each line as passed or failed:\n\n- `git config --global --get credential.credentialStore` → `gpg` (part 3)\n- the effective `credential.helper` list ends with GCM (part 1; the exact value varies)\n- each per-host setting from part 2 reads back as set\n- **per selected host**, the user runs `git fetch` in a repo of that host. The first one signs in (browser, device\n  code or PAT prompt); a **second** `git fetch` must complete with no prompt — the credential was stored.\n- **Azure DevOps only:** the `secret-tool` round trip from part 4 returned the dummy value, and the Azure DevOps fetch\n  (from a shell with the session — a new terminal if part 5 is done) completes without\n  `cannot persist Microsoft authentication token cache securely` \u002F `using plain-text fallback token cache`.\n\nIf the warning still appears: run `--check` from that same shell (user-side if your sandbox blocks sockets) and\nrepeat part 4. `credential.azreposUseMicrosoftSharedCache false` is **not** the fix — do not suggest it.\n\nIf a second fetch prompts again, the store is not saving: re-check part 3 (`.gpg-id`, `credentialStore`, and the\n`GPG_TTY` pitfall below).\n\n### 6. Remove plain-text leftovers\n\nOnly after step 5 passes. Hand off each that applies:\n\n- `~\u002F.git-credentials` exists → `rm ~\u002F.git-credentials`. If `credential.helper` lists `store`, remove that entry\n  after confirmation: `git config --global --unset credential.helper '^store$'`.\n- `~\u002F.local\u002F.IdentityService\u002Fmsal.cache` existed while the plain-text warning was showing → it may still hold tokens\n  in plain text. `rm ~\u002F.local\u002F.IdentityService\u002Fmsal.cache`; the next Azure DevOps fetch signs in once more and writes\n  the cache to the keyring.\n- Remind once more to revoke any PAT found in step 2, at the host's page listed in part 2.\n\n## Known pitfalls\n\n- **`gcm-linux_amd64.deb` returns 404** — that is not the asset name. Use `gcm-linux-x64-\u003Cversion>.deb`.\n- **`credentialStore gpg` does not silence the MSAL warning** — the Git credential store and the Microsoft token\n  cache are separate (parts 3 and 4).\n- **`credential.azreposUseMicrosoftSharedCache false` is not the fix** for the warning; a reachable Secret Service is.\n- **Do not paste `eval \"$(dbus-launch --sh-syntax)\"` into `.zshrc`** — each terminal starts another bus and keyring.\n  Source the bundled script instead (part 5).\n- **GPG cannot prompt for the passphrase** (Git hangs, or gpg reports `Inappropriate ioctl for device`) → the user\n  adds `export GPG_TTY=$(tty)` to their rc.\n- **`gh auth setup-git` \u002F `glab` silently take over** a host — their per-host helper beats the global GCM one (part 2).\n- **Windows Credential Manager is not used.** Everything runs on the Linux side; this skill does not set up the\n  Windows GCM bridge.\n","# Setup Git Credentials\n\nTake a Linux (Ubuntu\u002FDebian, WSL2 or native) Git setup from \"PAT in the remote URL\" to Git Credential Manager\n(GCM) signing in to each host — GitHub, GitLab, Azure DevOps or any other HTTPS host — with credentials encrypted with\nGPG + `pass`, and, for Azure DevOps, the Microsoft (MSAL) token cache in the Secret Service instead of a plain-text\nfile. SSH remotes carry no token and are left alone.\n\n**Three rules hold for the whole skill:**\n\n- **Never run `sudo`.** Anything that needs it is handed to the user as an exact command.\n- **Never print or read a secret.** No token, password, PAT, client secret or credential-file contents in your output,\n  your commands' output, or your notes. Redact before displaying (see step 2).\n- **Confirm before every change you make yourself.** You may only change user-level Git configuration\n  (`git config --global`, `git-credential-manager configure`, `git remote set-url`). If one fails — permissions,\n  agent sandbox — report it and hand the command to the user; do not work around it.\n\n`gcm-keyring-session.sh` lives next to this SKILL.md — call it by that path (`\u003Cskill-dir>` below).\n\n## The parts\n\n| # | Part | What it changes | Agent runs | User runs | Needs |\n| - | ---- | --------------- | ---------- | --------- | ----- |\n| 1 | Install GCM | `git-credential-manager` package, `credential.helper` | `git-credential-manager configure` | `apt` install of the `.deb` | — |\n| 2 | Sign-in per host + clean remotes | per-host `credential.*` settings, remote URLs | `git config`, `git remote set-url` | OAuth app details (self-hosted GitLab), revoking PATs | 1 |\n| 3 | Encrypted credential store | GPG key, `pass` store, `credential.credentialStore` | `git config` after the gate | `apt`, `gpg --full-generate-key`, `pass init` | 1 |\n| 4 | Secure MSAL token cache — **Azure DevOps only** | D-Bus session + GNOME Keyring (Secret Service) | `--check` | `apt`, sourcing the script, `secret-tool` test | 1 |\n| 5 | Auto-start in new shells — **with part 4** | a copy of the script + one rc line | — | copy + rc edit | 4 |\n\nPart 3 is where GCM keeps every host's credential — GitHub and GitLab OAuth tokens, PATs, passwords. Part 4 is only\nwhere Microsoft's sign-in library keeps Azure DevOps tokens. Fixing one does not fix the other.\n\n## Steps\n\n### 1. Ask whether this is WSL\n\nDetect first, then ask — the user's answer wins:\n\n```bash\ngrep -qi microsoft \u002Fproc\u002Fsys\u002Fkernel\u002Fosrelease && echo wsl                   # or WSL_DISTRO_NAME is set\n[ -d \u002Frun\u002Fsystemd\u002Fsystem ] && echo systemd                                 # systemd is PID 1\ncommand -v apt-get >\u002Fdev\u002Fnull && echo apt\n```\n\nAsk: \"This looks like WSL[, without systemd]. Is that right?\" On WSL without systemd expect part 4 to need the\nbundled script, and expect no browser to open for OAuth unless WSLg or `wslu` provides one. On native Ubuntu with a\ndesktop, or WSL with `systemd=true`, Secret Service is often already there and part 4 reduces to a check. No\n`apt-get` → say this skill covers Ubuntu\u002FDebian only and stop.\n\n### 2. Check what is already in place\n\nRead-only. Run what applies and keep the results for steps 3–5:\n\n```bash\ngit-credential-manager --version 2>\u002Fdev\u002Fnull\ngit config --global --get-all credential.helper\ngit config --global --get-regexp '^credential\\..+\\.helper$'        # per-host helpers, e.g. gh \u002F glab\ngit config --global --get-regexp '^credential\\..*(credentialstore|authmodes|provider|azreposcredentialtype)$'\ngpg --list-secret-keys --keyid-format LONG        # public key IDs only\ntest -s \"${PASSWORD_STORE_DIR:-$HOME\u002F.password-store}\u002F.gpg-id\" && echo pass-initialized\ntest -e ~\u002F.git-credentials && echo plaintext-credentials-file\ntest -e ~\u002F.local\u002F.IdentityService\u002Fmsal.cache && echo msal-cache-file\n\u003Cskill-dir>\u002Fgcm-keyring-session.sh --check\n```\n\n`credential.helper` is a list, and an empty entry resets it: only the entries after the last empty one are in effect.\n\n**Remotes — never run a bare `git remote -v`;** its output can contain the PAT. Use these two instead — one redacts,\none lists only the hosts:\n\n```bash\ngit remote -v | sed -E -e 's#(https?:\u002F\u002F)[^\u002F]*:[^\u002F]*@#\\1***:***@#' -e 's#(https?:\u002F\u002F)[^\u002F:@]{20,}@#\\1***@#'\ngit remote -v | sed -E -e 's#^[^\\t]*\\thttps?:\u002F\u002F([^\u002F]*@)?([^\u002F]+).*#https \\2#' \\\n                       -e 's#^[^\\t]*\\t(ssh:\u002F\u002F)?[^@\u002F]*@([^:\u002F]+).*#ssh \\2#' | sort -u\n```\n\nClassify each HTTPS remote by what the redacted output shows before the host:\n\n- `***:***@` → **credential embedded** (user:PAT);\n- `***@` → a 20+ character user name, **possibly a PAT** (GitHub's `ghp_…`, GitLab's `glpat-…`) — ask the user;\n- a short name such as the Azure DevOps organization (`https:\u002F\u002Forg@dev.azure.com\u002Forg\u002F...`) → harmless.\n\nAsk whether to scan other repositories too (for example everything under `~\u002Fprojects`):\n`find \u003Cdir> -maxdepth 3 -name .git -type d` and run both commands in each.\n\n`--check` needs a Unix socket. If your sandbox blocks it (\"Operation not permitted\"), the result says nothing about\nthe machine — ask the user to run it (in Claude Code: `! \u003Cskill-dir>\u002Fgcm-keyring-session.sh --check`).\n\n### 3. Ask which hosts, then which parts\n\n**Hosts** — multi-select, pre-selected from the HTTPS hosts found in step 2:\n\n- Azure DevOps (`dev.azure.com`, `*.visualstudio.com`)\n- GitHub (`github.com`)\n- GitLab.com\n- Self-hosted GitLab — ask for the URL\n- Other HTTPS host (Bitbucket, Gitea, …) — ask for the URL\n\n**Parts** — multi-select. Offer parts 4 and 5 only if Azure DevOps is selected. Mark each part **done** when its\nchecks pass:\n\n| Part | Done when |\n| ---- | --------- |\n| 1 | `git-credential-manager --version` prints a version and the effective `credential.helper` list ends with it |\n| 2 | each selected host's settings (part 2 below) are present, no per-host helper overrides GCM unless the user keeps it, and no remote has an embedded credential |\n| 3 | `.gpg-id` exists and `credentialStore` is `gpg` |\n| 4 | `--check` exits 0 |\n| 5 | the user's rc already sources the script |\n\nWalk the selection in the order 1 → 5. If a selected part needs an unselected one that is not done (table above,\n\"Needs\"), say so and ask whether to add it.\n\n### 4. Walk the selected parts\n\nAfter each hand-off, wait for the user to say it is done, then re-run that part's check before moving on.\n\n#### Part 1 — Install GCM\n\nHand off (2.9.1 is the version this setup was proven on):\n\n```bash\nsudo apt update && sudo apt install -y curl git ca-certificates\ncurl -fL https:\u002F\u002Fgithub.com\u002Fgit-ecosystem\u002Fgit-credential-manager\u002Freleases\u002Fdownload\u002Fv2.9.1\u002Fgcm-linux-x64-2.9.1.deb \\\n  -o \u002Ftmp\u002Fgcm.deb\nsudo apt install \u002Ftmp\u002Fgcm.deb\n```\n\nIf the user wants the latest release, look up its tag on the GitHub releases page or API and confirm an asset named\n`gcm-linux-x64-\u003Cversion>.deb` exists before handing off that URL. Then, after confirmation, run\n`git-credential-manager configure` and `git-credential-manager --version`.\n\n#### Part 2 — Sign-in per host and clean remotes\n\nGCM recognizes Azure DevOps, GitHub and GitLab.com by host name; set only what differs from its default. Settings\nscoped to a URL (`credential.https:\u002F\u002Fhost.\u003Ckey>`) affect only that host. Each change after confirmation:\n\n| Host | Set | Why |\n| ---- | --- | --- |\n| Azure DevOps | `git config --global credential.azreposCredentialType oauth` | OAuth tokens instead of GCM creating PATs |\n| GitHub, browser available | nothing | GCM's default OAuth opens the browser |\n| GitHub, no browser (plain WSL) | `git config --global credential.https:\u002F\u002Fgithub.com.gitHubAuthModes device` | sign in with a code on any device |\n| GitLab.com, browser available | nothing | GCM's default browser OAuth |\n| GitLab.com, no browser | `git config --global credential.https:\u002F\u002Fgitlab.com.gitLabAuthModes pat` | GitLab has no device flow; GCM prompts for a PAT once and stores it encrypted |\n| Self-hosted GitLab | `git config --global credential.\u003Curl>.provider gitlab`, then see below | GCM cannot detect it by name |\n| Other host | nothing | GCM prompts for the credential once and stores it |\n\n**Self-hosted GitLab.** Ask whether an OAuth application for GCM is registered on that instance (an admin creates it\nwith redirect URI `http:\u002F\u002F127.0.0.1\u002F` and scopes `read_repository write_repository`). If yes, set\n`credential.\u003Curl>.gitLabDevClientId \u003Capplication id>` yourself and hand off the secret so it never passes through you:\n\n```bash\nprintf 'Client secret: '; stty -echo; read -r s; stty echo; echo\ngit config --global credential.\u003Curl>.gitLabDevClientSecret \"$s\"; unset s\n```\n\nIf no OAuth app — or no browser — set `credential.\u003Curl>.gitLabAuthModes pat`; the user creates a PAT with\n`read_repository`\u002F`write_repository` scopes and pastes it at GCM's prompt on the first fetch.\n\n**Helpers that bypass GCM.** If step 2 found `credential.https:\u002F\u002Fgithub.com.helper` → `gh auth git-credential`, or a\n`glab auth git-credential` helper for a GitLab host, those win over GCM for that host. Ask: keep the CLI's helper, or\nuse GCM? For GCM, after confirmation remove that host's entries:\n`git config --global --unset-all credential.https:\u002F\u002Fgithub.com.helper`.\n\n**Clean remotes.** For each flagged remote, show the redacted URL and the clean one, and after confirmation rewrite\nit without ever echoing the old URL:\n\n```bash\ngit remote set-url \u003Cname> \"$(git remote get-url \u003Cname> | sed -E 's#^(https?:\u002F\u002F)[^\u002F]*@#\\1#')\"\ngit remote get-url \u003Cname>        # now clean — safe to show\n```\n\nRepeat with `--push` if `git config --get-all remote.\u003Cname>.pushurl` is set. Then tell the user: **revoke every PAT\nthat was in a URL or in `~\u002F.git-credentials`** — it has been on disk in plain text; removing it from the URL does not\nun-expose it:\n\n- Azure DevOps → User settings → Personal access tokens\n- GitHub → Settings → Developer settings → Personal access tokens\n- GitLab → Preferences (User settings) → Access tokens\n\n#### Part 3 — Encrypted credential store (GPG + `pass`)\n\nHand off `sudo apt install -y gnupg pass`. If step 2 found no secret key, hand off `gpg --full-generate-key`.\n\nThe user then needs their **primary** key ID for `pass init` — not the encryption subkey. Show how to recognize it\non this example listing (made-up IDs):\n\n```text\n$ gpg --list-secret-keys --keyid-format LONG\nsec   rsa4096\u002F1A2B3C4D5E6F7A8B 2026-01-15 [SC]\n      0123456789ABCDEF0123456789ABCDEF01234567\nuid                 [ultimate] Jane Doe \u003Cjane@example.com>\nssb   rsa4096\u002F8B7A6F5E4D3C2B1A 2026-01-15 [E]\n```\n\nThe ID after the `\u002F` on the **`sec`** line (`1A2B3C4D5E6F7A8B` here) is the one to use. The `ssb` line is the\nsubkey — GPG picks it automatically. Hand off `pass init \u003CPRIMARY_KEY_ID>` with the user's own ID from their\nlisting.\n\n**Gate:** only when `.gpg-id` exists, and after confirmation:\n\n```bash\ngit config --global credential.credentialStore gpg\ngit-credential-manager configure\n```\n\nSetting `credentialStore gpg` before `pass` is initialized breaks every Git sign-in, on every host.\n\n#### Part 4 — Secure MSAL token cache (Azure DevOps)\n\nHand off:\n\n```bash\nsudo apt install -y dbus-x11 gnome-keyring libsecret-tools\n. \u003Cskill-dir>\u002Fgcm-keyring-session.sh          # in the shell Git will run from\n```\n\nThe script reuses a live session bus or the one saved by an earlier shell, starts `dbus-launch` only if neither is\nreachable, and starts `gnome-keyring-daemon --components=secrets` only if no Secret Service owns the bus. It is\nsilent on success.\n\nThen hand off the round-trip test, with a throwaway value, never a real password — `lookup` prints it back:\n\n```bash\nsecret-tool store --label=\"GCM Test\" app gcm-test     # type a dummy value\nsecret-tool lookup app gcm-test\nsecret-tool clear app gcm-test\n```\n\nGNOME Keyring may ask to create or unlock a keyring. On WSL that prompt needs WSLg; if no prompt can appear and the\nstore fails, stop part 4 here and tell the user — do not configure anything that depends on it.\n\n#### Part 5 — Auto-start in new shells\n\nInstalled skill folders move between agents, so the rc line must not point into `\u003Cskill-dir>`. Find the shell with\n`basename \"$SHELL\"` and hand off (shown for zsh; use `~\u002F.bashrc` for bash):\n\n```bash\nmkdir -p ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\ncp \u003Cskill-dir>\u002Fgcm-keyring-session.sh ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002F\ngrep -qF 'setup-git-credentials\u002Fgcm-keyring-session.sh' ~\u002F.zshrc ||\n  echo '[ -f ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002Fgcm-keyring-session.sh ] && . ~\u002F.local\u002Fshare\u002Fsetup-git-credentials\u002Fgcm-keyring-session.sh' >> ~\u002F.zshrc\n```\n\nEvery new terminal then joins the same session instead of starting new daemons. After `wsl --shutdown` the saved\nsession is gone; the next terminal starts a fresh one and the keyring may ask to be unlocked.\n\n### 5. Verify\n\nReport each line as passed or failed:\n\n- `git config --global --get credential.credentialStore` → `gpg` (part 3)\n- the effective `credential.helper` list ends with GCM (part 1; the exact value varies)\n- each per-host setting from part 2 reads back as set\n- **per selected host**, the user runs `git fetch` in a repo of that host. The first one signs in (browser, device\n  code or PAT prompt); a **second** `git fetch` must complete with no prompt — the credential was stored.\n- **Azure DevOps only:** the `secret-tool` round trip from part 4 returned the dummy value, and the Azure DevOps fetch\n  (from a shell with the session — a new terminal if part 5 is done) completes without\n  `cannot persist Microsoft authentication token cache securely` \u002F `using plain-text fallback token cache`.\n\nIf the warning still appears: run `--check` from that same shell (user-side if your sandbox blocks sockets) and\nrepeat part 4. `credential.azreposUseMicrosoftSharedCache false` is **not** the fix — do not suggest it.\n\nIf a second fetch prompts again, the store is not saving: re-check part 3 (`.gpg-id`, `credentialStore`, and the\n`GPG_TTY` pitfall below).\n\n### 6. Remove plain-text leftovers\n\nOnly after step 5 passes. Hand off each that applies:\n\n- `~\u002F.git-credentials` exists → `rm ~\u002F.git-credentials`. If `credential.helper` lists `store`, remove that entry\n  after confirmation: `git config --global --unset credential.helper '^store$'`.\n- `~\u002F.local\u002F.IdentityService\u002Fmsal.cache` existed while the plain-text warning was showing → it may still hold tokens\n  in plain text. `rm ~\u002F.local\u002F.IdentityService\u002Fmsal.cache`; the next Azure DevOps fetch signs in once more and writes\n  the cache to the keyring.\n- Remind once more to revoke any PAT found in step 2, at the host's page listed in part 2.\n\n## Known pitfalls\n\n- **`gcm-linux_amd64.deb` returns 404** — that is not the asset name. Use `gcm-linux-x64-\u003Cversion>.deb`.\n- **`credentialStore gpg` does not silence the MSAL warning** — the Git credential store and the Microsoft token\n  cache are separate (parts 3 and 4).\n- **`credential.azreposUseMicrosoftSharedCache false` is not the fix** for the warning; a reachable Secret Service is.\n- **Do not paste `eval \"$(dbus-launch --sh-syntax)\"` into `.zshrc`** — each terminal starts another bus and keyring.\n  Source the bundled script instead (part 5).\n- **GPG cannot prompt for the passphrase** (Git hangs, or gpg reports `Inappropriate ioctl for device`) → the user\n  adds `export GPG_TTY=$(tty)` to their rc.\n- **`gh auth setup-git` \u002F `glab` silently take over** a host — their per-host helper beats the global GCM one (part 2).\n- **Windows Credential Manager is not used.** Everything runs on the Linux side; this skill does not set up the\n  Windows GCM bridge.\n",{"name":5,"tags":24,"type":37,"agents":38,"author":9,"version":44,"description":7,"user-invocable":45,"disable-model-invocation":20},[25,26,27,28,29,30,31,32,33,34,35,36],"git","credentials","gcm","oauth","github","gitlab","azure-devops","gpg","pass","keyring","wsl","security","skill",[39,40,41,42,43],"claude","codex","cursor","gemini","copilot","0.1.0",true,"main","4cd6c294735ac014fa15da54a397d33d6cdbed57","skills\u002Fworkflow\u002Fsetup-git-credentials","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills","https:\u002F\u002Fgithub.com\u002FAliendreamer","www.linkedin.com\u002Fin\u002Fteodor-stefanov-205aba174","2026-11-12 22:47:39",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":45},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Aliendreamer\u002Fai.skills --skill setup-git-credentials",{"tool":59,"command":60},"bunx","bunx skills add Aliendreamer\u002Fai.skills --skill setup-git-credentials",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Aliendreamer\u002Fai.skills --skill setup-git-credentials","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fsetup-git-credentials\u002FSKILL.md",[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"gcm-keyring-session.sh","SCRIPT","脚本",4353,"https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fsetup-git-credentials\u002Fgcm-keyring-session.sh",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M75PQ16N14SH0T44Q8GDXS01","setup-flow","Use when onboarding a repository or agent to the standard development workflow — installs the required skills from the ai.skills store, installs or updates a MANDATORY workflow block in the agent's instruction file (CLAUDE.md, AGENTS.md, GEMINI.md, Copilot or Cursor rules), AND configures .claude\u002Fsettings.json with Serena MCP, sandbox, permissions, hooks, and plugins. Hooks are wired to the context-hooks kit, which speaks once per session instead of injecting text on every turn; re-running replaces earlier inline hooks rather than adding to them. Also writes .vscode\u002Fsettings.json to hide the empty shell dotfiles an agent sandbox leaves in the repo root. Use when setting up a new repo, switching agents, or refreshing the workflow rules.","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fsetup-flow\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M75PPVEK6WWJEBA9PYYR06R6","developer-flow","Use when starting, implementing, or completing any feature, change, or fix in any software project — at feature start, before writing code, and before claiming a change is done, fixed, working, or green. A strict ordered flow with a gate per phase; stack-agnostic and repo-agnostic (OpenSpec optional, gates discovered).","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fdeveloper-flow\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M75PPPGQP9MV3BAHAP2W2KVV","daily-log-check","Use to check whether everyone on duty filed their Azure DevOps time-log Tasks for a given day, per platform — reports tickets, hours and activities per person against the headcount you give. Fires on \"did everyone log yesterday\", \"check web 4 mobile 3\", \"who is missing for 8.09\", \"daily log check\". Read-only. Org and project come from configuration.","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fdaily-log-check\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M75PPJFQSRGSRPF8RR0Z8CRS","daily-activity-log","Use at end of day to file the Azure DevOps time-log Tasks — one closed Task per Activity worked that day, Original Estimate in decimal hours, parented to the current sprint's Feature. Fires on \"log my day\", \"fill my tasks\", \"close my daily tasks\", \"I had 2h meetings and 4h development\". Org and project come from configuration.","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fdaily-activity-log\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M75PPFK8HSW0VB92VRMWAAJE","conventional-commits","Write commit messages that follow the Conventional Commits specification so tooling can derive versions and changelogs.","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fconventional-commits\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M75PPBQQGMQNQ1FTZPFAPPK6","complexity-sizing","Use when sizing or checking an Azure DevOps work item — Story Points must be derived from the Complexity field, never estimated freehand. Fires on \"size this ticket\", \"what SP\", \"is the SP right\", \"check complexity\", \"backfill story points\", or whenever a ticket's Complexity\u002FSP pair is read. Org and project come from configuration.","https:\u002F\u002Fgithub.com\u002FAliendreamer\u002Fai.skills\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow\u002Fcomplexity-sizing\u002FSKILL.md",[],[]]