agentsclimarketplace

Neo csharp

Skill Benknightdark/neo-skills/skills/neo-csharp

Neo Skills 是專為現代 AI Agent 設計的全方位能力擴充套件。本專案透過標準化的通訊架構,為 AI 代理安裝可插拔的「技能模組 (Skills)」,使其不僅僅是一個聊天機器人,而是能轉化為具備「感知-推理-行動」能力的多領域專家。

Install
npx -y skills add Benknightdark/neo-skills --skill neo-csharp

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 7 stars7 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use this skill when writing, reviewing, debugging, or modernizing C# code in .NET projects. Trigger for .cs/.csproj files, C# language-version questions, nullable reference types, records, pattern matching, async/cancellation, or version-appropriate syntax from C# 10+.

SKILL.md

5.3 KB, as published. Nobody here has run it

Modern C# (10+) Expert Skill

Trigger On

  • The user asks to write, debug, refactor, or review C# code.
  • The project directory contains *.cs, *.csproj, or single-file C# scripts.
  • The target framework is .NET 6.0 (LTS) and above.
  • Code modernization is needed (e.g., converting legacy nested namespaces to File-scoped namespaces).

Workflow

  1. Perceive (Version Awareness):
    • Check .csproj to identify TargetFramework and determine the syntax upper limit:
      • net6.0: C# 10 (File-scoped namespaces, Global usings).
      • net7.0: C# 11 (Raw string literals, Required members).
      • net8.0: C# 12 (Primary Constructors, Collection Expressions).
      • net9.0: C# 13 (params collections, Lock object).
      • net10.0: C# 14 (Extension members, field keyword).
  2. Reason (Planning Phase):
    • Evaluate the modernization level of the current code to determine the refactoring strategy.
    • In lower version environments (like .NET 6), avoid using higher version syntax (like Primary Constructors), but prioritize using File-scoped namespaces.
    • In higher version environments, actively adopt new features to reduce boilerplate code.
  3. Act (Execution Phase):
    • Write high-quality code, prioritizing "syntactic sugar" to improve readability.
    • Implement strong typing and immutable data structures (record, record struct).
    • Utilize Interpolated string handlers and Span<T> to optimize performance-sensitive paths.
  4. Validate (Standard Validation):
    • Validate the safety of NRT (Nullable Reference Types).
    • Check if asynchronous operations correctly handle cancellation tokens (CancellationToken).
    • Ensure naming conventions comply with official .NET recommendations.

Feature Roadmap (C# 10 - 14)

C# 10 & 11 (Foundation)

  • File-scoped Namespaces: Reduce indentation levels.
  • Global Using Directives: Centralize common namespaces management.
  • Raw String Literals: """...""" easily handle multi-line and special characters.
  • Required Members: Ensure required properties during object initialization.
  • List Patterns: if (list is [1, 2, ..]) powerful collection matching.

C# 12 & 13 (Productivity)

  • Primary Constructors: Simplify class-level dependency injection.
  • Collection Expressions: Uniformly use [1, 2, 3] to initialize collections.
  • params Collections: Method parameters support various collection types.
  • Implicit Span Conversion: Handle memory-safe code more naturally.

C# 14+ (Version-Specific Features)

  • Extension Members: Extension properties, operators, and static members.
  • field Keyword: Directly access backing fields in property logic.
  • Null-conditional Assignment: target?.Property = value;.
  • Scripting: Support dotnet run file.cs for direct execution.

Coding Standards

  • Clean Structure: Prioritize using File-scoped namespaces.
  • Immutability: Use record for Data Transfer Objects (DTO).
  • Performance: Use Span<T> and ReadOnlySpan<char> in critical paths.
  • Async Safety: Always pass CancellationToken, avoid .Result or .Wait().

Deliver

  • Version-Optimized Code: Provide the most appropriate modernized syntax code based on the target C# version.
  • Modernization Insights: Provide specific refactoring suggestions for upgrading from older C# syntax to new features (e.g., from nested namespaces to File-scoped namespaces).
  • Syntax Explanations: Clearly explain the design intent and syntax advantages behind the new C# features used.

Validate

  • Ensure the provided code complies with the syntax specifications of the target C# version.
  • Validate whether the code follows C# strong typing and Null safety (NRT) principles.
  • Confirm the code has good readability and best practices at the pure C# language level (e.g., proper use of Span<T>, record, etc.).

Documentation

Official References

Internal References

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.