frappe-doctype
БесплатноБез исполняемых скриптовНе проверенCreate a Frappe Framework v15 DocType with proper controller, service layer, repository, and test files. Triggers: "create doctype", "new doctype", "frappe…
от sergio-bershadsky★ 15 звёзд на GitHubОб этом скилле
Frappe DocType Creation
Create a production-ready Frappe v15 DocType with complete controller implementation, service layer integration, repository pattern, and test coverage.
When to Use
- Creating a new DocType for a Frappe application
- Need proper controller with lifecycle hooks
- Want service layer for business logic separation
- Require repository for clean data access
- Building submittable/amendable documents
Arguments
/frappe-doctype <doctype_name> [--module <module>] [--submittable] [--child]
Examples:
/frappe-doctype Sales Order
/frappe-doctype Invoice Item --child
/frappe-doctype Purchase Request --submittable
Procedure
Step 1: Gather DocType Requirements
Ask the user for:
- DocType Name (Title Case, e.g., "Sales Order")
- Module (which module this belongs to)
- DocType Type:
- Standard (regular CRUD document)
- Submittable (has workflow: Draft → Submitted → Cancelled)
- Child Table (embedded in parent documents)
- Single (configuration/settings document)
- Key Fields (at least the primary fields needed)
- Naming Pattern:
- Autoname (series like
SO-.YYYY.-.#####) - Field-based (use a specific field value)
- Prompt (user enters name)
- Autoname (series like
Step 2: Analyze and Design
Based on requirements, determine:
- Field types and properties
- Link relationships to other DocTypes
- Required indexes for performance
- Permission model (roles that can access)
- Workflow requirements
Step 3: Generate DocType JSON
Create the DocType definition <doctype_folder>/<doctype_name>.json:
{
"name": "<DocType Name>",
"module": "<Module>",
"doctype": "DocType",
"naming_rule": "By \"Naming Series\" field",
"autoname": "naming_series:",
"is_submittable": 0,
"is_tree": 0,
"istable": 0,
"editable_grid": 1,
"track_changes": 1,
"track_seen": 1,
"engine": "InnoDB",
"fields": [
{
"fieldname": "naming_series",
"fieldtype": "Select",
"label": "Series",
"options": "<PREFIX>-.YYYY.-.#####",
"reqd": 1,
"in_list_view": 0
},
{
"fieldname": "title",
"fieldtype": "Data",
"label": "Title",
"reqd": 1,
"in_list_view": 1,
"in_standard_filter": 1
},
{
"fieldname": "status",
"fieldtype": "Select",
"label": "Status",
"options": "\nDraft\nPending\nCompleted\nCancelled",
"default": "Draft",
"in_list_view": 1,
"in_standard_filter": 1
},
{
"fieldname": "column_break_1",
"fieldtype": "Column Break"
},
{
"fieldname": "date",
"fieldtype": "Date",
"label": "Date",
"default": "Today",
"reqd": 1,
"in_list_view": 1
},
{
"fieldname": "section_break_details",
"fieldtype": "Section Break",
"label": "Details"
},
{
"fieldname": "description",
"fieldtype": "Text Editor",
"label": "Description"
},
{
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"options": "<DocType Name>",
"print_hide": 1,
"read_only": 1
}
],
"permissions": [
{
"role": "System Manager",
"read": 1,
"write": 1,
"create": 1,
"delete": 1,
"submit": 0,
"cancel": 0,
"amend": 0
}
],
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title"
}
Step 4: Generate Controller with v15 Type Annotations
Create <doctype_folder>/<doctype_name>.py:
# Copyright (c) <year>, <author> and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.model.docstatus import DocStatus # v15: Helper for docstatus checks
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from frappe.types import DF
# Import child table types if needed
# from <app>.<module>.doctype.<child_doctype>.<child_doctype> import <ChildDocType>
class <DocTypeName>(Document):
"""
<DocType Name> - <brief description>
Lifecycle:
Draft → (validate) → Saved → (submit) → Submitted → (cancel) → Cancelled
"""
# begin: auto-generated types
# This section is auto-generated by Frappe. Do not modify manually.
if TYPE_CHECKING:
amended_from: DF.Link | None
date: DF.Date
description: DF.TextEditor | None
naming_series: DF.Literal["<PREFIX>-.YYYY.-.#####"]
status: DF.Literal["", "Draft", "Pending", "Completed", "Cancelled"]
title: DF.Data
# end: auto-generated types
def before_validate(self) -> None:
"""Auto-set default values before validation."""
self._set_defaults()
def validate(self) -> None:
"""Validate document before save. Throw exception to prevent saving."""
self._validate_business_rules()
def before_save(self) -> None:
"""Called befor
Установить frappe-doctype в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл frappe-doctype?
Create a Frappe Framework v15 DocType with proper controller, service layer, repository, and test files. Triggers: "create doctype", "new doctype", "frappe doctype", "add doctype", "/frappe-doctype". Generates production-ready DocType with type annotations, lifecycle hooks, and multi-layer architecture integration.
Как установить скилл frappe-doctype?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл frappe-doctype запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic