Agent skill

Query Patterns

by fullstackhero in fullstackhero/dotnet-starter-kit

Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse).

MITAuto-check passedDevelopment

Install Query Patterns

skills CLI
$ npx skills add fullstackhero/dotnet-starter-kit --skill query-patterns -a claude-code

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

GitHub CLI
$ gh skill install fullstackhero/dotnet-starter-kit query-patterns --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/fullstackhero/dotnet-starter-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/query-patterns .claude/skills/query-patterns && 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
query-patterns
GitHub stars
6.8k
Token cost
~1.2k tokens
SKILL.md length
118 words
Files
1
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse).

  • Adding GET endpoints
  • SKILL.md covers Paginated search query, Single-entity query, Endpoints and When to use a Specification…
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Project scaffolding

What it does

Query Patterns is an agent skill from fullstackhero/dotnet-starter-kit. Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse). Use when adding GET endpoints. See also add-feature.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding. The repository describes itself as: Production Grade Cloud-Ready .NET 10 Starter Kit (Web API + React Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All… The licence is MIT.

When your agent uses it

  • Adding GET endpoints
  • Tasks that involve Project scaffolding

Example prompts

  • “/query-patterns”

What it can do on your machine

Read from SKILL.md and the folder at commit 0bd98e3. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp).

    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

Query Patterns loads about 1.2k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 118 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~51
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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 fullstackhero/dotnet-starter-kit at commit 0bd98e3, republished under its MIT licence (© fullstackhero). 118 words, ~1,170 tokens.

Download SKILL.mdSave it as .claude/skills/query-patterns/SKILL.md (or your agent's skills folder).
name
query-patterns
description
Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse). Use when adding GET endpoints. See also add-feature.

Query Patterns

The dominant pattern is raw IQueryable on the module DbContext (AsNoTracking) with manual pagination. There is no generic repository and no PaginatedListAsync/EntitiesByPaginationFilterSpec/ PaginationFilter. Paged results are PagedResponse<T> (FSH.Framework.Shared.Persistence) — there is no PagedList<T>.

Paginated search query

csharp
// Contracts/v1/{Area}/
public sealed record Search{Entities}Query(
    string? Search = null,
    bool? IsActive = null,
    int PageNumber = 1,
    int PageSize = 20,
    string? SortBy = null,
    string? SortDir = null) : IQuery<PagedResponse<{Entity}Dto>>;
csharp
// Features/v1/{Area}/Search{Entities}/
public sealed class Search{Entities}QueryHandler({X}DbContext dbContext)
    : IQueryHandler<Search{Entities}Query, PagedResponse<{Entity}Dto>>
{
    public async ValueTask<PagedResponse<{Entity}Dto>> Handle(
        Search{Entities}Query query, CancellationToken cancellationToken)
    {
        ArgumentNullException.ThrowIfNull(query);
        int page = query.PageNumber < 1 ? 1 : query.PageNumber;
        int size = Math.Clamp(query.PageSize, 1, 100);

        var q = dbContext.{Entities}.AsNoTracking().AsQueryable();
        if (!string.IsNullOrWhiteSpace(query.Search))
            q = q.Where(x => EF.Functions.ILike(x.Name, $"%{query.Search}%"));
        if (query.IsActive is { } active)
            q = q.Where(x => x.IsActive == active);

        q = ApplySort(q, query.SortBy, query.SortDir);

        long total = await q.LongCountAsync(cancellationToken).ConfigureAwait(false);
        var items = await q.Skip(PaginationExtensions.GetOffset(page, size)).Take(size) // overflow-safe offset
            .ToListAsync(cancellationToken).ConfigureAwait(false);

        return new PagedResponse<{Entity}Dto>
        {
            Items = items.Select(x => x.ToDto()).ToList(),
            PageNumber = page, PageSize = size,
            TotalCount = total,
            TotalPages = (int)Math.Ceiling(total / (double)size)
        };
    }

    private static IQueryable<{Entity}> ApplySort(IQueryable<{Entity}> q, string? by, string? dir)
    {
        bool desc = string.Equals(dir, "desc", StringComparison.OrdinalIgnoreCase);
        return by?.ToLowerInvariant() switch
        {
            "name" => desc ? q.OrderByDescending(x => x.Name) : q.OrderBy(x => x.Name),
            _      => q.OrderByDescending(x => x.CreatedOnUtc)
        };
    }
}

