init-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Init Project Workflow

新项目初始化工作流

Set up a new project with proper structure from day one.
从第一天起就搭建具有合理结构的新项目。

Steps

步骤

  1. Gather requirements
  • What language / framework?
  • Project name?
  • Public or private repo?
  • Any CI/CD requirements?
  1. Create repo
gh repo create <name> --public/--private --clone
cd <name>
  1. Set up project structure
  • Create standard directories (src, tests, docs as needed)
  • Add
    .gitignore
    appropriate for the language
  • Add
    README.md
    with project name and one-line description
  • Add license file if specified
  1. Set up tooling
  • Package manager config (
    package.json
    ,
    pyproject.toml
    ,
    Cargo.toml
    , etc.)
  • Linter / formatter config if applicable
  • Test framework setup
  1. Set up CI (if requested)
  • GitHub Actions workflow for test + lint on PR
  • Keep it minimal — can be extended later
  1. First commit
git add -A
git commit -m "chore: initial project setup"
git push -u origin main
  1. 收集需求
  • 使用什么语言/框架?
  • 项目名称是什么?
  • 仓库是公开还是私有?
  • 有任何CI/CD需求吗?
  1. 创建仓库
gh repo create <name> --public/--private --clone
cd <name>
  1. 搭建项目结构
  • 创建标准目录(按需创建src、tests、docs)
  • 添加适用于对应语言的
    .gitignore
    文件
  • 添加包含项目名称和一行描述的
    README.md
  • 如有要求则添加许可证文件
  1. 配置工具
  • 包管理器配置文件(
    package.json
    pyproject.toml
    Cargo.toml
    等)
  • 如适用则添加代码检查/格式化工具配置
  • 搭建测试框架
  1. 配置CI(如有需求)
  • 用于PR时执行测试+代码检查的GitHub Actions工作流
  • 保持最简配置——后续可扩展
  1. 首次提交
git add -A
git commit -m "chore: initial project setup"
git push -u origin main

Rules

规则

  • Ask before adding anything beyond the basics
  • Don't over-engineer the initial setup — start minimal
  • Always include
    .gitignore
    and
    README.md
  • Test that the project builds/runs before committing
  • 添加基础内容之外的任何项前需先询问
  • 初始搭建不要过度设计——从最简开始
  • 务必包含
    .gitignore
    README.md
  • 提交前测试项目是否能构建/运行