Community程式設計與開發github.com

知識庫發布流程

說明如何將技能與代理程式發布至 dotnet-skills Claude Code 知識庫,包含新增內容、更新 plugin.json、驗證及發布標籤。

知識庫發布流程 是什麼?

此技能詳細說明向 dotnet-skills Claude Code 知識庫發布技能與代理程式的完整工作流程。其目的在於建立標準化、可重複的發布程序,涵蓋從新增技能或代理程式、更新 .claude-plugin/plugin.json 中的註冊資訊、執行 validate-marketplace.sh 進行驗證,到最終透過語意化版本號與 GitHub Actions 自動建立 Release 的完整步驟。此技能適用於任何需要貢獻或更新 dotnet-skills 知識庫內容的開發者與維運人員,支援的技能類別包含 akka、aspire、csharp、testing 與 meta 等領域。使用此技能時,使用者應遵循六步驟流程:選擇類別、建立技能資料夾、編寫符合格式規範的 SKILL.md、在 plugin.json 中註冊路徑、執行驗證腳本、最後將所有變更一同提交。對於代理程式,則需在 agents 資料夾中建立 .md 檔案,並同樣於 plugin.json 中註冊。整個發布流程以標籤驅動,當推送符合語意化版本的標籤(如 v1.1.0)時,GitHub Actions 會自動驗證結構並建立 Release。

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

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

在你喜歡的 AI 中提問

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

說明文件

知識庫發布工作流程

此技能說明如何將技能與代理程式發布至 dotnet-skills Claude Code 知識庫。

儲存庫結構

dotnet-skills/
├── .claude-plugin/
│   ├── marketplace.json      # 知識庫目錄
│   └── plugin.json           # 外掛程式元資料 + 技能/代理程式註冊
├── .github/workflows/
│   └── release.yml           # 發布自動化
├── skills/
│   ├── akka/                 # Akka.NET 技能
│   │   ├── best-practices/SKILL.md
│   │   ├── testing-patterns/SKILL.md
│   │   └── ...
│   ├── aspire/               # .NET Aspire 技能
│   ├── csharp/               # C# 語言技能
│   ├── testing/              # 測試框架技能
│   └── meta/                 # 後設技能
├── agents/
│   └── *.md                  # 代理程式定義
└── scripts/
    └── validate-marketplace.sh

新增技能

步驟 1:選擇類別

技能依領域分類:

類別用途
akka/Akka.NET 角色模式、測試、叢集
aspire/.NET Aspire 協調、測試、設定
csharp/C# 語言功能、編碼標準
testing/測試框架 (xUnit、Playwright、Testcontainers)
meta/關於此知識庫的後設技能

如果沒有適合的類別,可建立新的類別資料夾。

步驟 2:建立技能資料夾

在資料夾中建立包含 SKILL.md 的目錄:

skills/<類別>/<技能名稱>/SKILL.md

範例:skills/akka/cluster-sharding/SKILL.md

步驟 3:編寫 SKILL.md

---
name: my-new-skill
description: 此技能功能的簡短說明及其使用時機。
---

# 我的新技能

## 使用時機

在以下情況使用此技能:
- [列出特定情境]

---

## 內容

[包含範例、模式與反模式的全面指南]

要求:

  • name 必須為小寫並使用連字號(例如 cluster-sharding)
  • description 應為 1-2 句,說明 Claude 應在何時使用此技能
  • 內容應為 10-40KB,涵蓋該主題的全面資訊
  • 包含具體的程式碼範例,使用現代 C# 模式

步驟 4:在 plugin.json 中註冊

將技能路徑新增至 .claude-plugin/plugin.json 的 skills 陣列:

{
  "skills": [
    "./skills/akka/best-practices",
    "./skills/akka/cluster-sharding"  // 在此新增技能
  ]
}

步驟 5:驗證

執行驗證腳本:

./scripts/validate-marketplace.sh

步驟 6:一起提交

git add skills/akka/cluster-sharding/ .claude-plugin/plugin.json
git commit -m "新增 Akka.NET 叢集分片模式的 cluster-sharding 技能"

新增代理程式

步驟 1:建立代理程式檔案

在 /agents/ 中建立 markdown 檔案:

---
name: my-agent-name
description: [領域]專家。專精於[特定領域]。用於[情境]。
model: sonnet
color: blue
---

您是[領域]專家,在[領域]方面擁有深厚專業知識。

**參考資料:**
- [官方文件與資源]

**核心專業領域:**
[列出專業領域]

**診斷方法:**
[代理程式如何分析問題]

要求:

  • name 必須為小寫並使用連字號
  • model 必須為下列之一:haiku、sonnet、opus
  • color 為選填(用於 UI 顯示)

步驟 2:在 plugin.json 中註冊

新增至 agents 陣列:

{
  "agents": [
    "./agents/akka-net-specialist",
    "./agents/my-agent-name"  // 在此新增代理程式
  ]
}

步驟 3:一起提交

git add agents/my-agent-name.md .claude-plugin/plugin.json
git commit -m "新增 my-agent-name 代理程式,用於[領域]專業知識"

發布版本

版本管理

更新 .claude-plugin/plugin.json 中的版本號:

{
  "version": "1.1.0"
}

使用語意化版本號 (MAJOR.MINOR.PATCH):

  • MAJOR:重大變更(重新命名/移除技能)
  • MINOR:新增技能或代理程式
  • PATCH:修正或改進現有內容

發布流程

  1. 更新 plugin.json 中的版本號

  2. 驗證

    ./scripts/validate-marketplace.sh
    
  3. 提交版本變更

    git add .claude-plugin/plugin.json
    git commit -m "版本提升至 1.1.0"
    
  4. 建立並推送標籤

    git tag v1.1.0
    git push origin master --tags
    
  5. GitHub Actions 將自動:

    • 驗證知識庫結構
    • 建立包含自動產生說明的 GitHub Release

使用者安裝

使用者安裝完整的外掛程式(包含所有技能與代理程式):

# 新增知識庫(一次性操作)
/plugin marketplace add Aaronontheweb/dotnet-skills

# 安裝外掛程式(取得全部內容)
/plugin install dotnet-skills

# 更新至最新版本
/plugin marketplace update

驗證檢查清單

提交前請確認:

  • SKILL.md 包含有效的 YAML 前置資料,內有 name 與 description
  • 技能資料夾位於正確的類別下
  • 路徑已新增至 plugin.json 的 skills 陣列
  • 對於代理程式:已指定 model(haiku/sonnet/opus)
  • ./scripts/validate-marketplace.sh 執行成功

疑難排解

安裝後技能未出現

  • 確認 plugin.json 中的路徑與資料夾結構相符
  • 檢查資料夾中是否存在 SKILL.md
  • 嘗試重新安裝:/plugin uninstall dotnet-skills && /plugin install dotnet-skills

驗證錯誤

  • 確保 JSON 有效:jq . .claude-plugin/plugin.json
  • 檢查陣列中是否有結尾逗號
  • 確認所有參考的資料夾都包含 SKILL.md

未建立 Release

  • 確保標籤遵循 semver 格式(v1.0.0)
  • 檢查 GitHub Actions 日誌中的錯誤
  • 確認 plugin.json 中的版本號與標籤一致

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.

相關技能