Token导航 LogoToken导航

Agent Skill · 研究检索

writing-csharp-code(编写 csharp 代码)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

writing-csharp-code 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 67,439。

总安装 245周安装 10GitHub Stars 86下载 79核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:writing-csharp-code(编写 csharp 代码)
来源仓库:https://github.com/microsoft-foundry/foundry-agent-webapp
仓库路径:skills/writing-csharp-code
安装命令:
npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill writing-csharp-code
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill writing-csharp-code

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。适合让 Agent 提炼结构、补齐章节、统一术语或检查链接。使用时保留项目已有事实和路径,避免写成确定结论。涉及对外文案时需控制语气,防止过度营销或夸大能力。安装方式:通过 GitHub 仓库添加技能。

writing-csharp-code 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/writing-csharp-code

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

writing-csharp-code 怎么安装?

在终端执行 npx skills add https://github.com/microsoft-foundry/foundry-agent-webapp --skill writing-c…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

writing-csharp-code 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

writing-csharp-code 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

writing-csharp-code 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

writing-csharp-code 用的人多吗?

公开数据是累计安装 245 次,近一周安装 10 次,下载 79 次,GitHub 86 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

writing-csharp-code 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
writing-csharp-code

编写 csharp 代码 · 本页

24586操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

C# Coding Standards

Goal: Write clean, secure ASP.NET Core code with proper authentication

Hot Reload Development Workflow

The backend runs in watch mode (dotnet watch run). When you edit C# code:

  1. Save the file -.NET automatically recompiles
  2. Check the terminal - Look for compilation output in the "Backend: ASP.NET Core API" terminal
  3. Verify via console logs - New requests will use updated code immediately

VS Code Tasks (use Run Task command or check terminal panel):

  • Backend: ASP.NET Core API - Runs dotnet watch run with live recompilation
  • Logs are visible directly in VS Code terminal

No restart needed - Just edit, save, and test. Watch for compilation errors in the terminal.

Testing changes: Use Playwright browser tools to make requests and check browser console logs, or call endpoints directly.

Minimal API Patterns

Use typed request models, CancellationToken, and IHostEnvironment:

app.MapPost("/api/endpoint", async (
    RequestModel request,
    MyService service,
    IHostEnvironment env,
    CancellationToken cancellationToken) =>
{
    try
    {
        var result = await service.ProcessAsync(request, cancellationToken);
        return Results.Ok(result);
    }
    catch (Exception ex)
    {
        return ErrorResponseFactory.CreateFromException(ex, env);
    }
})
.RequireAuthorization("RequireChatScope")
.WithName("EndpointName");

Authentication Setup

JWT Bearer with Entra ID:

builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApi(options =>
    {
        builder.Configuration.Bind("AzureAd", options);
        options.TokenValidationParameters.ValidAudiences = new[]
        {
            builder.Configuration["AzureAd:ClientId"],
            $"api://{builder.Configuration["AzureAd:ClientId"]}"
        };
    }, options => builder.Configuration.Bind("AzureAd", options));

Async Best Practices

// ✅ Use async/await with CancellationToken
public async Task<Result> ProcessAsync(Request req, CancellationToken ct)
{
    return await _service.ExecuteAsync(req, ct);
}

// ❌ Never block on async
var result = _service.ExecuteAsync(req).Result;  // WRONG

IAsyncEnumerable for Streaming

public async IAsyncEnumerable<string> StreamAsync(
    string input,
    [EnumeratorCancellation] CancellationToken cancellationToken = default)
{
    await foreach (var chunk in source.WithCancellation(cancellationToken))
    {
        yield return chunk;
    }
}

Credential Strategy

TokenCredential credential = env.IsDevelopment()
    ? new ChainedTokenCredential(
        new AzureCliCredential(),
        new AzureDeveloperCliCredential())  // Supports 'azd auth login'
    : new ManagedIdentityCredential(miClientId); // User-assigned MI in production

Why ChainedTokenCredential: Avoids DefaultAzureCredential's "fail fast" mode issues. Explicit, predictable credential chain.

IDisposable Pattern

public class MyService : IDisposable
{
    private readonly SemaphoreSlim _lock = new(1, 1);
    private readonly CancellationTokenSource _disposeCts = new();
    private bool _disposed;

    public void DoWork()
    {
        ObjectDisposedException.ThrowIf(_disposed, this);
        // ...
    }

    public void Dispose()
    {
        if (_disposed) return;
        _disposed = true;

        // Cancel pending operations first
        try { _disposeCts.Cancel(); }
        catch (ObjectDisposedException) { }

        _disposeCts.Dispose();
        _lock.Dispose();
    }
}

