zr-github-repository

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Zenon-Red Repository Setup

Zenon-Red 仓库搭建

Create new repositories using the standard zenon-red template, then customize for your specific project.
使用标准的zenon-red模板创建新仓库,然后针对你的特定项目进行定制。

Template-Based Approach

基于模板的方法

All zenon-red repositories should be created from the
zenon-red/nexus-template
GitHub template:
bash
gh repo create zenon-red/REPO_NAME --template zenon-red/nexus-template --public
Then clone and customize:
bash
gh repo clone zenon-red/REPO_NAME
cd REPO_NAME
所有zenon-red仓库都应从
zenon-red/nexus-template
GitHub模板创建:
bash
gh repo create zenon-red/REPO_NAME --template zenon-red/nexus-template --public
然后克隆并定制:
bash
gh repo clone zenon-red/REPO_NAME
cd REPO_NAME

Post-Template Customization

模板创建后的定制步骤

After creating from template, follow these steps to customize:
从模板创建仓库后,请按照以下步骤进行定制:

1. Replace Placeholders

1. 替换占位符

Update all
REPO_NAME
placeholders with your actual repository name:
FileChanges
README.md
Replace
nexus-template
with repo name, update description
.github/settings.yml
Update
name:
and
description:
docs/setup.md
Update references to
nexus-template
skills/REPO_NAME/SKILL.md
Rename folder to actual repo name, update all content
将所有
REPO_NAME
占位符替换为你的实际仓库名称:
文件修改内容
README.md
nexus-template
替换为仓库名称,更新描述
.github/settings.yml
更新
name:
description:
字段
docs/setup.md
更新对
nexus-template
的引用
skills/REPO_NAME/SKILL.md
将文件夹重命名为实际仓库名称,更新所有内容

2. Update Logo

2. 更新Logo

The template includes a placeholder logo
.github/nexus-template.png
. Replace it:
  1. Temporary: Rename
    nexus-template.png
    to
    zr-newborn.png
    as a placeholder
  2. Final: Create your actual 128px PNG logo and save as
    .github/{repo-name}.png
  3. Update
    README.md
    to reference the correct logo file
bash
undefined
模板包含一个占位符Logo
.github/nexus-template.png
,请替换它:
  1. 临时方案:
    nexus-template.png
    重命名为
    zr-newborn.png
    作为临时占位符
  2. 最终方案: 创建实际的128px PNG格式Logo,并保存为
    .github/{repo-name}.png
  3. 更新
    README.md
    以引用正确的Logo文件
bash
undefined

Rename placeholder first

先重命名占位符

git mv .github/nexus-template.png .github/zr-newborn.png
git mv .github/nexus-template.png .github/zr-newborn.png

Update README.md to point to zr-newborn.png temporarily

临时更新README.md指向zr-newborn.png

Later, replace with actual logo:

之后替换为实际Logo:

git mv .github/zr-newborn.png .github/{repo-name}.png
undefined
git mv .github/zr-newborn.png .github/{repo-name}.png
undefined

3. Configure Tech Stack

3. 配置技术栈

Fill in the TODOs for your technology stack:
FileStack-Specific Changes
.github/workflows/ci.yml
Uncomment/setup your toolchain (Node, Rust, Python, Go, Deno)
.husky/pre-commit
Add lint/format commands
.husky/pre-push
Add test/build commands
.github/dependabot.yml
Uncomment and configure your package ecosystem
.gitignore
Add stack-specific patterns
填写技术栈相关的TODO项:
文件技术栈专属修改
.github/workflows/ci.yml
取消注释/配置你的工具链(Node、Rust、Python、Go、Deno)
.husky/pre-commit
添加代码检查/格式化命令
.husky/pre-push
添加测试/构建命令
.github/dependabot.yml
取消注释并配置你的包生态系统
.gitignore
添加技术栈专属的忽略规则

4. Update CODEOWNERS (if needed)

4. 更新CODEOWNERS(如有需要)

Default is
@zenon-red/zoe
. Change if different ownership is required:
undefined
默认所有者为
@zenon-red/zoe
,如果需要不同的所有权请修改:
undefined

.github/CODEOWNERS

.github/CODEOWNERS

  • @zenon-red/team-name
undefined
  • @zenon-red/team-name
