Code Style

frappe/skills/skills/code-style

作者 frappe0bef982e933705c30706efc1db3bc3bc5e7aca62无许可证收录于 2026年10月9日更新于 2026年10月9日

Code style rules for readable, maintainable implementation. Load this skill always when writing or editing code, and whenever the user asks about code style, refactoring shape, function/file size, object-oriented structure, helper ordering, or comments. For Frappe-specific work, prefer frappe-app-dev.

AI 生成的概览

提供代码风格规则,帮助写出可读、可维护的实现。

功能
该技能提供一组简短的代码风格规则,涵盖函数大小、文件长度、面向对象结构、辅助函数排序和注释风格。它只是纯说明性参考,不含脚本或资源,供编写或修改代码时加载。它产出的是指导建议,而不是文件或代码成品。
适用场景
在编写或修改代码时使用,也适用于用户询问代码风格、重构形态、函数或文件大小、面向对象结构、辅助函数排序或注释的情况。对于 Frappe 相关的工作,该技能本身建议改用其他技能。
运行要求
除智能体本身外无需其他条件;仅为说明性内容,不附带脚本。

Code Style Rules

  • Keep functions small. Split when a function has multiple jobs or needs sections to be readable.
  • Keep files under 300 lines when practical. Split by responsibility, not by arbitrary layer.
  • Prefer object-oriented code over scattered functions.
  • Put higher-order/public functions near the top of the file; keep low-level utilities at the bottom.
  • Write terse, simple English comments. Explain why something is surprising; do not narrate obvious code.
  • Do not add abstractions until there are repeated concrete uses.

来源与署名

来源:frappe/skills位于skills/code-style提交0bef982

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架