Tenant + soft-delete filters apply automatically — don't re-filter them. Project to a DTO (.ToDto() mapper); never return entities.

Single-entity query

csharp
public sealed record Get{Entity}Query(Guid Id) : IQuery<{Entity}Dto>;

public sealed class Get{Entity}QueryHandler({X}DbContext dbContext)
    : IQueryHandler<Get{Entity}Query, {Entity}Dto>
{
    public async ValueTask<{Entity}Dto> Handle(Get{Entity}Query query, CancellationToken cancellationToken)
    {
        ArgumentNullException.ThrowIfNull(query);
        var entity = await dbContext.{Entities}.AsNoTracking()
            .FirstOrDefaultAsync(x => x.Id == query.Id, cancellationToken).ConfigureAwait(false)
            ?? throw new NotFoundException($"{Entity} {query.Id} not found");
        return entity.ToDto();
    }
}

Endpoints

csharp
// list — bind the query with [AsParameters]
endpoints.MapGet("/{entities}", async ([AsParameters] Search{Entities}Query query,
        IMediator mediator, CancellationToken ct) => Results.Ok(await mediator.Send(query, ct)))
    .WithName("Search{Entities}").RequirePermission({X}Permissions.{Entities}.View);

// single
endpoints.MapGet("/{entities}/{id:guid}", async (Guid id,
        IMediator mediator, CancellationToken ct) => Results.Ok(await mediator.Send(new Get{Entity}Query(id), ct)))
    .WithName("Get{Entity}").RequirePermission({X}Permissions.{Entities}.View);

A paginated query needs a validator (Search{Entities}QueryValidator: PageNumber >= 1, PageSize in [1,100]) — enforced by Architecture.Tests.

When to use a Specification instead

