AgentSkillsCN

github-repo-setup

当用户需要创建新的 GitHub 仓库,或按照最佳实践来搭建项目时,可主动使用此技能。它支持四种仓库创建模式——快速公开仓库(约 30 秒)、企业级安全与 CI/CD 支持仓库(约 120 秒)、符合开源社区标准的仓库(约 90 秒),以及具备治理机制的私有团队协作仓库(约 90 秒)。此技能不适用于已有仓库的配置,也不适用于 GitHub Actions 工作流的调试。

SKILL.md
--- frontmatter
name: github-repo-setup
description: Use PROACTIVELY when user needs to create a new GitHub repository or set up a project with best practices. Automates repository creation with four modes - quick public repos (~30s), enterprise-grade with security and CI/CD (~120s), open-source community standards (~90s), and private team collaboration with governance (~90s). Not for existing repo configuration or GitHub Actions workflow debugging.

GitHub Repository Setup

Overview

This skill automates GitHub repository creation following official best practices (2024-2025). It provides four modes tailored to different use cases with appropriate security, documentation, and CI/CD configurations.

Four Modes:

  1. Quick Mode - Fast public repo with essentials (~30s)
  2. Enterprise Mode - Production-ready with full security and CI/CD (~120s)
  3. Open Source Mode - Community-focused with templates and guidelines (~90s)
  4. Private/Team Mode - Internal collaboration with CODEOWNERS and governance (~90s)

When to Use This Skill

Trigger Phrases:

  • "create a GitHub repository"
  • "set up a new GitHub repo"
  • "initialize GitHub repo with best practices"
  • "create an enterprise/open source/private repository"

Use Cases:

  • Starting new projects with GitHub best practices
  • Setting up open source projects with community health files
  • Creating team repositories with governance and security

Response Style

  • Efficient: Automate repetitive setup tasks
  • Guided: Clear mode selection with trade-offs
  • Security-first: Enable protection features by default

Quick Decision Matrix

User RequestModeSetup TimeKey Features
"quick repo", "experiment"Quick~30sREADME, LICENSE, .gitignore
"production repo", "CI/CD"Enterprise~120sSecurity + CI/CD + protection
"open source project"Open Source~90sCommunity templates
"private team repo"Private/Team~90sCODEOWNERS + governance

Mode Detection Logic

javascript
if (userMentions("quick", "test", "experiment")) return "quick-mode";
if (userMentions("enterprise", "production", "ci/cd")) return "enterprise-mode";
if (userMentions("open source", "oss", "public")) return "open-source-mode";
if (userMentions("private", "team", "internal")) return "private-team-mode";
return askForModeSelection();

Modes

ModeDescriptionDetails
QuickMinimal setup for experimentsmodes/quick-mode.md
EnterpriseFull security and CI/CDmodes/enterprise-mode.md
Open SourceCommunity health filesmodes/open-source-mode.md
Private/TeamCODEOWNERS and governancemodes/private-team-mode.md

Core Workflow

  1. Mode Selection - Detect intent or ask user
  2. Prerequisites - Validate gh CLI, auth, git config
  3. Repository Creation - Create via GitHub CLI
  4. Security Setup - Enable Dependabot, secret scanning
  5. Documentation - Generate README, LICENSE, .gitignore
  6. CI/CD - Configure workflows (enterprise/open-source)
  7. Templates - Add issue/PR templates
  8. Protection - Set branch rules (enterprise/team)
  9. Validation - Verify setup and provide next steps

Reference Materials

Important Reminders

  1. Security first - Enable Dependabot and secret scanning by default
  2. Branch protection - Protect main branch in production setups
  3. Documentation - Every repo needs README, LICENSE, and .gitignore
  4. CODEOWNERS - Use for critical files in team repositories

Official Documentation: