zr-github-repository
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseZenon-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 GitHub template:
zenon-red/nexus-templatebash
gh repo create zenon-red/REPO_NAME --template zenon-red/nexus-template --publicThen clone and customize:
bash
gh repo clone zenon-red/REPO_NAME
cd REPO_NAME所有zenon-red仓库都应从 GitHub模板创建:
zenon-red/nexus-templatebash
gh repo create zenon-red/REPO_NAME --template zenon-red/nexus-template --public然后克隆并定制:
bash
gh repo clone zenon-red/REPO_NAME
cd REPO_NAMEPost-Template Customization
模板创建后的定制步骤
After creating from template, follow these steps to customize:
从模板创建仓库后,请按照以下步骤进行定制:
1. Replace Placeholders
1. 替换占位符
Update all placeholders with your actual repository name:
REPO_NAME| File | Changes |
|---|---|
| Replace |
| Update |
| Update references to |
| Rename folder to actual repo name, update all content |
将所有占位符替换为你的实际仓库名称:
REPO_NAME| 文件 | 修改内容 |
|---|---|
| 将 |
| 更新 |
| 更新对 |
| 将文件夹重命名为实际仓库名称,更新所有内容 |
2. Update Logo
2. 更新Logo
The template includes a placeholder logo . Replace it:
.github/nexus-template.png- Temporary: Rename to
nexus-template.pngas a placeholderzr-newborn.png - Final: Create your actual 128px PNG logo and save as
.github/{repo-name}.png - Update to reference the correct logo file
README.md
bash
undefined模板包含一个占位符Logo ,请替换它:
.github/nexus-template.png- 临时方案: 将重命名为
nexus-template.png作为临时占位符zr-newborn.png - 最终方案: 创建实际的128px PNG格式Logo,并保存为
.github/{repo-name}.png - 更新以引用正确的Logo文件
README.md
bash
undefinedRename 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
undefinedgit mv .github/zr-newborn.png .github/{repo-name}.png
undefined3. Configure Tech Stack
3. 配置技术栈
Fill in the TODOs for your technology stack:
| File | Stack-Specific Changes |
|---|---|
| Uncomment/setup your toolchain (Node, Rust, Python, Go, Deno) |
| Add lint/format commands |
| Add test/build commands |
| Uncomment and configure your package ecosystem |
| Add stack-specific patterns |
填写技术栈相关的TODO项:
| 文件 | 技术栈专属修改 |
|---|---|
| 取消注释/配置你的工具链(Node、Rust、Python、Go、Deno) |
| 添加代码检查/格式化命令 |
| 添加测试/构建命令 |
| 取消注释并配置你的包生态系统 |
| 添加技术栈专属的忽略规则 |
4. Update CODEOWNERS (if needed)
4. 更新CODEOWNERS(如有需要)
Default is . Change if different ownership is required:
@zenon-red/zoeundefined默认所有者为,如果需要不同的所有权请修改:
@zenon-red/zoeundefined.github/CODEOWNERS
.github/CODEOWNERS
- @zenon-red/team-name
undefined- @zenon-red/team-name
undefined5. Update Documentation
5. 更新文档
Remove template-specific files:
- - This is only for setting up from the template, remove after customization
docs/setup.md
Create user-facing docs in :
docs/- - Installation and first steps
getting-started.md - - CLI commands or API reference
commands.md - - Technical architecture overview
architecture.md - - Usage examples
examples.md
Update index to:
docs/README.md- Remove the link to
setup.md - Add links to your new project-specific docs
移除模板专属文件:
- - 仅用于从模板搭建仓库,定制完成后移除
docs/setup.md
在中创建面向用户的文档:
docs/- - 安装和入门步骤
getting-started.md - - CLI命令或API参考
commands.md - - 技术架构概述
architecture.md - - 使用示例
examples.md
更新索引:
docs/README.md- 移除指向的链接
setup.md - 添加指向新项目专属文档的链接
6. Write Repo-Specific Skill
6. 编写仓库专属Skill
Replace the placeholder with actual guidance:
skills/{repo-name}/SKILL.md- 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
undefinedbash
undefinedInstall 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
undefinednpx husky init
undefined8. First Commit
8. 首次提交
bash
git add .
git commit -m "chore: initial setup from nexus-template"
git push -u origin mainbash
git add .
git commit -m "chore: initial setup from nexus-template"
git push -u origin main9. Apply Branch Protection
9. 应用分支保护
After first push to , apply branch protection via the API (free tier — does not require paid GitHub Team plan):
mainbash
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 () — that requires a paid GitHub Team plan.
/repos/.../rulesets首次推送到分支后,通过API应用分支保护(免费版可用——无需付费GitHub Team计划):
mainbash
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()——该功能需要付费GitHub Team计划。
/repos/.../rulesetsTarget 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
undefinedbash
undefinedTypeScript/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
undefineddeno lint && deno check
undefinedpre-push
pre-push
bash
undefinedbash
undefinedTypeScript/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
undefineddeno test && deno lint
undefinedLabels (In Template)
模板中的标签
The template includes these labels in :
.github/settings.yml| Label | Color | Description |
|---|---|---|
| d73a4a | Something isn't working |
| 0e8a16 | New feature or request |
| 6f42c1 | Planned implementation work item |
| 0075ca | Documentation improvements |
| 0075ca | Documentation changes (PR label) |
| 1d76db | Source code changes |
| 0366d6 | Dependency updates |
| 5319e7 | Configuration changes |
| fbca04 | Exempt from stale bot |
Note: Do not remove the label - it's used by org-level issue templates.
task模板在中包含以下标签:
.github/settings.yml| 标签 | 颜色 | 描述 |
|---|---|---|
| d73a4a | 功能异常 |
| 0e8a16 | 新功能或需求 |
| 6f42c1 | 计划内的实现工作项 |
| 0075ca | 文档改进 |
| 0075ca | 文档变更(PR标签) |
| 1d76db | 源代码变更 |
| 0366d6 | 依赖更新 |
| 5319e7 | 配置变更 |
| fbca04 | 不受 stale bot 影响 |
注意: 请勿移除标签——组织级问题模板会用到它。
taskOrg-Level Inherited Files
组织级继承文件
These files are inherited from when not present:
zenon-red/.github/| File | Inherited? | Notes |
|---|---|---|
| ✅ Yes | Org-level PR template |
| ✅ Yes | Bug, feature, task, docs forms |
| ✅ Yes (fallback) | Template includes a copy; can override |
以下文件在仓库中不存在时,会从继承:
zenon-red/.github/| 文件 | 是否继承 | 说明 |
|---|---|---|
| ✅ 是 | 组织级PR模板 |
| ✅ 是 | Bug、功能、任务、文档表单 |
| ✅ 是( fallback) | 模板包含一份副本;可覆盖 |
Checklist
检查清单
Before considering setup complete:
- Repository created from
zenon-red/nexus-template - updated with actual project name and description
README.md - has correct name/description
.github/settings.yml - Logo renamed from →
nexus-template.png(temp) or replaced with actual logozr-newborn.png - logo reference updated
README.md - renamed and customized
skills/{repo}/SKILL.md - configured for package ecosystem
.github/dependabot.yml - configured for tech stack
.github/workflows/ci.yml - has appropriate lint/format commands
.husky/pre-commit - has appropriate test/build commands
.husky/pre-push - has stack-specific patterns
.gitignore - removed (template-specific)
docs/setup.md - or equivalent created
docs/getting-started.md - Dependencies installed and /
package.json/etc. configuredCargo.toml - 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(临时)或替换为实际Logozr-newborn.png - 中的Logo引用已更新
README.md - 已重命名并定制
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 label - it's required by org issue templates
task - 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机器人会在首次推送后同步标签和仓库设置