Token导航 LogoToken导航

Agent Skill · 前端设计

dotnet-webapi(点网 Web API)

dotnet-webapi 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dotnet-webapi 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 7,705。

总安装 349周安装 15GitHub Stars 公开资料未说明下载 122核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/racar/racar_agent_skills --skill dotnet-webapi

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

该技能提供: ✅ 快速搭建项目脚手架 ✅ CRUD 实体生成 ✅ NuGet 包管理 ✅ Docker 容器化 ✅ .NET 10 最佳实践 ✅ 包括测试设置 ✅ 生产就绪的代码结构 ✅ 全面的文档 立即开始使用 .NET 10 构建现代 Web API!

每周安装量 15 存储库 racar/racar_agent_skills 第一次看到 1 天前 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克通行证

来源仓库内路径:skills/dotnet-webapi

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dotnet-webapi 怎么安装?

在终端执行 npx skills add https://github.com/racar/racar_agent_skills --skill dotnet-webapi。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dotnet-webapi 支持哪些 AI 工具?

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

dotnet-webapi 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dotnet-webapi 是免费的吗?

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

dotnet-webapi 用的人多吗?

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

dotnet-webapi 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

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

前端设计类 Skill 对比

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

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
dotnet-webapi

点网 Web API · 本页

349—需要联网未明确通过

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

SKILL.md 原文

.NET 10 Web API Development

Build production-ready ASP.NET Core Web APIs with.NET 10 using best practices from 2025.

Quick Start

Create a new Web API project:

scripts/new_api.sh <project_name> [output_directory]

Example:

scripts/new_api.sh ProductsApi
cd ProductsApi
dotnet build
dotnet run --project ProductsApi.Api

This creates:

  • Solution with API and Test projects
  • Controller-based Web API (.NET 10)
  • xUnit test project with integration testing setup
  • Proper folder structure (Controllers, Models, Services)
  • .gitignore configured for.NET

Core Features

1. Project Scaffolding

Create New API Project:

scripts/new_api.sh MyApi ./projects

Generates:

  • MyApi.Api - Main API project with controllers
  • MyApi.Tests - xUnit test project with integration testing
  • Solution file linking both projects
  • Standard folder structure
  • Test dependencies (FluentAssertions, WebApplicationFactory)

2. Add CRUD Entities

Generate Entity with Controller and Service:

scripts/add_entity.sh <entity_name> <project_path>

Example:

scripts/add_entity.sh Product ./MyApi
scripts/add_entity.sh Customer ./MyApi

Generates for each entity:

  • Model class (Models/Product.cs)
  • Service interface (Services/IProductService.cs)
  • Service implementation (Services/ProductService.cs)
  • CRUD controller (Controllers/ProductController.cs)
  • Automatic service registration in DI container

API Endpoints Created:

GET    /api/Product        - Get all
GET    /api/Product/{id}   - Get by ID
POST   /api/Product        - Create
PUT    /api/Product/{id}   - Update
DELETE /api/Product/{id}   - Delete

3. Package Management

Add NuGet Packages:

scripts/add_package.sh <project_path> <package_name|preset>

Presets:

# Entity Framework with PostgreSQL
scripts/add_package.sh ./MyApi ef-postgres

# Entity Framework with SQL Server
scripts/add_package.sh ./MyApi ef-sqlserver

# JWT Authentication
scripts/add_package.sh ./MyApi auth

# FluentValidation
scripts/add_package.sh ./MyApi validation

# Individual package
scripts/add_package.sh ./MyApi Newtonsoft.Json

4. Docker Support

Generate Dockerfile and docker-compose:

scripts/generate_dockerfile.sh <project_path>

Example:

scripts/generate_dockerfile.sh ./MyApi

Generates:

  • Multi-stage optimized Dockerfile
  • docker-compose.yml with PostgreSQL
  • .dockerignore
  • Non-root user configuration
  • Health check setup

Build and run:

docker-compose up -d
docker-compose logs -f api

.NET 10 Features

Built-in Features

OpenAPI 3.1 Support:

// Program.cs
builder.Services.AddOpenApi();

if (app.Environment.IsDevelopment())
{
    app.MapOpenApi(); // /openapi/v1.json
}

Automatic Minimal API Validation: DataAnnotations are automatically validated in.NET 10 for Minimal APIs and controllers.

Output Caching:

builder.Services.AddOutputCache();
app.UseOutputCache();

[OutputCache(Duration = 300)]
[HttpGet]
public async Task<IActionResult> GetAll()

Rate Limiting:

builder.Services.AddRateLimiter(options =>
{
    options.AddFixedWindowLimiter("api", config =>
    {
        config.PermitLimit = 100;
        config.Window = TimeSpan.FromMinutes(1);
    });
});

C# 14.0 Features

Use latest C# features:

  • Primary constructors
  • Collection expressions
  • Required members
  • Init-only properties

Development Workflows

Typical Development Flow

  1. Create project: scripts/new_api.sh OrderService cd OrderService
  2. Add entities: scripts/add_entity.sh Order. scripts/add_entity.sh OrderItem.
  3. Add database: scripts/add_package.sh. ef-postgres
  4. Build and run: dotnet build dotnet run --project OrderService.Api
  5. Test: dotnet test
  6. Dockerize: scripts/generate_dockerfile.sh. docker-compose up

Entity Framework Integration

After adding EF packages, configure DbContext:

// Data/ApplicationDbContext.cs
public class ApplicationDbContext : DbContext
{
    public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
        : base(options) { }

    public DbSet<Product> Products => Set<Product>();
}

