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.
View on GitHubFebruary 2, 2026
Select agents to install to:
npx add-skill https://github.com/sergio-bershadsky/ai/blob/main/plugins/frappe-dev/skills/frappe-doctype/SKILL.md -a claude-code --skill frappe-doctypeInstallation paths:
.claude/skills/frappe-doctype/# 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:
1. **DocType Name** (Title Case, e.g., "Sales Order")
2. **Module** (which module this belongs to)
3. **DocType Type:**
- Standard (regular CRUD document)
- Submittable (has workflow: Draft → Submitted → Cancelled)
- Child Table (embedded in parent documents)
- Single (configuration/settings document)
4. **Key Fields** (at least the primary fields needed)
5. **Naming Pattern:**
- Autoname (series like `SO-.YYYY.-.#####`)
- Field-based (use a specific field value)
- Prompt (user enters name)
### 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`:
```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",
"la