api-scaffolder
/api-scaffolder
Tworzy szkielet nowych projektów API wg wybranej architektury, np. Clean, Hexagonal lub DDD, z wybranym stosem i IDE.
- Autor
- dsaints2344 ↗
- Repozytorium
- api-scaffolder ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 35
- Skrypty
- 5
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 5 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs, evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Payments.Api.AssemblyInfo.cs, evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Pay
Co robi i kiedy
Tworzy szkielet nowych projektów API wg wybranej architektury, np. Clean, Hexagonal lub DDD, z wybranym stosem i IDE.
Oryginalny opis (EN)
Scaffold new API projects, either a standalone microservice repo or a service inside a monorepo, from a named architecture (Clean, Onion, Hexagonal, Vertical Slice, Layered/N-Tier, Modular Monolith, DDD), an optional pattern (CQRS, Mediator, Repository/Unit of Work, Specification, Result, Domain Events, Outbox, Saga, Event Sourcing), a tech stack (.NET, Node/NestJS, Java/Spring, Go, Python or any other) and the target IDE (Visual Studio, Rider, VS Code, Cursor, IntelliJ). Generates the layer folders, projects and references, one sample feature showing the pattern, IDE files, architecture tests
Jak działa
- Workflow
- scaffold.yaml
- Rules
- Stacks without a reference
Podgląd SKILL.md
--- name: api-scaffolder description: Scaffold new API projects, either a standalone microservice repo or a service inside a monorepo, from a named architecture (Clean, Onion, Hexagonal, Vertical Slice, Layered/N-Tier, Modular Monolith, DDD), an optional pattern (CQRS, Mediator, Repository/Unit of Work, Specification, Result, Domain Events, Outbox, Saga, Event Sourcing), a tech stack (.NET, Node/NestJS, Java/Spring, Go, Python or any other) and the target IDE (Visual Studio, Rider, VS Code, Cursor, IntelliJ). Generates the layer folders, projects and references, one sample feature showing the pattern, IDE files, architecture tests, and verifies the build. Use it whenever the user wants to create, bootstrap, scaffold, set up or start a new API, backend, microservice or monorepo service with a given architecture or pattern, even without the word "scaffold", e.g. "spin up a Payments service with clean architecture", "new NestJS hexagonal API", "add an Inventory microservice to our monorepo". --- # API Scaffolder Turns a handful of choices into an API skeleton a team would actually keep: real layers with an enforced dependency rule, one small working feature that shows where everything goes, IDE files for the user's editor, and a green build. Empty folders with a README are not the goal. | Input | Required | Examples | |---|---|---| | Repo mode | yes | `monorepo` (a service inside a shared repo) or `microservice` (standalone repo for one service) | | Name | yes | `Payments` (service), plus the repo name for a new monorepo | | Architecture | yes | clean, onion, hexagonal, vertical-slice, layered, modular-monolith, ddd | | Pattern(s) | no | cqrs, mediator, repository-uow, specification, result, domain-events, outbox, saga, event-sourcing | | Stack | yes | .NET 10 + EF Core + SQL Server · NestJS + Prisma + PostgreSQL · Spring Boot + JPA · Go + pgx · FastAPI + SQLAlchemy | | IDE | yes | Visual Studio, Rider, VS Code, Cursor, IntelliJ IDEA, GoLand, PyCharm | ## Workflow ### 1. Read the target directory Run `bash scripts/detect_repo.sh <target-dir>` from this skill's folder (target defaults to the current directory). Its `verdict:` line says whether the directory is empty, an existing monorepo, a single project, or a parent folder of separate repos (then ask which repo, or create a new folder there). It also reports which repo tooling is present (.NET solution, central package management, Nx, Turborepo, pnpm/npm workspaces, Gradle/Maven multi-module, go.work, uv workspace), existing services, CI, compose files, installed toolchains, and any `scaffold.yaml` files from earlier runs. Why this comes first: in an existing repo, its conventions beat this skill's defaults (folder names, namespaces, solution format, package versions), and earlier `scaffold.yaml` files tell you what the user already chose, so you can reuse those choices instead of asking again. If the script can't run (no bash), do the same checks with Glob/Read. ### 2. Collect the inputs Use everything the user already said and ask only for what's missing, in a single message (use AskUserQuestion when available). Pattern is optional: if the user named none, don't ask, just state in the plan that no pattern is applied. "Same as the other services" means: copy the stack and IDE from an existing `scaffold.yaml`. Map synonyms before looking anything up: "ports and adapters" = hexagonal; "n-tier", "3-layer" = layered; "feature folders", "REPR" = vertical-slice; "DDD" = clean with the DDD domain layout; "MediatR" = mediator (and see licensing in the stack reference); "microservices monorepo" = monorepo mode. Fill stack gaps from the stack reference's defaults and list every default you applied in the plan so the user can override it. Write the plan and the final report in the language the user writes in. ### 3. Load only the references that apply - `references/architectures.md`: the section for the chosen architecture, plus "Mapping layers to a stack" - `references/patterns.md`: the section for each chosen pattern - `references/compatibility.md`: always - `references/repo-modes.md`: the section for the mode (new vs existing monorepo, or microservice) - `references/ides.md`: the section for the IDE - `references/stacks/<stack>.md`: `dotnet.md`, `node-typescript.md`, `java-spring.md`, `go.md`, `python.md`. For any other stack, follow "Stacks without a reference" below. If the user names an architecture or pattern that has no entry, build it from your own knowledge in the same shape as the entries (purpose, layers, dependency rule, tree, sample feature location) and mark it in the plan as "not from the reference, please confirm". ### 4. Check compatibility Check every pairing listed in `compatibility.md` (architecture x pattern, pattern x stack, mode x architecture, stack x IDE, library licensing). A rejection stops the run: explain why and suggest the closest valid combination. A warning goes in the plan; continue once the user accepts it. ### 5. Present the plan and wait for a yes Scaffolding writes dozens of files and edits shared repo files, which is tedious to undo, so show the plan first: ``` ## Scaffold plan: Payments Mode: monorepo (existing; .NET, Platform.slnx, central package management) Architecture: Clean · Patterns: CQRS, Result · IDE: Rider Stack: .NET 10 · Minimal APIs · EF Core + SQL Server · xUnit · NetArchTest Defaults applied: Minimal APIs, data annotations validation, OneOf results Warnings: none services/payments/ ├── src/ │ ├── Payments.Domain/ │ ├── Payments.Application/ │ ├── Payments.Infrastructure/ │ └── Payments.Api/ └── tests/ ... References: Api → Application, Infrastructure (DI only) · Infrastructure → Application · Application → Domain Sample feature: Payments/CreatePayment (command) + GetPaymentById (query) Outside the service folder: Platform.slnx, Directory.Packages.props, .github/workflows/payments.yml, deploy/docker-compose.yml ``` If the user already said "no need to confirm", "just build it", or nobody is there to answer (scheduled or unattended run), go ahead and put the plan at the top of the final report instead. ### 6. Generate, from the inside out 1. **Projects or modules via the stack's official CLI** (`dotnet new`, `nest new`, Spring Initializr, `go mod init`, `uv init`...). The CLI produces current, correct project files and versions; project files written from memory drift (stale SDK versions, renamed packages). 2. **Layer folders and references** following the architecture's tree and dependency rule. 3. **Pattern plumbing** from `patterns.md` (dispatcher, pipeline behaviors, base types, outbox table...). 4. **One sample feature, end to end**, named after the service's domain (Payments gets CreatePayment and GetPaymentById, not WeatherForecast). It is the user's map of where each piece of the architecture and pattern lives. Apply every chosen pattern to it. Delete the CLI's sample code (WeatherForecast, Class1, app.controller samples). 5. **Cross-cutting basics**: health endpoint, OpenAPI document, structured logging, configuration from settings files and environment, and global error handling that returns RFC 7807 ProblemDetails (or the stack's equivalent). 6. **Tests**: unit tests for the sample feature, one integration test that calls the sample endpoint over HTTP, and architecture tests that encode the dependency rule (tool per stack in the stack reference). The architecture tests are what keep the layers honest after a few months of feature work, so treat them as part of the scaffold, not an extra. 7. **IDE files** from `ides.md`. 8. **Repo-mode wiring** from `repo-modes.md`: solution or workspace registration, root config, CI, compose file. 9. **Docs**: the service `README.md` (run, test, layer map, where to add the next feature) and `docs/adr/0001-architecture.md` recording the architecture, patterns, stack and the reasons given. 10. **`scaffold.yaml`** at the service root (format below) so later runs in the same repo can reuse the choices. ### 7. Verify Run the build, the tests and the architecture tests with the commands in the stack reference, and fix until green. If the toolchain isn't installed where you are running, say so plainly and give the user the exact commands to run. Never report a build or test run as passing unless you ran it. ### 8. Report Keep it short: - The plan as executed (tree summary, not a file list) - Verification: build, tests, architecture tests (pass/fail, or "not run" and why) - How to open it in the chosen IDE and run it (one or two commands) - Two or three next steps at most (e.g. "set the connection string with user-secrets", "add the first real aggregate") ## scaffold.yaml ```yaml schemaVersion: 1 name: Payments mode: monorepo # monorepo | microservice architecture: clean patterns: [cqrs, result] ide: rider stack: language: csharp runtime: net10.0 web: minimal-api data: efcore database: sqlserver messaging: none validation: data-annotations tests: [xunit, netarchtest] paths: service: services/payments ``` ## Rules - **Additive only in existing repos.** Never edit another service's files. Outside the new service's folder, touch only registration points (solution or workspace file, central package versions, root compose file, CI config, root README index) and list each one in the plan. - **Existing conventions win** over this skill's defaults: namespace root, services folder name (`services/`, `apps/`, `src/`), solution format, package versions, CI system. - **Never write into a non-empty target folder.** Stop and ask. - **Every dependency earns its place.** Prefer framework built-ins (DI, health checks, ProblemDetails, validation) over extra packages, and check the licensing notes before adding a library. - **No secrets in generated files.** Use placeholders, user-secrets or environment variables, and a `.env.example` where the stack uses `.env` files. ## Stacks without a reference 1. Create projects with the stack's official generator or package manager. 2. Map each layer to the smallest unit the stack can enforce boundaries on: a module/package where the language has one, otherwise a folder plus an import-lint rule. 3. Use the stack's architecture or import-rule testing tool if one exists; otherwise write a test that scans imports and fails on a forbidden direction. 4. Follow the stack's dominant conventions for layout, config and tests, and say in the plan which ones you chose.
Pliki w paczce (35)
- SKILL.md 10 KB
- evals/existing-monorepo-vertical-slice-warning/case.yaml 1 KB
- evals/existing-monorepo-vertical-slice-warning/place-files.sh 1 KB
- evals/existing-monorepo-vertical-slice-warning/prompt.md 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/Directory.Build.props 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/Directory.Packages.props 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/Platform.slnx 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/global.json 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/.github/workflows/payments.yml 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/deploy/docker-compose.yml 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/scaffold.yaml 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/Payments.Api.csproj 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.cs 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Payments.Api.AssemblyInfo.cs 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Payments.Api.AssemblyInfoInputs.cache 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Payments.Api.GeneratedMSBuildEditorConfig.editorconfig 1 KB
- evals/existing-monorepo-vertical-slice-warning/files/services/payments/src/Payments.Api/obj/Debug/net10.0/Payments.Api.GlobalUsings.g.cs 1 KB
- evals/existing-monorepo-vertical-slice-warning/graders/01-expected-output.md 1 KB
- evals/new-dotnet-monorepo-clean-cqrs/case.yaml 1 KB
- evals/new-dotnet-monorepo-clean-cqrs/prompt.md 1 KB
- evals/new-dotnet-monorepo-clean-cqrs/graders/01-expected-output.md 1 KB
- evals/standalone-nestjs-hexagonal/case.yaml 1 KB
- evals/standalone-nestjs-hexagonal/prompt.md 1 KB
- evals/standalone-nestjs-hexagonal/graders/01-expected-output.md 1 KB
- references/architectures.md 10 KB
- references/compatibility.md 3 KB
- references/ides.md 2 KB
- references/patterns.md 6 KB
- references/repo-modes.md 3 KB
- references/stacks/dotnet.md 6 KB
- references/stacks/go.md 2 KB
- references/stacks/java-spring.md 2 KB
- references/stacks/node-typescript.md 3 KB
- references/stacks/python.md 2 KB
- scripts/detect_repo.sh 6 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · dsaints2344/api-scaffolder | 100 | MIT |
| thisiskurubaran/DevSecOps | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki f73b10e3416c (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100clean-architecture-scaffolder
Tworzy szkielet rozwiązania .NET w Clean Architecture lub Vertical Slice: warstwy Domain, Application, Infrastructure i API, CQRS z MediatR oraz dodawanie nowych funkcji, przypadków użycia i wycinków. - 100architecture-unslop
Pozwala wybrać architekturę backendu z objaśnionego menu, zapisuje wybór jako ADR, tworzy szkielet katalogów z przykładem i pilnuje granic. - 100architecture
Projektuje lub przegląda architekturę rozwiązań .NET: modularny monolit, clean architecture, vertical slice, mikroserwisy, DDD, CQRS i granice cloud-native, bez nadmiernej inżynierii. - 100ddd-cqrs-architecture
Prowadzi przez architekturę CQRS: poziomy wdrożenia L1 do L3, Event Sourcing, idempotencja, cykl życia zdarzeń domenowych oraz integracja CQRS z architekturami warstwową, cebulową, heksagonalną, Clean i COLA. - 100architecture-patterns
Wdraża sprawdzone wzorce architektury backendu: Clean Architecture, heksagonalną i DDD, także przy rozbijaniu monolitu i cyklach zależności. - 100nestjs-modular-monolith
Projektuje i wdraża modularne monolity w NestJS z DDD, Clean Architecture i CQRS: konteksty ograniczone, moduły domenowe i komunikacja zdarzeniowa.