// Program.cs
builder.Services.AddDbContext<ApplicationDbContext>(options =>
    options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection")));

// appsettings.json
{
  "ConnectionStrings": {
    "DefaultConnection": "Host=localhost;Database=mydb;Username=postgres;Password=postgres"
  }
}

Run migrations:

dotnet ef migrations add Initial --project MyApi.Api
dotnet ef database update --project MyApi.Api

Authentication Setup

After adding auth package:

// Program.cs
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddJwtBearer(options =>
    {
        options.TokenValidationParameters = new TokenValidationParameters
        {
            ValidateIssuer = true,
            ValidateAudience = true,
            ValidateLifetime = true,
            ValidateIssuerSigningKey = true,
            ValidIssuer = builder.Configuration["Jwt:Issuer"],
            ValidAudience = builder.Configuration["Jwt:Audience"],
            IssuerSigningKey = new SymmetricSecurityKey(
                Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"]))
        };
    });

app.UseAuthentication();
app.UseAuthorization();

// Protect endpoints
[Authorize]
[HttpGet("admin")]
public IActionResult AdminOnly() => Ok("Admin data");

Best Practices

Controller Pattern

Generated controllers follow best practices:

[ApiController]
[Route("api/[controller]")]
public class ProductController : ControllerBase
{
    private readonly IProductService _service;
    private readonly ILogger<ProductController> _logger;

    // Constructor injection
    public ProductController(
        IProductService service,
        ILogger<ProductController> logger)
    {
        _service = service;
        _logger = logger;
    }

    // Documented endpoints
    /// <summary>
    /// Get all products
    /// </summary>
    [HttpGet]
    [ProducesResponseType(StatusCodes.Status200OK)]
    public async Task<ActionResult<IEnumerable<Product>>> GetAll()

    // Proper status codes
    [HttpPost]
    [ProducesResponseType(StatusCodes.Status201Created)]
    [ProducesResponseType(StatusCodes.Status400BadRequest)]
    public async Task<ActionResult<Product>> Create(Product entity)
    {
        var created = await _service.CreateAsync(entity);
        return CreatedAtAction(nameof(GetById), new { id = created.Id }, created);
    }
}

Service Layer Pattern

// Interface
public interface IProductService
{
    Task<IEnumerable<Product>> GetAllAsync();
    Task<Product?> GetByIdAsync(int id);
    Task<Product> CreateAsync(Product entity);
    Task<Product?> UpdateAsync(int id, Product entity);
    Task<bool> DeleteAsync(int id);
}

// Implementation with business logic
public class ProductService : IProductService
{
    // In-memory for demo, replace with repository/DbContext
    private readonly List<Product> _entities = new();

    public async Task<Product> CreateAsync(Product entity)
    {
        entity.Id = _nextId++;
        entity.CreatedAt = DateTime.UtcNow;
        _entities.Add(entity);
        return entity;
    }
}

Testing

Generated test projects include integration testing setup:

public class ProductsEndpointTests : IClassFixture<WebApplicationFactory<Program>>
{
    private readonly HttpClient _client;

    public ProductsEndpointTests(WebApplicationFactory<Program> factory)
    {
        _client = factory.CreateClient();
    }

    [Fact]
    public async Task GetAll_ReturnsSuccessStatusCode()
    {
        var response = await _client.GetAsync("/api/products");
        response.EnsureSuccessStatusCode();
    }
}

Run tests:

dotnet test
dotnet test --logger "console;verbosity=detailed"

References

For detailed guidance, see:

API Best Practices

references/api_best_practices.md - Comprehensive guide covering:

  • RESTful API design
  • HTTP status codes
  • Error handling patterns
  • Validation strategies
  • Authentication & authorization
  • Dependency injection
  • Logging best practices
  • Performance optimization
  • OpenAPI documentation

Testing Patterns

references/testing_patterns.md - Testing guide including:

  • xUnit fundamentals
  • Unit testing with Moq
  • Integration testing with WebApplicationFactory
  • Test data builders
  • FluentAssertions usage
  • Common testing patterns

Common Packages

references/common_packages.md - NuGet package guide for:

  • Database providers (EF Core, Dapper)
  • Authentication (JWT, Identity)
  • Validation (FluentValidation)
  • Testing tools (xUnit, Moq, FluentAssertions)
  • Logging (Serilog)
  • Utilities (AutoMapper, MediatR, Polly)

Common Scenarios

Scenario 1: New CRUD API

# Create project
scripts/new_api.sh InventoryApi

# Add entities
scripts/add_entity.sh Product ./InventoryApi
scripts/add_entity.sh Category ./InventoryApi

# Add database
scripts/add_package.sh ./InventoryApi ef-postgres

# Run
cd InventoryApi
dotnet run --project InventoryApi.Api

Scenario 2: Microservice with Docker

# Create and setup
scripts/new_api.sh OrderService
scripts/add_entity.sh Order ./OrderService
scripts/add_package.sh ./OrderService ef-postgres
scripts/generate_dockerfile.sh ./OrderService

# Deploy
cd OrderService
docker-compose up -d

Scenario 3: Authenticated API

scripts/new_api.sh SecureApi
scripts/add_entity.sh User ./SecureApi
scripts/add_package.sh ./SecureApi auth
scripts/add_package.sh ./SecureApi validation

Troubleshooting

.NET SDK Not Found

Ensure.NET 10 SDK is installed:

dotnet --version  # Should be 10.x

Install from: https://dotnet.microsoft.com/download/dotnet/10.0

Port Already in Use

Change port in Properties/launchSettings.json or use environment variable:

ASPNETCORE_HTTP_PORTS=5001 dotnet run --project MyApi.Api

Docker Build Fails

Ensure Docker daemon is running:

docker ps

Check Dockerfile paths match project structure.

EF Migrations Fail

Ensure connection string is correct and database is accessible:

dotnet ef database update --verbose --project MyApi.Api

Integration with Other Skills

Works well with:

  • postgres-query - Query databases created by your API
  • postgres-backup-restore - Restore test data for development
  • ruby-rails - Interop with Rails backends

Summary

This skill provides:

✅ Rapid project scaffolding ✅ CRUD entity generation ✅ NuGet package management ✅ Docker containerization ✅.NET 10 best practices ✅ Testing setup included ✅ Production-ready code structure ✅ Comprehensive documentation

Start building modern Web APIs with.NET 10 today!

平台分布

Codex

36.77%
按下载量换算45

Claude

28.6%
按下载量换算35

Cursor

17.96%
按下载量换算22

Gemini CLI

8.74%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills