项目脚手架

Universal

ln-700-project-bootstrap

by levnikolaevich

支持从空目录创建新项目,或把现有原型重构成生产可用结构,自动补齐 Clean Architecture、Docker、CI/CD、质量与安全配置。

不管是从零起步还是改造老项目,项目脚手架都能快速搭出可上线的生产级结构,省下大量规范化和 DevOps 配置时间。

405DevOps未扫描2026年3月5日

安装

claude skill add --url github.com/levnikolaevich/claude-code-skills/tree/master/ln-700-project-bootstrap

文档

Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.

ln-700-project-bootstrap

Type: L1 Top Orchestrator Category: 7XX Project Bootstrap

Universal project bootstrapper with two modes: CREATE (generate production-ready project from scratch) or TRANSFORM (migrate existing prototype from any platform to production structure). Output: Clean Architecture, Docker, CI/CD, quality tooling.


Mode Selection

AspectCREATETRANSFORM
InputEmpty directory or target stack configExisting project (Replit, StackBlitz, CodeSandbox, Glitch, custom)
DetectionNo source files foundSource files + optional platform config detected
ln-710SKIP (no deps to upgrade)RUN (upgrade existing deps)
ln-720SCAFFOLD + GENERATERESTRUCTURE + MIGRATE
ln-724SKIP (no artifacts)CONDITIONAL (if platform detected)
ln-730–780RUN (same for both modes)RUN (same for both modes)

Overview

AspectDetails
InputEmpty directory (CREATE) or source project (TRANSFORM)
OutputProduction-ready project with all infrastructure
Delegationsln-710 (conditional) -> ln-720 -> ln-730 -> ln-740 -> ln-750 -> ln-760 -> ln-770 -> ln-780

Workflow

code
Phase 0: Analyze (Tech Detection)
    |
    v
Phase 1: Plan (Generate Transformation Plan)
    |
    v
Phase 2: Confirm (User Approval)
    |
    v
Phase 3: Execute (Delegate to L2 Coordinators)
    |
    +---> ln-710: Dependency Upgrader
    +---> ln-720: Structure Migrator
    +---> ln-730: DevOps Setup
    +---> ln-740: Quality Setup
    +---> ln-750: Commands Generator
    +---> ln-760: Security Setup
    +---> ln-770: Crosscutting Setup
    +---> ln-780: Bootstrap Verifier
    |
    v
Phase 4: Report (Summary of Changes)

Phase 0: Technology Detection

Step 0.0: Mode Detection

ConditionModeAction
Empty directory (no source files)CREATEAsk user for target stack, project name, entities
Source files foundTRANSFORMAuto-detect stack, scan for platform artifacts
Ambiguous (few files, unclear)ASKPresent both options, let user choose

Step 0.1: CREATE Mode — User Input

ParameterRequiredDefaultExample
Project nameYesMyApp
Target backendYes.NET / Node.js / Python
Target frontendYesReact / Vue / Angular / Svelte
DatabaseYesPostgreSQL / MongoDB / MySQL
Main entitiesNoUser, Role (starter)User, Product, Order

Step 0.2: Idempotency Pre-flight

If target directory contains existing files:

  1. Detect existing structure (package.json, .csproj, etc.)
  2. Warn user: "Target directory is not empty. Existing files may be overwritten."
  3. Ask: Overwrite (replace all) / Merge (keep existing, add missing) / Abort

Step 0.3: Technology Detection (TRANSFORM mode) / Stack Config (CREATE mode)

Analyze project to detect tech stack before delegations.

Detection Rules

yaml
Frontend:
  React:
    - package.json contains "react"
    - Files: *.tsx, *.jsx with React imports
  Vue:
    - package.json contains "vue"
    - Files: *.vue
  Angular:
    - package.json contains "@angular/core"
    - Files: *.component.ts
  Svelte:
    - package.json contains "svelte"
    - Files: *.svelte

