AgentSkillsCN

applying-sun-lab-style

在编写、审查或重构代码时,遵循 Sun Lab 的 C# 与 Unity 编码规范。涵盖 .cs 文件、XML 文档注释、命名规范、MQTT 设计模式、README.md 文件、git 提交信息,以及 YAML 任务模板。当在 Sun Lab 项目中编写或修改任何 .cs、.md 或 .yaml 文件时,可使用此规范。

SKILL.md
--- frontmatter
name: applying-sun-lab-style
description: >-
  Applies Sun Lab C# and Unity coding conventions when writing, reviewing, or refactoring code. Covers
  .cs files, XML documentation, naming conventions, MQTT patterns, README.md files, git commit messages,
  and YAML task templates. Use when writing or modifying any .cs, .md, or .yaml files in Sun Lab projects.

Sun Lab Style Guide

Applies Sun Lab coding and documentation conventions.

You MUST read the appropriate style guide and apply its conventions when writing or modifying any code, documentation, commits, or skills. You MUST verify your changes against the style guide's checklist before submitting.


Style Guides

GuideUse When
CSHARP_STYLE.mdWriting C# code (naming, formatting, XML docs, inline comments, patterns)
README_STYLE.mdCreating or updating README files
COMMIT_STYLE.mdWriting git commit messages
SKILL_STYLE.mdCreating Claude skills or YAML task templates

Quick Reference

C# Code (includes API docs and inline comments)

  • XML Documentation: Triple-slash /// with <summary>, <param>, <returns> tags
  • Prose Over Lists: Use prose in all documentation; bullet lists are forbidden in code comments
  • Inline Comments: Third person imperative, above the code, explain non-obvious logic
  • Naming: Private fields _camelCase, public members PascalCase
  • Brace Style: Allman (braces on new lines)
  • Line Length: Maximum 120 characters
  • Formatting: Run csharpier . before committing

Commit Messages

  • Start with past tense verb: Added, Fixed, Updated, Refactored, Removed
  • Header line ≤ 72 characters
  • End with a period

README Files

  • Third person voice throughout
  • Present tense as default

Skills & Templates

  • SKILL.md frontmatter: name (gerund form), description (third person)
  • YAML templates: Header with Project, Purpose, Layout, Related fields
  • Line length ≤ 120 characters