version unknown

code-quality

microsoft@microsoft⭐ 1.4k stars· last commit 10d ago· 116 open issues

Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

7.0/10
Verified
Oct 12, 2026

// RATINGS

⭐GitHub Stars
⭐⭐⭐⭐⭐ 1.4k on GitHubGitHub ↗

Very popular

🟢ProSkills ScoreAI Verified
7.0/10
📍

Not yet listed on ClawHub or SkillsMP

// README

WinApp CLI

[!IMPORTANT] :warning: Status: Public Preview — The Windows App Development CLI (WinApp CLI) is experimental and in active development. We'd love your feedback! Share your thoughts by creating an issue.

[!NOTE] The main branch contains work that is in active development. Documentation, features, and behavior here may differ from what is publicly released. For the latest stable version, see the latest release. To try the newest in-progress build, see Install from latest build below.

The Windows App Development CLI (WinApp CLI) is a single command-line interface for creating, running, debugging, testing, and packaging Windows apps. It manages Windows SDKs, app identity, manifests, certificates, and build tools for WinUI and any other app framework. Whether you're building with WinUI, .NET/Win32, CMake, Electron, or Rust, this CLI gives you access to:

  • WinUI from the terminal - Create apps from official templates with winapp new and launch them with winapp run
  • Modern Windows APIs - Windows App SDK and Windows SDK with automatic setup and code generation
  • Package Identity - Debug and test by adding package identity without full packaging in a snap
  • MSIX Packaging - App packaging with signing and Store readiness
  • UI automation and agent tooling - Inspect and drive running apps with winapp ui, and ground AI coding agents with find-ui and find-api
  • Developer Tools - Manifests, certificates, assets, and build integration

Full documentation is published on Microsoft Learn: Windows App Development CLI.

Perfect for:

  • WinUI developers who want to create, run, test, and package apps from the terminal, VS Code, or an AI coding agent
  • Cross-platform developers using frameworks like Qt or Electron wanting native Windows features or targeting Windows
  • Developers who love their current tools and want to build Windows apps from VS Code, or any other editor
  • Developers crafting CI/CD pipelines to automate building apps for Windows

🤔 Why?

Many Windows APIs require your app to have package identity, enabling you to leverage some of the OS components Windows offers, that you wouldn't otherwise have access to. With identity, your app gains access to user-first features like notifications, OS integration, and on-device AI.

Our goal is to support developers wherever they are, with the tools and frameworks they already use. Based on feedback from developers shipping cross-platform apps on Windows, we built this CLI to streamline integrating with the Windows developer platform - handling SDK setup, header generation, manifests, certificates, and packaging in just a few commands:

A few examples of what package identity and MSIX packaging unlock:

✏️ Get started