Backend:
  .NET:
    - *.csproj files exist
    - *.sln files exist
  Node.js:
    - package.json + (express|fastify|nest|koa)
    - tsconfig.json or jsconfig.json
  Python:
    - requirements.txt OR pyproject.toml OR setup.py
    - (fastapi|flask|django) in dependencies
  Go:
    - go.mod exists

Database:
  PostgreSQL:
    - DATABASE_URL contains "postgres"
    - docker-compose.yml contains "postgres"
  MongoDB:
    - MONGODB_URI in env
    - docker-compose.yml contains "mongo"
  MySQL:
    - DATABASE_URL contains "mysql"

ORM:
  Drizzle: drizzle.config.ts exists
  Prisma: prisma/schema.prisma exists
  EF Core: *.csproj references Microsoft.EntityFrameworkCore
  SQLAlchemy: "sqlalchemy" in requirements

Detection Output

yaml
Detected Stack:
  Frontend:
    Framework: React
    Version: 19.x
    Build Tool: Vite
    UI Library: shadcn/ui
    State: React Query

  Backend:
    Current: Node.js + Express
    Target: .NET 10 (user preference)
    ORM: Drizzle -> EF Core

  Database:
    Type: PostgreSQL
    Version: 17

  Structure:
    Type: Monolith (Prototype)
    Origin: replit | stackblitz | codesandbox | glitch | custom
    Target: Clean Architecture

Phase 1: Generate Transformation Plan

Based on detected stack, create detailed plan:

markdown
# Bootstrap Transformation Plan

## Source Analysis
- Frontend: React 19 + Vite + TypeScript
- Backend: Express + Drizzle (to be replaced with .NET)
- Database: PostgreSQL 17

## Transformations

### 1. Dependencies (ln-710)
- Upgrade React 18 -> 19
- Upgrade Vite 5 -> 6
- Add missing peer dependencies

### 2. Structure (ln-720)
- Move frontend to src/frontend/
- Create .NET backend: MyApp.Api, MyApp.Domain, etc.
- Migrate mock data from Drizzle to MockData classes

### 3. DevOps (ln-730)
- Create Dockerfile.frontend (multi-stage)
- Create Dockerfile.backend (.NET SDK)
- Create docker-compose.yml
- Create .github/workflows/ci.yml

### 4. Quality (ln-740)
- Configure ESLint (flat config)
- Add Prettier
- Setup Husky + lint-staged
- Create test infrastructure (Vitest, xUnit)

### 5. Commands (ln-750)
- Generate refresh_context.md
- Generate refresh_infrastructure.md
- Generate build-and-test.md

### 6. Security (ln-760)
- Scan for hardcoded secrets
- Run npm audit
- Create SECURITY.md

### 7. Crosscutting (ln-770)
- Configure Serilog logging
- Add GlobalExceptionMiddleware
- Configure CORS policy
- Add /health endpoints
- Enable Swagger

### 8. Verification (ln-780)
- Build all projects
- Run tests
- Start Docker containers
- Verify health checks

## Estimated Changes
- Files created: ~45
- Files modified: ~12
- Files deleted: ~8 (replaced backend)

Phase 2: User Confirmation

Present plan and ask for approval:

code
Bootstrap Plan Ready!

Summary:
- Frontend: React 19 (upgrade from 18)
- Backend: .NET 10 (replacing Node.js)
- Docker: Multi-container setup
- CI/CD: GitHub Actions
- Quality: ESLint, Prettier, Husky

Proceed with bootstrap? [Y/n]

If user declines, ask for modifications.


Phase 3: Execute Delegations

Sequential delegation to L2 coordinators:

OrderSkillPurposeCREATE modeTRANSFORM modeDepends On
1ln-710Upgrade dependenciesSKIPRUN
2ln-720Structure (SCAFFOLD/RESTRUCTURE)RUN (SCAFFOLD)RUN (RESTRUCTURE)ln-710
3ln-730Setup Docker/CIRUNRUNln-720
4ln-740Configure quality toolsRUNRUNln-720
5ln-750Generate .claude/commandsRUNRUNln-720
6ln-760Security scanningRUNRUNln-710
7ln-770Crosscutting concernsRUNRUNln-720
8ln-780Build and verifyRUNRUNAll above

