SuperAPI AI Directory

gh-bootstrap

Deployment & operations

View repository

Updated 10-16 01:48

About this skill

gh-bootstrap

One-stop GitHub repository configuration initialization tool that shortens project configuration time from hours to minutes.

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│  gh-bootstrap Skill Architecture                                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  SKILL.md (入口)                                                 │
│       ↓                                                          │
│  Phase 1: Detection   →  扫描项目,识别语言/框架/现有配置         │
│       ↓                                                          │
│  Phase 2: Collection  →  交互式收集配置 (AskUserQuestion)         │
│       ↓                                                          │
│  Phase 3: Conflict    →  检测冲突,制定处理策略                   │
│       ↓                                                          │
│  Phase 4: Execution   →  下载模板 + 直接复制(仅替换变量)      │
│       ↓                                                          │
│  Phase 5: Report      →  生成执行报告和后续建议                   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Key Design Principles

  1. Phased Execution: Break down complex tasks into 5 ordered phases
  2. Separation of Concerns: phases/(Logic) + specs/(Configuration) + templates/(View)
  3. Interactive Configuration: Communicate with the user through AskUserQuestion throughout
  4. Runtime Download: Do not pre-store templates; download from recommended repositories on demand
  5. Direct Template Copying: Copy downloaded templates as-is, replacing only variable placeholders (rewriting prohibited)

CRITICAL CONSTRAINTS

⚠️ Writing configuration files yourself is prohibited! The following rules must be followed:

Must ask the user for the language environment at the beginning

At the beginning, call the question-and-answer form to ask the user's communication language (which determines the language used to communicate with you), and ask the user which language to use for writing subsequent templates (Issue templates, etc.) If the user confirms the use of Chinese or Chinese, you must try to be Chinese-friendly in all subsequent template writing

Enforce Order

Read specs/template-catalog.md → git clone 模板仓库 → Read 模板文件 → 直接复制 + 变量替换 → Write 输出

Rules That Must Be Followed

  1. Must read template-catalog.md first: Before downloading any templates, you must first read specs/template-catalog.md to obtain the exact file path mappings
  2. Must download templates: Before generating any configuration files, you must first download the corresponding recommended repositories from template-catalog.md Download the corresponding recommended repository in
  3. Must copy directly: After reading the template,copy as-isthe content to the target file, replacing only variable placeholders
  4. Generating from nothing is prohibited: It is not allowed to skip the download step and write files directly, even if Claude knows how to write them

Strictly Prohibited Actions

  • ❌ Skipping download and writing files directly
  • ❌ "Rewrite after referring to the template"
  • ❌ "Optimize the template based on best practices"
  • ❌ "Simplify/refactor template steps"
  • ❌ Generate configuration content from memory/knowledge
  • ❌ Delete steps in the template that "seem unnecessary"

Actions That Must Be Performed

  • ✅ Copy the structure and logic of the template
  • ✅ Must replaceall variable placeholders ({{projectName}}、{{description}}、{{author}} etc.)
  • ✅ Must replace GitHub information ({{owner}}、{{repo}}, badges URL, etc.)
  • ✅ Must adjustversion numbers (node-version、python-version , etc.) to the detected versions
  • ✅ Must populatecomponent-specific configuration (token names, platform accounts, etc.)
  • ✅ Preserve all ${{ secrets.* }}、${{ github.* }} expressions (these are GitHub Actions syntax)
  • ✅ Preserve all Action version numbers @v4

Variable replacement is mandatory

All variable placeholders in the template must be replaced and cannot be left empty! These variables must all be determined during the collection phase in Phase 2.

Violating the above rules will cause the workflow to fail! See 04-execution.md

Execution Flow

用户触发 gh-bootstrap
     │
     ▼
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│  Phase 1    │ ──▶ │  Phase 2    │ ──▶ │  Phase 3    │
│  Detection  │     │  Collection │     │  Conflict   │
│  项目检测    │     │  配置收集    │     │  冲突检测    │
└─────────────┘     └─────────────┘     └─────────────┘
                                              │
     ┌────────────────────────────────────────┘
     ▼
┌─────────────┐     ┌─────────────┐
│  Phase 4    │ ──▶ │  Phase 5    │
│  Execution  │     │  Report     │
│  执行生成    │     │  报告总结    │
└─────────────┘     └─────────────┘

Output Structure

{project-root}/
├── .github/
│   ├── workflows/
│   │   └── ci.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── dependabot.yml
│   ├── labels.yml
│   └── CODEOWNERS
├── README.md
├── LICENSE
├── .gitignore
└── CONTRIBUTING.md

Reference Documents

Document Purpose
phases/01-detection.md Intelligent Project Detection
phases/02-collection.md Interactive Configuration Collection
phases/03-conflict.md Conflict Detection and Handling
phases/04-execution.md Template Download and Direct Copying
phases/05-report.md Execution Report
specs/detection-rules.md Detection Rule Definition
specs/presets.md Preset Configuration Definitions
specs/template-catalog.md Recommended Template Repository Directory