undefined

5. Update Documentation

5. 更新文档

Remove template-specific files:
  • docs/setup.md
    - This is only for setting up from the template, remove after customization
Create user-facing docs in
docs/
:
  • getting-started.md
    - Installation and first steps
  • commands.md
    - CLI commands or API reference
  • architecture.md
    - Technical architecture overview
  • examples.md
    - Usage examples
Update
docs/README.md
index to:
  1. Remove the link to
    setup.md
  2. Add links to your new project-specific docs
移除模板专属文件:
  • docs/setup.md
    - 仅用于从模板搭建仓库,定制完成后移除
docs/
中创建面向用户的文档:
  • getting-started.md
    - 安装和入门步骤
  • commands.md
    - CLI命令或API参考
  • architecture.md
    - 技术架构概述
  • examples.md
    - 使用示例
更新
docs/README.md
索引:
  1. 移除指向
    setup.md
    的链接
  2. 添加指向新项目专属文档的链接

6. Write Repo-Specific Skill

6. 编写仓库专属Skill

Replace the placeholder
skills/{repo-name}/SKILL.md
with actual guidance:
  • Tech stack details
  • Project architecture
  • Development commands (build, test, lint)
  • Agent-specific guidelines and pitfalls
将占位符
skills/{repo-name}/SKILL.md
替换为实际指南:
  • 技术栈详情
  • 项目架构
  • 开发命令(构建、测试、代码检查)
  • Agent专属指南和注意事项

7. Install Dependencies & Setup Hooks

7. 安装依赖并配置钩子

bash
undefined
bash
undefined

Install your package manager dependencies

安装包管理器依赖

npm install # or cargo, pip, go mod, etc.
npm install # 或cargo、pip、go mod等

Initialize husky (if using Node.js)

初始化husky(如果使用Node.js)

npx husky init
undefined
npx husky init
undefined

8. First Commit

8. 首次提交

bash
git add .
git commit -m "chore: initial setup from nexus-template"
git push -u origin main
bash
git add .
git commit -m "chore: initial setup from nexus-template"
git push -u origin main

9. Apply Branch Protection

9. 应用分支保护

After first push to
main
, apply branch protection via the API (free tier — does not require paid GitHub Team plan):
bash
gh api repos/zenon-red/REPO_NAME/branches/main/protection \
  -X PUT \
  -f "enforce_admins=false" \
  -f "required_pull_request_reviews[required_approving_review_count]=0" \
  -f "required_pull_request_reviews[dismiss_stale_reviews]=true" \
  -f "required_pull_request_reviews[require_code_owner_reviews]=true" \
  -f "restrictions=null" \
  -f "allow_force_pushes=false" \
  -f "allow_deletions=false"
This sets:
  • No force pushes to main
  • No branch deletions
  • PR required before merge
  • CODEOWNERS review required (from
    .github/CODEOWNERS
    )
  • Stale reviews dismissed on new pushes
  • Admins can bypass (org owner override via
    enforce_admins=false
    )
Note: This uses the branch protection endpoint available on all GitHub plans. Do NOT use rulesets (
/repos/.../rulesets
) — that requires a paid GitHub Team plan.
首次推送到
main
分支后,通过API应用分支保护(免费版可用——无需付费GitHub Team计划):
bash
gh api repos/zenon-red/REPO_NAME/branches/main/protection \
  -X PUT \
  -f "enforce_admins=false" \
  -f "required_pull_request_reviews[required_approving_review_count]=0" \
  -f "required_pull_request_reviews[dismiss_stale_reviews]=true" \
  -f "required_pull_request_reviews[require_code_owner_reviews]=true" \
  -f "restrictions=null" \
  -f "allow_force_pushes=false" \
  -f "allow_deletions=false"
