service-scaffolder
БесплатноБез исполняемых скриптовНе проверенScaffold a new backend microservice end-to-end — create Abstractions, Core, DataAccess, GraphQL, Host, Worker projects with correct layer dependencies, DI…
от gabrielmoreira★ 23 звезды на GitHubОб этом скилле
Service Scaffolder
Scaffold a complete backend domain microservice following the established project structure and conventions.
Prerequisites: Read
general.instructions.mdfor architecture rules and layer definitions before scaffolding.
Scaffold Workflow
Follow these steps in order. Confirm the service name and scope with the user before starting.
Step 1: Gather Requirements
Ask the user:
- Service name — PascalCase domain name (e.g.,
Consultation,Invoice) - Layers needed — default: all (Abstractions, Core, DataAccess, GraphQL, Host, Worker). Some services skip Worker.
- Database — MongoDB (default), SQL Server, or both
- Messaging — MassTransit consumers needed? (yes/no)
- GraphQL only or REST+GraphQL — default: GraphQL only
Step 2: Create Project Structure
src/{ServiceName}/
├── src/
│ ├── Abstractions/
│ │ └── {ServiceName}.Abstractions.csproj
│ ├── Core/
│ │ └── {ServiceName}.Core.csproj
│ ├── DataAccess/
│ │ └── {ServiceName}.DataAccess.csproj
│ ├── GraphQL/
│ │ └── {ServiceName}.GraphQL.csproj
│ ├── Host/
│ │ └── {ServiceName}.Host.csproj
│ └── Worker/ ← optional
│ └── {ServiceName}.Worker.csproj
└── test/
├── Core.Tests/
│ └── {ServiceName}.Core.Tests.csproj
├── DataAccess.Tests/
│ └── {ServiceName}.DataAccess.Tests.csproj
├── GraphQL.Tests/
│ └── {ServiceName}.GraphQL.Tests.csproj
└── Worker.Tests/ ← if Worker exists
└── {ServiceName}.Worker.Tests.csproj
Step 3: Configure Project References
Follow the dependency rules strictly:
| Project | References |
|---|---|
| Abstractions | None (leaf) |
| Core | → Abstractions |
| DataAccess | → Abstractions, Core |
| GraphQL | → Abstractions, Core |
| Host | → Abstractions, Core, DataAccess, GraphQL |
| Worker | → Abstractions, Core |
| Core.Tests | → Core, Abstractions |
| DataAccess.Tests | → DataAccess, Core, Abstractions |
| GraphQL.Tests | → GraphQL, Core, Abstractions |
Step 4: Abstractions Layer
Create the foundational types:
// Models/{ServiceName}Entity.cs
// TODO: Replace with your organization namespace, e.g., YourOrg.YourProject
namespace YourOrg.YourProject.{ServiceName};
public record {ServiceName}Entity(
ID<{ServiceName}Entity> Id,
string Name);
// Interfaces/I{ServiceName}Repository.cs
// TODO: Replace with your organization namespace, e.g., YourOrg.YourProject
namespace YourOrg.YourProject.{ServiceName};
public interface I{ServiceName}Repository
{
Task<{ServiceName}Entity?> GetByIdAsync(
ID<{ServiceName}Entity> id,
CancellationToken cancellationToken);
}
Step 5: Core Layer
// Services/{ServiceName}Service.cs
// TODO: Replace with your organization namespace, e.g., YourOrg.YourProject
namespace YourOrg.YourProject.{ServiceName};
public sealed class {ServiceName}Service(
I{ServiceName}Repository _repository)
{
public async Task<{ServiceName}Entity?> GetByIdAsync(
ID<{ServiceName}Entity> id,
CancellationToken cancellationToken)
{
return await _repository.GetByIdAsync(id, cancellationToken);
}
}
// DependencyInjection/{ServiceName}CoreServiceCollectionExtensions.cs
namespace Microsoft.Extensions.DependencyInjection;
public static class {ServiceName}CoreServiceCollectionExtensions
{
public static IServiceCollection Add{ServiceName}Core(
this IServiceCollection services)
{
services.AddScoped<{ServiceName}Service>();
return services;
}
}
Step 6: DataAccess Layer (MongoDB)
// Repositories/{ServiceName}Repository.cs
// TODO: Replace with your organization namespace, e.g., YourOrg.YourProject
namespace YourOrg.YourProject.{ServiceName}.DataAccess;
public sealed class {ServiceName}Repository : I{ServiceName}Repository
{
private readonly IMongoCollection<{ServiceName}Entity> _collection;
public {ServiceName}Repository(IMongoDatabase database)
{
_collection = database.GetCollection<{ServiceName}Entity>("{serviceName}s");
}
public async Task<{ServiceName}Entity?> GetByIdAsync(
ID<{ServiceName}Entity> id,
CancellationToken cancellationToken)
{
FilterDefinition<{ServiceName}Entity> filter =
Builders<{ServiceName}Entity>.Filter.Eq(x => x.Id, id);
return await _collection
.Find(filter)
.FirstOrDefaultAsync(cancellationToken);
}
}
// DependencyInjection/{ServiceName}DataAccessServiceCollectionExtensions.cs
namespace Microsoft.Extensions.DependencyInjection;
public static class {ServiceName}DataAccessServiceCollectionExtensions
{
public static IServiceCollection Add{ServiceName}DataAccess(
this IServiceCollection services, IConfiguration configuration)
{
services.AddMongoDataAccess(config
Установить service-scaffolder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл service-scaffolder?
Scaffold a new backend microservice end-to-end — create Abstractions, Core, DataAccess, GraphQL, Host, Worker projects with correct layer dependencies, DI wiring, health checks, and test projects. Triggers on: new service, new microservice, scaffold service, create service, add domain service, new domain, setup service skeleton.
Как установить скилл service-scaffolder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл service-scaffolder запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic