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.
技能詳細資訊
Slug gh-frappe-skills-code-style-skills-code-style-9471087146313abe
名稱 code-style
作者 frappe
類型 僅含說明
信任等級 社群
收錄時間 2026年10月9日
更新時間 2026年10月9日 提供程式碼風格規則,協助寫出可讀、可維護的實作。
功能 此技能提供一組簡短的程式碼風格規則,涵蓋函式大小、檔案長度、物件導向結構、輔助函式排序與註解風格。它只是純說明性參考,不含指令碼或資源,供撰寫或修改程式碼時載入。它產出的是指引建議,而非檔案或程式碼成品。
適用情境 在撰寫或修改程式碼時使用,也適用於使用者詢問程式碼風格、重構形態、函式或檔案大小、物件導向結構、輔助函式排序或註解的情況。對於 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.