Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group…

MITAuto-check passedDevelopment

Install Add Slice

skills CLI
$ npx skills add SSWConsulting/SSW.VerticalSliceArchitecture --skill add-slice -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SSWConsulting/SSW.VerticalSliceArchitecture add-slice --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SSWConsulting/SSW.VerticalSliceArchitecture.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/add-slice .claude/skills/add-slice && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
add-slice
GitHub stars
407
Token cost
~2.3k tokens
SKILL.md length
1,159 words
Files
4 (incl. references)
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group…

  • Works in 5 steps: Feature scaffolding — only when this is… → Slice folder —… → The five files — endpoint, request,… → …
  • The user says add a slice
  • SKILL.md covers Read the live reference first, What you need to know before…, Steps and What CI enforces, plus 4 more sections
  • Calls dotnet

What it does

Add Slice is an agent skill from SSWConsulting/SSW.VerticalSliceArchitecture. Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group if they don't exist yet, plus tests. Use when the user says "add a slice", "add a use case", "add an endpoint", "add a command", "add a query", "expose X over the API", or names a use case such as "let users archive a team". Run /add-entity first if the use case needs a domain type that doesn't exist yet.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/command-slice.md`, `references/query-slice.md` and `references/tests.md`).

It sits in Development. The repository describes itself as: An enterprise ready solution template for Vertical Slice Architecture. This template is just one way to apply the Vertical Slice Architecture. The licence is MIT.

When your agent uses it

  • The user says add a slice
  • Add an endpoint
  • Expose X over the API
  • Names a use case such as let users archive a team

Example prompts

  • “t exist yet, plus tests. Use when the user says”
  • “add a use case”
  • “add an endpoint”
  • “/add-slice”

Requirements

  • Docker

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Feature scaffolding — only when this is the Feature's first slice: create src/WebApi/Features/{Feature}/ and add {Feature}Group.cs. Skip…
  2. Slice folder — src/WebApi/Features/{Feature}/{UseCase}/, namespace mirroring the folder. The endpoint has to sit exactly two segments…
  3. The five files — endpoint, request, response, validator, summary. One type per file, even when a file is three lines; they grow. A query…
  4. Event-triggered slice — when the use case reacts to a domain event rather than a request, the slice holds an IEventHandler instead of an…
  5. Tests — an integration test per slice, plus unit tests for any domain behaviour the slice added. Template: references/tests.md.

What it can do on your machine

Read from SKILL.md and the folder at commit 42e7a70. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Add Slice loads about 2.3k tokens when it runs, and up to ~9.6k if it reads all its reference files. Until then it costs about 129 tokens; SKILL.md has 1,159 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from SSWConsulting/SSW.VerticalSliceArchitecture at commit 42e7a70, republished under its MIT licence (© SSWConsulting). 1,159 words, ~2,309 tokens.

Download SKILL.mdSave it as .claude/skills/add-slice/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
add-slice
description
Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group if they don't exist yet, plus tests. Use when the user says "add a slice", "add a use case", "add an endpoint", "add a command", "add a query", "expose X over the API", or names a use case such as "let users archive a team". Run `/add-entity` first if the use case needs a domain type that doesn't exist yet.

Add a Slice

A slice is one use case, owning everything it needs from HTTP surface to persistence, in its own folder. CreateHero is a slice. A Feature is the group of slices over the same aggregate, sharing a route prefix — Heroes is a Feature, and it is not itself a slice. CONTEXT.md at the repo root defines both, along with Group, Endpoint, and the rest of the vocabulary. Use those words, and avoid the ones it lists under Avoid.

This skill adds a slice. It creates the Feature and its Group too, but only when the slice is the first one in that Feature.

Not every slice is HTTP. PowerLevelUpdated is a slice triggered by a domain event rather than a request — the same folder-per-use-case shape, with an event handler in place of an endpoint.

Read the live reference first

  • src/WebApi/Features/Heroes/CreateHero/ — the canonical command slice, all five files
  • src/WebApi/Features/Heroes/GetAllHeroes/ — a paged, sorted list query
  • src/WebApi/Features/Teams/GetTeam/ — a single-item query with a route parameter
  • src/WebApi/Features/Teams/AddHeroToTeam/ — a command that loads aggregates through specs
  • src/WebApi/Features/Teams/PowerLevelUpdated/ — an event-triggered slice

The templates in references/ follow these. If they disagree, the repo wins — follow it and fix the template.

What you need to know before scaffolding

InputNotes
FeatureThe plural noun that owns the route prefix (Heroes, Teams). Does one already exist for this aggregate, or is this its first slice?
Use caseVerb + noun, PascalCase (CreateHero, ArchiveTeam). This names the slice folder, the endpoint, and the OpenAPI operation ID.
Command or queryA command mutates and returns 200 with an ID or 204; a query reads and projects.
HTTP verb and routeRelative to the Group prefix — Post("/") becomes POST /api/heroes.
Request shapeBody fields plus any route parameters. FastEndpoints binds both into one request record.
Response shapeOr none, for a 204.
Failure modesNot found, conflict, forbidden — each needs a Produces(...) and a matching Send.*Async.

Ask about anything not stated. Guessing a route or a verb produces a slice that compiles and is wrong.

Steps

  1. Feature scaffolding — only when this is the Feature's first slice: create src/WebApi/Features/{Feature}/ and add {Feature}Group.cs. Skip {Feature}Feature.cs unless the Feature registers its own services; most don't, and an empty one is noise. Template: references/command-slice.md.
  2. Slice folder — src/WebApi/Features/{Feature}/{UseCase}/, namespace mirroring the folder. The endpoint has to sit exactly two segments below Features — one for the Feature, one for the use case — or the architecture tests fail.
  3. The five files — endpoint, request, response, validator, summary. One type per file, even when a file is three lines; they grow. A query with no input skips the request and validator; a list query is never one of those, because every list endpoint takes paging and sorting parameters. A command returning 204 skips the response.
  4. Event-triggered slice — when the use case reacts to a domain event rather than a request, the slice holds an IEventHandler<TEvent> instead of an endpoint: src/WebApi/Features/{Feature}/{Event}/{Event}EventHandler.cs. It belongs to the Feature that consumes the event, not the one that raises it.
  5. Tests — an integration test per slice, plus unit tests for any domain behaviour the slice added. Template: references/tests.md.

What CI enforces

tests/WebApi.ArchitectureTests/FeatureTests.cs turns five of these into build failures rather than review comments:

  • Endpoints are named *Endpoint and live in a slice namespace — exactly two segments below Features. A slice folder nested deeper or shallower fails.
  • Every endpoint with a request has a Validator<TRequest> in the same slice. Not a shared one and not a bare AbstractValidator — FastEndpoints only binds validators derived from its own Validator<T>, and the test matches that base. An endpoint whose request type can't be read fails too, so derive from Endpoint<TRequest, TResponse> or one of its aliases.
  • A PagedRequest needs a PagedRequestValidator<TRequest, TEntity>, not merely some Validator<TRequest>. The sort allow-list rules live in that base class, and the primitives throw on an unknown sort column rather than returning a 400 — so a bare validator would turn a documented 400 into a 500 with every other test still green.
  • No slice depends on another slice. This is the rule that makes it Vertical Slice Architecture rather than layers in disguise.
  • Endpoints take ApplicationDbContext — not the DbContext base type, and not a second DbContext. The check reads IL, so Resolve<T>() and handler-method injection are caught as well as constructor parameters.

Run them with dotnet test tests/WebApi.ArchitectureTests. A failure here means the code broke a rule; fix the code, not the test.

Show full SKILL.md (423 more words)Show less

The checklist that catches the silent failures

These all compile, and no test catches them.

  • Group<{Feature}Group>() in Configure(). Without it the endpoint registers at the root instead of under /api/{prefix}, and it loses the Group's tag and its ProducesProblemDetails(500).
  • Description(x => x.WithName("{UseCase}")). This is the OpenAPI operation ID, so it's what generated clients name the method. Missing, and callers get a mangled auto-generated name.
  • await Send.*Async(...), never a bare return. Returning from HandleAsync without sending produces a 200 with an empty body. Every path out ends in a Send.
  • return after Send.NotFoundAsync(ct). Send doesn't stop execution — HandleAsync carries on and will try to send twice.
  • A Produces(...) for every non-200 path you send. The status code has to be in the OpenAPI document or clients won't handle it.
  • Business rules in the aggregate, not the endpoint. If HandleAsync contains an if about domain state, that check belongs on the entity, returning ErrorOr<Success>.
  • Load the child collections before mutating. Only HasMany navigations need this — owned collections (OwnsMany(...).ToJson(), like Hero.Powers) always come with their parent. For a HasMany, either call a spec factory that declares the Includes (TeamSpec.ById does; HeroSpec.ById declares none) or .Include(...) explicitly. With neither, the children arrive silently empty.

Verification

bash
dotnet build && dotnet build -c Release
dotnet test tests/WebApi.UnitTests tests/WebApi.ArchitectureTests
dotnet test tests/WebApi.IntegrationTests    # needs Docker or Podman running

Then exercise it for real — a green test suite doesn't prove the route is where you think it is. Boot with aspire start --isolated (see the aspire skill), wait for the WebApi resource to go healthy, and call the endpoint through https://localhost:7255/swagger or curl. Confirm the success path and at least one failure path, and check the route appears under the expected prefix.

Full detail: .claude/rules/verification.md.

Guardrails

  • Don't add a {Feature}Feature.cs with an empty ConfigureServices. Add it when the Feature actually has services to register.
  • Don't put a DTO in a shared folder so two slices can use it. Duplication between slices is the design, not a smell — it's what lets one slice change without breaking another, and Slices_Should_NotDependOnOtherSlices enforces it.
  • Don't return IActionResult or use MVC attributes. This is FastEndpoints; see docs/adr/20251018-api-use-fastendpoints-instead-of-minimal-apis.md.
  • Don't validate inside HandleAsync for anything the validator can express. The validator runs first and auto-returns 400. ThrowError("...") is for the ad-hoc case that needs context only HandleAsync has.
  • Don't touch another Feature's folder. If the use case needs data from another aggregate, load it through that aggregate's spec — that's what AddHeroToTeam does.

Keeping this skill honest

The references/ templates are copies of the repo's shapes and will drift. When you find one that no longer matches the Heroes or Teams slices, update it as part of the same change.

© SSWConsulting, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in .claude/skills/add-slice of SSWConsulting/SSW.VerticalSliceArchitecture.

  • SKILL.md
  • references/command-slice.md
  • references/query-slice.md
  • references/tests.md

Open the folder on GitHubat commit 42e7a70

Compare with similar skills

Add Slice next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Add Slice compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Add Slice this skillSSWConsulting/SSW.VerticalSliceArchitecture407—~2.3kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from SSWConsulting/SSW.VerticalSliceArchitecture

  • Add Entity

    SSWConsulting/SSW.VerticalSliceArchitecture

    Scaffold a new domain entity or aggregate in this Vertical Slice Architecture template — the entity itself, its strongly typed ID, errors, specification, EF Core configuration, DbSet, the mandatory…

    407 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Aspire

    SSWConsulting/SSW.VerticalSliceArchitecture

    A skill your agent uses when the user is working with an Aspire distributed application and needs to operate the AppHost or its resources through the Aspire CLI: start, restart, stop, or wait on the…

    407 GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Add Adr

    SSWConsulting/SSW.VerticalSliceArchitecture

    Write an Architectural Decision Record in this repo's docs/adr/ following its Log4brains conventions — filename, title, metadata, and the sections that are required versus optional.

    407 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Bump Version

    SSWConsulting/SSW.VerticalSliceArchitecture

    Bump the SSW.VerticalSliceArchitecture.Template NuGet package version to cut a new release.

    407 GitHub stars~841 tokensUpdated today
    Auto-check passed

Categories

Questions about Add Slice

What does Add Slice do?

Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group…. VerticalSliceArchitecture. Scaffold a slice in this Vertical Slice Architecture template — one use case in its own folder, with its FastEndpoints endpoint, request, response, validator, and summary, plus the Feature and Group if they don't exist yet, plus tests.

When should I use Add Slice?

Add Slice fits situations like: the user says add a slice; add an endpoint; expose X over the API; names a use case such as let users archive a team.

How do I install Add Slice in Claude Code?

Run `npx skills add SSWConsulting/SSW.VerticalSliceArchitecture --skill add-slice -a claude-code`. Or copy the skill folder (.claude/skills/add-slice in SSWConsulting/SSW.VerticalSliceArchitecture) into .claude/skills/add-slice in your project. Claude Code loads it when a task matches its description.

How do I install Add Slice in Codex?

Run `npx skills add SSWConsulting/SSW.VerticalSliceArchitecture --skill add-slice -a codex`. Or copy the skill folder (.claude/skills/add-slice in SSWConsulting/SSW.VerticalSliceArchitecture) into .agents/skills/add-slice in your project. Codex loads it when a task matches its description.

Can I use Add Slice in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SSWConsulting/SSW.VerticalSliceArchitecture --skill add-slice -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/add-slice, .gemini/skills/add-slice, .github/skills/add-slice and .opencode/skills/add-slice in your project.

What does Add Slice need to run?

Going by SKILL.md and its folder, Add Slice needs the command-line tools its instructions call (dotnet). Our summary lists: Docker.

Does Add Slice access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Add Slice safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Add Slice use?

Add Slice is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Add Slice use?

About 2.3k tokens (SKILL.md is roughly 9.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.2k tokens, read only when the agent opens those files.

What are the alternatives to Add Slice?

Skills that share tags, products or a category with Add Slice: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Add Slice?

SSWConsulting (a GitHub organization) maintains it in SSWConsulting/SSW.VerticalSliceArchitecture, which has 407 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 8, 2026.

Source: SSWConsulting/SSW.VerticalSliceArchitecture on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.