github-connect
Conecta el proyecto a GitHub automáticamente. Crea repo, configura remote, hace push inicial.
by carlos060798★ 17 GitHub stars
Install github-connect in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
GitHub Connect Skill
Propósito
Eliminar la fricción de crear repositorio GitHub manualmente. Para usuarios no-técnicos, este proceso es una barrera insuperable. Este skill automatiza completamente:
- Validación del token de autenticación
- Creación del repositorio en GitHub
- Configuración del remote local
- Primer commit y push
- Registro de configuración en
.sdd/sdd.config.yaml
Entrada (Input)
El skill acepta los siguientes parámetros (todos opcionales):
GITHUB_TOKEN : Token de autenticación (variable de entorno o parámetro)
repo_name : Nombre del repositorio en GitHub (default: nombre de carpeta actual)
repo_description : Descripción del repositorio (default: "Proyecto SDD-ES")
repo_visibility : "public" o "private" (default: "public")
branch_name : Rama principal (default: "main")
auto_init_commit : true/false - hacer commit inicial (default: true)
Flujo de Ejecución
1. Validación del Token GitHub
# Verificar que GITHUB_TOKEN está disponible
if [ -z "$GITHUB_TOKEN" ]; then
echo "❌ GITHUB_TOKEN no configurado"
echo "Genera un token en: https://github.com/settings/tokens?type=beta"
echo "Instrucciones: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token"
exit 1
fi
# Probar autenticación
gh auth status --show-token 2>/dev/null || {
echo "❌ Token de GitHub inválido o expirado"
echo "Genera uno nuevo: https://github.com/settings/tokens?type=beta"
exit 1
}
2. Obtener Información del Usuario y del Proyecto
# Obtener usuario de GitHub
GITHUB_USER=$(gh api user --jq .login 2>/dev/null)
if [ -z "$GITHUB_USER" ]; then
echo "❌ No se pudo obtener usuario de GitHub"
exit 1
fi
# Nombre del repositorio (default a nombre de carpeta)
REPO_NAME="${repo_name:=$(basename "$(pwd)")}"
REPO_DESCRIPTION="${repo_description:=Proyecto SDD-ES}"
REPO_VISIBILITY="${repo_visibility:=public}"
BRANCH_NAME="${branch_name:=main}"
echo "📋 Configuración:"
echo " Usuario: $GITHUB_USER"
echo " Repo: $REPO_NAME"
echo " Descripción: $REPO_DESCRIPTION"
echo " Visibilidad: $REPO_VISIBILITY"
3. Verificar si el Repo Existe
# Comprobar existencia del repositorio
REPO_URL="https://github.com/$GITHUB_USER/$REPO_NAME"
if gh repo view "$GITHUB_USER/$REPO_NAME" --json name 2>/dev/null | grep -q "$REPO_NAME"; then
echo "⚠️ El repositorio '$REPO_NAME' ya existe en GitHub"
echo " URL: $REPO_URL"
echo " Se usará el repositorio existente."
REPO_EXISTS=true
else
REPO_EXISTS=false
fi
4. Crear Repositorio (si no existe)
if [ "$REPO_EXISTS" = false ]; then
echo "🔨 Creando repositorio en GitHub..."
gh repo create "$REPO_NAME" \
--description "$REPO_DESCRIPTION" \
--"$REPO_VISIBILITY" \
--source=. \
--remote=origin \
--push \
2>&1 | grep -E "^✓|error|Error" || true
if [ $? -ne 0 ]; then
echo "❌ Error al crear el repositorio"
exit 1
fi
echo "✅ Repositorio creado en GitHub"
fi
5. Configurar Remote Local
# Verificar si ya existe remote origin
if git remote get-url origin 2>/dev/null | grep -q "$REPO_NAME"; then
echo "✓ Remote ya configurado"
else
echo "🔗 Configurando remote..."
REMOTE_URL="https://github.com/$GITHUB_USER/$REPO_NAME.git"
# Remover remote anterior si existe
git remote remove origin 2>/dev/null || true
# Añadir nuevo remote
git remote add origin "$REMOTE_URL"
echo "✅ Remote configurado: $REMOTE_URL"
fi
6. Hacer Commit Inicial (si es necesario)
AUTO_INIT="${auto_init_commit:=true}"
if [ "$AUTO_INIT" = true ]; then
# Verificar cambios pendientes
if ! git diff-index --quiet HEAD 2>/dev/null; then
echo "📝 Haciendo commit inicial..."
git add -A
git commit -m "feat: Inicialización del proyecto SDD-ES
- Proyecto conectado a GitHub
- Configuración inicial completada"
echo "✅ Commit inicial creado"
else
echo "ℹ️ No hay cambios pendientes para commitear"
fi
fi
7. Push Inicial a GitHub
echo "🚀 Haciendo push a GitHub..."
# Configurar rama local
git branch -M "$BRANCH_NAME" 2>/dev/null || true
# Push con -u para establecer rama upstream
git push -u origin "$BRANCH_NAME" 2>&1 | grep -E "^✓|error|Error" || true
if [ $? -eq 0 ]; then
echo "✅ Push completado"
else
echo "⚠️ Push completado con advertencias"
fi
8. Actualizar Configuración Local
echo "💾 Actualizando configuración local..."
# Crear directorio .sdd si no existe
mkdir -p .sdd
# Crear o actualizar sdd.config.yaml
cat > .sdd/sdd.config.yaml << EOF
# Configuración de GitHub - SDD-ES
git:
remote_url: "https://github.com/$GITHUB_USER/$REPO_NAME.git"
connected: true
connected_at: "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
github_user: "$GITHUB_USER"
repo_name: "$REPO_NAME"
branch: "$BRANCH_NAME"
visibility: "$REPO_VISIBILITY"
EOF
echo "✅ Configuración guardada en .sdd/sdd.config.yaml"
# H
Allowed tools
Tools this skill is permitted to call.
- 01
Bash - 02
Read - 03
Edit - 04
Grep
Bundled files
- IMPLEMENTATION-CHECKLIST.md
- INDEX.md
- INTEGRATION.md
- QUICK-START.md
- README.md
- RESUMEN_IMPLEMENTACION.txt
- STRUCTURE.txt
- example-config.yaml
- github-connect.sh
FAQ
What does the github-connect skill do?
Conecta el proyecto a GitHub automáticamente. Crea repo, configura remote, hace push inicial.
How do I install the github-connect skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the github-connect skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…