Delegation Protocol

For each L2 coordinator:

  1. Prepare context:

    yaml
    Stack:
      frontend: { framework, version, buildTool }
      backend: { framework, version }
      database: { type, version }
    
    Paths:
      root: /project
      frontend: /project/src/frontend
      backend: /project/src/MyApp.Api
    
    Options:
      skipTests: false
      allowFailures: false
    
  2. Invoke skill: Pass context as input

  3. Collect result:

    yaml
    Status: success | partial | failed
    FilesCreated: [...]
    FilesModified: [...]
    Warnings: [...]
    Errors: [...]
    
  4. Handle errors:

    • Log error details
    • Ask user: continue or abort?
    • If abort, rollback if possible

Phase 4: Generate Report

Bootstrap Completeness Assessment

Context: Final verification that bootstrap produced a working project, not just files.

#CategoryCheckSource
1StructureClean Architecture layers presentln-720 result
2DependenciesAll packages installed, no version conflictsln-710 result
3DevOpsDocker builds, CI pipeline validln-730 result
4QualityLinters/formatters configured and passln-740 result
5SecurityNo hardcoded secrets, scanning configuredln-760 result
6BuildProject compiles/builds without errorsln-780 result

Completeness Score = count of PASS / 6

  • 6/6: Bootstrap complete
  • 4-5/6: Bootstrap complete with warnings (list failing categories)
  • <4/6: Bootstrap incomplete — list blocking issues for user action

Summary Report

Final summary after all delegations:

yaml
Bootstrap Complete!

Duration: 24 minutes 32 seconds

Changes Summary:
  Files Created: 47
  Files Modified: 15
  Files Deleted: 9

By Category:
  Dependencies:
    - Upgraded 23 packages
    - No breaking changes detected

  Structure:
    - Created 5 .NET projects
    - Restructured frontend (12 components extracted)
    - Migrated 8 mock data files

  DevOps:
    - Created Dockerfile.frontend
    - Created Dockerfile.backend
    - Created docker-compose.yml
    - Created .github/workflows/ci.yml

  Quality:
    - Configured ESLint + Prettier
    - Installed Husky hooks
    - Created 3 test files

  Commands:
    - Generated 3 .claude/commands

  Security:
    - Scanned 156 files
    - Found 0 secrets
    - 2 vulnerability warnings (low severity)

  Crosscutting:
    - Configured Serilog
    - Added error handling
    - CORS enabled for localhost
    - Health checks at /health
    - Swagger at /swagger

Verification:
  Build: SUCCESS
  Tests: 42 passed, 0 failed
  Docker: 3 containers running
  Health: All endpoints responding

Next Steps:
  1. Open http://localhost:3000 (frontend)
  2. Open http://localhost:5000/swagger (API docs)
  3. Review generated .claude/commands
  4. Run 'git add . && git commit -m "Bootstrap complete"'

Error Handling

Recoverable Errors

ErrorAction
Dependency conflictTry with --legacy-peer-deps
Build failureLog error, suggest fix, continue
Test failureLog warning, continue with --allow-failures
Docker build failSuggest Dockerfile fixes

Fatal Errors

ErrorActionMode
No package.json (TRANSFORM)Abort: "Not a Node.js project"TRANSFORM
Unsupported stackAbort: "Stack not supported: {stack}"Both
Permission deniedAbort: "Cannot write to {path}"Both
No stack selectedAbort: "Target stack required for CREATE mode"CREATE
Conflicting filesAbort if user chose "Abort" in pre-flightCREATE

Configuration

Skill Options

