CarpeWu

git-repo-guide

0
0
# Install this skill:
npx skills add CarpeWu/skills --skill "git-repo-guide"

Install specific skill from multi-skill repository

# Description

Generates repository creation guidelines and naming suggestions. Use when setting up new repositories, asking about repo naming conventions, or creating new projects.

# SKILL.md


name: git-repo-guide
description: Generates repository creation guidelines and naming suggestions. Use when setting up new repositories, asking about repo naming conventions, or creating new projects.


Git Repo Guide

生成仓库创建指南(非执行)

Naming Conventions

命名格式

<产品线>-<模块>-<功能>

命名示例

类型 示例 说明
产品核心 crm-customer-core CRM 客户核心模块
API 服务 crm-order-api CRM 订单 API
管理后台 crm-admin-portal CRM 管理后台
通用服务 common-auth-service 通用认证服务
工具脚本 tools-db-migrator 数据库迁移工具
实验项目 experiment-ai-poc AI 概念验证

命名规则

  • 小写字母 + 连字符
  • 语义清晰,避免缩写
  • 前缀统一,便于分类

Workflow

Step 1: 收集信息

如果用户未提供完整信息,依次询问:

📦 创建新仓库指南

1. 产品线/项目前缀(如 crm, common, tools):
2. 模块或功能名称:
3. 项目类型:
   [ ] 正式项目 - 需要立项审批
   [ ] 实验项目 - experiment- 前缀,无需审批
4. 简短描述(一句话):

Step 2: 生成仓库名建议

根据输入生成规范的仓库名:

📝 仓库名称建议:

   推荐: crm-order-api
   备选: crm-order-service

💡 命名说明:
   • crm - 产品线前缀
   • order - 模块名
   • api - 表明这是 API 服务

Step 3: 输出完整指南

╭─────────────────────────────────────────────────────╮
│  📦 仓库创建指南                                    │
╰─────────────────────────────────────────────────────╯

📝 仓库信息:
   名称: crm-order-api
   描述: CRM 订单服务 API
   类型: 正式项目
   可见性: 私有

═══════════════════════════════════════════════════════

⚠️ 第一步:立项审批(正式项目必须)

1. 在规范仓库创建「新项目立项申请」Issue
2. 填写:项目背景、目标、参与人员、技术选型
3. 等待审批通过

跳过条件: 实验项目(experiment-* 前缀)无需审批

═══════════════════════════════════════════════════════

📋 第二步:在 Git 服务器创建仓库

1. 访问 Git 服务器创建页面
2. 填写:
   • 仓库名称: crm-order-api
   • 描述: CRM 订单服务 API
   • 可见性: 私有
   • 初始化: ✓ README, ✓ .gitignore (根据技术栈)
   • 默认分支: main
3. 点击创建

═══════════════════════════════════════════════════════

🔧 第三步:配置分支保护

在仓库设置 → 分支 → 分支保护规则:

  分支: main
  ├─ ✓ 禁止直接推送
  ├─ ✓ 要求 Pull Request
  ├─ ✓ 要求至少 1 人审批
  └─ ✓ 禁止强制推送

═══════════════════════════════════════════════════════

💻 第四步:本地初始化

复制以下命令执行:

# 克隆仓库
git clone [email protected]:org/crm-order-api.git
cd crm-order-api

# 创建 develop 分支
git checkout -b develop
git push -u origin develop

# 创建基础目录结构
mkdir -p src tests docs

# 提交初始结构
git add .
git commit -m "chore: 初始化项目结构"
git push

═══════════════════════════════════════════════════════

✅ 完成后检查:

├─ [ ] 仓库已创建
├─ [ ] main 分支保护已启用
├─ [ ] develop 分支已创建
├─ [ ] 本地仓库已克隆
└─ [ ] 团队成员已添加

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.