# Csharp Style

> >

- **Type:** Skill
- **Install:** `agentstack add skill-nice3point-revit-skills-csharp-style`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Nice3point](https://agentstack.voostack.com/s/nice3point)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Nice3point](https://github.com/Nice3point)
- **Source:** https://github.com/Nice3point/revit-skills/tree/main/plugins/dotnet/skills/csharp-style

## Install

```sh
agentstack add skill-nice3point-revit-skills-csharp-style
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# C# Style

## Naming and layout

- Give every identifier its full domain meaning; never use a single-character or abbreviated name.
- Suffix a method returning `Task` or `Task` with `Async`.
- Use file-scoped namespaces.
- Order members: private fields, constructor, public properties, public methods, private methods.

## Language features

- Use the newest language feature that makes intent clearer without hiding control flow or allocation.
- Use `is null` / `is not null` for null checks; never the empty property pattern `is { }` as a null check.
- Combine predicates over one expression with `and`/`or`/`not` patterns; parenthesize when precedence is not obvious.
- Use collection expressions (`[…]`) for clear collection literals.

## Nullability and annotations

- Enable nullable reference types; keep public and internal contracts null-safe.
- Express real, IDE- or compiler-visible contracts with annotations from the JetBrains and `System.Diagnostics.CodeAnalysis` sets — both are large, so reach for whichever fits rather than a fixed few.
- Apply `[Pure]` to side-effect-free members and `[NotNullWhen]` to `Try`-style methods with an `out` result as a habit; add the rest (`[PublicAPI]`, `[MustUseReturnValue]`, `[MemberNotNull]`, `[DoesNotReturnIf]`, `[StringSyntax]`, …) wherever their exact condition holds.

## Asynchronous code

- Use `Task`/`Task`; reserve `async void` for a framework-required event handler.
- Flow `CancellationToken` through I/O, broker, storage, and long-running work.
- Never block an async flow with `.Result`, `.Wait()`, or synchronous sleeps.

## Data contracts

- Use `record` for DTOs, message contracts, and configuration-style data.
- Use `init` properties unless a caller must mutate after construction.
- Keep a contract stable and explicit once another process or service depends on it.

## Error handling

- Validate untrusted input at a public boundary.
- Prefer a semantic exception over a generic `Exception`.
- Catch only at a boundary that can add context, clean up, or choose recovery — never a broad catch with no recovery.

## Performance

- Measure a hot path before micro-optimizing.
- Remove repeated parsing, allocation, and intermediate collections before reaching for a lower-level primitive.
- Use `Span`/`ReadOnlySpan` only when it materially removes copying without obscuring ownership.
- Keep expensive work out of constructors and deserialization paths; dispose owned streams and pooled resources in their owner scope.

## Review

- [ ] Identifiers carry full domain meaning; async methods end in `Async`.
- [ ] Nullability is explicit and annotations match real contracts.
- [ ] Async paths flow `CancellationToken` and never block.
- [ ] Shared data contracts are immutable `record` types.
- [ ] Exceptions are semantic and caught only where recovery or context is added.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Nice3point](https://github.com/Nice3point)
- **Source:** [Nice3point/revit-skills](https://github.com/Nice3point/revit-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nice3point-revit-skills-csharp-style
- Seller: https://agentstack.voostack.com/s/nice3point
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
