网淘吧来吧,欢迎您!

Project Scaffold技能使用说明

2026-04-01 新闻来源:网淘吧 围观:7
电脑广告
手机广告

项目脚手架

使用最佳实践的项目结构、工具和配置来搭建新项目。

使用方法

当Colt(或你)需要启动一个新项目时,使用此技能来生成完整的项目模板。

Project Scaffold

决策树

询问或推断项目类型:

Web应用(React / Next.js)

my-app/
├── src/
│   ├── app/              # Next.js app router
│   ├── components/       # Reusable UI components
│   ├── lib/              # Utilities, helpers, API clients
│   ├── styles/           # Global styles, Tailwind config
│   └── types/            # TypeScript type definitions
├── public/               # Static assets
├── tests/                # Test files
├── .gitignore
├── .eslintrc.json
├── tailwind.config.ts
├── tsconfig.json
├── package.json
└── README.md

初始化命令:

npx create-next-app@latest my-app --typescript --tailwind --eslint --app --src-dir
cd my-app && npm install

API / 后端(FastAPI)

my-api/
├── app/
│   ├── __init__.py
│   ├── main.py           # FastAPI app entry
│   ├── routers/          # Route modules
│   ├── models/           # Pydantic models / DB models
│   ├── services/         # Business logic
│   └── config.py         # Settings / env vars
├── tests/
├── .gitignore
├── pyproject.toml
├── requirements.txt
└── README.md

初始化命令:

mkdir my-api && cd my-api
uv init && uv pip install fastapi uvicorn

移动应用(SwiftUI)

MyApp/
├── MyApp/
│   ├── App.swift
│   ├── ContentView.swift
│   ├── Models/
│   ├── Views/
│   ├── ViewModels/
│   └── Services/
├── MyAppTests/
├── MyAppUITests/
└── README.md

初始化:使用Xcode或swift package init --type executable

CLI工具(Node / Python)

my-cli/
├── src/
│   └── index.ts          # Entry point
├── bin/
│   └── my-cli            # Executable wrapper
├── tests/
├── .gitignore
├── tsconfig.json
├── package.json
└── README.md

浏览器扩展

my-extension/
├── src/
│   ├── background.ts
│   ├── content.ts
│   ├── popup/
│   │   ├── popup.html
│   │   ├── popup.ts
│   │   └── popup.css
│   └── options/
├── icons/
├── manifest.json
├── .gitignore
├── tsconfig.json
├── package.json
└── README.md

脚手架搭建后检查清单

生成项目结构后:

  1. git init && git add -A && git commit -m "Initial scaffold"
  2. 创建.gitignore适合项目类型的
  3. 设置代码检查配置(ESLint / Ruff)
  4. 添加基础README文件,包含项目名称和设置说明
  5. 添加基础测试文件以验证测试运行器正常工作

资源模板

.gitignore(通用基础版)

node_modules/
__pycache__/
.env
.env.local
dist/
build/
.next/
*.pyc
.DS_Store
*.log
coverage/

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第393739名访客 今日有1篇新文章/评论