Skip to content
cccskills
FreePublished on GitHub

style-review

Review changed or staged C# code against the docs-builder coding standards and flag violations. Use when the user asks to review code style, check for standards violations, or audit a diff before committing.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25 stars(GitHub 25 + cccskills 0)

Run score Not tested

See how to install

Files included (1)

  • SKILL.md3.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Style Review Skill

Reviews C# changes for violations that dotnet format and .editorconfig cannot catch — behavioral patterns, naming conventions, and architectural rules.

What this skill does NOT check

.editorconfig + dotnet format already enforce (mechanically):

  • var everywhere, no explicit types
  • No this. qualifier
  • Language keywords (string not String)
  • Expression bodies
  • Allman braces, newlines before {
  • Null propagation (?., ??)
  • Pattern matching over is/as casts
  • Inlined variable declarations (out var x)
  • Throw expressions, conditional delegate calls
  • Modifier order
  • File-scoped namespaces
  • Object/collection initializers
  • [] instead of new List<T>() / Array.Empty<T>()

Run dotnet format (or /lint) to fix those. Only continue with this skill for the behavioral checks below.

Steps

1. Get the diff

git diff          # unstaged changes
git diff --staged # staged changes
git diff main...HEAD  # full branch

2. Check behavioral rules

Async correctness (error-level):

  • Public async methods must end in Async; private async methods must NOT
  • Never .Result or .Wait() on an async call
  • Library code must use .ConfigureAwait(false) on awaits
  • All async methods should accept CancellationToken ct = default

Method design (error-level):

  • Max 4 parameters — flag anything over that without a record/options object
  • Boolean parameters must use named argument syntax at every call site
  • Cyclomatic complexity > 7 branches in one method — flag and suggest extraction

Structural (error-level):

  • No #region directives
  • Class member order violated: fields → constructors → properties → methods (grouped by function, not visibility)

Return values (error-level):

  • Methods returning collections must never return null — must return []
  • Lookups should use the TryGet pattern, not null returns

Testing (style-level, in tests/ and tests-integration/):

  • New test projects should use TUnit + AwesomeAssertions, not xUnit directly
  • Test method naming: MethodName_Scenario_Expected
  • No assertions without fluent style (Should().Be(...) not Assert.Equal(...))

Comments (style-level):

  • Comments that describe what the code does (not why) — flag for removal
  • Multi-paragraph docstrings on non-public members
  • #region (already error-level above)

3. Report

Format violations as a numbered list with severity:

ERROR:
1. src/Elastic.Markdown/Foo.cs:42 — public async method `GetData` missing `Async` suffix
2. src/Elastic.Markdown/Foo.cs:67 — `.Result` blocks on async call; use `await`

STYLE:
3. tests/Elastic.Markdown.Tests/Bar.cs:15 — test name `TestGetUser` should follow `GetUser_ValidId_ReturnsUser` pattern

If no violations: "No behavioral style violations found."

4. Do NOT auto-fix

Report only. For formatting issues, run /lint. For logic violations (blocking async, null collections), the developer must fix manually.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

commit

Free

Stage relevant files and create a well-formed git commit for the docs-builder repo. Use this when the user asks to commit changes, save work, or create a commit.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

Registers a feature flag as additive-only and verifies the flag-off path still matches the previous default. Use whenever adding or extending a feature flag, editing FeatureFlags.cs, changing feature_flags in assembler.yml, gating a code path behind a FEATURE_* environment variable, or enabling a flag in an environment. Do not skip this skill for flag work even if the user does not name it.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

issue

Free

File a well-formed bug report or feature request. Use when the user asks to open an issue, report a bug, or request a feature in the docs-builder repo.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

lint

Free

Auto-fix all formatting issues in the docs-builder repo — runs dotnet format for C# and npm fmt:write for TypeScript/JS. Use when the user asks to fix formatting, lint the code, or when a pre-commit hook fails due to formatting.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

Search, analyze, and author Elastic documentation using the remote MCP server. Use this when the user asks about Elastic product documentation, features, or APIs; wants to find, read, or verify existing docs pages; is writing or editing documentation; mentions cross-links between repos; asks about documentation structure, coherence, or consistency; wants to generate templates following Elastic content type guidelines; or references elastic.co/docs URLs or Elastic product names.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

pr

Free

Create a GitHub pull request for the current branch with a focused why/what body and exactly one release-drafter label. Use when the user asks to open a PR, create a pull request, or ship a branch.

The English summary is being prepared. Showing the original description.

elastic/docs-builder25Updated Oct 26, 2026

See all skills by elastic

Report a problem with this skill