Community编程与开发github.com

skills-index-snippets

创建并维护 AGENTS.md / CLAUDE.md 中的技能索引片段,将任务路由到正确的 dotnet-skills 技能和智能体(包括压缩的 Vercel 风格索引)。

skills-index-snippets 是什么?

此技能旨在解决 AI 编码助手在大型 .NET 仓库中“记住”并调用正确技能的问题。它通过生成紧凑的索引片段(可放入 AGENTS.md 或 CLAUDE.md),为助手提供一个明确的任务到技能/智能体的路由表。当开发者在仓库中添加、移除或重命名技能或智能体时,应使用此技能来更新这些索引片段,确保助手始终能根据任务类型(如 C# 代码质量、ASP.NET Core、数据访问、测试等)快速定位并调用正确的技能。该技能支持两种格式:一种是可读性较佳、结构清晰的 Markdown 模板,另一种是上下文占用更小的紧凑型 Vercel 风格模板。无论哪种格式,核心都是提供一个轻量级的“路由器”,而非冗长的文档。技能还提供了自动更新 README 中索引块的脚本,以及手动更新后的一系列验证步骤,以保持索引与 .claude-plugin/plugin.json 注册表同步。

兼容平台✓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 工作,优先使用检索导向推理而非预训练。
|flow:{浏览仓库模式 -> 按名称查阅 dotnet-skills -> 实施最小更改 -> 记录冲突}
|route:
|csharp:{modern-csharp-coding-standards,csharp-concurrency-patterns,api-design,type-design-performance}
|aspnetcore-web:{aspire-service-defaults,aspire-integration-testing}
|data:{efcore-patterns,database-performance}
|di-config:{dependency-injection-patterns,microsoft-extensions-configuration}
|testing:{testcontainers-integration-tests,playwright-blazor-testing,snapshot-testing}
|quality-gates:{dotnet-slopwatch(after:大量的新/重构/LLM 代码),crap-analysis(after:在复杂代码中添加/更改测试)}
|agents:{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.

相关技能