agentleFS
Alex72-pyAlex72-py/termux-elite/skills/git-credentials/SKILL.md

git-credentials

Skill2 starsChanged 57 days agoMITView on GitHub

Diagnose git clone, fetch, and push authentication failures from Termux without exposing tokens or private keys (HTTPS tokens, SSH keys, host key prompts, wrong account, missing scopes). Use for Authentication failed, HTTP 403, Permission denied (publickey), repeated credential prompts, or key permission warnings. Do NOT use for network outages, wrong remote names, or non-authentication rejections such as non-fast-forward.

  • Reads credentials
  • Commits and pushes

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run sh scripts/check-git-auth.sh.

    line 22
  2. Distinctive:

    Use one method per remote.

    line 33
  3. Distinctive:

    Run the read-only git ls-remote origin and confirm refs list without a prompt.

    line 44
  4. Distinctive:

    Keep the old remote URL and config lines in the report.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Git Credentials

Purpose

Diagnose git clone, fetch, and push authentication failures in Termux without ever exposing a token or private key.

When to use

Authentication failed, HTTP 403, Permission denied (publickey), Host key verification failed, repeated credential prompts, UNPROTECTED PRIVATE KEY FILE, or Permission to X denied to Y.

When NOT to use

Network outages (termux-network), wrong remote names, or non-authentication push rejections such as non-fast-forward or protected-branch rules that name no credential problem.

Preconditions

Run sh scripts/check-git-auth.sh. It redacts credentials embedded in remote URLs, lists key file names and modes only, and never reads key contents. If a remote URL embeds a token (https://user:secret@host/...), do not repeat it; that is itself a finding to fix.

Decision tree

  1. HTTPS remote: GitHub does not accept account passwords for git. Use a personal access token with minimal scope or gh auth login and gh auth setup-git. gh auth status does not print the token.
  2. HTTP 403 with a valid token: the token lacks repo (or the fine-grained repository selection), the organization requires SSO authorization of the token, or the branch is protected.
  3. Permission to X denied to Y: the authenticated account Y is not the one with access. Check which identity the credential helper supplies.
  4. credential.helper store keeps tokens in plaintext in ~/.git-credentials. Report it as a finding and prefer gh as the helper.
  5. SSH remote: Permission denied (publickey). List key file names in ~/.ssh (never contents), confirm the matching .pub is registered with the account, and test ssh -T git@github.com. A successful GitHub test prints a greeting and exits with status 1; that is normal.
  6. UNPROTECTED PRIVATE KEY FILE: ~/.ssh should be mode 700 and private keys 600. Keys on shared storage cannot hold these modes; keep them under $HOME (see storage-permissions).
  7. Host key verification failed: compare the fingerprint with the host's published one before accepting. Never set StrictHostKeyChecking=no as a fix.
  8. Works only sometimes: Termux does not start an ssh-agent. Name the key with IdentityFile in ~/.ssh/config, or start an agent per session.
  9. Use one method per remote. Do not mix an embedded token and SSH on one repository.

Example

  • Situation: git push returns HTTP 403 although a token is configured.
  • Without the skill: Embeds the token in the remote URL and enables credential.helper store.
  • With the skill: Runs the redacting helper, checks token scope and SSO authorization, switches to gh auth login with gh auth setup-git, and reports any plaintext credential file as a finding.

Safety

Generating keys, editing ~/.ssh/config, storing credentials, and changing remotes mutate state and need confirmation. Never paste tokens or private keys into chat, logs, commits, or URLs. Only a .pub file is safe to display.

Verification

Run the read-only git ls-remote origin and confirm refs list without a prompt. Push only when the user asks.

Rollback

Keep the old remote URL and config lines in the report. Revoke any token or key that was exposed during the session at the provider.

Handoffs

  • storage-permissions when keys sit on shared storage.
  • termux-network when the host is unreachable.
  • github-actions when the real task is a CI failure.
  • termux-sshd for inbound login, which is a different problem from git auth.

Report

Remote scheme and host, the failing layer (token, scope, account, key, permissions, host key), the one change proposed, and the git ls-remote result.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.