yaml
Options:
  # Backend replacement
  targetBackend: ".NET" | "Node" | "Python" | "keep"

  # Frontend refactoring depth
  frontendRefactoring: "minimal" | "moderate" | "full"

  # Docker setup
  dockerEnabled: true
  dockerRegistry: null  # Optional: ghcr.io/user

  # CI/CD
  cicdProvider: "github" | "azure" | "gitlab" | "none"

  # Quality tools
  linterConfig: "recommended" | "strict"
  precommitHooks: true

  # Commands to generate
  commands: ["refresh_context", "refresh_infrastructure", "build-and-test"]

  # Verification
  runTests: true
  startContainers: true
  keepContainersRunning: true

Environment Variables

bash
# Optional: Override detection
BOOTSTRAP_FRONTEND=react
BOOTSTRAP_BACKEND=dotnet
BOOTSTRAP_DB=postgres

# Optional: Skip steps
SKIP_DEPENDENCIES=false
SKIP_DOCKER=false
SKIP_TESTS=false

Integration with Existing Skills

SkillIntegration
ln-001-standards-researcherQuery for best practices during ln-720
ln-002-best-practices-researcherGenerate guides during ln-720
ln-100-documents-pipelineCall after bootstrap for docs
ln-310-story-validatorValidate generated tasks

References


Version: 2.0.0 Last Updated: 2026-02-07

相关 Skills

可观测性设计

by alirezarezvani

Universal
热门

面向生产系统规划可落地的可观测性体系,串起指标、日志、链路追踪与 SLI/SLO、错误预算、告警和仪表盘设计,适合搭建监控平台与优化故障响应。

把监控、日志、链路追踪串起来,帮助团队从设计阶段构建可观测性,排障更快、系统演进更稳。

DevOps
未扫描11.5k

AWS架构师

by alirezarezvani

Universal
热门

面向初创团队规划 AWS 架构,覆盖 Serverless、ECS、Aurora 等方案,可生成 CloudFormation 模板,兼顾成本优化、CI/CD 搭建与迁移上云。

特别适合创业团队,用无服务器模式和 IaC 模板快速搭好 AWS 架构,连成本优化、CI/CD 与迁移路径都能一并规划。

DevOps
未扫描11.5k

环境密钥管理

by alirezarezvani

Universal
热门

统一梳理dev/staging/prod的.env和密钥流程,自动生成.env.example、校验必填变量、扫描Git历史泄漏,并联动Vault、AWS SSM、1Password、Doppler完成轮换。

统一管理环境变量、密钥与配置,减少泄露和部署混乱,安全治理与团队协作一起做好,DevOps 场景很省心。

DevOps
未扫描11.5k

相关 MCP 服务

kubefwd

编辑精选

by txn2

热门

kubefwd 是让 AI 帮你批量转发 Kubernetes 服务到本地的开发神器。

微服务开发者最头疼的本地调试问题,它一键搞定——自动分配 IP 避免端口冲突,还能用自然语言查询状态。但依赖 AI 工作流,纯命令行爱好者可能觉得不够直接。

DevOps
4.1k

Cloudflare

编辑精选

by Cloudflare

热门

Cloudflare MCP Server 是让你用自然语言管理 Workers、KV 和 R2 等云资源的工具。

这个工具解决了开发者频繁切换控制台和文档的痛点,特别适合那些在 Cloudflare 上部署无服务器应用、需要快速调试或管理配置的团队。不过,由于它依赖多个子服务器,初次设置可能有点繁琐,建议先从 Workers Bindings 这类核心功能入手。

DevOps
3.6k

Terraform

编辑精选

by hashicorp

Terraform MCP Server 是让 AI 助手直接操作 Terraform Registry 和 HCP Terraform 的桥梁。

如果你经常在 Terraform 里翻文档找模块配置,这个服务器能省不少时间——直接问 Claude 就能生成准确的代码片段。最适合管理多云基础设施的团队,但注意它目前只适合本地使用,别在生产环境里暴露 HTTP 端点。

DevOps
1.3k

评论