.claude/skills/gen-scoped-instructions/SKILL.md
Use when a sub-project, module, or layer needs its own scoped AI coding instructions layered on top of the root instructions. Generates a .instructions.md with the correct applyTo glob, architecture decisions, conventions, and anti-patterns. Also invoke when the user mentions: scoped instructions, sub-project instructions, module instructions, feature instructions file. Domain: DevOps, AI Context. Level: Intermediate.
npx skillsauth add klod68/littlerae gen-scoped-instructionsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a scoped instructions file for the sub-project: ${1:SubProjectName}.
${2:e.g. src/MyApp.Demo}${3:e.g. Blazor Server demo app showcasing the library with in-memory data}${4|Blazor Server,Razor Pages,MVC,Minimal API,Console,Class Library,MAUI|}${5:e.g. In-memory data only, no database; uses InMemory services}${6:e.g. Do not add database access, Do not reference production connection strings}Create .github/instructions/${1:lower}.instructions.md:
---
applyTo: "[glob matching files in ${2}]"
---
# ${1} — Agent Instructions
## Purpose
${3}
## Architecture
[3–5 decisions specific to this sub-project, not duplicating the main instructions]
## File Organization
| Directory | Purpose |
|---|---|
## Conventions
[Only conventions that differ from or extend the main copilot-instructions.md]
## Key Dependencies
[Packages and project references unique to this sub-project]
## What NOT to Do
[Each as a ❌ bullet — specific and actionable]
## Build & Run
\`\`\`powershell
dotnet run --project ${2}
\`\`\`
applyTo glob selectionChoose the pattern that matches only files in this sub-project:
| Sub-project type | Pattern |
|---|---|
| Folder name contains a keyword | **/*${1}*/**/* |
| Specific project folder | ${2}/**/* |
| Blazor files only | **/*.razor,**/*.razor.cs |
| Test project | **/*Tests*/**/*.cs |
| Migration files | **/Migrations/**/* |
Verify the pattern does not accidentally match files outside this sub-project.
copilot-instructions.mdapplyTo pattern is tested against the actual directory structuretools
Use when cross-cutting concerns (logging, metrics, validation, authorization) are tangled into command handlers or service methods, when building database command pipelines with reorderable concerns, or when HTTP client pipelines or message handlers need composable, independently-replaceable processing stages. Covers ICommandInterceptor interface, InterceptorPipeline with reverse-chain construction, zero-cost Empty sentinel to skip overhead when no interceptors are registered, and ConfigureAwait(false) discipline for library code. Domain: Architecture, Cross-Cutting Concerns. Level: Intermediate. Tags: interceptor, pipeline, middleware, decorator, cross-cutting-concerns.
development
Use when writing integration tests for Razor Pages, MVC, or Minimal API applications to validate routing, middleware, page rendering, and HTTP behavior without a browser or live server, or when adding fast smoke tests to a CI pipeline. Covers WebApplicationFactory<Program> setup with public partial class Program, in-memory test server, AngleSharp HTML parsing, CSS selector assertions, redirect and status code testing, and a shared static fixture pattern for minimal per-test startup overhead. Domain: Testing, ASP.NET Core. Level: Intermediate. Tags: integration-testing, webapplicationfactory, razor-pages, anglesharp, http-testing.
development
Use when designing indexes for new tables, diagnosing slow queries that are not using indexes efficiently, reviewing index fragmentation and maintenance, or when the current indexing strategy results in key lookups, table scans, or missing index warnings. Covers clustered index key selection (narrow, unique, ever-increasing), non-clustered index design for query patterns, covering indexes with INCLUDE columns, filtered indexes for subset queries, composite index column ordering, DMV-based monitoring for missing and unused indexes, and rebuild vs reorganize maintenance thresholds. Domain: Database, Performance. Level: Intermediate. Tags: index, sql-server, covering-index, filtered-index, performance, dmv, maintenance.
development
Use when building a searchable in-memory catalog or registry for documentation sites, admin panels, or type/API browsers where you need keyword matching, fuzzy search, and ranked results without an external search engine or database. Covers RegistryService with weighted scoring across name, description, keywords, and method names; Levenshtein fuzzy matching; synonym expansion; category and subcategory filtering; and singleton DI registration for datasets of hundreds to low thousands of items. Domain: Search, Data Access Patterns. Level: Intermediate. Tags: search, registry, fuzzy-matching, in-memory, catalog, filtering.