Synthèse automatique
Automatise la gestion de dépôts GitHub (clonage, création, fork, synchronisation, consultation et réglages) via la CLI gh, avec une solution de repli en git et appels REST curl.
Points forts
- Chaque opération est fournie en deux variantes : gh quand il est disponible, sinon git + API REST curl avec GITHUB_TOKEN
- Couvre l'ensemble du cycle de vie : clone, création (compte perso, organisation, template), fork et synchronisation du fork avec upstream
- Détection automatique de l'authentification et extraction de owner/repo depuis le remote origin, ce qui limite les variables à renseigner à la main
- Commandes concrètes et copiables, y compris les cas particuliers comme le clone superficiel ou le push d'un répertoire local existant
Limites
- Le fichier est tronqué : la section sur les releases annoncée dans la description et la fin des réglages de dépôt sont absentes
- Suppose un shell Unix avec sed et python3 pour parser le JSON, et un GITHUB_TOKEN déjà injecté avec les bons scopes ; rien n'explique comment obtenir ou configurer ce jeton
- Le repli curl est plus fragile que gh : attente arbitraire (sleep 5) après un fork, gestion d'erreurs et limites de rate-limit non traitées
À utiliser lorsqu'il faut créer, cloner, forker ou reconfigurer un dépôt GitHub depuis un agent en ligne de commande, avec ou sans gh installé.
À éviter pour des workflows Git complexes (rebase interactif, résolution de conflits, stratégies de branches) ou pour de la gestion de releases, que ce skill ne couvre pas réellement.
Analyse de sécurité
PrudenceThe skill is a straightforward GitHub CLI/API reference: it uses bash, git, curl and a scoped GITHUB_TOKEN only against github.com endpoints, with no destructive commands, no curl|sh, no obfuscated payloads and no attempt to send credentials to third-party hosts. Risk is elevated to caution because it handles a privileged token on command lines and instructs uploading private SSH key material to GitHub secrets, both of which warrant user confirmation and tighter hygiene rather than being inherently malicious. No prompt-injection or instruction-override attempts were present in the content.
- •No allowed-tools declared, yet the skill requires shell execution, outbound network calls (api.github.com, uploads.github.com) and a privileged GITHUB_TOKEN — capability declaration does not match the instructions.
- •Section 7 instructs reading a private key (~/.ssh/id_rsa) and uploading it as a GitHub Actions secret; legitimate DevOps practice but it moves sensitive key material off-host and should require explicit user confirmation / prefer a dedicated deploy key.
- •GITHUB_TOKEN is interpolated into curl command lines (e.g. -H "Authorization: token ${GITHUB_TOKEN}"), so the credential can appear in shell history and process listings; examples do not recommend passing headers via stdin/env-file or scoping the token.
- •Placeholder values such as "your-secret-value" and "your-secret-value" in the encryption example could be copied verbatim, silently creating a bogus secret.
- •Contains a reference to environment-specific secret injection ('LaRuche's secret vault') that will not exist for other users, causing 401s.
- •Runs bash/git/curl/gh commands that create, modify, and delete remote repositories and settings — powerful but legitimate, user-directed operations.
- •Section 7 reads a local private key (`gh secret set SSH_KEY < ~/.ssh/id_rsa`) and encourages typing secret values on the command line (`--body "your-secret-value"`), which exposes them in shell history and process listings.
- •Uses a `GITHUB_TOKEN` with broad scope against api.github.com; all network calls go to GitHub's own API (no third-party exfiltration), but the token is powerful and a mis-scoped token could modify org repos.
- •Contains an API-scoped action that can toggle repository visibility to public (`gh repo edit --visibility public`), a potentially destructive exposure if misapplied.
Exemples
Create a private GitHub repo called my-project with an MIT license, then push my current directory to itFork owner/repo-name, clone my fork, and add the original repo as an upstream remote so I can sync latergh isn't installed here — using curl and GITHUB_TOKEN, show me the description, star count and default branch of owner/repo-nametype: skill name: github-repo-management description: Clone, create, fork or release a GitHub repository.
GitHub Repository Management
Create, clone, fork, configure, and manage GitHub repositories. Each section shows gh first, then git + curl as fallback.
Prerequisites
GITHUB_TOKEN is injected by LaRuche's secret vault at execution. Detect available auth:
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
AUTH="gh"
GH_USER=$(gh api user --jq '.login')
else
AUTH="git"
GH_USER=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/user | python3 -c "import sys,json; print(json.load(sys.stdin)['login'])")
fi
# If inside an existing repo, extract owner/repo:
REMOTE_URL=$(git remote get-url origin)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
1. Clone
# gh
gh repo clone owner/repo-name
gh repo clone owner/repo-name -- --depth 1
# git (works everywhere)
git clone https://github.com/owner/repo-name.git
git clone --depth 1 https://github.com/owner/repo-name.git
git clone --branch develop https://github.com/owner/repo-name.git ./my-dir
git clone git@github.com:owner/repo-name.git # SSH
2. Create
# gh
gh repo create my-project --public --clone
gh repo create my-project --private --description "Desc" --license MIT --clone
gh repo create my-org/my-project --public --clone
gh repo create my-project --source . --public --push # from existing local dir
# curl
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/user/repos \
-d '{"name":"my-project","description":"Desc","private":false,"auto_init":true,"license_template":"mit"}'
# For an org:
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/orgs/my-org/repos \
-d '{"name":"my-project","private":false}'
# Push existing local dir to new repo (curl path):
git init && git add . && git commit -m "Initial commit"
git remote add origin https://github.com/${GH_USER}/my-project.git
git push -u origin main
From a Template
# gh
gh repo create my-app --template owner/template-repo --public --clone
# curl
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/owner/template-repo/generate \
-d '{"owner":"'"${GH_USER}"'","name":"my-app","private":false}'
3. Fork
# gh (preferred - handles the wait automatically)
gh repo fork owner/repo-name --clone
# curl + git
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/owner/repo-name/forks
sleep 5 # GitHub needs a moment
git clone https://github.com/${GH_USER}/repo-name.git
cd repo-name
git remote add upstream https://github.com/owner/repo-name.git
Keep Fork in Sync
git fetch upstream && git checkout main && git merge upstream/main && git push origin main
# gh shortcut
gh repo sync ${GH_USER}/repo-name
4. Repository Info
# gh
gh repo view owner/repo-name
gh repo list --limit 20
gh search repos "machine learning" --language python --sort stars
# curl
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO} \
| python3 -c "
import sys,json; r=json.load(sys.stdin)
print(r['full_name'], r['description'], 'Stars:', r['stargazers_count'], 'Branch:', r['default_branch'])"
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/user/repos?per_page=20&sort=updated" \
| python3 -c "
import sys,json
for r in json.load(sys.stdin):
print(f\"{r['full_name']:40} {'private' if r['private'] else 'public':8} ★{r['stargazers_count']}\")"
5. Repository Settings
# gh
gh repo edit --description "Updated" --visibility public
gh repo edit --enable-wiki=false --enable-issues=true --default-branch main
gh repo edit --add-topic "machine-learning,python" --enable-auto-merge
# curl (PATCH)
curl -s -X PATCH -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO} \
-d '{"description":"Updated","has_wiki":false,"has_issues":true,"allow_auto_merge":true}'
# Update topics
curl -s -X PUT \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/repos/${OWNER}/${REPO}/topics \
-d '{"names":["machine-learning","python","automation"]}'
6. Branch Protection
# View current protection
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/branches/main/protection
# Set protection
curl -s -X PUT -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/branches/main/protection \
-d '{
"required_status_checks":{"strict":true,"contexts":["ci/test","ci/lint"]},
"enforce_admins":false,
"required_pull_request_reviews":{"required_approving_review_count":1},
"restrictions":null
}'
7. Secrets (GitHub Actions)
Use gh secret set whenever possible - curl path requires NaCl encryption.
# gh
gh secret set API_KEY --body "your-secret-value"
gh secret set SSH_KEY < ~/.ssh/id_rsa
gh secret list
gh secret delete API_KEY
# curl: fetch public key, encrypt with PyNaCl, then PUT
PUB=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/secrets/public-key)
KEY_ID=$(echo "$PUB" | python3 -c "import sys,json; print(json.load(sys.stdin)['key_id'])")
ENC=$(echo "$PUB" | python3 -c "
import sys,json
from base64 import b64encode
from nacl import encoding, public
d=json.load(sys.stdin)
box=public.SealedBox(public.PublicKey(d['key'].encode(), encoding.Base64Encoder))
print(b64encode(box.encrypt(b'your-secret-value')).decode())")
curl -s -X PUT -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/secrets/API_KEY \
-d "{\"encrypted_value\":\"$ENC\",\"key_id\":\"$KEY_ID\"}"
# List secrets (names only)
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/secrets \
| python3 -c "import sys,json; [print(s['name']) for s in json.load(sys.stdin)['secrets']]"
8. Releases
# gh
gh release create v1.0.0 --title "v1.0.0" --generate-notes
gh release create v2.0.0-rc1 --draft --prerelease --generate-notes
gh release create v1.0.0 ./dist/binary --notes "Release notes"
gh release list
gh release download v1.0.0 --dir ./downloads
# curl: create release
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/releases \
-d '{"tag_name":"v1.0.0","name":"v1.0.0","body":"## Changelog\n- Feature A","draft":false,"prerelease":false,"generate_release_notes":true}'
# Upload asset (get RELEASE_ID from create response)
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/releases/latest \
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
curl -s -X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${OWNER}/${REPO}/releases/${RELEASE_ID}/assets?name=binary-amd64" \
--data-binary @./dist/binary-amd64
9. GitHub Actions Workflows
# gh
gh workflow list
gh run list --limit 10
gh run view <RUN_ID> --log-failed
gh run rerun <RUN_ID> --failed
gh workflow run ci.yml --ref main
gh workflow run deploy.yml -f environment=staging
# curl: list workflows
curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/workflows \
| python3 -c "import sys,json; [print(w['id'],w['name'],w['state']) for w in json.load(sys.stdin)['workflows']]"
# Trigger workflow_dispatch
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/workflows/${WORKFLOW_ID}/dispatches \
-d '{"ref":"main","inputs":{"environment":"staging"}}'
# Rerun failed jobs only
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/${OWNER}/${REPO}/actions/runs/${RUN_ID}/rerun-failed-jobs
10. Gists
# gh
gh gist create script.py --public --desc "Useful script"
gh gist list
# curl
curl -s -X POST -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/gists \
-d '{"description":"Useful script","public":true,"files":{"script.py":{"content":"print(\"hello\")"}}}'
Error Handling
| Symptom | Fix |
|---|---|
| gh: command not found | Fall back to curl path; install with brew install gh or winget install gh |
| 401 Unauthorized | ${GITHUB_TOKEN} not set or expired - re-inject secret |
| 422 on fork | Repo already forked - clone existing fork |
| 403 on branch protection | Token needs repo scope (not fine-grained) |
| Asset upload 404 | Release must exist before uploading assets |
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/github-repository-management-mt2h8ky1/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/github-repository-management-mt2h8ky1' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/github-repository-management-mt2h8ky1/download' --output '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md.part' && mv '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md.part' '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Extrait original : Prerequisites
GITHUB_TOKEN is injected by LaRuche's secret vault at execution. Detect available auth:
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
AUTH="gh"
GH_USER=$(gh api user --jq '.login')
else
AUTH="git"
GH_USER=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/user | python3 -c "import sys,json; print(json.load(sys.stdin)['login'])")
fi
# If inside an existing repo, extract owner/repo:
REMOTE_URL=$(git remote get-url origin)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && test -s '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/github-repo-management' && cp -R '.skill-downloads/github-repository-management-mt2h8ky1' '.claude/skills/github-repo-management'Cursor
test -f '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && test -s '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/github-repo-management' && cp -R '.skill-downloads/github-repository-management-mt2h8ky1' '.cursor/skills/github-repo-management'Codex
test -f '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && test -s '.skill-downloads/github-repository-management-mt2h8ky1/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/github-repo-management' && cp -R '.skill-downloads/github-repository-management-mt2h8ky1' '.agents/skills/github-repo-management'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/github-repository-management-mt2h8ky1'openskills read 'github-repository-management-mt2h8ky1'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/github-repository-management-mt2h8ky1/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Configurer un canal de discussion avec SecretRefs
DevOps
Configurez des canaux de discussion avec des commandes non interactives, les secrets étant uniquement des SecretRefs. Couvre les étapes de collecte, modification, réparation et vérification.
Enquêter sur les échecs CI de ClickHouse
DevOps
Investigue un échec CI de ClickHouse de bout en bout à partir d'une URL de PR ou de rapport S3. Récupère les tests échoués, classe flaky vs vraie régression, et cherche des issues/fixes existants.
Revue de PR Ansible
DevOps
Examine une PR Ansible selon le processus standardisé du projet, incluant la validation des changelogs, la couverture de tests et le suivi des commentaires.