Community程式設計與開發github.com

技能索引片段 (skills-index-snippets)

建立與維護 AGENTS.md / CLAUDE.md 片段索引,將任務路由至正確的 dotnet-skills 技能與代理(包含類似 Vercel 風格的壓縮索引)。

技能索引片段 (skills-index-snippets) 是什麼?

這個技能(skills-index-snippets)旨在為 AI 編碼助手(如 Claude Code、OpenCode、Cursor 等)創建簡潔的任務路由索引,幫助它們更有效地利用 dotnet-skills 儲存庫中的專業技能和代理。核心目標是消除編碼助手「猜測」要調用哪個技能的決策點,透過在 AGENTS.md 或 CLAUDE.md 中提供一個小型路由器片段,明確指示助手應優先使用基於檢索的推理,並根據任務類型(如 C# 開發、ASP.NET Core、資料訪問、測試等)映射到對應的技能 ID。該技能支援兩種片段格式:可讀格式和 Vercel 風格的壓縮格式(後者可大幅節省上下文窗口)。來源的真實性來自 .claude-plugin/plugin.json 清單,每個技能和代理的唯一 ID 由其 SKILL.md 或代理 markdown 文件的前置元數據定義。它可以透過執行 ./scripts/generate-skill-index-snippets.sh --update-readme 指令,自動更新 README 中夾帶於特定標記之間的片段。

相容平台✓Claude Code~Codex CLI~Cursor✓OpenCode
npx skills add https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/skills-index-snippets

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

維護技能索引片段 (AGENTS.md / CLAUDE.md)

使用時機

在以下情況使用此技能:

  • 在此儲存庫中新增、移除或重新命名任何技能或代理時
  • 更新 .claude-plugin/plugin.json 時
  • 為下游儲存庫(OpenCode、Claude Code 等)建立複製/貼上片段時
  • 您想要一個緊湊、始終啟用、能提升技能使用率的索引時

目標

透過消除決策點,讓編碼助手更容易使用技能和代理。

與其期望助手「記得」去調用某個技能,不如在 AGENTS.md / CLAUDE.md 中提供一個小型路由器片段,該片段:

  1. 告訴助手優先採用基於檢索的推理
  2. 提供任務 -> 技能/代理 的路由索引
  3. 定義輕量級的品質閘門(可選)

資料來源

  • 註冊表:.claude-plugin/plugin.json
    • 技能列為目錄(每個目錄包含 SKILL.md)
    • 代理列為 agents/ 下的 Markdown 檔案
  • 技能 ID:每個 SKILL.md 前置元數據中的 name: 欄位
  • 代理 ID:每個代理前置元數據中的 name: 欄位

為下游儲存庫編寫片段時,請始終使用技能/代理的 ID(前置元數據中的 name),而不是本地檔案系統路徑。

最小化片段模板(可讀版本)

在目標儲存庫中使用此模板來路由常見任務:

# 代理指導:dotnet-skills

重要:對於任何 .NET 工作,優先採用基於檢索的推理而非預訓練。
工作流程:掃描儲存庫模式 -> 依名稱查詢 dotnet-skills -> 實施最小變更 -> 記錄衝突。

路由(依名稱調用)
- C# / 程式碼品質:modern-csharp-coding-standards, csharp-concurrency-patterns, api-design, type-design-performance
- ASP.NET Core / Web(含 Aspire):aspire-service-defaults, aspire-integration-testing
- 資料:efcore-patterns, database-performance
- DI / 設定:dependency-injection-patterns, microsoft-extensions-configuration
- 測試:testcontainers-integration-tests, playwright-blazor-testing, snapshot-testing

品質閘門(適用時使用)
- dotnet-slopwatch:在進行大量新增/重構/LLM 編寫程式碼後
- crap-analysis:在複雜程式碼中新增/修改測試後

專家代理
- dotnet-concurrency-specialist, dotnet-performance-analyst, dotnet-benchmark-designer, akka-net-specialist, docfx-specialist

壓縮片段模板(Vercel 風格)

在您想要最大密度(小上下文佔用)時使用此模板:

[dotnet-skills]|重要:對於任何 .NET 工作,優先採用基於檢索的推理而非預訓練。
|流程:{掃描儲存庫模式 -> 依名稱查詢 dotnet-skills -> 實施最小變更 -> 記錄衝突}
|路由:
|csharp:{modern-csharp-coding-standards,csharp-concurrency-patterns,api-design,type-design-performance}
|aspnetcore-web:{aspire-service-defaults,aspire-integration-testing}
|資料:{efcore-patterns,database-performance}
|di-config:{dependency-injection-patterns,microsoft-extensions-configuration}
|測試:{testcontainers-integration-tests,playwright-blazor-testing,snapshot-testing}
|品質閘門:{dotnet-slopwatch(在:大量新增/重構/LLM 程式碼後),crap-analysis(在:複雜程式碼中新增/修改測試後)}
|代理:{dotnet-concurrency-specialist,dotnet-performance-analyst,dotnet-benchmark-designer,akka-net-specialist,docfx-specialist}

重新產生 README 區塊

如果 README 包含以下標記,產生器可以自動更新它:

<!-- BEGIN DOTNET-SKILLS COMPRESSED INDEX -->
...壓縮片段...
<!-- END DOTNET-SKILLS COMPRESSED INDEX -->

執行:

./scripts/generate-skill-index-snippets.sh --update-readme

如何在技能變更後更新片段

  1. 更新 .claude-plugin/plugin.json 以包含/移除技能和代理。
  2. 確保每個技能都有正確的前置元數據 name:(OpenCode 和其他工具使用此名稱)。
  3. 執行 ./scripts/validate-marketplace.sh。
  4. 更新您的片段路由列表:
    • 將新技能新增到正確的類別
    • 移除已刪除的技能
    • 保持名稱與前置元數據 ID 完全一致
  5. 如果您維護了下游的 AGENTS.md/CLAUDE.md 片段,請重新產生並重新複製到依賴的儲存庫中。

建議類別

以下是片段類別(不一定是儲存庫的資料夾結構):

  • C# / 程式碼品質
  • ASP.NET Core / Web(含 Aspire)
  • 資料
  • DI / 設定
  • 測試
  • 品質閘門
  • 專家代理

保持片段精簡;它應該是路由器,而不是文件。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

akka-hosting-actor-patterns

Patterns for building entity actors with Akka.Hosting - GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. Supports both local testing and clustered production modes.

akka-net-aspire-configuration

Configure Akka.NET with .NET Aspire for local development and production deployments. Covers actor system setup, clustering, persistence, Akka.Management integration, and Aspire orchestration patterns.

akka-net-best-practices

Critical Akka.NET best practices including EventStream vs DistributedPubSub, supervision strategies, error handling, Props vs DependencyResolver, work distribution patterns, and cluster/local mode abstractions for testability.

akka-net-management

Akka.Management for cluster bootstrapping, service discovery (Kubernetes, Azure, Config), health checks, and dynamic cluster formation without static seed nodes.

akka-net-testing-patterns

Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.

api-design

Design stable, compatible public APIs using extend-only design principles. Manage API compatibility, wire compatibility, and versioning for NuGet packages and distributed systems.

aspire-configuration

Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.

aspire-integration-testing

Write integration tests using .NET Aspire

aspire-service-defaults

Create a shared ServiceDefaults project for Aspire applications. Centralizes OpenTelemetry, health checks, resilience, and service discovery configuration across all services.

crap-analysis

Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code. Use OpenCover format with ReportGenerator for Risk Hotspots showing cyclomatic complexity and untested code paths.

csharp-concurrency-patterns

Choosing the right concurrency abstraction in .NET - from async/await for I/O to Channels for producer/consumer to Akka.NET for stateful entity management. Avoid locks and manual synchronization unless absolutely necessary.

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

dependency-injection-patterns

Organize DI registrations using IServiceCollection extension methods. Group related services into composable Add* methods for clean Program.cs and reusable configuration in tests.

dotnet-devcert-trust

Diagnose and fix .NET HTTPS dev certificate trust issues on Linux. Covers the full certificate lifecycle from generation to system CA bundle inclusion, with distro-specific guidance for Ubuntu, Fedora, Arch, and WSL2.

dotnet-local-tools

Managing local .NET tools with dotnet-tools.json for consistent tooling across development environments and CI/CD pipelines.

dotnet-project-structure

Modern .NET project structure including .slnx solution format, Directory.Build.props, central package management, SourceLink, version management with RELEASE_NOTES.md, and SDK pinning with global.json.

dotnet-slopwatch

Use Slopwatch to detect LLM reward hacking in .NET code changes. Run after every code modification to catch disabled tests, suppressed warnings, empty catch blocks, and other shortcuts that mask real problems.

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

ilspy-decompile

Understand implementation details of .NET code by decompiling assemblies. Use when you want to see how a .NET API works internally, inspect NuGet package source, view framework implementation, or understand compiled .NET binaries.

mailpit-integration

Test email sending locally using Mailpit with .NET Aspire. Captures all outgoing emails without sending them. View rendered HTML, inspect headers, and verify delivery in integration tests.

相關技能