Dotnet Init

codewithmukesh/dotnet-claude-kit/skills/dotnet-init

作者 codewithmukesh23300897f4d1无许可证754 个星标收录于 2026年10月8日更新于 2026年10月8日仓库2个月前更新

Interactive project initialization. Detects project type, asks architecture questions, and generates a customized CLAUDE.md — no manual template copying. Use when: "init project", "setup project", "initialize", "new project setup", "generate CLAUDE.md", "configure for dotnet-claude-kit", or starting Claude Code on a fresh or existing .NET codebase.

AI 生成的概览

以交互方式初始化 .NET 项目,并生成定制化的 CLAUDE.md 配置文件。

功能
通过扫描解决方案和项目文件,判断当前目录中是已有项目还是全新 .NET 项目,然后就架构、领域复杂度、团队规模和技术栈提出针对性问题。它会推荐垂直切片、整洁架构、DDD 或模块化单体等架构,并在项目根目录生成定制化的 CLAUDE.md。对于全新项目,它还会搭建解决方案结构;在合并或覆盖之前,会先备份已有的 CLAUDE.md。
适用场景
适用于在 Claude Code 中启动新的 .NET 项目、为已有 .NET 代码库添加 dotnet-claude-kit,或被要求初始化、设置、配置项目并生成 CLAUDE.md 的场景。
运行要求
需要 .NET SDK 和 dotnet CLI 用于检测与脚手架搭建,并依赖配套技能(project-setup、architecture-advisor、convention-learner)以及 dotnet-architect 代理。它可能会为 Roslyn MCP 服务器创建 .mcp.json。不附带脚本,仅为指令。

/dotnet-init

What

Interactively initializes a .NET project for use with dotnet-claude-kit. Detects the project type, asks targeted questions about architecture and tech stack, then generates a fully customized CLAUDE.md in the project root.

No manual template copying required.

When

  • Starting a new .NET project with Claude Code
  • Adding dotnet-claude-kit to an existing project
  • "init project", "setup project", "generate CLAUDE.md", "configure for dotnet-claude-kit"

How

Step 1: Detect or Ask Project Type

Analyze the current directory to determine if this is an existing or greenfield project:

→ Look for .slnx / .sln files→ If found, scan .csproj files for SDK type:  - Microsoft.NET.Sdk.Web → web-api or blazor-app  - Microsoft.NET.Sdk.Worker → worker-service  - Microsoft.NET.Sdk → class-library  - Multiple projects with inter-module references → modular-monolith  - If ambiguous, ask the user
→ If NO solution/project found (greenfield):  - Ask: "What are you building?"    - REST API / microservice → web-api    - Blazor application → blazor-app    - Background worker / queue processor → worker-service    - NuGet package / shared library → class-library    - Multi-module system → modular-monolith  - Ask: "Project name?"  - Scaffold the solution structure:    - dotnet new sln -n ProjectName --format slnx   (modern XML solution format)    - dotnet new webapi / worker / classlib as appropriate    - Set up Directory.Build.props with .NET 10 defaults    - Create src/ and tests/ folder structure

Step 2: Architecture Questionnaire

Load the architecture-advisor skill and ask targeted questions:

  1. Domain complexity — CRUD-heavy, moderate business rules, or rich domain?
  2. Team size — Solo, small team, or large team?
  3. Module boundaries — Single deployable or multiple bounded contexts?
  4. Existing patterns — (existing projects only) Detect conventions via convention-learner skill

→ Recommend: VSA, Clean Architecture, DDD, or Modular Monolith with rationale.

Step 3: Tech Stack Selection

Ask about specific technology choices:

  • Database: PostgreSQL, SQL Server, SQLite, or none yet
  • Auth: JWT, OIDC, Cookie, or none yet
  • Caching: HybridCache, Redis, or none yet
  • Messaging: Wolverine, MassTransit, or none yet
  • Testing: Confirm xUnit + Testcontainers defaults

Step 4: Generate CLAUDE.md

Load the appropriate template from templates/ as a base, then customize:

  • Replace [ProjectName] with the actual project/solution name
  • Set the chosen architecture
  • Configure the tech stack section
  • For existing projects: add project-specific conventions detected in Step 2
  • For greenfield: add recommended conventions based on architecture choice

Before writing, check for an existing CLAUDE.md. Never overwrite it silently.

→ If ./CLAUDE.md does NOT exist:  - Write the generated content to ./CLAUDE.md
→ If ./CLAUDE.md ALREADY exists:  - Read it and identify hand-written / custom sections    (anything not produced by a kit template)  - Ask: "You already have a CLAUDE.md. How should I proceed?"    - Merge (recommended) → keep the user's custom sections, add or refresh the      kit's architecture, tech-stack, and convention sections in place    - Overwrite → replace it entirely with the freshly generated file    - Keep → leave the file untouched and print the generated content so the      user can copy what they want by hand  - For Merge and Overwrite: back the original up to ./CLAUDE.md.bak first.    Never discard user content without a .bak backup.

Step 5: Verify Setup

