class-organization-and-layout

按标准顺序组织类成员,类之间用空行分隔,并保持一个类一个文件的结构。适用于设计类接口、实现类、组织项目文件或建立面向对象编码规范时使用。

仓库最近推送
GitHub Stars
140
Forks
36
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "class-organization-and-layout":https://skillpi.com/zh/skills/deepskill-6af44d0c434199f43d903d6724a733808f2175b2c6aeaaff3108bad4335aa7c0。安装前核对上游来源和版本:https://github.com/kitchen-engineer42/pdf2skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

按标准顺序组织类成员,类之间用空行分隔,并保持一个类一个文件的结构。适用于设计类接口、实现类、组织项目文件或建立面向对象编码规范时使用。

0 下载

介绍来源: third_party · kitchen-engineer42 · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: class-organization-and-layout
description: Organize class members in standard order, separate classes with blank lines, and maintain one-class-per-file structure. Use when designing class interfaces, implementing classes, organizing project files, or establishing OOP coding standards.

Class Organization and Layout

Apply these principles to create consistent, maintainable class structures.

Class Interface Member Order

When to apply: When defining class interfaces in header files

Present class members in this order:

  1. Header comment: Describes the class and provides overall usage instructions
  2. Constructors and destructors
  3. Public routines
  4. Protected routines
  5. Private routines and member data

Class Implementation Member Order

When to apply: When implementing classes in source files

Organize class implementation in this order:

  1. Header comment: Describes the file contents
  2. Class data
  3. Public routines
  4. Protected routines
  5. Private routines

File-to-Class Relationship

When to apply: When organizing project files (in languages that support multiple source files)

  1. Single responsibility: Each file should contain routines supporting a single, unique purpose
  2. One-to-one relationship:
    • Place only one class per file when language permits (C++, Java, VB)
    • Exception: compelling reasons exist (e.g., several small classes forming a single pattern)
  3. File naming: Relate filename to class name (e.g., CustomerAccount class → CustomerAccount.cpp and CustomerAccount.h)
  4. Concept reinforcement: Files reinforce that grouped routines belong to the same class

Class Visual Separation

When to apply: When separating different classes within a file

  1. Use multiple blank lines to clearly identify and separate each class
  2. Avoid over-emphasis:
    • Don't mark every routine and comment with asterisk lines
    • When everything is emphasized, nothing is truly emphasized
  3. Hierarchical separation (if special characters must be used):
    • Establish character hierarchy (densest to sparsest)
    • Example: Asterisks for class separation, dashes for routine separation, blank lines for important comments
    • Never place two lines of asterisks or dashes together

Principle: In formatting, less is more.

Result

  • Class boundaries are clearly visible
  • Visual noise is minimized
  • File structure reinforces class organization
  • Members follow consistent ordering conventions

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 适用于面向对象编程的多个关键场景,包括类接口设计、实现、项目文件组织等
  • 提供了清晰的类成员排序规范和文件组织原则
触发精准85/100

亮点

  • 触发词覆盖全面,包含designing class interfaces、implementing classes、organizing project files等多种变体
  • 边界清晰,不易与其他Skill重叠
结构规范90/100

亮点

  • 结构清晰,分章节明确,每个部分都有When to apply门控
  • 提供了具体的示例和最佳实践,便于理解执行
执行可靠80/100

待提升项

  • 缺少对不可逆操作的确认机制说明 原报告严重程度:轻微

    文档中未提及在执行类重构或文件重组织时的确认机制

    改进建议:建议在File-to-Class Relationship部分增加对大规模重构操作的确认提示

亮点

  • 工具来源明确,参数正确,覆盖主要异常情况
  • 提供了清晰的执行步骤和最佳实践
证据可验 (前四项均值)83/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。