Specification<T> (src/BuildingBlocks/Persistence/Specifications/) is for composing reusable query shapes (protected Where(...)/Include(...)/OrderBy(...) in a derived spec's ctor; AsNoTracking defaults true; specs never paginate). Reach for it when the same filter/include set is shared across handlers; otherwise inline LINQ is the norm here.

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

Files

Just SKILL.md in .agents/skills/query-patterns of fullstackhero/dotnet-starter-kit.

Open the folder on GitHubat commit 0bd98e3

Compare with similar skills

Query Patterns 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.

Query Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Query Patterns this skillfullstackhero/dotnet-starter-kit6.8k—~1.2kAutomated safety check: PassMIT
AzureML Project ScaffoldingKilo-Org/kilo-marketplace189—~3.1kAutomated safety check: NotesMIT
New Resourcemondoohq/mql411—~5.6kAutomated safety check: PassCustom licence
Dynamo Webview Component ScaffoldDynamoDS/Dynamo2k—~991Automated safety check: PassApache-2.0
Deployjustrach/merjs356—~171Automated safety check: PassMIT
Upgrade Harnessruvnet/metaharness688—~497Automated safety check: PassMIT

Similar skills

  • AzureML Project Scaffolding

    Kilo-Org/kilo-marketplace

    Sets up and maintains AzureML-ready Python projects as uv workspaces with devcontainers, a Makefile and job YAML, so local runs match cloud jobs and experiments stay reproducible.

    189 GitHub stars~3.1k tokensUpdated 9 days ago
    DevelopmentAuto-check: notes
  • New Resource

    mondoohq/mql

    Add or change a resource in an existing mql provider — schema, codegen, implementation, tests, and verification against a real target.

    411 GitHub stars~5.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Scaffolds a new Dynamo package repo that hosts a view extension with a WebView2-embedded React frontend.

    2k GitHub stars~991 tokensUpdated today
    DevelopmentAuto-check passed
  • Deploy

    justrach/merjs

    Full production build — codegen, compile, prerender, and prepare for deployment.

    356 GitHub stars~171 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Upgrade Harness

    ruvnet/metaharness

    Drift detection + apply for a scaffolded harness. An agent skill from ruvnet/metaharness.

    688 GitHub stars~497 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Start Temps

    gotempsh/temps

    Start (or restart) a local Temps control plane built from this checkout, and the web dev server (bun dev) in <checkout/web.

    822 GitHub stars~5.4k tokensUpdated today
    DevelopmentAuto-check passed

More from fullstackhero/dotnet-starter-kit

All 11 skills in this repo
  • Add Entity

    fullstackhero/dotnet-starter-kit

    Add a domain entity/aggregate with EF configuration and a migration to an existing FSH module.

    6.8k GitHub stars~1.2k tokensUpdated 7 days ago
    Auto-check passed
  • Add Feature

    fullstackhero/dotnet-starter-kit

    Add a vertical-slice feature (command/query + handler + validator + endpoint) to an existing FSH module.

    6.8k GitHub stars~1.1k tokensUpdated 7 days ago
    Auto-check passed
  • Add Full Slice

    fullstackhero/dotnet-starter-kit

    Build a capability end-to-end — backend vertical slice (Contracts→handler→validator→endpoint) AND the React page wired to it.

    6.8k GitHub stars~783 tokensUpdated 7 days ago
    Auto-check passed
  • Add Integration Event

    fullstackhero/dotnet-starter-kit

    Publish a cross-module integration event via the Outbox and handle it idempotently in another module.

    6.8k GitHub stars~1.1k tokensUpdated 7 days ago
    Auto-check passed
  • Add Module

    fullstackhero/dotnet-starter-kit

    Create a new module (bounded context) — runtime + Contracts projects, IModule, DbContext, permissions, migrations, and the four registration sites.

    6.8k GitHub stars~1.5k tokensUpdated 7 days ago
    Auto-check passed
  • Add Permission

    fullstackhero/dotnet-starter-kit

    Add a new permission end-to-end — server constant + endpoint gate, and (admin app) mirror it into the permissions catalog + route guard.

    6.8k GitHub stars~849 tokensUpdated 7 days ago
    Auto-check passed

Questions about Query Patterns

What does Query Patterns do?

Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse). Query Patterns is an agent skill from fullstackhero/dotnet-starter-kit. Implement read queries — paginated lists, search/filter/sort, and single-entity fetches — the FSH way (DbContext LINQ + PagedResponse).

When should I use Query Patterns?

Query Patterns fits situations like: adding GET endpoints; tasks that involve Project scaffolding.

How do I install Query Patterns in Claude Code?

Run `npx skills add fullstackhero/dotnet-starter-kit --skill query-patterns -a claude-code`. Or copy the skill folder (.agents/skills/query-patterns in fullstackhero/dotnet-starter-kit) into .claude/skills/query-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Query Patterns in Codex?

Run `npx skills add fullstackhero/dotnet-starter-kit --skill query-patterns -a codex`. Or copy the skill folder (.agents/skills/query-patterns in fullstackhero/dotnet-starter-kit) into .agents/skills/query-patterns in your project. Codex loads it when a task matches its description.

Can I use Query Patterns 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 fullstackhero/dotnet-starter-kit --skill query-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/query-patterns, .gemini/skills/query-patterns, .github/skills/query-patterns and .opencode/skills/query-patterns in your project.

What does Query Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Query Patterns is instructions for the agent only.

Does Query Patterns 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 Query Patterns 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 Query Patterns use?

Query Patterns 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 Query Patterns use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Query Patterns?

Skills that share tags, products or a category with Query Patterns: AzureML Project Scaffolding (Kilo-Org/kilo-marketplace, 189 stars), New Resource (mondoohq/mql, 411 stars), Dynamo Webview Component Scaffold (DynamoDS/Dynamo, 2k stars) and Deploy (justrach/merjs, 356 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Query Patterns?

fullstackhero (a GitHub organization) maintains it in fullstackhero/dotnet-starter-kit, which has 6,813 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on September 30, 2026.

Source: fullstackhero/dotnet-starter-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.