Code Style

frappe/skills/skills/code-style

作者 frappe0bef982e933705c30706efc1db3bc3bc5e7aca62無授權條款147 個星標收錄於 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 從公開儲存庫中收錄這些內容。

檢舉或申請下架