.claude/skills/gen-verbose-copilot-instructions/SKILL.md
Generate a comprehensive root instruction file for any repository by discovering the project structure, validating every command, and embedding universal architectural principles. Verbose variant with full output template. Invoke when the user says: generate verbose instructions, create comprehensive copilot instructions, bootstrap root instruction file, full instructions template, generate CLAUDE.md. Domain: DevOps, AI Context. Level: Intermediate.
npx skillsauth add klod68/littlerae gen-verbose-copilot-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 root instruction file (e.g., .github/copilot-instructions.md or CLAUDE.md) that enables coding agents to work efficiently in this repository without extensive exploration. The output combines project-specific operational guidance (discovered from the repository) with universal architectural principles (defined in this prompt and always included verbatim).
Primary Goals:
Success Criteria: An agent should be able to:
Documentation Files
Build System — Identify and extract exact commands from:
package.json / package-lock.json (Node.js)requirements.txt / pyproject.toml / setup.py (Python)pom.xml / build.gradle (Java/Kotlin)*.csproj / *.sln (C#/.NET)Cargo.toml (Rust)go.mod (Go)Gemfile (Ruby)Makefile / scripts in scripts/, build/, tools/CI/CD & Validation — Extract the exact commands CI runs:
.github/workflows/*.yml.circleci/config.yml.gitlab-ci.ymlazure-pipelines.ymlJenkinsfileConfiguration Files
.eslintrc*, .prettierrc*, tsconfig.json.pylintrc, setup.cfg, pyproject.toml.editorconfigDockerfile, docker-compose.yml.nvmrc, .python-version, .ruby-versionProject Structure
src/, lib/, app/)test/, tests/, __tests__/, spec/)main.*, index.*, app.*, Program.*)Run each command before documenting it:
git clean -fdx # start from clean state
[run each command in order and confirm it succeeds]
Mark results as:
Test scenarios (focus on these, not edge cases):
Check for and document if present:
These sections are mandatory in every generated file, for every project, regardless of language or stack. Translate the rules below to match the project's language and idioms. Do not omit, summarize, or move them to a separate document.
new ConcreteType() to instantiate a type from another module or library. Use factories or dependency injection.Save, Delete, Execute); queries use Get, Find, Load; validators use Is, Has, Can..Result, .Wait(), or equivalent blocking calls on async operations).ConfigureAwait(false) in C#).async void (or equivalent fire-and-forget that loses exceptions). Fire-and-forget must be explicitly managed with structured concurrency.! in C#, ! assertion in TypeScript) require an inline comment explaining why.catch block either re-throws, wraps, or logs at a severity that makes the failure visible.Exception type except at a single top-level resilience boundary.Result<T>, OperationResult, etc.) for expected domain-level outcomes (not found, validation failure). Use exceptions for broken contracts and infrastructure failures. Never mix both patterns in the same return path.MethodOrUnit_Condition_ExpectedOutcome.| Anti-Pattern | Rule Violated | Required Fix |
|---|---|---|
| new ConcreteType() across module boundaries | DIP | Use factory or DI |
| switch/if-else branching on type | OCP | Replace with polymorphism |
| is / instanceof / typeof checks on base types | LSP | Consumer must not inspect concrete type |
| Empty catch {} block | Error Handling | Re-throw, wrap, or log |
| Async method without cancellation token | Async Policy | Add CancellationToken parameter |
| Blocking call on async operation (.Result, .Wait()) | Async Policy | Await properly |
| Returning null for a collection | Nullability | Return empty collection |
| Command method that returns data | CQS | Decompose into command + query |
| Interface with 10+ unrelated methods | ISP | Split by role |
| Public concrete class (non-abstract, non-helper) | Encapsulation | Make internal or abstract |
Use this template. Fill Part 1 sections from discovery. Include Part 2 sections verbatim (translated to the project's language/idioms).
# [Project Name] — Coding Agent Instructions
## Repository Overview
[2–4 sentences: what the project does, who uses it.]
**Tech Stack:**
- Language: [e.g., TypeScript 5.x, C# 12, Python 3.12]
- Framework: [e.g., Express, ASP.NET Core, FastAPI]
- Runtime: [e.g., Node.js 20.x, .NET 8, Python 3.12+]
- Project Type: [e.g., REST API, NuGet library, CLI tool]
---
## Setup & Build
### Prerequisites
- [Tool] [version]+ (check with `[command]`)
### First-Time Setup
```bash
[exact commands]
Expected time: [~X minutes]
[exact command]
⚠️ [Any critical notes]
Common issues:
# Unit tests
[exact command]
# Integration tests (requires [prerequisite])
[exact command]
# Specific test
[exact command with example]
Expected time: [~X seconds/minutes]
# Lint
[exact command]
# Format
[exact command]
# Type check (if applicable)
[exact command]
[exact sequence CI runs]
All checks must pass before opening a PR.
[repo-root]/
├── [dir]/ - [purpose]
├── [dir]/ - [purpose]
└── [dir]/ - [purpose]
Key locations:
[path][path][path][path] — generated, never edit directlyOn Pull Request:
[workflow] — Runs: [what it does][workflow] — Runs: [what it does]Pre-commit hooks: [what runs automatically, or "None"]
new. Use factories or DI.Save, Delete, Execute). No data returned.Get/Find/Load. No side effects.Is/Has/Can. No side effects.ConfigureAwait(false) or equivalent).async void or unmanaged background tasks).MethodOrUnit_Condition_ExpectedOutcome.| Anti-Pattern | Fix |
|---|---|
| new ConcreteType() across module boundaries | Factory or DI |
| switch/if-else branching on type | Polymorphism |
| is/instanceof check on base type | Redesign — consumer must not inspect type |
| Empty catch {} | Re-throw, wrap, or log |
| Async without cancellation token | Add cancellation parameter |
| Blocking on async (.Result, .Wait()) | Await properly |
| Returning null for collection | Return empty collection |
| Command that returns data | Split into command + query |
| Interface with many unrelated methods | Split by role |
| Public concrete non-abstract class | Make internal or abstract |
[Populate from discovery — project-specific gotchas, ordering requirements, environment issues]
# Setup
[command]
# Build
[command]
# Test
[command]
# Lint / Format
[command]
Key paths:
[path][path][path]Trust these instructions. Search the codebase only when:
When generating code, verify it satisfies every rule in Architectural Rules before emitting. If a user request conflicts with a rule, flag the conflict and propose a compliant alternative.
---
## Writing Style Rules (Apply to All Generated Content)
**DO:**
- Imperative voice: "Run X", "Never Y", "Always Z"
- Exact commands: `` `dotnet test` `` not "run the tests"
- Version numbers: "Node.js 20.x" not "recent Node.js"
- Timing for slow operations: "~5 minutes"
- Highlight gotchas: "⚠️ Must build before testing"
**DON'T:**
- Passive voice: "Dependencies should be installed"
- Vague instructions: "Set up the environment"
- Assumed knowledge: "Configure as usual"
- Paragraphs: Use bullets and code blocks
- Omit error cases: Document known failure modes
---
## Edge Cases
**No build step:**
```markdown
## Setup & Build
No build step required. Files execute directly.
No tests:
## Testing
⚠️ No automated test suite. Manual validation: [describe steps]
Monorepo:
## Repository Structure
Monorepo. Packages:
- `packages/[name]/` — [purpose] — build with `[command]`
- `packages/[name]/` — [purpose] — build with `[command]`
Missing information: Document the gap explicitly rather than guessing.
⚠️ Build command not found in repository. Check with the team before proceeding.
tools
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.