본문으로 건너뛰기
cccskills
무료GitHub에 공개

dotnet-agent-harness-hooks

Hooks and MCP server guide for dotnet-agent-harness. How hooks behave, how to disable them, MCP configuration and troubleshooting.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

dotnet-agent-harness-hooks

Source: dotnet-artisan (MIT) — Claire Novotny LLC. Ported into dotnet-agent-harness.

This guide explains the hook patterns and MCP server integration used by the dotnet-agent-harness ecosystem.


Hooks overview

Hooks fire automatically during Claude Code sessions. They provide .NET-focused defaults and suggestions.

PostToolUse hook (Write|Edit)

A single hook entry with matcher Write|Edit dispatches to scripts/hooks/post-edit-dotnet.sh, which inspects the edited file's extension and takes the appropriate action.

File patternBehaviorDetails
*Tests.cs, *Test.csSuggests running related testsOutputs a systemMessage with a dotnet test --filter command targeting the modified test class
*.csAuto-formats with dotnet formatRuns dotnet format --include <file> asynchronously; reports results on the next turn
*.csprojSuggests dotnet restoreOutputs a systemMessage recommending restore after project file changes
*.xamlValidates XML well-formednessUses xmllint or falls back to python3 xml.etree.ElementTree; reports validation errors

This hook runs asynchronously (async: true) with a 60-second timeout. It never blocks editing (always exits 0).

SessionStart hook (startup)

The scripts/hooks/session-start-context.sh hook fires once when a new Claude Code session starts. It detects whether the current directory is a .NET project and injects context.

  • Counts .sln/.slnx solution files (up to 3 directories deep)
  • Counts .csproj project files (up to 3 directories deep)
  • Checks for global.json
  • Extracts the target framework moniker (TFM) from the first .csproj found

If .NET project indicators are found, the hook outputs an additionalContext message such as:

This is a .NET project (net10.0) with 3 project(s) in 1 solution(s).

This context helps Claude understand the project environment from the start of the session.


How to disable hooks

Plugin hooks can be disabled in two ways:

  1. Disable all hooks globally: set disableAllHooks: true in your .claude/settings.json file. This disables hooks from all plugins.
  2. Per-session control: use the /hooks menu within Claude Code to review and toggle individual hooks during a session. Hooks snapshot at session startup; changes via /hooks take effect immediately but do not persist across restarts.

To re-enable hooks after disabling, remove the disableAllHooks setting or toggle them back on via /hooks.


MCP server configuration

The plugin configures the following MCP server in .mcp.json.

Context7

PropertyValue
Transportstdio
Commandnpx -y @upstash/context7-mcp@latest
PurposeLibrary documentation lookup covering Microsoft Learn, NuGet, and .NET ecosystem docs

Context7 provides on-demand documentation lookups that enhance skill guidance with live, up-to-date library references.

Version note: The plugin currently uses @latest for initial ship. After stabilization, the version may be pinned (for example @1.x.x) to prevent upstream breaking changes.

Requirements

  • Node.js is required for MCP servers that use npx. Verify Node.js is installed by running node --version in your terminal. You can also check MCP server status with the /mcp command inside Claude Code.
  • MCP servers start automatically when the plugin is enabled. After enabling or disabling the plugin, restart Claude Code to apply MCP server changes.

Troubleshooting

dotnet not found

The PostToolUse hook checks for dotnet in PATH before running dotnet format. If the .NET SDK is not installed or not in PATH, the hook degrades gracefully: it outputs a warning message and exits 0 without blocking.

Fix: install the .NET SDK and ensure dotnet is available in your shell's PATH.

npx not available

MCP servers configured with npx (such as Context7) will not start if Node.js is not installed.

Fix: install Node.js (LTS recommended). After installation, restart Claude Code so MCP servers can initialize.

Hooks not firing

Hooks are snapshotted when a Claude Code session starts. If you install or update the plugin mid-session, hooks from the new version will not fire until the next session.

Fix: restart Claude Code to pick up hook changes. Use /hooks to verify hooks are registered.

jq not found

The hook scripts use jq to parse JSON input from stdin. If jq is not installed, the hook scripts will fail. The post-edit-dotnet.sh script requires jq for extracting the file_path from tool input.

Fix: install jq via your system package manager.

  • macOS: brew install jq
  • Ubuntu/Debian: sudo apt-get install jq
  • Windows: winget install jqlang.jq

XAML validation unavailable

The XAML well-formedness check requires either xmllint or python3. If neither is available, the hook skips validation and reports a warning.

Fix: install libxml2-utils (for xmllint) or ensure python3 is in your PATH.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Patterns and techniques for evaluating and improving AI agent outputs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Use when user requests research requiring multiple sources, comprehensive analysis, or synthesis across topics - technical research, domain knowledge gathering, market analysis, or learning about complex subjects

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

deep-wiki

무료

AI-powered wiki generation for code repositories with commands, agents, and skills

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Use when building .NET 10 or C# 14 applications; when using minimal APIs, modular monolith patterns, or feature folders; when implementing HTTP resilience, Options pattern, Channels, or validation; when seeing outdated patterns like old extension method syntax

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

Implements accessible .NET UI. SemanticProperties, ARIA, AutomationPeer, testing per platform.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rudironsoni/Synaxis22026년 3월 17일 업데이트

rudironsoni의 스킬 모두 보기

이 스킬의 문제 신고