Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计提醒

frappe-doctype-development冰沙文档类型开发

Agent Skill

frappe-doctype-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,599

周安装

68

GitHub Stars

16

下载量

560
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frappe-doctype-development(冰沙文档类型开发)
来源仓库:https://github.com/lubusin/agent-skills
仓库路径:skills/frappe-doctype-development
安装命令:
npx skills add https://github.com/lubusin/agent-skills --skill frappe-doctype-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lubusin/agent-skills --skill frappe-doctype-development

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在需要围绕仓库状态或代码变更进行整理时使用。frappe-doctype-development 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发不必要操作。
  • 注意是否会触发联网、命令执行或文件读写,确保安全使用。

SKILL.md

Frappe DocType Development

Build and modify DocTypes—the core data model abstraction in Frappe Framework.

When to use

  • Creating new DocTypes (standard, single, child table, submittable, tree)
  • Adding or modifying fields on existing DocTypes
  • Implementing controller logic (validate, before_save, on_submit, etc.)
  • Setting up naming series and auto-naming
  • Configuring permissions and workflows
  • Building child tables and parent-child relationships

Inputs required

  • Target app and module path
  • DocType name and type (standard/single/child/submittable/tree)
  • Field definitions (name, type, options)
  • Permission requirements by role
  • Whether workflow is needed

Procedure

0) Verify environment

# Ensure developer mode is enabled
bench --site <site> console
>>> frappe.conf.developer_mode  # Must be True

1) Choose DocType type

TypeUse CaseKey Setting
StandardMultiple recordsDefault
SingleConfig/settings (one record)issingle: 1
Child TableRows in parent tableistable: 1
SubmittableDraft→Submit→Cancel workflowis_submittable: 1
TreeHierarchical datais_tree: 1
VirtualExternal data sourceis_virtual: 1

2) Create DocType

Option A: Via UI (recommended for new DocTypes)

  1. Navigate to DocType List → New
  2. Define fields, permissions, settings
  3. Save (exports to app in developer mode)

Option B: Via code

# Create DocType JSON in:
# <app>/<module>/doctype/<doctype_name>/<doctype_name>.json

3) Define fields

Common field patterns:

{
  "fieldname": "customer",
  "fieldtype": "Link",
  "label": "Customer",
  "options": "Customer",
  "reqd": 1
}

See references/field-types.md for all field types.

4) Implement controller

Create <doctype_name>.py alongside the JSON:

import frappe
from frappe.model.document import Document

class MyDocType(Document):
    def validate(self):
        # Lightweight validation
        if not self.customer:
            frappe.throw("Customer is required")

    def before_save(self):
        # Pre-save normalization
        self.full_name = f"{self.first_name} {self.last_name}"

    def after_insert(self):
        # Post-create side effects
        frappe.publish_realtime("new_doc", {"name": self.name})

5) Set up naming

{
  "autoname": "naming_series:",
  "fields": [
    {
      "fieldname": "naming_series",
      "fieldtype": "Select",
      "options": "PRJ-.YYYY.-\nPRJ-.YYYY.-.###"
    }
  ]
}

Options: field:fieldname, naming_series:, hash, format:PREFIX-{####}

6) Configure permissions

Set in DocType → Permissions tab:

  • Role + Read/Write/Create/Delete/Submit/Cancel
  • User permissions for row-level filtering

7) Add workflow (if needed)

Create Workflow DocType linking to your DocType with states and transitions.

Verification

  • DocType appears in list and can create new records
  • All fields save correctly
  • Controller hooks fire (check logs)
  • Permissions enforced for each role
  • Naming series generates correctly
  • Run: bench --site <site> migrate succeeds

Failure modes / debugging

  • DocType not found: Check module path and app installation
  • Controller not loading: Verify class name matches DocType name (PascalCase)
  • Fields not saving: Check fieldtype and options compatibility
  • Permission denied: Verify role permissions and User Permissions

Escalation

References

Guardrails

  • Check developer_mode before schema changes: DocType modifications only export to files when developer_mode = 1 in site config
  • Verify naming series uniqueness: Ensure naming series prefixes don't conflict with existing DocTypes
  • Test child tables separately: Child tables have their own lifecycle; test them in isolation before parent integration
  • Always run migrate after changes: Schema changes require bench --site <site> migrate to apply
  • Validate fieldname conventions: Use snake_case, max 140 chars, no reserved SQL keywords

Common Mistakes

MistakeWhy It FailsFix
Missing reqd on mandatory fieldsUsers can save incomplete dataSet reqd: 1 on fields that must have values
Wrong fieldtype for dataData truncation or validation errorsMatch fieldtype to data (e.g., Currency for money, not Float)
Not running bench migrateSchema changes not applied to databaseAlways run bench --site <site> migrate after DocType changes
Circular Link dependenciesDocType creation failsUse Dynamic Link or restructure relationships
Controller class name mismatchController methods not calledClass name must be PascalCase of DocType name (e.g., SalesOrder for "Sales Order")
Missing in_list_view on key fieldsFields not visible in listSet in_list_view: 1 on important fields

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.76%
按下载量换算200

Claude

28.7%
按下载量换算161

Cursor

20.26%
按下载量换算113

Gemini CLI

8.9%
按下载量换算50

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills