A skill that initializes a C#/.NET project for Claude Code. Generates CLAUDE.md and installs the context hook (Bash/PowerShell).
Arguments
$ARGUMENTS[0]: subcommand (init|migrate|hooks)$ARGUMENTS[1]: target project path (optional, default: current directory)
Subcommand
| Command | Description |
|---|---|
init |
Initialize a new project (generate CLAUDE.md + install hook) |
migrate |
Add a Context Management section to an existing CLAUDE.md + install hook |
hooks |
Install/update only the hook script |
Workflow
Step 1: Parse arguments
서브커맨드 = $ARGUMENTS[0] (기본값: "init")
대상 경로 = $ARGUMENTS[1] (기본값: 현재 작업 디렉토리)
If the subcommand is not one of init, migrate, hooks :
- Treat the first argument as the path and set the subcommand to
initset to
Step 2: Detect C# project (init/migrate)
hooks If the subcommand is , skip this step.
- Use Glob to search for
.sln,.csprojfiles in the target path .csprojRead the files and extract the following information:<TargetFramework>(예: net8.0, net9.0)<OutputType>(예: WinExe, Exe, Library)<UseWPF>true</UseWPF>whether <UseWPF>true</UseWPF><PackageReference>list (major NuGet packages)
- Determine project type:
| OutputType | UseWPF | Determination result |
|---|---|---|
| WinExe | true | WPF Application |
| Exe | - | Console Application |
| Library | - | Class Library |
| - | - (WebAPI package present) | ASP.NET WebAPI |
| - | - (test package present) | Test Project |
- Identify solution structure:
.slnExtract the project list from the file- Check the src/tests directory structure
Step 3: Install hook script
Detect OS: uname -s Determine the environment from the result:
uname -s uname -s result |
Environment | Script |
|---|---|---|
Linux |
Linux/WSL | setup.sh |
Darwin |
macOS | setup.sh |
MINGW* / MSYS* / CYGWIN* |
Git Bash/MSYS2 | setup.sh |
| Command failed or other | Windows (native) | setup.ps1 |
Bash environment (Linux/macOS/WSL):
bash <plugin-path>/skills/project-setup/scripts/setup.sh <target-dir>
PowerShell environment (Windows):
pwsh <plugin-path>/skills/project-setup/scripts/setup.ps1 -TargetDir <target-dir>
<plugin-path>is the absolute path of this SKILL.md's parent directory (skills/project-setup/). The setup script performs hook file copying, setting execute permissions, and directory creation.
Step 4: Generate or update CLAUDE.md
init subcommand: Create a new CLAUDE.md
Use the Write tool to <target>/CLAUDE.md Create <target>/CLAUDE.md with the Write tool. Refer to the references/claude-md-template.md template and replace the {variables} with the information detected in Step 2. references/claude-md-template.md Refer to the template and replace {변수}with the information detected in Step 2.
- Read로
references/claude-md-template.mdRead with Read references/claude-md-template.md - Replace the template's
{변수}with the Step 2 detection results - Apply conditional sections:
- If it is not a WPF project:
### WPF/MVVM PatternsRemove the section +Skill Workflows > ScaffoldingRemove the section - If there is no test project:
### Test PatternsRemove the section +Build & Test CommandsRemove the Test row from - If TargetFramework < net8.0:
### C# 12 Features (.NET 8)Add a warning note at the top of the section (> ⚠ 현재 프로젝트는 {TargetFramework}입니다. C# 12 기능은 .NET 8+ 에서 사용 가능합니다.)
- If it is not a WPF project:
- Write로
<target>/CLAUDE.mdCreate <target>/CLAUDE.md with Write
migrate subcommand: Add a section to an existing CLAUDE.md
- Read the existing CLAUDE.md
## Context ManagementIf the section does not exist, add it with Edit## C#/.NET Quick Referenceif the section does not exist, add it with Edit (the template's entire Quick Reference)## Detailed Referencesif the section does not exist, add it with Edit (existing## C#/.NET Coding Guidelinesif there is## Detailed Referencesrename to)## Skill Workflowsif the section does not exist, add it with Edit- never delete existing content
Step 5: Update settings.local.json
- Read로
<target>/.claude/settings.local.jsonread (create new if absent) - Determine the hook command according to the OS detected in Step 3:
- Bash environment:
bash scripts/hooks/<name>.sh - PowerShell environment:
pwsh scripts/hooks/<name>.ps1
- Bash environment:
- If existing hooks settings are present, merge them; if not, add new:
Hook registration structure
{
"hooks": {
"SessionStart": [{ "matcher": "", "hooks": [{ "type": "command", "command": "<runner> scripts/hooks/session-start.<ext>" }] }],
"PreCompact": [{ "matcher": "", "hooks": [{ "type": "command", "command": "<runner> scripts/hooks/pre-compact.<ext>" }] }],
"Stop": [{ "matcher": "", "hooks": [{ "type": "command", "command": "<runner> scripts/hooks/session-complete.<ext>" }] }]
}
}
<runner> / <ext> substitution:
| environment | <runner> |
<ext> |
|---|---|---|
| Bash (Linux/macOS/WSL) | bash |
sh |
| PowerShell (Windows) | pwsh |
ps1 |
- If existing settings are present,
hooksmerge into the key (keep existing hooks)
Step 6: Verification checklist
After all installations are complete, verify:
-
scripts/hooks/session-start.sh+.ps1exists -
scripts/hooks/pre-compact.sh+.ps1exists -
scripts/hooks/session-complete.sh+.ps1exists -
scripts/hooks/lib/utils.sh+utils.ps1exists - Check Bash script execution permission (Linux/macOS)
-
.claude/context/directory exists -
.claude/learnings/directory exists -
.claude/settings.local.jsoncheck hook registration in -
CLAUDE.md에## C#/.NET Quick Referencesection exists (init/migrate) -
CLAUDE.md에## Detailed Referencessection exists (init/migrate) -
CLAUDE.md에## Skill Workflowssection exists (init/migrate) - Conditional sections applied correctly: no WPF section if not WPF, no Test section if no tests
If there are failed verification items, notify the user and guide them on manual remediation.
Currently passed arguments
ARGUMENTS: $ARGUMENTS
Execution instructions
Parse the above ARGUMENTS and start the workflow.
If ARGUMENTS is empty initas the default subcommand, and target the current directory.
Invocation examples:
/project-setup→ init + current directory/project-setup init→ init + current directory/project-setup init /path/to/project→ init + specified path/project-setup migrate→ add section to existing CLAUDE.md/project-setup hooks→ install hook scripts only/project-setup /path/to/project→ init + specified path (when the path is not a subcommand)
Error Handling
| Situation | Handling |
|---|---|
| No .csproj | Output warning and create default CLAUDE.md |
| CLAUDE.md already exists (init) | Ask the user to confirm overwrite or suggest migrate |
| settings.local.json parsing failed | Create new after backup |
| setup script execution failed | Output error details + guide on manual installation method |
.gitignore guidance
After installation is complete, guide the user to add the following to .gitignore:
# Claude Code context (auto-generated, session-specific)
.claude/context/
.claude/learnings/
scripts/hooks/is recommended to be committed for team sharing.