Error Responses (RFC 7807)

Use ErrorResponseFactory.CreateFromException() for consistent error responses.

See: backend/WebApp.Api/Models/ErrorResponse.cs

Common Mistakes

  • ❌ Using .Result or .Wait() on async methods
  • ❌ Forgetting CancellationToken parameter
  • ❌ Missing .RequireAuthorization() on endpoints
  • ❌ Exposing internal errors in production
  • ❌ Forgetting disposal guards in IDisposable

Project-Specific: Middleware Pipeline

Goal: Serve static files → validate auth → route APIs → SPA fallback

app.UseDefaultFiles();     // index.html for /
app.UseStaticFiles();      // wwwroot/* assets
app.UseCors();             // Dev only
app.UseAuthentication();   // Validate JWT
app.UseAuthorization();    // Enforce scope
// Map endpoints here
app.MapFallbackToFile("index.html");  // MUST BE LAST

Project-Specific: AgentFrameworkService

See: backend/WebApp.Api/Services/AgentFrameworkService.cs

SDK Packages:

  • Azure.AI.Projects — Main entry point, v2 Agents API (see *.csproj for version)
  • Azure.AI.Projects.Agents — ProjectsAgentVersion, DeclarativeAgentDefinition, AgentAdministrationClient
  • Azure.AI.Extensions.OpenAI — ProjectOpenAIClient, ProjectConversationsClient, ProjectResponsesClient

Sub-namespaces: Azure.AI.Projects.Agents, Azure.AI.Extensions.OpenAI, OpenAI.Responses

Key patterns:

  • IDisposable implementation
  • Disposal guards (ObjectDisposedException.ThrowIf) in all public methods
  • Environment-aware credential selection (ChainedTokenCredential vs ManagedIdentityCredential vs OnBehalfOfCredential)
  • Static-cached ProjectsAgentVersion resolved once per process via SemaphoreSlim
  • Configuration validation (AI_AGENT_ENDPOINT, AI_AGENT_ID, optional AI_AGENT_VERSION)

Agent Loading (direct SDK):

// Load agent metadata directly from v2 Agents API.
// NOTE: the REST spec has no "latest" keyword — the agent_version path parameter is a
// plain string. To resolve the newest version, enumerate versions in descending order
// and take the first. Pin a specific version by passing its id to GetAgentVersionAsync.
ProjectsAgentVersion? agentVersion = null;
await foreach (var v in projectClient.AgentAdministrationClient.GetAgentVersionsAsync(
    agentName: agentId,
    limit: 1,
    order: AgentListOrder.Descending,
    after: null,
    before: null,
    cancellationToken: ct))
{
    agentVersion = v;
    break;
}

// Access definition for model/instructions/structured inputs
var definition = agentVersion?.Definition as DeclarativeAgentDefinition;

Streaming (direct ProjectResponsesClient — required for specialized types):

// Direct SDK for streaming — IChatClient doesn't expose MCP/annotations.
// Pin to the resolved agentVersion.Version so streaming and metadata stay in sync.
ProjectResponsesClient responsesClient = projectClient.ProjectOpenAIClient.GetProjectResponsesClientForAgent(
    new AgentReference(agentId, agentVersion.Version), conversationId);

Why direct streaming? The IChatClient abstraction doesn't expose:

  • McpToolCallApprovalRequestItem for MCP approval flows
  • FileSearchCallResponseItem for file search quotes
  • MessageResponseItem.OutputTextAnnotations for citations

Streaming Pattern: Returns IAsyncEnumerable<StreamChunk> where StreamChunk contains either:

  • Text delta (chunk.IsText, chunk.TextDelta)
  • Annotations/citations (chunk.HasAnnotations, chunk.Annotations)

Streaming Response Types (from OpenAI.Responses):

  • StreamingResponseOutputTextDeltaUpdate - Text content delta
  • StreamingResponseOutputItemDoneUpdate - Item completion (has annotations)
  • StreamingResponseCompletedUpdate - Response completion with usage stats

Image Validation (in BuildUserMessage()):

  • Maximum 5 images per request
  • Maximum 5MB per image (decoded size)
  • Allowed: image/png, image/jpeg, image/gif, image/webp
  • Returns HTTP 400 with validation details if constraints violated

Annotation Types (from OpenAI.Responses):

  • UriCitationMessageAnnotation - Bing, Azure AI Search, SharePoint
  • FileCitationMessageAnnotation - File search (vector stores)
  • FilePathMessageAnnotation - Code interpreter output
  • ContainerFileCitationMessageAnnotation - Container file citations

