SuperAPI AI Directory

project-setup

Agents & models

View repository

Updated 10-15 23:47

About this skill

Project Setup

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.

  1. Use Glob to search for .sln, .csproj files in the target path
  2. .csproj Read 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)
  3. 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
  1. Identify solution structure:
    • .sln Extract 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.

  1. Read로 references/claude-md-template.md Read with Read references/claude-md-template.md
  2. Replace the template's {변수}with the Step 2 detection results
  3. Apply conditional sections:
    • If it is not a WPF project: ### WPF/MVVM Patterns Remove the section + Skill Workflows > Scaffolding Remove the section
    • If there is no test project: ### Test Patterns Remove 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+ 에서 사용 가능합니다.)
  4. Write로 <target>/CLAUDE.md Create <target>/CLAUDE.md with Write

migrate subcommand: Add a section to an existing CLAUDE.md

  1. Read the existing CLAUDE.md
  2. ## Context Management If the section does not exist, add it with Edit
  3. ## C#/.NET Quick Reference if the section does not exist, add it with Edit (the template's entire Quick Reference)
  4. ## Detailed References if the section does not exist, add it with Edit (existing ## C#/.NET Coding Guidelinesif there is ## Detailed Referencesrename to)
  5. ## Skill Workflows if the section does not exist, add it with Edit
  6. never delete existing content

Step 5: Update settings.local.json

  1. Read로 <target>/.claude/settings.local.json read (create new if absent)
  2. 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
  3. 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
  1. If existing settings are present, hooks merge into the key (keep existing hooks)

Step 6: Verification checklist

After all installations are complete, verify:

  • scripts/hooks/session-start.sh + .ps1 exists
  • scripts/hooks/pre-compact.sh + .ps1 exists
  • scripts/hooks/session-complete.sh + .ps1 exists
  • scripts/hooks/lib/utils.sh + utils.ps1 exists
  • 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 Reference section exists (init/migrate)
  • CLAUDE.md에 ## Detailed References section exists (init/migrate)
  • CLAUDE.md에 ## Skill Workflows section 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.