→ Confirm .mcp.json exists or create it (for Roslyn MCP server)→ For existing projects:  - Verify the solution file is discoverable  - Run a quick health check to establish baseline  - Report: "Project initialized. Run /health-check to see your baseline."→ For greenfield projects:  - Verify dotnet build succeeds on the scaffolded solution  - Report: "Project created. Run /scaffold to add your first feature."

Skills invoked: project-setup, architecture-advisor, convention-learner Agent: dotnet-architect

Example — Existing Project

User: /dotnet-init
Claude: Detected:  - Solution: MyApp.slnx (3 projects)  - SDK: Microsoft.NET.Sdk.Web → Web API  - Database: PostgreSQL (from connection string)  - Auth: JWT (from appsettings)
  1. Domain complexity? [CRUD-heavy / Moderate / Rich domain]  > Moderate
  2. Team size? [Solo / Small / Large]  > Small
  Recommendation: Vertical Slice Architecture  Generated: ./CLAUDE.md (MyApp + VSA + PostgreSQL + JWT)  Run /health-check to see your baseline.

Example — Greenfield Project

User: /dotnet-init
Claude: No .sln or .csproj found. Let's set up a new project.
  1. What are you building? [REST API / Blazor / Worker / Library / Modular Monolith]  > REST API
  2. Project name?  > OrderService
  3. Domain complexity? [CRUD-heavy / Moderate / Rich domain]  > CRUD-heavy
  Recommendation: Vertical Slice Architecture
  Creating solution...  → dotnet new sln -n OrderService --format slnx  → dotnet new webapi -n OrderService.Api -o src/OrderService.Api  → dotnet new xunit3 -n OrderService.Tests -o tests/OrderService.Tests  → Directory.Build.props with .NET 10 defaults  → Generated: ./CLAUDE.md (OrderService + VSA + scaffold-ready)
  Run /scaffold to add your first feature.

Example — Existing Project With a CLAUDE.md

User: /dotnet-init
Claude: Detected:  - Solution: MyApp.slnx (3 projects) → Web API  - Found an existing CLAUDE.md (custom "Deployment" and "Team conventions" sections)
  You already have a CLAUDE.md. How should I proceed?  [Merge (recommended) / Overwrite / Keep]  > Merge
  → Backed up original to ./CLAUDE.md.bak  → Kept your Deployment + Team conventions sections  → Refreshed architecture (VSA), tech-stack (PostgreSQL + JWT), and convention sections  Generated: ./CLAUDE.md  Run /health-check to see your baseline.

Related

  • /plan — Plan before building features
  • /health-check — Assess project health after init
  • /scaffold — Scaffold features using the chosen architecture

来源与署名

来源:codewithmukesh/dotnet-claude-kit位于skills/dotnet-init提交2330089

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 codewithmukesh/dotnet-claude-kit 的技能

Wrap Up

codewithmukesh

在会话结束时把已完成工作、待办任务与经验写入交接文件,并在会话开始时重新载入。

Productivity & Workflow7542个月前更新

Workflow Mastery

codewithmukesh

Claude Code workflow mastery for .NET developers. Covers parallel execution with git worktrees, plan mode strategy, verification loops, auto-formatting hooks, permission setup for dotnet CLI, prompting techniques, subagent patterns, and context discipline — token budget management, MCP-first navigation, lazy loading, and subagent isolation — all adapted for the .NET ecosystem. Load this skill when setting up Claude Code for a .NET project, optimizing workflows, running parallel sessions, when context is running low or sessions feel sluggish, when exploring a large codebase efficiently, or when the user mentions "productivity", "workflow", "parallel", "worktree", "plan mode", "permissions", "hooks", "10x", "setup Claude Code", "speed up development", "context", "tokens", "budget", "running out of context", "too many files", or "large codebase". Inspired by tips from Boris Cherny (creator of Claude Code) and the Anthropic team.

待分类7542个月前更新

Vertical Slice

codewithmukesh

指导 .NET 开发者采用垂直切片架构组织应用,涵盖功能文件夹、端点分组与处理程序模式。

Software Development7542个月前更新

Testing

codewithmukesh

Testing strategy for .NET 10 applications. Covers xUnit v3, WebApplicationFactory for integration tests, Testcontainers for real database testing, Verify for snapshot testing, and the AAA pattern. Load this skill when writing tests, setting up test infrastructure, reviewing test coverage, or when the user mentions "test", "xUnit", "WebApplicationFactory", "Testcontainers", "integration test", "unit test", "bUnit", "snapshot test", "Verify", "test coverage", "AAA pattern", "WireMock", or "FakeTimeProvider".

待分类7542个月前更新

Tdd

codewithmukesh

Guided test-driven development workflow for .NET 10 using xUnit v3, WebApplicationFactory, Testcontainers, and Verify snapshots. Follows the strict red-green-refactor cycle. Use when: "TDD", "test-driven", "let's TDD this", "red green refactor", "write the test first", or when building a feature with clear acceptance criteria.

待分类7542个月前更新

Spec

codewithmukesh

通过结构化提问,把模糊的功能想法转化为双方确认并持久化的规格说明文件。

Productivity & Workflow7542个月前更新