Starter Prompts: Parsed from agent metadata (starterPrompts key, newline-separated).

Project-Specific: Configuration Loading

Auto-load .env file before building configuration:

var envFile = Path.Combine(Directory.GetCurrentDirectory(), ".env");
if (File.Exists(envFile))
{
    foreach (var line in File.ReadAllLines(envFile)
        .Where(l => !string.IsNullOrWhiteSpace(l) && !l.StartsWith("#")))
    {
        var parts = line.Split('=', 2);
        if (parts.Length == 2)
            Environment.SetEnvironmentVariable(parts[0].Trim(), parts[1].Trim());
    }
}

Troubleshooting SDK Issues

When things break: SDK type mismatches and missing methods almost always happen after a package upgrade. Check backend/WebApp.Api/WebApp.Api.csproj for current versions:

  • Azure.AI.Projects - check WebApp.Api.csproj for current version
  • Azure.Identity - check WebApp.Api.csproj for current version

If types don't match documentation or samples, verify you're looking at docs for the same version installed in the project.

GitHub SDK Source (For Deep Dives)

When you need to understand SDK internals, fetch the actual source:

Quick Structure Checks (CLI)

For project-level overviews only—use sparingly:

# List public types in backend (overview, not deep exploration)
Get-ChildItem -Path backend -Recurse -Include *.cs |
    Select-String -Pattern "^\s*(public|internal)\s+(class|record|interface)\s+(\w+)" |
    ForEach-Object { $_.Matches.Groups[3].Value } | Sort-Object -Unique

# Find IDisposable implementations
Get-ChildItem -Path backend -Recurse -Include *.cs |
    Select-String -Pattern ":\s*.*IDisposable"

Use for: Quick inventory of what exists. Follow up with pattern search or IDE navigation for understanding.

PowerShell Reflection for.NET Assemblies

Use when you need to discover exact type members on any.NET assembly (especially beta SDKs):

# 1. Build first to ensure DLLs are current
cd backend/WebApp.Api; dotnet build --no-restore

# 2. Find and load any assembly by name
$dll = Get-ChildItem -Path "bin/Debug" -Recurse -Filter "SomePackage.dll" | Select-Object -First 1
$asm = [System.Reflection.Assembly]::LoadFrom($dll.FullName)

# 3. Inspect a specific type's properties
$type = $asm.GetType("SomeNamespace.SomeClass")
Write-Host "Type: $($type.FullName)"
Write-Host "Assembly: $($asm.GetName().Name) v$($asm.GetName().Version)"
$type.GetProperties() | ForEach-Object { Write-Host "  $($_.PropertyType.Name) $($_.Name)" }

# 4. Check base type for inherited members
Write-Host "Base: $($type.BaseType.Name)"
$type.BaseType.GetProperties() | ForEach-Object { Write-Host "    $($_.PropertyType.Name) $($_.Name)" }

Finding types by pattern (when you don't know exact namespace):

# Search for types matching a pattern
$asm.GetTypes() | Where-Object { $_.Name -like "*Response*" } | ForEach-Object { Write-Host $_.FullName }

# Find methods on a type
$type.GetMethods() | Where-Object { $_.Name -like "*Async*" } | Select-Object Name, ReturnType

Common assemblies to inspect (after dotnet build):

AssemblyPathContains
Azure.AI.Projects.dllbin/Debug/net10.0/AIProjectClient, AgentReference
Azure.AI.Projects.Agents.dllbin/Debug/net10.0/AgentAdministrationClient, ProjectsAgentVersion, DeclarativeAgentDefinition
Azure.AI.Extensions.OpenAI.dllbin/Debug/net10.0/ProjectOpenAIClient, ProjectConversationsClient, ProjectResponsesClient
OpenAI.dllbin/Debug/net10.0/ResponseItem, StreamingResponse*, annotations
Azure.Identity.dllbin/Debug/net10.0/Credential types

When to use: Beta SDK properties aren't in docs, IDE tooltips are incomplete, or you need to verify a type's actual API surface.

Limitation: Returns raw API surface without intent or usage guidance. Combine with GitHub source for context.

Related Skills

  • implementing-chat-streaming - SSE streaming patterns and backend endpoint implementation
  • troubleshooting-authentication - MSAL/JWT debugging for 401 errors
  • researching-azure-ai-sdk - SDK research workflow and sample repositories

平台分布

Codex

35.72%
按下载量换算28

Claude

32.24%
按下载量换算25

Cursor

16.85%
按下载量换算13

Gemini CLI

9.12%
按下载量换算7

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills