Files
cnb/.opencode/skills/create-repo/SKILL.md
xiongxiao a8f2cb14a7 update
2026-01-16 11:27:26 +08:00

68 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: create-new-repo
description: 创建一个基本的新的代码仓库,并自动添加必要的配置文件。
---
# 创建新的代码仓库
该技能用于创建一个新的代码仓库,并自动添加必要的配置文件,如 `.cnb.yml`
## 调用工具链
1. 执行`create-repo`工具,参数是/group/repo_name例如 `kevisual/my-new-repo`
2. 工具会自动创建一个新的代码仓库
3. 创建完成后,地址就是这个 /group/repo_name例如 `kevisual/my-new-repo`
4. 添加.cnb.yml配置文件调用create-repo-file工具
### .cnb.yml配置文件内容示例
新仓库名称为 REPO_NAME(为其中的group/repo_name的repo_name部分)
TO_REPO 为 kevisual/REPO_NAME
```yaml
# .cnb.yml
include:
- https://cnb.cool/kevisual/cnb/-/blob/main/.cnb/template.yml
.common_env: &common_env
env:
TO_REPO: kevisual/cnb
TO_URL: git.xiongxiao.me
imports:
- https://cnb.cool/kevisual/env/-/blob/main/.env.development
$:
vscode:
- docker:
image: docker.cnb.cool/kevisual/dev-env:latest
services:
- vscode
- docker
imports: !reference [.common_env, imports]
# 开发环境启动后会执行的任务
# stages:
# - name: pnpm install
# script: pnpm install
stages: !reference [.dev_tempalte, stages]
.common_sync_to_gitea: &common_sync_to_gitea
- <<: *common_env
services: !reference [.common_sync_to_gitea_template, services]
stages: !reference [.common_sync_to_gitea_template, stages]
.common_sync_from_gitea: &common_sync_from_gitea
- <<: *common_env
services: !reference [.common_sync_from_gitea_template, services]
stages: !reference [.common_sync_from_gitea_template, stages]
main:
web_trigger_sync_to_gitea:
- <<: *common_sync_to_gitea
web_trigger_sync_from_gitea:
- <<: *common_sync_from_gitea
api_trigger_sync_to_gitea:
- <<: *common_sync_to_gitea
api_trigger_sync_from_gitea:
- <<: *common_sync_from_gitea
```