此配置设置:
  • 禁止向main分支强制推送
  • 禁止删除分支
  • 合并前需要提交PR
  • 需要CODEOWNERS审核(来自
    .github/CODEOWNERS
  • 新推送时会取消过时的审核
  • 管理员可绕过限制(通过
    enforce_admins=false
    允许组织所有者覆盖)
注意: 此命令使用所有GitHub计划都支持的分支保护端点。请勿使用rulesets(
/repos/.../rulesets
)——该功能需要付费GitHub Team计划。

Target Structure (After Template + Customization)

目标结构(模板+定制后)

repo/
├── .github/
│   ├── {repo}.png              # Logo (128px) - replace zr-newborn.png placeholder
│   ├── CODEOWNERS             # Code owners (@zenon-red/zoe default)
│   ├── dependabot.yml         # Dependency updates (configure for your stack)
│   ├── labeler.yml            # PR label patterns
│   ├── settings.yml           # Repo settings and labels
│   └── workflows/
│       ├── ci.yml             # Stack-specific CI pipeline
│       ├── labeler.yml        # Auto-label PRs
│       └── stale-issues-prs.yml
├── .husky/
│   ├── commit-msg             # Commit message validation (optional)
│   ├── pre-commit             # Pre-commit checks (lint, format)
│   └── pre-push               # Pre-push checks (test, build)
├── docs/                      # Documentation
│   ├── README.md              # Docs index (remove setup.md link)
│   ├── getting-started.md     # (create as needed)
│   └── ...                    # Other user docs (setup.md removed)
├── skills/
│   └── {repo-name}/
│       └── SKILL.md           # Repo-specific agent guidance
├── src/                       # Source code (create for your stack)
├── .gitignore                 # Stack-specific ignore patterns
├── CONTRIBUTING.md            # Contribution guidelines (can override org)
├── LICENSE                    # MIT license
├── README.md                  # Main project README
└── {config files}             # package.json, Cargo.toml, etc.
repo/
├── .github/
│   ├── {repo}.png              # Logo(128px)- 替换zr-newborn.png占位符
│   ├── CODEOWNERS             # 代码所有者(默认@zenon-red/zoe)
│   ├── dependabot.yml         # 依赖更新(针对你的技术栈配置)
│   ├── labeler.yml            # PR标签规则
│   ├── settings.yml           # 仓库设置和标签
│   └── workflows/
│       ├── ci.yml             # 技术栈专属CI流水线
│       ├── labeler.yml        # PR自动打标签
│       └── stale-issues-prs.yml
├── .husky/
│   ├── commit-msg             # 提交消息验证(可选)
│   ├── pre-commit             # 提交前检查(代码检查、格式化)
│   └── pre-push               # 推送前检查(测试、构建)
├── docs/                      # 文档
│   ├── README.md              # 文档索引(移除setup.md链接)
│   ├── getting-started.md     # 根据需要创建
│   └── ...                    # 其他用户文档(setup.md已移除)
├── skills/
│   └── {repo-name}/
│       └── SKILL.md           # 仓库专属Agent指南
├── src/                       # 源代码(根据技术栈创建)
├── .gitignore                 # 技术栈专属忽略规则
├── CONTRIBUTING.md            # 贡献指南(可覆盖组织级版本)
├── LICENSE                    # MIT许可证
├── README.md                  # 项目主README
└── {config files}             # package.json、Cargo.toml等配置文件

Stack-Specific Hook Examples

技术栈专属钩子示例

pre-commit

pre-commit

bash
undefined
bash
undefined

TypeScript/JavaScript

TypeScript/JavaScript

npm run lint:staged && npm run typecheck
npm run lint:staged && npm run typecheck

Rust

Rust

cargo fmt --check && cargo clippy
cargo fmt --check && cargo clippy

Python

Python

ruff check . && mypy .
ruff check . && mypy .

Go

Go

go fmt ./... && go vet ./...
go fmt ./... && go vet ./...

Deno

Deno

deno lint && deno check
undefined
deno lint && deno check
undefined

pre-push

pre-push

bash
undefined
bash
undefined

TypeScript/JavaScript

TypeScript/JavaScript

npm run check:push
npm run check:push

Rust

Rust

cargo test && cargo clippy -- -D warnings
cargo test && cargo clippy -- -D warnings

Python

Python

pytest && ruff check .
pytest && ruff check .

Go

Go

go test ./... && go build ./...
go test ./... && go build ./...

Deno

Deno

deno test && deno lint
undefined
deno test && deno lint
undefined

Labels (In Template)

模板中的标签

The template includes these labels in
.github/settings.yml
:
LabelColorDescription
bug
d73a4aSomething isn't working
feature
0e8a16New feature or request
task
6f42c1Planned implementation work item
documentation
0075caDocumentation improvements
doc
0075caDocumentation changes (PR label)
code
1d76dbSource code changes
dep
0366d6Dependency updates
config
5319e7Configuration changes
pinned
fbca04Exempt from stale bot
Note: Do not remove the
task
label - it's used by org-level issue templates.
模板在
.github/settings.yml
中包含以下标签:
标签颜色描述
bug
d73a4a功能异常
feature
0e8a16新功能或需求
task
6f42c1计划内的实现工作项
documentation
0075ca文档改进
doc
0075ca文档变更(PR标签)
code
1d76db源代码变更
dep
0366d6依赖更新
config
5319e7配置变更
pinned
fbca04不受 stale bot 影响
注意: 请勿移除
task
标签——组织级问题模板会用到它。

Org-Level Inherited Files

组织级继承文件

These files are inherited from
zenon-red/.github/
when not present:
FileInherited?Notes
PULL_REQUEST_TEMPLATE.md
✅ YesOrg-level PR template
.github/ISSUE_TEMPLATE/*
✅ YesBug, feature, task, docs forms
CONTRIBUTING.md
✅ Yes (fallback)Template includes a copy; can override
以下文件在仓库中不存在时,会从
zenon-red/.github/
继承:
文件是否继承说明
PULL_REQUEST_TEMPLATE.md
✅ 是组织级PR模板
.github/ISSUE_TEMPLATE/*
✅ 是Bug、功能、任务、文档表单
CONTRIBUTING.md
✅ 是( fallback)模板包含一份副本;可覆盖

Checklist

检查清单

Before considering setup complete:
  • Repository created from
    zenon-red/nexus-template
  • README.md
    updated with actual project name and description
  • .github/settings.yml
    has correct name/description
  • Logo renamed from
    nexus-template.png
    zr-newborn.png
    (temp) or replaced with actual logo
  • README.md
    logo reference updated
  • skills/{repo}/SKILL.md
    renamed and customized
  • .github/dependabot.yml
    configured for package ecosystem
  • .github/workflows/ci.yml
    configured for tech stack
  • .husky/pre-commit
    has appropriate lint/format commands
  • .husky/pre-push
    has appropriate test/build commands
  • .gitignore
    has stack-specific patterns
  • docs/setup.md
    removed (template-specific)
  • docs/getting-started.md
    or equivalent created
  • Dependencies installed and
    package.json
    /
    Cargo.toml
    /etc. configured
  • First commit pushed to main
  • Branch protection applied (via API, not rulesets)
  • All TODO comments in files addressed or removed
搭建完成前请确认以下项:
  • 仓库从
    zenon-red/nexus-template
    创建
  • README.md
    已更新为实际项目名称和描述
  • .github/settings.yml
    包含正确的名称/描述
  • Logo已从
    nexus-template.png
    重命名为
    zr-newborn.png
    (临时)或替换为实际Logo
  • README.md
    中的Logo引用已更新
  • skills/{repo}/SKILL.md
    已重命名并定制
  • .github/dependabot.yml
    已针对包生态系统配置
  • .github/workflows/ci.yml
    已针对技术栈配置
  • .husky/pre-commit
    包含合适的代码检查/格式化命令
  • .husky/pre-push
    包含合适的测试/构建命令
  • .gitignore
    包含技术栈专属的忽略规则
  • docs/setup.md
    已移除(模板专属)
  • docs/getting-started.md
    或同类文档已创建
  • 依赖已安装,
    package.json
    /
    Cargo.toml
    等配置文件已配置完成
  • 首次提交已推送到main分支
  • 分支保护已应用(通过API,而非rulesets)
  • 文件中所有TODO注释已处理或移除

Important Notes

重要提示

  • Never create repos from scratch - always use
    --template zenon-red/nexus-template
  • Always keep the
    task
    label - it's required by org issue templates
  • Always verify husky hooks are executable:
    chmod +x .husky/*
  • The Probot Settings bot will sync labels and repo settings after first push
  • 绝不从零创建仓库——始终使用
    --template zenon-red/nexus-template
  • 务必保留
    task
    标签——组织级问题模板需要它
  • 务必验证husky钩子的可执行性:
    chmod +x .husky/*
  • Probot Settings机器人会在首次推送后同步标签和仓库设置