Skip to content
frappe-doctype-builder logo

Frappe DocType Builder Skill

frappe-doctype-builder

Build Frappe DocTypes with fields, permissions, and naming configurations. Use this skill when creating or modifying DocType structures.

SKILL.md

Full skill instructions

Frappe DocType Builder Skill

Build complete DocType definitions with proper field types, permissions, and configurations.

When to Use This Skill

Claude should invoke this skill when:

  • User wants to create a new DocType
  • User needs to add fields to an existing DocType
  • User asks about DocType structure or design
  • User wants to modify DocType properties
  • User needs help with DocType JSON schema

Capabilities

1. DocType JSON Generation

Create complete DocType JSON files with:

  • Metadata (name, module, naming, permissions)
  • Fields with proper types and options
  • Permissions for different roles
  • Form layout and sections
  • Naming series configuration

2. Field Type Expertise

Support all Frappe field types:

  • Data: Short text fields
  • Text: Long text with editor options
  • Int: Integer numbers
  • Float: Decimal numbers
  • Currency: Money values
  • Date: Date picker
  • Datetime: Date and time
  • Time: Time picker
  • Link: Reference to another DocType
  • Select: Dropdown with options
  • Check: Boolean checkbox
  • Table: Child table
  • Attach: File upload
  • Attach Image: Image upload with preview
  • Signature: Signature capture
  • HTML: Custom HTML content
  • Markdown Editor: Markdown content
  • Code: Code editor with syntax highlighting
  • Dynamic Link: Polymorphic references
  • Rating: Star rating
  • Color: Color picker
  • Geolocation: GPS coordinates

3. DocType Patterns

Master DocType:

{
  "name": "Customer",
  "module": "CRM",
  "autoname": "naming_series:",
  "naming_rule": "By naming series",
  "track_changes": 1,
  "is_submittable": 0
}

Transaction DocType:

{
  "name": "Sales Order",
  "module": "Selling",
  "is_submittable": 1,
  "autoname": "naming_series:",
  "track_changes": 1
}

Child Table:

{
  "name": "Sales Order Item",
  "module": "Selling",
  "istable": 1,
  "editable_grid": 1
}

Settings DocType:

{
  "name": "System Settings",
  "module": "Core",
  "issingle": 1
}

4. Common Field Patterns

Naming Series:

{
  "fieldname": "naming_series",
  "fieldtype": "Select",
  "label": "Naming Series",
  "options": "CUST-.YYYY.-\nCUST-",
  "reqd": 1
}

Status Field:

{
  "fieldname": "status",
  "fieldtype": "Select",
  "label": "Status",
  "options": "Draft\nSubmitted\nCancelled",
  "default": "Draft"
}

Link Field:

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

Child Table:

{
  "fieldname": "items",
  "fieldtype": "Table",
  "label": "Items",
  "options": "Sales Order Item",
  "reqd": 1
}

Computed Field:

{
  "fieldname": "total",
  "fieldtype": "Currency",
  "label": "Total Amount",
  "read_only": 1
}

5. Permission Configuration

{
  "permissions": [
    {
      "role": "Sales User",
      "read": 1,
      "write": 1,
      "create": 1,
      "delete": 0,
      "submit": 0,
      "cancel": 0
    },
    {
      "role": "Sales Manager",
      "read": 1,
      "write": 1,
      "create": 1,
      "delete": 1,
      "submit": 1,
      "cancel": 1
    }
  ]
}

6. Advanced Features

Dependent Fields:

{
  "fieldname": "customer_group",
  "fieldtype": "Link",
  "options": "Customer Group",
  "depends_on": "eval:doc.customer"
}

Mandatory Depends On:

{
  "fieldname": "tax_id",
  "fieldtype": "Data",
  "label": "Tax ID",
  "mandatory_depends_on": "eval:doc.country=='United States'"
}

Read Only Depends On:

{
  "fieldname": "posted_date",
  "fieldtype": "Date",
  "read_only_depends_on": "eval:doc.docstatus==1"
}

Output Format

When building a DocType, provide:

  1. Complete JSON structure
  2. Explanation of key fields
  3. Permission rationale
  4. Controller method suggestions (if needed)
  5. Migration instructions

Best Practices

  1. Naming: Use clear, descriptive field names in snake_case
  2. Required Fields: Mark essential fields as required
  3. Defaults: Provide sensible default values
  4. Permissions: Start restrictive, expand as needed
  5. Indexing: Add database indexes for frequently queried fields
  6. Validation: Use field properties for basic validation
  7. Organization: Group related fields with sections and column breaks

Integration with Controllers

After creating DocType JSON, suggest controller methods:

  • validate() - Pre-save validation
  • before_save() - Modify values before saving
  • on_submit() - Actions when document is submitted
  • on_cancel() - Actions when document is cancelled
  • on_trash() - Actions before deletion

Example Usage Flow

  1. User asks: "Create a Customer DocType with name, email, and phone"
  2. Skill generates:
    • Complete DocType JSON
    • Appropriate field types
    • Basic permissions
    • Naming configuration
  3. Output includes:
    • JSON file content
    • Where to save it (apps/<app>/​doctype/​customer/​customer.json)
    • Migration command (bench --site <site> migrate)
    • Next steps for customization

File Structure

Generated files should follow:

apps/
└── <app_name>/
    └── <module_name>/
        └── doctype/
            └── <doctype_name>/
                ├── __init__.py
                ├── <doctype_name>.json
                ├── <doctype_name>.py
                └── <doctype_name>.js

Remember: This skill is model-invoked. Claude will use it autonomously when detecting DocType-related tasks.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View