Check out our getting started guides for step by step instructions of how to setup your environment, generate manifests, assets, and certificate, how to debug APIs that require package identity, and how to MSIX package your app.

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • .github/skills/code-quality/SKILL.md8.0 KBupstream ↗
    ---
    name: code-quality
    description: Statically check changed C# against the same deterministic rules github-code-quality[bot] runs on pull requests, so a contributor can fix likely findings before opening the PR and keep the bot's inline comments to a minimum. Activate when a contributor asks to "check code quality", "run code quality on my changes", "will the code quality bot complain", "pre-check before I open the PR", "code quality check", or similar. Scoped to C#. Reads the diff and compares it against the enumerated csharp-code-quality rule set below — no CodeQL download or build required. This is a fast approximation of a dataflow engine, not a reproduction; report accordingly. Does NOT apply fixes unless explicitly asked.
    infer: true
    ---
    
    You are the **local code-quality pre-check** for `microsoft/winappcli`. On pull
    requests, `github-code-quality[bot]` runs the deterministic CodeQL
    **`csharp-code-quality`** suite and posts each hit as an inline comment. This
    skill reads the contributor's C# diff and flags lines that are likely to trip
    those same rules, so they can be cleared before pushing.
    
    Scope is **C# only** — the language the bot rule-checks in this repo.
    
    **Be honest about what this is.** The bot runs a deterministic dataflow/type
    engine; you are pattern-matching a diff by reading it. You will reliably catch the
    syntactic rules and miss or over-flag the analysis-heavy ones (marked **†**
    below — null-flow, disposal escape analysis, "value never used", LINQ shape
    detection). Treat **†** findings as *lower confidence*, and never claim a clean
    result guarantees zero bot comments. It does not — it means nothing *obvious* is
    left. This also does not cover the bot's separate AI-powered pass, or C/C++.
    
    Do **not** activate for a single "is this line okay" question — that is a direct
    question, not a diff-wide pre-check.
    
    ## 1. Scope to the changed C# code
    
    First find the merge base, so committed *and* still-uncommitted work both count —
    call it `<base>`: `git merge-base origin/main HEAD`.
    
    - **Tracked changes** (branch commits plus any staged/unstaged edits):
      `git --no-pager diff --name-only <base>` — diffing the working tree against the
      merge base, so a later edit to an already-committed file is still seen.
    - **Untracked new files:** `git ls-files --others --exclude-standard -- "src/*.cs"`
      — `git diff` cannot emit hunks for these; read them directly with `view`.
    
    Keep only `*.cs` under `src\`, and drop files matching the repo's CodeQL exclusion
    `**/*Tests/*.cs` — a `.cs` file **directly inside** a directory whose name ends in
    `Tests` (e.g. `src\WinApp.Cli.Tests\Foo.cs`). Mirror that glob exactly: a file
    nested deeper, such as `src\...\WinApp.Cli.Tests\TestApps\App.xaml.cs`, does **not**
    match it, so the bot may scan it — keep those in scope. If nothing survives, say
    so and stop.
    
    Then read the changed lines. For a tracked file:
    `git --no-pager diff --unified=0 <base> -- <file>`; for an untracked file the whole
    file is added, so `view` it. Either way `view` each changed region for context.
    **Only flag code inside the changed hunks** — the bot comments on changed lines,
    and pre-existing debt elsewhere is not this PR's problem.
    
    ## 2. Check the diff against the rule set
    
    For every changed hunk, walk the rule tables below and flag each line that
    matches. For a match, record the `cs/...` id, the exact `file:line`, the offending
    snippet, and the smallest fix. Prefer precision over volume: if you cannot point
    at the specific line and say what the bot would say, drop it. Apply extra
    skepticism to **†** rules — only raise one when the trigger is visible in the diff
    (e.g. a `new HttpRequestMessage(...)` with no `using` and no `return`/field
    assignment), not on a hunch.
    
    ### Exception handling
    | Rule | Flags → do instead |
    |---|---|
    | `cs/catch-of-all-exceptions` | `catch (Exception)` (or bare `catch`) → catch the specific type you can handle |
    | `cs/catch-nullreferenceexception` | catching `NullReferenceException` → fix the deref; don't catch it |
    | `cs/empty-catch-block` | `catch {}` that swallows → handle, log, or let it propagate |
    | `cs/rethrown-exception-variable` | `throw ex;` (resets stack) → `throw;` |
    
    ### Null & dereference — **†**
    | Rule | Flags → do instead |
    |---|---|
    | `cs/dereferenced-value-may-be-null` **†** | using a value that a prior branch/API can leave null → null-check or `?.` |
    | `cs/dereferenced-value-is-always-null` **†** | dereffing a value provably always null → remove/repair |
    | `cs/null-argument-to-equals` | `x.Equals(null)` → `x is null` |
    
    ### Disposal & resources
    | Rule | Flags → do instead |
    |---|---|
    | `cs/local-not-disposed` **†** | a local `IDisposable` you own, never disposed → `using` |
    | `cs/missed-using-statement` **†** | `Dispose()` in a `finally` you could express as `using` → `using` |
    
    ### Equality & hashing
    | Rule | Flags → do instead |
    |---|---|
    | `cs/gethashcode-is-not-defined` | overriding `Equals` without `GetHashCode` → override both |
    | `cs/useless-gethashcode-call` | `GetHashCode()` on a small integral type (e.g. `int`, `enum`) — it just returns the value → drop the redundant call |
    | `cs/equals-on-arrays` | `array.Equals(other)` (reference eq) → `SequenceEqual` |
    | `cs/equals-on-unrelated-types` | `Equals` across incomparable types → compare compatible types |
    | `cs/unchecked-cast-in-equals` | unchecked cast of the arg in an `Equals` override → `is`/`as` guard |
    | `cs/recursive-equals-call` | `Equals` calling itself unboundedly → fix the recursion |
    | `cs/reference-equality-on-valuetypes` | `ReferenceEquals` on value types (always false) → `==`/`Equals` |
    | `cs/equality-on-floats` | `==` on `double`/`float` → compare with a tolerance |
    | `cs/comparison-of-identical-expressions` | a comparison operator with identical operands (`x == x`, `a < a`) → remove or fix the typo |
    
    ### Dead & useless code
    | Rule | Flags → do instead |
    |---|---|
    | `cs/empty-block` | empty `if`/loop body → remove or fill |
    | `cs/useless-if-statement` | `if` whose branches do the same thing → collapse |
    | `cs/constant-condition` **†** | condition provably always true/false → remove the dead path |
    | `cs/simplifiable-boolean-expression` | `x ? true : false`, `!(a == b)` → simplify |
    | `cs/missed-ternary-operator` | `if/else` that only assigns one variable → ternary |
    | `cs/nested-if-statements` | `if (a) { if (b) … }` with no else → `if (a && b)` |
    | `cs/useless-tostring-call` | `.ToString()` on a `string` / in interpolation → drop it |
    | `cs/call-to-object-tostring` | default `object.ToString()` (type name) → override or format explicitly |
    | `cs/self-assignment` | `x = x;` → remove (or fix the intended target) |
    | `cs/unused-label` | a `label:` never targeted → remove |
    | `cs/unused-property-value` **†** | setter that ignores `value` → use it |
    | `cs/empty-collection` **†** | a collection created empty and then read/used but never given any elements → add elements or drop the reads |
    | `cs/unused-collection` **†** | a collection filled but never read → remove or use |
    
    ### LINQ opportunities — **†**
    | Rule | Flags → do instead |
    |---|---|
    | `cs/linq/missed-where` **†** | `foreach` with a filtering `if` → `.Where(...)` |
    | `cs/linq/missed-select` **†** | `foreach` that only projects → `.Select(...)` |
    | `cs/linq/missed-all` **†** | loop checking a condition holds for all → `.All(...)` |
    | `cs/linq/missed-cast` **†** | loop casting every element → `.Cast<T>()` |
    | `cs/linq/missed-oftype` **†** | loop filtering by type → `.OfType<T>()` |
    | `cs/linq/useless-select` | `.Select(x => x)` → drop it |
    
    ### Collections & indexing
    | Rule | Flags → do instead |
    |---|---|
    | `cs/inefficient-containskey` | `ContainsKey` then indexer → `TryGetValue` |
    | `cs/test-for-negative-container-size` | `Count < 0` / `Length < 0` (never true) → fix the check |
    | `cs/index-out-of-bounds` **†** | off-by-one vs `Length`/`Count` → use `< Length` |
    | `cs/nested-loops-with-same-variable` | nested `for`/`foreach` that reuse the same counter (inner loop als
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/microsoft-winappcli-github-skills-code-quality.md

// REPO STATS

1.4k stars
116 open issues
Last commit: 10d ago